'.$this->l('How-to restore a database Backup in 10 easy steps').'
-
-
'.$this->l('Turn off the "Enable Shop" option in the "Preferences" tab.').'
-
'.$this->l('Download the Backup from the list below or from your FTP server (in the folder "admin/backups").').'
-
'.$this->l('Check the Backup integrity: look for errors, incomplete file. Verify all your data.').'
-
'.$this->l('Ask your hosting provider for a "phpMyAdmin" access to your database').'
-
'.$this->l('Connect to "phpMyAdmin" and select your current database').'
-
'.$this->l('Unless you enabled the "Drop existing tables" option, you must delete all tables from your current database.').'
-
'.$this->l('At the top of the screen select the tab "Import"').'
-
'.$this->l('Click on the "Browse..." button and select the Backup file from your hard drive').'
-
'.$this->l('Check the max. allowed filesize (ie. Max: 16Mb)').' '.$this->l('If your Backup file exceeds this limit, contact your hosting provider').'
-
'.$this->l('Click on the "Go" button and wait during the import, the process can take several minutes').'
-
-
- ';
- }
-
- public function displayList()
- {
- // Test if the backup dir is writable
- if(!is_writable(_PS_ADMIN_DIR_.'/backups/'))
- $this->displayWarning($this->l('"Backups" Directory in admin directory must be writeable (CHMOD 755 / 777)'));
-
- $this->displayErrors();
- $this->displayHowTo();
-
- parent::displayList();
- }
-
- public function getList($id_lang, $orderBy = NULL, $orderWay = NULL, $start = 0, $limit = NULL, $id_lang_shop = NULL)
- {
-
- if (!Validate::isTableOrIdentifier($this->table))
- die('filter is corrupted');
- if (empty($orderBy))
- $orderBy = Tools::getValue($this->table.'Orderby', $this->_defaultOrderBy);
- if (empty($orderWay))
- $orderWay = Tools::getValue($this->table.'Orderway', 'ASC');
-
- // Try and obtain getList arguments from $_GET
- $orderBy = Tools::getValue($this->table.'Orderby');
- $orderWay = Tools::getValue($this->table.'Orderway');
-
- // Validate the orderBy and orderWay fields
- switch ($orderBy)
- {
- case 'filename':
- case 'filesize':
- case 'date':
- case 'age':
- break;
- default:
- $orderBy = 'date';
- }
- switch ($orderWay)
- {
- case 'asc':
- case 'desc':
- break;
- default:
- $orderWay = 'desc';
- }
- if (empty($limit))
- $limit = ((!isset($this->context->cookie->{$this->table.'_pagination'})) ? $this->_pagination[0] : $limit = $this->context->cookie->{$this->table.'_pagination'});
- $limit = (int)(Tools::getValue('pagination', $limit));
- $this->context->cookie->{$this->table.'_pagination'} = $limit;
-
- /* Determine offset from current page */
- if (!empty($_POST['submitFilter'.$this->table]) AND is_numeric($_POST['submitFilter'.$this->table]))
- $start = (int)($_POST['submitFilter'.$this->table] - 1) * $limit;
- $this->_lang = (int)($id_lang);
- $this->_orderBy = $orderBy;
- $this->_orderWay = strtoupper($orderWay);
- $this->_list = array();
-
- // Find all the backups
- $dh = @opendir(_PS_ADMIN_DIR_.'/backups/');
- if ($dh === false)
- {
- $this->_errors[] = Tools::displayError('Unable to open backup directory .').addslashes(_PS_ADMIN_DIR_.'/backups/').'"';
- return;
- }
- while (($file = readdir($dh)) !== false)
- {
- if (preg_match('/^([\d]+-[a-z\d]+)\.sql(\.gz|\.bz2)?$/', $file, $matches) == 0)
- continue;
- $timestamp = (int)($matches[1]);
- $date = date('Y-m-d H:i:s', $timestamp);
- $age = time() - $timestamp;
- if ($age < 3600)
- $age = '< 1 '.$this->l('hour');
- else if ($age < 86400)
- {
- $age = floor($age / 3600);
- $age = $age.' '.(($age == 1) ? $this->l('hour') : $this->l('hours'));
- }
- else
- {
- $age = floor($age / 86400);
- $age = $age.' '.(($age == 1) ? $this->l('day') : $this->l('days'));
- }
- $size = filesize(_PS_ADMIN_DIR_.'/backups/'.$file);
- $this->_list[] = array(
- 'filename' => $file,
- 'age' => $age,
- 'date' => $date,
- 'filesize' => number_format($size / 1000, 2).' Kb',
- 'timestamp' => $timestamp,
- 'filesize_sort' => $size,
- );
- }
- closedir($dh);
- $this->_listTotal = count($this->_list);
-
- // Sort the _list based on the order requirements
- switch ($this->_orderBy)
- {
- case 'filename':
- $this->_sortBy = 'filename';
- $sorter = 'str_sort';
- break;
- case 'filesize':
- $this->_sortBy = 'filesize_sort';
- $sorter = 'int_sort';
- break;
- case 'age':
- case 'date':
- $this->_sortBy = 'timestamp';
- $sorter = 'int_sort';
- break;
- }
- usort($this->_list, array($this, $sorter));
- $this->_list = array_slice($this->_list, $start, $limit);
- }
-
- public function int_sort($a, $b)
- {
- return $this->_orderWay == 'ASC' ? $a[$this->_sortBy] - $b[$this->_sortBy] : $b[$this->_sortBy] - $a[$this->_sortBy];
- }
-
- public function str_sort($a, $b)
- {
- return $this->_orderWay == 'ASC' ? strcmp($a[ $this->_sortBy], $b[$this->_sortBy]) : strcmp($b[ $this->_sortBy], $a[$this->_sortBy]);
- }
-}
diff --git a/admin-dev/themes/template/backup/content.tpl b/admin-dev/themes/template/backup/content.tpl
new file mode 100644
index 000000000..0034dc011
--- /dev/null
+++ b/admin-dev/themes/template/backup/content.tpl
@@ -0,0 +1,77 @@
+{*
+* 2007-2011 PrestaShop
+*
+* NOTICE OF LICENSE
+*
+* This source file is subject to the Academic Free License (AFL 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/afl-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
+* @copyright 2007-2011 PrestaShop SA
+* @version Release: $Revision$
+* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*}
+
+{if isset($download)}
+
+{/if}
+
+{if isset($how_to)}
+
+
{l s='Disclaimer before creating a new Backup'}
+
+
{l s='PrestaShop is not responsible for your database, Backups, restore and data.'}
+
{l s='PrestaShop is an Open-source software, you are using it at your own risk under the licence agreement.'}
+
{l s='You should Backup your data on a regular basis (both files and database).'}
+
{l s='This function only backs up your database, not your files.'}
+
{l s='By default, your existing database tables will be deleted during Backup restore (see options).'}
+
{l s='Always verify the quality and integrity of your Backups files.'}
+
{l s='Always verify that your Backups files are complete, up-to-date and valid. Even if you had a success message during the Backup process.'}
+
{l s='Always check your data.'}
+
{l s='Never restore a Backup on a live site.'}
+
+
+ {if $show_form}
+
+ {/if}
+
+
+
{l s='How-to restore a database Backup in 10 easy steps'}
+
+
{l s='Turn off the "Enable Shop" option in the "Preferences" tab.'}
+
{l s='Download the Backup from the list below or from your FTP server (in the folder "admin/backups").'}
+
{l s='Check the Backup integrity: look for errors, incomplete file. Verify all your data.'}
+
{l s='Ask your hosting provider for a "phpMyAdmin" access to your database'}
+
{l s='Connect to "phpMyAdmin" and select your current database'}
+
{l s='Unless you enabled the "Drop existing tables" option, you must delete all tables from your current database.'}
+
{l s='At the top of the screen select the tab "Import"'}
+
{l s='Click on the "Browse..." button and select the Backup file from your hard drive'}
+
{l s='Check the max. allowed filesize (ie. Max: 16Mb)'} {l s='If your Backup file exceeds this limit, contact your hosting provider'}
+
{l s='Click on the "Go" button and wait during the import, the process can take several minutes'}
+
+
+
+{/if}
+{if isset($download)}
+
{l s='Back to list'}
+{/if}
+
+{$content}
diff --git a/admin-dev/themes/template/backup/view.tpl b/admin-dev/themes/template/backup/view.tpl
new file mode 100644
index 000000000..596c20197
--- /dev/null
+++ b/admin-dev/themes/template/backup/view.tpl
@@ -0,0 +1,33 @@
+{*
+* 2007-2011 PrestaShop
+*
+* NOTICE OF LICENSE
+*
+* This source file is subject to the Academic Free License (AFL 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/afl-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
+* @copyright 2007-2011 PrestaShop SA
+* @version Release: $Revision$
+* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*}
+
+
{l s='Beginning download ...'}
+ {l s='Back-up file should automatically download.'}
+
{l s='Back to list'}
+
+
diff --git a/admin-dev/themes/template/images/content.tpl b/admin-dev/themes/template/images/content.tpl
new file mode 100644
index 000000000..6437bb354
--- /dev/null
+++ b/admin-dev/themes/template/images/content.tpl
@@ -0,0 +1,104 @@
+{*
+* 2007-2011 PrestaShop
+*
+* NOTICE OF LICENSE
+*
+* This source file is subject to the Academic Free License (AFL 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/afl-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
+* @copyright 2007-2011 PrestaShop SA
+* @version Release: $Revision$
+* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*}
+
+{$content}
+
+{if isset($display_regenerate)}
+
{l s='Regenerate thumbnails'}
+ {l s='Regenerates thumbnails for all existing product images'}
+
+
+ {l s='Please be patient, as this can take several minutes'}
+ {l s='Be careful! Manually generated thumbnails will be erased by automatically generated thumbnails.'}
+
+
+
+{/if}
+
+{if isset($display_move)}
+
{l s='Move images'}
+ {l s='A new storage system for product images is now used by PrestaShop. It offers better performance if your shop has a very large number of products.'}
+
+ {if $safe_mode}
+
+ {l s='PrestaShop has detected that your server configuration is not compatible with the new storage system (directive "safe_mode" is activated). You should continue to use the actual system.'}
+
+ {else}
+
+ {/if}
+{/if}
\ No newline at end of file
diff --git a/classes/AdminController.php b/classes/AdminController.php
index ac4d2ed07..bdc68a27e 100644
--- a/classes/AdminController.php
+++ b/classes/AdminController.php
@@ -76,7 +76,8 @@ class AdminControllerCore extends Controller
protected $list_display;
- protected $form_list;
+ /** @var array list of option forms to be generated */
+ protected $options;
protected $_listSkipDelete = array();
@@ -292,7 +293,6 @@ class AdminControllerCore extends Controller
// Sub included tab postProcessing
$this->includeSubTab('postProcess', array('status', 'submitAdd1', 'submitDel', 'delete', 'submitFilter', 'submitReset'));
-
switch ($this->action)
{
/* Delete object image */
@@ -725,6 +725,7 @@ class AdminControllerCore extends Controller
$tpl = $this->tpl_folder.'content.tpl';
$tpl_action = $this->tpl_folder.$this->display.'.tpl';
// Check if action template has been override
+
if (file_exists($this->context->smarty->template_dir.'/'.$tpl_action))
$this->context->smarty->assign('content', $this->context->smarty->fetch($tpl_action));
@@ -934,6 +935,11 @@ class AdminControllerCore extends Controller
*/
public function initContent()
{
+ $this->context->smarty->assign(array(
+ 'current' => self::$currentIndex,
+ 'token' => $this->token
+ ));
+
if ($this->display == 'edit' || $this->display == 'add')
{
if (!($obj = $this->loadObject(true)))
@@ -1195,12 +1201,10 @@ class AdminControllerCore extends Controller
/* Delete object image */
if (isset($_GET['deleteImage']))
{
- $this->action = 'delete_image';
- $token = Tools::getValue('token') ? Tools::getValue('token') : $this->token;
- if (Validate::isLoadedObject($object = $this->loadObject()))
- if (($object->deleteImage()))
- Tools::redirectAdmin(self::$currentIndex.'&add'.$this->table.'&'.$this->identifier.'='.Tools::getValue($this->identifier).'&conf=7&token='.$token);
- $this->_errors[] = Tools::displayError('An error occurred during image deletion (cannot load object).');
+ if ($this->tabAccess['delete'] === '1')
+ $this->action = 'delete_image';
+ else
+ $this->_errors[] = Tools::displayError('You do not have permission to delete here.');
}
/* Delete object */
else if (isset($_GET['delete'.$this->table]))
@@ -1249,11 +1253,19 @@ class AdminControllerCore extends Controller
}
else if (isset($_GET['update'.$this->table]) && isset($_GET['id_'.$this->table]))
{
+ // @TODO move the employee condition to AdminEmployee
if ($this->tabAccess['edit'] === '1' || ($this->table == 'employee' && $this->context->employee->id == Tools::getValue('id_employee')))
$this->display = 'edit';
else
$this->_errors[] = Tools::displayError('You do not have permission to edit here.');
}
+ if (isset($_GET['view'.$this->table]))
+ {
+ if ($this->tabAccess['view'] === '1')
+ $this->display = 'view';
+ else
+ $this->_errors[] = Tools::displayError('You do not have permission to view here.');
+ }
/* Cancel all filters for this tab */
else if (isset($_POST['submitReset'.$this->table]))
$this->action = 'reset_filters';
@@ -1663,7 +1675,7 @@ class AdminControllerCore extends Controller
$languages = Language::getLanguages(false);
- foreach ($this->form_list as $option_list)
+ foreach ($this->options as $option_list)
{
foreach ($option_list as $category => $categoryData)
{
diff --git a/controllers/admin/AdminBackupController.php b/controllers/admin/AdminBackupController.php
new file mode 100644
index 000000000..109c98b25
--- /dev/null
+++ b/controllers/admin/AdminBackupController.php
@@ -0,0 +1,271 @@
+
+* @copyright 2007-2011 PrestaShop SA
+* @version Release: $Revision: 7320 $
+* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*/
+
+class AdminBackupControllerCore extends AdminController
+{
+ /** @var string The field we are sorting on */
+ protected $_sortBy = 'date';
+
+ public function __construct()
+ {
+ $this->table = 'backup';
+ $this->className = 'Backup';
+ parent::__construct();
+
+ $this->addRowAction('delete');
+ $this->addRowAction('view');
+
+ $this->deleted = false;
+
+ $this->requiredDatabase = false;
+
+ $this->fieldsDisplay = array (
+ 'date' => array('title' => $this->l('Date'), 'type' => 'datetime', 'width' => 120, 'align' => 'right'),
+ 'age' => array('title' => $this->l('Age')),
+ 'filename' => array('title' => $this->l('File name'), 'width' => 200),
+ 'filesize' => array('title' => $this->l('File size'))
+ );
+
+ $this->options = array(
+ 'options_general' => array(
+ 'general' => array(
+ 'title' => $this->l('Backup options'),
+ 'fields' => array(
+ 'PS_BACKUP_ALL' => array('title' => $this->l('Ignore statistics tables:'),
+ 'desc' => $this->l('The following tables will NOT be backed up if you enable this option:').' '._DB_PREFIX_.'connections, '._DB_PREFIX_.'connections_page, '._DB_PREFIX_.'connections_source, '._DB_PREFIX_.'guest, '._DB_PREFIX_.'statssearch', 'cast' => 'intval', 'type' => 'bool'),
+ 'PS_BACKUP_DROP_TABLE' => array('title' => $this->l('Drop existing tables during import:'),
+ 'desc' => $this->l('Select this option to instruct the backup file to drop your tables prior to restoring the backed up data').' (ie. "DROP TABLE IF EXISTS")', 'cast' => 'intval', 'type' => 'bool'),
+ ),
+ ),
+ ),
+ );
+ $this->identifier = 'filename';
+ }
+
+ /**
+ * Load class object using identifier in $_GET (if possible)
+ * otherwise return an empty object
+ * This method overrides the one in AdminTab because AdminTab assumes the id is a UnsignedInt
+ * "Backups" Directory in admin directory must be writeable (CHMOD 777)
+ * @param boolean $opt Return an empty object if load fail
+ * @return object
+ */
+ protected function loadObject($opt = false)
+ {
+ if ($id = Tools::getValue($this->identifier))
+ return new $this->className($id);
+ return new $this->className();
+ }
+
+ public function initContent()
+ {
+ if ($this->display == 'view')
+ {
+ if (!($object = $this->loadObject()))
+ $this->_errors[] = Tools::displayError('The object could not be loaded.');
+ if ($object->id)
+ {
+ $this->context->smarty->assign(array(
+ 'url_backup' => $object->getBackupURL()
+ ));
+ }
+ elseif ($object->error)
+ $this->_errors[] = $object->error;
+ }
+ else
+ {
+ if ($this->display == 'add')
+ {
+ $download = true;
+ $show_form = false;
+ }
+ else
+ {
+ $this->display = 'list';
+ $show_form = true;
+ }
+
+ $this->context->smarty->assign(array(
+ 'current' => self::$currentIndex,
+ 'show_form' => $show_form,
+ 'download' => isset($download) ? $download : null,
+ 'how_to' => true,
+ ));
+ }
+ parent::initContent();
+
+ if ($this->display == 'list')
+ {
+ $helper = new HelperOptions();
+ $helper->id = $this->id;
+ $helper->currentIndex = self::$currentIndex;
+ $this->content .= $helper->generateOptions($this->options['options_general']);
+ }
+ }
+
+ public function postProcess()
+ {
+ // Test if the backup dir is writable
+ if(!is_writable(_PS_ADMIN_DIR_.'/backups/'))
+ $this->warnings[] = $this->l('"Backups" Directory in admin directory must be writeable (CHMOD 755 / 777)');
+
+ if($this->action == 'new' && is_writable(_PS_ADMIN_DIR_.'/backups/'))
+ {
+ if (($object = $this->loadObject()))
+ {
+ if ($object->add())
+ {
+ $this->context->smarty->assign(array(
+ 'conf' => $this->l('It appears that the Backup was successful, however, you must download and carefully verify the Backup file.'),
+ 'backup_url' => $object->getBackupURL(),
+ 'backup_weight' => number_format((filesize($object->id)*0.000001), 2, '.', '')
+ ));
+ }
+ elseif ($object->error)
+ $this->_errors[] = $object->error;
+ }
+ }
+
+ parent::postProcess();
+ }
+
+ public function getList($id_lang, $orderBy = NULL, $orderWay = NULL, $start = 0, $limit = NULL, $id_lang_shop = NULL)
+ {
+
+ if (!Validate::isTableOrIdentifier($this->table))
+ die('filter is corrupted');
+ if (empty($orderBy))
+ $orderBy = Tools::getValue($this->table.'Orderby', $this->_defaultOrderBy);
+ if (empty($orderWay))
+ $orderWay = Tools::getValue($this->table.'Orderway', 'ASC');
+
+ // Try and obtain getList arguments from $_GET
+ $orderBy = Tools::getValue($this->table.'Orderby');
+ $orderWay = Tools::getValue($this->table.'Orderway');
+
+ // Validate the orderBy and orderWay fields
+ switch ($orderBy)
+ {
+ case 'filename':
+ case 'filesize':
+ case 'date':
+ case 'age':
+ break;
+ default:
+ $orderBy = 'date';
+ }
+ switch ($orderWay)
+ {
+ case 'asc':
+ case 'desc':
+ break;
+ default:
+ $orderWay = 'desc';
+ }
+ if (empty($limit))
+ $limit = ((!isset($this->context->cookie->{$this->table.'_pagination'})) ? $this->_pagination[0] : $limit = $this->context->cookie->{$this->table.'_pagination'});
+ $limit = (int)(Tools::getValue('pagination', $limit));
+ $this->context->cookie->{$this->table.'_pagination'} = $limit;
+
+ /* Determine offset from current page */
+ if (!empty($_POST['submitFilter'.$this->table]) AND is_numeric($_POST['submitFilter'.$this->table]))
+ $start = (int)($_POST['submitFilter'.$this->table] - 1) * $limit;
+ $this->_lang = (int)($id_lang);
+ $this->_orderBy = $orderBy;
+ $this->_orderWay = strtoupper($orderWay);
+ $this->_list = array();
+
+ // Find all the backups
+ $dh = @opendir(_PS_ADMIN_DIR_.'/backups/');
+ if ($dh === false)
+ {
+ $this->_errors[] = Tools::displayError('Unable to open backup directory .').addslashes(_PS_ADMIN_DIR_.'/backups/').'"';
+ return;
+ }
+ while (($file = readdir($dh)) !== false)
+ {
+ if (preg_match('/^([\d]+-[a-z\d]+)\.sql(\.gz|\.bz2)?$/', $file, $matches) == 0)
+ continue;
+ $timestamp = (int)($matches[1]);
+ $date = date('Y-m-d H:i:s', $timestamp);
+ $age = time() - $timestamp;
+ if ($age < 3600)
+ $age = '< 1 '.$this->l('hour');
+ else if ($age < 86400)
+ {
+ $age = floor($age / 3600);
+ $age = $age.' '.(($age == 1) ? $this->l('hour') : $this->l('hours'));
+ }
+ else
+ {
+ $age = floor($age / 86400);
+ $age = $age.' '.(($age == 1) ? $this->l('day') : $this->l('days'));
+ }
+ $size = filesize(_PS_ADMIN_DIR_.'/backups/'.$file);
+ $this->_list[] = array(
+ 'filename' => $file,
+ 'age' => $age,
+ 'date' => $date,
+ 'filesize' => number_format($size / 1000, 2).' Kb',
+ 'timestamp' => $timestamp,
+ 'filesize_sort' => $size,
+ );
+ }
+ closedir($dh);
+ $this->_listTotal = count($this->_list);
+
+ // Sort the _list based on the order requirements
+ switch ($this->_orderBy)
+ {
+ case 'filename':
+ $this->_sortBy = 'filename';
+ $sorter = 'str_sort';
+ break;
+ case 'filesize':
+ $this->_sortBy = 'filesize_sort';
+ $sorter = 'int_sort';
+ break;
+ case 'age':
+ case 'date':
+ $this->_sortBy = 'timestamp';
+ $sorter = 'int_sort';
+ break;
+ }
+ usort($this->_list, array($this, $sorter));
+ $this->_list = array_slice($this->_list, $start, $limit);
+ }
+
+ public function int_sort($a, $b)
+ {
+ return $this->_orderWay == 'ASC' ? $a[$this->_sortBy] - $b[$this->_sortBy] : $b[$this->_sortBy] - $a[$this->_sortBy];
+ }
+
+ public function str_sort($a, $b)
+ {
+ return $this->_orderWay == 'ASC' ? strcmp($a[ $this->_sortBy], $b[$this->_sortBy]) : strcmp($b[ $this->_sortBy], $a[$this->_sortBy]);
+ }
+}
diff --git a/controllers/admin/AdminHomeController.php b/controllers/admin/AdminHomeController.php
index b5124765b..44a3652fd 100644
--- a/controllers/admin/AdminHomeController.php
+++ b/controllers/admin/AdminHomeController.php
@@ -1,6 +1,6 @@
getValue('SELECT date_upd FROM '._DB_PREFIX_.'configuration WHERE name = "PS_HTACCESS_CACHE_CONTROL"');
if (Configuration::get('PS_HTACCESS_CACHE_CONTROL') AND strtotime($dateUpdHtaccess) > $stat['mtime'])
$htaccessOptimized = 1;
-
+
$dateUpdate = Configuration::get('PS_LAST_SHOP_UPDATE');
if ($dateUpdate AND strtotime($dateUpdate) > $stat['mtime'])
$htaccessAfterUpdate = 0;
@@ -70,7 +70,7 @@ class AdminHomeControllerCore extends AdminController
$needRebuild=Configuration::get('PS_NEED_REBUILD_INDEX');
if($needRebuild !='0');
$indexRebuiltAfterUpdate = 2;
-
+
$smartyOptimized = 0;
if (Configuration::get('PS_SMARTY_FORCE_COMPILE') == _PS_SMARTY_NO_COMPILE_)
++$smartyOptimized;
@@ -85,15 +85,15 @@ class AdminHomeControllerCore extends AdminController
$cccOptimized = 2;
else
$cccOptimized = 1;
-
+
$shopEnabled = (Configuration::get('PS_SHOP_ENABLE') ? 2 : 1);
-
+
$lights = array(
- 0 => array('image'=>'error2.png','color'=>'#fbe8e8'),
+ 0 => array('image'=>'error2.png','color'=>'#fbe8e8'),
1 => array('image'=>'warn2.png','color'=>'#fffac6'),
2 => array('image'=>'ok2.png','color'=>'#dffad3'));
-
-
+
+
if ($rewrite + $htaccessOptimized + $smartyOptimized + $cccOptimized + $shopEnabled + $htaccessAfterUpdate + $indexRebuiltAfterUpdate != 14)
{
$this->context->smarty->assign('hide_tips',Configuration::get('PS_HIDE_OPTIMIZATION_TIPS'));
@@ -124,13 +124,13 @@ class AdminHomeControllerCore extends AdminController
'color' => $lights[$cccOptimized]['color'],
'image' => $lights[$cccOptimized]['image'],
);
-
+
$opti_list[] = array(
'title' => $this->l('Shop enabled'),
'href' => $link->getAdminLink('AdminPreferences'),
'color' => $lights[$shopEnabled]['color'],
'image' => $lights[$shopEnabled]['image'],
- );
+ );
$opti_list[] = array(
'title' => $this->l('index rebuilt after update'),
@@ -138,7 +138,7 @@ class AdminHomeControllerCore extends AdminController
'color' => $lights[$indexRebuiltAfterUpdate]['color'],
'image' => $lights[$indexRebuiltAfterUpdate]['image'],
);
-
+
$opti_list[] = array(
'title' => $this->l('.htaccess up-to-date'),
'href' => $link->getAdminLink('AdminGenerator'),
@@ -181,7 +181,7 @@ class AdminHomeControllerCore extends AdminController
'title' => $this->l('New product'),
'description' => $this->l('Fill up your catalog with new articles and attributes.'),
);
-
+
$quick_links['third'] = array(
'href' => $this->context->link->getAdminLink('AdminStats'),
'title' => $this->l('Statistics'),
@@ -313,7 +313,7 @@ class AdminHomeControllerCore extends AdminController
$content = '