public function __construct($options = array()) { //echo 'EXTENDS JCATEGORIES'; $options['table'] = '#__imc_issues'; $options['extension'] = 'com_imc'; parent::__construct($options); }
public function getItems($pk) { if (!count($this->_items)) { $app = JFactory::getApplication(); $menu = $app->getMenu(); $active = $menu->getActive(); $this->params = $params = $this->getState('params'); if ($active) { $params->loadString($active->params); } $options = array(); $options['countItems'] = $params->get('show_cat_items_cat', 1) || !$params->get('show_empty_categories_cat', 0); $categories = JCategories::getInstance('Contact', $options); $this->_parent = $categories->get($pk['id']); $JSNConfig = JSNFactory::getConfig(); $JSNConfig->megreMenuParams($pk['Itemid'], $params, 'com_contact'); $JSNConfig->megreGlobalParams('com_contact', $this->params, true); if (is_object($this->_parent)) { $this->_items = $this->_parent->getChildren(); } else { $this->_items = false; } } return $this->_items; }
public function __construct($options = array()) { $options['table'] = '#__agendadirigentes_cargos'; $options['extension'] = 'com_agendadirigentes'; $options['statefield'] = 'published'; parent::__construct($options); }
public static function getCategoryRoute($catid) { if ($catid instanceof JCategoryNode) { $id = $catid->id; $category = $catid; } else { $id = (int) $catid; $category = JCategories::getInstance('Content')->get($id); } if ($id < 1) { $link = ''; } else { $needles = array('category' => array($id)); if ($item = self::_findItem($needles)) { $link = 'index.php?Itemid=' . $item; } else { //Create the link $link = 'index.php?option=com_content&view=category&id=' . $id; if ($category) { $catids = array_reverse($category->getPath()); $needles = array('category' => $catids, 'categories' => $catids); if ($item = self::_findItem($needles)) { $link .= '&Itemid=' . $item; } elseif ($item = self::_findItem()) { $link .= '&Itemid=' . $item; } } } } return $link; }
public function __construct($options = array()) { //echo 'EXTENDS JCATEGORIES'; $options['table'] = '#__citybranding_pois'; $options['extension'] = 'com_citybranding'; parent::__construct($options); }
public function __construct($options = array()) { $options['table'] = '#__eventgallery_folder'; $options['extension'] = 'com_eventgallery'; $options['statefield'] = 'published'; parent::__construct($options); }
/** * Name of the items state field * * @var string * @since 1.0.0 */ public function __construct($options = array()) { $options['statefield'] = 'published'; $options['table'] = '#__digicom_products'; $options['extension'] = 'com_digicom'; parent::__construct($options); }
/** * Class constructor * * @param array $options Array of options * * @since 11.1 */ public function __construct($options = array()) { $options['table'] = '#__catalogue_item'; $options['extension'] = 'com_catalogue'; $options['field'] = 'category_id'; parent::__construct($options); }
function get_category($catid) { if (!is_object($this->_item)) { $app = JFactory::getApplication(); $menu = $app->getMenu(); $active = $menu->getActive(); $params = new JRegistry(); if ($active) { $params->loadString($active->params); } $options = array(); $options['countItems'] = $params->get('show_cat_num_articles_cat', 1) || !$params->get('show_empty_categories_cat', 0); $catid = $catid > 0 ? $catid : 'root'; $categories = JCategories::getInstance('CommunitySurveys', $options); $this->_item = $categories->get($catid); if (is_object($this->_item)) { $user = JFactory::getUser(); $userId = $user->get('id'); $asset = 'com_content.category.' . $this->_item->id; if ($user->authorise('core.create', $asset)) { $this->_item->getParams()->set('access-create', true); } } } return $this->_item; }
public function __construct($options = array()) { $options['table'] = '#__knvbapi2_teamnaams'; $options['extension'] = 'com_knvbapi2'; $options['statefield'] = 'state'; parent::__construct($options); }
/** * Constructor Helper * * @param array $options Array of options * * @since 1.5 */ public function __construct($options = []) { $options['table'] = '#__churchdirectory_details'; $options['extension'] = 'com_churchdirectory'; $options['statefield'] = 'published'; parent::__construct($options); }
public function __construct($options = array()) { $options['table'] = '#__content'; $options['extension'] = 'com_content'; $options['allLanguages'] = true; parent::__construct($options); }
public function __construct($options = array()) { $options['table'] = '#__survey'; $options['extension'] = 'com_communitysurveys'; $options['statefield'] = 'published'; parent::__construct($options); }
/** * @param int The route of the content item */ public static function getArticleRoute($id, $catid = 0, $language = 0) { $needles = array('article' => array((int) $id)); //Create the link $link = 'index.php?option=com_tz_portfolio_plus&view=article&id=' . $id; if ((int) $catid > 1) { $categories = JCategories::getInstance('TZ_Portfolio_Plus'); $category = $categories->get((int) $catid); if ($category) { $needles['portfolio'] = array_reverse($category->getPath()); $needles['categories'] = $needles['portfolio']; $needles['date'] = $needles['portfolio']; $link .= '&catid=' . $catid; } } if ($language && $language != "*" && JLanguageMultilang::isEnabled()) { self::buildLanguageLookup(); if (isset(self::$lang_lookup[$language])) { $link .= '&lang=' . self::$lang_lookup[$language]; $needles['language'] = $language; } } if ($item = self::_findItem($needles)) { $link .= '&Itemid=' . $item; } elseif ($item = self::_findItem()) { $link .= '&Itemid=' . $item; } return $link; }
public function __construct($options = array()) { $options['table'] = '#__contact_details'; $options['extension'] = 'com_contact'; $options['statefield'] = 'published'; parent::__construct($options); }
public static function getCategoryRoute($catid, $language = 0) { if ($catid instanceof JCategoryNode) { $id = $catid->id; $category = $catid; } else { $id = (int) $catid; $category = JCategories::getInstance('Contact')->get($id); } if ($id < 1 || !$category instanceof JCategoryNode) { $link = ''; } else { $needles = array(); // Create the link $link = 'index.php?option=com_contact&view=category&id=' . $id; $catids = array_reverse($category->getPath()); $needles['category'] = $catids; $needles['categories'] = $catids; if ($language && $language != "*" && JLanguageMultilang::isEnabled()) { self::buildLanguageLookup(); if (isset(self::$lang_lookup[$language])) { $link .= '&lang=' . self::$lang_lookup[$language]; $needles['language'] = $language; } } if ($item = self::_findItem($needles)) { $link .= '&Itemid=' . $item; } } return $link; }
/** * Class constructor * * @param array $options Array of options * * @since 11.1 */ public function __construct($options = array()) { $options['table'] = '#__content'; $options['extension'] = 'com_content'; $options['access'] = false; parent::__construct($options); }
/** * Метод для отображения формы вопроса * @param unknown_type $tpl */ public function display($tpl = null) { $catid = JRequest::getInt('catid', null, 'GET'); if (!$catid) { throw new Exception('Category id not set'); } JForm::addFormPath('components/com_smfaq/models/forms'); JForm::addFieldPath('components/com_smfaq/models/fields'); $form = JForm::getInstance('question', 'question'); $categories = JCategories::getInstance('SmFaq'); $category = $categories->get($catid); $params = $category->getParams(); if ($layout = $params->get('category_layout')) { $this->setLayout($layout); } JPluginHelper::importPlugin('smfaq'); $dispatcher = JDispatcher::getInstance(); $results = $dispatcher->trigger('onPrepareForm', array($form)); // Check for errors encountered while preparing the form. if (count($results) && in_array(false, $results, true)) { // Get the last error. $error = $dispatcher->getError(); if (!$error instanceof Exception) { throw new Exception($error); } } $this->assignRef('form', $form); $this->assignRef('params', $params); $this->assignRef('category', $category); parent::display($tpl); }
public function __construct($options = array()) { $options['table'] = '#__newsfeeds'; $options['extension'] = 'com_newsfeeds'; $options['statefield'] = 'published'; parent::__construct($options); }
/** * Get the category route. * * @param integer $catid The category ID. * @param integer $language The language code. * * @return string The product route. * * @since 1.5 */ public static function getCategoryRoute($catid, $language = 0) { if ($catid instanceof JCategoryNode) { $id = $catid->id; $category = $catid; } else { $id = (int) $catid; $category = JCategories::getInstance('DigiCom')->get($id); } if ($id < 1 || !$category instanceof JCategoryNode) { $link = ''; } else { $needles = array(); $link = 'index.php?option=com_digicom&view=category&id=' . $id; $catids = array_reverse($category->getPath()); $needles['category'] = $catids; $needles['categories'] = $catids; if ($language && $language != "*" && JLanguageMultilang::isEnabled()) { $link .= '&lang=' . $language; $needles['language'] = $language; } if ($item = self::_findItem($needles)) { $link .= '&Itemid=' . $item; } } return $link; }
function display($tpl = null) { // Parameters $app = JFactory::getApplication(); $doc = JFactory::getDocument(); $params = $app->getParams(); $feedEmail = $app->getCfg('feed_email', 'author'); $siteEmail = $app->getCfg('mailfrom'); $doc->link = JRoute::_('index.php?option=com_content&view=featured'); // Get some data from the model JRequest::setVar('limit', $app->getCfg('feed_limit')); $categories = JCategories::getInstance('Content'); $rows = $this->get('Items'); foreach ($rows as $row) { // strip html from feed item title $title = $this->escape($row->title); $title = html_entity_decode($title, ENT_COMPAT, 'UTF-8'); // Compute the article slug $row->slug = $row->alias ? $row->id . ':' . $row->alias : $row->id; // Url link to article $link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catid)); // Get row fulltext $db = JFactory::getDBO(); $query = 'SELECT' . $db->quoteName('fulltext') . 'FROM #__content WHERE id =' . $row->id; $db->setQuery($query); $row->fulltext = $db->loadResult(); $description = $params->get('feed_summary', 0) ? $row->introtext . $row->fulltext : $row->introtext; $author = $row->created_by_alias ? $row->created_by_alias : $row->author; // Load individual item creator class $item = new JFeedItem(); $item->title = $title; $item->link = $link; $item->date = $row->publish_up; $item_category = $categories->get($row->catid); $item->category = array(); $item->category[] = JText::_('JFEATURED'); // All featured articles are categorized as "Featured" for ($item_category = $categories->get($row->catid); $item_category !== null; $item_category = $item_category->getParent()) { if ($item_category->id > 1) { // Only add non-root categories $item->category[] = $item_category->title; } } $item->author = $author; if ($feedEmail == 'site') { $item->authorEmail = $siteEmail; } elseif ($feedEmail === 'author') { $item->authorEmail = $row->author_email; } // Add readmore link to description if introtext is shown, show_readmore is true and fulltext exists if (!$params->get('feed_summary', 0) && $params->get('feed_show_readmore', 0) && $row->fulltext) { $description .= '<p class="feed-readmore"><a target="_blank" href ="' . $item->link . '">' . JText::_('COM_CONTENT_FEED_READMORE') . '</a></p>'; } // Load item description and add div $item->description = '<div class="feed-description">' . $description . '</div>'; // Loads item info into rss array $doc->addItem($item); } }
/** * Get content items of the type category * * @param int $id ID of the category to load * * @return array Categories path identified by $id * * @since 3.4 */ public function getCategorySegment($id, $query) { $category = JCategories::getInstance($this->getName())->get($id); if ($category) { return array_reverse($category->getPath(), true); } return array(); }
public function getCategory() { $id = $this->getState('filter.category_id'); jimport('joomla.application.categories'); $cat = JCategories::getInstance('Content', array('extension' => 'com_content', 'table' => '')); $category = $cat->get($id); return $category; }
protected function getListQuery() { $id = JRequest::getUInt('id'); jimport('joomla.application.categories'); $catObj = JCategories::getInstance('JNT_Hanhphuc', array('extension' => 'com_jnt_hanhphuc', 'table' => '')); $category = $catObj->get($id); $query = FrontJntHanhphucHelper::getUsers($category->id, true); return $query; }
public function display($tpl = null) { $this->doc = JFactory::getDocument(); $this->app = JFactory::getApplication(); $this->user = JFactory::getUser(); $this->params = $this->app->getParams(); $this->menu = $this->app->getMenu()->getActive(); // Params $this->showDate = $this->app->input->get('showDate', $this->params->get('showDate', 1)); $this->showIcon = $this->app->input->get('showIcon', $this->params->get('showIcon', 1)); $this->showDesc = $this->app->input->get('showDesc', $this->params->get('showDesc', 1)); $this->showAuth = $this->app->input->get('showAuth', $this->params->get('showAuth', 0)); $this->showLicence = $this->app->input->get('showLicence', $this->params->get('showLicence', 0)); $this->showSize = $this->app->input->get('showSize', $this->params->get('showSize', 1)); $this->showMD5 = $this->app->input->get('showMD5', $this->params->get('showMD5', 0)); $this->showNew = $this->app->input->get('showNew', $this->params->get('showNew', 1)); $this->newfiledays = $this->params->get('newfiledays', 7); $this->show_page_heading = $this->app->input->get('show_page_heading', 1); $this->subview = $this->app->input->get('subview', 'list'); $this->defIcon = $this->params->get('defaulticon', "./media/com_simplefilemanager/images/document.png"); $this->linkOnEntryTitle = $this->params->get('linkOnTitle', 1); $this->enableOrderingSelect = $this->app->input->get('sortFieldSelection', 1); // Permissions $this->canCreate = $this->user->authorise('core.create', 'com_simplefilemanager'); $this->canEdit = $this->user->authorise('core.edit', 'com_simplefilemanager'); $this->canCheckin = $this->user->authorise('core.manage', 'com_simplefilemanager'); $this->canChange = $this->user->authorise('core.edit.state', 'com_simplefilemanager'); $this->canDelete = $this->user->authorise('core.delete', 'com_simplefilemanager'); // View data $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->params = $this->app->getParams('com_simplefilemanager'); $this->catID = $this->app->input->get('catid', 0); $this->category = JCategories::getInstance('Simplefilemanager')->get($this->catID); $this->sortDirection = $this->state->get('list.direction'); $this->sortColumn = $this->state->get('list.ordering'); $this->sortFields = $this->getSortFields(); // CSS and Libraries $this->doc->addStyleSheet("./media/com_simplefilemanager/css/site.stylesheet.css"); foreach ($this->items as $item) { $item->icon = $item->icon ?: $this->defIcon; $item->canDownload = $item->visibility == 1 || $item->visibility == 3 && $item->reserved_user == $this->user->id || $item->visibility == 2 && $item->user->id || $item->visibility == 5 && $item->author == $this->user->id || $item->visibility == 4 && in_array($item->reserved_group, JAccess::getGroupsByUser($this->user->id)); } if (!$this->catID or !$this->category) { JError::raiseError(500); } // TODO: Check if user can view cateogry else throw a 403 error $this->children = $this->category->getChildren(); // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } $this->_prepareDocument(); parent::display($tpl); echo JText::_("COM_SIMPLEFILEMANAGER_CREDITS"); }
public static function getList(&$params) { $categories = JCategories::getInstance('Content'); $category = $categories->get($params->get('parent', 'root')); $items = $category->getChildren(); if ($params->get('count', 0) > 0 && count($items) > $params->get('count', 0)) { $items = array_slice($items, 0, $params->get('count', 0)); } return $items; }
public function __construct($options = array()) { $options['table'] = '#__smfaq'; $options['extension'] = 'com_smfaq'; $options['access'] = false; $options['statefield'] = 'published'; //$options['published'] = false; $options['countItems'] = true; parent::__construct($options); }
public static function getCategories($recursive = false) { $_categories = JCategories::getInstance('Imc'); $_parent = $_categories->get(); if (is_object($_parent)) { $_items = $_parent->getChildren($recursive); } else { $_items = false; } return ModImcfiltersHelper::loadCats($_items); }
function display($tpl = NULL) { /** * @var JSite $app */ $app = JFactory::getApplication(); $this->params = $app->getParams(); /* Default Page fallback*/ $active = $app->getMenu()->getActive(); if (NULL == $active) { $this->params->merge($app->getMenu()->getDefault()->params); $active = $app->getMenu()->getDefault(); } $this->currentItemid = $active->id; $this->catid = JRequest::getInt('catid', 0); if ($this->catid == 0) { $this->catid = 'root'; } $options = array(); $options['countItems'] = $this->params->get('show_items_per_category_count', 0); /** * @var JCategories $categories */ $categories = JCategories::getInstance('Eventgallery', $options); /** * @var JCategoryNode $root */ if (null != $this->catid) { $this->category = $categories->get($this->catid); } if ($this->category == null || $this->category->published != 1) { return JError::raiseError(404, JText::_('JGLOBAL_CATEGORY_NOT_FOUND')); } $entriesPerPage = $this->params->get('max_events_per_page', 12); $model = $this->getModel('categories'); $eventModel = JModelLegacy::getInstance('Event', 'EventgalleryModel'); $user = JFactory::getUser(); $usergroups = JUserHelper::getUserGroups($user->id); $entries = $model->getEntries(JRequest::getVar('start', 0), $entriesPerPage, $this->params->get('tags'), $this->params->get('sort_events_by'), $usergroups, $this->catid); $this->pageNav = $model->getPagination(); $this->entries = $entries; $this->eventModel = $eventModel; $this->_prepareDocument(); /** * @var JPathway $pathway */ $pathway = $app->getPathway(); $rootCategoryId = 0; if (isset($active->query['catid'])) { $rootCategoryId = $active->query['catid']; } EventgalleryHelpersCategories::addCategoryPathToPathway($pathway, $rootCategoryId, JRequest::getInt('catid', 0), $this->currentItemid); parent::display($tpl); }
function getCategories($recursive = false) { $_categories = JCategories::getInstance('Improvemycity'); $this->_parent = $_categories->get(); if (is_object($this->_parent)) { $this->_items = $this->_parent->getChildren($recursive); } else { $this->_items = false; } return $this->loadCats($this->_items); }