// Translations for helper
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11585 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+31
-1
@@ -2077,6 +2077,37 @@ FileETag INode MTime Size
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @params string $path Path to scan
|
||||
* @params string $ext Extention to filter files
|
||||
* @params string $dir Add this to prefix output for example /path/dir/*
|
||||
*
|
||||
* @return array List of file found
|
||||
* @since 1.5.0
|
||||
*/
|
||||
public static function scandir($path, $ext = 'php', $dir = '')
|
||||
{
|
||||
$real_path = $path.$dir;
|
||||
$files = scandir($real_path);
|
||||
if (!$files)
|
||||
return array();
|
||||
|
||||
$filtered_files = array();
|
||||
|
||||
$real_ext = '';
|
||||
if (!empty($ext))
|
||||
$real_ext = '.' . $ext;
|
||||
|
||||
$real_ext_length = strlen($real_ext);
|
||||
|
||||
foreach ($files as $file)
|
||||
if (strpos($file, $real_ext) && strpos($file, $real_ext) == (strlen($file) - $real_ext_length))
|
||||
$filtered_files[] = $dir . '/' . $file;
|
||||
//elog($filtered_files);
|
||||
return $filtered_files;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2104,4 +2135,3 @@ function cmpPriceDesc($a,$b)
|
||||
return (-1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ class HelperListCore extends Helper
|
||||
/* Append when we get a syntax error in SQL query */
|
||||
if ($list === false)
|
||||
{
|
||||
$this->displayWarning($this->l('Bad SQL query'));
|
||||
$this->displayWarning($this->l('Bad SQL query', 'helper'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -349,10 +349,10 @@ class HelperListCore extends Helper
|
||||
{
|
||||
$tpl = $this->createTemplate('list_action_duplicate.tpl');
|
||||
if (!array_key_exists('Duplicate', self::$cache_lang))
|
||||
self::$cache_lang['Duplicate'] = $this->l('Duplicate');
|
||||
self::$cache_lang['Duplicate'] = $this->l('Duplicate', 'helper');
|
||||
|
||||
if (!array_key_exists('Copy images too?', self::$cache_lang))
|
||||
self::$cache_lang['Copy images too?'] = $this->l('Copy images too?', __CLASS__, true, false);
|
||||
self::$cache_lang['Copy images too?'] = $this->l('Copy images too?', 'helper');
|
||||
|
||||
$duplicate = $this->currentIndex.'&'.$this->identifier.'='.$id.'&duplicate'.$this->table;
|
||||
|
||||
@@ -391,7 +391,7 @@ class HelperListCore extends Helper
|
||||
{
|
||||
$tpl = $this->createTemplate('list_action_details.tpl');
|
||||
if (!array_key_exists('Details', self::$cache_lang))
|
||||
self::$cache_lang['Details'] = $this->l('Details');
|
||||
self::$cache_lang['Details'] = $this->l('Details', 'helper');
|
||||
$tpl->assign(array(
|
||||
'id' => $id,
|
||||
'controller' => str_replace('Controller', '', get_class($this->context->controller)),
|
||||
@@ -409,7 +409,7 @@ class HelperListCore extends Helper
|
||||
{
|
||||
$tpl = $this->createTemplate('list_action_view.tpl');
|
||||
if (!array_key_exists('View', self::$cache_lang))
|
||||
self::$cache_lang['View'] = $this->l('View');
|
||||
self::$cache_lang['View'] = $this->l('View', 'helper');
|
||||
|
||||
$tpl->assign(array(
|
||||
'href' => $this->currentIndex.'&'.$this->identifier.'='.$id.'&view'.$this->table.'&token='.($token != null ? $token : $this->token),
|
||||
@@ -427,7 +427,7 @@ class HelperListCore extends Helper
|
||||
{
|
||||
$tpl = $this->createTemplate('list_action_edit.tpl');
|
||||
if (!array_key_exists('Edit', self::$cache_lang))
|
||||
self::$cache_lang['Edit'] = $this->l('Edit');
|
||||
self::$cache_lang['Edit'] = $this->l('Edit', 'helper');
|
||||
|
||||
$tpl->assign(array(
|
||||
'href' => $this->currentIndex.'&'.$this->identifier.'='.$id.'&update'.$this->table.'&token='.($token != null ? $token : $this->token),
|
||||
@@ -447,20 +447,20 @@ class HelperListCore extends Helper
|
||||
$tpl = $this->createTemplate('list_action_delete.tpl');
|
||||
|
||||
if (!array_key_exists('Delete', self::$cache_lang))
|
||||
self::$cache_lang['Delete'] = $this->l('Delete');
|
||||
self::$cache_lang['Delete'] = $this->l('Delete', 'helper');
|
||||
|
||||
if (!array_key_exists('DeleteItem', self::$cache_lang))
|
||||
self::$cache_lang['DeleteItem'] = $this->l('Delete selected item ?', __CLASS__, true, false);
|
||||
self::$cache_lang['DeleteItem'] = $this->l('Delete selected item ?', 'helper');
|
||||
|
||||
if (!array_key_exists('Name', self::$cache_lang))
|
||||
self::$cache_lang['Name'] = $this->l('Name:');
|
||||
self::$cache_lang['Name'] = $this->l('Name:', 'helper');
|
||||
|
||||
if (!is_null($name))
|
||||
$name = '\n\n'.self::$cache_lang['Name'].' '.$name;
|
||||
|
||||
$tpl->assign(array_merge($this->tpl_delete_link_vars, array(
|
||||
'href' => $this->currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&token='.($token != null ? $token : $this->token),
|
||||
'confirm' => (!is_null($this->specificConfirmDelete) ? '\r'.$this->specificConfirmDelete : self::$cache_lang['DeleteItem'].$name.' \n'.$this->l('ID:').' '.$id),
|
||||
'confirm' => (!is_null($this->specificConfirmDelete) ? '\r'.$this->specificConfirmDelete : self::$cache_lang['DeleteItem'].$name.' \n'.$this->l('ID:', 'helper').' '.$id),
|
||||
'action' => self::$cache_lang['Delete'],
|
||||
'id' => $id,
|
||||
)));
|
||||
@@ -475,7 +475,7 @@ class HelperListCore extends Helper
|
||||
{
|
||||
$tpl = $this->createTemplate('list_action_default.tpl');
|
||||
if (!array_key_exists('Default', self::$cache_lang))
|
||||
self::$cache_lang['Default'] = $this->l('Default');
|
||||
self::$cache_lang['Default'] = $this->l('Default', 'helper');
|
||||
|
||||
$tpl->assign(array_merge($this->tpl_delete_link_vars, array(
|
||||
'href' => $this->currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&token='.($token != null ? $token : $this->token),
|
||||
|
||||
+499
-718
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user