1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-06 13:16:54 +02:00

Monstra Library: basic core improvments

This commit is contained in:
Awilum
2013-01-04 21:08:04 +02:00
parent 7437cc6abb
commit ef12b7492e
289 changed files with 16265 additions and 17155 deletions

View File

@@ -1,149 +1,146 @@
<?php
// Add plugin navigation link
Navigation::add(__('Blocks', 'blocks'), 'content', 'blocks', 2);
// Add plugin navigation link
Navigation::add(__('Blocks', 'blocks'), 'content', 'blocks', 2);
/**
* Blocks Admin Class
*/
class BlocksAdmin extends Backend
{
/**
* Blocks Admin Class
* Blocks admin function
*/
class BlocksAdmin extends Backend {
public static function main()
{
// Init vars
$blocks_path = STORAGE . DS . 'blocks' . DS;
$blocks_list = array();
$errors = array();
// Check for get actions
// -------------------------------------
if (Request::get('action')) {
/**
* Blocks admin function
*/
public static function main() {
// Switch actions
// -------------------------------------
switch (Request::get('action')) {
// Init vars
$blocks_path = STORAGE . DS . 'blocks' . DS;
$blocks_list = array();
$errors = array();
// Check for get actions
// -------------------------------------
if (Request::get('action')) {
// Add block
// -------------------------------------
case "add_block":
// Switch actions
// -------------------------------------
switch (Request::get('action')) {
if (Request::post('add_blocks') || Request::post('add_blocks_and_exit')) {
// Add block
// -------------------------------------
case "add_block":
if (Request::post('add_blocks') || Request::post('add_blocks_and_exit')) {
if (Security::check(Request::post('csrf'))) {
if (Security::check(Request::post('csrf'))) {
if (trim(Request::post('name')) == '') $errors['blocks_empty_name'] = __('Required field', 'blocks');
if (file_exists($blocks_path.Security::safeName(Request::post('name')).'.block.html')) $errors['blocks_exists'] = __('This block already exists', 'blocks');
if (trim(Request::post('name')) == '') $errors['blocks_empty_name'] = __('Required field', 'blocks');
if (file_exists($blocks_path.Security::safeName(Request::post('name')).'.block.html')) $errors['blocks_exists'] = __('This block already exists', 'blocks');
if (count($errors) == 0) {
// Save block
File::setContent($blocks_path.Security::safeName(Request::post('name')).'.block.html', XML::safe(Request::post('editor')));
Notification::set('success', __('Your changes to the block <i>:name</i> have been saved.', 'blocks', array(':name' => Security::safeName(Request::post('name')))));
if (count($errors) == 0) {
if (Request::post('add_blocks_and_exit')) {
Request::redirect('index.php?id=blocks');
} else {
Request::redirect('index.php?id=blocks&action=edit_block&filename='.Security::safeName(Request::post('name')));
}
// Save block
File::setContent($blocks_path.Security::safeName(Request::post('name')).'.block.html', XML::safe(Request::post('editor')));
Notification::set('success', __('Your changes to the block <i>:name</i> have been saved.', 'blocks', array(':name' => Security::safeName(Request::post('name')))));
if (Request::post('add_blocks_and_exit')) {
Request::redirect('index.php?id=blocks');
} else {
Request::redirect('index.php?id=blocks&action=edit_block&filename='.Security::safeName(Request::post('name')));
}
}
} else { die('csrf detected!'); }
}
// Save fields
if (Request::post('name')) $name = Request::post('name'); else $name = '';
if (Request::post('editor')) $content = Request::post('editor'); else $content = '';
// Display view
View::factory('box/blocks/views/backend/add')
->assign('content', $content)
->assign('name', $name)
->assign('errors', $errors)
->display();
break;
} else { die('csrf detected!'); }
}
// Edit block
// -------------------------------------
case "edit_block":
// Save current block action
if (Request::post('edit_blocks') || Request::post('edit_blocks_and_exit') ) {
// Save fields
if (Request::post('name')) $name = Request::post('name'); else $name = '';
if (Request::post('editor')) $content = Request::post('editor'); else $content = '';
if (Security::check(Request::post('csrf'))) {
// Display view
View::factory('box/blocks/views/backend/add')
->assign('content', $content)
->assign('name', $name)
->assign('errors', $errors)
->display();
break;
if (trim(Request::post('name')) == '') $errors['blocks_empty_name'] = __('Required field', 'blocks');
if ((file_exists($blocks_path.Security::safeName(Request::post('name')).'.block.html')) and (Security::safeName(Request::post('blocks_old_name')) !== Security::safeName(Request::post('name')))) $errors['blocks_exists'] = __('This block already exists', 'blocks');
// Edit block
// -------------------------------------
case "edit_block":
// Save current block action
if (Request::post('edit_blocks') || Request::post('edit_blocks_and_exit') ) {
// Save fields
if (Request::post('editor')) $content = Request::post('editor'); else $content = '';
if (count($errors) == 0) {
if (Security::check(Request::post('csrf'))) {
$block_old_filename = $blocks_path.Request::post('blocks_old_name').'.block.html';
$block_new_filename = $blocks_path.Security::safeName(Request::post('name')).'.block.html';
if ( ! empty($block_old_filename)) {
if ($block_old_filename !== $block_new_filename) {
rename($block_old_filename, $block_new_filename);
$save_filename = $block_new_filename;
} else {
$save_filename = $block_new_filename;
}
if (trim(Request::post('name')) == '') $errors['blocks_empty_name'] = __('Required field', 'blocks');
if ((file_exists($blocks_path.Security::safeName(Request::post('name')).'.block.html')) and (Security::safeName(Request::post('blocks_old_name')) !== Security::safeName(Request::post('name')))) $errors['blocks_exists'] = __('This block already exists', 'blocks');
// Save fields
if (Request::post('editor')) $content = Request::post('editor'); else $content = '';
if (count($errors) == 0) {
$block_old_filename = $blocks_path.Request::post('blocks_old_name').'.block.html';
$block_new_filename = $blocks_path.Security::safeName(Request::post('name')).'.block.html';
if ( ! empty($block_old_filename)) {
if ($block_old_filename !== $block_new_filename) {
rename($block_old_filename, $block_new_filename);
$save_filename = $block_new_filename;
} else {
$save_filename = $block_new_filename;
}
// Save block
File::setContent($save_filename, XML::safe(Request::post('editor')));
Notification::set('success', __('Your changes to the block <i>:name</i> have been saved.', 'blocks', array(':name' => basename($save_filename, '.block.html'))));
if (Request::post('edit_blocks_and_exit')) {
Request::redirect('index.php?id=blocks');
} else {
Request::redirect('index.php?id=blocks&action=edit_block&filename='.Security::safeName(Request::post('name')));
}
} else {
$save_filename = $block_new_filename;
}
} else { die('csrf detected!'); }
}
if (Request::post('name')) $name = Request::post('name'); else $name = File::name(Request::get('filename'));
if (Request::post('editor')) $content = Request::post('editor'); else $content = File::getContent($blocks_path.Request::get('filename').'.block.html');
// Save block
File::setContent($save_filename, XML::safe(Request::post('editor')));
// Display view
View::factory('box/blocks/views/backend/edit')
->assign('content', Text::toHtml($content))
->assign('name', $name)
->assign('errors', $errors)
->display();
break;
case "delete_block":
Notification::set('success', __('Your changes to the block <i>:name</i> have been saved.', 'blocks', array(':name' => basename($save_filename, '.block.html'))));
if (Security::check(Request::get('token'))) {
if (Request::post('edit_blocks_and_exit')) {
Request::redirect('index.php?id=blocks');
} else {
Request::redirect('index.php?id=blocks&action=edit_block&filename='.Security::safeName(Request::post('name')));
}
}
File::delete($blocks_path.Request::get('filename').'.block.html');
Notification::set('success', __('Block <i>:name</i> deleted', 'blocks', array(':name' => File::name(Request::get('filename')))));
Request::redirect('index.php?id=blocks');
} else { die('csrf detected!'); }
}
if (Request::post('name')) $name = Request::post('name'); else $name = File::name(Request::get('filename'));
if (Request::post('editor')) $content = Request::post('editor'); else $content = File::getContent($blocks_path.Request::get('filename').'.block.html');
} else { die('csrf detected!'); }
break;
}
} else {
// Display view
View::factory('box/blocks/views/backend/edit')
->assign('content', Text::toHtml($content))
->assign('name', $name)
->assign('errors', $errors)
->display();
break;
case "delete_block":
if (Security::check(Request::get('token'))) {
// Get blocks
$blocks_list = File::scan($blocks_path, '.block.html');
File::delete($blocks_path.Request::get('filename').'.block.html');
Notification::set('success', __('Block <i>:name</i> deleted', 'blocks', array(':name' => File::name(Request::get('filename')))));
Request::redirect('index.php?id=blocks');
// Display view
View::factory('box/blocks/views/backend/index')
->assign('blocks_list', $blocks_list)
->display();
} else { die('csrf detected!'); }
break;
}
} else {
// Get blocks
$blocks_list = File::scan($blocks_path, '.block.html');
// Display view
View::factory('box/blocks/views/backend/index')
->assign('blocks_list', $blocks_list)
->display();
}
}
}
}

View File

@@ -1,118 +1,115 @@
<?php
/**
* Blocks plugin
*
* @package Monstra
* @subpackage Plugins
* @author Romanenko Sergey / Awilum
* @copyright 2012 Romanenko Sergey / Awilum
* @version 1.0.0
*
*/
// Register plugin
Plugin::register( __FILE__,
__('Blocks', 'blocks'),
__('Blocks manager plugin', 'blocks'),
'1.0.0',
'Awilum',
'http://monstra.org/',
null,
'box');
if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin', 'editor'))) {
// Include Admin
Plugin::admin('blocks', 'box');
}
// Add Plugin Javascript
Javascript::add('plugins/box/blocks/js/blocks.js', 'backend');
// 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
{
/**
* Blocks plugin
*
* @package Monstra
* @subpackage Plugins
* @author Romanenko Sergey / Awilum
* @copyright 2012 Romanenko Sergey / Awilum
* @version 1.0.0
* Inline Blocks
*
* @var array
*/
public static $inline_blocks = array();
// Register plugin
Plugin::register( __FILE__,
__('Blocks', 'blocks'),
__('Blocks manager plugin', 'blocks'),
'1.0.0',
'Awilum',
'http://monstra.org/',
null,
'box');
if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin', 'editor'))) {
// Include Admin
Plugin::admin('blocks', 'box');
/**
* 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,
);
}
}
// Add Plugin Javascript
Javascript::add('plugins/box/blocks/js/blocks.js', 'backend');
// 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
* Draw Inline Block
*/
class 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 '';
}
}
/**
* Inline Blocks
*
* @var array
*/
public static $inline_blocks = array();
/**
* Get block
*
* @param string $name Block file name
*/
public static function get($name)
{
return Block::_content(array('get' => $name));
}
/**
* Returns block content for shortcode {block get="blockname"}
*
* @param array $attributes block filename
*/
public static function _content($attributes)
{
if (isset($attributes['get'])) $name = (string) $attributes['get']; else $name = '';
/**
* 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,
);
$block_path = STORAGE . DS . 'blocks' . DS . $name . '.block.html';
if (File::exists($block_path)) {
ob_start();
include $block_path;
$block_contents = ob_get_contents();
ob_end_clean();
return Filter::apply('content', Text::toHtml($block_contents));
} else {
if (Session::exists('admin') && Session::get('admin') == true) {
return __('<b>Block <u>:name</u> is not found!</b>', 'blocks', array(':name' => $name));
}
}
/**
* 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
*
* @param string $name Block file name
*/
public static function get($name) {
return Block::_content(array('get' => $name));
}
/**
* Returns block content for shortcode {block get="blockname"}
*
* @param array $attributes block filename
*/
public static function _content($attributes) {
if (isset($attributes['get'])) $name = (string)$attributes['get']; else $name = '';
$block_path = STORAGE . DS . 'blocks' . DS . $name . '.block.html';
if (File::exists($block_path)) {
ob_start();
include $block_path;
$block_contents = ob_get_contents();
ob_end_clean();
return Filter::apply('content', Text::toHtml($block_contents));
} else {
if (Session::exists('admin') && Session::get('admin') == true) {
return __('<b>Block <u>:name</u> is not found!</b>', 'blocks', array(':name' => $name));
}
}
}
}
}
}

View File

@@ -8,4 +8,4 @@
<plugin_version>1.0.0</plugin_version>
<plugin_author>Awilum</plugin_author>
<plugin_author_uri>http://monstra.org/</plugin_author_uri>
</root>
</root>

View File

@@ -1,29 +1,29 @@
<?php
return array(
'blocks' => array(
'Blocks' => 'Blöcke',
'Blocks manager' => 'Block-Manager',
'Delete' => 'Löschen',
'Edit' => 'Bearbeiten',
'Name' => 'Name',
'Create new block' => 'Erstelle einen neuen Block',
'New block' => 'Neuer Block',
'Edit block' => 'Bearbeite Block',
'Save' => 'Save',
'Save and exit' => 'Speichern und Schließen',
'Actions' => 'Aktionen',
'Required field' => 'Erforderliches Feld',
'This block already exists' => 'Dieser Block existiert bereits',
'This block does not exist' => 'Dieser Block existiert nicht',
'Delete block: :block' => 'Lösche Block: :block',
'Block content' => 'Block-Inhalt',
'Block <i>:name</i> deleted' => 'Block <i>:name</i> gelöscht',
'Your changes to the block <i>:name</i> have been saved.' => 'Deine Änderungen für den Block <i>:name</i> wurden übernommen.',
'Delete block: :block' => 'Lösche Block: :block',
'View Embed Code' => 'View Embed Code',
'Embed Code' => 'Embed Code',
'Shortcode' => 'Shortcode',
'PHP Code' => 'PHP Code',
)
);
<?php
return array(
'blocks' => array(
'Blocks' => 'Blöcke',
'Blocks manager' => 'Block-Manager',
'Delete' => 'Löschen',
'Edit' => 'Bearbeiten',
'Name' => 'Name',
'Create new block' => 'Erstelle einen neuen Block',
'New block' => 'Neuer Block',
'Edit block' => 'Bearbeite Block',
'Save' => 'Save',
'Save and exit' => 'Speichern und Schließen',
'Actions' => 'Aktionen',
'Required field' => 'Erforderliches Feld',
'This block already exists' => 'Dieser Block existiert bereits',
'This block does not exist' => 'Dieser Block existiert nicht',
'Delete block: :block' => 'Lösche Block: :block',
'Block content' => 'Block-Inhalt',
'Block <i>:name</i> deleted' => 'Block <i>:name</i> gelöscht',
'Your changes to the block <i>:name</i> have been saved.' => 'Deine Änderungen für den Block <i>:name</i> wurden übernommen.',
'Delete block: :block' => 'Lösche Block: :block',
'View Embed Code' => 'View Embed Code',
'Embed Code' => 'Embed Code',
'Shortcode' => 'Shortcode',
'PHP Code' => 'PHP Code',
)
);

View File

@@ -3,16 +3,16 @@
return array(
'blocks' => array(
'Blocks' => 'Blocks',
'Blocks manager' => 'Blocks manager',
'Blocks manager' => 'Blocks manager',
'Delete' => 'Delete',
'Edit' => 'Edit',
'Name' => 'Name',
'Create new block' => 'Create new block',
'New block' => 'New block',
'Edit block' => 'Edit block',
'Save' => 'Save',
'Save and exit' => 'Save and exit',
'Actions' => 'Actions',
'Edit block' => 'Edit block',
'Save' => 'Save',
'Save and exit' => 'Save and exit',
'Actions' => 'Actions',
'Required field' => 'Required field',
'This block already exists' => 'This block already exists',
'This block does not exist' => 'This block does not exist',
@@ -22,8 +22,8 @@
'Your changes to the block <i>:name</i> have been saved.' => 'Your changes to the block <i>:name</i> have been saved.',
'Delete block: :block' => 'Delete block: :block',
'View Embed Code' => 'View Embed Code',
'Embed Code' => 'Embed Code',
'Embed Code' => 'Embed Code',
'Shortcode' => 'Shortcode',
'PHP Code' => 'PHP Code',
)
);
);

View File

@@ -3,16 +3,16 @@
return array(
'blocks' => array(
'Blocks' => 'Blocchi',
'Blocks manager' => 'Gestione blocchi',
'Blocks manager' => 'Gestione blocchi',
'Delete' => 'Elimina',
'Edit' => 'Modifica',
'New block' => 'Nuovo blocco',
'Create new block' => 'Crea nuovo blocco',
'New block' => 'Nuovo blocco',
'Create new block' => 'Crea nuovo blocco',
'Name' => 'Nome',
'Edit block' => 'Modifica blocco',
'Save' => 'Salva',
'Save' => 'Salva',
'Actions' => 'Azioni',
'Save and exit' => 'Salva ed esci',
'Save and exit' => 'Salva ed esci',
'Required field' => 'Campo obbligatorio',
'This block already exists' => 'Tale blocco già esistente',
'This block does not exist' => 'Tale blocco non esiste',
@@ -22,8 +22,8 @@
'Your changes to the block <i>:name</i> have been saved.' => 'Le modifiche al blocco: <i>nome</ i> sono state salvate.',
'Delete block: :block' => 'Elimina blocco: :block',
'View Embed Code' => 'View Embed Code',
'Embed Code' => 'Embed Code',
'Embed Code' => 'Embed Code',
'Shortcode' => 'Shortcode',
'PHP Code' => 'PHP Code',
)
);
);

View File

@@ -12,7 +12,7 @@
'Edit block' => 'Redaguoti bloką',
'Save' => 'Išsaugoti',
'Save and exit' => 'Išsaugoti ir išeiti',
'Actions' => 'Veiksmai',
'Actions' => 'Veiksmai',
'Required field' => 'Privalomas laukas',
'This block already exists' => 'Toks blokas jau yra',
'This block does not exist' => 'Tokio bloko nėra',
@@ -22,8 +22,8 @@
'Your changes to the block <i>:name</i> have been saved.' => 'Bloko <i>:name</i> pakeitimai išsaugoti.',
'Delete block: :block' => 'Delete block: :block',
'View Embed Code' => 'View Embed Code',
'Embed Code' => 'Embed Code',
'Embed Code' => 'Embed Code',
'Shortcode' => 'Shortcode',
'PHP Code' => 'PHP Code',
)
);
);

View File

@@ -9,7 +9,7 @@
'Name' => 'Nome',
'Create new block' => 'Criar novo bloco',
'New block' => 'Novo bloco',
'Edit block' => 'Editar bloco',
'Edit block' => 'Editar bloco',
'Save' => 'Salvar',
'Save and exit' => 'Salvar e sair',
'Actions' => 'Ações',
@@ -22,8 +22,8 @@
'Your changes to the block <i>:name</i> have been saved.' => 'Suas mudanças no bloco <i>:name</i> foram salvas',
'Delete block: :block' => 'Delete block: :block',
'View Embed Code' => 'View Embed Code',
'Embed Code' => 'Embed Code',
'Embed Code' => 'Embed Code',
'Shortcode' => 'Shortcode',
'PHP Code' => 'PHP Code',
)
);
);

View File

@@ -3,16 +3,16 @@
return array(
'blocks' => array(
'Blocks' => 'Блоки',
'Blocks manager' => 'Менеджер блоков',
'Blocks manager' => 'Менеджер блоков',
'Delete' => 'Удалить',
'Edit' => 'Редактировать',
'New block' => 'Новый блок',
'Create new block' => 'Создать новый блок',
'New block' => 'Новый блок',
'Create new block' => 'Создать новый блок',
'Name' => 'Название',
'Edit block' => 'Редактирование блока',
'Save' => 'Сохранить',
'Save' => 'Сохранить',
'Actions' => 'Действия',
'Save and exit' => 'Сохранить и выйти',
'Save and exit' => 'Сохранить и выйти',
'Required field' => 'Обязательное поле',
'This block already exists' => 'Такой блок уже существует',
'This block does not exist' => 'Такого блока не существует',
@@ -22,8 +22,8 @@
'Your changes to the block <i>:name</i> have been saved.' => 'Ваши изменения к блоку <i>:name</i> были сохранены.',
'Delete block: :block' => 'Удалить блок: :block',
'View Embed Code' => 'Код для вставки',
'Embed Code' => 'Код для вставки',
'Embed Code' => 'Код для вставки',
'Shortcode' => 'Шорткод',
'PHP Code' => 'PHP код',
)
);
);

View File

@@ -3,16 +3,16 @@
return array(
'blocks' => array(
'Blocks' => 'Блоки',
'Blocks manager' => 'Менеджер блоків',
'Blocks manager' => 'Менеджер блоків',
'Delete' => 'Видалити',
'Edit' => 'Редагувати',
'New block' => 'Новий блок',
'Create new block' => 'Створити новий блок',
'New block' => 'Новий блок',
'Create new block' => 'Створити новий блок',
'Name' => 'Назва',
'Edit block' => 'Редагування блоку',
'Save' => 'Зберегти',
'Save' => 'Зберегти',
'Actions' => 'Дії',
'Save and exit' => 'Зберегти та вийти',
'Save and exit' => 'Зберегти та вийти',
'Required field' => 'Обов&prime;язкове поле',
'This block already exists' => 'Такий блок вже існує',
'This block does not exist' => 'Такого блоку не існує',
@@ -22,8 +22,8 @@
'Your changes to the block <i>:name</i> have been saved.' => 'Ваші зміни до блоку <i>:name</i> були збережені.',
'Delete block: :block' => 'Видалити блок: :block',
'View Embed Code' => 'Код для вставки',
'Embed Code' => 'Код для вставки',
'Embed Code' => 'Код для вставки',
'Shortcode' => 'Шорткод',
'PHP Code' => 'PHP код',
)
);
);

View File

@@ -5,12 +5,10 @@
<?php if (isset($errors['blocks_empty_name']) or isset($errors['blocks_exists'])) $error_class = 'error'; else $error_class = ''; ?>
<?php echo (Form::open()); ?>
<?php echo (Form::hidden('csrf', Security::token())); ?>
<?php echo (Form::label('name', __('Name', 'blocks'))); ?>
<?php echo (Form::input('name', $name, array('class' => (isset($errors['blocks_empty_name']) || isset($errors['blocks_exists'])) ? 'input-xxlarge error-field' : 'input-xxlarge'))); ?>
@@ -33,4 +31,3 @@
);
?>

View File

@@ -16,7 +16,6 @@
?>
<?php echo (Form::label('name', __('Name', 'blocks'))); ?>
<?php echo (Form::input('name', $name, array('class' => (isset($errors['blocks_empty_name']) || isset($errors['blocks_exists'])) ? 'input-xxlarge error-field' : 'input-xxlarge'))); ?>
@@ -28,7 +27,7 @@
<br /><br />
<?php
Action::run('admin_editor', array(Html::toText($content)));
echo (
@@ -37,8 +36,8 @@
Form::submit('edit_blocks', __('Save', 'blocks'), array('class' => 'btn default')). Html::nbsp().
Form::close()
);
} else {
echo '<div class="message-error">'.__('This block does not exist', 'blocks').'</div>';
}
?>
?>

View File

@@ -4,9 +4,9 @@
<?php if(Notification::get('success')) Alert::success(Notification::get('success')); ?>
<?php
echo (
echo (
Html::anchor(__('Create New Block', 'blocks'), 'index.php?id=blocks&action=add_block', array('title' => __('Create new block', 'blocks'), 'class' => 'btn default btn-small')). Html::nbsp(3)
);
);
?>
<br /><br />
@@ -31,7 +31,7 @@
<a class="btn dropdown-toggle btn-actions btn-small" data-toggle="dropdown" href="#" style="font-family:arial;"><span class="caret"></span></a>
<ul class="dropdown-menu">
<li><?php echo Html::anchor(__('View Embed Code', 'blocks'), 'javascript:;', array('title' => __('View Embed Code', 'blocks'), 'onclick' => '$.monstra.blocks.showEmbedCodes("'.basename($block, '.block.html').'");')); ?></li>
</ul>
</ul>
<?php echo Html::anchor(__('Delete', 'blocks'),
'index.php?id=blocks&action=delete_block&filename='.basename($block, '.block.html').'&token='.Security::token(),
array('class' => 'btn btn-actions btn-small btn-actions-default', 'onclick' => "return confirmDelete('".__('Delete block: :block', 'blocks', array(':block' => basename($block, '.block.html')))."')"));
@@ -60,4 +60,4 @@
<code id="phpcode"></code>
</p>
</div>
</div>
</div>