本文整理汇总了PHP中Vtiger_Module::fireEvent方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Module::fireEvent方法的具体用法?PHP Vtiger_Module::fireEvent怎么用?PHP Vtiger_Module::fireEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Module
的用法示例。
在下文中一共展示了Vtiger_Module::fireEvent方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: import_Module
/**
* Import Module
* @access private
*/
function import_Module()
{
$tabname = $this->_modulexml->name;
$tablabel = $this->_modulexml->label;
$tabversion = $this->_modulexml->version;
$isextension = false;
if (!empty($this->_modulexml->type)) {
$type = strtolower($this->_modulexml->type);
if ($type == 'extension' || $type == 'language') {
$isextension = true;
}
}
$vtigerMinVersion = $this->_modulexml->dependencies->vtiger_version;
$vtigerMaxVersion = $this->_modulexml->dependencies->vtiger_max_version;
$moduleInstance = new Vtiger_Module();
$moduleInstance->name = $tabname;
$moduleInstance->label = $tablabel;
$moduleInstance->isentitytype = $isextension != true;
$moduleInstance->version = !$tabversion ? 0 : $tabversion;
$moduleInstance->minversion = !$vtigerMinVersion ? false : $vtigerMinVersion;
$moduleInstance->maxversion = !$vtigerMaxVersion ? false : $vtigerMaxVersion;
if ($type != 'update') {
$moduleInstance->save();
$moduleInstance->initWebservice();
$this->import_Tables($this->_modulexml);
$this->import_Blocks($this->_modulexml, $moduleInstance);
$this->import_CustomViews($this->_modulexml, $moduleInstance);
$this->import_SharingAccess($this->_modulexml, $moduleInstance);
$this->import_Events($this->_modulexml, $moduleInstance);
$this->import_Actions($this->_modulexml, $moduleInstance);
$this->import_RelatedLists($this->_modulexml, $moduleInstance);
$this->import_CustomLinks($this->_modulexml, $moduleInstance);
$this->import_CronTasks($this->_modulexml);
Vtiger_Module::fireEvent($moduleInstance->name, Vtiger_Module::EVENT_MODULE_POSTINSTALL);
} else {
$this->import_update($this->_modulexml);
}
}
示例2: update_Module
/**
* Update Module
* @access private
*/
function update_Module($moduleInstance)
{
$tabname = $this->_modulexml->name;
$tablabel = $this->_modulexml->label;
$parenttab = $this->_modulexml->parent;
$tabversion = $this->_modulexml->version;
$isextension = false;
if (!empty($this->_modulexml->type)) {
$type = strtolower($this->_modulexml->type);
if ($type == 'extension' || $type == 'language') {
$isextension = true;
}
}
Vtiger_Module::fireEvent($moduleInstance->name, Vtiger_Module::EVENT_MODULE_PREUPDATE);
// TODO Handle module property changes like menu, label etc...
/*if(!empty($parenttab) && $parenttab != '') {
$menuInstance = Vtiger_Menu::getInstance($parenttab);
$menuInstance->addModule($moduleInstance);
}*/
$this->handle_Migration($this->_modulexml, $moduleInstance);
$this->update_Tables($this->_modulexml);
$this->update_Blocks($this->_modulexml, $moduleInstance);
$this->update_CustomViews($this->_modulexml, $moduleInstance);
$this->update_SharingAccess($this->_modulexml, $moduleInstance);
$this->update_Events($this->_modulexml, $moduleInstance);
$this->update_Actions($this->_modulexml, $moduleInstance);
$this->update_RelatedLists($this->_modulexml, $moduleInstance);
$this->update_CustomLinks($this->_modulexml, $moduleInstance);
$this->update_CronTasks($this->_modulexml);
$moduleInstance->__updateVersion($tabversion);
Vtiger_Module::fireEvent($moduleInstance->name, Vtiger_Module::EVENT_MODULE_POSTUPDATE);
}
示例3: __delete
/**
* Delete this instance
* @access private
*/
function __delete()
{
Vtiger_Module::fireEvent($this->name, Vtiger_Module::EVENT_MODULE_PREUNINSTALL);
global $adb;
if ($this->isentitytype) {
$this->unsetEntityIdentifier();
$this->deleteRelatedLists();
}
$adb->pquery("DELETE FROM vtiger_tab WHERE tabid=?", array($this->id));
self::log("Deleting Module {$this->name} ... DONE");
}
示例4: update_Module
/**
* Update Module
* @access private
*/
function update_Module($moduleInstance)
{
$tabname = $this->_modulexml->name;
$tablabel = $this->_modulexml->label;
$tabversion = $this->_modulexml->version;
$isextension = false;
if (!empty($this->_modulexml->type)) {
$type = strtolower($this->_modulexml->type);
if ($type == 'extension' || $type == 'language') {
$isextension = true;
}
}
Vtiger_Module::fireEvent($moduleInstance->name, Vtiger_Module::EVENT_MODULE_PREUPDATE);
$moduleInstance->label = $tablabel;
$moduleInstance->save();
$this->handle_Migration($this->_modulexml, $moduleInstance);
$this->update_Tables($this->_modulexml);
$this->update_Blocks($this->_modulexml, $moduleInstance);
$this->update_CustomViews($this->_modulexml, $moduleInstance);
$this->update_SharingAccess($this->_modulexml, $moduleInstance);
$this->update_Events($this->_modulexml, $moduleInstance);
$this->update_Actions($this->_modulexml, $moduleInstance);
$this->update_RelatedLists($this->_modulexml, $moduleInstance);
$this->update_CustomLinks($this->_modulexml, $moduleInstance);
$this->update_CronTasks($this->_modulexml);
$moduleInstance->__updateVersion($tabversion);
Vtiger_Module::fireEvent($moduleInstance->name, Vtiger_Module::EVENT_MODULE_POSTUPDATE);
}
示例5: vtlib_toggleModuleAccess
/**
* Toggle the module (enable/disable)
*/
function vtlib_toggleModuleAccess($module, $enable_disable)
{
global $adb, $__cache_module_activeinfo;
include_once 'vtlib/Vtiger/Module.php';
$event_type = false;
if ($enable_disable === true) {
$enable_disable = 0;
$event_type = Vtiger_Module::EVENT_MODULE_ENABLED;
} else {
if ($enable_disable === false) {
$enable_disable = 1;
$event_type = Vtiger_Module::EVENT_MODULE_DISABLED;
}
}
$adb->pquery("UPDATE vtiger_tab set presence = ? WHERE name = ?", array($enable_disable, $module));
$__cache_module_activeinfo[$module] = $enable_disable;
create_tab_data_file();
create_parenttab_data_file();
// UserPrivilege file needs to be regenerated if module state is changed from
// vtiger 5.1.0 onwards
global $vtiger_current_version;
if (version_compare($vtiger_current_version, '5.0.4', '>')) {
vtlib_RecreateUserPrivilegeFiles();
}
Vtiger_Module::fireEvent($module, $event_type);
}
示例6: vtlib_toggleModuleAccess
/**
* Toggle the module (enable/disable)
*/
function vtlib_toggleModuleAccess($module, $enable_disable)
{
global $adb, $__cache_module_activeinfo;
include_once 'vtlib/Vtiger/Module.php';
$event_type = false;
if ($enable_disable === true) {
$enable_disable = 0;
$event_type = Vtiger_Module::EVENT_MODULE_ENABLED;
} else {
if ($enable_disable === false) {
$enable_disable = 1;
$event_type = Vtiger_Module::EVENT_MODULE_DISABLED;
}
}
$adb->pquery("UPDATE vtiger_tab set presence = ? WHERE name = ?", array($enable_disable, $module));
$__cache_module_activeinfo[$module] = $enable_disable;
create_tab_data_file();
vtlib_RecreateUserPrivilegeFiles();
Vtiger_Module::fireEvent($module, $event_type);
}
示例7: __delete
/**
* Delete this instance
* @access private
*/
function __delete()
{
Vtiger_Module::fireEvent($this->name, Vtiger_Module::EVENT_MODULE_PREUNINSTALL);
$adb = PearDatabase::getInstance();
if ($this->isentitytype) {
$this->unsetEntityIdentifier();
}
$adb->pquery("DELETE FROM vtiger_tab WHERE tabid=?", array($this->id));
self::log("Deleting Module {$this->name} ... DONE");
}
示例8: import_Module
/**
* Import Module
* @access private
*/
function import_Module()
{
$tabname = $this->_modulexml->name;
$tablabel = $this->_modulexml->label;
$parenttab = (string) $this->_modulexml->parent;
$tabversion = $this->_modulexml->version;
$isextension = false;
if (!empty($this->_modulexml->type)) {
$type = strtolower($this->_modulexml->type);
if ($type == 'extension' || $type == 'language') {
$isextension = true;
}
}
$vtigerMinVersion = $this->_modulexml->dependencies->vtiger_version;
$vtigerMaxVersion = $this->_modulexml->dependencies->vtiger_max_version;
$moduleInstance = new Vtiger_Module();
$moduleInstance->name = $tabname;
$moduleInstance->label = $tablabel;
if ($menuInstance = Vtiger_Menu::getInstance($parenttab)) {
$moduleInstance->parent = $parenttab;
} else {
$moduleInstance->parent = "Tools";
}
$moduleInstance->isentitytype = $isextension != true;
$moduleInstance->version = !$tabversion ? 0 : $tabversion;
$moduleInstance->minversion = !$vtigerMinVersion ? false : $vtigerMinVersion;
$moduleInstance->maxversion = !$vtigerMaxVersion ? false : $vtigerMaxVersion;
$moduleInstance->save();
if (!empty($parenttab)) {
$menuInstance = Vtiger_Menu::getInstance($parenttab);
if ($menuInstance == NULL) {
$menuInstance = Vtiger_Menu::getInstance("Tools");
self::log("Module attached to Tools because {$parenttab} does not exist");
}
$menuInstance->addModule($moduleInstance);
}
$this->import_Tables($this->_modulexml);
$this->import_Blocks($this->_modulexml, $moduleInstance);
$this->import_CustomViews($this->_modulexml, $moduleInstance);
$this->import_SharingAccess($this->_modulexml, $moduleInstance);
$this->import_Events($this->_modulexml, $moduleInstance);
$this->import_Actions($this->_modulexml, $moduleInstance);
$this->import_RelatedLists($this->_modulexml, $moduleInstance);
$this->import_CustomLinks($this->_modulexml, $moduleInstance);
$this->import_CronTasks($this->_modulexml);
$moduleInstance->initWebservice();
Vtiger_Module::fireEvent($moduleInstance->name, Vtiger_Module::EVENT_MODULE_POSTINSTALL);
}
示例9: __delete
/**
* Delete this instance
* @access private
*/
function __delete()
{
Vtiger_Module::fireEvent($this->name, Vtiger_Module::EVENT_MODULE_PREUNINSTALL);
global $adb;
if ($this->isentitytype) {
$this->unsetEntityIdentifier();
$this->deleteRelatedLists();
}
$adb->pquery("DELETE FROM vtiger_tab WHERE tabid=?", array($this->id));
// SalesPlatform.ru begin Disable history for deleted module
$adb->pquery("DELETE FROM vtiger_modtracker_tabs WHERE tabid=?", array($this->id));
// SalesPlatform.ru end
self::log("Deleting Module {$this->name} ... DONE");
}
示例10: import_Module
/**
* Import Module
* @access private
*/
function import_Module()
{
$tabname = $this->_modulexml->name;
$tablabel = $this->_modulexml->label;
$parenttab = (string) $this->_modulexml->parent;
$tabversion = $this->_modulexml->version;
$isextension = false;
if (!empty($this->_modulexml->type)) {
$type = strtolower($this->_modulexml->type);
if ($type == 'extension' || $type == 'language') {
$isextension = true;
}
}
$moduleInstance = new Vtiger_Module();
$moduleInstance->name = $tabname;
$moduleInstance->label = $tablabel;
$moduleInstance->isentitytype = $isextension != true;
$moduleInstance->version = !$tabversion ? 0 : $tabversion;
$moduleInstance->save();
if (!empty($parenttab)) {
$menuInstance = Vtiger_Menu::getInstance($parenttab);
$menuInstance->addModule($moduleInstance);
}
$this->import_Tables($this->_modulexml);
$this->import_Blocks($this->_modulexml, $moduleInstance);
$this->import_CustomViews($this->_modulexml, $moduleInstance);
$this->import_SharingAccess($this->_modulexml, $moduleInstance);
$this->import_Events($this->_modulexml, $moduleInstance);
$this->import_Actions($this->_modulexml, $moduleInstance);
$this->import_RelatedLists($this->_modulexml, $moduleInstance);
$this->import_CustomLinks($this->_modulexml, $moduleInstance);
Vtiger_Module::fireEvent($moduleInstance->name, Vtiger_Module::EVENT_MODULE_POSTINSTALL);
$moduleInstance->initWebservice();
}