コード例 #1
0
ファイル: categoryClass.php プロジェクト: hriggs/cs-website
 function bind($array, $ignore = array())
 {
     $cfg = JEVConfig::getInstance();
     $array['id'] = isset($array['id']) ? intval($array['id']) : 0;
     parent::bind($array);
     $params = new JRegistry($this->params);
     if (!$params->get("catcolour", false)) {
         $color = array_key_exists("color", $array) ? $array['color'] : "#000000";
         if (!preg_match("/^#[0-9a-f]+\$/i", $color)) {
             $color = "#000000";
         }
         $params->set("catcolor", $color);
     }
     if (!$params->get("admin", false)) {
         $admin = array_key_exists("admin", $array) ? $array['admin'] : 0;
         $params->set("admin", $admin);
     }
     if (!$params->get("overlaps", false)) {
         $overlaps = array_key_exists("overlaps", $array) ? intval($array['overlaps']) : 0;
         $params->set("overlaps", $overlaps);
     }
     if (!$params->get("image", false)) {
         $image = array_key_exists("image", $array) ? intval($array['image']) : "";
         $params->set("image", $image);
     }
     $this->params = (string) $params;
     // Fill in the gaps
     $this->parent_id = array_key_exists("parent_id", $array) ? intval($array['parent_id']) : 1;
     $this->level = array_key_exists("level", $array) ? intval($array['level']) : 1;
     $this->extension = "com_jevents";
     $this->language = "*";
     $this->setLocation(1, 'last-child');
     return true;
 }
コード例 #2
0
ファイル: categoryClass.php プロジェクト: madseller/coperio
 function bind($array)
 {
     $cfg =& JEVConfig::getInstance();
     if (JVersion::isCompatible("1.6.0")) {
         $array['id'] = isset($array['id']) ? intval($array['id']) : 0;
         $array['extension'] = "com_jevents";
         $array['parent_id'] = 1;
         $array['language'] = "*";
         if (!isset($array['access'])) {
             $array['access'] = JRequest::getInt("access", -1);
             if ($array['access'] == -1) {
                 $array['access'] = (int) JFactory::getConfig()->get('access');
             }
         }
         $array['alias'] = JApplication::stringURLSafe($array['title']);
         $array['path'] = $array['alias'];
         $this->setLocation($array['parent_id'], 'last-child');
         parent::bind($array);
     } else {
         $array['id'] = isset($array['id']) ? intval($array['id']) : 0;
         parent::bind($array);
         if (!isset($this->_catextra)) {
             $this->_catextra = new CatExtra($this->_db);
         }
         $this->_catextra->color = array_key_exists("color", $array) ? $array['color'] : "#000000";
         if (!preg_match("/^#[0-9a-f]+\$/i", $this->_catextra->color)) {
             $this->_catextra->color = "#000000";
         }
         unset($this->color);
         $this->_catextra->admin = array_key_exists("admin", $array) ? $array['admin'] : 0;
         unset($this->admin);
         $this->_catextra->overlaps = array_key_exists("overlaps", $array) ? intval($array['overlaps']) : 0;
         // Fill in the gaps
         $this->name = $this->title;
         $this->section = "com_jevents";
         $this->image_position = "left";
     }
     return true;
 }