本文整理汇总了PHP中CModule::load方法的典型用法代码示例。如果您正苦于以下问题:PHP CModule::load方法的具体用法?PHP CModule::load怎么用?PHP CModule::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CModule
的用法示例。
在下文中一共展示了CModule::load方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dPgetParam
<?php
/* SYSTEM $Id: domodsql.php,v 1.11 2005/03/23 00:30:24 ajdonnison Exp $ */
##
## Activate or move a module entry
##
$cmd = dPgetParam($_GET, 'cmd', '0');
$mod_id = intval(dPgetParam($_GET, 'mod_id', '0'));
$mod_directory = dPgetParam($_GET, 'mod_directory', '0');
$obj = new CModule();
if ($mod_id) {
$obj->load($mod_id);
} else {
$obj->mod_directory = $mod_directory;
}
$ok = @(include_once "{$dPconfig['root_dir']}/modules/{$obj->mod_directory}/setup.php");
if (!$ok) {
if ($obj->mod_type != 'core') {
$AppUI->setMsg('Module setup file could not be found', UI_MSG_ERROR);
if ($cmd == 'remove') {
$sql = "DELETE FROM modules WHERE mod_id = {$mod_id}";
db_exec($sql);
echo db_error();
$AppUI->setMsg('Module has been removed from the modules list - please check your database for additional tables that may need to be removed', UI_MSG_ERROR);
}
$AppUI->redirect();
}
}
$setupclass = $config['mod_setup_class'];
if (!$setupclass) {
if ($obj->mod_type != 'core') {
示例2: CModule
CAppUI::setMsg("Installation de '%s' à la version %s", UI_MSG_OK, $module->mod_name, $setup->mod_version);
} else {
CAppUI::setMsg("Installation de '{$module->mod_name}' à la version {$module->mod_version} sur {$setup->mod_version}", UI_MSG_WARNING, true);
}
} else {
CAppUI::setMsg("Module '%s' non mis à jour", UI_MSG_WARNING, $module->mod_name);
}
}
// In case the setup has added some user prefs
CAppUI::buildPrefs();
error_reporting($old_er);
CAppUI::redirect();
}
$module = new CModule();
if ($mod_id) {
$module->load($mod_id);
$module->checkModuleFiles();
} else {
$module->mod_version = "all";
$module->mod_name = $mod_name;
}
if (!class_exists($setupclass = "CSetup{$module->mod_name}")) {
if ($module->mod_type != "core" && !$module->_files_missing) {
CAppUI::setMsg("CModule-msg-no-setup", UI_MSG_ERROR);
CAppUI::redirect();
}
}
if ($module->mod_type == "core" && in_array($cmd, array("remove", "install", "toggle"))) {
CAppUI::setMsg("Core modules can't be uninstalled or disactivated", UI_MSG_ERROR);
CAppUI::redirect();
}