includes/paths.php
changeset 650 e45183014778
parent 617 9e4ccf67b6ea
child 685 17ebe24cdf85
equal deleted inserted replaced
649:74e03196fd43 650:e45183014778
   473       $ret .= "['".$name."', 'javascript:trees[0].toggle($i)', \n";
   473       $ret .= "['".$name."', 'javascript:trees[0].toggle($i)', \n";
   474       foreach($this->admin_tree[$key] as $c)
   474       foreach($this->admin_tree[$key] as $c)
   475       {
   475       {
   476         $i++;
   476         $i++;
   477         $name = ( preg_match('/^[a-z0-9_]+$/', $key) ) ? $lang->get($c['name']) : $c['name'];
   477         $name = ( preg_match('/^[a-z0-9_]+$/', $key) ) ? $lang->get($c['name']) : $c['name'];
   478         if ( $c['icon'] && $c['icon'] != scriptPath . '/images/spacer.gif' )
   478         if ( $c['icon'] && $c['icon'] != cdnPath . '/images/spacer.gif' )
   479         {
   479         {
   480           if ( is_array($c['icon']) )
   480           if ( is_array($c['icon']) )
   481           {
   481           {
   482             // this is a sprite reference
   482             // this is a sprite reference
   483             list($ix, $iy) = $c['icon'];
   483             list($ix, $iy) = $c['icon'];
   518   
   518   
   519   function make_sprite_icon($ix, $iy)
   519   function make_sprite_icon($ix, $iy)
   520   {
   520   {
   521     $xpos = 16 * ( $ix - 1 );
   521     $xpos = 16 * ( $ix - 1 );
   522     $ypos = 16 * ( $iy - 1 );
   522     $ypos = 16 * ( $iy - 1 );
   523     return "<img alt=\"\" src=\"" . scriptPath . "/images/spacer.gif\" class=\"adminiconsprite\" style=\"border-width: 0; margin-right: 3px; background-position: -{$xpos}px -{$ypos}px;\" /> ";
   523     return "<img alt=\"\" src=\"" . cdnPath . "/images/spacer.gif\" class=\"adminiconsprite\" style=\"border-width: 0; margin-right: 3px; background-position: -{$xpos}px -{$ypos}px;\" /> ";
   524   }
   524   }
   525   
   525   
   526   /**
   526   /**
   527    * Creates a new entry in the administration panel's navigation tree.
   527    * Creates a new entry in the administration panel's navigation tree.
   528    * @param string Section name - if this is a language string identifier, it will be sent through $lang->get()
   528    * @param string Section name - if this is a language string identifier, it will be sent through $lang->get()
   533   
   533   
   534   function addAdminNode($section, $page_title, $url, $icon = false)
   534   function addAdminNode($section, $page_title, $url, $icon = false)
   535   {
   535   {
   536     if ( !$icon )
   536     if ( !$icon )
   537     {
   537     {
   538       $icon = scriptPath . '/images/spacer.gif';
   538       $icon = cdnPath . '/images/spacer.gif';
   539     }
   539     }
   540     if(!isset($this->admin_tree[$section]))
   540     if(!isset($this->admin_tree[$section]))
   541     {
   541     {
   542       $this->admin_tree[$section] = Array();
   542       $this->admin_tree[$section] = Array();
   543     }
   543     }