Changeset 2166:6f409aa25386 for inc/admin/lib.dc.page.php
- Timestamp:
- 09/30/13 11:56:33 (12 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/admin/lib.dc.page.php
r2161 r2166 304 304 } 305 305 306 public static function breadcrumb($elements=null,$with_home_link=true,$echo=false) 307 { 306 public static function breadcrumb($elements=null,$options=array()) 307 { 308 $with_home_link = isset($options['home_link'])?$options['home_link']:true; 309 $highlight_latest = isset($options['highlight_latest'])?$options['highlight_latest']:true; 310 $highlight_pos = isset($options['highlight_pos'])?$options['highlight_pos']:-1; 308 311 // First item of array elements should be blog's name, System or Plugins 309 312 $res = '<h2>'.($with_home_link ? … … 311 314 '<img src="style/dashboard-alt.png" alt="" />'); 312 315 $index = 0; 316 if ($highlight_pos < 0) { 317 $highlight_pos = count($elements)+$highlight_pos; 318 } 313 319 foreach ($elements as $element => $url) { 320 if ($highlight_latest && $index == $highlight_pos) { 321 $element = sprintf('<span class="page-title">%s</span>',$element); 322 } 314 323 $res .= ($with_home_link ? ($index == 1 ? ' : ' : ' › ') : ($index == 0 ? ' ' : ' › ')). 315 324 ($url ? '<a href="'.$url.'">' : '').$element.($url ? '</a>' : ''); … … 317 326 } 318 327 $res .= '</h2>'; 319 if ($echo) {320 echo $res;321 }322 328 return $res; 323 329 }
Note: See TracChangeset
for help on using the changeset viewer.