Changeset 21203


Ignore:
Timestamp:
Mar 5, 2013, 12:11:53 PM (8 years ago)
Author:
mistic100
Message:

define body_id and page_title

Location:
extensions/AdditionalPages/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/AdditionalPages/trunk/additional_page.php

    r12927 r21203  
    114114);
    115115
     116
     117
    116118add_event_handler('loc_end_index', 'ap_set_index');
     119add_event_handler('loc_begin_page_header', 'ap_set_header');
     120
     121function ap_set_header()
     122{
     123  global $page, $title;
     124 
     125  if ($page['ap_homepage'])
     126  {
     127    $page['body_id'] = 'theHomePage';
     128  }
     129  else
     130  {
     131    $page['body_id'] = 'theAdditionalPage';
     132    $title = $page['additional_page']['title'];
     133  }
     134}
    117135
    118136function ap_set_index()
  • extensions/AdditionalPages/trunk/main.inc.php

    r19836 r21203  
    7070  if ($tokens[0] == 'additional_page' and !empty($tokens[1]))
    7171    redirect(make_index_url(array('section'=>'page')).'/'.$tokens[1]);
    72 
    73   if (!is_null($conf['AP']['homepage']))
    74   {
    75     $albums_url = make_index_url(array('section' => 'categories'));
    76    
    77     $page['title'] = preg_replace(
    78       '#/a>#',
    79       '/a>'.$conf['level_separator'].'<a href="'.$albums_url.'">'.l10n('Albums').'</a>',
    80       $page['title'],
    81       1 // only replace the first occurence of "a/>"
    82       );
    83   }
    8472}
    8573
Note: See TracChangeset for help on using the changeset viewer.