static function update_rules()
 {
     // Make sure our thumb size matches the gallery one
     $thumb_size = module::get_var("gallery", "thumb_size");
     if ($thumb_size != module::get_var("custom_albums", "thumb_size")) {
         // Remove and readd our rule with the latest thumb size
         graphics::remove_rule("custom_albums", "thumb", "custom_albums_graphics::build_thumb");
         graphics::add_rule("custom_albums", "thumb", "custom_albums_graphics::build_thumb", array("width" => $thumb_size, "height" => $thumb_size, "master" => Image::AUTO), 101);
         // Deactivate the gallery thumbnail generation, we'll handle it now
         graphics::deactivate_rules("gallery");
         module::set_var("custom_albums", "thumb_size", $thumb_size);
     }
     // Make sure our resize size matches the gallery one
     $resize_size = module::get_var("gallery", "resize_size");
     if ($resize_size != module::get_var("custom_albums", "resize_size")) {
         // Remove and readd our rule with the latest resize size
         graphics::remove_rule("custom_albums", "resize", "custom_albums_graphics::build_resize");
         graphics::add_rule("custom_albums", "resize", "custom_albums_graphics::build_resize", array("width" => $resize_size, "height" => $resize_size, "master" => Image::AUTO), 101);
         // Deactivate the gallery resize, we'll handle it now
         graphics::deactivate_rules("gallery");
         module::set_var("custom_albums", "resize_size", $resize_size);
     }
 }
Example #2
0
 /**
  * Deactivate an installed module.  This will call <module>_installer::deactivate() which should
  * take any cleanup steps to make sure that the module isn't visible in any way.  Note that the
  * module remains available in Kohana's cascading file system until the end of the request!
  * @param string $module_name
  */
 static function deactivate($module_name)
 {
     $installer_class = "{$module_name}_installer";
     if (class_exists($installer_class) && method_exists($installer_class, "deactivate")) {
         call_user_func_array(array($installer_class, "deactivate"), array());
     }
     $module = module::get($module_name);
     if ($module->loaded()) {
         $module->active = false;
         $module->save();
     }
     module::load_modules();
     graphics::deactivate_rules($module_name);
     block_manager::deactivate_blocks($module_name);
     if (module::info($module_name)) {
         log::success("module", t("Deactivated module %module_name", array("module_name" => $module_name)));
     } else {
         log::success("module", t("Deactivated missing module %module_name", array("module_name" => $module_name)));
     }
 }
Example #3
0
 /**
  * Deactivate an installed module.  This will call <module>_installer::deactivate() which should
  * take any cleanup steps to make sure that the module isn't visible in any way.  Note that the
  * module remains available in Kohana's cascading file system until the end of the request!
  * @param string $module_name
  */
 static function deactivate($module_name)
 {
     $installer_class = "{$module_name}_installer";
     if (method_exists($installer_class, "deactivate")) {
         call_user_func_array(array($installer_class, "deactivate"), array());
     }
     $module = self::get($module_name);
     if ($module->loaded) {
         $module->active = false;
         $module->save();
     }
     module::load_modules();
     graphics::deactivate_rules($module_name);
     log::success("module", t("Deactivated module %module_name", array("module_name" => $module_name)));
 }