CMS  Version 3.9
custom_css_edit.inc
Go to the documentation of this file.
1 <?php
2 Fakoli::using("html_editor", "settings");
3 
4 $editor = checkIdentifier($_GET["editor"]);
5 
6 if (!checkRole("admin"))
7 {
8  Fakoli::end("Permission Denied");
9 }
10 
11 $c = Component::getComponent("html_editor");
12 
13 $form = new SettingAutoForm($c, new InclusionFilter("enable_custom_CSS", "custom_CSS"));
14 $form->setLayout(new UngroupedFormLayout($form));
15 
16 $form->action = "/action/html_editor/custom_css_edit?editor=" . $editor;
17 
18 $form->ajaxSubmit("function (response){new CustomCSSManager().cssEditorResponse(response); }");
19 
20 if ($method == "POST")
21 {
22  if ($form->save())
23  {
24  Fakoli::end("OK");
25  }
26  else
27  {
28  Fakoli::end($form->msg);
29  }
30 }
31 
32 $script .= $form->writeScript();
33 $form->drawForm();
static getComponent($name)
Definition: component.inc:91
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition: core.inc:116
static end($message="")
Use this method to terminate execution of a script instead of using the php keywords exit() or die().
Definition: core.inc:1149
$method
Pull out a simple reference to the request method.
Definition: core.inc:1573
if(!checkRole("admin")) $c
$editor
if($method=="POST") $script