Ignore:
Timestamp:
Mar 7, 2013, 1:50:05 AM (11 years ago)
Author:
mistic100
Message:

fix breadcrumb in 2.5 & add button with new template features

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/skeleton/trunk/include/public_events.inc.php

    r18858 r21307  
    1212  {
    1313    $page['section'] = 'skeleton';
    14     $page['title'] = '<a href="'.get_absolute_root_url().'">'.l10n('Home').'</a>'.$conf['level_separator'].'<a href="'.SKELETON_PUBLIC.'">'.l10n('Skeleton').'</a>';
    1514   
    16     // print_r($tokens);
     15    // section_title is for breadcrumb, title is for page <title>
     16    $page['section_title'] = '<a href="'.get_absolute_root_url().'">'.l10n('Home').'</a>'.$conf['level_separator'].'<a href="'.SKELETON_PUBLIC.'">'.l10n('Skeleton').'</a>';
     17    $page['title'] = l10n('Skeleton');
     18   
     19    // define body_id
     20    add_event_handler('loc_begin_page_header', 'skeleton_loc_begin_page_header');
    1721  }
     22}
     23
     24function skeleton_loc_begin_page_header()
     25{
     26  global $page;
     27  $page['body_id'] = 'theSkeletonPage';
    1828}
    1929
     
    2333function skeleton_loc_end_page()
    2434{
    25   global $page;
     35  global $page, $template;
    2636
    27   if ( isset($page['section']) and $page['section'] == 'skeleton' )
     37  if ( isset($page['section']) and $page['section']=='skeleton' )
    2838  {
    2939    include(SKELETON_PATH . 'include/skeleton_page.inc.php');
     40  }
     41}
     42
     43/*
     44 * button on album and photos pages
     45 */
     46function skeleton_add_button()
     47{
     48  global $template;
     49 
     50  $template->assign('SKELETON_PATH', SKELETON_PATH);
     51  $template->set_filename('skeleton_button', realpath(SKELETON_PATH.'template/my_button.tpl'));
     52  $button = $template->parse('skeleton_button', true);
     53 
     54  if (script_basename()=='index')
     55  {
     56    $template->add_index_button('<li>'.$button.'</li>', EVENT_HANDLER_PRIORITY_NEUTRAL);
     57  }
     58  else
     59  {
     60    $template->add_picture_button($button, EVENT_HANDLER_PRIORITY_NEUTRAL);
    3061  }
    3162}
Note: See TracChangeset for help on using the changeset viewer.