コード例 #1
0
ファイル: module.php プロジェクト: ultimateprogramer/cms
 /**
  * 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
  */
 public static function uninstall($module_name)
 {
     //Call DB migrations for this module
     self::migrate($module_name, 'down');
     $installer_class = ucfirst($module_name) . '_Installer';
     if (is_callable(array($installer_class, "uninstall"))) {
         call_user_func(array($installer_class, "uninstall"));
     }
     $module = self::get($module_name);
     if ($module->loaded()) {
         $module->delete();
     }
     self::load_modules(TRUE);
     // remove widgets when the module is uninstalled
     Widgets::uninstall($module_name);
     Log::info('Uninstalled module :module_name', array(':module_name' => $module_name));
 }
コード例 #2
0
 /**
  * The Delete action of the Admin module should be triggered through an HTTP POST request in order to
  * uninstall a widget that was installed in the widget repository.
  *
  * @param string $widget The identifier of the widget that must uninstalled from the widget repository.
  */
 public function delete($widget)
 {
     // Security check.
     if (!Auth::isAuth() && (Auth::isAdmin() || Auth::isGod())) {
         DefaultFC::redirection('users/index?ref=admin');
     }
     // Action
     Widgets::uninstall($widget);
     $_SESSION['isError'] = false;
     $_SESSION['message'] = __("The widget has been deleted successfully.");
     DefaultFC::redirection('admin/index');
 }