From 97bd9842f44bb25832f5dd8288372f2199cf3b7b Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Wed, 30 Oct 2013 00:51:01 +0100 Subject: Correction de bugs, amélioration titres admin, traductions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/admin/add.php | 11 +++++++++-- code/admin/admin.css | 5 +++++ code/admin/admin.js | 3 +++ code/admin/index.php | 6 +++++- code/admin/render.php | 17 +++++++++++++---- 5 files changed, 35 insertions(+), 7 deletions(-) (limited to 'code') diff --git a/code/admin/add.php b/code/admin/add.php index c839e0a..0869dd5 100644 --- a/code/admin/add.php +++ b/code/admin/add.php @@ -9,7 +9,11 @@ // Localization Init l10n_init($site_conf['site_admin_lang']); - $kind=sanitize($_GET, 'kind', '/[^a-z_]+/', 'page'); /* Could be : page, media */ + // URL parameter parsing + $kind = sanitize($_GET, 'kind', '/[^a-z_]+/', 'page'); /* Could be : page, media */ + + // Pre-computed because used twice + $page_title = _('Admin') . ' - ' . ( ($kind=='media')?_('Add a media'):_('Add a page') ); ?> @@ -18,9 +22,10 @@ -<?=($kind=='media')?_('Add media'):_('Add page')?> +<?=$page_title?> +

@@ -50,6 +55,8 @@
+ +
diff --git a/code/admin/admin.css b/code/admin/admin.css index f01a35d..f394ef9 100644 --- a/code/admin/admin.css +++ b/code/admin/admin.css @@ -1,3 +1,8 @@ +h1 { + text-align:center; + font-size:160% +} + fieldset { display:inline-block; vertical-align: top; diff --git a/code/admin/admin.js b/code/admin/admin.js index 3d0125d..669658d 100644 --- a/code/admin/admin.js +++ b/code/admin/admin.js @@ -91,6 +91,9 @@ function save_site_props() { } // Admin other actions (with page change or refresh) +function go_admin_page() { + document.location = './'; +} function go_add_form(kind) { document.location = 'add.php?kind=' + encodeURIComponent(kind); } diff --git a/code/admin/index.php b/code/admin/index.php index ddb95b3..dc10206 100644 --- a/code/admin/index.php +++ b/code/admin/index.php @@ -8,6 +8,9 @@ // Localization Init l10n_init($site_conf['site_admin_lang']); + + // Pre-computed because used twice + $page_title = _('Admin'); ?> @@ -17,9 +20,10 @@ -<?=_('Admin')?> +<?=$page_title?> +

diff --git a/code/admin/render.php b/code/admin/render.php index 9d4175e..2d49f01 100644 --- a/code/admin/render.php +++ b/code/admin/render.php @@ -1,14 +1,23 @@ 'publish', + 'page' => $argv[1] + ); + } else { + // In web mode, take from args from GET request + $params=&$_GET; + } + // params clean-up + $action=sanitize($params, 'action', '/[^a-z_]+/', 'preview'); /* Could be : preview, edit, publish */ + $page=sanitize($params, 'page', '/[^a-z0-9\/]+/', $site_conf['site_default_page']); // Never put \. in this regex // Template vars init ($page, $page_path, $page_props, $page_tpl_url) $page_path = "content/$page"; -- cgit v1.2.3