From 5b50aa689ed04176a6ece7188a7589bee5de8061 Mon Sep 17 00:00:00 2001 From: Martynas Barzda Date: Mon, 29 Oct 2012 17:30:50 +0200 Subject: [PATCH 01/19] Install script: updated $system_timezone Get system timezone with date_default_timezone_get() function --- install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.php b/install.php index 5f98e54..f7a6142 100644 --- a/install.php +++ b/install.php @@ -11,7 +11,7 @@ if ( ! defined('MONSTRA_ACCESS')) define('MONSTRA_ACCESS', true); // Set default timezone - $system_timezone = 'Kwajalein'; + $system_timezone = date_default_timezone_get(); // Load bootstrap file require_once(ROOT . DS . 'monstra' . DS . 'bootstrap.php'); From 029e8be63464f156b42c23fa837bdda8184a9903 Mon Sep 17 00:00:00 2001 From: Martynas Barzda Date: Mon, 29 Oct 2012 19:35:41 +0200 Subject: [PATCH 02/19] Install script: update languages list --- install.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/install.php b/install.php index f7a6142..21ea38b 100644 --- a/install.php +++ b/install.php @@ -31,9 +31,12 @@ // Directories to check $dir_array = array('public', 'storage', 'backups', 'tmp'); + // Languages array + $languages_array = array('en', 'ru', 'lt', 'it', 'de', 'pt-br'); + // Select Monstra language if (Request::get('language')) { - if (in_array(Request::get('language'), array('en', 'ru', 'lt', 'it', 'de', 'pt-br'))) { + if (in_array(Request::get('language'), $languages_array)) { if (Option::update('language', Request::get('language'))) { Request::redirect($site_url); } @@ -153,13 +156,14 @@ color: #F74C18; } - .sep { - color:#ccc; - } - .language-link { color:#7A7A7C; } + + .language-link+.language-link:before { + color: #ccc; + content: ' | '; + } .language-link:hover { color:#000; @@ -228,12 +232,9 @@
- en | - it | - lt | - de | - pt | - ru + + +
From 823d712a1b2a735743aebe5ddaef285c6aa0308c Mon Sep 17 00:00:00 2001 From: Martynas Barzda Date: Mon, 29 Oct 2012 19:51:01 +0200 Subject: [PATCH 03/19] Install script: updates --- install.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/install.php b/install.php index 21ea38b..0bbdfe6 100644 --- a/install.php +++ b/install.php @@ -1,10 +1,10 @@
- - - + + +
@@ -405,9 +406,9 @@ } if (is_writable(__FILE__)){ - echo '
  • '.__('Install script writable', 'system').'
  • '; + echo '
  • '.__('Install script writable', 'system').'
  • '; } else { - echo '
  • '.__('Install script not writable', 'system').'
  • '; + echo '
  • '.__('Install script not writable', 'system').'
  • '; } if (is_writable('sitemap.xml')){ @@ -446,4 +447,4 @@ - + \ No newline at end of file From 8394d1db6ae2a67a3de9844df53dc3d801c2b3f4 Mon Sep 17 00:00:00 2001 From: Awilum Date: Mon, 29 Oct 2012 23:41:13 +0200 Subject: [PATCH 04/19] Shortcodes API: shortcode name issue #53 --- monstra/engine/shortcodes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monstra/engine/shortcodes.php b/monstra/engine/shortcodes.php index df0cddb..2454489 100644 --- a/monstra/engine/shortcodes.php +++ b/monstra/engine/shortcodes.php @@ -148,8 +148,8 @@ if ( ! Shortcode::$shortcode_tags) return $content; $shortcodes = implode('|', array_map('preg_quote', array_keys(Shortcode::$shortcode_tags))); - $pattern = "/(.?)\{($shortcodes)(.*?)(\/)?\}(?(4)|(?:(.+?)\{\/\s*\\2\s*\}))?(.?)/s"; - + $pattern = "/(.?)\{([$shortcodes]+)(.*?)(\/)?\}(?(4)|(?:(.+?)\{\/\s*\\2\s*\}))?(.?)/s"; + return preg_replace_callback($pattern, 'Shortcode::_handle', $content); } From a14027696681d35ba2761ed9f8842e676c0d7905 Mon Sep 17 00:00:00 2001 From: Awilum Date: Thu, 1 Nov 2012 18:55:09 +0200 Subject: [PATCH 05/19] Pages Plugin: expand improvments #27. and fixed delete action --- plugins/box/pages/pages.admin.php | 69 +++++++++++++++++-- .../box/pages/views/backend/index.view.php | 24 ++++++- 2 files changed, 86 insertions(+), 7 deletions(-) diff --git a/plugins/box/pages/pages.admin.php b/plugins/box/pages/pages.admin.php index 83bfda9..7146ddf 100755 --- a/plugins/box/pages/pages.admin.php +++ b/plugins/box/pages/pages.admin.php @@ -1,10 +1,63 @@ updateWhere('[slug="'.Request::post('slug').'"]', array('expand' => Request::post('expand'))); + Request::shutdown(); + } + } + + + /** + * _themeHeaders + */ + public static function _themeHeaders() { + echo (''); + } + /** * Pages admin function @@ -19,6 +72,8 @@ $errors = array(); $pages = new Table('pages'); + PagesAdmin::$pages = $pages; + $users = new Table('users'); $user = $users->select('[id='.Session::get('user_id').']', null); @@ -428,7 +483,12 @@ // Delete page and update fields if ($pages->deleteWhere('[slug="'.$page['slug'].'" ]')) { - $pages->updateWhere('[parent="'.$page['slug'].'"]', array('parent' => '')); + + $_pages = $pages->select('[parent="'.$page['slug'].'"]', 'all'); + foreach($_pages as $_page) { + $pages->updateWhere('[slug="'.$_page['slug'].'"]', array('parent' => '')); + } + File::delete(STORAGE . DS . 'pages' . DS . $page['id'] . '.page.txt'); Notification::set('success', __('Page :page deleted', 'pages', array(':page' => Html::toText($page['title'])))); } @@ -458,7 +518,7 @@ $count = 0; // Get pages - $pages_list = $pages->select(null, 'all', null, array('slug', 'title', 'status', 'date', 'author', 'parent')); + $pages_list = $pages->select(null, 'all', null, array('slug', 'title', 'status', 'date', 'author', 'expand', 'parent')); // Loop foreach ($pages_list as $page) { @@ -468,6 +528,7 @@ $pages_array[$count]['status'] = $status_array[$page['status']]; $pages_array[$count]['date'] = $page['date']; $pages_array[$count]['author'] = $page['author']; + $pages_array[$count]['expand'] = $page['expand']; $pages_array[$count]['slug'] = $page['slug']; if (isset($page['parent'])) { diff --git a/plugins/box/pages/views/backend/index.view.php b/plugins/box/pages/views/backend/index.view.php index ce7687c..e99609f 100755 --- a/plugins/box/pages/views/backend/index.view.php +++ b/plugins/box/pages/views/backend/index.view.php @@ -18,6 +18,7 @@ + @@ -32,12 +33,28 @@ if ($page['parent'] != '') { $dash = Html::arrow('right').'  '; } else { $dash = ""; } ?> - + select('[slug="'.(string)$page['parent'].'"]', null); + if ($page['parent'] !== '' && isset($expand['expand']) && $expand['expand'] == '1') { $visibility = 'style="display:none;"'; } else { $visibility = ''; } + ?> + rel="children_" > + + Date: Thu, 1 Nov 2012 18:56:05 +0200 Subject: [PATCH 06/19] Admin Default Theme: #27 add .btn-expand class --- admin/themes/default/css/default.css | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/admin/themes/default/css/default.css b/admin/themes/default/css/default.css index 667806a..15c715f 100644 --- a/admin/themes/default/css/default.css +++ b/admin/themes/default/css/default.css @@ -450,4 +450,11 @@ td, th { .error-none {display:none;} .error-field {border:1px solid red!important;} .container-fluid {padding-left:0px;} -img {max-width:none;} \ No newline at end of file +img {max-width:none;} + +a.btn-expand{ + color: #333; + text-decoration: none; + padding-left:4px; + padding-right:4px; +} \ No newline at end of file From edb260c9ac93639c2a4196b3cfec8c330c8a5574 Mon Sep 17 00:00:00 2001 From: Awilum Date: Thu, 1 Nov 2012 19:19:42 +0200 Subject: [PATCH 07/19] Pages Table: expand field added --- storage/database/pages.table.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/database/pages.table.xml b/storage/database/pages.table.xml index a39ab0e..5f39323 100644 --- a/storage/database/pages.table.xml +++ b/storage/database/pages.table.xml @@ -1,2 +1,2 @@ -2
    + select('[parent="'.(string)$page['slug'].'"]', 'all')) > 0) { + if (isset($page['expand']) && $page['expand'] == '1') { + echo '+'; + } else { + echo '-'; + } + } + ?> + '_blank')); + echo $dash.Html::anchor(Html::toText($page['title']), $site_url.$parent.$page['slug'], array('target' => '_blank', 'rel' => 'children_'.$_parent)); ?> @@ -68,6 +85,7 @@