> ------------------------------------------------------------------------------ See main.inc.php for release information HGram_PIP : classe to manage plugin public pages --------------------------------------------------------------------------- */ include_once('hgram_root.class.inc.php'); class HGram_PIP extends HGram_root { protected $section_page; public function __construct($prefixeTable, $filelocation) { parent::__construct($prefixeTable, $filelocation); $this->loadConfig(); $this->initEvents(); $this->load_lang(); } public function __destruct() { unset($section_page); parent::__destruct(); } /** * load language file */ public function load_lang() { global $lang; load_language('plugin.lang', HGRAM_PATH); } /** * initialize events call for the plugin */ public function initEvents() { parent::initEvents(); add_event_handler('loc_begin_picture', array(&$this, 'addHistogram')); } /* ------------------------------------------------------------------------- FUNCTIONS TO MANAGE HISTOGRAM DISPLAY ------------------------------------------------------------------------- */ public function addHistogram() { global $page, $template; $fileName=self::getHistogramGraph($page['image_id']); $metadata=$template->get_template_vars('metadata'); $template->set_filename('hgramHisto', dirname($this->getFileLocation()).'/templates/hgram_picture_histo.tpl'); $template->assign('histoImg', $fileName); $template->assign('imageId', $page['image_id']); $template->assign('token', self::getToken($page['image_id'])); $histoNfo=Array( 'TITLE' => l10n('hgram_histogram'), 'lines' => Array( '' => $template->parse('hgramHisto', true) ) ); $metadata[]=$histoNfo; $template->assign('metadata', $metadata); } } //class ?>