source: extensions/pwgCumulus/include/pwgCumulusContent.class.php @ 6433

Last change on this file since 6433 was 6433, checked in by nikrou, 14 years ago
  • restore home link on tags page
  • update Free Software Foundation address
File size: 3.0 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | pwgCumulus  - a plugin for Piwigo                                     |
4// +-----------------------------------------------------------------------+
5// | Copyright(C) 2009-2010 Nicolas Roudaire        http://www.nikrou.net  |
6// +-----------------------------------------------------------------------+
7// | This program is free software; you can redistribute it and/or modify  |
8// | it under the terms of the GNU General Public License version 2 as     |
9// | published by  the Free Software Foundation                            |
10// |                                                                       |
11// | This program is distributed in the hope that it will be useful, but   |
12// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
13// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
14// | General Public License for more details.                              |
15// |                                                                       |
16// | You should have received a copy of the GNU General Public License     |
17// | along with this program; if not, write to the Free Software           |
18// | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,            |
19// | MA 02110-1301 USA                                                     |
20// +-----------------------------------------------------------------------+
21
22class pwgCumulusContent
23{
24  public function __construct($config) {
25    $this->plugin_config = $config;
26  }
27
28  public function loc_begin_page_header() {
29    if (!empty($_GET['display_mode']) && $_GET['display_mode']=='cumulus') {
30      $GLOBALS['template']->assign('display_mode', 'cumulus');
31    }
32
33    $GLOBALS['template']->set_filenames(array('tags'=> PWG_CUMULUS_PLUGIN_TEMPLATE . '/tags.tpl'));
34    $GLOBALS['template']->func_known_script(array('id' => 'swfobject',
35                                                  'src' => PWG_CUMULUS_PLUGIN_JS. '/swfobject.js'
36                                                  ),
37                                            $GLOBALS['template']->smarty
38                                            );
39   
40    $GLOBALS['template']->assign('PWG_CUMULUS_SWF', PWG_CUMULUS_PLUGIN_SWF);
41    $GLOBALS['template']->assign('PWG_CUMULUS_IMGS', PWG_CUMULUS_PLUGIN_IMGS);
42
43    $GLOBALS['template']->assign('PWG_CUMULUS_WIDTH', $this->plugin_config->pwg_cumulus_width);
44    $GLOBALS['template']->assign('PWG_CUMULUS_HEIGHT', $this->plugin_config->pwg_cumulus_height);
45    $GLOBALS['template']->assign('PWG_CUMULUS_HREF', get_root_url().'tags.php?display_mode=cumulus');
46
47    $GLOBALS['template']->assign('PWG_CUMULUS_COLOR1', '0x'.$this->plugin_config->pwg_cumulus_color1);
48    $GLOBALS['template']->assign('PWG_CUMULUS_COLOR2', '0x'.$this->plugin_config->pwg_cumulus_color2);
49    $GLOBALS['template']->assign('PWG_CUMULUS_HICOLOR', '0x'.$this->plugin_config->pwg_cumulus_hicolor);
50
51    if (!empty($GLOBALS['template']->smarty->_tpl_vars['tags'])) {
52      foreach ($GLOBALS['template']->smarty->_tpl_vars['tags'] as $key => &$tag) {
53        $tag['display_name'] = urlencode($tag['name']);
54        $tag['size'] = $this->plugin_config->pwg_cumulus_coeff*$tag['level'];
55      }
56    }
57  }
58}
59?>
Note: See TracBrowser for help on using the repository browser.