Skip to content

Commit

Permalink
// fixed translations problems due to r11899
Browse files Browse the repository at this point in the history
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11910 b9a71923-0436-4b27-9f14-aed3839534dd
  • Loading branch information
bmancone committed Dec 29, 2011
1 parent 95092cd commit b837a7c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions controllers/admin/AdminStockManagementController.php
Expand Up @@ -1072,7 +1072,7 @@ public function displayAddstockLink($token = null, $id)
'action' => self::$cache_lang['AddStock'],
));

return $this->context->smarty->fetch(_PS_ADMIN_DIR_.'/themes/template/helper/list/list_action_addstock.tpl');
return $this->context->smarty->fetch('helper/list/list_action_addstock.tpl');
}

/**
Expand All @@ -1093,7 +1093,7 @@ public function displayRemovestockLink($token = null, $id)
'action' => self::$cache_lang['RemoveStock'],
));

return $this->context->smarty->fetch(_PS_ADMIN_DIR_.'/themes/template/helper/list/list_action_removestock.tpl');
return $this->context->smarty->fetch('helper/list/list_action_removestock.tpl');
}

/**
Expand All @@ -1114,6 +1114,6 @@ public function displayTransferstockLink($token = null, $id)
'action' => self::$cache_lang['TransferStock'],
));

return $this->context->smarty->fetch(_PS_ADMIN_DIR_.'/themes/template/helper/list/list_action_transferstock.tpl');
return $this->context->smarty->fetch('helper/list/list_action_transferstock.tpl');
}
}
6 changes: 3 additions & 3 deletions controllers/admin/AdminSupplyOrdersController.php
Expand Up @@ -1306,7 +1306,7 @@ public function displayUpdateReceiptLink($token = null, $id)
'action' => self::$cache_lang['Receipt'],
));

return $this->context->smarty->fetch(_PS_ADMIN_DIR_.'/themes/template/helper/list/list_action_supply_order_receipt.tpl');
return $this->context->smarty->fetch('helper/list/list_action_supply_order_receipt.tpl');
}

/**
Expand All @@ -1327,7 +1327,7 @@ public function displayChangestateLink($token = null, $id)
'action' => self::$cache_lang['State'],
));

return $this->context->smarty->fetch(_PS_ADMIN_DIR_.'/themes/template/helper/list/list_action_supply_order_change_state.tpl');
return $this->context->smarty->fetch('helper/list/list_action_supply_order_change_state.tpl');
}

/**
Expand All @@ -1352,7 +1352,7 @@ public function displayCreateSupplyOrderLink($token = null, $id)
'action' => self::$cache_lang['CreateSupplyOrder'],
));

return $this->context->smarty->fetch(_PS_ADMIN_DIR_.'/themes/template/helper/list/list_action_supply_order_create_from_template.tpl');
return $this->context->smarty->fetch('helper/list/list_action_supply_order_create_from_template.tpl');
}

/**
Expand Down
9 changes: 6 additions & 3 deletions controllers/admin/AdminTranslationsController.php
Expand Up @@ -974,7 +974,7 @@ public function initFormBack($lang)
}

/* List templates to parse */
$templates = $this->listFiles(_PS_ADMIN_DIR_.DIRECTORY_SEPARATOR.'themes'.DIRECTORY_SEPARATOR.'template');
$templates = $this->listFiles(_PS_ADMIN_DIR_.DIRECTORY_SEPARATOR.'themes');
foreach ($templates as $template)
if (preg_match('/^(.*).tpl$/', $template))
{
Expand All @@ -983,13 +983,16 @@ public function initFormBack($lang)

// get controller name instead of file name
$prefix_key = Tools::toCamelCase(str_replace(_PS_ADMIN_DIR_.DIRECTORY_SEPARATOR.'themes'.DIRECTORY_SEPARATOR.'template'.DIRECTORY_SEPARATOR, '', $tpl), true);
$prefix_key = 'Admin'.substr($prefix_key, 0, strpos($prefix_key, DIRECTORY_SEPARATOR));
$pos = strrpos($prefix_key, DIRECTORY_SEPARATOR);
$tmp = substr($prefix_key, 0, $pos);
$prefix_key = 'Admin'.ucfirst(substr($tmp, strrpos($tmp, DIRECTORY_SEPARATOR) + 1, $pos));

if ($prefix_key == 'AdminHelper')
$prefix_key = 'Helper';

// @todo retrompatibility : we assume here than files directly in template/
// use the prefix "AdminController" (like old php files 'header', 'footer.inc', 'index', 'login', 'password', 'functions'
if ( $prefix_key == 'Admin')
if ( $prefix_key == 'Admin' || $prefix_key == 'AdminTemplate')
$prefix_key = 'AdminController';
// and helpers in helper

Expand Down

0 comments on commit b837a7c

Please sign in to comment.