/** * @param XmapDisplayerInterface $xmap * @param stdClass $parent * @param array $params */ private static function getListsTree($xmap, stdClass $parent, array &$params) { $db = JFactory::getDbo(); $query = $db->getQuery(true)->select(array('id', 'title', 'alias'))->from('#_mijopolls_polls AS l')->where('l.published = 1')->order('l.ordering'); if (!$params['show_unauth']) { $query->where('l.visible = 1'); } $db->setQuery($query); $rows = $db->loadObjectList(); if (empty($rows)) { return; } $xmap->changeLevel(1); foreach ($rows as $row) { $node = new stdclass(); $node->id = $parent->id; $node->name = $row->name; $node->uid = $parent->uid . '_lid_' . $row->listid; $node->browserNav = $parent->browserNav; $node->priority = $params['ddPolls_priority']; $node->changefreq = $params['ddPolls_changefreq']; $node->link = 'index.php?option=com_mijopolls&view=poll&id=' . $row->id . ':' . $row->alias; } $xmap->changeLevel(-1); }
/** * @param XmapDisplayerInterface $xmap * @param stdClass $parent * @param array $params * @param int $parent_id */ private static function getCategoryTree($xmap, stdClass $parent, array &$params, $parent_id) { $db = JFactory::getDbo(); $query = $db->getQuery(true)->select(array('c.id', 'c.title', 'c.parent_id'))->from('#__jdownloads_categories AS c')->where('c.parent_id = ' . $db->quote($parent_id))->where('c.published = 1')->order('c.ordering'); if (!$params['show_unauth']) { $query->where('c.access IN(' . $params['groups'] . ')'); } $db->setQuery($query); $rows = $db->loadObjectList(); if (empty($rows)) { return; } $xmap->changeLevel(1); foreach ($rows as $row) { $node = new stdclass(); $node->id = $parent->id; $node->name = $row->title; $node->uid = $parent->uid . '_cid_' . $row->id; $node->browserNav = $parent->browserNav; $node->priority = $params['category_priority']; $node->changefreq = $params['category_changefreq']; $node->link = 'index.php?option=com_jdownloads&view=category&catid=' . $row->id . '&Itemid=' . $parent->id; if ($xmap->printNode($node) !== false) { self::getDownloads($xmap, $parent, $params, $row->id); } } $xmap->changeLevel(-1); }
/** * @param XmapDisplayerInterface $xmap * @param stdClass $parent * @param array $params */ private static function getLevels($xmap, stdClass $parent, array &$params) { $db = JFactory::getDbo(); $query = $db->getQuery(true)->select(array('l.akeebasubs_level_id', 'l.title', 'l.slug'))->from('#__akeebasubs_levels AS l')->where('l.enabled = 1')->order('l.ordering'); $db->setQuery($query); $rows = $db->loadObjectList(); if (empty($rows)) { return; } $xmap->changeLevel(1); foreach ($rows as $row) { $node = new stdclass(); $node->id = $parent->akeebasubs_level_id; $node->name = $row->title; $node->uid = $parent->uid . '_' . $row->akeebasubs_level_id; $node->browserNav = $parent->browserNav; $node->priority = $params['level_priority']; $node->changefreq = $params['level_changefreq']; $node->link = 'index.php?option=com_akeebasubs&view=level&slug=' . $row->slug . '&format=html&layout=default' . '&Itemid=' . $parent->id; $xmap->printNode($node); } $xmap->changeLevel(-1); }
/** * @param XmapDisplayerInterface $xmap * @param stdClass $parent * @param array $params * @param int $catid */ private static function getCategoryTree($xmap, stdClass $parent, array &$params, $catid) { /** @var KunenaForumCategory[] $categories */ $categories = KunenaForumCategoryHelper::getChildren($catid); $xmap->changeLevel(1); foreach ($categories as $cat) { $node = new stdClass(); $node->id = $parent->id; $node->browserNav = $parent->browserNav; $node->uid = $parent->uid . '_c_' . $cat->id; $node->name = $cat->name; $node->priority = $params['cat_priority']; $node->changefreq = $params['cat_changefreq']; $node->link = 'index.php?option=com_kunena&view=category&catid=' . $cat->id . '&Itemid=' . $parent->id; $node->secure = $parent->secure; if ($xmap->printNode($node)) { self::getTopics($xmap, $parent, $params, $cat->id); } } $xmap->changeLevel(-1); }
/** * @param XmapDisplayerInterface $xmap * @param stdClass $parent * @param array $params * @param int $parent_id */ private static function getCategoryTree($xmap, stdClass $parent, array &$params, $parent_id) { $db = JFactory::getDbo(); $query = $db->getQuery(true)->select(array('c.id', 'c.name'))->from('#__adsmanager_categories AS c')->where('c.parent = ' . $db->quote($parent_id))->where('c.published = 1')->order('c.ordering'); $db->setQuery($query); $rows = $db->loadObjectList(); $xmap->changeLevel(1); foreach ($rows as $row) { $node = new stdclass(); $node->id = $parent->id; $node->name = $row->name; $node->uid = $parent->uid . '_cid_' . $row->id; $node->browserNav = $parent->browserNav; $node->priority = $params['category_priority']; $node->changefreq = $params['category_changefreq']; $node->link = 'index.php?option=com_adsmanager&view=list&catid=' . $row->id . '&Itemid=' . $parent->id; if ($xmap->printNode($node) !== false) { self::getEntries($xmap, $parent, $params, $row->id); } } $xmap->changeLevel(-1); }
/** * @param XmapDisplayerInterface $xmap * @param stdClass $parent * @param array $params * @param array $catids */ private static function getCategoryTree($xmap, stdClass $parent, array &$params, array $catids) { $db = JFactory::getDBO(); JArrayHelper::toInteger($catids); if (count($catids) == 1 && end($catids) == 0) { $catids = array(1); } $query = $db->getQuery(true)->select(array('id', 'title', 'parent_id'))->from('#__categories')->where('extension = ' . $db->quote('com_simplecalendar'))->order('lft'); if (!empty($catids)) { $query->where('parent_id IN(' . implode(',', $catids) . ')'); } if (!$params['show_unauth']) { $query->where('access IN(' . $params['groups'] . ')'); } $db->setQuery($query); $rows = $db->loadObjectList(); if (empty($rows)) { return; } $xmap->changeLevel(1); foreach ($rows as $row) { $node = new stdclass(); $node->id = $parent->id; $node->name = $row->title; $node->uid = $parent->uid . '_cid_' . $row->id; $node->browserNav = $parent->browserNav; $node->priority = $params['category_priority']; $node->changefreq = $params['category_changefreq']; $node->pid = $row->parent_id; $node->link = SimpleCalendarHelperRoute::getCategoryRoute($row->id); if ($xmap->printNode($node) !== false) { self::getCategoryTree($xmap, $parent, $params, array($row->id)); if ($params['include_events']) { self::getEvents($xmap, $parent, $params, array($row->id)); } } } $xmap->changeLevel(-1); }
/** * @param XmapDisplayerInterface $xmap * @param stdClass $parent * @param array $params * @param int $parent_id * @param int[]|null $ids * * @return bool */ protected static function getCategoryTree($xmap, stdClass $parent, array &$params, $parent_id, $ids = null) { $db = JFactory::getDbo(); $query = $db->getQuery(true)->select(array('c.id', 'c.name', 'c.alias', 'c.parent'))->from('#__k2_categories AS c')->where('c.published = 1')->where('c.trash = 0')->order('c.ordering'); if (!empty($ids)) { $query->where('c.id IN(' . implode(',', $db->quote($ids)) . ')'); } else { $query->where('c.parent =' . $db->quote($parent_id)); } if (!$params['show_unauth']) { $query->where('c.access IN(' . $params['groups'] . ')'); } if ($params['language_filter']) { $query->where('c.language IN(' . $db->quote(JFactory::getLanguage()->getTag()) . ', ' . $db->quote('*') . ')'); } $db->setQuery($query); try { $rows = $db->loadObjectList(); } catch (RuntimeException $e) { return false; } if (empty($rows)) { return false; } $xmap->changeLevel(1); foreach ($rows as $row) { $node = new stdClass(); $node->id = $parent->id; $node->name = $row->name; $node->uid = $parent->uid . '_cid_' . $row->id; $node->browserNav = $parent->browserNav; $node->priority = $params['category_priority']; $node->changefreq = $params['category_changefreq']; $node->pid = $row->parent; $node->link = K2HelperRoute::getCategoryRoute($row->id . ':' . $row->alias); if ($xmap->printNode($node) !== false) { self::getItems($xmap, $parent, $params, 'category', $row->id); } } $xmap->changeLevel(-1); return true; }
/** * @param XmapDisplayerInterface $xmap * @param stdClass $parent * @param array $params * @param $catid */ private static function getEvents($xmap, $parent, array &$params, $catid) { static $datamodel; if (!$datamodel) { $datamodel = new JEventsDataModel(); } $rows = $datamodel->queryModel->listIcalEventsByCat(array($catid)); if (empty($rows)) { return; } $xmap->changeLevel(1); foreach ($rows as $row) { $node = new stdclass(); $node->id = $parent->id; $node->name = $row->title(); $node->uid = $parent->uid . '_' . $row->id; $node->browserNav = $parent->browserNav; $node->priority = $params['event_priority']; $node->changefreq = $params['event_changefreq']; $node->link = $row->viewDetailLink($row->yup(), $row->mup(), $row->dup(), false); $xmap->printNode($node); } $xmap->changeLevel(-1); }
/** * @param XmapDisplayerInterface $xmap * @param stdClass $parent * @param array $params * @param int $parent_id */ private static function getCategoryTree($xmap, stdClass $parent, array &$params, $parent_id) { $db = JFactory::getDbo(); $query = $db->getQuery(true)->select(array('c.id', 'c.alias', 'c.title', 'c.parent_id'))->from('#__phocadownload_categories AS c')->where('c.parent_id = ' . $db->quote($parent_id))->where('c.published = 1')->order('c.ordering'); if (!$params['show_unauth']) { $query->where('c.access IN(' . $params['groups'] . ')'); } if ($params['language_filter']) { $query->where('c.language IN(' . $db->quote(JFactory::getLanguage()->getTag()) . ', ' . $db->quote('*') . ')'); } $db->setQuery($query); $rows = $db->loadObjectList(); if (empty($rows)) { return; } $xmap->changeLevel(1); foreach ($rows as $row) { $node = new stdclass(); $node->id = $parent->id; $node->name = $row->title; $node->uid = $parent->uid . '_cid_' . $row->id; $node->browserNav = $parent->browserNav; $node->priority = $params['category_priority']; $node->changefreq = $params['category_changefreq']; $node->pid = $row->parent_id; $node->link = PhocaDownloadRoute::getCategoryRoute($row->id . ':' . $row->alias); if ($params['itemid_workaround'] && !strstr($node->link, 'Itemid=')) { $node->link .= '&Itemid=' . $parent->id; } if ($xmap->printNode($node) !== false) { self::getDownloads($xmap, $parent, $params, $row->id); } } $xmap->changeLevel(-1); }
/** * @param XmapDisplayerInterface $xmap * @param stdClass $parent * @param array $params * @param int $listid */ private static function getNewsletter($xmap, stdClass $parent, array &$params, $listid) { $db = JFactory::getDbo(); $query = $db->getQuery(true)->select(array('m.subject', 'm.mailid', 'l.listid'))->from('#__acymailing_listmail AS lm')->join('INNER', '#__acymailing_mail AS m ON(m.mailid = lm.mailid)')->join('INNER', '#__acymailing_list AS l ON(lm.listid = l.listid)')->where('l.listid = ' . $db->Quote($listid))->where('l.published = 1')->where('m.published = 1')->order('m.created'); if (!$params['show_unauth']) { $query->where('l.visible = 1'); $query->where('m.visible = 1'); } $db->setQuery($query); $rows = $db->loadObjectList(); if (empty($rows)) { return; } $xmap->changeLevel(1); foreach ($rows as $row) { $node = new stdclass(); $node->id = $parent->id; $node->name = $row->subject; $node->uid = $parent->uid . '_' . $row->mailid; $node->browserNav = $parent->browserNav; $node->priority = $params['newsletter_priority']; $node->changefreq = $params['newsletter_changefreq']; $node->link = 'index.php?option=com_acymailing&ctrl=archive&task=view&listid=' . $row->listid . '&mailid=' . $row->mailid . '&Itemid=' . $parent->id; $xmap->printNode($node); } $xmap->changeLevel(-1); }
/** * @param XmapDisplayerInterface $xmap * @param stdClass $parent * @param array $params * @param array $tagIds * @param array $typesr */ private static function getTagTree($xmap, stdClass $parent, array &$params, array $tagIds, array $typesr = null) { $db = JFactory::getDbo(); $rows = array(); foreach ($tagIds as $tagId) { $listQuery = new JHelperTags(); $query = $listQuery->getTagItemsQuery($tagId, $typesr, false, 'c.core_title', 'ASC', true, $params['language_filter']); $db->setQuery($query); $result = $db->loadObjectList(); if (is_array($result)) { $rows += $result; } } if (empty($rows)) { return; } $xmap->changeLevel(1); foreach ($rows as $row) { $node = new stdclass(); $node->id = $parent->id; $node->name = $row->core_title; $node->uid = $parent->uid . '_' . $row->content_item_id; $node->browserNav = $parent->browserNav; $node->priority = $params['tag_priority']; $node->changefreq = $params['tag_changefreq']; $node->link = TagsHelperRoute::getItemRoute($row->content_item_id, $row->core_alias, $row->core_catid, $row->core_language, $row->type_alias, $row->router); $xmap->printNode($node); } $xmap->changeLevel(-1); }
/** * @param XmapDisplayerInterface $xmap * @param stdClass $parent * @param array $params * @param int $catid * @param string $catAlias */ private static function getImages($xmap, stdClass $parent, array &$params, $catid, $catAlias) { $db = JFactory::getDbo(); $query = $db->getQuery(true)->select(array('g.id', 'g.alias', 'g.title', 'g.filename'))->from('#__phocagallery AS g')->where('g.catid = ' . $db->Quote($catid))->where('g.published = 1')->order('g.ordering'); if ($params['language_filter']) { $query->where('g.language IN(' . $db->quote(JFactory::getLanguage()->getTag()) . ', ' . $db->quote('*') . ')'); } $db->setQuery($query); $rows = $db->loadObjectList(); if (empty($rows)) { return; } $xmap->changeLevel(1); $root = JUri::root() . 'images/phocagallery/'; foreach ($rows as $row) { $node = new stdclass(); $node->id = $parent->id; $node->name = $row->title; $node->uid = $parent->uid . '_' . $row->id; $node->browserNav = $parent->browserNav; $node->priority = $params['image_priority']; $node->changefreq = $params['image_changefreq']; $node->link = PhocaGalleryRoute::getImageRoute($row->id, $catid, $row->alias, $catAlias); if ($params['enable_imagemap']) { $node->isImages = 1; // $node->images can be a array with more than one image $node->images[0] = new stdClass(); $node->images[0]->src = $root . self::setImageSrc($row->filename, $params); $node->images[0]->title = $row->title; } $xmap->printNode($node); } $xmap->changeLevel(-1); }
/** * @param XmapDisplayerInterface $xmap * @param stdCLass $parent * @param array $params * @param int $catid */ public static function getCategoryTree($xmap, stdClass $parent, array &$params, $catid = 0) { // TODO refactor if (!isset($urlBase)) { $urlBase = JURI::base(); } $vendorId = 1; $children = VmModel::getModel('category')->getChildCategoryList($vendorId, $catid); $xmap->changeLevel(1); foreach ($children as $row) { $node = new stdclass(); $node->id = $parent->id; $node->uid = $parent->uid . 'c' . $row->virtuemart_category_id; $node->browserNav = $parent->browserNav; $node->name = stripslashes($row->category_name); $node->priority = $params['cat_priority']; $node->changefreq = $params['cat_changefreq']; $node->expandible = true; $node->link = 'index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $row->virtuemart_category_id . '&Itemid=' . $parent->id; if ($xmap->printNode($node) !== false) { self::getCategoryTree($xmap, $parent, $params, $row->virtuemart_category_id); } } $xmap->changeLevel(-1); if ($params['include_products'] && $catid != 0) { $products = self::$productModel->getProductsInCategory($catid); if ($params['include_product_images']) { self::$categoryModel->addImages($products, 1); } $xmap->changeLevel(1); foreach ($products as $row) { $node = new stdclass(); $node->id = $parent->id; $node->uid = $parent->uid . 'c' . $row->virtuemart_category_id . 'p' . $row->virtuemart_product_id; $node->browserNav = $parent->browserNav; $node->priority = $params['prod_priority']; $node->changefreq = $params['prod_changefreq']; $node->name = $row->product_name; $node->modified = strtotime($row->modified_on); $node->expandible = false; $node->link = 'index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $row->virtuemart_product_id . '&virtuemart_category_id=' . $row->virtuemart_category_id . '&Itemid=' . $parent->id; if ($params['include_product_images']) { foreach ($row->images as $image) { if (isset($image->file_url)) { $imagenode = new stdClass(); $imagenode->src = $urlBase . $image->file_url_thumb; $imagenode->title = $row->product_name; $imagenode->license = $params['product_image_license_url']; $node->images[] = $imagenode; } } } $xmap->printNode($node); } $xmap->changeLevel(-1); } }