Changeset 5182 for trunk/admin/help.php


Ignore:
Timestamp:
Mar 18, 2010, 11:12:30 PM (14 years ago)
Author:
plg
Message:

feature 1519: admin instructions are dispatched into several tabs. Only
applied to en_UK and fr_FR. The help content itself needs some updates
but it will be another set of commits, in this commit, I nearly only
modified the container.

The new "Add Photos" help page only introduces you to 3 main ways to add
photos: direct upload, pLoader and FTP. Each of them has a dedicated tab
on the Admin>Photos>Add screen.

No use of the big question mark icon linked to the Help pages in the
administration header, to avoid having this icon twice : in the header
+ in the content next to H2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/help.php

    r3282 r5182  
    2323
    2424include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
     25include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
    2526
    2627// +-----------------------------------------------------------------------+
     
    2930check_status(ACCESS_ADMINISTRATOR);
    3031
    31 $template->assign('ADMIN_CONTENT', load_language('help.html','',array('return'=>true)) );
     32$link = get_root_url().'admin.php?page=help&section=';
     33$selected = null;
     34$help_section_title = null;
     35
     36$tabs = array(
     37  array(
     38    'code' => 'add_photos',
     39    'label' => 'Add Photos',
     40    ),
     41  array(
     42    'code' => 'permissions',
     43    'label' => 'Permissions',
     44    ),
     45  array(
     46    'code' => 'groups',
     47    'label' => 'Groups',
     48    ),
     49  array(
     50    'code' => 'user_upload',
     51    'label' => 'User Upload',
     52    ),
     53  array(
     54    'code' => 'virtual_links',
     55    'label' => 'Virtual Links',
     56    ),
     57  array(
     58    'code' => 'misc',
     59    'label' => 'Miscellaneous',
     60    ),
     61  );
     62
     63if (!isset($_GET['section']))
     64{
     65  $section = $tabs[0]['code'];
     66}
     67else
     68{
     69  $section = $_GET['section'];
     70}
     71
     72$tabsheet = new tabsheet();
     73foreach ($tabs as $tab)
     74{
     75  if ($tab['code'] == $section)
     76  {
     77    $selected_tab = $tab['code'];
     78    $help_section_title = l10n($tab['label']);
     79  }
     80 
     81  $tabsheet->add($tab['code'], l10n($tab['label']), $link.$tab['code']);
     82}
     83$tabsheet->select($selected_tab);
     84$tabsheet->assign();
     85
     86$template->set_filenames(array('help' => 'help.tpl'));
     87
     88$template->assign(
     89  array(
     90    'HELP_CONTENT' => load_language(
     91      'help/help_'.$selected_tab.'.html',
     92      '',
     93      array('return'=>true)
     94      ),
     95    'HELP_SECTION_TITLE' => $help_section_title,
     96    )
     97  );
     98
     99// +-----------------------------------------------------------------------+
     100// |                           sending html code                           |
     101// +-----------------------------------------------------------------------+
     102
     103$template->assign_var_from_handle('ADMIN_CONTENT', 'help');
    32104?>
Note: See TracChangeset for help on using the changeset viewer.