source: extensions/ExtendedDescription/admin.inc.php @ 16172

Revision 16172, 1.8 KB checked in by mistic100, 7 years ago (diff)

-help buttons added with a prefilter, update for 2.4
-update fr and en help files (only)

Line 
1<?php
2
3if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
4
5add_event_handler('get_popup_help_content', 'extended_desc_popup', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
6add_event_handler('loc_begin_admin_page', 'add_ed_help');
7
8function add_ed_help()
9{
10  global $page, $template;
11 
12  $target = null;
13  switch ($page['page'])
14  {
15    case 'album':
16      $target = 'album_properties';
17      break;
18    case 'photo':
19      $target = 'picture_modify';
20      break;
21    case 'configuration':
22      $target = 'config';
23      break;
24    case 'notification_by_mail':
25      $target = 'notification_by_mail';
26      break;
27    case 'plugin':
28      if ($_GET['section'] == 'AdditionalPages/admin.php') $target = 'plugin_admin_content';
29      if ($_GET['section'] == 'header_manager/admin.php')  $target = 'header_manager';
30      break;
31  }
32 
33  if (!empty($target))
34  {
35    load_language('plugin.lang', EXTENDED_DESC_PATH);
36    $template->set_prefilter($target, 'add_ed_help_prefilter');
37  }
38}
39
40function add_ed_help_prefilter($content)
41{
42  global $template;
43  $themeconf = $template->get_template_vars('themeconf');
44 
45  $search = '</textarea>';
46  $add = '
47{combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'}
48<a href="./admin/popuphelp.php?page=extended_desc" onclick="popuphelp(this.href); return false;" title="'.l10n('ExtendedDesc_help').'" style="vertical-align: middle; border: 0; margin: 0.5em;"><img src="'.$themeconf['admin_icon_dir'].'/help.png" class="button" alt="'.l10n('ExtendedDesc_help').'"></a>';
49 
50  return str_replace($search, $search.$add, $content);
51}
52
53function  extended_desc_popup($help_content, $get)
54{
55  if ($get == 'extended_desc')
56  {
57    $help_content = load_language('help.html', EXTENDED_DESC_PATH, array('return'=>true));
58  }
59  return $help_content;
60}
61
62
63?>
Note: See TracBrowser for help on using the repository browser.