AAAA.htaccess000066600000000177151372040110006345 0ustar00 Order allow,deny Deny from all displayer.php000066600000020047151372040110007252 0ustar00get('id'))); $date = new JDate(); $this->userLevels = (array)$user->getAuthorisedViewLevels(); // Deprecated: should use userLevels from now on // $this->gid = $user->gid; $this->now = $date->toUnix(); $this->config = $config; $this->sitemap = $sitemap; $this->isNews = false; $this->isImages = false; $this->count = 0; $this->canEdit = false; } public function printNode( &$node ) { return false; } public function printSitemap() { foreach ($this->jview->items as $menutype => &$items) { $node = new stdclass(); $node->uid = "menu-".$menutype; $node->menutype = $menutype; $node->priority = null; $node->changefreq = null; // $node->priority = $menu->priority; // $node->changefreq = $menu->changefreq; $node->browserNav = 3; $node->type = 'separator'; /** * @todo allow the user to provide the module used to display that menu, or some other * workaround */ $node->name = $this->getMenuTitle($menutype,'mod_menu'); // Get the name of this menu $this->startMenu($node); $this->printMenuTree($node, $items); $this->endMenu($node); } } public function setJView($view) { $this->jview = $view; } public function getMenuTitle($menutype,$module='mod_menu') { $app = JFactory::getApplication(); $db = JFactory::getDbo(); $title = $extra = ''; // Filter by language if ($app->getLanguageFilter()) { $extra = ' AND language in ('.$db->quote(JFactory::getLanguage()->getTag()).','.$db->quote('*').')'; } $db->setQuery( "SELECT * FROM #__modules WHERE module='{$module}' AND params " ."LIKE '%\"menutype\":\"{$menutype}\"%' AND access IN (".implode(',',$this->userLevels).") " ."AND published=1 AND client_id=0 " . $extra . "LIMIT 1" ); $module = $db->loadObject(); if ($module) { $title = $module->title; } return $title; } protected function startMenu(&$node) { return true; } protected function endMenu(&$node) { return true; } protected function printMenuTree($menu,&$items) { $this->changeLevel(1); $router = JSite::getRouter(); foreach ( $items as $i => $item ) { // Add each menu entry to the root tree. $excludeExternal = false; $node = new stdclass; $node->id = $item->id; $node->uid = $item->uid; $node->name = $item->title; // displayed name of node // $node->parent = $item->parent; // id of parent node $node->browserNav = $item->browserNav; // how to open link $node->priority = $item->priority; $node->changefreq = $item->changefreq; $node->type = $item->type; // menuentry-type $node->menutype = $menu->menutype; // menuentry-type $node->home = $item->home; // If it's a home menu entry // $node->link = isset( $item->link ) ? htmlspecialchars( $item->link ) : ''; $node->link = $item->link; $node->option = $item->option; $node->modified = @$item->modified; $node->secure = $item->params->get('secure'); // New on Xmap 2.0: send the menu params $node->params =& $item->params; if ($node->home == 1) { // Correct the URL for the home page. $node->link = JURI::base(); } switch ($item->type) { case 'separator': $node->browserNav=3; break; case 'url': if ((strpos($item->link, 'index.php?') === 0) && (strpos($item->link, 'Itemid=') === false)) { // If this is an internal Joomla link, ensure the Itemid is set. $node->link = $node->link.'&Itemid='.$node->id; } else { $excludeExternal = ($this->view == 'xml'); } break; case 'alias': // If this is an alias use the item id stored in the parameters to make the link. $node->link = 'index.php?Itemid='.$item->params->get('aliasoptions'); break; default: if ($router->getMode() == JROUTER_MODE_SEF) { $node->link = 'index.php?Itemid='.$node->id; } elseif (!$node->home) { $node->link .= '&Itemid='.$node->id; } break; } if ($excludeExternal || $this->printNode($node)) { //Restore the original link $node->link = $item->link; $this->printMenuTree($node,$item->items); $matches=array(); //if ( preg_match('#^/?index.php.*option=(com_[^&]+)#',$node->link,$matches) ) { if ( $node->option ) { if ( !empty($this->jview->extensions[$node->option]) ) { $node->uid = $node->option; $className = 'xmap_'.$node->option; $result = call_user_func_array(array($className, 'getTree'),array(&$this,&$node,&$this->jview->extensions[$node->option]->params)); } } //XmapPlugins::printTree( $this, $node, $this->jview->extensions ); // Determine the menu entry's type and call it's handler } } $this->changeLevel(-1); } public function changeLevel($step) { return true; } public function getCount() { return $this->count; } public function &getExcludedItems() { static $_excluded_items; if (!isset($_excluded_items)) { $_excluded_items = array(); $registry = new JRegistry('_default'); $registry->loadString($this->sitemap->excluded_items); $_excluded_items = $registry->toArray(); } return $_excluded_items; } public function isExcluded($itemid,$uid) { $excludedItems = $this->getExcludedItems(); $items = NULL; if (!empty($excludedItems[$itemid])) { if (is_object($excludedItems[$itemid])) { $excludedItems[$itemid] = (array) $excludedItems[$itemid]; } $items =& $excludedItems[$itemid]; } if (!$items) { return false; } return ( in_array($uid, $items)); } } metadata.xml000066600000000076151372040110007047 0ustar00 controller.php000066600000003623151372040110007442 0ustar00get('id') || !in_array($viewName, array('html', 'xml')) || $viewLayout == 'xsl') { $cachable = false; } if ($viewName) { $document = JFactory::getDocument(); $viewType = $document->getType(); $view = $this->getView($viewName, $viewType, '', array('base_path' => $this->basePath, 'layout' => $viewLayout)); $sitemapmodel = $this->getModel('Sitemap'); $view->setModel($sitemapmodel, true); } $safeurlparams = array('id' => 'INT', 'itemid' => 'INT', 'uid' => 'CMD', 'action' => 'CMD', 'property' => 'CMD', 'value' => 'CMD'); parent::display($cachable, $safeurlparams); return $this; } } helpers/.htaccess000066600000000177151372040110010007 0ustar00 Order allow,deny Deny from all helpers/index.html000066600000000036151372040110010200 0ustar00helpers/xmap.php000066600000020333151372040110007663 0ustar00 $menuOptions) { // Initialize variables. // Get the menu items as a tree. $query = $db->getQuery(true); $query->select( 'n.id, n.title, n.alias, n.path, n.level, n.link, ' . 'n.type, n.params, n.home, n.parent_id' . ',n.'.$db->quoteName('browserNav') ); $query->from('#__menu AS n'); $query->join('INNER', ' #__menu AS p ON p.lft = 0'); $query->where('n.lft > p.lft'); $query->where('n.lft < p.rgt'); $query->order('n.lft'); // Filter over the appropriate menu. $query->where('n.menutype = ' . $db->quote($menutype)); // Filter over authorized access levels and publishing state. $query->where('n.published = 1'); $query->where('n.access IN (' . implode(',', (array) $user->getAuthorisedViewLevels()) . ')'); // Filter by language if ($app->getLanguageFilter()) { $query->where('n.language in ('.$db->quote(JFactory::getLanguage()->getTag()).','.$db->quote('*').')'); } // Get the list of menu items. $db->setQuery($query); $tmpList = $db->loadObjectList('id'); $list[$menutype] = array(); // Check for a database error. if ($db->getErrorNum()) { JError::raiseWarning(021, $db->getErrorMsg()); return array(); } // Set some values to make nested HTML rendering easier. foreach ($tmpList as $id => $item) { $item->items = array(); $params = new JRegistry($item->params); $item->uid = 'itemid'.$item->id; if (preg_match('#^/?index.php.*option=(com_[^&]+)#', $item->link, $matches)) { $item->option = $matches[1]; $componentParams = clone(JComponentHelper::getParams($item->option)); $componentParams->merge($params); //$params->merge($componentParams); $params = $componentParams; } else { $item->option = null; } $item->params = $params; if ($item->type != 'separator') { $item->priority = $menuOptions['priority']; $item->changefreq = $menuOptions['changefreq']; XmapHelper::prepareMenuItem($item); } else { $item->priority = null; $item->changefreq = null; } if ($item->parent_id > 1) { $tmpList[$item->parent_id]->items[$item->id] = $item; } else { $list[$menutype][$item->id] = $item; } } } return $list; } public static function &getExtensions() { static $list; jimport('joomla.html.parameter'); if ($list != null) { return $list; } $db = JFactory::getDBO(); $list = array(); // Get the menu items as a tree. $query = $db->getQuery(true); $query->select('*'); $query->from('#__extensions AS n'); $query->where('n.folder = \'xmap\''); $query->where('n.enabled = 1'); // Get the list of menu items. $db->setQuery($query); $extensions = $db->loadObjectList('element'); foreach ($extensions as $element => $extension) { if (file_exists(JPATH_PLUGINS . '/' . $extension->folder . '/' . $element. '/'. $element . '.php')) { require_once(JPATH_PLUGINS . '/' . $extension->folder . '/' . $element. '/'. $element . '.php'); $params = new JRegistry($extension->params); $extension->params = $params->toArray(); $list[$element] = $extension; } } return $list; } /** * Call the function prepareMenuItem of the extension for the item (if any) * * @param object Menu item object * * @return void */ public static function prepareMenuItem($item) { $extensions = XmapHelper::getExtensions(); if (!empty($extensions[$item->option])) { $className = 'xmap_' . $item->option; $obj = new $className; if (method_exists($obj, 'prepareMenuItem')) { $obj->prepareMenuItem($item,$extensions[$item->option]->params); } } } static function getImages($text,$max) { if (!isset($urlBase)) { $urlBase = JURI::base(); $urlBaseLen = strlen($urlBase); } $images = null; $matches = $matches1 = $matches2 = array(); // Look tags preg_match_all('/]*?(?:(?:[^>]*src="(?P[^"]+)")|(?:[^>]*alt="(?P[^"]+)")|(?:[^>]*title="(?P[^"]+)"))+[^>]*>/i', $text, $matches1, PREG_SET_ORDER); // Loog for <a> tags with href to images preg_match_all('/<a[^>]*?(?:(?:[^>]*href="(?P<src>[^"]+\.(gif|png|jpg|jpeg))")|(?:[^>]*alt="(?P<alt>[^"]+)")|(?:[^>]*title="(?P<title>[^"]+)"))+[^>]*>/i', $text, $matches2, PREG_SET_ORDER); $matches = array_merge($matches1,$matches2); if (count($matches)) { $images = array(); $count = count($matches); $j = 0; for ($i = 0; $i < $count && $j < $max; $i++) { if (trim($matches[$i]['src']) && (substr($matches[$i]['src'], 0, 1) == '/' || !preg_match('/^https?:\/\//i', $matches[$i]['src']) || substr($matches[$i]['src'], 0, $urlBaseLen) == $urlBase)) { $src = $matches[$i]['src']; if (substr($src, 0, 1) == '/') { $src = substr($src, 1); } if (!preg_match('/^https?:\//i', $src)) { $src = $urlBase . $src; } $image = new stdClass; $image->src = $src; $image->title = (isset($matches[$i]['title']) ? $matches[$i]['title'] : @$matches[$i]['alt']); $images[] = $image; $j++; } } } return $images; } static function getPagebreaks($text,$baseLink) { $matches = $subnodes = array(); if (preg_match_all( '/<hr\s*[^>]*?(?:(?:\s*alt="(?P<alt>[^"]+)")|(?:\s*title="(?P<title>[^"]+)"))+[^>]*>/i', $text, $matches, PREG_SET_ORDER) ) { $i = 2; foreach ($matches as $match) { if (strpos($match[0], 'class="system-pagebreak"') !== FALSE) { $link = $baseLink . '&limitstart=' . ($i - 1); if (@$match['alt']) { $title = stripslashes($match['alt']); } elseif (@$match['title']) { $title = stripslashes($match['title']); } else { $title = JText::sprintf('Page #', $i); } $subnode = new stdclass(); $subnode->name = $title; $subnode->expandible = false; $subnode->link = $link; $subnodes[] = $subnode; $i++; } } } return $subnodes; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������index.html������������������������������������������������������������������������������������������0000666�����������������00000000036�15137204011�0006536 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!DOCTYPE html><title>assets/images/img_blue.gif000066600000000111151372040110011554 0ustar00GIF89a f!, @&`B ֵ*.Dv!z;assets/images/img_grey.gif000066600000000112151372040110011574 0ustar00GIF89a !, @`B!ֵ*.`=#]H;assets/images/sortdown.gif000066600000000133151372040110011654 0ustar00GIF89a 'xy]^!, @ 0BfĹ:[' 4hXY|Sd;assets/images/arrow.gif000066600000001524151372040110011134 0ustar00GIF89a3f3333f333ff3fffff3f3f̙3f3333f3333333333f3333333f3f33ff3f3f3f3333f3333333f3̙333333f333ff3ffffff3f33f3ff3f3f3ffff3fffffffffff3fffffff3fff̙ffff3fffff3f̙3333f33̙3ff3ffff̙f3f̙3f̙̙3f̙3f3333f333ff3fffff̙̙3̙f̙̙̙3f̙3f3f3333f333ff3fffff3f3f̙3f,9H*\Ȑ#Jŋ1#B5&@B?L.Ӱ˗ ;assets/images/unpublished.png000066600000001114151372040110012336 0ustar00PNG  IHDR(-SsBITOPLTE もRR:: 夤((tt%%66붶oo 䒒CCcc??{{))33mmHH\\rr22;;LL99** ##{{))MM88ffssta`assets/images/txt_blue.gif000066600000000072151372040110011625 0ustar00GIF89a 33!, @ ~42Kߕ ;assets/images/tick.png000066600000000777151372040110010764 0ustar00PNG  IHDR(-SsBITOPLTEL ֥Rԟc ~V `k/W߲֖}_]g$渌PP ݱ\ vBr[\T I׃ߩ\RW l%Ұp5΄aT`8tRNS em pHYs  ~tEXtSoftwareMacromedia Fireworks 8hxIDATcE h|C4e6Tci-mn3YX4@HCRF`k5y@|a55~;LX}UKu$%%吜.oćEQ89Ř1} & <IENDB`assets/images/txt_grey.gif000066600000000072151372040110011644 0ustar00GIF89a !, {Q"yP;assets/images/img_orange.gif000066600000000112151372040110012101 0ustar00GIF89a  !, @&LH(Zt=Sa;assets/images/img_red.gif000066600000000112151372040110011400 0ustar00GIF89a 3X!, @&LH(Zt=Sa;assets/images/img_green.gif000066600000000130151372040110011726 0ustar00GIF89a f3!, @HoE5Th,\29@6]1f$;assets/images/txt_green.gif000066600000000072151372040110011776 0ustar00GIF89a f!, @ ~42Kߕ ;assets/images/.htaccess000066600000000177151372040110011114 0ustar00 Order allow,deny Deny from all assets/images/sortup.gif000066600000000166151372040110011337 0ustar00GIF89a 'xy]^!, @#I#=BPM1zGc[O;assets/images/txt_red.gif000066600000000072151372040110011450 0ustar00GIF89a !, {Q"yP;assets/images/txt_orange.gif000066600000000072151372040110012151 0ustar00GIF89a }!, @ ~42Kߕ ;assets/index.html000066600000000036151372040110010040 0ustar00assets/css/.htaccess000066600000000177151372040110010437 0ustar00 Order allow,deny Deny from all assets/css/xmap.css000066600000001104151372040110010307 0ustar00/* list-style: pos1 pos2 po3; * parameter: * pos1: none | disc | circle | square * pos2: inside | outside * pos3: none | url('arrow.gif') * more info under: http://www.w3schools.com/css/css_list.asp */ #xmap ul { display : block; list-style : none; margin : 0; padding : 0; } #xmap ul li { margin : 0; padding : 0; background : transparent; } #xmap a img { border : none; } #xmap ul.level_0 ul { list-style : inside square; padding : 0; } #xmap ul.level_1 li { padding : 0 1em 0 1em; } #xmap .active { font-style : italic; } assets/css/index.html000066600000000036151372040110010630 0ustar00assets/xsl/gssadmin.xsl000066600000031565151372040110011221 0ustar00 Google Sitemap File

Site Map

Number of URLs in this Sitemap:

Sitemap URL Last modification date Change freq. Priority
assets/xsl/index.html000066600000000036151372040110010646 0ustar00assets/xsl/.htaccess000066600000000177151372040110010455 0ustar00 Order allow,deny Deny from all assets/xsl/gss.xsl000066600000017573151372040110010213 0ustar00 Google Sitemap File

Site Map

Number of URLs in this Sitemap:

Sitemap URL Last modification date Change freq. Priority
assets/.htaccess000066600000000177151372040110007647 0ustar00 Order allow,deny Deny from all views/index.html000066600000000036151372040110007673 0ustar00views/.htaccess000066600000000177151372040110007502 0ustar00 Order allow,deny Deny from all views/html/index.html000066600000000036151372040110010637 0ustar00views/html/.htaccess000066600000000177151372040110010446 0ustar00 Order allow,deny Deny from all views/html/view.html.php000066600000011014151372040110011266 0ustar00app = JFactory::getApplication(); $this->user = JFactory::getUser(); $doc = JFactory::getDocument(); // Get view related request variables. $this->print = JRequest::getBool('print'); // Get model data. $this->state = $this->get('State'); $this->item = $this->get('Item'); $this->items = $this->get('Items'); $this->canEdit = JFactory::getUser()->authorise('core.admin', 'com_xmap'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseWarning(500, implode("\n", $errors)); return false; } $this->extensions = $this->get('Extensions'); // Add router helpers. $this->item->slug = $this->item->alias ? ($this->item->id . ':' . $this->item->alias) : $this->item->id; $this->item->rlink = JRoute::_('index.php?option=com_xmap&view=html&id=' . $this->item->slug); // Create a shortcut to the paramemters. $params = &$this->state->params; $offset = $this->state->get('page.offset'); if ($params->get('include_css', 0)){ $doc->addStyleSheet(JURI::root().'components/com_xmap/assets/css/xmap.css'); } // If a guest user, they may be able to log in to view the full article // TODO: Does this satisfy the show not auth setting? if (!$this->item->params->get('access-view')) { if ($user->get('guest')) { // Redirect to login $uri = JFactory::getURI(); $app->redirect( 'index.php?option=com_users&view=login&return=' . base64_encode($uri), JText::_('Xmap_Error_Login_to_view_sitemap') ); return; } else { JError::raiseWarning(403, JText::_('Xmap_Error_Not_auth')); return; } } // Override the layout. if ($layout = $params->get('layout')) { $this->setLayout($layout); } // Load the class used to display the sitemap $this->loadTemplate('class'); $this->displayer = new XmapHtmlDisplayer($params, $this->item); $this->displayer->setJView($this); $this->displayer->canEdit = $this->canEdit; $this->_prepareDocument(); parent::display($tpl); $model = $this->getModel(); $model->hit($this->displayer->getCount()); } /** * Prepares the document */ protected function _prepareDocument() { $app = JFactory::getApplication(); $pathway = $app->getPathway(); $menus = $app->getMenu(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself if ($menu = $menus->getActive()) { if (isset($menu->query['view']) && isset($menu->query['id'])) { if ($menu->query['view'] == 'html' && $menu->query['id'] == $this->item->id) { $menuParams = new JRegistry($menu->params); $title = $menuParams->get('page_title'); $this->document->setDescription($menuParams->get('menu-meta_description')); $this->document->setMetadata('keywords', $menuParams->get('menu-meta_keywords')); } } } if (empty($title)) { $title = $this->item->title; } $this->document->setTitle($title); if ($app->getCfg('MetaTitle') == '1') { $this->document->setMetaData('title', $this->item->title); } if ($this->print) { $this->document->setMetaData('robots', 'noindex, nofollow'); } } } views/html/metadata.xml000066600000000312151372040110011141 0ustar00 views/html/tmpl/default_class.php000066600000014670151372040110013151 0ustar00view = 'html'; parent::__construct($config, $sitemap); $this->_parent_children=array(); $this->_last_child=array(); $this->live_site = substr_replace(JURI::root(), "", -1, 1); $user = JFactory::getUser(); } 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); } } /** * Prints one node of the sitemap * * * @param object $node * @return boolean */ function printNode( &$node ) { $out = ''; if ($this->isExcluded($node->id,$node->uid) && !$this->canEdit) { return FALSE; } // To avoid duplicate children in the same parent if ( !empty($this->_parent_children[$this->level][$node->uid]) ) { return FALSE; } //var_dump($this->_parent_children[$this->level]); $this->_parent_children[$this->level][$node->uid] = true; $out .= $this->_closeItem; $out .= $this->_openList; $this->_openList = ""; $out .= '
  • '; if( !isset($node->browserNav) ) $node->browserNav = 0; if ($node->browserNav != 3) { $link = JRoute::_($node->link, true, @$node->secure); } $node->name = htmlspecialchars($node->name); switch( $node->browserNav ) { case 1: // open url in new window $ext_image = ''; if ( $this->sitemap->params->get('exlinks') ) { $ext_image = ' ' . JText::_('COM_XMAP_SHOW_AS_EXTERN_ALT') . ''; } $out .= ''. $node->name . $ext_image .''; break; case 2: // open url in javascript popup window $ext_image = ''; if( $this->sitemap->params->get('exlinks') ) { $ext_image = ' ' . JText::_('COM_XMAP_SHOW_AS_EXTERN_ALT') . ''; } $out .= '". $node->name . $ext_image.""; break; case 3: // no link $out .= ''. $node->name .''; break; default: // open url in parent window $out .= ''. $node->name .''; break; } $this->_closeItem = "
  • \n"; $this->_childs[$this->level]++; echo $out; if ($this->canEdit) { if ( $this->isExcluded($node->id,$node->uid) ) { $img = 'v'; $class= 'xmapexclon'; } else { $img = 'x'; $class= 'xmapexcloff'; } echo ' '.$img.''; } $this->count++; $this->_last_child[$this->level] = $node->uid; return TRUE; } /** * Moves sitemap level up or down */ function changeLevel( $level ) { if ( $level > 0 ) { # We do not print start ul here to avoid empty list, it's printed at the first child $this->level += $level; $this->_childs[$this->level]=0; $this->_openList = "\n
      level."\">\n"; $this->_closeItem = ''; // If we are moving up, then lets clean the children of this level // because for sure this is a new set of links if ( empty ($this->_last_child[$this->level-1]) || empty ($this->_parent_children[$this->level]['parent']) || $this->_parent_children[$this->level]['parent'] != $this->_last_child[$this->level-1] ) { $this->_parent_children[$this->level]=array(); $this->_parent_children[$this->level]['parent'] = @$this->_last_child[$this->level-1]; } } else { if ($this->_childs[$this->level]){ echo $this->_closeItem."
    \n"; } $this->_closeItem =''; $this->_openList = ''; $this->level += $level; } } function startMenu(&$menu) { if( $this->sitemap->params->get('columns') > 1 ) // use columns echo '
    '; if( $this->sitemap->params->get('show_menutitle') ) // show menu titles echo ''; } function endMenu(&$menu) { $sitemap=&$this->sitemap; $this->_closeItem=''; if( $sitemap->params->get('columns')> 1 ) { echo "
    \n"; } } } views/html/tmpl/.htaccess000066600000000177151372040110011422 0ustar00 Order allow,deny Deny from all views/html/tmpl/index.html000066600000000036151372040110011613 0ustar00views/html/tmpl/default_items.php000066600000000766151372040110013166 0ustar00state->get('params'); // Use the class defined in default_class.php to print the sitemap $this->displayer->printSitemap();views/html/tmpl/default.xml000066600000002314151372040110011765 0ustar00
    views/html/tmpl/default.php000066600000006612151372040110011761 0ustar00item->params; if ($this->displayer->canEdit) { $live_site = JURI::root(); JHTML::_('behavior.framework', true); $ajaxurl = "{$live_site}index.php?option=com_xmap&format=json&task=ajax.editElement&action=toggleElement&".JSession::getFormToken().'=1'; $css = '.xmapexcl img{ border:0px; }'."\n"; $css .= '.xmapexcloff { text-decoration:line-through; }'; //$css .= "\n.".$this->item->classname .' li {float:left;}'; $js = " window.addEvent('domready',function (){ $$('.xmapexcl').each(function(el){ el.onclick = function(){ if (this && this.rel) { options = JSON.decode(this.rel); this.onComplete = checkExcludeResult var myAjax = new Request.JSON({ url:'{$ajaxurl}', onSuccess: checkExcludeResult.bind(this) }).get({id:{$this->item->id},uid:options.uid,itemid:options.itemid}); } return false; }; }); }); checkExcludeResult = function (response) { //this.set('class','xmapexcl xmapexcloff'); var imgs = this.getElementsByTagName('img'); if (response.result == 'OK') { var state = response.state; if (state==0) { imgs[0].src='{$live_site}/components/com_xmap/assets/images/unpublished.png'; } else { imgs[0].src='{$live_site}/components/com_xmap/assets/images/tick.png'; } } else { alert('The element couldn\\'t be published or upublished!'); } }"; $doc = JFactory::getDocument(); $doc->addStyleDeclaration ($css); $doc->addScriptDeclaration ($js); } ?>
    get('show_page_heading', 1) && $params->get('page_heading') != '') : ?>

    escape($params->get('page_heading')); ?>

    get('access-edit') || $params->get('show_title') || $params->get('show_print_icon') || $params->get('show_email_icon')) : ?>
      print) : ?> get('show_print_icon')) : ?>
    • item, $params); ?>
    • get('show_email_icon')) : ?>
    • item, $params); ?>
    • item, $params); ?>
    get('showintro', 1) ) : ?> item->introtext; ?> loadTemplate('items'); ?>  
    views/xml/index.html000066600000000036151372040110010473 0ustar00views/xml/tmpl/.htaccess000066600000000177151372040110011256 0ustar00 Order allow,deny Deny from all views/xml/tmpl/default_xsl.php000066600000046143151372040110012506 0ustar00canEdit && JRequest::getBool('filter_showtitle', 0); $showExcluded = $this->canEdit && JRequest::getBool('filter_showexcluded', 0); echo '',"\n"; ?> <?php echo JText::_('COM_XMAP_XML_FILE'); ?> isImages): ?> canEdit): ?> isImages): ?> canEdit): ?>
    canEdit): ?> Images
    -
    views/xml/tmpl/index.html000066600000000036151372040110011447 0ustar00views/xml/tmpl/default_class.php000066600000017531151372040110013004 0ustar00uids = 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(); } /** * Prints an XML node for the sitemap * * @param stdclass $node */ function printNode($node) { $node->isExcluded = false; if ($this->isExcluded($node->id,$node->uid)) { if (!$this->showExcluded || !$this->canEdit) { return false; } $node->isExcluded = true; } if ($this->isNews && (!isset($node->newsItem) || !$node->newsItem)) { return true; } // For images sitemaps only display pages with images if ($this->isImages && (!isset($node->images) || !count($node->images))) { return true; } // Get the item's URL $link = JRoute::_($node->link, true, @$node->secure==0? -1: $node->secure); if (!isset($node->browserNav)) $node->browserNav = 0; if ($node->browserNav != 3 // ignore "no link" && empty($this->_links[$link])) { // ignore links that have been added already $this->count++; $this->_links[$link] = 1; if (!isset($node->priority)) $node->priority = "0.5"; if (!isset($node->changefreq)) $node->changefreq = 'daily'; // Get the chancefrequency and priority for this item $changefreq = $this->getProperty('changefreq', $node->changefreq, $node->id, 'xml', $node->uid); $priority = $this->getProperty('priority', $node->priority, $node->id, 'xml', $node->uid); echo '' . "\n"; echo '', $link, '' . "\n"; if ($this->canEdit) { if ($this->showTitle) { echo '<![CDATA['.$node->name.']]>' . "\n"; } if ($this->showExcluded) { echo '',($node->isExcluded? 'excluded':''),''; } echo '', $node->uid, '' . "\n"; echo '', $node->id, '' . "\n"; } $modified = (isset($node->modified) && $node->modified != FALSE && $node->modified != $this->nullDate && $node->modified != -1) ? $node->modified : NULL; if (!$modified && $this->isNews) { $modified = time(); } if ($modified && !is_numeric($modified)){ $date = new JDate($modified); $modified = $date->toUnix(); } if ($modified) { $modified = gmdate('Y-m-d\TH:i:s\Z', $modified); } // If this is not a news sitemap if (!$this->isNews) { if ($this->isImages) { foreach ($node->images as $image) { echo '', "\n"; echo '', $image->src, '', "\n"; if ($image->title) { $image->title = str_replace('&', '&', html_entity_decode($image->title, ENT_NOQUOTES, 'UTF-8')); echo '', $image->title, '', "\n"; } else { echo ''; } if (isset($image->license) && $image->license) { echo '',str_replace('&', '&',html_entity_decode($image->license, ENT_NOQUOTES, 'UTF-8')),'',"\n"; } echo '', "\n"; } } else { if ($modified){ echo '', $modified, '' . "\n"; } echo '', $changefreq, '' . "\n"; echo '', $priority, '' . "\n"; } } else { if (isset($node->keywords)) { $keywords = htmlspecialchars($node->keywords); } else { $keywords = ''; } if (!isset($node->language) || $node->language == '*') { $node->language = $this->defaultLanguage; } echo "\n"; echo ''."\n"; echo ' '.(htmlspecialchars($this->sitemap->params->get('news_publication_name'))).''."\n"; echo ' '.$node->language.''."\n"; echo ''."\n"; echo '', $modified, '' . "\n"; echo 'name.']]>' . "\n"; if ($keywords) { echo '', $keywords, '' . "\n"; } echo "\n"; } echo '', "\n"; } else { return empty($this->_links[$link]); } return true; } /** * * @param string $property The property that is needed * @param string $value The default value if the property is not found * @param int $Itemid The menu item id * @param string $view (xml / html) * @param int $uid Unique id of the element on the sitemap * (the id asigned by the extension) * @return string */ function getProperty($property, $value, $Itemid, $view, $uid) { if (isset($this->jview->sitemapItems[$view][$Itemid][$uid][$property])) { return $this->jview->sitemapItems[$view][$Itemid][$uid][$property]; } return $value; } /** * Called on every level change * * @param int $level * @return boolean */ function changeLevel($level) { return true; } /** * Function called before displaying the menu * * @param stdclass $menu The menu node item * @return boolean */ function startMenu($menu) { return true; } /** * Function called after displaying the menu * * @param stdclass $menu The menu node item * @return boolean */ function endMenu($menu) { return true; } } views/xml/tmpl/default_items.php000066600000001007151372040110013007 0ustar00state->get('params'); // Use the class defined in default_class.php to print the sitemap $this->displayer->printSitemap();views/xml/tmpl/default.php000066600000003153151372040110011612 0ustar00item->params; $live_site = substr_replace(JURI::root(), "", -1, 1); header('Content-type: text/xml; charset=utf-8'); echo '',"\n"; if (($this->item->params->get('beautify_xml', 1) == 1) && !$this->displayer->isNews) { $params = '&filter_showtitle='.JRequest::getBool('filter_showtitle',0); $params .= '&filter_showexcluded='.JRequest::getBool('filter_showexcluded',0); $params .= (JRequest::getCmd('lang')?'&lang='.JRequest::getCmd('lang'):''); echo 'item->id.($this->isImages?'&images=1':'').$params.'"?>'."\n"; } ?> displayer->isImages? ' xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"':''); ?>displayer->isNews? ' xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"':''); ?>> loadTemplate('items'); ?> views/xml/view.html.php000066600000011211151372040110011121 0ustar00user = JFactory::getUser(); $isNewsSitemap = JRequest::getInt('news',0); $this->isImages = JRequest::getInt('images',0); $model = $this->getModel('Sitemap'); $this->setModel($model); // force to not display errors on XML sitemap @ini_set('display_errors', 0); # Increase memory and max execution time for XML sitemaps to make it work # with very large sites @ini_set('memory_limit','512M'); @ini_set('max_execution_time',300); $layout = $this->getLayout(); $this->item = $this->get('Item'); $this->state = $this->get('State'); $this->canEdit = JFactory::getUser()->authorise('core.admin', 'com_xmap'); // For now, news sitemaps are not editable $this->canEdit = $this->canEdit && !$isNewsSitemap; if ($layout == 'xsl') { return $this->displayXSL($layout); } // Get model data. $this->items = $this->get('Items'); $this->sitemapItems = $this->get('SitemapItems'); $this->extensions = $this->get('Extensions'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseWarning(500, implode("\n", $errors)); return false; } // Add router helpers. $this->item->slug = $this->item->alias ? ($this->item->id . ':' . $this->item->alias) : $this->item->id; $this->item->rlink = JRoute::_('index.php?option=com_xmap&view=xml&id=' . $this->item->slug); // Create a shortcut to the paramemters. $params = &$this->state->params; $offset = $this->state->get('page.offset'); if (!$this->item->params->get('access-view')) { if ($this->user->get('guest')) { // Redirect to login $uri = JFactory::getURI(); $app->redirect( 'index.php?option=com_users&view=login&return=' . base64_encode($uri), JText::_('Xmap_Error_Login_to_view_sitemap') ); return; } else { JError::raiseWarning(403, JText::_('Xmap_Error_Not_auth')); return; } } // Override the layout. if ($layout = $params->get('layout')) { $this->setLayout($layout); } // Load the class used to display the sitemap $this->loadTemplate('class'); $this->displayer = new XmapXmlDisplayer($params, $this->item); $this->displayer->setJView($this); $this->displayer->isNews = $isNewsSitemap; $this->displayer->isImages = $this->isImages; $this->displayer->canEdit = $this->canEdit; $doCompression = ($this->item->params->get('compress_xml') && !ini_get('zlib.output_compression') && ini_get('output_handler') != 'ob_gzhandler'); $this->endAllBuffering(); if ($doCompression) { ob_start(); } parent::display($tpl); $model = $this->getModel(); $model->hit($this->displayer->getCount()); if ($doCompression) { $data = ob_get_contents(); JResponse::setBody($data); @ob_end_clean(); echo JResponse::toString(true); } $this->recreateBuffering(); exit; } function displayXSL() { $this->setLayout('default'); $this->endAllBuffering(); parent::display('xsl'); $this->recreateBuffering(); exit; } private function endAllBuffering() { $this->_obLevel = ob_get_level(); while (ob_get_level()) { @ob_end_clean(); } } private function recreateBuffering() { while($this->_obLevel--) { ob_start(); } } } views/xml/metadata.xml000066600000000265151372040110011004 0ustar00 views/xml/.htaccess000066600000000177151372040110010302 0ustar00 Order allow,deny Deny from all models/sitemap.php000066600000023144151372040110010204 0ustar00setState('sitemap.id', $pk); $offset = JRequest::getInt('limitstart'); $this->setState('list.offset', $offset); // Load the parameters. $params = $app->getParams(); $this->setState('params', $params); // TODO: Tune these values based on other permissions. $this->setState('filter.published', 1); $this->setState('filter.access', true); } /** * Method to get sitemap data. * * @param integer The id of the article. * * @return mixed Menu item data object on success, false on failure. */ public function &getItem($pk = null) { // Initialize variables. $db = $this->getDbo(); $pk = (!empty($pk)) ? $pk : (int) $this->getState('sitemap.id'); // If not sitemap specified, select the default one if (!$pk) { $query = $db->getQuery(true); $query->select('id')->from('#__xmap_sitemap')->where('is_default=1'); $db->setQuery($query); $pk = $db->loadResult(); } if ($this->_item === null) { $this->_item = array(); } if (!isset($this->_item[$pk])) { try { $query = $db->getQuery(true); $query->select($this->getState('item.select', 'a.*')); $query->from('#__xmap_sitemap AS a'); $query->where('a.id = ' . (int) $pk); // Filter by published state. $published = $this->getState('filter.published'); if (is_numeric($published)) { $query->where('a.state = ' . (int) $published); } // Filter by access level. if ($access = $this->getState('filter.access')) { $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); $query->where('a.access IN (' . $groups . ')'); } $this->_db->setQuery($query); $data = $this->_db->loadObject(); if ($error = $this->_db->getErrorMsg()) { throw new Exception($error); } if (empty($data)) { throw new Exception(JText::_('COM_XMAP_ERROR_SITEMAP_NOT_FOUND')); } // Check for published state if filter set. if (is_numeric($published) && $data->state != $published) { throw new Exception(JText::_('COM_XMAP_ERROR_SITEMAP_NOT_FOUND')); } // Convert parameter fields to objects. $registry = new JRegistry('_default'); $registry->loadString($data->attribs); $data->params = clone $this->getState('params'); $data->params->merge($registry); // Convert the selections field to an array. $registry = new JRegistry('_default'); $registry->loadString($data->selections); $data->selections = $registry->toArray(); // Compute access permissions. if ($access) { // If the access filter has been set, we already know this user can view. $data->params->set('access-view', true); } else { // If no access filter is set, the layout takes some responsibility for display of limited information. $user = &JFactory::getUser(); $groups = $user->authorisedLevels(); $data->params->set('access-view', in_array($data->access, $groups)); } // TODO: Type 2 permission checks? $this->_item[$pk] = $data; } catch (Exception $e) { $this->setError($e->getMessage()); $this->_item[$pk] = false; } } return $this->_item[$pk]; } public function getItems() { if ($item = $this->getItem()) { return XmapHelper::getMenuItems($item->selections); } return false; } function getExtensions() { return XmapHelper::getExtensions(); } /** * Increment the hit counter for the sitemap. * * @param int Optional primary key of the sitemap to increment. * * @return boolean True if successful; false otherwise and internal error set. */ public function hit($count) { // Initialize variables. $pk = (int) $this->getState('sitemap.id'); $view = JRequest::getCmd('view', 'html'); if ($view != 'xml' && $view != 'html') { return false; } $this->_db->setQuery( 'UPDATE #__xmap_sitemap' . ' SET views_' . $view . ' = views_' . $view . ' + 1, count_' . $view . ' = ' . $count . ', lastvisit_' . $view . ' = ' . JFactory::getDate()->toUnix() . ' WHERE id = ' . (int) $pk ); if (!$this->_db->query()) { $this->setError($this->_db->getErrorMsg()); return false; } return true; } public function getSitemapItems($view=null) { if (!isset($view)) { $view = JRequest::getCmd('view'); } $db = JFactory::getDBO(); $pk = (int) $this->getState('sitemap.id'); if (self::$items !== NULL && isset(self::$items[$view])) { return; } $query = "select * from #__xmap_items where view='$view' and sitemap_id=" . $pk; $db->setQuery($query); $rows = $db->loadObjectList(); self::$items[$view] = array(); foreach ($rows as $row) { self::$items[$view][$row->itemid] = array(); self::$items[$view][$row->itemid][$row->uid] = array(); $pairs = explode(';', $row->properties); foreach ($pairs as $pair) { if (strpos($pair, '=') !== FALSE) { list($property, $value) = explode('=', $pair); self::$items[$view][$row->itemid][$row->uid][$property] = $value; } } } return self::$items; } function chageItemPropery($uid, $itemid, $view, $property, $value) { $items = $this->getSitemapItems($view); $db = JFactory::getDBO(); $pk = (int) $this->getState('sitemap.id'); $isNew = false; if (empty($items[$view][$itemid][$uid])) { $items[$view][$itemid][$uid] = array(); $isNew = true; } $items[$view][$itemid][$uid][$property] = $value; $sep = $properties = ''; foreach ($items[$view][$itemid][$uid] as $k => $v) { $properties .= $sep . $k . '=' . $v; $sep = ';'; } if (!$isNew) { $query = 'UPDATE #__xmap_items SET properties=\'' . $db->escape($properties) . "' where uid='" . $db->escape($uid) . "' and itemid=$itemid and view='$view' and sitemap_id=" . $pk; } else { $query = 'INSERT #__xmap_items (uid,itemid,view,sitemap_id,properties) values ( \'' . $db->escape($uid) . "',$itemid,'$view',$pk,'" . $db->escape($properties) . "')"; } $db->setQuery($query); //echo $db->getQuery();exit; if ($db->query()) { return true; } else { return false; } } function toggleItem($uid, $itemid) { $app = JFactory::getApplication('site'); $sitemap = $this->getItem(); $displayer = new XmapDisplayer($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 #__xmap_sitemap set excluded_items='" . $db->escape($str) . "' where id=" . $sitemap->id; $db->setQuery($query); $db->query(); return $state; } } models/index.html000066600000000036151372040110010021 0ustar00models/.htaccess000066600000000177151372040110007630 0ustar00 Order allow,deny Deny from all xmap.php000066600000001327151372040110006223 0ustar00execute(JRequest::getVar('task')); $controller->redirect(); controllers/.htaccess000066600000000177151372040110010713 0ustar00 Order allow,deny Deny from all controllers/index.html000066600000000036151372040110011104 0ustar00controllers/ajax.json.php000066600000004424151372040110011520 0ustar00get('id'))); $result = new JRegistry('_default'); $sitemapId = JREquest::getInt('id'); if (!$user->authorise('core.edit', 'com_xmap.sitemap.'.$sitemapId)) { $result->setValue('result', 'KO'); $result->setValue('message', 'You are not authorized to perform this action!'); } else { $model = $this->getModel('sitemap'); if ($model->getItem()) { $action = JRequest::getCmd('action', ''); $uid = JRequest::getCmd('uid', ''); $itemid = JRequest::getInt('itemid', ''); switch ($action) { case 'toggleElement': if ($uid && $itemid) { $state = $model->toggleItem($uid, $itemid); } break; case 'changeProperty': $uid = JRequest::getCmd('uid', ''); $property = JRequest::getCmd('property', ''); $value = JRequest::getCmd('value', ''); if ($uid && $itemid && $uid && $property) { $state = $model->chageItemPropery($uid, $itemid, 'xml', $property, $value); } break; } } $result->set('result', 'OK'); $result->set('state', $state); $result->set('message', ''); } echo $result->toString(); } }router.php000066600000011213151372040110006571 0ustar00 (int) $id ); //Create the link $link = 'index.php?option=com_xmap&view='.$view.'&id='. $id; if ($itemId = self::_findItemId($needles)) { $link .= '&Itemid='.$itemId; }; return $link; } protected static function _findItemId($needles) { // Prepare the reverse lookup array. if (self::$lookup === null) { self::$lookup = array(); $component = &JComponentHelper::getComponent('com_xmap'); $menus = &JApplication::getMenu('site', array()); $items = $menus->getItems('component_id', $component->id); foreach ($items as &$item) { if (isset($item->query) && isset($item->query['view'])) { $view = $item->query['view']; if (!isset(self::$lookup[$view])) { self::$lookup[$view] = array(); } if (isset($item->query['id'])) { self::$lookup[$view][$item->query['id']] = $item->id; } } } } $match = null; foreach ($needles as $view => $id) { if (isset(self::$lookup[$view])) { if (isset(self::$lookup[$view][$id])) { return self::$lookup[$view][$id]; } } } return null; } } /** * Build the route for the com_content component * * @param array An array of URL arguments * * @return array The URL arguments to use to assemble the subsequent URL. */ function XmapBuildRoute(&$query) { $segments = array(); // get a menu item based on Itemid or currently active $app = JFactory::getApplication(); $menu = $app->getMenu(); if (empty($query['Itemid'])) { $menuItem = $menu->getActive(); } else { $menuItem = $menu->getItem($query['Itemid']); } $mView = (empty($menuItem->query['view'])) ? null : $menuItem->query['view']; $mId = (empty($menuItem->query['id'])) ? null : $menuItem->query['id']; if ( !empty($query['Itemid']) ) { unset($query['view']); unset($query['id']); } else { if ( !empty($query['view']) ) { $segments[] = $query['view']; } } if (isset($query['id'])) { if (empty($query['Itemid'])) { $segments[] = $query['id']; } else { if (isset($menuItem->query['id'])) { if ($query['id'] != $mId) { $segments[] = $query['id']; } } else { $segments[] = $query['id']; } } unset($query['id']); }; if (isset($query['layout'])) { if (!empty($query['Itemid']) && isset($menuItem->query['layout'])) { if ($query['layout'] == $menuItem->query['layout']) { unset($query['layout']); } } else { if ($query['layout'] == 'default') { unset($query['layout']); } } }; return $segments; } /** * Parse the segments of a URL. * * @param array The segments of the URL to parse. * * @return array The URL attributes to be used by the application. */ function XmapParseRoute($segments) { $vars = array(); //G et the active menu item. $app = JFactory::getApplication(); $menu = $app->getMenu(); $item = $menu->getActive(); // Count route segments $count = count($segments); // Standard routing for articles. if (!isset($item)) { $vars['view'] = $segments[0]; $vars['id'] = $segments[$count - 1]; return $vars; } $vars['view'] = $item->query['view']; $vars['id'] = $item->query['id']; return $vars; } images/xmap-favicon.png000066600000001450151372051020011107 0ustar00PNG  IHDRatEXtSoftwareAdobe ImageReadyqe<IDATxڤS_HSQνww]ڒE5S 2R(@z=,-!,/F6Z]N{wm}g=z9~;0 fa`v!Qo6gqI&B@4AG-1~e^tmF’تh:3+ hb6p} i#*/ƃU@8: ݁A Q m5YqxH)Q2 ? Dz9xQ!|t2Vc:$12tvkXQX_:{\dJ`hj*}*lh HM{npz[œ?$E$dE^YxyԽ_6UУ1\rnA f %eIvrj88~dYWC_K)ClI<U Jf5}Ŕr%o!*G&j'z뾡}߆E-)-vr_< Q~+X=:ʗ>Yugˢz:CV5(k>G{zt9@A "W~lO4E}>~ 5Jȿ-IENDB`images/sitemap-icon.png000066600000000753151372051020011114 0ustar00PNG  IHDR00WtEXtSoftwareAdobe ImageReadyqe<IDATxb?PL Cz` <~/ Hw|QD=u-dyRH#9ģRlZAP_vh ,Ih4  ,Cέh$K#]ʛϾRܨS&9H>/_̶3RcUЛG3.~oYt-*1y<@Z"쬚8<rtXAL B|ogsj!0#Q6RRzrT?LLf f'QC7hP5TM[SYkJ [DĘVT5.ȱb0X#%+SڰF=0R=&K05hG/FIENDB`images/.htaccess000066600000000177151372051020007614 0ustar00 Order allow,deny Deny from all images/index.html000066600000000036151372051020010005 0ustar00elements/index.html000066600000000036151372051020010354 0ustar00elements/sitemap.php000066600000001576151372051020010544 0ustar00setQuery($sql); $rows = $db->loadObjectList(); $html = JHTML::_('select.genericlist',$rows,$fieldName,'','id','name',$value); return $html; } } elements/.htaccess000066600000000177151372051020010163 0ustar00 Order allow,deny Deny from all install/index.html000066600000000036151372051020010206 0ustar00install/uninstall.postgresql.sql000066600000000071151372051020013144 0ustar00drop table "#__xmap_items"; drop table "#__xmap_sitemap";install/uninstall.utf8.sql000066600000000071151372051020011627 0ustar00drop table `#__xmap_items`; drop table `#__xmap_sitemap`;install/install.utf8.sql000066600000002164151372051020011271 0ustar00CREATE TABLE IF NOT EXISTS `#__xmap_sitemap` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(255) DEFAULT NULL, `alias` varchar(255) DEFAULT NULL, `introtext` text DEFAULT NULL, `metadesc` text DEFAULT NULL, `metakey` text DEFAULT NULL, `attribs` text DEFAULT NULL, `selections` text DEFAULT NULL, `excluded_items` text DEFAULT NULL, `is_default` int(1) DEFAULT 0, `state` int(2) DEFAULT NULL, `access` int DEFAULT NULL, `created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, `count_xml` int(11) DEFAULT NULL, `count_html` int(11) DEFAULT NULL, `views_xml` int(11) DEFAULT NULL, `views_html` int(11) DEFAULT NULL, `lastvisit_xml` int(11) DEFAULT NULL, `lastvisit_html` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `#__xmap_items` ( `uid` varchar(100) NOT NULL, `itemid` int(11) NOT NULL, `view` varchar(10) NOT NULL, `sitemap_id` int(11) NOT NULL, `properties` varchar(300) DEFAULT NULL, PRIMARY KEY (`uid`,`itemid`,`view`,`sitemap_id`), KEY `uid` (`uid`,`itemid`), KEY `view` (`view`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8install/install.postgresql.sql000066600000002253151372051020012605 0ustar00CREATE TABLE "#__xmap_sitemap" ( "id" serial NOT NULL, "title" character varying(255) DEFAULT NULL, "alias" character varying(255) DEFAULT NULL, "introtext" text DEFAULT NULL, "metadesc" text DEFAULT NULL, "metakey" text DEFAULT NULL, "attribs" text DEFAULT NULL, "selections" text DEFAULT NULL, "excluded_items" text DEFAULT NULL, "is_default" integer DEFAULT 0, "state" integer DEFAULT NULL, "access" integer DEFAULT NULL, "created" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, "count_xml" integer DEFAULT NULL, "count_html" integer DEFAULT NULL, "views_xml" integer DEFAULT NULL, "views_html" integer DEFAULT NULL, "lastvisit_xml" integer DEFAULT NULL, "lastvisit_html" integer DEFAULT NULL, PRIMARY KEY ("id") ); CREATE TABLE "#__xmap_items" ( "uid" character varying(100) NOT NULL, "itemid" integer NOT NULL, "view" character varying(10) NOT NULL, "sitemap_id" integer NOT NULL, "properties" varchar(300) DEFAULT NULL, PRIMARY KEY ("uid","itemid","view","sitemap_id") ); CREATE INDEX "#__xmap_items_idx_uid" on "#__xmap_items" ("uid", "itemid"); CREATE INDEX "#__xmap_items_idx_view" on "#__xmap_items" ("view"); install/.htaccess000066600000000177151372051020010015 0ustar00 Order allow,deny Deny from all views/sitemaps/view.html.php000066600000007327151372051020012165 0ustar00getLayout() !== 'modal') { XmapHelper::addSubmenu('sitemaps'); } $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $version = new JVersion; $message = $this->get('ExtensionsMessage'); if ( $message ) { JFactory::getApplication()->enqueueMessage($message); } // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } // We don't need toolbar in the modal window. if ($this->getLayout() !== 'modal') { if (version_compare($version->getShortVersion(), '3.0.0', '<')) { $tpl = 'legacy'; } $this->addToolbar(); } parent::display($tpl); } /** * Display the toolbar * * @access private */ protected function addToolbar() { $state = $this->get('State'); $doc = JFactory::getDocument(); $version = new JVersion; JToolBarHelper::addNew('sitemap.add'); JToolBarHelper::custom('sitemap.edit', 'edit.png', 'edit_f2.png', 'JTOOLBAR_EDIT', true); $doc->addStyleDeclaration('.icon-48-sitemap {background-image: url(components/com_xmap/images/sitemap-icon.png);}'); JToolBarHelper::title(JText::_('XMAP_SITEMAPS_TITLE'), 'sitemap.png'); JToolBarHelper::custom('sitemaps.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_Publish', true); JToolBarHelper::custom('sitemaps.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); if (version_compare($version->getShortVersion(), '3.0.0', '>=')) { JToolBarHelper::custom('sitemaps.setdefault', 'featured.png', 'featured_f2.png', 'XMAP_TOOLBAR_SET_DEFAULT', true); } else { JToolBarHelper::custom('sitemaps.setdefault', 'default.png', 'default_f2.png', 'XMAP_TOOLBAR_SET_DEFAULT', true); } if ($state->get('filter.published') == -2) { JToolBarHelper::deleteList('', 'sitemaps.delete','JTOOLBAR_DELETE'); } else { JToolBarHelper::trash('sitemaps.trash','JTOOLBAR_TRASH'); } JToolBarHelper::divider(); if (class_exists('JHtmlSidebar')){ JHtmlSidebar::addFilter( JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) ); JHtmlSidebar::addFilter( JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) ); $this->sidebar = JHtmlSidebar::render(); } } } views/sitemaps/.htaccess000066600000000177151372051020011331 0ustar00 Order allow,deny Deny from all views/sitemaps/index.html000066600000000036151372051020011522 0ustar00views/sitemaps/tmpl/default_legacy.php000066600000021765151372051020014176 0ustar00items); $baseUrl = JUri::root(); $version = new JVersion; ?>
    items as $i => $item) : $now = JFactory::getDate()->toUnix(); if ( !$item->lastvisit_html ) { $htmlDate = JText::_('Date_Never'); }elseif ( $item->lastvisit_html > ($now-3600)) { // Less than one hour $htmlDate = JText::sprintf('Date_Minutes_Ago',intval(($now-$item->lastvisit_html)/60)); } elseif ( $item->lastvisit_html > ($now-86400)) { // Less than one day $hours = intval (($now-$item->lastvisit_html)/3600 ); $htmlDate = JText::sprintf('Date_Hours_Minutes_Ago',$hours,($now-($hours*3600)-$item->lastvisit_html)/60); } elseif ( $item->lastvisit_html > ($now-259200)) { // Less than three days $days = intval(($now-$item->lastvisit_html)/86400); $htmlDate = JText::sprintf('Date_Days_Hours_Ago',$days,intval(($now-($days*86400)-$item->lastvisit_html)/3600)); } else { $date = new JDate($item->lastvisit_html); $htmlDate = $date->format('Y-m-d H:i'); } if ( !$item->lastvisit_xml ) { $xmlDate = JText::_('Date_Never'); } elseif ( $item->lastvisit_xml > ($now-3600)) { // Less than one hour $xmlDate = JText::sprintf('Date_Minutes_Ago',intval(($now-$item->lastvisit_xml)/60)); } elseif ( $item->lastvisit_xml > ($now-86400)) { // Less than one day $hours = intval (($now-$item->lastvisit_xml)/3600 ); $xmlDate = JText::sprintf('Date_Hours_Minutes_Ago',$hours,($now-($hours*3600)-$item->lastvisit_xml)/60); } elseif ( $item->lastvisit_xml > ($now-259200)) { // Less than three days $days = intval(($now-$item->lastvisit_xml)/86400); $xmlDate = JText::sprintf('Date_Days_Hours_Ago',$days,intval(($now-($days*86400)-$item->lastvisit_xml)/3600)); } else { $date = new JDate($item->lastvisit_xml); $xmlDate = $date->format('Y-m-d H:i'); } ?>
    state->get('list.direction'), $this->state->get('list.ordering')); ?> state->get('list.direction'), $this->state->get('list.ordering')); ?> state->get('list.direction'), $this->state->get('list.ordering')); ?>
    ()

    state->get('list.direction'), $this->state->get('list.ordering')); ?>
    pagination->getListFooter(); ?>
    id); ?> escape($item->title); ?> is_default == 1) : ?> getShortVersion(), '3.0.0', '>=')): ?> <?php echo JText::_('Default'); ?> state): ?> [] [] []
    (escape($item->alias); ?>)
    state, $i, 'sitemaps.'); ?> escape($item->access_level); ?> count_html .' / '.$item->views_html. ' / ' . $htmlDate; ?> count_xml .' / '.$item->views_xml. ' / ' . $xmlDate; ?> id; ?>
    views/sitemaps/tmpl/form.php000066600000000000151372051020012144 0ustar00views/sitemaps/tmpl/modal.php000066600000016577151372051020012327 0ustar00items); ?>
    items as $i => $item) : $now = JFactory::getDate()->toUnix(); if ( !$item->lastvisit_html ) { $htmlDate = JText::_('Date_Never'); }elseif ( $item->lastvisit_html > ($now-3600)) { // Less than one hour $htmlDate = JText::sprintf('Date_Minutes_Ago',intval(($now-$item->lastvisit_html)/60)); } elseif ( $item->lastvisit_html > ($now-86400)) { // Less than one day $hours = intval (($now-$item->lastvisit_html)/3600 ); $htmlDate = JText::sprintf('Date_Hours_Minutes_Ago',$hours,($now-($hours*3600)-$item->lastvisit_html)/60); } elseif ( $item->lastvisit_html > ($now-259200)) { // Less than three days $days = intval(($now-$item->lastvisit_html)/86400); $htmlDate = JText::sprintf('Date_Days_Hours_Ago',$days,intval(($now-($days*86400)-$item->lastvisit_html)/3600)); } else { $date = new JDate($item->lastvisit_html); $htmlDate = $date->toFormat('%Y-%m-%d %H:%M'); } if ( !$item->lastvisit_xml ) { $xmlDate = JText::_('Date_Never'); } elseif ( $item->lastvisit_xml > ($now-3600)) { // Less than one hour $xmlDate = JText::sprintf('Date_Minutes_Ago',intval(($now-$item->lastvisit_xml)/60)); } elseif ( $item->lastvisit_xml > ($now-86400)) { // Less than one day $hours = intval (($now-$item->lastvisit_xml)/3600 ); $xmlDate = JText::sprintf('Date_Hours_Minutes_Ago',$hours,($now-($hours*3600)-$item->lastvisit_xml)/60); } elseif ( $item->lastvisit_xml > ($now-259200)) { // Less than three days $days = intval(($now-$item->lastvisit_xml)/86400); $xmlDate = JText::sprintf('Date_Days_Hours_Ago',$days,intval(($now-($days*86400)-$item->lastvisit_xml)/3600)); } else { $date = new JDate($item->lastvisit_xml); $xmlDate = $date->toFormat('%Y-%m-%d %H:%M'); } ?>
    state->get('list.direction'), $this->state->get('list.ordering')); ?> state->get('list.direction'), $this->state->get('list.ordering')); ?> state->get('list.direction'), $this->state->get('list.ordering')); ?>
    ()

    state->get('list.direction'), $this->state->get('list.ordering')); ?>
    pagination->getListFooter(); ?>
    escape($item->title); ?> state, $i, 'sitemaps.'); ?> escape($item->access_level); ?> count_html .' / '.$item->views_html. ' / ' . $htmlDate; ?> count_xml .' / '.$item->views_xml. ' / ' . $xmlDate; ?> id; ?>
    views/sitemaps/tmpl/index.html000066600000000036151372051020012476 0ustar00views/sitemaps/tmpl/.htaccess000066600000000177151372051020012305 0ustar00 Order allow,deny Deny from all views/sitemaps/tmpl/default.php000066600000022465151372051020012650 0ustar00items); $baseUrl = JUri::root(); $version = new JVersion; ?>
    sidebar)): ?>
    sidebar; ?>
    items as $i => $item) : $now = JFactory::getDate()->toUnix(); if ( !$item->lastvisit_html ) { $htmlDate = JText::_('Date_Never'); }elseif ( $item->lastvisit_html > ($now-3600)) { // Less than one hour $htmlDate = JText::sprintf('Date_Minutes_Ago',intval(($now-$item->lastvisit_html)/60)); } elseif ( $item->lastvisit_html > ($now-86400)) { // Less than one day $hours = intval (($now-$item->lastvisit_html)/3600 ); $htmlDate = JText::sprintf('Date_Hours_Minutes_Ago',$hours,($now-($hours*3600)-$item->lastvisit_html)/60); } elseif ( $item->lastvisit_html > ($now-259200)) { // Less than three days $days = intval(($now-$item->lastvisit_html)/86400); $htmlDate = JText::sprintf('Date_Days_Hours_Ago',$days,intval(($now-($days*86400)-$item->lastvisit_html)/3600)); } else { $date = new JDate($item->lastvisit_html); $htmlDate = $date->format('Y-m-d H:i'); } if ( !$item->lastvisit_xml ) { $xmlDate = JText::_('Date_Never'); } elseif ( $item->lastvisit_xml > ($now-3600)) { // Less than one hour $xmlDate = JText::sprintf('Date_Minutes_Ago',intval(($now-$item->lastvisit_xml)/60)); } elseif ( $item->lastvisit_xml > ($now-86400)) { // Less than one day $hours = intval (($now-$item->lastvisit_xml)/3600 ); $xmlDate = JText::sprintf('Date_Hours_Minutes_Ago',$hours,($now-($hours*3600)-$item->lastvisit_xml)/60); } elseif ( $item->lastvisit_xml > ($now-259200)) { // Less than three days $days = intval(($now-$item->lastvisit_xml)/86400); $xmlDate = JText::sprintf('Date_Days_Hours_Ago',$days,intval(($now-($days*86400)-$item->lastvisit_xml)/3600)); } else { $date = new JDate($item->lastvisit_xml); $xmlDate = $date->format('Y-m-d H:i'); } ?>
    state->get('list.direction'), $this->state->get('list.ordering')); ?> state->get('list.direction'), $this->state->get('list.ordering')); ?> state->get('list.direction'), $this->state->get('list.ordering')); ?>
    ()

    state->get('list.direction'), $this->state->get('list.ordering')); ?>
    pagination->getListFooter(); ?>
    id); ?> escape($item->title); ?> is_default == 1) : ?> getShortVersion(), '3.0.0', '>=')): ?> <?php echo JText::_('Default'); ?> state): ?> [] [] []
    (escape($item->alias); ?>)
    state, $i, 'sitemaps.'); ?> escape($item->access_level); ?> count_html .' / '.$item->views_html. ' / ' . $htmlDate; ?> count_xml .' / '.$item->views_xml. ' / ' . $xmlDate; ?> id; ?>
    views/sitemap/view.html.php000066600000014126151372051020011775 0ustar00state = $this->get('State'); $this->item = $this->get('Item'); $this->form = $this->get('Form'); $version = new JVersion; // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } JHTML::stylesheet('administrator/components/com_xmap/css/xmap.css'); // Convert dates from UTC $offset = $app->getCfg('offset'); if (intval($this->item->created)) { $this->item->created = JHtml::date($this->item->created, '%Y-%m-%d %H-%M-%S', $offset); } $this->_setToolbar(); if (version_compare($version->getShortVersion(), '3.0.0', '<')) { $tpl = 'legacy'; } parent::display($tpl); JRequest::setVar('hidemainmenu', true); } /** * Display the view * * @access public */ function navigator($tpl = null) { require_once(JPATH_COMPONENT_SITE . '/helpers/xmap.php'); $app = JFactory::getApplication(); $this->state = $this->get('State'); $this->item = $this->get('Item'); # $menuItems = XmapHelper::getMenuItems($item->selections); # $extensions = XmapHelper::getExtensions(); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } JHTML::script('mootree.js', 'media/system/js/'); JHTML::stylesheet('mootree.css', 'media/system/css/'); $this->loadTemplate('class'); $displayer = new XmapNavigatorDisplayer($state->params, $this->item); parent::display($tpl); } function navigatorLinks($tpl = null) { require_once(JPATH_COMPONENT_SITE . '/helpers/xmap.php'); $link = urldecode(JRequest::getVar('link', '')); $name = JRequest::getCmd('e_name', ''); $Itemid = JRequest::getInt('Itemid'); $this->item = $this->get('Item'); $this->state = $this->get('State'); $menuItems = XmapHelper::getMenuItems($item->selections); $extensions = XmapHelper::getExtensions(); $this->loadTemplate('class'); $nav = new XmapNavigatorDisplayer($state->params, $item); $nav->setExtensions($extensions); $this->list = array(); // Show the menu list if (!$link && !$Itemid) { foreach ($menuItems as $menutype => &$menu) { $menu = new stdclass(); #$menu->id = 0; #$menu->menutype = $menutype; $node = new stdClass; $node->uid = "menu-" . $menutype; $node->menutype = $menutype; $node->ordering = $item->selections->$menutype->ordering; $node->priority = $item->selections->$menutype->priority; $node->changefreq = $item->selections->$menutype->changefreq; $node->browserNav = 3; $node->type = 'separator'; if (!$node->name = $nav->getMenuTitle($menutype, @$menu->module)) { $node->name = $menutype; } $node->link = '-menu-' . $menutype; $node->expandible = true; $node->selectable = false; //$node->name = $this->getMenuTitle($menutype,@$menu->module); // get the mod_mainmenu title from modules table $this->list[] = $node; } } else { $parent = new stdClass; if ($Itemid) { // Expand a menu Item $items = &JSite::getMenu(); $node = & $items->getItem($Itemid); if (isset($menuItems[$node->menutype])) { $parent->name = $node->title; $parent->id = $node->id; $parent->uid = 'itemid' . $node->id; $parent->link = $link; $parent->type = $node->type; $parent->browserNav = $node->browserNav; $parent->priority = $item->selections->{$node->menutype}->priority; $parent->changefreq = $item->selections->{$node->menutype}->changefreq; $parent->menutype = $node->menutype; $parent->selectable = false; $parent->expandible = true; } } else { $parent->id = 1; $parent->link = $link; } $this->list = $nav->expandLink($parent); } parent::display('links'); exit; } /** * Display the toolbar * * @access private */ function _setToolbar() { $user = JFactory::getUser(); $isNew = ($this->item->id == 0); JToolBarHelper::title(JText::_('XMAP_PAGE_' . ($isNew ? 'ADD_SITEMAP' : 'EDIT_SITEMAP')), 'article-add.png'); JToolBarHelper::apply('sitemap.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('sitemap.save', 'JTOOLBAR_SAVE'); JToolBarHelper::save2new('sitemap.save2new'); if (!$isNew) { JToolBarHelper::save2copy('sitemap.save2copy'); } JToolBarHelper::cancel('sitemap.cancel', 'JTOOLBAR_CLOSE'); } } views/sitemap/.htaccess000066600000000177151372051020011146 0ustar00 Order allow,deny Deny from all views/sitemap/tmpl/edit_legacy.php000066600000006324151372051020013306 0ustar00
    form->getLabel('id'); ?> form->getInput('id'); ?> form->getLabel('title'); ?> form->getInput('title'); ?> form->getLabel('alias'); ?> form->getInput('alias'); ?> form->getLabel('state'); ?> form->getInput('state'); ?> form->getLabel('access'); ?> form->getInput('access'); ?>
    form->getLabel('introtext'); ?>
    form->getInput('introtext'); ?>
    item->id, array('useCookie' => 1)); ?> form->getInput('selections'); ?> form->getFieldsets('attribs'); foreach ($fieldSets as $name => $fieldSet) : echo JHtml::_('sliders.panel', JText::_($fieldSet->label), $name . '-options'); if (isset($fieldSet->description) && trim($fieldSet->description)) : echo '

    ' . $this->escape(JText::_($fieldSet->description)) . '

    '; endif; ?>
      form->getFieldset($name) as $field) : ?>
    • label; ?> input; ?>
    form->getInput('is_default'); ?>
    views/sitemap/tmpl/.htaccess000066600000000177151372051020012122 0ustar00 Order allow,deny Deny from all views/sitemap/tmpl/edit.php000066600000012250151372051020011755 0ustar00
    form->getLabel('title'); ?>
    form->getInput('title'); ?>
    form->getLabel('alias'); ?>
    form->getInput('alias'); ?>
    form->getLabel('state'); ?>
    form->getInput('state'); ?>
    form->getLabel('access'); ?>
    form->getInput('access'); ?>
    form->getLabel('introtext'); ?>
    form->getInput('introtext'); ?>
    form->getInput('selections'); ?>
    form->getFieldsets('attribs'); foreach ($fieldSets as $name => $fieldSet) : ?>
    description) && trim($fieldSet->description)) : echo '

    ' . $this->escape(JText::_($fieldSet->description)) . '

    '; endif; foreach ($this->form->getFieldset($name) as $field) : ?>
    label; ?>
    input; ?>
    form->getInput('is_default'); ?>
    views/sitemap/tmpl/navigator.php000066600000007537151372051020013036 0ustar00addScriptDeclaration(' var tree; var autotext = \'\'; insertLink = function (){ var link = $(\'f_link\').get(\'value\'); var text = $(\'f_text\').get(\'value\'); var title = $(\'f_title\').get(\'value\'); var cssstyle = $(\'f_cssstyle\').get(\'value\'); var cssclass = $(\'f_cssclass\').get(\'value\'); if (link != \'\' && text != \'\') { var extra =\'\'; if (title != \'\') { extra = extra + \' title=\'+title.replace(\'"\',\'"\')+\'"\'; } if (cssclass != \'\') { extra = extra + \' class=\'+cssclass.replace(\'"\',\'"\')+\'"\'; } if (cssstyle != \'\') { extra = extra + \' style=\'+cssstyle.replace(\'"\',\'"\')+\'"\'; } var tag = ""+text+""; window.parent.jInsertEditorText(tag, "'.htmlspecialchars($name).'"); } window.parent.SqueezeBox.close(); }; window.addEvent("domready",function(){ tree = new MooTreeControl({ div: \'xmap-nav_tree\', mode: \'files\', grid: true, theme: \'../media/media/images/mootree.gif\', onSelect: function (node,state) { if (typeof node.data.link != \'undefined\' && node.data.selectable == \'true\') { document.adminForm.link.value = node.data.link; if (document.adminForm.text.value == autotext ) { document.adminForm.text.value = node.text; autotext = node.text; } } } },{ text: \'Home\', open: true }); tree.root.load(\'index.php?option=com_xmap&task=navigator-links&sitemap='.$this->item->id.'&e_name='.$name.'&tmpl=component\'); }); '); ?>
      views/sitemap/tmpl/index.html000066600000000036151372051020012313 0ustar00views/sitemap/tmpl/navigator_class.php000066600000010063151372051020014207 0ustar00_list=array(); $this->view='navigator'; parent::__construct( $config, $sitemap); } function printNode( &$node ) { if (!isset($node->selectable )) { $node->selectable=true; } // For extentions that doesn't set this property as this is new in Xmap 1.2.3 if (!isset($node->expandible )) { $node->expandible = true; } if ( empty($this->_list[$node->uid]) ) { // Avoid duplicated items $this->_list[$node->uid] = $node; } return false; } function &expandLink(&$parent) { $items = &JSite::getMenu(); $extensions = &$this->_extensions; $rows = null; if (strpos($parent->link,'-menu-') === 0 ) { $menutype = str_replace('-menu-','',$parent->link); // Get Menu Items $rows = $items->getItems('menutype', $menutype); } elseif ($parent->id) { $rows = $items->getItems('parent_id', $parent->id); } if ( $rows ) { foreach ($rows as $item) { if ($item->parent_id == $parent->id) { $node = new stdclass; $node->name = $item->title; $node->id = $item->id; $node->uid = 'itemid'.$item->id; $node->link = $item->link; $node->expandible = true; $node->selectable=true; // Prepare the node link XmapHelper::prepareMenuItem($node); if ( $item->home ) { $node->link = JURI::root(); } elseif (substr($item->link,0,9) == 'index.php' && $item->type != 'url' ) { if ($item->type == 'menulink') {// For Joomla 1.5 SEF compatibility $params = new JParameter($item->params); $node->link = 'index.php?Itemid=' . $params->get('menu_item'); } elseif ( strpos($item->link,'Itemid=') === FALSE ){ $node->link = 'index.php?Itemid=' . $node->id; } } elseif ($item->type == 'separator') { $node->selectable=false; } $this->printNode($node); // Add to the internal list } } } if ($parent->id) { $option = null; if ( preg_match('#^/?index.php.*option=(com_[^&]+)#',$parent->link,$matches) ) { $option = $matches[1]; } $Itemid = JRequest::getInt('Itemid'); if (!$option && $Itemid) { $item = $items->getItem($Itemid); $link_query = parse_url( $item->link ); parse_str( html_entity_decode($link_query['query']), $link_vars); $option = JArrayHelper::getValue($link_vars,'option',''); if ( $option ) { $parent->link = $item->link; } } if ( $option ) { if ( !empty($extensions[$option]) ) { $parent->uid = $option; $className = 'xmap_'.$option; $result = call_user_func_array(array($className, 'getTree'),array(&$this,&$parent,$extensions[$option]->params)); } } } return $this->_list;; } function &getParam($arr, $name, $def) { $var = JArrayHelper::getValue( $arr, $name, $def, '' ); return $var; } } views/sitemap/tmpl/navigator_links.php000066600000002051151372051020014220 0ustar00 list as $node) { $load = 'index.php?option=com_xmap&task=navigator-links&sitemap='.$this->item->id.'&e_name='.$name.(isset($node->id)?'&Itemid='.$node->id:'').(isset($node->link)?'&link='.urlencode($node->link):'').'&tmpl=component'; ?> expandible?" openicon=\"_open\" icon=\"_closed\" load=\"$load\"":' icon="_doc"'); ?> uid="uid; ?>" link="link); ?>" selectable="selectable?'true':'false'); ?>" /> views/sitemap/index.html000066600000000036151372051020011337 0ustar00helpers/html/index.html000066600000000036151372051020011146 0ustar00helpers/html/xmap.php000066600000003061151372051020010630 0ustar00 Order allow,deny Deny from all css/xmap.css000066600000001055151372051020007014 0ustar00.xmap-menu-options { border-bottom: 1px solid #CCC; padding:10px; } .xmap-menu-options label { cursor:move; } .xmap-menu-options input, .xmap-menu-options select { margin: 5px 5px 2px 0px; } ul.ul_sortable { list-style:none; margin:0; padding:0; } ul.ul_sortable li { cursor:move; background-color: #eee; margin:5px; padding: 5px; } ul.ul_sortable li label.menu_label { font-weight: bold; display: inline-block; margin-bottom: 0px; } ul.ul_sortable input[type="checkbox"] { margin: 0 3px 0 3px; } css/.htaccess000066600000000177151372051020007137 0ustar00 Order allow,deny Deny from all css/index.html000066600000000036151372051020007330 0ustar00tables/index.html000066600000000036151372051020010012 0ustar00tables/sitemap.php000066600000014415151372051020010176 0ustar00loadArray($array['attribs']); $array['attribs'] = $registry->toString(); } if (isset($array['selections']) && is_array($array['selections'])) { $selections = array(); foreach ($array['selections'] as $i => $menu) { $selections[$menu] = array( 'priority' => $array['selections_priority'][$i], 'changefreq' => $array['selections_changefreq'][$i], 'ordering' => $i ); } $registry = new JRegistry(); $registry->loadArray($selections); $array['selections'] = $registry->toString(); } if (isset($array['metadata']) && is_array($array['metadata'])) { $registry = new JRegistry(); $registry->loadArray($array['metadata']); $array['metadata'] = $registry->toString(); } return parent::bind($array, $ignore); } /** * Overloaded check function * * @access public * @return boolean * @see JTable::check * @since 2.0 */ function check() { if (empty($this->title)) { $this->setError(JText::_('Sitemap must have a title')); return false; } if (empty($this->alias)) { $this->alias = $this->title; } $this->alias = JApplication::stringURLSafe($this->alias); if (trim(str_replace('-', '', $this->alias)) == '') { $datenow = &JFactory::getDate(); $this->alias = $datenow->format("Y-m-d-H-i-s"); } return true; } /** * Overriden JTable::store to set modified data and user id. * * @param boolean True to update fields even if they are null. * @return boolean True on success. * @since 2.0 */ public function store($updateNulls = false) { $date = JFactory::getDate(); if (!$this->id) { $this->created = $date->toSql(); } return parent::store($updateNulls); } /** * Method to set the publishing state for a row or list of rows in the database * table. * * @param mixed An optional array of primary key values to update. If not * set the instance property value is used. * @param integer The publishing state. eg. [0 = unpublished, 1 = published] * @param integer The user id of the user performing the operation. * @return boolean True on success. * @since 2.0 */ public function publish($pks = null, $state = 1, $userId = 0) { // Initialize variables. $k = $this->_tbl_key; // Sanitize input. JArrayHelper::toInteger($pks); $userId = (int) $userId; $state = (int) $state; // If there are no primary keys set check to see if the instance key is set. if (empty($pks)) { if ($this->$k) { $pks = array($this->$k); } // Nothing to set publishing state on, return false. else { $this->setError(JText::_('No_Rows_Selected')); return false; } } // Build the WHERE clause for the primary keys. $where = $k . '=' . implode(' OR ' . $k . '=', $pks); // Update the publishing state for rows with the given primary keys. $query = $this->_db->getQuery(true) ->update($this->_db->quoteName('#__xmap_sitemap')) ->set($this->_db->quoteName('state').' = '. (int) $state) ->where($where); $this->_db->setQuery($query); $this->_db->query(); // Check for a database error. if ($this->_db->getErrorNum()) { $this->setError($this->_db->getErrorMsg()); return false; } // If the JTable instance value is in the list of primary keys that were set, set the instance. if (in_array($this->$k, $pks)) { $this->state = $state; } $this->setError(''); return true; } } tables/.htaccess000066600000000177151372051020007621 0ustar00 Order allow,deny Deny from all manifest.xml000066600000007375151372051020007110 0ustar00 com_xmap 2011-04-10 Guillermo Vargas This component is released under the GNU/GPL License guille@vargas.co.cr http://joomla.vargas.co.cr 2.3.3 GNU/GPL Xmap - Sitemap Generator for Joomla! install/install.utf8.sql install/install.postgresql.sql install/uninstall.utf8.sql install/uninstall.postgresql.sql controller.php displayer.php index.html metadata.xml router.php xmap.php assets controllers helpers models views en-GB.com_xmap.ini es-ES.com_xmap.ini fa-IR.com_xmap.ini cs-CZ.com_xmap.ini nl-NL.com_xmap.ini ru-RU.com_xmap.ini images COM_XMAP_TITLE xmap.php controller.php index.html LICENSE.txt css elements images install helpers controllers tables views models en-GB/en-GB.com_xmap.ini en-GB/en-GB.com_xmap.sys.ini es-ES/es-ES.com_xmap.ini es-ES/es-ES.com_xmap.sys.ini fa-IR/fa-IR.com_xmap.ini fa-IR/fa-IR.com_xmap.sys.ini cs-CZ/cs-CZ.com_xmap.ini cs-CZ/cs-CZ.com_xmap.sys.ini nl-NL/nl-NL.com_xmap.ini nl-NL/nl-NL.com_xmap.sys.ini ru-RU/ru-RU.com_xmap.ini ru-RU/ru-RU.com_xmap.sys.ini images https://raw.github.com/guilleva/Xmap/master/xmap-update.xml controllers/sitemap.php000066600000002053151372051020011265 0ustar00authorise('core.edit', 'com_xmap.sitemap.'.$recordId); } }controllers/sitemaps.php000066600000004110151372051020011444 0ustar00registerTask('unpublish', 'publish'); $this->registerTask('trash', 'publish'); $this->registerTask('unfeatured', 'featured'); } /** * Method to toggle the default sitemap. * * @return void * @since 2.0 */ function setDefault() { // Check for request forgeries JRequest::checkToken() or die('Invalid Token'); // Get items to publish from the request. $cid = JRequest::getVar('cid', 0, '', 'array'); $id = @$cid[0]; if (!$id) { JError::raiseWarning(500, JText::_('Select an item to set as default')); } else { // Get the model. $model = $this->getModel(); // Publish the items. if (!$model->setDefault($id)) { JError::raiseWarning(500, $model->getError()); } } $this->setRedirect('index.php?option=com_xmap&view=sitemaps'); } /** * Proxy for getModel. * * @param string $name The name of the model. * @param string $prefix The prefix for the PHP class name. * * @return JModel * @since 2.0 */ public function getModel($name = 'Sitemap', $prefix = 'XmapModel', $config = array('ignore_request' => true)) { $model = parent::getModel($name, $prefix, $config); return $model; } }LICENSE.txt000066600000042630151372051020006374 0ustar00GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. models/fields/xmapmenus.php000066600000014304151372051020012025 0ustar00getQuery(true); //$currentMenus = array_keys(get_object_vars($this->value)); $currentMenus = array(); $query->select('menutype As value, title As text'); $query->from('#__menu_types AS a'); $query->order('a.title'); // Get the options. $db->setQuery($query); // echo $db->getQuery(); $menus = $db->loadObjectList('value'); $options = array(); // Add the current sitemap menus in the defined order to the list foreach ($currentMenus as $menutype) { if (!empty($menus[$menutype])) { $options[] = $menus[$menutype]; } } // Add the rest of the menus to the list (if any) foreach ($menus as $menutype => $menu) { if (!in_array($menutype, $currentMenus)) { $options[] = $menu; } } // Check for a database error. if ($db->getErrorNum()) { JError::raiseWarning(500, $db->getErrorMsg()); } $options = array_merge( parent::getOptions(), $options ); return $options; } /** * Method to get the field input. * * @return string The field input. */ protected function getInput() { $disabled = $this->element['disabled'] == 'true' ? true : false; $readonly = $this->element['readonly'] == 'true' ? true : false; $attributes = ' '; $type = 'radio'; if ($v = $this->element['size']) { $attributes .= 'size="' . $v . '" '; } if ($v = $this->element['class']) { $attributes .= 'class="' . $v . '" '; } else { $attributes .= 'class="inputbox" '; } if ($m = $this->element['multiple']) { $type = 'checkbox'; } $value = $this->value; if (!is_array($value)) { // Convert the selections field to an array. $registry = new JRegistry; $registry->loadString($value); $value = $registry->toArray(); } $doc = JFactory::getDocument(); $doc->addScriptDeclaration(" window.addEvent('domready',function(){ \$\$('div.xmap-menu-options select').addEvent('mouseover',function(event){xmapMenusSortable.detach();}) \$\$('div.xmap-menu-options select').addEvent('mouseout',function(event){xmapMenusSortable.attach();}) var xmapMenusSortable = new Sortables(\$('ul_" . $this->inputId . "'),{ clone:true, revert: true, preventDefault: true, onStart: function(el) { el.setStyle('background','#bbb'); }, onComplete: function(el) { el.setStyle('background','#eee'); } }); });"); if ($disabled || $readonly) { $attributes .= 'disabled="disabled"'; } $options = (array) $this->_getOptions(); $return = '
        '; // Create a regular list. $i = 0; //Lets show the enabled menus first $this->currentItems = array_keys($value); // Sort the menu options uasort($options, array($this, 'myCompare')); foreach ($options as $option) { $prioritiesName = preg_replace('/(jform\[[^\]]+)(\].*)/', '$1_priority$2', $this->name); $changefreqName = preg_replace('/(jform\[[^\]]+)(\].*)/', '$1_changefreq$2', $this->name); $selected = (isset($value[$option->value]) ? ' checked="checked"' : ''); $i++; $return .= ''; } $return .= "
      "; return $return; } public function myCompare($a, $b) { $indexA = array_search($a->value, $this->currentItems); $indexB = array_search($b->value, $this->currentItems); if ($indexA === $indexB && $indexA !== false) { return 0; } if ($indexA === false && $indexA === $indexB) { return ($a->value < $b->value) ? -1 : 1; } if ($indexA === false) { return 1; } if ($indexB === false) { return -1; } return ($indexA < $indexB) ? -1 : 1; } } models/fields/index.html000066600000000036151372051020011271 0ustar00models/fields/.htaccess000066600000000177151372051020011100 0ustar00 Order allow,deny Deny from all models/fields/modal/index.html000066600000000036151372051020012365 0ustar00models/fields/modal/sitemaps.php000066600000006102151372051020012726 0ustar00value) { $db->setQuery( 'SELECT title' . ' FROM #__xmap_sitemap' . ' WHERE id = ' . (int) $this->value ); $title = $db->loadResult(); if ($error = $db->getErrorMsg()) { JError::raiseWarning(500, $error); } } else { $title = ''; } if (empty($title)) { $title = JText::_('COM_XMAP_SELECT_AN_SITEMAP'); } $doc->addScriptDeclaration( "function jSelectSitemap_" . $this->id . "(id, title, object) { $('" . $this->id . "_id').value = id; $('" . $this->id . "_name').value = title; SqueezeBox.close(); }" ); $link = 'index.php?option=com_xmap&view=sitemaps&layout=modal&tmpl=component&function=jSelectSitemap_' . $this->id; JHTML::_('behavior.modal', 'a.modal'); $html = ''; $html .= "\n" . ''; if(version_compare(JVERSION,'3.0.0','ge')) $html .= ' ' . JText::_('COM_XMAP_CHANGE_SITEMAP_BUTTON') . '' . "\n"; else $html .= '' . "\n"; $html .= ''; $html .= "\n" . ''; return $html; } }models/fields/modal/.htaccess000066600000000177151372051020012174 0ustar00 Order allow,deny Deny from all models/sitemaps.php000066600000013570151372051020010373 0ustar00context .= '.'.$layout; } $access = $this->getUserStateFromRequest($this->context.'.filter.access', 'filter_access', 0, 'int'); $this->setState('filter.access', $access); $published = $this->getUserStateFromRequest($this->context.'.filter.published', 'filter_published', ''); $this->setState('filter.published', $published); $search = $this->getUserStateFromRequest($this->context.'.filter.search', 'filter_search'); $this->setState('filter.search', $search); // List state information. parent::populateState('a.title', 'asc'); } /** * Method to get a store id based on model configuration state. * * This is necessary because the model is used by the component and * different modules that might need different sets of data or different * ordering requirements. * * @param string $id A prefix for the store id. * * @return string A store id. */ protected function getStoreId($id = '') { // Compile the store id. $id .= ':'.$this->getState('filter.search'); $id .= ':'.$this->getState('filter.access'); $id .= ':'.$this->getState('filter.published'); return parent::getStoreId($id); } /** * @param boolean True to join selected foreign information * * @return string */ protected function getListQuery($resolveFKs = true) { $db = $this->getDbo(); // Create a new query object. $query = $db->getQuery(true); // Select the required fields from the table. $query->select( $this->getState( 'list.select', 'a.*') ); $query->from('#__xmap_sitemap AS a'); // Join over the asset groups. $query->select('ag.title AS access_level'); $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); // Filter by access level. if ($access = $this->getState('filter.access')) { $query->where('a.access = ' . (int) $access); } // Filter by published state $published = $this->getState('filter.published'); if (is_numeric($published)) { $query->where('a.state = ' . (int) $published); } else if ($published === '') { $query->where('(a.state = 0 OR a.state = 1)'); } // Filter by search in title. $search = $this->getState('filter.search'); if (!empty($search)) { if (stripos($search, 'id:') === 0) { $query->where('a.id = '.(int) substr($search, 3)); } else { $search = $db->Quote('%'.$db->escape($search, true).'%'); $query->where('(a.title LIKE '.$search.' OR a.alias LIKE '.$search.')'); } } // Add the list ordering clause. $query->order($db->escape($this->state->get('list.ordering', 'a.title')) . ' ' . $db->escape($this->state->get('list.direction', 'ASC'))); //echo nl2br(str_replace('#__','jos_',$query)); return $query; } public function getExtensionsMessage() { $db = $this->getDbo(); $query = $db->getQuery(true); $query->select('e.*'); $query->from($db->quoteName('#__extensions'). 'AS e'); $query->join('INNER', '#__extensions AS p ON e.element=p.element and p.enabled=0 and p.type=\'plugin\' and p.folder=\'xmap\''); $query->where('e.type=\'component\' and e.enabled=1'); $db->setQuery($query); $extensions = $db->loadObjectList(); if ( count($extensions) ) { $sep = $extensionsNameList = ''; foreach ($extensions as $extension) { $extensionsNameList .= "$sep$extension->element"; $sep = ', '; } return JText::sprintf('XMAP_MESSAGE_EXTENSIONS_DISABLED',$extensionsNameList); } else { return ""; } } } models/forms/extension.xml000066600000002765151372051020011725 0ustar00
      models/forms/.htaccess000066600000000177151372051020010760 0ustar00 Order allow,deny Deny from all models/forms/index.html000066600000000036151372051020011151 0ustar00models/forms/sitemap.xml000066600000022255151372051020011347 0ustar00