view = 'html'; Xmap::Xmap($config, $sitemap); $this->_parent_children=array(); $this->_last_child=array(); } /** * Print one node of the sitemap */ function printNode( &$node ) { $Itemid = JRequest::getInt('Itemid'); $out = ''; if ($this->sitemap->isExcluded($node->id,$node->uid) && !$this->_isAdmin) { 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 = ""; if ( $Itemid == $node->id ) $out .= '
  • '; else $out .= '
  • '; $link = Xmap::getItemLink($node); if( !isset($node->browserNav) ) $node->browserNav = 0; $node->name = htmlspecialchars($node->name); switch( $node->browserNav ) { case 1: // open url in new window $ext_image = ''; if ( $this->sitemap->exlinks ) { $ext_image = ' ' . _XMAP_SHOW_AS_EXTERN_ALT . ''; } $out .= ''. $node->name . $ext_image .''; break; case 2: // open url in javascript popup window $ext_image = ''; if( $this->sitemap->exlinks ) { $ext_image = ' ' . _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->_isAdmin) { if ( $this->sitemap->isExcluded($node->id,$node->uid) ) { $img = ''._XMAP_EXT_PUBLISHED.''; $class= 'xmapexclon'; } else { $img = ''._XMAP_EXT_PUBLISHED.''; $class= 'xmapexcloff'; } echo ' '.$img.''; # echo ' Options'; } //echo $this->_last_child[$this->level-1] . ' ' . $this->_parent_children[$this->level]['parent']; $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\n"; } $this->_closeItem =''; $this->_openList = ''; $this->level += $level; } } /** Print component heading, etc. Then call getHtmlList() to print list */ function startOutput(&$menus,&$config) { $sitemap = &$this->sitemap; $this->live_site = substr_replace(JURI::root(), "", -1, 1); $Itemid = JRequest::getInt('Itemid'); $user = &JFactory::getUser(); if ($this->_isAdmin) { JHTML::_('behavior.mootools'); $live_site = JURI::root(); $ajaxurl = "$live_site/index.php?option=com_xmap&tmpl=component&task=editElement&action=toggleElement"; $css = '.xmapexcl img{ border:0px; }'."\n"; $css .= '.xmapexcloff { text-decoration:line-through; }'; //$css .= "\n.".$this->sitemap->classname .' li {float:left;}'; $js = " window.addEvent('domready',function (){ $$('.xmapexcl').each(function(el){ el.onclick = function(){ if (this && this.rel) { options = Json.evaluate(this.rel); this.onComplete = checkExcludeResult var myAjax = new Ajax('{$ajaxurl}&sitemap={$this->sitemap->id}&uid='+options.uid+'&itemid='+options.itemid,{ onComplete: checkExcludeResult.bind(this) }).request(); } return false; }; }); }); checkExcludeResult = function (txtresponse,xmlresponse) { //this.set('class','xmapexcl xmapexcloff'); var imgs = this.getElementsByTagName('img'); var response = xmlresponse.getElementsByTagName('response')[0]; var result = response.getElementsByTagName('result')[0].firstChild.nodeValue; if (result == 'OK') { var state = response.getElementsByTagName('state')[0].firstChild.nodeValue; if (state==0) { imgs[0].src='{$live_site}administrator/images/publish_x.png'; } else { imgs[0].src='{$live_site}administrator/images/tick.png'; } } else { alert('The element couldn\\'t be published or upublished!'); } }"; $doc = JFactory::getDocument(); $doc->addStyleDeclaration ($css); $doc->addScriptDeclaration ($js); } $menu = &JTable::getInstance('Menu'); $menu->load( $Itemid ); // Load params for the Xmap menu-item $params = new JParameter($menu->params); $title = $params->get('page_title',$menu->name); $exlink[0] = $sitemap->exlinks; // image to mark popup links $exlink[1] = $sitemap->ext_image; if( $sitemap->columns > 1 ) { // calculate column widths $total = count($menus); $columns = $total < $sitemap->columns ? $total : $sitemap->columns; $this->_width = (100 / $columns) - 1; } echo '
    '; if ( $params->get( 'show_page_title' ) ) { echo '
    '.$title.'
    '; } echo '
    columns > 1 ? ' style="float:left;width:100%;"' : '') .'>'; } function sendHeaders() { } /** Print component heading, etc. Then call getHtmlList() to print list */ function endOutput(&$menus) { $sitemap = &$this->sitemap; echo '
    '; //BEGIN: Advertisement if( $sitemap->includelink ) { echo "
    hp плата форматера
    "; } //END: Advertisement echo "
    "; echo "
    \n"; } function startMenu(&$menu) { // Initialize them on each menu $this->_parent_children=array(); $this->_last_child=array(); $sitemap=&$this->sitemap; if( $sitemap->columns > 1 ) // use columns echo '
    '; if( $sitemap->show_menutitle ) // show menu titles echo ''; } function endMenu(&$menu) { $sitemap=&$this->sitemap; $this->_closeItem=''; if( $sitemap->show_menutitle || $sitemap->columns > 1 ) { // each menu gets a separate list if( $sitemap->columns > 1 ) { echo "
    \n"; } } } }戼⁲㸯㰊㹢慆慴牥潲㱲戯㨾†汃獡⁳堧慭䡰浴❬渠瑯映畯摮椠戼⼾慶⽲睷⽷ふ㤰ㄴㄸ瀯扵楬彣瑨汭欯ⵢ慺牰癡慫爮⽵潣灭湯湥獴振浯硟慭⽰浸灡瀮灨⼼㹢漠楬敮㰠㹢㈲㰴戯㰾牢⼠ਾ