@@ -27,276 +27,276 @@ discard block |
||
27 | 27 | |
28 | 28 | class PageEditPage extends PageType { |
29 | 29 | |
30 | - public function getContent(): string { |
|
31 | - $template = new DwooTemplate("pages/editpage"); |
|
32 | - |
|
33 | - //check, if pageID is set |
|
34 | - if (!isset($_REQUEST['edit']) || empty($_REQUEST['edit'])) { |
|
35 | - //show error |
|
36 | - return $this->showError("No pageID was set!"); |
|
37 | - } |
|
38 | - |
|
39 | - $pageID = (int) $_REQUEST['edit']; |
|
40 | - |
|
41 | - $page = new Page(); |
|
42 | - $page->loadByID($pageID); |
|
43 | - |
|
44 | - //first check permissions |
|
45 | - if (!PermissionChecker::current()->hasRight("can_edit_all_pages") && !(PermissionChecker::current()->hasRight("can_edit_own_pages") && $page->getAuthorID() == User::current()->getID())) { |
|
46 | - //user doesn't have permissions to edit this page |
|
47 | - return $this->showError("You don't have permissions to edit this page!"); |
|
48 | - } |
|
49 | - |
|
50 | - //first, lock page |
|
51 | - Page::lockPage($page->getPageID(), User::current()->getID()); |
|
52 | - |
|
53 | - $success_messages = array(); |
|
54 | - $error_messages = array(); |
|
55 | - |
|
56 | - //save page |
|
57 | - if (isset($_REQUEST['submit'])) { |
|
58 | - if ($_REQUEST['submit'] === "Save") { |
|
59 | - //save page |
|
60 | - $res = $this->save($page); |
|
61 | - |
|
62 | - if ($res === true) { |
|
63 | - $success_messages[] = "Saved page successfully!"; |
|
64 | - } else { |
|
65 | - $error_messages[] = $res; |
|
66 | - } |
|
67 | - } else if ($_REQUEST['submit'] === "SaveUnlock") { |
|
68 | - //save page |
|
69 | - $res = $this->save($page); |
|
70 | - |
|
71 | - if ($res === true) { |
|
72 | - //unlock page |
|
73 | - Page::unlockPage($page->getPageID()); |
|
74 | - |
|
75 | - //redirect to admin/pages |
|
76 | - header("Location: " . DomainUtils::generateURL("admin/pages")); |
|
77 | - |
|
78 | - ob_flush(); |
|
79 | - ob_end_flush(); |
|
80 | - |
|
81 | - exit; |
|
82 | - } else { |
|
83 | - $error_messages[] = $res; |
|
84 | - } |
|
85 | - } else if ($_REQUEST['submit'] === "Publish") { |
|
86 | - //save page |
|
87 | - $res = $this->save($page); |
|
88 | - |
|
89 | - if ($res === true) { |
|
90 | - $success_messages[] = "Saved page successfully!"; |
|
91 | - } else { |
|
92 | - $error_messages[] = $res; |
|
93 | - } |
|
94 | - |
|
95 | - //publish page |
|
96 | - $res = $this->publish($page); |
|
97 | - |
|
98 | - if ($res === true) { |
|
99 | - $success_messages[] = "Page published successfully!"; |
|
100 | - } else { |
|
101 | - $error_messages[] = $res; |
|
102 | - } |
|
103 | - } |
|
104 | - } |
|
105 | - |
|
106 | - $template->assign("action_url", DomainUtils::generateURL($this->getPage()->getAlias(), array("edit" => $pageID))); |
|
107 | - |
|
108 | - $template->assign("page", array( |
|
109 | - 'id' => $page->getPageID(), |
|
110 | - 'alias' => "/" . $page->getAlias(), |
|
111 | - 'title' => $page->getTitle(), |
|
112 | - 'content' => $page->getContent(), |
|
113 | - 'is_published' => $page->isPublished(), |
|
114 | - 'can_publish' => (!$page->isPublished() && (PermissionChecker::current()->hasRight("can_publish_all_pages") || (PermissionChecker::current()->hasRight("can_publish_own_pages") && $page->getAuthorID() == User::current()->getID()))), |
|
115 | - 'can_change_owner' => (PermissionChecker::current()->hasRight("can_change_page_owner") || $page->getAuthorID() == User::current()->getID()), |
|
116 | - 'folder' => $page->getFolder(), |
|
117 | - 'preview_url' => DomainUtils::generateURL($page->getAlias(), array("preview" => "true")), |
|
118 | - 'current_style' => $page->getStyle(), |
|
119 | - 'template' => $page->getCustomTemplate(), |
|
120 | - 'has_custom_template' => $page->hasCustomTemplate(), |
|
121 | - 'parent' => $page->getParentID(), |
|
122 | - 'meta_description' => $page->getMetaDescription(), |
|
123 | - 'meta_keywords' => $page->getMetaKeywords(), |
|
124 | - 'meta_robots' => $page->getMetaRobotsOptions(), |
|
125 | - 'meta_canonicals' => $page->getMetaCanonicals(), |
|
126 | - 'has_canoncials' => !empty($page->getMetaCanonicals()), |
|
127 | - 'sitemap' => $page->isSitemapEnabled(), |
|
128 | - 'sitemap_changefreq' => $page->getSitemapChangeFreq(), |
|
129 | - 'sitemap_priority' => $page->getSitemapPriority(), |
|
130 | - 'og_type' => $page->getOgType() |
|
131 | - )); |
|
132 | - |
|
133 | - //set available styles |
|
134 | - $template->assign("styles", StyleController::listAllStyles()); |
|
135 | - |
|
136 | - //get all pages from database |
|
137 | - $pages = array(); |
|
138 | - $rows = Database::getInstance()->listRows("SELECT `id`, `alias` FROM `{praefix}pages` WHERE `editable` = '1' AND `activated` = '1'; "); |
|
139 | - |
|
140 | - foreach ($rows as $row) { |
|
141 | - $pages[] = array( |
|
142 | - 'id' => $row['id'], |
|
143 | - 'alias' => $row['alias'] |
|
144 | - ); |
|
145 | - } |
|
146 | - |
|
147 | - $template->assign("parent_pages", $pages); |
|
148 | - |
|
149 | - //https://developers.google.com/search/reference/robots_meta_tag?hl=de |
|
150 | - $robots_options = array( |
|
151 | - "all", |
|
152 | - "noindex", |
|
153 | - "nofollow", |
|
154 | - "none", |
|
155 | - "noarchive", |
|
156 | - "nosnippet", |
|
157 | - "noodp", |
|
158 | - "notranslate", |
|
159 | - "noimageindex", |
|
160 | - "unavailable_after: " |
|
161 | - ); |
|
162 | - |
|
163 | - $template->assign("robots_options", $robots_options); |
|
164 | - |
|
165 | - $sitemap_change_frequencies = array( |
|
166 | - "AlWAYS", "HOURLY", "DAILY", "WEEKLY", "MONTHLY", "YEARLY", "NEVER" |
|
167 | - ); |
|
168 | - |
|
169 | - $template->assign("sitemap_change_frequencies", $sitemap_change_frequencies); |
|
170 | - |
|
171 | - //OpenGraph types,https://developers.facebook.com/docs/reference/opengraph/ |
|
172 | - $og_types = array("website", "article", "book", "profile"); |
|
173 | - |
|
174 | - $template->assign("og_types", $og_types); |
|
175 | - |
|
176 | - //add support to show additional code from plugins |
|
177 | - $additional_code_header = ""; |
|
178 | - $additional_code_footer = ""; |
|
179 | - |
|
180 | - Events::throwEvent("page_edit_additional_code_header", array( |
|
181 | - 'page' => &$page, |
|
182 | - 'code' => &$additional_code_header |
|
183 | - )); |
|
184 | - |
|
185 | - $template->assign("additional_code_header", $additional_code_footer); |
|
186 | - |
|
187 | - Events::throwEvent("page_edit_additional_code_footer", array( |
|
188 | - 'page' => &$page, |
|
189 | - 'code' => &$additional_code_footer |
|
190 | - )); |
|
191 | - |
|
192 | - $template->assign("additional_code_footer", $additional_code_footer); |
|
193 | - |
|
194 | - $template->assign("errors", $error_messages); |
|
195 | - $template->assign("success_messages", $success_messages); |
|
196 | - |
|
197 | - return $template->getCode(); |
|
198 | - } |
|
199 | - |
|
200 | - protected function save (Page &$page) { |
|
201 | - //first check permissions |
|
202 | - if (!PermissionChecker::current()->hasRight("can_edit_all_pages") && !(PermissionChecker::current()->hasRight("can_edit_own_pages") && $page->getAuthorID() == User::current()->getID())) { |
|
203 | - //user doesn't have permissions to edit this page |
|
204 | - return "You don't have permissions to edit this page!"; |
|
205 | - } |
|
206 | - |
|
207 | - if (!isset($_POST['title']) || empty($_POST['title'])) { |
|
208 | - return "No title was set"; |
|
209 | - } |
|
210 | - |
|
211 | - //validate title |
|
212 | - $title = htmlentities($_POST['title']); |
|
213 | - |
|
214 | - if (!isset($_POST['html_code']) || empty($_POST['html_code'])) { |
|
215 | - return "No content was set or content is empty!"; |
|
216 | - } |
|
217 | - |
|
218 | - $content = $_POST['html_code']; |
|
219 | - |
|
220 | - //TODO: save page attributes |
|
221 | - if (!isset($_REQUEST['parent']) || empty($_REQUEST['parent'])) { |
|
222 | - return "Parent page wasn't set!"; |
|
223 | - } |
|
224 | - |
|
225 | - $parent = (int) $_REQUEST['parent']; |
|
30 | + public function getContent(): string { |
|
31 | + $template = new DwooTemplate("pages/editpage"); |
|
32 | + |
|
33 | + //check, if pageID is set |
|
34 | + if (!isset($_REQUEST['edit']) || empty($_REQUEST['edit'])) { |
|
35 | + //show error |
|
36 | + return $this->showError("No pageID was set!"); |
|
37 | + } |
|
38 | + |
|
39 | + $pageID = (int) $_REQUEST['edit']; |
|
40 | + |
|
41 | + $page = new Page(); |
|
42 | + $page->loadByID($pageID); |
|
43 | + |
|
44 | + //first check permissions |
|
45 | + if (!PermissionChecker::current()->hasRight("can_edit_all_pages") && !(PermissionChecker::current()->hasRight("can_edit_own_pages") && $page->getAuthorID() == User::current()->getID())) { |
|
46 | + //user doesn't have permissions to edit this page |
|
47 | + return $this->showError("You don't have permissions to edit this page!"); |
|
48 | + } |
|
49 | + |
|
50 | + //first, lock page |
|
51 | + Page::lockPage($page->getPageID(), User::current()->getID()); |
|
52 | + |
|
53 | + $success_messages = array(); |
|
54 | + $error_messages = array(); |
|
55 | + |
|
56 | + //save page |
|
57 | + if (isset($_REQUEST['submit'])) { |
|
58 | + if ($_REQUEST['submit'] === "Save") { |
|
59 | + //save page |
|
60 | + $res = $this->save($page); |
|
61 | + |
|
62 | + if ($res === true) { |
|
63 | + $success_messages[] = "Saved page successfully!"; |
|
64 | + } else { |
|
65 | + $error_messages[] = $res; |
|
66 | + } |
|
67 | + } else if ($_REQUEST['submit'] === "SaveUnlock") { |
|
68 | + //save page |
|
69 | + $res = $this->save($page); |
|
70 | + |
|
71 | + if ($res === true) { |
|
72 | + //unlock page |
|
73 | + Page::unlockPage($page->getPageID()); |
|
74 | + |
|
75 | + //redirect to admin/pages |
|
76 | + header("Location: " . DomainUtils::generateURL("admin/pages")); |
|
77 | + |
|
78 | + ob_flush(); |
|
79 | + ob_end_flush(); |
|
80 | + |
|
81 | + exit; |
|
82 | + } else { |
|
83 | + $error_messages[] = $res; |
|
84 | + } |
|
85 | + } else if ($_REQUEST['submit'] === "Publish") { |
|
86 | + //save page |
|
87 | + $res = $this->save($page); |
|
88 | + |
|
89 | + if ($res === true) { |
|
90 | + $success_messages[] = "Saved page successfully!"; |
|
91 | + } else { |
|
92 | + $error_messages[] = $res; |
|
93 | + } |
|
94 | + |
|
95 | + //publish page |
|
96 | + $res = $this->publish($page); |
|
97 | + |
|
98 | + if ($res === true) { |
|
99 | + $success_messages[] = "Page published successfully!"; |
|
100 | + } else { |
|
101 | + $error_messages[] = $res; |
|
102 | + } |
|
103 | + } |
|
104 | + } |
|
105 | + |
|
106 | + $template->assign("action_url", DomainUtils::generateURL($this->getPage()->getAlias(), array("edit" => $pageID))); |
|
107 | + |
|
108 | + $template->assign("page", array( |
|
109 | + 'id' => $page->getPageID(), |
|
110 | + 'alias' => "/" . $page->getAlias(), |
|
111 | + 'title' => $page->getTitle(), |
|
112 | + 'content' => $page->getContent(), |
|
113 | + 'is_published' => $page->isPublished(), |
|
114 | + 'can_publish' => (!$page->isPublished() && (PermissionChecker::current()->hasRight("can_publish_all_pages") || (PermissionChecker::current()->hasRight("can_publish_own_pages") && $page->getAuthorID() == User::current()->getID()))), |
|
115 | + 'can_change_owner' => (PermissionChecker::current()->hasRight("can_change_page_owner") || $page->getAuthorID() == User::current()->getID()), |
|
116 | + 'folder' => $page->getFolder(), |
|
117 | + 'preview_url' => DomainUtils::generateURL($page->getAlias(), array("preview" => "true")), |
|
118 | + 'current_style' => $page->getStyle(), |
|
119 | + 'template' => $page->getCustomTemplate(), |
|
120 | + 'has_custom_template' => $page->hasCustomTemplate(), |
|
121 | + 'parent' => $page->getParentID(), |
|
122 | + 'meta_description' => $page->getMetaDescription(), |
|
123 | + 'meta_keywords' => $page->getMetaKeywords(), |
|
124 | + 'meta_robots' => $page->getMetaRobotsOptions(), |
|
125 | + 'meta_canonicals' => $page->getMetaCanonicals(), |
|
126 | + 'has_canoncials' => !empty($page->getMetaCanonicals()), |
|
127 | + 'sitemap' => $page->isSitemapEnabled(), |
|
128 | + 'sitemap_changefreq' => $page->getSitemapChangeFreq(), |
|
129 | + 'sitemap_priority' => $page->getSitemapPriority(), |
|
130 | + 'og_type' => $page->getOgType() |
|
131 | + )); |
|
132 | + |
|
133 | + //set available styles |
|
134 | + $template->assign("styles", StyleController::listAllStyles()); |
|
135 | + |
|
136 | + //get all pages from database |
|
137 | + $pages = array(); |
|
138 | + $rows = Database::getInstance()->listRows("SELECT `id`, `alias` FROM `{praefix}pages` WHERE `editable` = '1' AND `activated` = '1'; "); |
|
139 | + |
|
140 | + foreach ($rows as $row) { |
|
141 | + $pages[] = array( |
|
142 | + 'id' => $row['id'], |
|
143 | + 'alias' => $row['alias'] |
|
144 | + ); |
|
145 | + } |
|
146 | + |
|
147 | + $template->assign("parent_pages", $pages); |
|
148 | + |
|
149 | + //https://developers.google.com/search/reference/robots_meta_tag?hl=de |
|
150 | + $robots_options = array( |
|
151 | + "all", |
|
152 | + "noindex", |
|
153 | + "nofollow", |
|
154 | + "none", |
|
155 | + "noarchive", |
|
156 | + "nosnippet", |
|
157 | + "noodp", |
|
158 | + "notranslate", |
|
159 | + "noimageindex", |
|
160 | + "unavailable_after: " |
|
161 | + ); |
|
162 | + |
|
163 | + $template->assign("robots_options", $robots_options); |
|
164 | + |
|
165 | + $sitemap_change_frequencies = array( |
|
166 | + "AlWAYS", "HOURLY", "DAILY", "WEEKLY", "MONTHLY", "YEARLY", "NEVER" |
|
167 | + ); |
|
168 | + |
|
169 | + $template->assign("sitemap_change_frequencies", $sitemap_change_frequencies); |
|
170 | + |
|
171 | + //OpenGraph types,https://developers.facebook.com/docs/reference/opengraph/ |
|
172 | + $og_types = array("website", "article", "book", "profile"); |
|
173 | + |
|
174 | + $template->assign("og_types", $og_types); |
|
175 | + |
|
176 | + //add support to show additional code from plugins |
|
177 | + $additional_code_header = ""; |
|
178 | + $additional_code_footer = ""; |
|
179 | + |
|
180 | + Events::throwEvent("page_edit_additional_code_header", array( |
|
181 | + 'page' => &$page, |
|
182 | + 'code' => &$additional_code_header |
|
183 | + )); |
|
184 | + |
|
185 | + $template->assign("additional_code_header", $additional_code_footer); |
|
186 | + |
|
187 | + Events::throwEvent("page_edit_additional_code_footer", array( |
|
188 | + 'page' => &$page, |
|
189 | + 'code' => &$additional_code_footer |
|
190 | + )); |
|
191 | + |
|
192 | + $template->assign("additional_code_footer", $additional_code_footer); |
|
193 | + |
|
194 | + $template->assign("errors", $error_messages); |
|
195 | + $template->assign("success_messages", $success_messages); |
|
196 | + |
|
197 | + return $template->getCode(); |
|
198 | + } |
|
199 | + |
|
200 | + protected function save (Page &$page) { |
|
201 | + //first check permissions |
|
202 | + if (!PermissionChecker::current()->hasRight("can_edit_all_pages") && !(PermissionChecker::current()->hasRight("can_edit_own_pages") && $page->getAuthorID() == User::current()->getID())) { |
|
203 | + //user doesn't have permissions to edit this page |
|
204 | + return "You don't have permissions to edit this page!"; |
|
205 | + } |
|
206 | + |
|
207 | + if (!isset($_POST['title']) || empty($_POST['title'])) { |
|
208 | + return "No title was set"; |
|
209 | + } |
|
210 | + |
|
211 | + //validate title |
|
212 | + $title = htmlentities($_POST['title']); |
|
213 | + |
|
214 | + if (!isset($_POST['html_code']) || empty($_POST['html_code'])) { |
|
215 | + return "No content was set or content is empty!"; |
|
216 | + } |
|
217 | + |
|
218 | + $content = $_POST['html_code']; |
|
219 | + |
|
220 | + //TODO: save page attributes |
|
221 | + if (!isset($_REQUEST['parent']) || empty($_REQUEST['parent'])) { |
|
222 | + return "Parent page wasn't set!"; |
|
223 | + } |
|
224 | + |
|
225 | + $parent = (int) $_REQUEST['parent']; |
|
226 | 226 | |
227 | - if (!isset($_REQUEST['design']) || empty($_REQUEST['design'])) { |
|
228 | - return "Design wasn't set!"; |
|
229 | - } |
|
227 | + if (!isset($_REQUEST['design']) || empty($_REQUEST['design'])) { |
|
228 | + return "Design wasn't set!"; |
|
229 | + } |
|
230 | 230 | |
231 | - $design = $_REQUEST['design']; |
|
231 | + $design = $_REQUEST['design']; |
|
232 | 232 | |
233 | - //TODO: check, if style (design) exists |
|
233 | + //TODO: check, if style (design) exists |
|
234 | 234 | |
235 | - $template = "none"; |
|
235 | + $template = "none"; |
|
236 | 236 | |
237 | - if (isset($_REQUEST['has_custom_template']) && isset($_REQUEST['template']) && !empty($_REQUEST['template'])) { |
|
238 | - $template = $_REQUEST['template']; |
|
239 | - } |
|
237 | + if (isset($_REQUEST['has_custom_template']) && isset($_REQUEST['template']) && !empty($_REQUEST['template'])) { |
|
238 | + $template = $_REQUEST['template']; |
|
239 | + } |
|
240 | 240 | |
241 | - //update page in database |
|
242 | - Database::getInstance()->execute("UPDATE `{praefix}pages` SET `title` = :title, `content` = :content, `parent` = :parent, `design` = :design, `template` = :template WHERE `id` = :pageID; ", array( |
|
243 | - 'title' => $title, |
|
244 | - 'content' => $content, |
|
245 | - 'pageID' => $page->getPageID(), |
|
246 | - 'parent' => $parent, |
|
247 | - 'design' => $design, |
|
248 | - 'template' => $template |
|
249 | - )); |
|
241 | + //update page in database |
|
242 | + Database::getInstance()->execute("UPDATE `{praefix}pages` SET `title` = :title, `content` = :content, `parent` = :parent, `design` = :design, `template` = :template WHERE `id` = :pageID; ", array( |
|
243 | + 'title' => $title, |
|
244 | + 'content' => $content, |
|
245 | + 'pageID' => $page->getPageID(), |
|
246 | + 'parent' => $parent, |
|
247 | + 'design' => $design, |
|
248 | + 'template' => $template |
|
249 | + )); |
|
250 | 250 | |
251 | - //clear cache |
|
252 | - $page->clearCache(); |
|
251 | + //clear cache |
|
252 | + $page->clearCache(); |
|
253 | 253 | |
254 | - //reload page from database |
|
255 | - $page->loadByID($page->getPageID(), false); |
|
254 | + //reload page from database |
|
255 | + $page->loadByID($page->getPageID(), false); |
|
256 | 256 | |
257 | - //TODO: remove this line later |
|
258 | - Cache::clear("pages"); |
|
257 | + //TODO: remove this line later |
|
258 | + Cache::clear("pages"); |
|
259 | 259 | |
260 | - return true; |
|
261 | - } |
|
260 | + return true; |
|
261 | + } |
|
262 | 262 | |
263 | - protected function publish (Page &$page) { |
|
264 | - //check permissions for publishing |
|
265 | - if (PermissionChecker::current()->hasRight("can_publish_all_pages") || (PermissionChecker::current()->hasRight("can_publish_own_pages") && $page->getAuthorID() == User::current()->getID())) { |
|
266 | - //update page in database |
|
267 | - Database::getInstance()->execute("UPDATE `{praefix}pages` SET `published` = '1' WHERE `id` = :pageID; ", array( |
|
268 | - 'pageID' => $page->getPageID() |
|
269 | - )); |
|
263 | + protected function publish (Page &$page) { |
|
264 | + //check permissions for publishing |
|
265 | + if (PermissionChecker::current()->hasRight("can_publish_all_pages") || (PermissionChecker::current()->hasRight("can_publish_own_pages") && $page->getAuthorID() == User::current()->getID())) { |
|
266 | + //update page in database |
|
267 | + Database::getInstance()->execute("UPDATE `{praefix}pages` SET `published` = '1' WHERE `id` = :pageID; ", array( |
|
268 | + 'pageID' => $page->getPageID() |
|
269 | + )); |
|
270 | 270 | |
271 | - //clear cache |
|
272 | - $page->clearCache(); |
|
271 | + //clear cache |
|
272 | + $page->clearCache(); |
|
273 | 273 | |
274 | - //reload page from database |
|
275 | - $page->loadByID($page->getPageID(), false); |
|
274 | + //reload page from database |
|
275 | + $page->loadByID($page->getPageID(), false); |
|
276 | 276 | |
277 | - //TODO: remove this line later |
|
278 | - Cache::clear("pages"); |
|
277 | + //TODO: remove this line later |
|
278 | + Cache::clear("pages"); |
|
279 | 279 | |
280 | - return true; |
|
281 | - } else { |
|
282 | - return "You don't have the permissions to publish this page!"; |
|
283 | - } |
|
284 | - } |
|
280 | + return true; |
|
281 | + } else { |
|
282 | + return "You don't have the permissions to publish this page!"; |
|
283 | + } |
|
284 | + } |
|
285 | 285 | |
286 | - protected function showError (string $message) : string { |
|
287 | - //show error |
|
288 | - $template = new DwooTemplate("pages/error"); |
|
289 | - $template->assign("message", "No pageID was set!"); |
|
290 | - return $template->getCode(); |
|
291 | - } |
|
286 | + protected function showError (string $message) : string { |
|
287 | + //show error |
|
288 | + $template = new DwooTemplate("pages/error"); |
|
289 | + $template->assign("message", "No pageID was set!"); |
|
290 | + return $template->getCode(); |
|
291 | + } |
|
292 | 292 | |
293 | - public function getFooterScripts(): string { |
|
294 | - $style_name = Registry::singleton()->getSetting("current_style_name"); |
|
295 | - $style_path = DomainUtils::getBaseURL() . "/styles/" . $style_name . "/"; |
|
293 | + public function getFooterScripts(): string { |
|
294 | + $style_name = Registry::singleton()->getSetting("current_style_name"); |
|
295 | + $style_path = DomainUtils::getBaseURL() . "/styles/" . $style_name . "/"; |
|
296 | 296 | |
297 | - $thirdparty_url = Registry::singleton()->getSetting("thirdparty_url"); |
|
297 | + $thirdparty_url = Registry::singleton()->getSetting("thirdparty_url"); |
|
298 | 298 | |
299 | - /*return "<!-- CK Editor --> |
|
299 | + /*return "<!-- CK Editor --> |
|
300 | 300 | <script src=\"" . $style_path . "bower_components/ckeditor/ckeditor.js\"></script> |
301 | 301 | |
302 | 302 | <script> |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | }); |
311 | 311 | </script>";*/ |
312 | 312 | |
313 | - return "<script src=\"" . $thirdparty_url . "tinymce_4.8.2/js/tinymce/tinymce.min.js\"></script> |
|
313 | + return "<script src=\"" . $thirdparty_url . "tinymce_4.8.2/js/tinymce/tinymce.min.js\"></script> |
|
314 | 314 | <script>tinymce.init({ |
315 | 315 | selector: 'textarea', |
316 | 316 | height: 500, |
@@ -342,11 +342,11 @@ discard block |
||
342 | 342 | document.getElementById('inputSitemapPriority').disabled = !this.checked; |
343 | 343 | }; |
344 | 344 | </script>"; |
345 | - } |
|
345 | + } |
|
346 | 346 | |
347 | - public function listRequiredPermissions(): array { |
|
348 | - return array("can_edit_all_pages", "can_edit_own_pages"); |
|
349 | - } |
|
347 | + public function listRequiredPermissions(): array { |
|
348 | + return array("can_edit_all_pages", "can_edit_own_pages"); |
|
349 | + } |
|
350 | 350 | |
351 | 351 | } |
352 | 352 |