本文整理汇总了PHP中block_manager::activate_blocks方法的典型用法代码示例。如果您正苦于以下问题:PHP block_manager::activate_blocks方法的具体用法?PHP block_manager::activate_blocks怎么用?PHP block_manager::activate_blocks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类block_manager
的用法示例。
在下文中一共展示了block_manager::activate_blocks方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: activate
/**
* Activate an installed module. This will call <module>_installer::activate() which should take
* any steps to make sure that the module is ready for use. This will also activate any
* existing graphics rules for this module.
* @param string $module_name
*/
static function activate($module_name)
{
module::_add_to_path($module_name);
$installer_class = "{$module_name}_installer";
if (class_exists($installer_class) && method_exists($installer_class, "activate")) {
call_user_func_array(array($installer_class, "activate"), array());
}
$module = module::get($module_name);
if ($module->loaded()) {
$module->active = true;
$module->save();
}
module::load_modules();
graphics::activate_rules($module_name);
block_manager::activate_blocks($module_name);
log::success("module", t("Activated module %module_name", array("module_name" => $module_name)));
}
示例2: activate
/**
* Activate an installed module. This will call <module>_installer::activate() which should take
* any steps to make sure that the module is ready for use. This will also activate any
* existing graphics rules for this module.
* @param string $module_name
*/
static function activate($module_name)
{
$kohana_modules = Kohana::config("core.modules");
array_unshift($kohana_modules, MODPATH . $module_name);
Kohana::config_set("core.modules", $kohana_modules);
$installer_class = "{$module_name}_installer";
if (method_exists($installer_class, "activate")) {
call_user_func_array(array($installer_class, "activate"), array());
}
$module = self::get($module_name);
if ($module->loaded) {
$module->active = true;
$module->save();
}
module::load_modules();
graphics::activate_rules($module_name);
block_manager::activate_blocks($module_name);
log::success("module", t("Activated module %module_name", array("module_name" => $module_name)));
}