// fix norm

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9073 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
aFolletete committed 2011-10-05 15:45:57 +00:00
1 parent 23c5f297ce
commit 9d063a0a67
2 files changed
+52 -21

No files matched your search

+26 -20
View File
@@ -27,6 +27,7 @@
/* /*
* TODO : move HTML code in template files * TODO : move HTML code in template files
* TODO : phpDoc on two last methods: includeDatepicker() & bindDatepicker()
*/ */
class HelperCore class HelperCore
@@ -200,18 +201,18 @@ class HelperCore
return rtrim($html, ' '); return rtrim($html, ' ');
} }
function bindDatepicker($id, $time) public function bindDatepicker($id, $time = false)
{ {
if ($time) if ($time)
echo ' echo '
var dateObj = new Date(); var dateObj = new Date();
var hours = dateObj.getHours(); var hours = dateObj.getHours();
var mins = dateObj.getMinutes(); var mins = dateObj.getMinutes();
var secs = dateObj.getSeconds(); var secs = dateObj.getSeconds();
if (hours < 10) { hours = "0" + hours; } if (hours < 10) { hours = "0" + hours; }
if (mins < 10) { mins = "0" + mins; } if (mins < 10) { mins = "0" + mins; }
if (secs < 10) { secs = "0" + secs; } if (secs < 10) { secs = "0" + secs; }
var time = " "+hours+":"+mins+":"+secs;'; var time = " "+hours+":"+mins+":"+secs;';
echo ' echo '
$(function() { $(function() {
@@ -223,18 +224,23 @@ class HelperCore
} }
// id can be a identifier or an array of identifiers // id can be a identifier or an array of identifiers
function includeDatepicker($id, $time = false) public function includeDatepicker($id, $time = false)
{ {
echo '<script type="text/javascript" src="'.__PS_BASE_URI__.'js/jquery/jquery-ui-1.8.10.custom.min.js"></script>';
$iso = Db::getInstance()->getValue('SELECT iso_code FROM '._DB_PREFIX_.'lang WHERE `id_lang` = '.(int)Context::getContext()->language->id); $iso = Db::getInstance()->getValue('SELECT iso_code FROM '._DB_PREFIX_.'lang WHERE `id_lang` = '.(int)Context::getContext()->language->id);
if ($iso != 'en') if (!$iso)
echo '<script type="text/javascript" src="'.__PS_BASE_URI__.'js/jquery/datepicker/ui/i18n/ui.datepicker-'.$iso.'.js"></script>'; $iso = 'en';
echo '<script type="text/javascript">'; // TODO : change in order to use Media::addJqueryUi()
if (is_array($id)) echo '
foreach ($id as $id2) <script type="text/javascript" src="'.__PS_BASE_URI__.'js/jquery/jquery-ui-1.8.10.custom.min.js"></script>
bindDatepicker($id2, $time); <script type="text/javascript" src="'.__PS_BASE_URI__.'js/jquery/datepicker/ui/i18n/ui.datepicker-'.$iso.'.js"></script>
else <script type="text/javascript">';
bindDatepicker($id, $time);
if (is_array($id))
foreach ($id as $id2)
bindDatepicker($id2, $time);
else
bindDatepicker($id, $time);
echo '</script>'; echo '</script>';
} }
} }
+26 -1
View File
@@ -1,4 +1,30 @@
<?php <?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
class HelperListCore extends Helper class HelperListCore extends Helper
{ {
/** @var array Cache for query results */ /** @var array Cache for query results */
@@ -35,7 +61,6 @@ class HelperListCore extends Helper
public $token; public $token;
protected $is_cms = false; protected $is_cms = false;
protected $is_dnd_identifier = false; protected $is_dnd_identifier = false;