예제 #1
0
function uninstall_module($namespace)
{
    $module = get_modules('filter_namespace', $namespace);
    // Disabling Module
    unactive_module($namespace);
    // Removing module actions
    get_db()->where('MOD_NAMESPACE', $module['namespace'])->delete('tendoo_modules_actions');
    // Include uninstall.php for more uninstall task
    include_if_file_exists($module['uri_path'] . 'uninstall.php');
    // Droping module repository
    return get_instance()->tendoo_admin->drop($module['uri_path']);
}
예제 #2
0
 public function unactive($e, $namespace)
 {
     if ($e == 'module') {
         current_user()->cannot('system@manage_modules') ? $this->url->redirect(array('admin', 'index?notice=accessDenied')) : false;
         $module = get_modules('filter_namespace', $namespace);
         if ($module) {
             if (unactive_module($namespace)) {
                 $this->url->redirect(array('admin', 'modules?info=' . strip_tags(sprintf(translate('The module <strong>%s</strong> is now disabled'), $module['name']))));
             }
             $this->url->redirect(array('admin', 'modules?notice=error-occured'));
         }
         $this->url->redirect(array('admin', 'index?notice=unactive-or-unknow-module'));
     }
     $this->url->redirect(array('admin', 'index?notice=error-occured'));
 }