> ------------------------------------------------------------------------------ See main.inc.php for release information ASE_PIP : classe to manage plugin public pages --------------------------------------------------------------------------- */ include_once('ase_root.class.inc.php'); include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCPublicIntegration.class.inc.php'); include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCRequestBuilder.class.inc.php'); class ASE_PIP extends ASE_root { const SEARCH_SECTION = 'Search'; protected $sectionPage; protected $css2; public function __construct($prefixeTable, $filelocation) { parent::__construct($prefixeTable, $filelocation); $this->css2 = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles()."2.css"); $this->loadConfig(); $this->load_lang(); if($this->config['ase_publicAccess_active']) { $this->sectionPage=new GPCPublicIntegration(self::SEARCH_SECTION); $this->sectionPage->setCallbackPageFunction(array(&$this, 'managePage')); $this->sectionPage->initEvents(); $this->initEvents(); } } public function __destruct() { unset($section_page); parent::__destruct(); } /* load language file */ public function load_lang() { load_language('plugin.lang', ASE_PATH); load_language('rbuilder.lang', GPC_PATH); } /* initialize events call for the plugin */ public function initEvents() { parent::initEvents(); add_event_handler('blockmanager_apply', array(&$this, 'blockManagerApply'), 40); // call ASE before AMM if($this->sectionPage->pageIsSection()) { GPCRequestBuilder::loadJSandCSS(); add_event_handler('init', array(&$this, 'applyJS')); add_event_handler('loc_begin_page_header', array(&$this->css2, 'applyCSS'), 9); // have to be loaded before other css file (event level from GPCCore=10) add_event_handler('user_init', array(&$this, 'load_lang')); } } /* ------------------------------------------------------------------------- FUNCTIONS TO MANAGE ASE ------------------------------------------------------------------------- */ public function applyJS() { global $template; $theme=$template->get_themeconf('name'); $file='plugins/ASearchEngine/themes/'.$theme.'/ASE'.$theme.'.css'; if(($theme=='Sylvia' or $theme=='clear' or $theme=='dark') and file_exists(GPCCore::getPiwigoSystemPath().'/'.$file)) GPCCore::addHeaderCSS('ASE0', $file); $file='themes/'.$theme.'/css/ASE'.$theme.'.css'; if(file_exists(GPCCore::getPiwigoSystemPath().'/'.$file)) GPCCore::addHeaderCSS('ASE1', $file); $file=PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'local/css/ASE'.$theme.'.css'; if(file_exists(GPCCore::getPiwigoSystemPath().'/'.$file)) GPCCore::addHeaderCSS('ASE2', $file); } public function managePage() { global $page, $conf, $template; /* * make the title bar */ $page['title'].=$conf['level_separator'].l10n('ase_search_with_multiple_criteria'); $template->assign('TITLE', $page['title']); if($template->get_themeconf('parent')=='gally-default') { $template->assign('PLUGIN_INDEX_ACTIONS' , '