bludit/bl-kernel/admin/views/blocks.php

60 lines
1.5 KiB
PHP
Raw Normal View History

2018-12-12 18:18:48 +01:00
<?php defined('BLUDIT') or die('Bludit CMS.'); ?>
<?php echo Bootstrap::formOpen(array('id'=>'jsform', 'class'=>'tab-content')); ?>
<div class="align-middle">
<div class="float-right mt-1">
<button type="submit" class="btn btn-primary btn-sm" name="save"><?php $L->p('Save') ?></button>
<a class="btn btn-secondary btn-sm" href="<?php echo HTML_PATH_ADMIN_ROOT.'themes' ?>" role="button"><?php $L->p('Cancel') ?></a>
</div>
<?php echo Bootstrap::pageTitle(array('title'=>$L->g('Blocks'), 'icon'=>'box')); ?>
</div>
<?php
// Token CSRF
echo Bootstrap::formInputHidden(array(
'name'=>'tokenCSRF',
'value'=>$security->getTokenCSRF()
));
2018-12-17 22:13:15 +01:00
foreach ($blocks->getAll() as $block) {
echo Bootstrap::formTitle(array('title'=>$block->title()));
if (Text::isNotEmpty( $block->description() )) {
echo Bootstrap::alert(array('class'=>'alert-primary', 'text'=>$block->description()));
}
2018-12-12 18:18:48 +01:00
echo Bootstrap::formInputText(array(
'name'=>'key[]',
'label'=>$L->g('Key'),
2018-12-17 22:13:15 +01:00
'value'=>$block->key(),
2018-12-12 18:18:48 +01:00
'class'=>'',
'placeholder'=>'',
'tip'=>'',
'readonly'=>true
));
echo Bootstrap::formInputText(array(
'name'=>'title[]',
'label'=>$L->g('title'),
2018-12-17 22:13:15 +01:00
'value'=>$block->title(),
2018-12-12 18:18:48 +01:00
'class'=>'',
'placeholder'=>'',
'tip'=>''
));
echo Bootstrap::formTextarea(array(
'name'=>'value[]',
'label'=>$L->g('Value'),
2018-12-17 22:13:15 +01:00
'value'=>$block->value(),
2018-12-12 18:18:48 +01:00
'class'=>'',
'placeholder'=>'',
'tip'=>'',
'rows'=>5
));
}
echo Bootstrap::formClose();
?>