> ------------------------------------------------------------------------------ See main.inc.php for release information ASE_root : common classe for admin and public classes --------------------------------------------------------------------------- */ include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php'); class ASE_root extends CommonPlugin { protected $css; public function __construct($prefixeTable, $filelocation) { $this->setPluginName('Advanced Search Engine'); $this->setPluginNameFiles("ase"); parent::__construct($prefixeTable, $filelocation); $this->section_name=$this->getPluginNameFiles(); $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css"); } public function __destruct() { parent::__destruct(); } public function initEvents() { } /* surchage of CommonPlugin->saveConfig function */ public function saveConfig() { if(parent::saveConfig()) { return(true); } return(false); } /* surchage of CommonPlugin->saveConfig function */ public function loadConfig() { parent::loadConfig(); } /* initialize default values */ public function initConfig() { //global $user; $this->config=array( 'ase_keyword_minLength' => 3, 'ase_publicAccess_active' => false, 'ase_publicAccess_applyLimits' => true, 'ase_publicAccess_limits' => 1000, 'ase_publicAccess_allowedPlugins' => array() ); } /** * */ protected function configForTemplate() { global $template; $template->assign('aseConfig', $this->config); } public function getAdminLink($mode='') { if($mode=='ajax') { return('plugins/'.basename(dirname($this->getFileLocation())).'/ase_ajax.php'); } else { return(parent::getAdminLink()); } } protected function displayResult($action_msg, $result) { global $page; if($result) { array_push($page['infos'], $action_msg); } else { array_push($page['errors'], $action_msg); } } /* --------------------------------------------------------------------------- --------------------------------------------------------------------------- */ } //class class ASE_functions { static private $tables = Array(); static private $config = Array(); /** * initialise the class * * @param String $prefixeTable : the piwigo prefixe used on tables name * @param String $pluginNameFile : the plugin name used for tables name */ static public function init($prefixeTable) { // no tables for this plugin } /** * return all HTML&JS code necessary to display a dialogbox to choose * categories */ static public function dialogBoxASECategory() { global $template; $template->set_filename('ase_category_choose', dirname(__FILE__).'/templates/ase_dialog_category_choose.tpl'); return($template->parse('ase_category_choose', true)); } /** * return all HTML&JS code necessary to display a dialogbox to choose * dates */ static public function dialogBoxASEDate() { global $template; $template->set_filename('ase_date_choose', dirname(__FILE__).'/templates/ase_dialog_date_choose.tpl'); return($template->parse('ase_date_choose', true)); } /** * return all HTML&JS code necessary to display a dialogbox to choose * keywords */ static public function dialogBoxASEKeyword() { global $template; $template->set_filename('ase_keyword_choose', dirname(__FILE__).'/templates/ase_dialog_keyword_choose.tpl'); $config=array(); GPCCore::loadConfig('ase', $config); $template->assign('aseConfig', $config); return($template->parse('ase_keyword_choose', true)); } /** * return all HTML&JS code necessary to display a dialogbox to choose * rate on picture */ static public function dialogBoxASERate() { global $template; $template->set_filename('ase_rate_choose', dirname(__FILE__).'/templates/ase_dialog_rate_choose.tpl'); return($template->parse('ase_rate_choose', true)); } /** * return all HTML&JS code necessary to display a dialogbox to choose * tags on picture */ static public function dialogBoxASETag() { global $template; $template->set_filename('ase_tag_choose', dirname(__FILE__).'/templates/ase_dialog_tag_choose.tpl'); return($template->parse('ase_tag_choose', true)); } } //ASE_functions ?>