>
------------------------------------------------------------------------------
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');
load_language('plugin.lang', LMT_PATH);
class LMT_PIP extends LMT_root
{
protected $section_page;
public function __construct($prefixeTable, $filelocation)
{
parent::__construct($prefixeTable, $filelocation);
$this->loadConfig();
$this->initEvents();
}
public function __destruct()
{
unset($section_page);
parent::__destruct();
}
/**
* initialize events call for the plugin
*/
public function initEvents()
{
parent::initEvents();
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, 'manageLicenceElement'));
if($this->config['lmt_warning_visible']=='y')
{
add_event_handler('loc_end_page_tail', array(&$this, 'manageWarningText'));
}
}
}
/* -------------------------------------------------------------------------
FUNCTIONS TO MANAGE LMT DISPLAY
------------------------------------------------------------------------- */
public function manageLicenceElement()
{
global $template, $page, $user;
$licence=$this->getImageLicence($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="";
}
$alternateText=" alt='".htmlspecialchars(l10n('lmt_lbl_cc_s-'.strtolower($licence['licence'])), ENT_QUOTES)."'
title='".htmlspecialchars(
l10n('lmt_lbl_under-'.strtolower($licence['licence'])).' '.
l10n('lmt_lbl_cc_s-'.strtolower($licence['licence'])).' : '.
l10n('lmt_lbl_cc-'.strtolower($licence['licence'])),ENT_QUOTES
)."' ";
$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']." |
".$licence['aut_text1']." ".$licence['aut_text2']." |