Ejemplo n.º 1
0
 static function uninstall()
 {
     graphics::remove_rules("watermark");
     module::delete("watermark");
     Database::instance()->query("DROP TABLE `watermarks`");
     dir::unlink(VARPATH . "modules/watermark");
 }
Ejemplo n.º 2
0
 private function _update_graphics_rules()
 {
     graphics::remove_rules("watermark");
     if ($name = module::get_var("watermark", "name")) {
         foreach (array("thumb", "resize") as $target) {
             graphics::add_rule("watermark", $target, "gallery_graphics::composite", array("file" => VARPATH . "modules/watermark/{$name}", "width" => module::get_var("watermark", "width"), "height" => module::get_var("watermark", "height"), "position" => module::get_var("watermark", "position"), "transparency" => 101 - module::get_var("watermark", "transparency")), 1000);
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * Uninstall a deactivated module.  This will call <module>_installer::uninstall() which should
  * take whatever steps necessary to make sure that all traces of a module are gone.
  * @param string $module_name
  */
 static function uninstall($module_name)
 {
     $installer_class = "{$module_name}_installer";
     if (class_exists($installer_class) && method_exists($installer_class, "uninstall")) {
         call_user_func(array($installer_class, "uninstall"));
     }
     graphics::remove_rules($module_name);
     $module = module::get($module_name);
     if ($module->loaded()) {
         $module->delete();
     }
     module::load_modules();
     // We could delete the module vars here too, but it's nice to leave them around
     // in case the module gets reinstalled.
     log::success("module", t("Uninstalled module %module_name", array("module_name" => $module_name)));
 }