Changeset 879 for trunk/popuphelp.php


Ignore:
Timestamp:
Sep 27, 2005, 11:57:14 PM (19 years ago)
Author:
plg
Message:
  • bug 168 fixed: crash when language file does not exists. Constant PHPWG_DEFAULT_LANGUAGE added. New function get_language_filepath always used to find language files.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/popuphelp.php

    r858 r879  
    3333include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
    3434
    35 // language files
    36 $user_langdir = PHPWG_ROOT_PATH.'language/'.$user['language'];
    37 $conf_langdir = PHPWG_ROOT_PATH.'language/'.$conf['default_language'];
    38 
    39 if (file_exists($user_langdir.'/help/'.$_GET['page'].'.html'))
    40 {
    41   $html_file = $user_langdir.'/help/'.$_GET['page'].'.html';
    42 }
    43 else
    44 {
    45   $html_file = $conf_langdir.'/help/'.$_GET['page'].'.html';
    46 }
    47 
    4835$page['body_id'] = 'thePopuphelpPage';
    4936$page['gallery_title'] = $title = l10n('PhpWebGallery Help');
    5037include(PHPWG_ROOT_PATH.'include/page_header.php');
    51 $template->set_filenames(array('help_content' => $html_file));
     38
     39$template->set_filenames(
     40  array(
     41    'help_content' => get_language_filepath('help/'.$_GET['page'].'.html')
     42    )
     43  );
    5244
    5345$template->set_filenames(array('popuphelp' => 'popuphelp.tpl'));
Note: See TracChangeset for help on using the changeset viewer.