// Context part 29

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7935 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2011-08-08 13:17:12 +00:00
parent 89cc9649cf
commit 653ef8d115
40 changed files with 195 additions and 360 deletions
+1 -4
View File
@@ -1028,10 +1028,7 @@ class CategoryCore extends ObjectModel
public static function getCategoryInformations($ids_category, $id_lang = null)
{
if ($id_lang === null)
{
global $cookie;
$id_lang = $cookie->id_lang;
}
$id_lang = Context::getContext()->language->id;
if (!is_array($ids_category) || !sizeof($ids_category))
return;
+1 -3
View File
@@ -477,8 +477,6 @@ abstract class ModuleCore
*/
public static function getModuleNameFromClass($currentClass)
{
global $cookie;
// Module can now define AdminTab keeping the module translations method,
// i.e. in modules/[module name]/[iso_code].php
if (!isset(self::$classInModule[$currentClass]))
@@ -918,7 +916,7 @@ abstract class ModuleCore
global $_MODULES, $_MODULE;
if ($id_lang == null)
$id_lang = (!isset($cookie) OR !is_object($cookie)) ? (int)(Configuration::get('PS_LANG_DEFAULT')) : (int)($cookie->id_lang);
$id_lang = Context::getContext()->language->id;
$file = _PS_MODULE_DIR_.$this->name.'/'.Context::getContext()->language->iso_code.'.php';
if (Tools::file_exists_cache($file) AND include_once($file))
+1 -2
View File
@@ -90,7 +90,6 @@ class ToolsCore
*/
public static function redirectLink($url)
{
$context = Context::getContext();
if (!preg_match('@^https?://@i', $url))
{
if (strpos($url, __PS_BASE_URI__) !== FALSE && strpos($url, __PS_BASE_URI__) == 0)
@@ -98,7 +97,7 @@ class ToolsCore
if (strpos($url, 'index.php?controller=') !== FALSE && strpos($url, 'index.php/') == 0)
$url = substr($url, strlen('index.php?controller='));
$explode = explode('?', $url);
$url = $context->link->getPageLink($explode[0]);
$url = Context::getContext()->link->getPageLink($explode[0]);
if (isset($explode[1]))
$url .= '?'.$explode[1];
}