$x = intval(($xi - $xr) / 2); $y = intval(($yi + $yr) / 2); imagettftext($image, $size, 0, $x, $y, $color, $font, $text); imagepng($image); imagedestroy($image); exit; }, 90); /** * Static Page * ----------- * * [1]. page-slug * */ Route::accept('(:any)', function ($slug = "") use($config) { if (!($page = Get::page($slug))) { Shield::abort('404-page'); } if ($page->state === 'drafted') { Shield::abort('404-page'); } if (isset($_GET['repair']) && Guardian::happy()) { Guardian::kick($config->manager->slug . '/page/repair/id:' . $page->id); } Filter::add('pager:url', function ($url) { return Filter::apply('page:url', $url); }); Config::set(array('page_title' => $page->title . $config->title_separator . $config->title, 'page' => $page)); Weapon::add('shell_after', function () use($page) { if (isset($page->css) && trim($page->css) !== "") { echo O_BEGIN . $page->css . O_END;
Weapon::fire('on_page_repair', array($G, $P)); Guardian::kick($config->manager->slug . '/page/repair/id:' . Date::format($date, 'U')); } } } Weapon::add('SHIPMENT_REGION_BOTTOM', function () { echo Asset::javascript('manager/assets/sword/editor.compose.js', "", 'sword/editor.compose.min.js'); }, 11); Shield::lot(array('segment' => 'page', 'default' => $page))->attach('manager', false); }); /** * Page Killer * ----------- */ Route::accept($config->manager->slug . '/page/kill/id:(:num)', function ($id = "") use($config, $speak) { if (!($page = Get::page($id, array('comments')))) { Shield::abort(); } if (Guardian::get('status') !== 'pilot' && Guardian::get('author') !== $page->author) { Shield::abort(); } Config::set(array('page_title' => $speak->deleting . ': ' . $page->title . $config->title_separator . $config->manager->title, 'page' => $page, 'cargo' => DECK . DS . 'workers' . DS . 'kill.page.php')); $G = array('data' => Mecha::A($page)); if ($request = Request::post()) { Guardian::checkToken($request['token']); File::open($page->path)->delete(); $task_connect = $page; $P = array('data' => $request); include DECK . DS . 'workers' . DS . 'task.field.3.php'; include DECK . DS . 'workers' . DS . 'task.custom.3.php'; Notify::success(Config::speak('notify_success_deleted', $page->title));