2 if (file_exists($Page->file) and !is_writable($Page->file)) {
6 if (!isset($Page->raw)) {
7 # open bottom template as initial contents
8 $template = 'template.inc.html';
9 if ($Page->handler and file_exists("{$Page->handler}/$template")) {
10 $template = "{$Page->handler}/$template";
12 $Page->raw($template);
13 $Page->meta['article:published_time'] = date('Y-m-d h:i:s O');
14 $Page->meta['article:author'] = '/' . $User->dir;
18 if (isset($Page->raw)) {
19 # restore meta tags in static contents for editing
20 foreach (array_reverse($Page->meta) as $metaprop => $val) {
22 '<meta property="%s" content="%s">'."\n",
29 if ($csssrc = '/admin.css' and file_exists(DOCROOT . $csssrc)) {
30 printf('<link rel="stylesheet" type="text/css" href="%s" />'."\n", $csssrc);
32 $ckesrc = '/lib/ckeditor'; # local install
33 if (!file_exists(DOCROOT . $ckesrc)) {
34 $ckesrc = '//cdn.ckeditor.com/4.15.1/full-all'; # remote fallback
36 printf('<script src="/edit/page.js" data-ckesrc="%s"></script>'."\n", "$ckesrc/ckeditor.js");
37 $Page->head = ob_get_clean();