Changeset 2566:9bf417837888 for plugins/simpleMenu/_public.php
- Timestamp:
- 11/17/13 20:25:53 (12 years ago)
- Branch:
- 2.6
- Children:
- 2567:6c11245cbf04, 2568:61c67a7d17fa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/simpleMenu/_public.php
r1179 r2566 25 25 $id = isset($attr['id']) ? trim($attr['id']) : ''; 26 26 $description = isset($attr['description']) ? trim($attr['description']) : ''; 27 27 28 28 if (!preg_match('#^(title|span)$#',$description)) { 29 29 $description = ''; 30 30 } 31 31 32 32 return '<?php echo tplSimpleMenu::displayMenu('. 33 33 "'".addslashes($class)."',". … … 36 36 '); ?>'; 37 37 } 38 38 39 39 # Widget function 40 40 public static function simpleMenuWidget($w) 41 41 { 42 42 global $core, $_ctx; 43 43 44 44 if (($w->homeonly == 1 && $core->url->type != 'default') || 45 45 ($w->homeonly == 2 && $core->url->type == 'default')) { … … 57 57 ($w->content_only ? '' : '</div>'); 58 58 } 59 59 60 60 public static function displayMenu($class='',$id='',$description='') 61 61 { … … 67 67 $menu = @unserialize($menu); 68 68 69 if (is_array($menu)) 69 if (is_array($menu)) 70 70 { 71 71 // Current relative URL 72 72 $url = $_SERVER['REQUEST_URI']; 73 73 $abs_url = http::getHost().$url; 74 74 75 75 // Home recognition var 76 76 $home_url = html::stripHostURL($GLOBALS['core']->blog->url); … … 87 87 # Active item test 88 88 $active = false; 89 if (($url == $href) || 90 ($abs_url == $href) || 91 ($_SERVER['URL_REQUEST_PART'] == $href) || 89 if (($url == $href) || 90 ($abs_url == $href) || 91 ($_SERVER['URL_REQUEST_PART'] == $href) || 92 92 (($_SERVER['URL_REQUEST_PART'] == '') && (($href == $home_url) || ($href == $home_directory)))) { 93 93 $active = true; … … 123 123 '</li>'; 124 124 } 125 125 126 126 // Final rendering 127 127 if ($ret) { … … 133 133 } 134 134 } 135 136 ?>
Note: See TracChangeset
for help on using the changeset viewer.