1 | <?php |
---|
2 | defined('EXTENDED_DESC_PATH') or die('Hacking attempt!'); |
---|
3 | |
---|
4 | /** |
---|
5 | * Main help page on plugins list |
---|
6 | */ |
---|
7 | function extdesc_admin_menu($menu) |
---|
8 | { |
---|
9 | $menu[] = array( |
---|
10 | 'NAME' => 'Extended Description', |
---|
11 | 'URL' => get_root_url() . 'admin.php?page=plugin-ExtendedDescription', |
---|
12 | ); |
---|
13 | return $menu; |
---|
14 | } |
---|
15 | |
---|
16 | /** |
---|
17 | * Add link to help popup |
---|
18 | */ |
---|
19 | function add_ed_help() |
---|
20 | { |
---|
21 | global $page, $template; |
---|
22 | |
---|
23 | $target = null; |
---|
24 | switch ($page['page']) |
---|
25 | { |
---|
26 | case 'album': |
---|
27 | $target = 'album_properties'; |
---|
28 | break; |
---|
29 | case 'photo': |
---|
30 | $target = 'picture_modify'; |
---|
31 | break; |
---|
32 | case 'configuration': |
---|
33 | $target = 'config'; |
---|
34 | break; |
---|
35 | case 'notification_by_mail': |
---|
36 | $target = 'notification_by_mail'; |
---|
37 | break; |
---|
38 | case 'plugin': |
---|
39 | if ($_GET['section'] == 'AdditionalPages/admin.php') $target = 'plugin_admin_content'; |
---|
40 | if ($_GET['section'] == 'header_manager/admin.php') $target = 'header_manager'; |
---|
41 | break; |
---|
42 | } |
---|
43 | |
---|
44 | if (!empty($target)) |
---|
45 | { |
---|
46 | load_language('plugin.lang', EXTENDED_DESC_PATH); |
---|
47 | $template->set_prefilter($target, 'add_ed_help_prefilter'); |
---|
48 | } |
---|
49 | } |
---|
50 | |
---|
51 | function add_ed_help_prefilter($content) |
---|
52 | { |
---|
53 | global $template; |
---|
54 | $themeconf = $template->get_template_vars('themeconf'); |
---|
55 | |
---|
56 | $search = '</textarea>'; |
---|
57 | $add = ' |
---|
58 | {combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
59 | <a href="./admin/popuphelp.php?page=extended_desc" onclick="popuphelp(this.href); return false;" title="'.l10n('Use Extended Description tags...').'" style="vertical-align: middle; border: 0; margin: 0.5em;"><img src="'.$themeconf['admin_icon_dir'].'/help.png" class="button" alt="'.l10n('Use Extended Description tags...').'"></a>'; |
---|
60 | |
---|
61 | return str_replace($search, $search.$add, $content); |
---|
62 | } |
---|
63 | |
---|
64 | |
---|
65 | /** |
---|
66 | * Display popup content |
---|
67 | */ |
---|
68 | function extended_desc_popup($help_content, $get) |
---|
69 | { |
---|
70 | if ($get == 'extended_desc') |
---|
71 | { |
---|
72 | global $template; |
---|
73 | |
---|
74 | load_language('plugin.lang', EXTENDED_DESC_PATH); |
---|
75 | |
---|
76 | $template->assign(array( |
---|
77 | 'EXTENDED_DESC_PATH' => EXTENDED_DESC_PATH, |
---|
78 | 'EXTDESC_HELP' => array( |
---|
79 | 'lang' => load_language('help.lang.html', EXTENDED_DESC_PATH, array('return'=>true)), |
---|
80 | 'extdesc' => load_language('help.extdesc.html', EXTENDED_DESC_PATH, array('return'=>true)), |
---|
81 | 'cat_photo' => load_language('help.cat_photo.html', EXTENDED_DESC_PATH, array('return'=>true)), |
---|
82 | 'slider' => load_language('help.slider.html', EXTENDED_DESC_PATH, array('return'=>true)), |
---|
83 | 'hide' => load_language('help.hide.html', EXTENDED_DESC_PATH, array('return'=>true)), |
---|
84 | 'redirect' => load_language('help.redirect.html', EXTENDED_DESC_PATH, array('return'=>true)), |
---|
85 | ), |
---|
86 | )); |
---|
87 | |
---|
88 | $template->set_filename('extdesc', realpath(EXTENDED_DESC_PATH . 'template/admin.tpl')); |
---|
89 | |
---|
90 | $help_content = '<h2>Extended Description</h2>' . $template->parse('extdesc', true); |
---|
91 | } |
---|
92 | return $help_content; |
---|
93 | } |
---|