Esempio n. 1
0
 /**
  * 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 bool $opt Return an empty object if load fail
  * @return object
  */
 protected function loadObject($opt = false)
 {
     if (($id = Tools::getValue($this->identifier)) && PrestaShopBackup::backupExist($id)) {
         return new $this->className($id);
     }
     $obj = new $this->className();
     $obj->error = Tools::displayError('The backup file does not exist');
     return $obj;
 }
Esempio n. 2
0
 /**
  * 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 bool $opt Return an empty object if load fail
  * @return object
  */
 protected function loadObject($opt = false)
 {
     if (($id = Tools::getValue($this->identifier)) && PrestaShopBackup::backupExist($id)) {
         return new $this->className($id);
     }
     $obj = new $this->className();
     $obj->error = $this->trans('The backup file does not exist', array(), 'Admin.AdvParameters.Notification');
     return $obj;
 }