Changeset 11753


Ignore:
Timestamp:
07/15/11 20:56:20 (9 years ago)
Author:
rvelices
Message:
  • removed admin never used function cat_admin_access
  • removed obsolete known_script template block
  • added a warning on usage of is_adviser function
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions.php

    r11728 r11753  
    17831783} 
    17841784 
    1785 /** 
    1786  * Is the category accessible to the (Admin) user ? 
    1787  * 
    1788  * Note : if the user is not authorized to see this category, category jump 
    1789  * will be replaced by admin cat_modify page 
    1790  * 
    1791  * @param int category id to verify 
    1792  * @return bool 
    1793  */ 
    1794 function cat_admin_access($category_id) 
    1795 { 
    1796   global $user; 
    1797  
    1798   // $filter['visible_categories'] and $filter['visible_images'] 
    1799   // are not used because it's not necessary (filter <> restriction) 
    1800   if (in_array($category_id, explode(',', $user['forbidden_categories']))) 
    1801   { 
    1802     return false; 
    1803   } 
    1804   return true; 
    1805 } 
    18061785 
    18071786/** 
  • trunk/include/functions_user.inc.php

    r11737 r11753  
    13131313function is_adviser() 
    13141314{ 
     1315  trigger_error('call to obsolete function is_adviser', E_USER_WARNING); 
    13151316  return false; 
    13161317} 
  • trunk/include/template.class.php

    r11122 r11753  
    116116    $this->smarty->register_compiler_function('get_combined_css', array(&$this, 'func_get_combined_css') ); 
    117117    $this->smarty->register_block('footer_script', array(&$this, 'block_footer_script') ); 
    118     $this->smarty->register_function('known_script', array(&$this, 'func_known_script') ); 
    119118    $this->smarty->register_prefilter( array('Template', 'prefilter_white_space') ); 
    120119    if ( $conf['compiled_template_cache_language'] ) 
     
    532531  } 
    533532 
    534  /** 
    535    * This smarty "known_script" functions allows to insert well known java scripts 
    536    * such as prototype, jquery, etc... only once. Examples: 
    537    * {known_script id="jquery" src="{$ROOT_URL}template-common/lib/jquery.packed.js"} 
    538    */ 
    539   function func_known_script($params, &$smarty ) 
    540   { 
    541     if (!isset($params['id'])) 
    542     { 
    543         $smarty->trigger_error("known_script: missing 'id' parameter"); 
    544         return; 
    545     } 
    546     $id = $params['id']; 
    547     trigger_error("known_script is deprecated $id ".@$params['src'], E_USER_WARNING); 
    548     if ('jquery'==$id) 
    549     { 
    550       $this->scriptLoader->add($id, 0, array(), null); 
    551       return; 
    552     } 
    553     if (! isset( $this->known_scripts[$id] ) ) 
    554     { 
    555       if (!isset($params['src'])) 
    556       { 
    557           $smarty->trigger_error("known_script: missing 'src' parameter"); 
    558           return; 
    559       } 
    560       $this->known_scripts[$id] = $params['src']; 
    561       $content = '<script type="text/javascript" src="'.$params['src'].'"></script>'; 
    562       if (isset($params['now']) and $params['now'] and empty($this->output) ) 
    563       { 
    564         return $content; 
    565       } 
    566       $repeat = false; 
    567       $this->block_html_head(null, $content, $smarty, $repeat); 
    568     } 
    569   } 
    570  
    571   /** 
     533   /** 
    572534    * combine_script smarty function allows inclusion of a javascript file in the current page. 
    573535    * The engine will combine several js files into a single one in order to reduce the number of 
Note: See TracChangeset for help on using the changeset viewer.