Exemplo n.º 1
0
 /**
  * @mcms_message ru.molinos.cms.cron
  */
 public static function taskRun(Context $ctx)
 {
     modman::updateDB();
 }
Exemplo n.º 2
0
 public static function on_reload(Context $ctx)
 {
     modman::updateDB();
     return $ctx->getRedirect();
 }
Exemplo n.º 3
0
 public static function rpc_post_remove(Context $ctx)
 {
     $status = array();
     $remove = (array) $ctx->post('modules');
     // Удаляем отключенные модули.
     foreach (modman::getLocalModules() as $name => $info) {
         if ('required' != @$info['priority'] and in_array($name, $remove)) {
             // Отказываемся удалять локальные модули, которые нельзя вернуть.
             if (!empty($info['url'])) {
                 if (modman::uninstall($name)) {
                     $status[$name] = 'removed';
                 }
             }
         }
     }
     /*
     $ctx->config->modules = $enabled;
     $ctx->config->write();
     */
     $next = new url($ctx->get('destination', 'admin'));
     $next->setarg('status', $status);
     self::rpc_rebuild($ctx);
     // Обновляем базу модулей, чтобы выбросить удалённые локальные.
     modman::updateDB();
     return new Redirect($next->string());
 }