本文整理汇总了PHP中plugin::load方法的典型用法代码示例。如果您正苦于以下问题:PHP plugin::load方法的具体用法?PHP plugin::load怎么用?PHP plugin::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plugin
的用法示例。
在下文中一共展示了plugin::load方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load
function load(&$pluginAPI)
{
parent::load($pluginAPI);
$am =& $this->_pluginAPI->getActionManager();
$em =& $this->_pluginAPI->getEventManager();
$am->addAction(new action('adminUserManager', 'GET', array($this, 'onViewUserManager'), array(), array()));
$am->addAction(new action('adminMakeUserAdmin', 'POST', array($this, 'onMakeUserAdmin'), array(new IDInput('userID')), array()));
$am->addAction(new action('adminMakeUserNormal', 'POST', array($this, 'onMakeUserNormal'), array(new IDInput('userID')), array()));
$am->addAction(new action('adminUserDelete', 'GET', array($this, 'onDeleteUser'), array(new IDInput('userID')), array()));
}
示例2: load
function load(&$pluginAPI)
{
include_once $this->getLoadedDir() . '/mailingList.class.php';
include_once $this->getLoadedDir() . '/mailingMember.class.php';
parent::load($pluginAPI);
$executor = array($this, 'onViewManager');
$requiredOptions = array();
$smth = new action('adminMailingListManager', 'GET', $executor, $requiredOptions);
$actionmanager =& $pluginAPI->getActionManager();
$actionmanager->addAction($smth);
}
示例3: load
function load(&$pluginAPI)
{
parent::load($pluginAPI);
$this->_adminPlugin = new viewPageCoreAdminPlugin($this->_loadedDir);
$this->_adminPlugin->load($pluginAPI);
$am =& $this->_pluginAPI->getActionManager();
$am->addAction(new action('viewPage', 'GET', array($this, 'onViewPage'), array(), array(new IDInput('pageID'), new LocaleInput('pageLang'))));
$em =& $this->_pluginAPI->getEventManager();
$em->addEvent(new Event('viewPage', array('pageID', 'pageLang')));
$em->subscribeToEvent('viewPage', new callback('setPageVars', array($this, 'setPageVars'), array('pageID', 'pageLang')));
}
示例4: load
function load(&$pluginAPI)
{
parent::load($pluginAPI);
$am =& $this->_pluginAPI->getActionManager();
$em =& $this->_pluginAPI->getEventManager();
$am->addAction(new action('adminPluginManager', 'GET', array($this, 'onViewPluginManager'), array(), array()));
$am->addAction(new action('adminEnablePlugin', 'GET', array($this, 'onEnablePlugin'), array(new StringInput('pluginID')), array()));
$am->addAction(new action('adminInstallPlugin', 'GET', array($this, 'onInstallPlugin'), array(new StringInput('pluginID')), array()));
$am->addAction(new action('adminDisablePlugin', 'GET', array($this, 'onDisablePlugin'), array(new StringInput('pluginID')), array()));
$am->addAction(new action('adminUnInstallPlugin', 'GET', array($this, 'onUnInstallPlugin'), array(new StringInput('pluginID')), array()));
}
示例5: load
function load(&$pluginAPI)
{
parent::load($pluginAPI);
include $this->getLoadedDir() . '/users.admin.plugin.php';
$this->_adminPlugin = new adminCoreUserAdminPlugin($this->getLoadedDir());
$this->_adminPlugin->load($this->_pluginAPI);
$am =& $this->_pluginAPI->getActionManager();
$am->addAction(new action('userLogin', 'POST', array($this, 'onLogin'), array(new StringInput('login'), new StringInput('password')), array()));
$am->addAction(new action('userLogout', 'POST', array($this, 'onLogout'), array(), array()));
$am->addAction(new action('userRegisterForm', 'POST', array($this, 'onRegisterForm'), array(), array(new LocaleInput('pageLang'))));
$am->addAction(new action('userRegister', 'POST', array($this, 'onRegister'), array(new StringInput('login'), new EmailInput('email'), new PasswordNewInput('password')), array()));
$em =& $this->_pluginAPI->getEventManager();
$em->subscribeToEvent('viewPage', new callback('userVars', array($this, 'setUserVars')));
}
示例6: load
function load(&$pluginAPI)
{
parent::load($pluginAPI);
/*$this->_pluginAPI->getActionManager ()->addAction (
new action ('installerAskLanguage', 'GET',
array (&$this, 'askLanguage'), array (), array ()));*/
$aM =& $this->_pluginAPI->getActionManager();
$aM->addAction(new action('installerShowLicense', 'GET', array(&$this, 'showLicense'), array(), array(new LocaleInput('language'))));
$aM->addAction(new action('installerAgreeLicense', 'GET', array(&$this, 'agreeLicense'), array(new BoolInput('agreed')), array()));
$aM->addAction(new action('installerShowRequirements', 'GET', array(&$this, 'showRequirements'), array(new BoolInput('agreed')), array()));
$aM->addAction(new action('askConfig', 'GET', array(&$this, 'askConfig'), array(new BoolInput('canRun')), array()));
$aM->addAction(new action('installerInstall', 'POST', array(&$this, 'installConfigAndDatabase'), array(new StringInput('siteName'), new StringInput('databaseModule'), new StringInput('databaseHost'), new StringInput('databaseUser'), new StringInput('databasePassword'), new StringInput('databaseName'), new StringInput('databasePrefix'), new StringInput('adminLogin'), new PasswordNewInput('adminPassword'), new EmailInput('adminMail')), array()));
//echo $this->_pluginAPI->_actionManager;
}
示例7: load
function load(&$pluginAPI)
{
parent::load($pluginAPI);
include_once $this->_loadedDir . '/adminpluginplugin.class.php';
$this->_pluginAdmin = new adminCorePluginAdminPlugin($this->_loadedDir);
$this->_pluginAdmin->load($pluginAPI);
$am =& $this->_pluginAPI->getActionManager();
$em =& $this->_pluginAPI->getEventManager();
$am->addAction(new action('admin', 'GET', array(&$this, 'onViewAdmin'), array(), array(new IDInput('pageID'), new LocaleInput('pageLang'))));
$am->addAction(new action('adminLogin', 'POST', array(&$this, 'onLogin'), array(new StringInput('adminLogin'), new StringInput('adminPassword')), array()));
$am->addAction(new action('adminLogout', 'GET', array(&$this, 'onLogout'), array(), array()));
$em->addEvent(new event('viewAnyAdminPage', array('pageID')));
$em->subscribeToEvent('viewAnyAdminPage', new callback('setAdminVars', array(&$this, 'setAdminVars'), array('pageID')));
}
示例8: load
function load(&$pluginAPI)
{
parent::load($pluginAPI);
$am =& $this->_pluginAPI->getActionManager();
$em =& $this->_pluginAPI->getEventManager();
$am->addAction(new action('adminPageManager', 'GET', array(&$this, 'onViewPageManager'), array(), array(new IDInput('pageID'), new LocaleInput('pageLang'))));
// page edit action
$am->addAction(new action('adminMovePageDown', 'GET', array(&$this, 'onMovePageDown'), new IDInput('pageID'), array()));
$am->addAction(new action('adminMovePageUp', 'GET', array(&$this, 'onMovePageUp'), new IDInput('pageID'), array()));
$am->addAction(new action('adminSavePage', 'POST', array(&$this, 'onSavePage'), array(new IDInput('pageID'), new StringInput('pageTitle'), new StringInput('pageNavTitle'), new StringInput('pageContent')), array()));
$am->addAction(new action('adminNewPage', 'GET', array(&$this, 'onNewPage'), array(new IDInput('parentPageID'), 'pageTitle'), array()));
$am->addAction(new action('adminDeletePage', 'GET', array(&$this, 'onDeletePage'), array(new IDInput('pageID')), array()));
$am->addAction(new action('adminAddPageToMenu', 'GET', array(&$this, 'onDeletePage'), array(new IDInput('pageID')), array()));
$am->addAction(new action('adminRemovePageFromMenu', 'GET', array(&$this, 'onDeletePage'), array(new IDInput('pageID')), array()));
$am->addAction(new action('adminMovePageLevelDown', 'GET', array(&$this, 'onMovePageLevelDown'), array(new IDInput('pageID'), new IDInput('newParentPageID')), array()));
$am->addAction(new action('adminMovePageLevelUp', 'GET', array(&$this, 'onMovePageLevelUp'), array('pageID'), array()));
}
示例9: load
function load(&$pluginAPI)
{
parent::load($pluginAPI);
$t =& $this->_pluginAPI->getI18NManager();
$t->loadTranslation($this->getLoadedDir() . '/i18n');
$this->_calendarM = new calendar($this->_pluginAPI->getDBModule());
$em =& $this->_pluginAPI->getEventManager();
$am =& $this->_pluginAPI->getActionManager();
$em->subscribeToEvent('viewPage', new callback('AddMiniCalendar', array($this, 'addMiniCalendarToSidebar'), array('pageID')));
$am->addAction(new Action('adminCalendarManager', 'GET', array($this, 'onManageCalendar'), array(), array()));
$am->addAction(new Action('adminNewCalendarEvent', 'GET', array($this, 'onNewEvent'), array('title', 'description', 'Start_Date_Year', 'Start_Date_Month', 'Start_Date_Day', 'Start_Time_Hour', 'Start_Time_Minute', 'End_Date_Year', 'End_Date_Month', 'End_Date_Day', 'End_Time_Hour', 'End_Time_Minute', 'groupID'), array()));
$am->addAction(new Action('adminDeleteCalendarEvent', 'GET', array($this, 'onDeleteEvent'), array(new IDInput('eventID')), array()));
$am->addAction(new Action('adminEditCalendarEvent', 'GET', array($this, 'onEditEvent'), array('eventID', 'title', 'description', 'Start_Date_Year', 'Start_Date_Month', 'Start_Date_Day', 'Start_Time_Hour', 'Start_Time_Minute', 'End_Date_Year', 'End_Date_Month', 'End_Date_Day', 'End_Time_Hour', 'End_Time_Minute', 'groupID'), array()));
$am->addAction(new Action('adminEditCalendarEventForm', 'GET', array($this, 'onEditEventForm'), array(), array(new IDInput('eventID'))));
$am->addAction(new Action('adminNewCalendarGroup', 'GET', array($this, 'onNewGroup'), array(new StringInput('groupName'), new StringInput('groupColor')), array()));
$am->addAction(new Action('adminDeleteCalendarGroup', 'GET', array($this, 'onDeleteGroup'), array(new IDInput('groupID')), array()));
$am->addAction(new Action('adminEditCalendarGroupForm', 'GET', array($this, 'onEditGroupForm'), array(new IDInput('groupID')), array()));
$am->addAction(new Action('adminEditCalendarGroup', 'POST', array($this, 'onEditGroup'), array(new IDInput('groupID'), new StringInput('groupName'), new StringInput('groupColor')), array()));
$am->addAction(new Action('calendarMonthView', 'GET', array($this, 'onMonthView'), array(), array(new IntInput('month'), new IntInput('year'), new IDInput('eventID'))));
}
示例10: testPHPlogs
public function testPHPlogs()
{
global $CFG_GLPI, $PLUGIN_HOOKS;
$_SESSION['glpi_use_mode'] = 2;
$_SESSION["glpiID"] = 2;
$_SESSION["glpiactiveentities_string"] = 0;
$PLUGIN_HOOKS = plugin_init_monitoring();
plugin::load("monitoring");
$CFG_GLPI['root_doc'] = "http://127.0.0.1/fusion0.80/";
loadLanguage("en_GB");
$pmComponent = new PluginMonitoringComponent();
$pmComponentscatalog = new PluginMonitoringComponentscatalog();
$pmComponentscatalog_Component = new PluginMonitoringComponentscatalog_Component();
$pmComponentscatalog_rule = new PluginMonitoringComponentscatalog_rule();
$pmComponentscatalog_Host = new PluginMonitoringComponentscatalog_Host();
$pmService = new PluginMonitoringService();
$computer = new Computer();
// Add components
$input = array();
$input['name'] = 'Host alive';
$input['plugin_monitoring_commands_id '] = '21';
$input['plugin_monitoring_checks_id'] = '1';
$input['calendars_id'] = '1';
$components_id = $pmComponent->add($input);
// Add components catalog
$input = array();
$input['name'] = 'linux servers';
$catalogs_id = $pmComponentscatalog->add($input);
$input = array();
$input['plugin_monitoring_componentscalalog_id'] = $catalogs_id;
$input['plugin_monitoring_components_id'] = $components_id;
$pmComponentscatalog_Component->add($input);
// Add Computer
$input = array();
$input['name'] = 'pc1';
$input['entities_id'] = 0;
$pc1 = $computer->add($input);
// Check computer pc1 not added in ressources
$a_hosts = $pmComponentscatalog_Host->find("`plugin_monitoring_componentscalalog_id`='" . $catalogs_id . "'");
$this->assertEquals(count($a_hosts), '0', '[f1] Computer in component cataglog and may not be');
$input = array();
$input['plugin_monitoring_componentscalalog_id'] = $catalogs_id;
$input['name'] = 'all have name';
$input['itemtype'] = 'Computer';
$input['condition'] = '{"field":["1"],"searchtype":["contains"],"contains":["pc"],"itemtype":"Computer","start":"0"}';
$rules_id = $pmComponentscatalog_rule->add($input);
// Check computer pc1 not added in ressources
$a_hosts = $pmComponentscatalog_Host->find("`plugin_monitoring_componentscalalog_id`='" . $catalogs_id . "'");
$this->assertEquals(count($a_hosts), '1', '[f2] Computer may be in component catalog');
// Check service of this computer created
$a_services = $pmService->find();
$this->assertEquals(count($a_services), '1', '[s2] One service may be created');
// Add Computer
$input = array();
$input['name'] = 'pc2';
$input['entities_id'] = 0;
$pc2 = $computer->add($input);
// Check computer pc1 not added in ressources
$a_hosts = $pmComponentscatalog_Host->find("`plugin_monitoring_componentscalalog_id`='" . $catalogs_id . "'");
$this->assertEquals(count($a_hosts), '2', '[f3] 2 computers may be in component catalog');
// Check service of this computer created
$a_services = $pmService->find();
$this->assertEquals(count($a_services), '2', '[s3] 2 services may be created');
// Remove pc2
$computer->delete(array('id' => $pc2), 1);
// Check computer pc1 added in ressources
$a_hosts = $pmComponentscatalog_Host->find("`plugin_monitoring_componentscalalog_id`='" . $catalogs_id . "'");
$this->assertEquals(count($a_hosts), '1', '[f4] Computer may be unique in component catalog');
// Check service of this computer created
$a_services = $pmService->find();
$this->assertEquals(count($a_services), '1', '[s4] One service may be created');
// Modify rule
$input['id'] = $rules_id;
$input['condition'] = '{"field":["1"],"searchtype":["contains"],"contains":["tc"],"itemtype":"Computer","start":"0"}';
$pmComponentscatalog_rule->update($input);
// Check no computer in ressources
$a_hosts = $pmComponentscatalog_Host->find("`plugin_monitoring_componentscalalog_id`='" . $catalogs_id . "'");
$this->assertEquals(count($a_hosts), '0', '[f5] Computer may be deleted on rule update');
// Check service
$a_services = $pmService->find();
$this->assertEquals(count($a_services), '0', '[s5] No service may be created');
// Modify rule
$input['id'] = $rules_id;
$input['condition'] = '{"field":["1"],"searchtype":["contains"],"contains":["pc"],"itemtype":"Computer","start":"0"}';
$pmComponentscatalog_rule->update($input);
// Check computer pc1 added in ressources
$a_hosts = $pmComponentscatalog_Host->find("`plugin_monitoring_componentscalalog_id`='" . $catalogs_id . "'");
$this->assertEquals(count($a_hosts), '1', '[f6] Computer may be unique in component catalog');
// Delete rule
$pmComponentscatalog_rule->delete(array('id' => $rules_id), 1);
// Check not have computer in ressources
$a_hosts = $pmComponentscatalog_Host->find("`plugin_monitoring_componentscalalog_id`='" . $catalogs_id . "'");
$this->assertEquals(count($a_hosts), '0', '[f7] must have no computer in component catalog');
// Check service
$a_services = $pmService->find();
$this->assertEquals(count($a_services), '0', '[s7] No service may be created');
}
示例11: load
function load(&$pluginAPI)
{
parent::load($pluginAPI);
return new Error("I_AM_STUCK");
}
示例12: load
function load($pluginAPI)
{
parent::load($pluginAPI);
global $loadDataTester;
$loadDataTester++;
}
示例13:
function &load($pkg)
{
$pkg =& parent::load($pkg);
$pkg->db =& $this->db;
return $pkg;
}
示例14: load
function load($pluginAPI)
{
parent::load($pluginAPI);
$eventM =& $this->_pluginAPI->getEventManager();
$a = $eventM->subscribeToEvent('viewPage', new Callback('onViewHelloWorld', array($this, 'onViewPage')));
}