Example #1
0
 public function __construct($param, $isCouponCode)
 {
     if ($isCouponCode && eF_checkParameter($param, 'text')) {
         $result = eF_getTableData("coupons", "*", "code='" . $param . "'");
         $param = $result[0];
     }
     parent::__construct($param);
 }
 /**
  *
  * @param $param
  * @return unknown_type
  */
 public function __construct($param)
 {
     //Special handling in case we are instantiating with string (name) instead of id
     if (!eF_checkParameter($param, 'id') && eF_checkParameter($param, 'alnum_general')) {
         $result = eF_getTableData("themes", "id", "name='" . $param . "'");
         if (sizeof($result) == 0) {
             throw new EfrontEntityException(_ENTITYNOTFOUND . ': ' . htmlspecialchars($param), EfrontEntityException::ENTITY_NOT_EXIST);
         }
         $param = $result[0]['id'];
     }
     parent::__construct($param);
     if (strpos($this->{$this->entity}['path'], 'http') === 0) {
         $this->remote = 1;
     }
     /*
             //Check whether this is a remote theme
             if (!is_dir($this -> {$this -> entity}['path']) && !is_file($this -> {$this -> entity}['path'])) {
                 if (!fopen($this -> {$this -> entity}['path'].'theme.xml', 'r')) {
                     throw new EfrontEntityException(_ENTITYNOTFOUND.': '.htmlspecialchars($this -> {$this -> entity}['path']), EfrontEntityException :: ENTITY_NOT_EXIST);
                 } else {
                     $this -> remote = 1;
                 }
             }
     */
     if (unserialize($this->{$this->entity}['options']) !== false) {
         $this->options = unserialize($this->{$this->entity}['options']);
     }
     if (!$this->options) {
         $this->options = array();
     }
     if (unserialize($this->{$this->entity}['layout']) !== false) {
         $this->layout = unserialize($this->{$this->entity}['layout']);
     }
     if (!$this->layout) {
         $this->layout = array();
     }
     //Check validity of current logo
     try {
         if (isset($this->options['logo'])) {
             new EfrontFile($this->options['logo']);
         } else {
             throw new Exception();
         }
     } catch (Exception $e) {
         $this->options['logo'] = false;
     }
     //Check validity of current favicon
     try {
         if (isset($this->options['favicon'])) {
             new EfrontFile($this->options['favicon']);
         } else {
             throw new Exception();
         }
     } catch (Exception $e) {
         $this->options['favicon'] = false;
     }
 }
Example #3
0
 /**
  * 
  * @return unknown_type
  */
 public function __construct($param)
 {
     $this->entity = 'f_poll';
     parent::__construct($param);
 }