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

@@ -3,7 +3,7 @@
<?php if (Notification::get('success')) Alert::success(Notification::get('success')); ?>
<?php
<?php
echo (
Form::open().
Form::hidden('csrf', Security::token())
@@ -15,7 +15,7 @@
<li <?php if (Notification::get('metadata')) { ?>class="active"<?php } ?>><a href="#metadata" data-toggle="tab"><?php echo __('Metadata', 'pages'); ?></a></li>
<li <?php if (Notification::get('settings')) { ?>class="active"<?php } ?>><a href="#settings" data-toggle="tab"><?php echo __('Settings', 'pages'); ?></a></li>
</ul>
<div class="tab-content tab-page">
<div class="tab-pane <?php if (Notification::get('page')) { ?>active<?php } ?>" id="page">
<?php
@@ -25,16 +25,16 @@
);
if (isset($errors['pages_empty_title'])) echo Html::nbsp(3).'<span style="color:red">'.$errors['pages_empty_title'].'</span>';
echo (
echo (
Html::br(2).
Form::label('page_name', __('Name (slug)', 'pages')).
Form::label('page_name', __('Name (slug)', 'pages')).
Form::input('page_name', $post_name, array('class' => (isset($errors['pages_empty_name'])) ? 'input-xxlarge error-field' : 'input-xxlarge'))
);
if (isset($errors['pages_exists'])) echo Html::nbsp(3).'<span style="color:red">'.$errors['pages_exists'].'</span>';
if (isset($errors['pages_empty_name'])) echo Html::nbsp(3).'<span style="color:red">'.$errors['pages_empty_name'].'</span>';
?>
</div>
<div class="tab-pane <?php if (Notification::get('metadata')) { ?>active<?php } ?>" id="metadata">
<?php
@@ -43,14 +43,14 @@
Form::input('page_keywords', $post_keywords, array('class' => 'input-xxlarge')).
Html::br(2).
Form::label('page_description', __('Description', 'pages')).
Form::textarea('page_description', $post_description, array('class' => 'input-xxlarge'))
Form::textarea('page_description', $post_description, array('class' => 'input-xxlarge'))
);
?>
<?php
echo (
Html::br(2).
Form::label('robots', __('Search Engines Robots', 'pages')).
<?php
echo (
Html::br(2).
Form::label('robots', __('Search Engines Robots', 'pages')).
'no Index'.Html::nbsp().Form::checkbox('robots_index', 'index', $post_robots_index).Html::nbsp(2).
'no Follow'.Html::nbsp().Form::checkbox('robots_follow', 'follow', $post_robots_follow)
);
@@ -59,34 +59,34 @@
<div class="tab-pane <?php if (Notification::get('settings')) { ?>active<?php } ?>" id="settings">
<div class="row-fluid">
<div class="span3">
<?php
<?php
echo (
Form::label('pages', __('Parent', 'pages')).
Form::select('pages', $pages_array, $parent_page)
Form::select('pages', $pages_array, $parent_page)
);
?>
</div>
</div>
<div class="span3">
<?php
echo (
Form::label('templates', __('Template', 'pages')).
Form::select('templates', $templates_array, $post_template)
);
?>
</div>
<div class="span3">
<?php
echo (
Form::label('status', __('Status', 'pages')).
Form::select('status', $status_array, $post_status)
);
?>
</div>
<div class="span3">
<?php
<?php
echo (
Form::label('status', __('Status', 'pages')).
Form::select('status', $status_array, $post_status)
);
?>
</div>
<div class="span3">
<?php
echo (
Form::label('access', __('Access', 'pages')).
Form::select('access', $access_array, $post_access)
Form::select('access', $access_array, $post_access)
);
?>
</div>

View File

@@ -3,7 +3,7 @@
<?php if (Notification::get('success')) Alert::success(Notification::get('success')); ?>
<?php
<?php
echo (
Form::open().
Form::hidden('csrf', Security::token()).
@@ -18,7 +18,7 @@
<li <?php if (Notification::get('metadata')) { ?>class="active"<?php } ?>><a href="#metadata" data-toggle="tab"><?php echo __('Metadata', 'pages'); ?></a></li>
<li <?php if (Notification::get('settings')) { ?>class="active"<?php } ?>><a href="#settings" data-toggle="tab"><?php echo __('Settings', 'pages'); ?></a></li>
</ul>
<div class="tab-content tab-page">
<div class="tab-pane <?php if (Notification::get('page')) { ?>active<?php } ?>" id="page">
<?php
@@ -30,7 +30,7 @@
if (Request::get('name') !== 'error404') {
echo (
Html::br(2).
Html::br(2).
Form::label('page_name', __('Name (slug)', 'pages'))
);
}
@@ -49,19 +49,18 @@
</div>
<div class="tab-pane <?php if (Notification::get('metadata')) { ?>active<?php } ?>" id="metadata">
<?php
echo (
Form::label('page_keywords', __('Keywords', 'pages')).
Form::input('page_keywords', $keywords_to_edit, array('class' => 'input-xxlarge')).
Html::br(2).
Form::label('page_description', __('Description', 'pages')).
Form::textarea('page_description', $description_to_edit, array('class' => 'input-xxlarge'))
Form::textarea('page_description', $description_to_edit, array('class' => 'input-xxlarge'))
);
echo (
Html::br(2).
Form::label('robots', __('Search Engines Robots', 'pages')).
echo (
Html::br(2).
Form::label('robots', __('Search Engines Robots', 'pages')).
'no Index'.Html::nbsp().Form::checkbox('robots_index', 'index', $post_robots_index).Html::nbsp(2).
'no Follow'.Html::nbsp().Form::checkbox('robots_follow', 'follow', $post_robots_follow)
);
@@ -75,7 +74,7 @@
} else {
?>
<div class="span3">
<?php
<?php
echo (
Form::label('pages', __('Parent', 'pages')).
Form::select('pages', $pages_array, $parent_page)
@@ -92,16 +91,16 @@
echo (
Form::label('templates', __('Template', 'pages')).
Form::select('templates', $templates_array, $template)
);
);
?>
</div>
<?php
<?php
if (Request::get('name') == 'error404') {
echo Form::hidden('status', $status);
} else {
?>
<div class="span3">
<?php
<?php
echo (
Form::label('status', __('Status', 'pages')).
Form::select('status', $status_array, $status)
@@ -109,13 +108,13 @@
?>
</div>
<?php } ?>
<?php
<?php
if (Request::get('name') == 'error404') {
echo Form::hidden('access', $access);
} else {
?>
<div class="span3">
<?php
<?php
echo (
Form::label('access', __('Access', 'pages')).
Form::select('access', $access_array, $access)
@@ -127,7 +126,6 @@
</div>
</div>
<br /><br />
<?php Action::run('admin_editor', array(Html::toText($to_edit))); ?>

View File

@@ -4,10 +4,10 @@
<?php if (Notification::get('success')) Alert::success(Notification::get('success')); ?>
<?php
echo (
echo (
Html::anchor(__('Create New Page', 'pages'), 'index.php?id=pages&action=add_page', array('title' => __('Create New Page', 'pages'), 'class' => 'btn btn-small')). Html::nbsp(3).
Html::anchor(__('Edit 404 Page', 'pages'), 'index.php?id=pages&action=edit_page&name=error404', array('title' => __('Create New Page', 'pages'), 'class' => 'btn btn-small'))
);
Html::anchor(__('Edit 404 Page', 'pages'), 'index.php?id=pages&action=edit_page&name=error404', array('title' => __('Create New Page', 'pages'), 'class' => 'btn btn-small'))
);
?>
<br /><br />
@@ -26,33 +26,33 @@
</thead>
<tbody>
<?php
if (count($pages) != 0) {
if (count($pages) != 0) {
foreach ($pages as $page) {
if ($page['parent'] != '') { $dash = Html::arrow('right').'&nbsp;&nbsp;'; } else { $dash = ""; }
?>
<?php if ($page['slug'] != 'error404') { ?>
<?php
$expand = PagesAdmin::$pages->select('[slug="'.(string)$page['parent'].'"]', null);
$expand = PagesAdmin::$pages->select('[slug="'.(string) $page['parent'].'"]', null);
if ($page['parent'] !== '' && isset($expand['expand']) && $expand['expand'] == '1') { $visibility = 'style="display:none;"'; } else { $visibility = ''; }
?>
<tr <?php echo $visibility; ?> <?php if(trim($page['parent']) !== '') {?> rel="children_<?php echo $page['parent']; ?>" <?php } ?>>
<td>
<?php
if (count(PagesAdmin::$pages->select('[parent="'.(string)$page['slug'].'"]', 'all')) > 0) {
<tr <?php echo $visibility; ?> <?php if (trim($page['parent']) !== '') {?> rel="children_<?php echo $page['parent']; ?>" <?php } ?>>
<td>
<?php
if (count(PagesAdmin::$pages->select('[parent="'.(string) $page['slug'].'"]', 'all')) > 0) {
if (isset($page['expand']) && $page['expand'] == '1') {
echo '<a href="javascript:;" class="btn-expand parent" token="'.Security::token().'" rel="'.$page['slug'].'">+</a>';
} else {
echo '<a href="javascript:;" class="btn-expand parent" token="'.Security::token().'" rel="'.$page['slug'].'">-</a>';
}
}
?>
</td>
?>
</td>
<td>
<?php
$_parent = (trim($page['parent']) == '') ? '' : $page['parent'];
$parent = (trim($page['parent']) == '') ? '' : $page['parent'].'/';
echo (trim($page['parent']) == '') ? '' : '&nbsp;';
echo $dash.Html::anchor(Html::toText($page['title']), $site_url.$parent.$page['slug'], array('target' => '_blank', 'rel' => 'children_'.$_parent));
echo $dash.Html::anchor(Html::toText($page['title']), $site_url.$parent.$page['slug'], array('target' => '_blank', 'rel' => 'children_'.$_parent));
?>
</td>
<td class="hidden-phone">
@@ -67,7 +67,7 @@
<td class="hidden-phone">
<?php echo Date::format($page['date'], "j.n.Y"); ?>
</td>
<td>
<td>
<div class="pull-right">
<div class="btn-group">
<?php echo Html::anchor(__('Edit', 'pages'), 'index.php?id=pages&action=edit_page&name='.$page['slug'], array('class' => 'btn btn-small')); ?>
@@ -77,19 +77,19 @@
<li><a href="index.php?id=pages&action=add_page&parent_page=<?php echo $page['slug']; ?>" title="<?php echo __('Create New Page', 'pages'); ?>"><?php echo __('Add', 'pages'); ?></a></li>
<?php } ?>
<li><?php echo Html::anchor(__('Clone', 'pages'), 'index.php?id=pages&action=clone_page&name='.$page['slug'].'&token='.Security::token(), array('title' => __('Clone', 'pages'))); ?></li>
</ul>
</ul>
<?php echo Html::anchor(__('Delete', 'pages'),
'index.php?id=pages&action=delete_page&name='.$page['slug'].'&token='.Security::token(),
array('class' => 'btn btn-actions btn-small btn-actions-default', 'onclick' => "return confirmDelete('".__("Delete page: :page", 'pages', array(':page' => Html::toText($page['title'])))."')"));
?>
</div>
</div>
</div>
</div>
</td>
</tr>
</tr>
<?php } ?>
<?php
}
}
}
?>
</tbody>