From e264e935ee02c0ea654a441707520ebbbb30a1c8 Mon Sep 17 00:00:00 2001 From: labby Date: Fri, 31 Jul 2015 13:35:02 +0200 Subject: [PATCH] enable custom template files for droplets --- upload/modules/droplets/css/backend.css | 83 ++++++++---- upload/modules/droplets/css/backend_old.css | 80 ----------- upload/modules/droplets/functions.php | 12 +- upload/modules/droplets/headers.inc.php | 59 -------- upload/modules/droplets/js/backend_body.js | 4 - upload/modules/droplets/register_parser.php | 46 +++++++ .../droplets/templates/backend/backups.lte | 78 ----------- .../templates/backend/droplet_permissions.lte | 64 --------- .../droplets/templates/backend/edit.lte | 109 --------------- .../droplets/templates/backend/footer.lte | 19 --- .../droplets/templates/backend/header.lte | 36 ----- .../droplets/templates/backend/import.lte | 50 ------- .../droplets/templates/backend/index.php | 42 ------ .../droplets/templates/backend/modify.lte | 126 ------------------ .../templates/backend/permissions.lte | 64 --------- upload/modules/droplets/templates/backups.lte | 4 +- .../templates/droplet_permissions.lte | 4 +- upload/modules/droplets/templates/edit.lte | 4 +- upload/modules/droplets/templates/import.lte | 4 +- upload/modules/droplets/templates/modify.lte | 4 +- .../droplets/templates/permissions.lte | 4 +- upload/modules/droplets/tool.php | 7 +- 22 files changed, 126 insertions(+), 777 deletions(-) delete mode 100644 upload/modules/droplets/css/backend_old.css delete mode 100644 upload/modules/droplets/headers.inc.php create mode 100644 upload/modules/droplets/register_parser.php delete mode 100644 upload/modules/droplets/templates/backend/backups.lte delete mode 100644 upload/modules/droplets/templates/backend/droplet_permissions.lte delete mode 100644 upload/modules/droplets/templates/backend/edit.lte delete mode 100644 upload/modules/droplets/templates/backend/footer.lte delete mode 100644 upload/modules/droplets/templates/backend/header.lte delete mode 100644 upload/modules/droplets/templates/backend/import.lte delete mode 100644 upload/modules/droplets/templates/backend/index.php delete mode 100644 upload/modules/droplets/templates/backend/modify.lte delete mode 100644 upload/modules/droplets/templates/backend/permissions.lte diff --git a/upload/modules/droplets/css/backend.css b/upload/modules/droplets/css/backend.css index e277e750..601edcd0 100644 --- a/upload/modules/droplets/css/backend.css +++ b/upload/modules/droplets/css/backend.css @@ -12,38 +12,69 @@ * */ -#droplets {padding:20px;} - -label { - - white-space: nowrap; - display: block; - float: left; - margin-right: 20px; - -} - -input[type='checkbox']{ - float: left; - margin-right: 10px; - margin-top: 6px; -} - -.button {margin:10px !important;} - +#droplets {margin-top:20px;} +#droplets h1 {display:inline-block; margin-bottom: 24px;;font-size:24px;} +#droplets table.droplets {background-color:white;width:100%;} +#droplets table.droplets thead {font-weight:bold;background-color:#c7d1db !important;height:25px;} +#droplets table.droplets th {background-color: #e6EEEE;border: 1px solid #FFF;font-size: 8pt;padding: 4px;text-align:left;} #droplets a.tooltip span.comment {display:none; margin-left:14px; width:430px;} - #droplets a.tooltip:hover span.comment{display:inline; position:absolute; padding:5px; border:1px solid #000000; background:#ffffff; color:#000000;} - #droplets span.usage {font-weight:bold;} +#droplets fieldset{border:1px solid #888888;padding:10px;} +#droplets legend{font-weight:bold;font-size:1.3em;padding:0 20px;border-left:1px solid #888888;border-right:1px solid #888888;margin:15px 0;} +#droplets label, #droplets span.label { + width:160px; + float:left; + text-align:right; + margin-right:5px; + margin-left: 5px; + padding-top:5px; + font-weight:bold; +} -#droplets a:hover {text-decoration:none;} -/* hack for be-theme algos */ -.info { - background: none; - padding-left: 0px; +#droplets input[type=text], #droplets textarea {width:600px;} +#droplets input[type=submit] {width:200px;} +#droplets div.problem {border:2px solid #f00;padding:15px;background-color:#FFCCCC;font-size:1.2em;font-weight:bold;text-align:center;color:#f00;} +#droplets div.info {border:2px solid #006600;margin:15px auto;padding:15px;background-color:#CCFFCC;font-size:1.2em;font-weight:bold;text-align:center;color:#060;} +/* addition 2.0.2 */ +#code { display: block; float: left; width: 100%; height: 300px; } +.droplet-v-spacer { display: block; float: left; width: 100%; height: 20px; } +.radio_label { + display: block; + width: 50px !important; + overflow: hidden; + text-align: left !important; +} +#active_y, #active_n { + float: left; + width: 24px; +} +th { + padding-left: 10px !important; +} +th input[type='checkbox'] { + margin-right: 10px; } +#droplets td { + padding-left: 11px !important; +} +.spacer { +height: 24px; +width:100%; +} +input[type='checkbox']{ + float: left; + margin-right: 10px; +} +label { + text-align: left !important; + margin-right: 30px !important; +} +.bottom_save { +float:right; +margin-right:78px; +} \ No newline at end of file diff --git a/upload/modules/droplets/css/backend_old.css b/upload/modules/droplets/css/backend_old.css deleted file mode 100644 index 601edcd0..00000000 --- a/upload/modules/droplets/css/backend_old.css +++ /dev/null @@ -1,80 +0,0 @@ -/** - * This file is part of an ADDON for use with LEPTON Core. - * This ADDON is released under the GNU GPL. - * Additional license terms can be seen in the info.php of this module. - * - * @module Droplets - * @author LEPTON Project - * @copyright 2010-2015 LEPTON Project - * @link http://www.LEPTON-cms.org - * @license http://www.gnu.org/licenses/gpl.html - * @license_terms please see info.php of this module - * - */ - -#droplets {margin-top:20px;} -#droplets h1 {display:inline-block; margin-bottom: 24px;;font-size:24px;} -#droplets table.droplets {background-color:white;width:100%;} -#droplets table.droplets thead {font-weight:bold;background-color:#c7d1db !important;height:25px;} -#droplets table.droplets th {background-color: #e6EEEE;border: 1px solid #FFF;font-size: 8pt;padding: 4px;text-align:left;} -#droplets a.tooltip span.comment {display:none; margin-left:14px; width:430px;} -#droplets a.tooltip:hover span.comment{display:inline; position:absolute; padding:5px; border:1px solid #000000; background:#ffffff; color:#000000;} -#droplets span.usage {font-weight:bold;} -#droplets fieldset{border:1px solid #888888;padding:10px;} -#droplets legend{font-weight:bold;font-size:1.3em;padding:0 20px;border-left:1px solid #888888;border-right:1px solid #888888;margin:15px 0;} -#droplets label, #droplets span.label { - width:160px; - float:left; - text-align:right; - margin-right:5px; - margin-left: 5px; - padding-top:5px; - font-weight:bold; -} - - -#droplets input[type=text], #droplets textarea {width:600px;} -#droplets input[type=submit] {width:200px;} -#droplets div.problem {border:2px solid #f00;padding:15px;background-color:#FFCCCC;font-size:1.2em;font-weight:bold;text-align:center;color:#f00;} -#droplets div.info {border:2px solid #006600;margin:15px auto;padding:15px;background-color:#CCFFCC;font-size:1.2em;font-weight:bold;text-align:center;color:#060;} -/* addition 2.0.2 */ -#code { display: block; float: left; width: 100%; height: 300px; } -.droplet-v-spacer { display: block; float: left; width: 100%; height: 20px; } -.radio_label { - display: block; - width: 50px !important; - overflow: hidden; - text-align: left !important; -} -#active_y, #active_n { - float: left; - width: 24px; -} -th { - padding-left: 10px !important; -} -th input[type='checkbox'] { - margin-right: 10px; -} - -#droplets td { - padding-left: 11px !important; -} -.spacer { -height: 24px; -width:100%; -} - -input[type='checkbox']{ - float: left; - margin-right: 10px; -} -label { - text-align: left !important; - margin-right: 30px !important; -} - -.bottom_save { -float:right; -margin-right:78px; -} \ No newline at end of file diff --git a/upload/modules/droplets/functions.php b/upload/modules/droplets/functions.php index 831e4202..71d77952 100644 --- a/upload/modules/droplets/functions.php +++ b/upload/modules/droplets/functions.php @@ -211,7 +211,7 @@ function list_droplets( $info = NULL ) } echo $parser->render( - 'modify.lte', + '@droplets/modify.lte', array( 'rows' => $rows, 'num_rows' => count($rows), @@ -309,7 +309,7 @@ function manage_backups() } echo $parser->render( - 'backups.lte', + '@droplets/backups.lte', array( 'rows' => $rows, 'info' => $info, @@ -381,7 +381,7 @@ function manage_perms() sort($rows); echo $parser->render( - 'permissions.lte', + '@droplets/permissions.lte', array( 'rows' => $rows, 'info' => $info, @@ -542,7 +542,7 @@ function import_droplets() } echo $parser->render( - 'import.lte', + '@droplets/import.lte', array( 'problem' => $problem ) @@ -799,7 +799,7 @@ function edit_droplet( $id ) } echo $parser->render( - 'edit.lte', + '@droplets/edit.lte', array( 'LANG' => $MOD_DROPLET, 'problem' => $problem, @@ -880,7 +880,7 @@ function edit_droplet_perms( $id ) } echo $parser->render( - 'droplet_permissions.lte', + '@droplets/droplet_permissions.lte', array( 'rows' => $rows, 'info' => $info, diff --git a/upload/modules/droplets/headers.inc.php b/upload/modules/droplets/headers.inc.php deleted file mode 100644 index ea241730..00000000 --- a/upload/modules/droplets/headers.inc.php +++ /dev/null @@ -1,59 +0,0 @@ -%s ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR); - } -} -// end include class.secure.php - -$mod_headers = array(); - -if ( DEFAULT_THEME =='algos' ) { - $mod_headers = array( - 'backend' => array( - 'css' => array( - array( - 'media' => 'screen', - 'file' => '/modules/droplets/css/backend_old.css', - ) - ), - - ), - ); -} - -?> \ No newline at end of file diff --git a/upload/modules/droplets/js/backend_body.js b/upload/modules/droplets/js/backend_body.js index c822d798..3c5246cc 100644 --- a/upload/modules/droplets/js/backend_body.js +++ b/upload/modules/droplets/js/backend_body.js @@ -24,7 +24,3 @@ if ( typeof jQuery != 'undefined' ) { }); } -// initialise semantic radio button -$('.ui.radio.checkbox') - .checkbox() -; diff --git a/upload/modules/droplets/register_parser.php b/upload/modules/droplets/register_parser.php new file mode 100644 index 00000000..a81ce210 --- /dev/null +++ b/upload/modules/droplets/register_parser.php @@ -0,0 +1,46 @@ +prependPath( dirname(__FILE__)."/templates/", $module_directory ); + +$backend_template_path = LEPTON_PATH."/templates/".DEFAULT_THEME."/backend/".$module_directory."/"; +$module_template_path = dirname(__FILE__)."/templates/"; + +require_once (LEPTON_PATH."/modules/lib_twig/classes/class.twig_utilities.php"); +$twig_util = new twig_utilities( $parser, $loader, $module_template_path, $backend_template_path ); +$twig_util->template_namespace = $module_directory; + +$twig_modul_namespace = "@".$module_directory."/" + +?> \ No newline at end of file diff --git a/upload/modules/droplets/templates/backend/backups.lte b/upload/modules/droplets/templates/backend/backups.lte deleted file mode 100644 index 9f9936ac..00000000 --- a/upload/modules/droplets/templates/backend/backups.lte +++ /dev/null @@ -1,78 +0,0 @@ -{# -/** - * This file is part of an ADDON for use with LEPTON Core. - * This ADDON is released under the GNU GPL. - * Additional license terms can be seen in the info.php of this module. - * - * @module Droplets - * @author LEPTON Project - * @copyright 2010-2015 LEPTON Project - * @link http://www.LEPTON-cms.org - * @license http://www.gnu.org/licenses/gpl.html - * @license_terms please see info.php of this module - * - */ - #} -{% include "header.lte" %} -{% autoescape false %} -

{{ MOD_DROPLET['Manage backups'] }}

- « {{ MOD_DROPLET['Back to overview'] }} « -
- {% if info is not empty %}
{{ info }}
{% endif %} - -
- - - - {% if num_rows == 0 %} -
{{ MOD_DROPLET['No Backups found'] }}
- {% else %} - - - - - - - - - - - - - {% for item in rows %} - - - - - - - - {% endfor %} - -
{{ MOD_DROPLET['Actions'] }}{{ MOD_DROPLET['Name'] }}{{ MOD_DROPLET['Size'] }} (Byte){{ MOD_DROPLET['Date'] }}{{ MOD_DROPLET['Files'] }}
- - - - {{ MOD_DROPLET['Contained files'] }}:
{{ item.listfiles }}
-
- {{ item.name }} - {{ item.size }}{{ item.date }}{{ item.files }}
- - -
-
- -
-
- - -
-
- -
-
- -
- {% endif %} -{% endautoescape %} -{% include "footer.lte" %} \ No newline at end of file diff --git a/upload/modules/droplets/templates/backend/droplet_permissions.lte b/upload/modules/droplets/templates/backend/droplet_permissions.lte deleted file mode 100644 index 1b10a1cf..00000000 --- a/upload/modules/droplets/templates/backend/droplet_permissions.lte +++ /dev/null @@ -1,64 +0,0 @@ -{# -/** - * This file is part of an ADDON for use with LEPTON Core. - * This ADDON is released under the GNU GPL. - * Additional license terms can be seen in the info.php of this module. - * - * @module Droplets - * @author LEPTON Project - * @copyright 2010-2015 LEPTON Project - * @link http://www.LEPTON-cms.org - * @license http://www.gnu.org/licenses/gpl.html - * @license_terms please see info.php of this module - * - */ - #} -{% include "header.lte" %} -{% autoescape false %} -

{{ MOD_DROPLET['Manage Droplet permissions'] }}

-« {{ MOD_DROPLET['Back to overview'] }} « - - -{% if info is not empty %}
{{ info }}
{% endif %} - - - -
- - - - {% if num_rows == 0 %} -
{{ MOD_DROPLET['No permission settings found'] }}
- {% else %} - - - - - - - - - - {% for item in rows %} - - - - - {% endfor %} - -
{{ MOD_DROPLET['Name'] }}{{ MOD_DROPLET['Groups'] }}
{{ item.name }}{{ item.groups }}
- -
-
-
- - - -
-
-
-
- -{% endif %} -{% endautoescape %} -{% include "footer.lte" %} \ No newline at end of file diff --git a/upload/modules/droplets/templates/backend/edit.lte b/upload/modules/droplets/templates/backend/edit.lte deleted file mode 100644 index 7b52e19d..00000000 --- a/upload/modules/droplets/templates/backend/edit.lte +++ /dev/null @@ -1,109 +0,0 @@ -{# -/** - * This file is part of an ADDON for use with LEPTON Core. - * This ADDON is released under the GNU GPL. - * Additional license terms can be seen in the info.php of this module. - * - * @module Droplets - * @author LEPTON Project - * @copyright 2010-2015 LEPTON Project - * @link http://www.LEPTON-cms.org - * @license http://www.gnu.org/licenses/gpl.html - * @license_terms please see info.php of this module - * - */ - #} -{% include "header.lte" %} -{% autoescape false %} -

{{ MOD_DROPLET['edit droplet'] }}

-« {{ MOD_DROPLET['Back to overview'] }} « - - -{% if problem is not empty %}
{{problem }}
<{% endif %} -{% if info is not empty %}
{{ info }}
{% endif %} - - - -
- - - -
-
-
-
-
- - -
-
-
- -
-
-
- - -
-
-
-
- -
-
-
-
- -
-
- - -
-
-
-
- - -
-
-
-
-
-
- -
-
-
-
- - -
-
-
-
- -
-
-
-
- - {{ register_area }} - -
-
-
-
- -
-
- - - -
-
- -
- -
-{% endautoescape %} -{% include "footer.lte" %} \ No newline at end of file diff --git a/upload/modules/droplets/templates/backend/footer.lte b/upload/modules/droplets/templates/backend/footer.lte deleted file mode 100644 index c017512c..00000000 --- a/upload/modules/droplets/templates/backend/footer.lte +++ /dev/null @@ -1,19 +0,0 @@ -{# -/** - * This file is part of an ADDON for use with LEPTON Core. - * This ADDON is released under the GNU GPL. - * Additional license terms can be seen in the info.php of this module. - * - * @module Droplets - * @author LEPTON Project - * @copyright 2010-2015 LEPTON Project - * @link http://www.LEPTON-cms.org - * @license http://www.gnu.org/licenses/gpl.html - * @license_terms please see info.php of this module - * - */ - #} -{% autoescape false %} - - {# ############# end div from header.lte ############ #} -{% endautoescape %} \ No newline at end of file diff --git a/upload/modules/droplets/templates/backend/header.lte b/upload/modules/droplets/templates/backend/header.lte deleted file mode 100644 index 82c57d6f..00000000 --- a/upload/modules/droplets/templates/backend/header.lte +++ /dev/null @@ -1,36 +0,0 @@ -{# -/** - * This file is part of an ADDON for use with LEPTON Core. - * This ADDON is released under the GNU GPL. - * Additional license terms can be seen in the info.php of this module. - * - * @module Droplets - * @author LEPTON Project - * @copyright 2010-2015 LEPTON Project - * @link http://www.LEPTON-cms.org - * @license http://www.gnu.org/licenses/gpl.html - * @license_terms please see info.php of this module - * - */ - #} -{% autoescape false %} -
{# ############# start div, ends in footer.lte ############ #} -
-
-
-

- -
Droplets
-

-
- -
-
-{% endautoescape %} \ No newline at end of file diff --git a/upload/modules/droplets/templates/backend/import.lte b/upload/modules/droplets/templates/backend/import.lte deleted file mode 100644 index dae1bfe2..00000000 --- a/upload/modules/droplets/templates/backend/import.lte +++ /dev/null @@ -1,50 +0,0 @@ -{# -/** - * This file is part of an ADDON for use with LEPTON Core. - * This ADDON is released under the GNU GPL. - * Additional license terms can be seen in the info.php of this module. - * - * @module Droplets - * @author LEPTON Project - * @copyright 2010-2015 LEPTON Project - * @link http://www.LEPTON-cms.org - * @license http://www.gnu.org/licenses/gpl.html - * @license_terms please see info.php of this module - * - */ - #} -{% include "header.lte" %} -{% autoescape false %} -

{{ MOD_DROPLET['Import'] }}

-« {{ MOD_DROPLET['Back to overview'] }} « - - -{% if problem is not empty %}
{{problem }}
<{% endif %} -{% if info is not empty %}
{{ info }}
{% endif %} - - -
- - -
-
-
-
- - -
-
- -
- - - -
-
-
- -
-