public function __construct()
 {
     self::$enabled = JComponentHelper::isEnabled('com_jevents');
     if (self::$enabled) {
         require_once JPATH_SITE . '/components/com_jevents/jevents.defines.php';
     }
 }
Example #2
0
 function getCategoryTree(&$xmap, &$parent, &$params, $catids)
 {
     $menuid = $parent->id;
     $database =& JFactory::getDBO();
     $my =& JFactory::getUser();
     $content = "";
     $enum = 0;
     $xmap->changeLevel(1);
     if (count($catids) != 1) {
         foreach ($catids as $i => $catid) {
             $query = 'SELECT id,name,title FROM ' . '#__categories ' . ' WHERE id = ' . $catid . ' AND section = \'' . JEV_COM_COMPONENT . '\'' . ' AND access<=' . $my->gid . ' ' . 'ORDER BY ordering ';
             $database->setQuery($query);
             $rows = $database->loadRowList();
             $now = time();
             foreach ($rows as $num => $row) {
                 $node = new stdclass();
                 $node->link = "index.php?option=com_jevents&task=cat.listevents&offset=1&category_fv=" . $row[0];
                 $node->name = $row[2];
                 $node->id = $menuid;
                 $node->uid = $parent->uid . 'c' . $row[0];
                 //Unique ID
                 $node->expandible = true;
                 if ($xmap->printNode($node) !== FALSE) {
                     xmap_com_jevents::getCategoryTree($xmap, $parent, $params, array($row[0]));
                 }
             }
         }
     } else {
         $query = 'SELECT id,name,title FROM ' . '#__categories ' . ' WHERE parent_id = ' . $catids[0] . ' AND section = \'' . JEV_COM_COMPONENT . '\'' . ' AND access<=' . $my->gid . ' ' . 'ORDER BY ordering ';
         $database->setQuery($query);
         $rows = $database->loadRowList();
         $now = time();
         foreach ($rows as $num => $row) {
             $node = new stdclass();
             $node->link = "index.php?option=com_jevents&task=cat.listevents&offset=1&category_fv=" . $row[0];
             $node->name = $row[2];
             $node->id = $menuid;
             $node->uid = $parent->uid . 'c' . $row[0];
             //Unique ID
             $node->expandible = true;
             if ($xmap->printNode($node) !== FALSE) {
                 xmap_com_jevents::getCategoryTree($xmap, $parent, $params, array($row[0]));
             }
         }
         if ($params['include_events'] && count($catids) == 1 && $catids[0]) {
             $rows =& xmap_com_jevents::getCategoryEvents($menuid, $catids);
             foreach ($rows as $row) {
                 $node = new stdclass();
                 $node->link = $row->viewDetailLink($row->yup(), $row->mup(), $row->dup(), false);
                 $node->name = $row->title();
                 $node->id = $menuid;
                 $node->uid = $parent->uid . 'e' . $row->id();
                 //Unique ID
                 $node->priority = $parent->priority;
                 $node->changefreq = $parent->changefreq;
                 $node->expandible = false;
                 $xmap->printNode($node);
             }
         }
     }
     $xmap->changeLevel(-1);
 }