Ignore:
Timestamp:
Feb 22, 2011, 3:50:46 PM (13 years ago)
Author:
patdenice
Message:

Extended description now work on page title.
Language restriction is now optionnal.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/AdditionalPages/additional_page.php

    r9345 r9350  
    2929$identifier = $page['ap_homepage'] ? $conf['AP']['homepage'] : $tokens[1];
    3030
    31 if (function_exists('get_extended_desc'))
    32   add_event_handler('AP_render_content', 'get_extended_desc');
    33 
    3431// Retrieve page data
    35 $query = 'SELECT id, title , content, users, groups, level, permalink, standalone
     32$query = 'SELECT id, title, lang, content, users, groups, level, permalink, standalone
    3633FROM ' . ADD_PAGES_TABLE . '
    3734';
     
    5855if (!is_admin() or (!is_admin() xor $page['ap_homepage']))
    5956{
     57  // authorized language
     58  if (!empty($row['lang']) and $row['lang'] != $user['language'])
     59  {
     60    if ($page['ap_homepage'] and check_random_index_redirect()) return;
     61    page_forbidden(l10n('You are not authorized to access the requested page'), make_index_url());
     62  }
     63
    6064  // authorized level
    6165  if ($user['level'] < $row['level'])
    6266  {
    6367    if ($page['ap_homepage'] and check_random_index_redirect()) return;
    64     page_forbidden(l10n('You are not authorized to access the requested page'));
     68    page_forbidden(l10n('You are not authorized to access the requested page'), make_index_url());
    6569  }
    6670
     
    7276    {
    7377      if ($page['ap_homepage'] and check_random_index_redirect()) return;
    74       page_forbidden(l10n('You are not authorized to access the requested page'));
     78      page_forbidden(l10n('You are not authorized to access the requested page'), make_index_url());
    7579    }
    7680  }
     
    8892    {
    8993      if ($page['ap_homepage'] and check_random_index_redirect()) return;
    90       page_forbidden(l10n('You are not authorized to access the requested page'));
     94      page_forbidden(l10n('You are not authorized to access the requested page'), make_index_url());
    9195    }
    9296  }
     
    106110  'id' => $row['id'],
    107111  'permalink' => @$row['permalink'],
    108   'title' => trigger_event('AP_render_content', $row['title']),
     112  'title' => trigger_event('AP_render_title', $row['title']),
    109113  'content' => trigger_event('AP_render_content', $row['content']),
    110114);
Note: See TracChangeset for help on using the changeset viewer.