Beispiel #1
0
 function setJView($view)
 {
     parent::setJView($view);
     $columns = $this->sitemap->params->get('columns', 0);
     if ($columns > 1) {
         // calculate column widths
         $total = count($view->items);
         $columns = $total < $columns ? $total : $columns;
         $this->_width = 100 / $columns - 1;
         $this->sitemap->params->set('columns', $columns);
     }
 }
Beispiel #2
0
 function __construct($config, $sitemap)
 {
     parent::__construct($config, $sitemap);
     $this->uids = array();
     $this->defaultLanguage = strtolower(JFactory::getLanguage()->getTag());
     if (preg_match('/^([a-z]+)-.*/', $this->defaultLanguage, $matches) && !in_array($this->defaultLanguage, array(' zh-cn', ' zh-tw'))) {
         $this->defaultLanguage = $matches[1];
     }
     $this->showTitle = JRequest::getBool('filter_showtitle', 0);
     $this->showExcluded = JRequest::getBool('filter_showexcluded', 0);
     $db = JFactory::getDbo();
     $this->nullDate = $db->getNullDate();
 }
Beispiel #3
0
 function toggleItem($uid, $itemid)
 {
     $app = JFactory::getApplication('site');
     $sitemap = $this->getItem();
     $displayer = new OSMapDisplayer($app->getParams(), $sitemap);
     $excludedItems = $displayer->getExcludedItems();
     if (isset($excludedItems[$itemid])) {
         $excludedItems[$itemid] = (array) $excludedItems[$itemid];
     }
     if (!$displayer->isExcluded($itemid, $uid)) {
         $excludedItems[$itemid][] = $uid;
         $state = 0;
     } else {
         if (is_array($excludedItems[$itemid]) && count($excludedItems[$itemid])) {
             $excludedItems[$itemid] = array_filter($excludedItems[$itemid], create_function('$var', 'return ($var != \'' . $uid . '\');'));
         } else {
             unset($excludedItems[$itemid]);
         }
         $state = 1;
     }
     $registry = new JRegistry('_default');
     $registry->loadArray($excludedItems);
     $str = $registry->toString();
     $db = JFactory::getDBO();
     $query = "UPDATE #__osmap_sitemap set excluded_items='" . $db->escape($str) . "' where id=" . $sitemap->id;
     $db->setQuery($query);
     $db->query();
     return $state;
 }
Beispiel #4
0
 function __construct(&$config, &$sitemap)
 {
     $this->_list = array();
     $this->view = 'navigator';
     parent::__construct($config, $sitemap);
 }