1 | <?php |
---|
2 | defined('SHARETHIS_PATH') or die('Hacking attempt!'); |
---|
3 | |
---|
4 | /** |
---|
5 | * detect current section |
---|
6 | */ |
---|
7 | function skeleton_loc_end_section_init() |
---|
8 | { |
---|
9 | global $tokens, $page, $conf; |
---|
10 | |
---|
11 | if ($tokens[0] == 'skeleton') |
---|
12 | { |
---|
13 | $page['section'] = 'skeleton'; |
---|
14 | |
---|
15 | // section_title is for breadcrumb, title is for page <title> |
---|
16 | $page['section_title'] = '<a href="'.get_absolute_root_url().'">'.l10n('Home').'</a>'.$conf['level_separator'].'<a href="'.SKELETON_PUBLIC.'">'.l10n('Skeleton').'</a>'; |
---|
17 | $page['title'] = l10n('Skeleton'); |
---|
18 | |
---|
19 | $page['body_id'] = 'theSkeletonPage'; |
---|
20 | $page['is_external'] = true; // inform Piwigo that you are on a new page |
---|
21 | } |
---|
22 | } |
---|
23 | |
---|
24 | /** |
---|
25 | * include public page |
---|
26 | */ |
---|
27 | function skeleton_loc_end_page() |
---|
28 | { |
---|
29 | global $page, $template; |
---|
30 | |
---|
31 | if (isset($page['section']) and $page['section']=='skeleton') |
---|
32 | { |
---|
33 | include(SKELETON_PATH . 'include/skeleton_page.inc.php'); |
---|
34 | } |
---|
35 | } |
---|
36 | |
---|
37 | /* |
---|
38 | * button on album and photos pages |
---|
39 | */ |
---|
40 | function skeleton_add_button() |
---|
41 | { |
---|
42 | global $template; |
---|
43 | |
---|
44 | $template->assign('SKELETON_PATH', SKELETON_PATH); |
---|
45 | $template->set_filename('skeleton_button', realpath(SKELETON_PATH.'template/my_button.tpl')); |
---|
46 | $button = $template->parse('skeleton_button', true); |
---|
47 | |
---|
48 | if (script_basename()=='index') |
---|
49 | { |
---|
50 | $template->add_index_button($button, BUTTONS_RANK_NEUTRAL); |
---|
51 | } |
---|
52 | else |
---|
53 | { |
---|
54 | $template->add_picture_button($button, BUTTONS_RANK_NEUTRAL); |
---|
55 | } |
---|
56 | } |
---|
57 | |
---|
58 | /** |
---|
59 | * add a prefilter on photo page |
---|
60 | */ |
---|
61 | function skeleton_loc_end_picture() |
---|
62 | { |
---|
63 | global $template; |
---|
64 | |
---|
65 | $template->set_prefilter('picture', 'skeleton_picture_prefilter'); |
---|
66 | } |
---|
67 | |
---|
68 | function skeleton_picture_prefilter($content) |
---|
69 | { |
---|
70 | $search = '{if $display_info.author and isset($INFO_AUTHOR)}'; |
---|
71 | $replace = ' |
---|
72 | <div id="Skeleton" class="imageInfo"> |
---|
73 | <dt>{\'Skeleton\'|@translate}</dt> |
---|
74 | <dd style="color:orange;">{\'Piwigo rocks\'|@translate}</dd> |
---|
75 | </div> |
---|
76 | '; |
---|
77 | |
---|
78 | return str_replace($search, $replace.$search, $content); |
---|
79 | } |
---|