Changeset 11753
- Timestamp:
- Jul 15, 2011, 8:56:20 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r11728 r11753 1783 1783 } 1784 1784 1785 /**1786 * Is the category accessible to the (Admin) user ?1787 *1788 * Note : if the user is not authorized to see this category, category jump1789 * will be replaced by admin cat_modify page1790 *1791 * @param int category id to verify1792 * @return bool1793 */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 }1806 1785 1807 1786 /** -
trunk/include/functions_user.inc.php
r11737 r11753 1313 1313 function is_adviser() 1314 1314 { 1315 trigger_error('call to obsolete function is_adviser', E_USER_WARNING); 1315 1316 return false; 1316 1317 } -
trunk/include/template.class.php
r11122 r11753 116 116 $this->smarty->register_compiler_function('get_combined_css', array(&$this, 'func_get_combined_css') ); 117 117 $this->smarty->register_block('footer_script', array(&$this, 'block_footer_script') ); 118 $this->smarty->register_function('known_script', array(&$this, 'func_known_script') );119 118 $this->smarty->register_prefilter( array('Template', 'prefilter_white_space') ); 120 119 if ( $conf['compiled_template_cache_language'] ) … … 532 531 } 533 532 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 /** 572 534 * combine_script smarty function allows inclusion of a javascript file in the current page. 573 535 * 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.