git.shiar.nl
/
minimedit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
issue: store main description as comment row
[minimedit.git]
/
edit
/
head.inc.php
diff --git
a/edit/head.inc.php
b/edit/head.inc.php
index 9759ec818a4e8cbac0bd34b21b1004c94bf61b2e..b2b50f3b19a15506432345df0b6a664a8d27fcb7 100644
(file)
--- a/
edit/head.inc.php
+++ b/
edit/head.inc.php
@@
-1,4
+1,8
@@
<?php
<?php
+if (file_exists($Page->file) and !is_writable($Page->file)) {
+ return;
+}
+
if (!isset($Page->raw)) {
# open bottom template as initial contents
$template = 'template.inc.html';
if (!isset($Page->raw)) {
# open bottom template as initial contents
$template = 'template.inc.html';
@@
-11,19
+15,6
@@
if (!isset($Page->raw)) {
$Page->body = NULL;
}
$Page->body = NULL;
}
-$editpage = $Page->link;
-if (is_dir($editpage)) {
- if (file_exists("$editpage/index.html")) {
- $editpage .= '/index.html';
- }
-}
-else {
- $editpage .= '.html';
-}
-if (file_exists($editpage) and !is_writable($editpage)) {
- return;
-}
-
if (isset($Page->raw)) {
# restore meta tags in static contents for editing
foreach (array_reverse($Page->meta) as $metaprop => $val) {
if (isset($Page->raw)) {
# restore meta tags in static contents for editing
foreach (array_reverse($Page->meta) as $metaprop => $val) {
@@
-34,12
+25,14
@@
if (isset($Page->raw)) {
}
}
}
}
+ob_start();
+if ($csssrc = '/admin.css' and file_exists(DOCROOT . $csssrc)) {
+ printf('<link rel="stylesheet" type="text/css" href="%s" />'."\n", $csssrc);
+}
$ckesrc = '/lib/ckeditor'; # local install
if (!file_exists(DOCROOT . $ckesrc)) {
$ckesrc = '//cdn.ckeditor.com/4.15.1/full-all'; # remote fallback
}
$ckesrc = '/lib/ckeditor'; # local install
if (!file_exists(DOCROOT . $ckesrc)) {
$ckesrc = '//cdn.ckeditor.com/4.15.1/full-all'; # remote fallback
}
-ob_start();
-printf("<script>var ckesrc = '%s'</script>\n", "$ckesrc/ckeditor.js");
-print '<script src="/edit/page.js"></script>'."\n";
+printf('<script src="/edit/page.js" data-ckesrc="%s"></script>'."\n", "$ckesrc/ckeditor.js");
$Page->head = ob_get_clean();
$Page->head = ob_get_clean();