if (isset($page->js) && trim($page->js) !== "") { echo O_BEGIN . $page->js . O_END; } }); Shield::attach('page-' . $slug); }, 100); /** * Home Page * --------- * * [1]. / * */ Route::accept('/', function () use($config, $excludes) { Session::kill('search.query'); Session::kill('search.results'); $s = Get::articles(); if ($articles = Mecha::eat($s)->chunk(1, $config->index->per_page)->vomit()) { $articles = Mecha::walk($articles, function ($path) use($excludes) { return Get::article($path, $excludes); }); } else { $articles = false; } Filter::add('pager:url', function ($url) { return Filter::apply('index:url', $url); }); Config::set(array('articles' => $articles, 'pagination' => Navigator::extract($s, 1, $config->index->per_page, $config->index->slug))); Shield::attach('page-home'); }, 110); /**
}, 20); Weapon::add('shell_after', function () use($config) { if (!Asset::loaded($config->protocol . ICON_LIBRARY_PATH)) { echo Asset::stylesheet($config->protocol . ICON_LIBRARY_PATH); } $path = __DIR__ . DS . 'assets' . DS . 'shell' . DS; echo Asset::stylesheet(array($path . 'row.css', $path . 'upload.css', $path . 'tab.css', $path . 'toggle.css', $path . 'modal.css', $path . 'tooltip.css', $path . 'sortable.css', $path . 'accordion.css', $path . 'layout.css', SHIELD . DS . $config->shield . DS . 'assets' . DS . 'shell' . DS . 'manager.css'), "", 'shell/manager.min.css'); }, 10); Weapon::add('cargo_after', function () use($config, $speak) { if (Config::get('widget_manager_bar_id', 0) <= 1) { echo Widget::manager('BAR'); // include once ... } }, 20); Weapon::add('SHIPMENT_REGION_BOTTOM', function () use($config) { Session::kill('recent_item_update'); $path = __DIR__ . DS . 'assets' . DS . 'sword' . DS; echo Asset::javascript(array($path . 'ajax.js', $path . 'row.js', $path . 'slug.js', $path . 'upload.js', $path . 'tab.js', $path . 'toggle.js', $path . 'modal.js', $path . 'tooltip.js', $path . 'sortable.js', $path . 'accordion.js', SHIELD . DS . $config->shield . DS . 'assets' . DS . 'sword' . DS . 'manager.js'), "", 'sword/manager.min.js'); }, 1); /** * Footer Link(s) * -------------- */ if ($config->page_type === 'manager' || $config->is->post) { // Add default comment footer link(s) Weapon::add('comment_footer', function ($comment, $article) use($config, $speak) { $status = Mecha::alter(File::E($comment->path), array('hold' => Jot::span('info', Jot::icon('clock-o') . ' ' . $speak->pending) . ' · '), ""); echo $status . Cell::a($config->manager->slug . '/comment/repair/id:' . $comment->id, $speak->edit) . ' / ' . Cell::a($config->manager->slug . '/comment/kill/id:' . $comment->id, $speak->delete); }, 20); } /**
public static function clear($clear_errors = true) { Session::kill(self::$message); self::$errors = $clear_errors ? 0 : self::$errors; }
/** * ============================================================ * LOGGING OUT ... * ============================================================ * * -- CODE: --------------------------------------------------- * * if($user_is_invalid) { * Guardian::reject()->kick('manager/login'); * } * * ------------------------------------------------------------ * */ public static function reject() { self::deleteToken(); Session::kill('cookie:' . self::$user); return new static(); }
foreach ($constant['user'] as $k => $v) { $constant_js .= $k . '=' . json_encode($v) . ','; } unset($constant); $cargo = array('segment' => $uri_end, 'languages' => Config::get('DASHBOARD.languages', array()), 'is_html_parser_enabled' => Config::get('html_parser') === HTML_PARSER, 'html_parser' => HTML_PARSER, 'tab_size' => TAB, 'element_suffix' => ES, 'file_extension_allow' => implode(',', File::$config['file_extension_allow']), 'url' => array('protocol' => $config->protocol, 'base' => $config->base, 'host' => $config->host, 'url' => $config->url, 'path' => $config->url_path, 'current' => $config->url_current, 'query' => $config->url_query)); $output = O_BEGIN . '<script>var ' . rtrim($constant_js, ',') . ';'; foreach ($cargo as $k => $v) { $output .= 'DASHBOARD.' . $k . '=' . json_encode($v) . ';'; } $output .= 'DASHBOARD.url.hash=window.location.hash;'; echo $output . '</script>' . O_END; }, 1); Weapon::add('SHIPMENT_REGION_BOTTOM', function () { $MTE = Mecha::alter(Config::get('html_parser'), array(HTML_PARSER => 'mte', 'HTML' => 'hte'), 'hte'); // default is `hte` Session::kill('recent_file_update'); echo Asset::javascript('manager/assets/sword/editor/editor.min.js'); echo Asset::javascript('manager/assets/sword/editor/' . $MTE . '.min.js'); echo Asset::javascript(array('manager/assets/sword/editor/run.js', 'manager/assets/sword/ajax.js', 'manager/assets/sword/row.js', 'manager/assets/sword/slug.js', 'manager/assets/sword/check.js', 'manager/assets/sword/upload.js', 'manager/assets/sword/tab.js', 'manager/assets/sword/modal.js', 'manager/assets/sword/tooltip.js', 'manager/assets/sword/sortable.js', 'manager/assets/sword/accordion.js'), "", 'sword/manager.min.js'); }, 10); /** * Cache Killer * ------------ * * Add global cache killer for article(s) and page(s). * */ function do_remove_cache() { global $config; File::open(CACHE . DS . 'sitemap.cache')->delete();
public static function clear() { Session::kill(self::$message); }
function logout() { if (!$this->session->islogged()) { $this->error("Page innacessible."); } Session::kill(); $this->myrender(array('menu' => 'menu', 'title' => 'Déconnexion', 'view' => 'logout')); }