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",
28 $ckesrc = '/lib/ckeditor'; # local install
29 if (!file_exists(DOCROOT . $ckesrc)) {
30 $ckesrc = '//cdn.ckeditor.com/4.15.1/full-all'; # remote fallback
33 printf("<script>var ckesrc = '%s'</script>\n", "$ckesrc/ckeditor.js");
34 print '<script src="/edit/page.js"></script>'."\n";
35 $Page->head = ob_get_clean();