Revision 1235
Added by Dietmar almost 15 years ago
frontend.functions.php | ||
---|---|---|
231 | 231 |
global $database; |
232 | 232 |
global $wb; |
233 | 233 |
$admin = & $wb; |
234 |
if ($wb->page_access_denied==true) { |
|
234 |
if ($wb->page_access_denied==true) |
|
235 |
{ |
|
235 | 236 |
echo $MESSAGE['FRONTEND']['SORRY_NO_VIEWING_PERMISSIONS']; |
236 | 237 |
exit(); |
237 | 238 |
} |
238 |
if ($wb->page_no_active_sections==true) { |
|
239 |
if ($wb->page_no_active_sections==true) |
|
240 |
{ |
|
239 | 241 |
echo $MESSAGE['FRONTEND']['SORRY_NO_ACTIVE_SECTIONS']; |
240 | 242 |
exit(); |
241 | 243 |
} |
242 |
if(isset($globals) AND is_array($globals)) { foreach($globals AS $global_name) { global $$global_name; } } |
|
244 |
if(isset($globals) AND is_array($globals)) |
|
245 |
{ |
|
246 |
foreach($globals AS $global_name) |
|
247 |
{ |
|
248 |
global $$global_name; |
|
249 |
} |
|
250 |
} |
|
243 | 251 |
// Make sure block is numeric |
244 | 252 |
if(!is_numeric($block)) { $block = 1; } |
245 | 253 |
// Include page content |
... | ... | |
303 | 311 |
echo $content; |
304 | 312 |
} |
305 | 313 |
} |
306 |
} else { |
|
314 |
} |
|
315 |
else |
|
316 |
{ |
|
317 |
|
|
307 | 318 |
require(PAGE_CONTENT); |
308 | 319 |
} |
309 | 320 |
} |
... | ... | |
333 | 344 |
$level = ($count <= $level ) ? $count-1 : $level; |
334 | 345 |
// set level from which to show, delete indexes in array |
335 | 346 |
$crumbs = array_slice($bread_crumbs, $level ); |
336 |
// set depth of links -1 or 0 show all links |
|
337 | 347 |
$depth = ($depth <= 0) ? sizeof($crumbs) : $depth; |
338 | 348 |
// if empty array, set orginal links |
339 | 349 |
$crumbs = (!empty($crumbs)) ? $crumbs : $wb->page_trail; |
340 | 350 |
$total_crumbs = ( ($depth <= 0) OR ($depth > sizeof($crumbs)) ) ? sizeof($crumbs) : $depth; |
341 |
print '<div class="breadcrumb">'.$title; |
|
342 |
|
|
343 |
foreach ($crumbs as $temp){ |
|
351 |
print '<div class="breadcrumb"><span class=" title">'.$title.'</span>'; |
|
352 |
// print_r($crumbs); |
|
353 |
foreach ($crumbs as $temp) |
|
354 |
{ |
|
344 | 355 |
if($counter == $depth) { break; } |
345 |
// set separator |
|
346 |
$query_menu = $database->query("SELECT menu_title, link FROM ".TABLE_PREFIX."pages WHERE page_id = $temp");
|
|
356 |
// set links and separator
|
|
357 |
$query_menu = $database->query("SELECT * FROM ".TABLE_PREFIX."pages WHERE page_id = $temp");
|
|
347 | 358 |
$page = $query_menu->fetchRow(); |
348 |
if ( ($links == true) AND ($temp != $page_id) ) { |
|
349 |
print '<a href="'.page_link($page['link']).'">'.$page['menu_title'].'</a>'; |
|
350 |
} else { |
|
351 |
print '<span class="crumb">'.$page['menu_title'].'</span>'; |
|
352 |
} |
|
353 |
if ( ( $counter <> $total_crumbs-1 ) ) { |
|
359 |
|
|
360 |
$show_crumb = (($links == true) AND ($temp != $page_id)) |
|
361 |
? '<a href="'.page_link($page['link']).'" class="link">'.$page['menu_title'].'</a>' |
|
362 |
: '<span class="crumb">'.MENU_TITLE.'</span>'; |
|
363 |
|
|
364 |
// Permission |
|
365 |
switch ($page['visibility']) |
|
366 |
{ |
|
367 |
case 'none' : |
|
368 |
case 'hidden' : |
|
369 |
// if show, you know there is an error in a hidden page |
|
370 |
print $show_crumb.' --- '; |
|
371 |
break; |
|
372 |
default : |
|
373 |
print $show_crumb; |
|
374 |
break; |
|
375 |
} |
|
376 |
|
|
377 |
if ( ( $counter <> $total_crumbs-1 ) ) |
|
378 |
{ |
|
354 | 379 |
print '<span class="separator">'.$sep.'</span>'; |
355 | 380 |
} |
356 | 381 |
$counter++; |
357 |
}
|
|
382 |
} |
|
358 | 383 |
print "</div>\n"; |
359 | 384 |
} |
360 | 385 |
} |
Also available in: Unified diff
Ticket #903 fix CSS-errors in WB backend
add title class in show_breadcrumbs, now full css styling