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

Add Monstra from HG Commit 683dcb70c4cc

This commit is contained in:
Awilum
2012-09-25 19:09:50 +03:00
parent d2db42b2bb
commit 4a5fea5f5b
251 changed files with 35026 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<h2><?php echo __('New snippet', 'snippets'); ?></h2>
<br />
<?php if (Notification::get('success')) Alert::success(Notification::get('success')); ?>
<?php if (isset($errors['snippets_empty_name']) or isset($errors['snippets_exists'])) $error_class = 'error'; else $error_class = ''; ?>
<?php echo (Form::open(null, array('class' => 'form-horizontal'))); ?>
<?php echo (Form::hidden('csrf', Security::token())); ?>
<?php echo (Form::label('name', __('Name', 'snippets'))); ?>
<div class="input-append">
<?php echo (Form::input('name', $name, array('class' => 'input-xlarge'))); ?><span class="add-on">.snippet.php</span>
</div>
<?php
if (isset($errors['snippets_empty_name'])) echo '&nbsp;&nbsp;&nbsp;<span style="color:red">'.$errors['snippets_empty_name'].'</span>';
if (isset($errors['snippets_exists'])) echo '&nbsp;&nbsp;&nbsp;<span style="color:red">'.$errors['snippets_exists'].'</span>';
?>
<?php
echo (
Html::br(2).
Form::label('content', __('Snippet content', 'snippets')).
Form::textarea('content', $content, array('style' => 'width:100%;height:400px;', 'class'=>'source-editor')).
Html::br(2).
Form::submit('add_snippets_and_exit', __('Save and exit', 'snippets'), array('class' => 'btn')).Html::nbsp(2).
Form::submit('add_snippets', __('Save', 'snippets'), array('class' => 'btn')).
Form::close()
);
?>

View File

@@ -0,0 +1,46 @@
<h2><?php echo __('Edit snippet', 'snippets'); ?></h2>
<br />
<?php if (Notification::get('success')) Alert::success(Notification::get('success')); ?>
<?php
if ($content !== null) {
if (isset($errors['snippets_empty_name']) or isset($errors['snippets_exists'])) $error_class = 'error'; else $error_class = '';
echo (Form::open(null, array('class' => 'form-horizontal')));
echo (Form::hidden('csrf', Security::token()));
echo (Form::hidden('snippets_old_name', Request::get('filename')));
?>
<?php echo (Form::label('name', __('Name', 'snippets'))); ?>
<div class="input-append">
<?php echo (Form::input('name', $name, array('class' => 'input-xlarge'))); ?><span class="add-on">.snippet.php</span>
</div>
<?php
if (isset($errors['snippets_empty_name'])) echo '&nbsp;&nbsp;&nbsp;<span style="color:red">'.$errors['snippets_empty_name'].'</span>';
if (isset($errors['snippets_exists'])) echo '&nbsp;&nbsp;&nbsp;<span style="color:red">'.$errors['snippets_exists'].'</span>';
?>
<?php
echo (
Html::br(2).
Form::label('content', __('Snippet content', 'snippets')).
Form::textarea('content', Html::toText($content), array('style' => 'width:100%;height:400px;', 'class' => 'source-editor')).
Html::br(2).
Form::submit('edit_snippets_and_exit', __('Save and exit', 'snippets'), array('class' => 'btn default')).Html::nbsp(2).
Form::submit('edit_snippets', __('Save', 'snippets'), array('class' => 'btn default')). Html::nbsp().
Form::close()
);
} else {
echo '<div class="message-error">'.__('This snippet does not exist').'</div>';
}
?>

View File

@@ -0,0 +1,34 @@
<h2><?php echo __('Snippets', 'snippets'); ?></h2>
<br />
<?php if(Notification::get('success')) Alert::success(Notification::get('success')); ?>
<?php
echo (
Html::anchor(__('Create new snippet', 'snippets'), 'index.php?id=snippets&action=add_snippet', array('title' => __('Create new snippet', 'snippets'), 'class' => 'btn default btn-small')). Html::nbsp(3)
);
?>
<br /><br />
<!-- Snippets_list -->
<table class="table table-bordered">
<thead>
<tr><td><?php echo __('Snippets', 'snippets'); ?></td><td width="30%"><?php echo __('Actions', 'snippets'); ?></td></tr>
</thead>
<tbody>
<?php if (count($snippets_list) != 0) foreach ($snippets_list as $snippet) { ?>
<tr>
<td><?php echo basename($snippet, '.snippet.php'); ?></td>
<td>
<?php echo Html::anchor(__('Edit', 'snippets'), 'index.php?id=snippets&action=edit_snippet&filename='.basename($snippet, '.snippet.php'), array('class' => 'btn btn-actions')); ?>
<?php echo Html::anchor(__('Delete', 'snippets'),
'index.php?id=snippets&action=delete_snippet&filename='.basename($snippet, '.snippet.php'),
array('class' => 'btn btn-actions', 'onclick' => "return confirmDelete('".__('Delete snippet: :snippet', 'snippets', array(':snippet' => basename($snippet, '.snippet.php')))."')"));
?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<!-- /Snippets_list -->