source: extensions/ExtendedDescription/include/admin.inc.php @ 26424

Last change on this file since 26424 was 26424, checked in by mistic100, 10 years ago

reorganize code, clean EOL, remove [img] (deprecated since 08/2012)

File size: 1.7 KB
Line 
1<?php
2defined('EXTENDED_DESC_PATH') or die('Hacking attempt!');
3
4/**
5 * Add link to help popup
6 */
7function add_ed_help()
8{
9  global $page, $template;
10
11  $target = null;
12  switch ($page['page'])
13  {
14    case 'album':
15      $target = 'album_properties';
16      break;
17    case 'photo':
18      $target = 'picture_modify';
19      break;
20    case 'configuration':
21      $target = 'config';
22      break;
23    case 'notification_by_mail':
24      $target = 'notification_by_mail';
25      break;
26    case 'plugin':
27      if ($_GET['section'] == 'AdditionalPages/admin.php') $target = 'plugin_admin_content';
28      if ($_GET['section'] == 'header_manager/admin.php')  $target = 'header_manager';
29      break;
30  }
31
32  if (!empty($target))
33  {
34    load_language('plugin.lang', EXTENDED_DESC_PATH);
35    $template->set_prefilter($target, 'add_ed_help_prefilter');
36  }
37}
38
39function add_ed_help_prefilter($content)
40{
41  global $template;
42  $themeconf = $template->get_template_vars('themeconf');
43
44  $search = '</textarea>';
45  $add = '
46{combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'}
47<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>';
48
49  return str_replace($search, $search.$add, $content);
50}
51
52
53/**
54 * Display popup content
55 */
56function  extended_desc_popup($help_content, $get)
57{
58  if ($get == 'extended_desc')
59  {
60    $help_content = load_language('help.html', EXTENDED_DESC_PATH, array('return'=>true));
61  }
62  return $help_content;
63}
Note: See TracBrowser for help on using the repository browser.