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

Last change on this file since 6299 was 5405, checked in by nikrou, 14 years ago

Change farbtastic by color picker to choose animation's colors
Make plugin compatible with piwigo 2.1

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 as published by  |
9// | 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
19// | USA.                                                                  |
20// +-----------------------------------------------------------------------+
21
22class pwgCumulusContent
23{
24  public function __construct($config) {
25    $this->plugin_config = $config;
26
27  }
28
29  public function loc_begin_page_header() {
30    if (!empty($_GET['display_mode']) && $_GET['display_mode']=='cumulus') {
31      $GLOBALS['template']->assign('display_mode', 'cumulus');
32    }
33
34    $GLOBALS['template']->set_filenames(array('tags'=> PWG_CUMULUS_PLUGIN_TEMPLATE . '/tags.tpl'));
35    $GLOBALS['template']->func_known_script(array('id' => 'swfobject',
36                                                  'src' => PWG_CUMULUS_PLUGIN_JS. '/swfobject.js'
37                                                  ),
38                                            $GLOBALS['template']->smarty
39                                            );
40   
41    $GLOBALS['template']->assign('PWG_CUMULUS_SWF', PWG_CUMULUS_PLUGIN_SWF);
42    $GLOBALS['template']->assign('PWG_CUMULUS_IMGS', PWG_CUMULUS_PLUGIN_IMGS);
43
44    $GLOBALS['template']->assign('PWG_CUMULUS_WIDTH', $this->plugin_config->pwg_cumulus_width);
45    $GLOBALS['template']->assign('PWG_CUMULUS_HEIGHT', $this->plugin_config->pwg_cumulus_height);
46    $GLOBALS['template']->assign('PWG_CUMULUS_HREF', get_root_url().'tags.php?display_mode=cumulus');
47
48    $GLOBALS['template']->assign('PWG_CUMULUS_COLOR1', '0x'.$this->plugin_config->pwg_cumulus_color1);
49    $GLOBALS['template']->assign('PWG_CUMULUS_COLOR2', '0x'.$this->plugin_config->pwg_cumulus_color2);
50    $GLOBALS['template']->assign('PWG_CUMULUS_HICOLOR', '0x'.$this->plugin_config->pwg_cumulus_hicolor);
51
52    if (!empty($GLOBALS['template']->smarty->_tpl_vars['tags'])) {
53      foreach ($GLOBALS['template']->smarty->_tpl_vars['tags'] as $key => &$tag) {
54        $tag['display_name'] = urlencode($tag['name']);
55        $tag['size'] = $this->plugin_config->pwg_cumulus_coeff*$tag['level'];
56      }
57    }
58  }
59}
60?>
Note: See TracBrowser for help on using the repository browser.