1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-05 12:48:00 +02:00

Merge remote-tracking branch 'origin/dev'

This commit is contained in:
Awilum
2012-12-05 21:57:15 +02:00
6 changed files with 57 additions and 15 deletions

View File

@@ -93,7 +93,7 @@
// Send // 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 // Set notification
Notification::set('success', __('Your login details for :site_name has been sent', 'users', array(':site_name' => $site_name))); 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 admin user is login = true then set is_admin = true
if (Session::exists('admin')) { if (Session::exists('admin') && Session::get('admin') == true) {
if (Session::get('admin') == true) { $is_admin = true;
$is_admin = true;
}
} else { } else {
$is_admin = false; $is_admin = false;
} }
@@ -123,13 +121,10 @@
// If is admin then load admin area // If is admin then load admin area
if ($is_admin) { if ($is_admin) {
// If id is empty then redirect to default plugin PAGES // If id is empty then redirect to default plugin PAGES
if (Request::get('id')) { if (Request::get('id')) {
if (Request::get('sub_id')) { $area = Request::get('id');
$area = Request::get('sub_id');
} else {
$area = Request::get('id');
}
} else { } else {
Request::redirect('index.php?id=pages'); Request::redirect('index.php?id=pages');
} }

View File

@@ -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 Monstra 2.1.1, 2012-11-30
------------------------ ------------------------
- Plugins: Minify bug #71 - fixed. - Plugins: Minify bug #71 - fixed.

View File

@@ -45,7 +45,7 @@
/** /**
* The version of Monstra * The version of Monstra
*/ */
const VERSION = '2.1.1'; const VERSION = '2.1.2';
/** /**

View File

@@ -111,7 +111,7 @@
* @return string * @return string
*/ */
public static function description() { 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 * @return string
*/ */
public static function keywords() { 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);
} }

View File

@@ -36,12 +36,52 @@
// Add shortcode {block get="blockname"} // Add shortcode {block get="blockname"}
Shortcode::add('block', 'Block::_content'); 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 * Block Class
*/ */
class Block { 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 * Get block
* *

View File

@@ -10,7 +10,7 @@ $.monstra.pages = {
$.ajax({ $.ajax({
type:"post", type:"post",
data:"slug="+slug+"&expand="+expand+"&token="+token, data:"slug="+slug+"&expand="+expand+"&token="+token,
url: $('form input[name="siteurl"]').val() url: $('form input[name="url"]').val()
}); });
}, },