function load($oid = NULL, $reset = true) { parent::load($oid); $params = new JRegistry($this->params); $this->color = $params->get("catcolour", "#000000"); $this->overlaps = $params->get("overlaps", 0); $this->admin = $params->get("admin", 0); $this->image = $params->get("image", ""); }
function load($oid = null) { parent::load($oid); if (!JVersion::isCompatible("1.6.0")) { if (!isset($this->_catextra)) { $this->_catextra = new CatExtra($this->_db); } if ($this->id > 0) { $this->_catextra->load($this->id); } } }
function load($oid = null) { parent::load($oid); if (!JVersion::isCompatible("1.6.0")) { if (!isset($this->_catextra)) { $this->_catextra = new CatExtra($this->_db); } if ($this->id > 0) { $this->_catextra->load($this->id); } } else { $params = new JParameter($this->params); $this->color = $params->get("catcolour", "#000000"); $this->overlaps = $params->get("overlaps", 0); $this->admin = $params->get("admin", 0); } }
protected function getCategory($params) { $breadcrumbs = $params->get('data.breadcrumbs'); $breadcrumbs = preg_replace('#^\\s*<a[^>]*>.*?</a>\\s*<img[^>]*>\\s*#is', '', $breadcrumbs); $breadcrumbs = preg_replace('#\\s*<img[^>]*>\\s*$#is', '', $breadcrumbs); $breadcrumbs = preg_replace('#\\s*<img[^>]*>\\s*#is', '|', $breadcrumbs); $breadcrumbs = strip_tags($breadcrumbs); $breadcrumbs = htmlspecialchars_decode($breadcrumbs); $breadcrumbs = explode('|', $breadcrumbs); $db = JFactory::getDbo(); $parentId = 1; $depth = $params->get('depth'); foreach ($breadcrumbs as $title) { $depth++; $alias = JApplication::stringURLSafe($title); $table = new JTableCategory($db); $table->load(array('alias' => $alias, 'extension' => 'com_jed')); if (empty($table->id)) { $table->title = $title; $table->alias = $alias; $table->description = $this->params->get("data.{$depth}", ''); $table->extension = 'com_jed'; $table->published = 1; $table->access = 1; $table->created_user_id = 42; $table->language = '*'; $table->setLocation($parentId, 'last-child'); // Store the data. if (!$table->store()) { $this->setError($table->getError()); return false; } // Rebuild the path for the category: if (!$table->rebuildPath($table->id)) { $this->setError($table->getError()); return false; } // Rebuild the paths of the category's children: if (!$table->rebuild($table->id, $table->lft, $table->level, $table->path)) { $this->setError($table->getError()); return false; } } else { if ($this->params->get("data.{$depth}", '') != '') { $table->description = $this->params->get("data.{$depth}", ''); $table->store(); } } $parentId = $table->id; } return $parentId; }
/** * getContentCategories * * @param array $article_cat Param. * * @return array */ public static function getContentCategories($article_cat) { $cat_ids = array(); $cat_names = array(); $cat_alias = array(); $row = JTable::getInstance('category'); // JomSocial Conflict Category ? if (!method_exists($row, 'load')) { if (EXTLY_J3) { include_once JPATH_SITE . '/libraries/legacy/table/category.php'; } else { include_once JPATH_SITE . '/libraries/joomla/database/table/category.php'; } $db = JFactory::getDbo(); $row = new JTableCategory($db); } $row->load($article_cat); while ($row->parent_id > 0) { $cat_ids[] = $row->id; $cat_names[] = $row->title; $cat_alias[] = $row->alias; $row->load($row->parent_id); } return array($cat_ids, $cat_names, $cat_alias); }