Exemplo n.º 1
0
 /**
  *
  */
 public function __construct()
 {
     if (self::$cs) {
         Sobi::Error('mainframe', SPLang::e('CRITICAL_SECTION'), SPC::ERROR, 500, __LINE__, __CLASS__);
     } else {
         self::$cs = true;
         self::$cs = false;
     }
 }
Exemplo n.º 2
0
 /**
  * @param string $title
  * @param bool $forceAdd
  * @return void
  */
 public function setTitle($title, $forceAdd = false)
 {
     if (defined('SOBIPRO_ADM')) {
         if (is_array($title)) {
             $title = implode(' ', $title);
         }
         static $section = null;
         if (!$section) {
             $section = Sobi::Section(true);
         }
         if (strlen($section) && !strstr($title, $section)) {
             if (strlen($title)) {
                 $title = "SobiPro [{$section}] - {$title}";
             } else {
                 $title = "SobiPro [{$section}]";
             }
         } else {
             $title = 'SobiPro - ' . $title;
         }
         JToolbarHelper::title($title);
     } else {
         parent::setTitle($title, $forceAdd);
     }
 }
Exemplo n.º 3
0
 /** SobiPro support */
 function getCategoryTree($xmap, $parent, $sid, &$params)
 {
     $database =& JFactory::getDBO();
     $query = "SELECT a.id,a.nid, a.name, b.pid as pid " . "\n FROM #__sobipro_object AS a, #__sobipro_relations AS b " . "\n WHERE a.parent={$sid}" . "   AND a.oType='category'" . "   AND b.oType=a.oType" . "   AND a.state=1 " . "   AND a.approved=1 " . "\n AND a.id=b.id " . "\n ORDER BY b.position ASC";
     $database->setQuery($query);
     $rows = $database->loadObjectList();
     $modified = time();
     $xmap->changeLevel(1);
     foreach ($rows as $row) {
         $node = new stdclass();
         $node->id = $parent->id;
         $node->uid = 'com_sobiproc' . $row->id;
         // Unique ID
         $node->browserNav = $parent->browserNav;
         $node->name = html_entity_decode($row->name);
         $node->modified = $modified;
         #$node->link = 'index.php?option=com_sobipro&sid='.$row->id.':'.trim( SPLang::urlSafe( $row->name ) ).'&Itemid='.$parent->id;
         $node->link = SPJoomlaMainFrame::url(array('sid' => $row->id, 'title' => $row->name), false, false);
         $node->priority = $params['cat_priority'];
         $node->changefreq = $params['cat_changefreq'];
         $node->expandible = true;
         $node->secure = $parent->secure;
         if ($xmap->printNode($node) !== FALSE) {
             xmap_com_sobipro::getCategoryTree($xmap, $parent, $row->id, $params);
         }
     }
     if ($params['include_entries']) {
         $query = "SELECT a.id, c.baseData as name,a.updatedTime as modified,b.validSince as publish_up, b.pid as catid  " . "\n FROM #__sobipro_object AS a, #__sobipro_relations AS b, #__sobipro_field_data c" . "\n WHERE a.state=1 " . "\n AND a.id=b.id " . "\n AND b.oType = 'entry'" . "\n AND b.pid = {$sid}" . "\n AND a.approved=1 " . "\n AND (a.validUntil>='{$params['now']}' or a.validUntil='0000-00-00 00:00:00' ) " . "\n AND (a.validSince<='{$params['now']}' or a.validSince='0000-00-00 00:00:00' ) " . "\n AND a.id=c.sid AND c.fid=" . self::$sectionConfig['name_field']->sValue . "\n AND c.section=" . self::$sectionConfig['name_field']->section . $params['days'] . "\n ORDER BY " . $params['ordering'] . $params['limit'];
         $database->setQuery($query);
         $rows = $database->loadObjectList();
         foreach ($rows as $row) {
             $node = new stdclass();
             $node->id = $parent->id;
             $node->uid = 'com_sobiproe' . $row->id;
             // Unique ID
             $node->browserNav = $parent->browserNav;
             $node->name = html_entity_decode($row->name);
             $node->modified = $row->modified ? $row->modified : $row->publish_up;
             $node->priority = $params['entry_priority'];
             $node->changefreq = $params['entry_changefreq'];
             $node->expandible = false;
             $node->secure = $parent->secure;
             # $node->link = 'index.php?option=com_sobipro&pid='.$row->catid . '&sid=' . $row->id.':'.trim( SPLang::urlSafe( $row->name )).'&Itemid='.$parent->id;
             $node->link = SPJoomlaMainFrame::url(array('sid' => $row->id, 'pid' => $row->catid, 'title' => $row->name), false, false);
             $xmap->printNode($node);
         }
     }
     $xmap->changeLevel(-1);
 }