> ------------------------------------------------------------------------------ See main.inc.php for release information LMT_PIP : classe to manage plugin public pages --------------------------------------------------------------------------- */ include_once('lmt_root.class.inc.php'); //include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCPublicIntegration.class.inc.php'); class LMT_PIP extends LMT_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', LMT_PATH); // ajax is managed here ; this permit to use user&language properties inside // ajax content //$this->return_ajax_content(); } /* initialize events call for the plugin */ public function initEvents() { parent::initEvents(); /* add_event_handler('blockmanager_apply', array(&$this, 'blockmanager_apply') ); add_event_handler('loading_lang', array(&$this, 'load_lang')); */ if($this->config['lmt_licence_activated']=='y') { add_event_handler('loc_end_page_header', array(&$this->css_icn, 'applyCSS')); add_event_handler('loc_end_picture', array(&$this, 'manage_licence_element')); if($this->config['lmt_warning_visible']=='y') { add_event_handler('loc_end_page_tail', array(&$this, 'manage_warning_text')); } } } /* ------------------------------------------------------------------------- FUNCTIONS TO MANAGE LMT DISPLAY ------------------------------------------------------------------------- */ public function manage_licence_element() { global $template, $page, $user; $licence=$this->get_image_licence($page['image_id']); if($licence['licence']=="") { return(""); } if($this->config['lmt_redirect_activated']=='y') { $url=$this->config['lmt_redirect_url-'.strToLower($licence['licence'])][$user['language']]; if($url=='') { $url=$this->config['lmt_redirect_url-'.strToLower($licence['licence'])]['en_UK']; } } else { $url=""; } $style=""; $text=""; $target=($this->config['lmt_redirect_open_target']=="y")?" onclick='window.open(this.href); return false;'":""; switch($this->config['lmt_licence_logo']) { case '80x15': if($url!="") { $text = "
".$licence['aut_text1']." ".$licence['aut_text2']; } else { $text = "
".$licence['aut_text1']." ".$licence['aut_text2']; } break; case '88x31'; $style=" style='text-align:left;'"; if($url!="") { $text = "
".$licence['aut_text1']."
".$licence['aut_text2']."
"; } else { $text = "
".$licence['aut_text1']."
".$licence['aut_text2']."
"; } break; case 'text'; if($url!="") { $text ="
".l10n("lmt_lbl_under-".strToLower($licence['licence']))." ".l10n("lmt_lbl_cc_s-".strToLower($licence['licence']))." ".$licence['aut_text1']." ".$licence['aut_text2']; } else { $text ="
".l10n("lmt_lbl_under-".strToLower($licence['licence']))." ".l10n("lmt_lbl_cc_s-".strToLower($licence['licence']))." ".$licence['aut_text1']." ".$licence['aut_text2']; } break; } $template->concat('COMMENT_IMG', ''.$text.''); } public function manage_warning_text() { global $template, $user; if(isset($this->config['lmt_warning_texts'][$user['language']])) { $text=$this->config['lmt_warning_texts'][$user['language']]; } else { $text=$this->config['lmt_warning_texts']['en_UK']; } $patterns = array('/\[logo=80x15\]/i', '/\[logo=88x31\]/i', '/\[logo=text\]/i'); $replacements = array( "", "", l10n("lmt_lbl_cc_s-".strToLower($this->config['lmt_licence_default'])) ); if($this->config['lmt_redirect_activated']=='y') { $url=$this->config['lmt_redirect_url-'.strToLower($this->config['lmt_licence_default'])][$user['language']]; if($url=='') { $url=$this->config['lmt_redirect_url-'.strToLower($this->config['lmt_licence_default'])]['en_UK']; } if($url!="") { $target=($this->config['lmt_redirect_open_target']=="y")?" onclick='window.open(this.href); return false;'":""; $replacements[0]="".$replacements[0].""; $replacements[1]="".$replacements[1].""; $replacements[2]="".$replacements[2].""; } } $text = preg_replace($patterns, $replacements, $text); $template->append("footer_elements", "".htmlspecialchars_decode($text).""); } /* --------------------------------------------------------------------------- ajax functions --------------------------------------------------------------------------- */ } //class ?>