Merge branch 'catalog'

Conflicts:
	core/lib/Thelia/Config/Resources/config.xml
	core/lib/Thelia/Config/Resources/routing/admin.xml
	core/lib/Thelia/Core/Template/Loop/Country.php
	core/lib/Thelia/Core/Template/Smarty/Plugins/Form.php
	core/lib/Thelia/Model/Country.php
	core/lib/Thelia/Model/Profile.php
	core/lib/Thelia/Model/ProfileQuery.php
	install/insert.sql
	install/thelia.sql
	local/config/schema.xml
This commit is contained in:
Franck Allimant
2013-10-24 00:16:33 +02:00
38 changed files with 3324 additions and 1903 deletions

View File

@@ -0,0 +1,52 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
namespace Thelia\Tools;
use Symfony\Component\HttpFoundation\Request;
class NumberFormat
{
protected $request;
public function __construct(Request $request)
{
$this->request = $request;
}
public static function getInstance(Request $request)
{
return new NumberFormat($request);
}
public function format($number, $decimals = null, $decPoint = null, $thousandsSep = null)
{
$lang = $this->request->getSession()->getLang();
if ($decimals == null) $decimals = $lang->getDecimals();
if ($decPoint == null) $decPoint = $lang->getDecimalSeparator();
if ($thousandsSep == null) $thousandsSep = $lang->getThousandsSeparator();
return number_format($number, $decimals, $decPoint, $thousandsSep);
}
}