From 0ce22ebf7adf19631968a205e4fc6a36079f09d3 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Mon, 3 Mar 2014 11:44:06 +0100 Subject: [PATCH] [ADDED] Template Editor --- public/include/pages/admin/templates.inc.php | 4 +- .../bootstrap/admin/templates/browser.tpl | 48 +++++++++++ .../bootstrap/admin/templates/default.tpl | 79 +------------------ .../bootstrap/admin/templates/editor.tpl | 37 +++++++++ 4 files changed, 91 insertions(+), 77 deletions(-) create mode 100644 public/templates/bootstrap/admin/templates/browser.tpl create mode 100644 public/templates/bootstrap/admin/templates/editor.tpl diff --git a/public/include/pages/admin/templates.inc.php b/public/include/pages/admin/templates.inc.php index 2272b9c1..00af9281 100644 --- a/public/include/pages/admin/templates.inc.php +++ b/public/include/pages/admin/templates.inc.php @@ -27,7 +27,7 @@ $sOriginalTemplate = $template->getTemplateContent($sTemplate); if (@$_REQUEST['do'] == 'save') { if ($template->updateEntry(@$_REQUEST['template'], @$_REQUEST['content'], @$_REQUEST['active'])) { - $_SESSION['POPUP'][] = array('CONTENT' => 'Page updated', 'TYPE' => 'success'); + $_SESSION['POPUP'][] = array('CONTENT' => 'Page updated', 'TYPE' => 'alert alert-success'); } else { $_SESSION['POPUP'][] = array('CONTENT' => 'Page update failed: ' . $template->getError(), 'TYPE' => 'alert alert-danger'); } @@ -36,7 +36,7 @@ if (@$_REQUEST['do'] == 'save') { $oDatabaseTemplate = $template->getEntry($sTemplate); if ( $oDatabaseTemplate === false ) { - $_SESSION['POPUP'][] = array('CONTENT' => 'Can\'t fetch template from Database. Have you created `templates` table? Run 005_create_templates_table.sql from sql folder', 'TYPE' => 'danger'); + $_SESSION['POPUP'][] = array('CONTENT' => 'Can\'t fetch template from Database. Have you created `templates` table? Run 005_create_templates_table.sql from sql folder', 'TYPE' => 'alert alert-danger'); } $smarty->assign("TEMPLATES", $aTemplates); diff --git a/public/templates/bootstrap/admin/templates/browser.tpl b/public/templates/bootstrap/admin/templates/browser.tpl new file mode 100644 index 00000000..9330b7a1 --- /dev/null +++ b/public/templates/bootstrap/admin/templates/browser.tpl @@ -0,0 +1,48 @@ +
+
+
+ Select Page +
+
+ {include file="admin/templates/tree.tpl" files=$TEMPLATES prefix=""} +
+ + + + + + + +
+
diff --git a/public/templates/bootstrap/admin/templates/default.tpl b/public/templates/bootstrap/admin/templates/default.tpl index d2a762eb..1d5adaea 100644 --- a/public/templates/bootstrap/admin/templates/default.tpl +++ b/public/templates/bootstrap/admin/templates/default.tpl @@ -1,75 +1,4 @@ -
-

Select Page

-
- {include file="admin/templates/tree.tpl" files=$TEMPLATES prefix=""} -
- - - - - - -
-
  • Bold templates are activated
-
-
- -
-

Edit template '{$CURRENT_TEMPLATE}'

-
- - - - -
-
- - - - -
-
- - -
-
- - -
-
-
- -
-
-
+
+ {include file="admin/templates/browser.tpl"} + {include file="admin/templates/editor.tpl"} +
diff --git a/public/templates/bootstrap/admin/templates/editor.tpl b/public/templates/bootstrap/admin/templates/editor.tpl new file mode 100644 index 00000000..602c0a35 --- /dev/null +++ b/public/templates/bootstrap/admin/templates/editor.tpl @@ -0,0 +1,37 @@ +
+ + + + +
+
+ Edit template '{$CURRENT_TEMPLATE}' +
+
+ + + + + + + + + + + + + +
+ + +
+ +
+ +
+
+ +
+