diff --git a/admin/index.php b/admin/index.php index 70d6be6..0393d77 100644 --- a/admin/index.php +++ b/admin/index.php @@ -93,7 +93,7 @@ // Send - @mail($user['email'], __('Your login details for :site_name', 'users', array('site_name' => $site_name)), $message); + @mail($user['email'], __('Your login details for :site_name', 'users', array(':site_name' => $site_name)), $message); // Set notification Notification::set('success', __('Your login details for :site_name has been sent', 'users', array(':site_name' => $site_name))); @@ -108,10 +108,8 @@ } // If admin user is login = true then set is_admin = true - if (Session::exists('admin')) { - if (Session::get('admin') == true) { - $is_admin = true; - } + if (Session::exists('admin') && Session::get('admin') == true) { + $is_admin = true; } else { $is_admin = false; } @@ -122,14 +120,11 @@ } // If is admin then load admin area - if ($is_admin) { + if ($is_admin) { + // If id is empty then redirect to default plugin PAGES if (Request::get('id')) { - if (Request::get('sub_id')) { - $area = Request::get('sub_id'); - } else { - $area = Request::get('id'); - } + $area = Request::get('id'); } else { Request::redirect('index.php?id=pages'); } diff --git a/changelog.txt b/changelog.txt index 44f80fe..a9075f3 100755 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,10 @@ +Monstra 2.1.2, 2012-12-05 +------------------------ +- Blocks Plugin: added ability create and render inline content blocks with {block_inline} and {block_inline_create} +- Site Module: methods keywords() and description() fixes. +- Pages Plugin: pages.js fixes. +- Admin main index.php fixes. + Monstra 2.1.1, 2012-11-30 ------------------------ - Plugins: Minify bug #71 - fixed. diff --git a/monstra/engine/core.php b/monstra/engine/core.php index 02cc053..1471944 100644 --- a/monstra/engine/core.php +++ b/monstra/engine/core.php @@ -45,7 +45,7 @@ /** * The version of Monstra */ - const VERSION = '2.1.1'; + const VERSION = '2.1.2'; /** diff --git a/monstra/engine/site.php b/monstra/engine/site.php index 9cdb7b8..e9ae7d4 100644 --- a/monstra/engine/site.php +++ b/monstra/engine/site.php @@ -111,7 +111,7 @@ * @return string */ public static function description() { - return (trim(call_user_func(ucfirst(Uri::command()).'::description')) == '') ? Html::toText(Option::get('description')) : Html::toText($description); + return (($description = trim(call_user_func(ucfirst(Uri::command()).'::description'))) == '') ? Html::toText(Option::get('description')) : Html::toText($description); } @@ -125,7 +125,7 @@ * @return string */ public static function keywords() { - return (trim(call_user_func(ucfirst(Uri::command()).'::keywords')) == '') ? Html::toText(Option::get('keywords')) : Html::toText($description); + return (($keywords = trim(call_user_func(ucfirst(Uri::command()).'::keywords'))) == '') ? Html::toText(Option::get('keywords')) : Html::toText($keywords); } diff --git a/plugins/box/blocks/blocks.plugin.php b/plugins/box/blocks/blocks.plugin.php index 9895919..094456b 100644 --- a/plugins/box/blocks/blocks.plugin.php +++ b/plugins/box/blocks/blocks.plugin.php @@ -35,13 +35,53 @@ // Add shortcode {block get="blockname"} Shortcode::add('block', 'Block::_content'); + + // Add shortcode {block_inline name="blockname"} + Shortcode::add('block_inline', 'Block::_inlineBlock'); + + // Add shortcode {block_inline_create name="blockname"} Block content here {/block_inline_create} + Shortcode::add('block_inline_create', 'Block::_createInlineBlock'); + /** * Block Class */ class Block { + /** + * Inline Blocks + * + * @var array + */ + public static $inline_blocks = array(); + + + /** + * Create Inline Block + */ + public static function _createInlineBlock($attributes, $content) { + if (isset($attributes['name'])) { + Block::$inline_blocks[Security::safeName($attributes['name'], '_', true)] = array( + 'content' => (string)$content, + ); + } + } + + + /** + * Draw Inline Block + */ + public static function _inlineBlock($attributes) { + if (isset($attributes['name']) && isset(Block::$inline_blocks[$attributes['name']])) { + $content = Filter::apply('content', Text::toHtml(Block::$inline_blocks[$attributes['name']]['content'])); + return $content; + } else { + return ''; + } + } + + /** * Get block * diff --git a/plugins/box/pages/js/pages.js b/plugins/box/pages/js/pages.js index 52aa4e4..4b079d5 100644 --- a/plugins/box/pages/js/pages.js +++ b/plugins/box/pages/js/pages.js @@ -10,7 +10,7 @@ $.monstra.pages = { $.ajax({ type:"post", data:"slug="+slug+"&expand="+expand+"&token="+token, - url: $('form input[name="siteurl"]').val() + url: $('form input[name="url"]').val() }); },