Changeset 21307


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

Location:
extensions/skeleton/trunk
Files:
2 added
4 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}
  • extensions/skeleton/trunk/language/en_UK/intro.html

    r17933 r21307  
    1616    <li>Simple template prefilter (on picture.php page)</li>
    1717    <li>Add new method to the API</li>
     18    <li>Add a toolbar button</li>
    1819  </ul>
    1920</p>
  • extensions/skeleton/trunk/language/fr_FR/intro.html

    r17933 r21307  
    1616    <li>Préfiltre de template simple (sur page picture.php)</li>
    1717    <li>Ajout d'une méthode à l'API</li>
     18    <li>Ajout d'un bouton dans la barre d'outils</li>
    1819  </ul>
    1920</p>
  • extensions/skeleton/trunk/main.inc.php

    r21304 r21307  
    7171  // NOTE: skeleton_blockmanager_apply1() and skeleton_blockmanager_apply2() can (should) be merged
    7272 
     73  // add button on album and photos pages
     74  add_event_handler('loc_end_index', 'skeleton_add_button');
     75  add_event_handler('loc_end_picture', 'skeleton_add_button');
     76 
    7377  // prefilter on photo page
    7478  add_event_handler('loc_end_picture', 'skeleton_loc_end_picture');
Note: See TracChangeset for help on using the changeset viewer.