@@ -1,51 +1,79 @@
<?php $this->extend('/Common/admin_edit'); ?>
<?php echo $this->Form->create('Node', array('url' => array('controller' => 'attachments', 'action' => 'edit')));?>
<fieldset>
<div class="tabs">
<ul>
<li><a href="#node-basic"><span><?php echo __('Attachment'); ?></span></a></li>
<li><a href="#node-info"><span><?php echo __('Info'); ?></span></a></li>
<?php echo $this->Croogo->adminTabs(); ?>
<?php

$this->extend('/Common/admin_edit');

$this->Html
->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('Attachments'), array('plugin' => 'file_manager', 'controller' => 'attachments', 'action' => 'index'))
->addCrumb($this->data['Node']['title'], $this->here);

echo $this->Form->create('Node', array('url' => array('controller' => 'attachments', 'action' => 'edit')));

?>
<div class="row-fluid">
<div class="span8">

<ul class="nav nav-tabs">
<li><a href="#attachment-main" data-toggle="tab"><?php echo __('Attachment'); ?></a></li>
</ul>

<div id="node-basic">
<div class="thumbnail">
<?php
$fileType = explode('/', $this->data['Node']['mime_type']);
$fileType = $fileType['0'];
if ($fileType == 'image') {
echo $this->Image->resize('/uploads/' . $this->data['Node']['slug'], 200, 300);
} else {
echo $this->Html->image('/img/icons/' . $this->Filemanager->mimeTypeToImage($this->data['Node']['mime_type'])) . ' ' . $this->data['Node']['mime_type'];
}
?>
</div>
<div class="tab-content">

<div id="attachment-main" class="tab-pane">
<?php
echo $this->Form->input('id');
echo $this->Form->input('title');
echo $this->Form->input('excerpt', array('label' => __('Caption')));
//echo $this->Form->input('body', array('label' => __('Description')));
?>
</div>

<div id="node-info">
<?php
echo $this->Form->input('file_url', array('label' => __('File URL'), 'value' => Router::url($this->data['Node']['path'], true), 'readonly' => 'readonly'));
echo $this->Form->input('file_type', array('label' => __('Mime Type'), 'value' => $this->data['Node']['mime_type'], 'readonly' => 'readonly'));
$fileType = explode('/', $this->data['Node']['mime_type']);
$fileType = $fileType['0'];
if ($fileType == 'image') {
$imgUrl = $this->Image->resize('/uploads/'.$this->data['Node']['slug'], 200, 300, true, array('class' => 'img-polaroid'));
} else {
$imgUrl = $this->Html->image('/img/icons/' . $this->Filemanager->mimeTypeToImage($this->data['Node']['mime_type'])) . ' ' . $this->data['Node']['mime_type'];
}
echo $this->Html->link($imgUrl, $this->data['Node']['path'], array(
'class' => 'thickbox pull-right',
));
$this->Form->inputDefaults(array(
'class' => 'span6',
'label' => false,
));
echo $this->Form->input('title', array(
'placeholder' => __('Title'),
));
echo $this->Form->input('excerpt', array(
'placeholder' => __('Caption'),
));

echo $this->Form->input('file_url', array(
'placeholder' => __('File URL'),
'value' => Router::url($this->data['Node']['path'], true),
'readonly' => 'readonly')
);

echo $this->Form->input('file_type', array(
'placeholder' => __('Mime Type'),
'value' => $this->data['Node']['mime_type'],
'readonly' => 'readonly')
);

?>
</div>

<?php echo $this->Croogo->adminTabs(); ?>
</div>
<?php echo $this->Croogo->adminTabs(); ?>
</div>
</fieldset>

<div class="buttons">
<?php
echo $this->Form->end(__('Save'));
echo $this->Html->link(__('Cancel'), array(
'action' => 'index',
), array(
'class' => 'cancel',
));
?>
</div>
<div class="span4">
<?php
echo $this->Html->beginBox(__('Publishing')) .
$this->Form->button(__('Save')) .
$this->Html->link(
__('Cancel'),
array('action' => 'index'),
array('class' => 'cancel', 'button' => 'danger')
).
$this->Html->endBox();
?>
</div>
</div>
<?php echo $this->Form->end(); ?>
@@ -1,48 +1,70 @@
<?php $this->extend('/Common/admin_index'); ?>
<?php

$this->extend('/Common/admin_index');

<table cellpadding="0" cellspacing="0">
$this->Html
->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('Attachments'), $this->here);

?>
<table class="table table-striped">
<?php

$tableHeaders = $this->Html->tableHeaders(array(
$this->Paginator->sort('id'),
'&nbsp;',
$this->Paginator->sort('title'),
__('URL'),
__('Actions'),
));
echo $tableHeaders;

?>
<thead>
<?php echo $tableHeaders; ?>
</thead>
<?php

$rows = array();
foreach ($attachments as $attachment) {
$actions = $this->Html->link(__('Edit'), array(
'controller' => 'attachments',
'action' => 'edit',
$attachment['Node']['id'],
));
$actions .= ' ' . $this->Croogo->adminRowActions($attachment['Node']['id']);
$actions .= ' ' . $this->Form->postLink(__('Delete'), array(
'controller' => 'attachments',
'action' => 'delete',
$attachment['Node']['id'],
), null, __('Are you sure?'));
$actions = array();
$actions[] = $this->Croogo->adminRowActions($attachment['Node']['id']);
$actions[] = $this->Croogo->adminRowAction('',
array('controller' => 'attachments', 'action' => 'edit', $attachment['Node']['id']),
array('icon' => 'pencil', 'tooltip' => __('Edit this item'))
);
$actions[] = $this->Croogo->adminRowAction('',
array('controller' => 'attachments', 'action' => 'delete', $attachment['Node']['id']),
array('icon' => 'trash', 'tooltip' => __('Remove this item')),
__('Are you sure?'));

$mimeType = explode('/', $attachment['Node']['mime_type']);
$mimeType = $mimeType['0'];
if ($mimeType == 'image') {
$thumbnail = $this->Html->link($this->Image->resize('/uploads/' . $attachment['Node']['slug'], 100, 200), array('controller' => 'attachments', 'action' => 'edit', $attachment['Node']['id']), array('escape' => false));
$imgUrl = $this->Image->resize('/uploads/' . $attachment['Node']['slug'], 100, 200, true, array('class' => 'img-polaroid'));
$thumbnail = $this->Html->link($imgUrl, $attachment['Node']['path'],
array('escape' => false, 'class' => 'thickbox', 'title' => $attachment['Node']['title']));
} else {
$thumbnail = $this->Html->image('/img/icons/page_white.png') . ' ' . $attachment['Node']['mime_type'] . ' (' . $this->Filemanager->filename2ext($attachment['Node']['slug']) . ')';
}

$actions = $this->Html->div('item-actions', implode(' ', $actions));

$rows[] = array(
$attachment['Node']['id'],
$thumbnail,
$attachment['Node']['title'],
$this->Html->link($this->Text->truncate($this->Html->url($attachment['Node']['path'], true), 20), $attachment['Node']['path']),
$this->Html->link(
$this->Html->url($attachment['Node']['path'], true),
$attachment['Node']['path'],
array(
'target' => '_blank',
)
),
$actions,
);
}

echo $this->Html->tableCells($rows);
echo $tableHeaders;

?>
</table>
@@ -1,69 +1,107 @@
<?php $this->extend('/Common/admin_index'); ?>
<?php

$this->extend('/Common/admin_index');

$this->Html
->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('File Manager'), $this->here);

?>

<?php $this->start('tabs'); ?>
<li><?php echo $this->FileManager->link(__('Upload here'), array('controller' => 'file_manager', 'action' => 'upload'), $path); ?></li>
<li><?php echo $this->FileManager->link(__('Create directory'), array('controller' => 'file_manager', 'action' => 'create_directory'), $path); ?></li>
<li><?php echo $this->FileManager->link(__('Create file'), array('controller' => 'file_manager', 'action' => 'create_file'), $path); ?></li>
<li>
<?php
echo $this->FileManager->link(__('Upload here'),
array('controller' => 'file_manager', 'action' => 'upload'),
$path
);
?>
</li>
<li>
<?php
echo $this->FileManager->link(__('Create directory'),
array('controller' => 'file_manager', 'action' => 'create_directory'),
$path
);
?>
</li>
<li>
<?php
echo $this->FileManager->link(__('Create file'),
array('controller' => 'file_manager', 'action' => 'create_file'),
$path
);
?>
</li>
<?php $this->end(); ?>

<div class="breadcrumb">
<?php
echo __('You are here:') . ' ';
$breadcrumb = $this->FileManager->breadcrumb($path);
foreach ($breadcrumb as $pathname => $p) {
echo $this->FileManager->linkDirectory($pathname, $p);
echo DS;
}
?>
<a href="#"><?php echo __('You are here') . ' '; ?> </a> <span class="divider"> &gt; </span>
<?php $breadcrumb = $this->FileManager->breadcrumb($path); ?>
<?php foreach ($breadcrumb as $pathname => $p) : ?>
<?php echo $this->FileManager->linkDirectory($pathname, $p); ?>
<span class="divider"> <?php echo DS; ?> </span>
<?php endforeach; ?>
</div>

&nbsp;

<div class="directory-content">
<table cellpadding="0" cellspacing="0">
<table class="table table-striped">
<?php
$tableHeaders = $this->Html->tableHeaders(array(
'',
__('Directory content'),
__('Actions'),
));
echo $tableHeaders;

?>
<thead>
<?php echo $tableHeaders; ?>
</thead>
<?php
// directories
$rows = array();
foreach ($content['0'] as $directory) {
$actions = $this->FileManager->linkDirectory(__('Open'), $path . $directory . DS);
if ($this->FileManager->inPath($deletablePaths, $path . $directory)) {
$actions .= ' ' . $this->FileManager->link(__('Delete'), array(
foreach ($content['0'] as $directory):
$actions = array();
$actions[] = $this->FileManager->linkDirectory(__('Open'), $path.$directory.DS);
if ($this->FileManager->inPath($deletablePaths, $path.$directory)) {
$actions[] = $this->FileManager->link(__('Delete'), array(
'controller' => 'file_manager',
'action' => 'delete_directory',
), $path . $directory);
}
$actions = $this->Html->div('item-actions', implode(' ', $actions));
$rows[] = array(
$this->Html->image('/img/icons/folder.png'),
$this->FileManager->linkDirectory($directory, $path . $directory . DS),
$actions,
);
}
endforeach;
echo $this->Html->tableCells($rows, array('class' => 'directory'), array('class' => 'directory'));

// files
$rows = array();
foreach ($content['1'] as $file) {
$actions = $this->FileManager->link(__('Edit'), array('controller' => 'file_manager', 'action' => 'editfile'), $path . $file);
if ($this->FileManager->inPath($deletablePaths, $path . $file)) {
$actions .= $this->FileManager->link(__('Delete'), array(
foreach ($content['1'] as $file):
$actions = array();
$actions[] = $this->FileManager->link(__('Edit'), array('controller' => 'file_manager', 'action' => 'editfile'), $path.$file);
if ($this->FileManager->inPath($deletablePaths, $path.$file)) {
$actions[] = $this->FileManager->link(__('Delete'), array(
'controller' => 'file_manager',
'action' => 'delete_file',
), $path . $file);
}
$actions = implode(' ', $actions);
$rows[] = array(
$this->Html->image('/img/icons/' . $this->FileManager->filename2icon($file)),
$this->FileManager->linkFile($file, $path . $file),
$actions,
);
}
endforeach;
echo $this->Html->tableCells($rows, array('class' => 'file'), array('class' => 'file'));

echo $tableHeaders;
?>
<thead>
<?php echo $tableHeaders; ?>
</thead>
</table>
</div>
@@ -1,36 +1,60 @@
<div class="filemanager form">
<h2><?php echo $title_for_layout; ?></h2>
<?php
$this->Html
->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('File Manager'), array('plugin' => 'file_manager', 'controller' => 'file_manager', 'action' => 'browse'))
->addCrumb(__('Create Directory'), $this->here);

<div class="breadcrumb">
<?php
echo __('You are here:') . ' ';
$breadcrumb = $this->FileManager->breadcrumb($path);
foreach ($breadcrumb as $pathname => $p) {
echo $this->FileManager->linkDirectory($pathname, $p);
echo DS;
}
?>
echo $this->Form->create('FileManager', array(
'url' => $this->Html->url(array(
'controller' => 'file_manager',
'action' => 'create_directory',
), true) . '?path=' . urlencode($path),
));
?>
<h2 class="hidden-desktop"><?php echo __('Create Directory'); ?></h2>
<div class="breadcrumb">
<a href="#"><?php echo __('You are here') . ' '; ?> </a> <span class="divider"> &gt; </span>
<?php $breadcrumb = $this->FileManager->breadcrumb($path); ?>
<?php foreach ($breadcrumb as $pathname => $p) : ?>
<?php echo $this->FileManager->linkDirectory($pathname, $p); ?>
<span class="divider"> <?php echo DS; ?> </span>
<?php endforeach; ?>
</div>

&nbsp;

<div class="row-fluid">
<div class="span8">

<ul class="nav nav-tabs">
<li><a href="#filemanager-createdir" data-toggle="tab"><?php echo __('Directory'); ?></a></li>
<?php echo $this->Croogo->adminTabs(); ?>
</ul>

<div class="tab-content">
<div id="filemanager-createdir" class="tab-pane">
<?php
echo $this->Form->input('FileManager.name', array(
'type' => 'text',
'placeholder' => __('Directory name'),
));
?>
</div>

<?php echo $this->Croogo->adminTabs(); ?>
</div>
</div>

<div class="span4">
<?php
echo $this->Form->create('FileManager', array(
'url' => $this->Html->url(array(
'controller' => 'file_manager',
'action' => 'create_directory',
), true) . '?path=' . urlencode($path),
));
?>
<fieldset>
<?php echo $this->Form->input('FileManager.name', array('type' => 'text')); ?>
</fieldset>
<div class="buttons">
<?php
echo $this->Form->end(__('Create'));
echo $this->Html->link(__('Cancel'), array(
'action' => 'index',
), array(
'class' => 'cancel',
));
echo $this->Html->beginBox(__('Publishing')) .
$this->Form->button(__('Create'), array('button' => 'default')) .
$this->Html->link(__('Cancel'), array('action' => 'index'), array('button' => 'danger')) .
$this->Html->endBox();

echo $this->Croogo->adminBoxes();
?>
</div>
</div>

</div>
<?php echo $this->Form->end(); ?>
@@ -1,37 +1,59 @@
<div class="filemanager form">
<h2><?php echo $title_for_layout; ?></h2>

<div class="breadcrumb">
<?php
echo __('You are here:') . ' ';
$breadcrumb = $this->FileManager->breadcrumb($path);
foreach ($breadcrumb as $pathname => $p) {
echo $this->FileManager->linkDirectory($pathname, $p);
echo DS;
}
?>
</div>
<?php
$this->Html
->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('File Manager'), array('plugin' => 'file_manager', 'controller' => 'file_manager', 'action' => 'browse'))
->addCrumb(__('Create File'), $this->here);

echo $this->Form->create('FileManager', array(
'url' => $this->Html->url(array(
'controller' => 'file_manager',
'action' => 'create_file',
), true) . '?path=' . urlencode($path),
));

?>
<h2 class="hidden-desktop"><?php echo __('Create file'); ?> </h2>
<div class="breadcrumb">
<a href="#"><?php echo __('You are here') . ' '; ?> </a> <span class="divider"> &gt; </span>
<?php $breadcrumb = $this->FileManager->breadcrumb($path); ?>
<?php foreach ($breadcrumb as $pathname => $p) : ?>
<?php echo $this->FileManager->linkDirectory($pathname, $p); ?>
<span class="divider"> <?php echo DS; ?> </span>
<?php endforeach; ?>
</div>

&nbsp;

<div class="row-fluid">
<div class="span8">

<?php
echo $this->Form->create('FileManager', array(
'url' => $this->Html->url(array(
'controller' => 'file_manager',
'action' => 'create_file',
), true) . '?path=' . urlencode($path),
));
?>
<fieldset>
<?php echo $this->Form->input('FileManager.name', array('type' => 'text')); ?>
</fieldset>

<div class="buttons">
<?php
echo $this->Form->end(__('Create'));
echo $this->Html->link(__('Cancel'), array(
'action' => 'index',
), array(
'class' => 'cancel',
));
?>
<ul class="nav nav-tabs">
<li><a href="#filemanager-createfile" data-toggle="tab"><?php echo __('File'); ?></a></li>
<?php echo $this->Croogo->adminTabs(); ?>
</ul>

<div class="tab-content">
<div id="filemanager-createfile" class="tab-pane">
<?php
echo $this->Form->input('FileManager.name', array(
'type' => 'text',
'placeholder' => __('Filename'),
'class' => 'span10',
));
?>
</div>

<?php echo $this->Croogo->adminTabs(); ?>
</div>
</div>
</div>
<div class="span4">
<?php
echo $this->Html->beginBox(__('Publishing')) .
$this->Form->button(__('Save'), array('button' => 'default')) .
$this->Html->link(__('Cancel'), array('action' => 'index'), array('button' => 'danger')) .
$this->Html->endBox();
?>
</div>

</div>
<?php echo $this->Form->end(); ?>
@@ -1,37 +1,46 @@
<div class="filemanager form">
<h2><?php echo $title_for_layout; ?></h2>
<?php
$this->Html
->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('File Manager'), array('plugin' => 'file_manager', 'controller' => 'file_manager', 'action' => 'browse'))
->addCrumb(basename($absolutefilepath), $this->here);

<div class="breadcrumb">
<?php
echo __('You are here:') . ' ';
$breadcrumb = $this->FileManager->breadcrumb($path);
foreach ($breadcrumb as $pathname => $p) {
echo $this->FileManager->linkDirectory($pathname, $p);
echo DS;
}
?>
</div>
echo $this->Form->create('FileManager', array(
'url' => $this->Html->url(array(
'controller' => 'file_manager',
'action' => 'editfile',
), true) . '?path=' . urlencode($absolutefilepath),
));
?>
<h2 class="hidden-desktop"><?php echo __('Edit file'); ?> </h2>
<div class="breadcrumb">
<a href="#"><?php echo __('You are here') . ' '; ?> </a> <span class="divider"> &gt; </span>
<?php $breadcrumb = $this->FileManager->breadcrumb($path); ?>
<?php foreach ($breadcrumb as $pathname => $p) : ?>
<?php echo $this->FileManager->linkDirectory($pathname, $p); ?>
<span class="divider"> <?php echo DS; ?> </span>
<?php endforeach; ?>
</ul>
</div>

<?php
echo $this->Form->create('FileManager', array(
'url' => $this->Html->url(array(
'controller' => 'file_manager',
'action' => 'editfile',
), true) . '?path=' . urlencode($absolutefilepath),
));
?>
<fieldset>
<?php echo $this->Form->input('FileManager.content', array('type' => 'textarea', 'value' => $content, 'class' => 'content')); ?>
</fieldset>
&nbsp;

<div class="buttons">
<?php
echo $this->Form->end(__('Save'));
echo $this->Html->link(__('Cancel'), array(
'action' => 'index',
), array(
'class' => 'cancel',
));
?>
<div class="row-fluid">
<div class="span8">
<?php echo $this->Html->beginBox(__('Edit')) .
$this->Form->input(
'FileManager.content',
array('type' => 'textarea', 'value' => $content, 'class' => 'span12', 'label' => '')
) .
$this->Html->endBox(); ?>
</div>
<div class="span4">
<?php
echo $this->Html->beginBox(__('Publishing')) .
$this->Form->button(__('Save'), array('button' => 'default')) .
$this->Html->link(__('Cancel'), array('action' => 'index'), array('button' => 'danger')) .
$this->Html->endBox();
?>
</div>
</div>

</div>
<?php echo $this->Form->end(); ?>
@@ -1,38 +1,56 @@
<div class="filemanager form">
<h2><?php echo $title_for_layout; ?></h2>
<?php
$this->Html
->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('File Manager'), array('plugin' => 'file_manager', 'controller' => 'file_manager', 'action' => 'browse'))
->addCrumb(__('Upload'), $this->here);

<div class="breadcrumb">
<?php echo __('You are here:');
echo $this->Form->create('FileManager', array(
'type' => 'file',
'url' => $this->Html->url(array(
'controller' => 'file_manager',
'action' => 'upload',
), true) . '?path=' . urlencode($path),
));
?>
<h2 class="hidden-desktop"><?php echo __('Upload file'); ?> </h2>
<div class="breadcrumb">
<a href="#"><?php echo __('You are here') . ' '; ?> </a> <span class="divider"> &gt; </span>
<?php $breadcrumb = $this->FileManager->breadcrumb($path); ?>
<?php foreach ($breadcrumb as $pathname => $p) : ?>
<?php echo $this->FileManager->linkDirectory($pathname, $p); ?>
<span class="divider"> <?php echo DS; ?> </span>
<?php endforeach; ?>
</div>

$breadcrumb = $this->FileManager->breadcrumb($path);
foreach ($breadcrumb as $pathname => $p) {
echo $this->FileManager->linkDirectory($pathname, $p);
echo DS;
}
?>
&nbsp;

<div class="row-fluid">
<div class="span8">
<ul class="nav nav-tabs">
<li><a href="#filemanager-upload" data-toggle="tab"><?php echo __('Upload'); ?></a></li>
</ul>

<div class="tab-content">
<div id="filemanager-upload" class="tab-pane">
<?php
echo $this->Form->input('FileManager.file', array('type' => 'file', 'label' => ''));
?>
</div>

<?php echo $this->Croogo->adminTabs(); ?>
</div>
</div>

<div class="span4">
<?php
echo $this->Form->create('FileManager', array(
'type' => 'file',
'url' => $this->Html->url(array(
'controller' => 'file_manager',
'action' => 'upload',
), true) . '?path=' . urlencode($path),
));
?>
<fieldset>
<?php echo $this->Form->input('FileManager.file', array('type' => 'file')); ?>
</fieldset>
echo $this->Html->beginBox(__('Publishing')) .
$this->Form->button(__('Save'), array('button' => 'default')) .
$this->Html->link(__('Cancel'), array('action' => 'index'), array('button' => 'danger')) .
$this->Html->endBox();

<div class="buttons">
<?php
echo $this->Form->end(__('Upload'));
echo $this->Html->link(__('Cancel'), array(
'action' => 'index',
), array(
'class' => 'cancel',
));
echo $this->Croogo->adminBoxes();
?>
</div>
</div>

</div>
<?php echo $this->Form->end(); ?>
@@ -119,10 +119,16 @@ public function breadcrumb($path) {
* @return string
*/
public function link($title, $url, $path, $pathKey = 'path') {
$class = '';
if (isset($url['action'])
&& ($url['action'] == 'create_directory' || $url['action'] == 'upload' || $url['action'] == 'create_file')) {
$class = 'btn';
}

if (isset($url['action']) && ($url['action'] == 'delete_directory' || $url['action'] == 'delete_file')) {
$output = $this->Form->postLink($title, $url, array('data' => compact('path')), __('Are you sure?'));
} else {
$output = "<a href='" . $this->Html->url($url) . "?{$pathKey}=" . urlencode($path) . "'>" . $title . "</a>";
$output = '<a class="' . $class . '" href="' . $this->Html->url($url) . "?{$pathKey}=" . urlencode($path) . '">' . $title . '</a>';
}
return $output;
}
@@ -5,6 +5,7 @@
Croogo::hookHelper('*', 'Menus.Menus');

CroogoNav::add('menus', array(
'icon' => array('sitemap', 'large'),
'title' => __('Menus'),
'url' => array(
'plugin' => 'menus',
@@ -1,67 +1,114 @@
<?php $this->Html->script(array('Menus.links'), false); ?>
<?php $this->extend('/Common/admin_edit'); ?>
<?php echo $this->Form->create('Link', array('url' => array('controller' => 'links', 'action' => 'add', 'menu' => $menuId)));?>
<fieldset>
<div class="tabs">
<ul>
<li><a href="#link-basic"><span><?php echo __('Link'); ?></span></a></li>
<li><a href="#link-access"><span><?php echo __('Access'); ?></span></a></li>
<li><a href="#link-misc"><span><?php echo __('Misc.'); ?></span></a></li>
<?php echo $this->Croogo->adminTabs(); ?>
</ul>
<?php

$this->Html->script(array('Menus.links'), false);
$this->extend('/Common/admin_edit');

$this->Html
->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('Menus'), array('plugin' => 'menus', 'controller' => 'menus', 'action' => 'index'))
->addCrumb($menus[$menuId], array('plugin' => 'menus', 'controller' => 'links', 'action' => 'index', '?' => array('menu_id' => $menuId)))
->addCrumb(__('Add'), $this->here);

echo $this->Form->create('Link', array('url' => array('controller' => 'links', 'action' => 'add', 'menu' => $menuId)));

<div id="link-basic">
<?php
echo $this->Form->input('menu_id', array('selected' => $menuId));
echo $this->Form->input('parent_id', array(
'label' => __('Parent'),
'options' => $parentLinks,
'empty' => true,
));
echo $this->Form->input('title');
echo $this->Form->input('link') .
$this->Html->link(__('Link to a Node'), Router::url(array(
'plugin' => 'nodes',
'controller' => 'nodes',
'action' => 'index',
'links' => 1,
), true) . '?KeepThis=true&TB_iframe=true&height=400&width=600',
array(
'class' => 'thickbox',
));
echo $this->Form->input('status');
?>
?>
<div class="row-fluid">
<div class="span8">

<ul class="nav nav-tabs">
<li><a href="#link-basic" data-toggle="tab"><?php echo __('Link'); ?></a></li>
<li><a href="#link-access" data-toggle="tab"><?php echo __('Access'); ?></a></li>
<li><a href="#link-misc" data-toggle="tab"><?php echo __('Misc.'); ?></a></li>
<?php echo $this->Croogo->adminTabs(); ?>
</ul>

<div class="tab-content">
<div id="link-basic" class="tab-pane">
<?php
echo $this->Form->input('menu_id', array(
'selected' => $menuId,
));
echo $this->Form->input('parent_id', array(
'title' => __('Parent'),
'options' => $parentLinks,
'empty' => true,
));
$this->Form->inputDefaults(array(
'class' => 'span10',
));
echo $this->Form->input('title', array(
'label' => false,
'placeholder' => __('Title'),
));
echo $this->Form->input('link', array(
'label' => false,
'placeholder' => __('Link'),
));
echo $this->Html->link(__('Link to a Node'), Router::url(array(
'plugin' => 'nodes',
'controller' => 'nodes',
'action' => 'index',
'links' => 1,
), true) . '?KeepThis=true&TB_iframe=true&height=400&width=600',
array(
'class' => 'thickbox',
)
);
?>
</div>

<div id="link-access">
<?php
echo $this->Form->input('Role.Role');
?>
<div id="link-access" class="tab-pane">
<?php
echo $this->Form->input('Role.Role', array(
'class' => false,
));
?>
</div>

<div id="link-misc">
<?php
echo $this->Form->input('class', array('class' => 'class'));
echo $this->Form->input('description');
echo $this->Form->input('rel');
echo $this->Form->input('target');
echo $this->Form->input('params');
?>
<div id="link-misc" class="tab-pane">
<?php
echo $this->Form->input('class', array(
'label' => false,
'placeholder' => __('Class'),
));
echo $this->Form->input('description', array(
'label' => false,
'placeholder' => __('Description'),
));
echo $this->Form->input('rel', array(
'label' => false,
'placeholder' => __('Rel'),
));
echo $this->Form->input('target', array(
'label' => false,
'placeholder' => __('Target'),
));
echo $this->Form->input('params', array(
'label' => false,
'placeholder' => __('Params'),
));
?>
</div>

<?php echo $this->Croogo->adminTabs(); ?>
</div>
</fieldset>

<div class="buttons">
<?php
echo $this->Form->submit(__('Apply'), array('name' => 'apply'));
echo $this->Form->submit(__('Save'));
echo $this->Html->link(__('Cancel'), array(
'action' => 'index',
'?' => array('menu_id' => $menuId),
), array(
'class' => 'cancel',
));
?>
</div>

<div class="span4">
<?php
echo $this->Html->beginBox(__('Publishing')) .
$this->Form->button(__('Apply'), array('name' => 'apply', 'button' => 'default')) .
$this->Form->button(__('Save'), array('button' => 'default')) .
$this->Html->link(__('Cancel'), array('action' => 'index'), array('button' => 'danger')) .
$this->Form->input('status', array(
'label' => __('Status'),
'class' => false,
)) .
$this->Html->endBox();
echo $this->Croogo->adminBoxes();
?>
</div>

</div>
<?php echo $this->Form->end(); ?>
@@ -1,67 +1,114 @@
<?php $this->extend('/Common/admin_edit'); ?>
<?php $this->Html->script(array('Menus.links'), false); ?>
<?php echo $this->Form->create('Link', array('url' => array('controller' => 'links', 'action' => 'edit', 'menu' => $menuId)));?>
<fieldset>
<div class="tabs">
<ul>
<li><a href="#link-basic"><span><?php echo __('Link'); ?></span></a></li>
<li><a href="#link-access"><span><?php echo __('Access'); ?></span></a></li>
<li><a href="#link-misc"><span><?php echo __('Misc.'); ?></span></a></li>
<?php echo $this->Croogo->adminTabs(); ?>
</ul>
<?php

$this->extend('/Common/admin_edit');
$this->Html->script(array('Menus.links'), false);

$this->Html
->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('Menus'), array('plugin' => 'menus', 'controller' => 'menus', 'action' => 'index'))
->addCrumb($this->data['Menu']['title'], array('plugin' => 'menus', 'controller' => 'links', 'action' => 'index', '?' => array('menu_id' => $this->data['Menu']['id'])))
->addCrumb($this->request->data['Link']['title'], $this->here);

echo $this->Form->create('Link', array('url' => array('controller' => 'links', 'action' => 'edit', 'menu' => $menuId)));

<div id="link-basic">
<?php
echo $this->Form->input('id');
echo $this->Form->input('menu_id');
echo $this->Form->input('parent_id', array(
'label' => __('Parent'),
'options' => $parentLinks,
'empty' => true,
));
echo $this->Form->input('title');
echo $this->Form->input('link') .
$this->Html->link(__('Link to a Node'), Router::url(array(
'plugin' => 'nodes',
'controller' => 'nodes',
'action' => 'index',
'links' => 1,
), true) . '?KeepThis=true&TB_iframe=true&height=400&width=600',
array(
'class' => 'thickbox',
));
echo $this->Form->input('status');
?>
?>
<div class="row-fluid">
<div class="span8">

<ul class="nav nav-tabs">
<li><a href="#link-basic" data-toggle="tab"><?php echo __('Link'); ?></a></li>
<li><a href="#link-access" data-toggle="tab"><?php echo __('Access'); ?></a></li>
<li><a href="#link-misc" data-toggle="tab"><?php echo __('Misc.'); ?></a></li>
<?php echo $this->Croogo->adminTabs(); ?>
</ul>

<div class="tab-content">
<div id="link-basic" class="tab-pane">
<?php
echo $this->Form->input('id');
echo $this->Form->input('menu_id', array(
'selected' => $menuId,
));
echo $this->Form->input('parent_id', array(
'title' => __('Parent'),
'options' => $parentLinks,
'empty' => true,
));
$this->Form->inputDefaults(array(
'class' => 'span10',
));
echo $this->Form->input('title', array(
'label' => false,
'placeholder' => __('Title'),
));
echo $this->Form->input('link', array(
'label' => false,
'placeholder' => __('Link'),
));
echo $this->Html->link(__('Link to a Node'), Router::url(array(
'plugin' => 'nodes',
'controller' => 'nodes',
'action' => 'index',
'links' => 1,
), true) . '?KeepThis=true&TB_iframe=true&height=400&width=600',
array(
'class' => 'thickbox',
)
);
?>
</div>

<div id="link-access">
<?php
echo $this->Form->input('Role.Role');
?>
<div id="link-access" class="tab-pane">
<?php
echo $this->Form->input('Role.Role', array(
'class' => false,
));
?>
</div>

<div id="link-misc">
<?php
echo $this->Form->input('class', array('class' => 'class'));
echo $this->Form->input('description');
echo $this->Form->input('rel');
echo $this->Form->input('target');
echo $this->Form->input('params');
?>
<div id="link-misc" class="tab-pane">
<?php
echo $this->Form->input('class', array(
'label' => false,
'placeholder' => __('Class'),
));
echo $this->Form->input('description', array(
'label' => false,
'placeholder' => __('Description'),
));
echo $this->Form->input('rel', array(
'label' => false,
'placeholder' => __('Rel'),
));
echo $this->Form->input('target', array(
'label' => false,
'placeholder' => __('Target'),
));
echo $this->Form->input('params', array(
'label' => false,
'placeholder' => __('Params'),
));
?>
</div>

<?php echo $this->Croogo->adminTabs(); ?>
</div>
</fieldset>
<div class="buttons">
<?php
echo $this->Form->submit(__('Apply'), array('name' => 'apply'));
echo $this->Form->submit(__('Save'));
echo $this->Html->link(__('Cancel'), array(
'action' => 'index',
'?' => array('menu_id' => $menuId),
), array(
'class' => 'cancel',
));
?>

</div>

<div class="span4">
<?php
echo $this->Html->beginBox(__('Publishing')) .
$this->Form->button(__('Apply'), array('name' => 'apply', 'button' => 'default')) .
$this->Form->button(__('Save'), array('button' => 'default')) .
$this->Html->link(__('Cancel'), array('action' => 'index'), array('button' => 'danger')) .
$this->Form->input('status', array(
'label' => __('Status'),
'class' => false,
)) .
$this->Html->endBox();
echo $this->Croogo->adminBoxes();
?>
</div>
</div>
<?php echo $this->Form->end(); ?>
@@ -1,12 +1,27 @@
<?php $this->extend('/Common/admin_index'); ?>
<?php

$this->extend('/Common/admin_index');

$this->Html
->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('Menus'), array('plugin' => 'menus', 'controller' => 'menus', 'action' => 'index'))
->addCrumb(__($menu['Menu']['title']), array(
'plugin' => 'menus', 'controller' => 'links', 'action' => 'index',
'?' => array('menu_id' => $menu['Menu']['id'])));
?>

<?php $this->start('tabs'); ?>
<li><?php echo $this->Html->link(
__('New %s', Inflector::singularize($this->name)),
array('action' => 'add',
'?' => array('menu_id' => $menu['Menu']['id']),
)); ?>
<li>
<?php
echo $this->Html->link(
__('New %s', Inflector::singularize($this->name)),
array('action' => 'add', $menu['Menu']['id']),
array('button' => 'default')
);
?>
</li>
<?php $this->end('tabs'); ?>

<?php
if (isset($this->params['named'])) {
foreach ($this->params['named'] as $nn => $nv) {
@@ -21,7 +36,7 @@
),
));
?>
<table cellpadding="0" cellspacing="0">
<table class="table table-striped">
<?php
$tableHeaders = $this->Html->tableHeaders(array(
'',
@@ -30,42 +45,69 @@
__('Status'),
__('Actions'),
));
echo $tableHeaders;

?>
<thead>
<?php echo $tableHeaders; ?>
</thead>
<?php
$rows = array();
foreach ($linksTree as $linkId => $linkTitle) {
$actions = $this->Html->link(__('Move up'), array('controller' => 'links', 'action' => 'moveup', $linkId));
$actions .= ' ' . $this->Html->link(__('Move down'), array('controller' => 'links', 'action' => 'movedown', $linkId));
$actions .= ' ' . $this->Html->link(__('Edit'), array('controller' => 'links', 'action' => 'edit', $linkId));
$actions .= ' ' . $this->Croogo->adminRowActions($linkId);
$actions .= ' ' . $this->Layout->processLink(__('Delete'),
'#Link' . $linkId . 'Id',
null, __('Are you sure?'));

foreach ($linksTree as $linkId => $linkTitle):
$actions = array();
$actions[] = $this->Croogo->adminRowAction('', array(
'controller' => 'links', 'action' => 'moveup', $linkId
), array(
'icon' => 'chevron-up',
'tooltip' => __('Move up'),
));
$actions[] = $this->Croogo->adminRowAction('', array(
'controller' => 'links', 'action' => 'movedown', $linkId,
), array(
'icon' => 'chevron-down',
'tooltip' => __('Move down'),
));
$actions[] = $this->Croogo->adminRowActions($linkId);
$actions[] = $this->Croogo->adminRowAction('', array(
'controller' => 'links', 'action' => 'edit', $linkId,
), array(
'icon' => 'pencil', 'tooltip' => __('Edit this item'),
));
$actions[] = $this->Croogo->adminRowAction('', '#Link' . $linkId . 'Id',
array(
'icon' => 'trash',
'tooltip' => __('Delete this item')
),
__('Are you sure?')
);
$actions = $this->Html->div('item-actions', implode(' ', $actions));
$rows[] = array(
$this->Form->checkbox('Link.' . $linkId . '.id'),
$linkId,
$linkTitle,
$this->Layout->status($linksStatus[$linkId]),
$this->Html->status($linksStatus[$linkId]),
$actions,
);
}
endforeach;

echo $this->Html->tableCells($rows);
echo $tableHeaders;
?>
?>

</table>
<div class="bulk-actions">
<?php
echo $this->Form->input('Link.action', array(
'label' => false,
'options' => array(
'publish' => __('Publish'),
'unpublish' => __('Unpublish'),
'delete' => __('Delete'),
),
'empty' => true,
));
echo $this->Form->end(__('Submit'));
?>
<div class="row-fluid">
<div class="control-group">
<?php
echo $this->Form->input('Link.action', array(
'div' => 'input inline',
'label' => false,
'options' => array(
'publish' => __('Publish'),
'unpublish' => __('Unpublish'),
'delete' => __('Delete'),
),
'empty' => true,
));
?>
<div class="controls">
<?php echo $this->Form->end(__('Submit')); ?>
</div>
</div>
</div>
@@ -1,40 +1,68 @@
<?php $this->extend('/Common/admin_edit'); ?>
<?php echo $this->Form->create('Menu');?>
<fieldset>
<div class="tabs">
<ul>
<li><a href="#menu-basic"><span><?php echo __('Menu'); ?></span></a></li>
<li><a href="#menu-misc"><span><?php echo __('Misc.'); ?></span></a></li>
<?php

$this->extend('/Common/admin_edit');

$this->Html
->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('Menus'), array('plugin' => 'menus', 'controller' => 'menus', 'action' => 'index'))
->addCrumb(__('Add'), $this->here);

echo $this->Form->create('Menu');

?>
<div class="row-fluid">
<div class="span8">

<ul class="nav nav-tabs">
<li><a href="#menu-basic" data-toggle="tab"><?php echo __('Menu'); ?></a></li>
<li><a href="#menu-misc" data-toggle="tab"><?php echo __('Misc.'); ?></a></li>
<?php echo $this->Croogo->adminTabs(); ?>
</ul>

<div id="menu-basic">
<div class="tab-content">

<div id="menu-basic" class="tab-pane">
<?php
echo $this->Form->input('title');
echo $this->Form->input('alias');
echo $this->Form->input('description');
//echo $this->Form->input('status');
$this->Form->inputDefaults(array(
'class' => 'span10',
));
echo $this->Form->input('title', array(
'label' => false,
'placeholder' => __('Title'),
));
echo $this->Form->input('alias', array(
'label' => false,
'placeholder' => __('Alias'),
));
echo $this->Form->input('description', array(
'label' => false,
'placeholder' => __('Description'),
));
?>
</div>
</div>

<div id="menu-misc">
<div id="menu-misc" class="tab-pane">
<?php
echo $this->Form->input('params');
echo $this->Form->input('params', array(
'label' => false,
'placeholder' => __('Params'),
));
?>
</div>

<?php echo $this->Croogo->adminTabs(); ?>
</div>
<?php echo $this->Croogo->adminTabs(); ?>
</div>
</fieldset>

<div class="buttons">
<?php
echo $this->Form->submit(__('Apply'), array('name' => 'apply'));
echo $this->Form->submit(__('Save'));
echo $this->Html->link(__('Cancel'), array(
'action' => 'index',
), array(
'class' => 'cancel',
));
?>
<div class="span4">
<?php
echo $this->Html->beginBox('Publishing') .
$this->Form->button(__('Apply'), array('name' => 'apply', 'button' => 'default')) .
$this->Form->button(__('Save'), array('button' => 'default')) .
$this->Html->link(__('Cancel'), array('action' => 'index'), array('button' => 'danger')) .
$this->Html->endBox();
$this->Croogo->adminBoxes();
?>
</div>

</div>
<?php echo $this->Form->end(); ?>
@@ -1,41 +1,71 @@
<?php $this->extend('/Common/admin_edit'); ?>
<?php echo $this->Form->create('Menu');?>
<fieldset>
<div class="tabs">
<ul>
<li><a href="#menu-basic"><span><?php echo __('Menu'); ?></span></a></li>
<li><a href="#menu-misc"><span><?php echo __('Misc.'); ?></span></a></li>
<?php

$this->extend('/Common/admin_edit');

$this->Html
->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('Menus'), array('plugin' => 'menus', 'controller' => 'menus', 'action' => 'index'))
->addCrumb($this->request->data['Menu']['title']);

echo $this->Form->create('Menu');

?>
<div class="row-fluid">
<div class="span8">

<ul class="nav nav-tabs">
<li><a href="#menu-basic" data-toggle="tab"><?php echo __('Menu'); ?></a></li>
<li><a href="#menu-misc" data-toggle="tab"><?php echo __('Misc.'); ?></a></li>
<?php echo $this->Croogo->adminTabs(); ?>
</ul>

<div id="menu-basic">
<div class="tab-content">

<div id="menu-basic" class="tab-pane">
<?php
echo $this->Form->input('id');
echo $this->Form->input('title');
echo $this->Form->input('alias');
echo $this->Form->input('description');
//echo $this->Form->input('status');
$this->Form->inputDefaults(array(
'class' => 'span12',
));
echo $this->Form->input('title', array(
'label' => false,
'placeholder' => __('Title'),
));
echo $this->Form->input('alias', array(
'label' => false,
'placeholder' => __('Alias'),
));
echo $this->Form->input('description', array(
'label' => false,
'placeholder' => __('Description'),
));
?>
</div>
</div>

<div id="menu-misc">
<div id="menu-misc" class="tab-pane">
<?php
echo $this->Form->input('params');
echo $this->Form->input('params', array(
'label' => false,
'placeholder' => __('Params'),
));
?>
</div>

<?php echo $this->Croogo->adminTabs(); ?>
</div>
<?php echo $this->Croogo->adminTabs(); ?>
</div>
</fieldset>

<div class="buttons">
<?php
echo $this->Form->submit(__('Apply'), array('name' => 'apply'));
echo $this->Form->submit(__('Save'));
echo $this->Html->link(__('Cancel'), array(
'action' => 'index',
), array(
'class' => 'cancel',
));
?>
<div class="span4">
<?php
echo $this->Html->beginBox('Publishing') .
$this->Form->button(__('Apply'), array('name' => 'apply', 'button' => 'default')) .
$this->Form->button(__('Save'), array('button' => 'default')) .
$this->Html->link(__('Cancel'), array('action' => 'index'), array('button' => 'danger')) .
$this->Html->endBox();

$this->Croogo->adminBoxes();
?>
</div>

</div>
<?php echo $this->Form->end(); ?>
@@ -1,40 +1,61 @@
<?php $this->extend('/Common/admin_index'); ?>

<table cellpadding="0" cellspacing="0">
<?php
$tableHeaders = $this->Html->tableHeaders(array(
$this->Paginator->sort('id'),
$this->Paginator->sort('title'),
$this->Paginator->sort('alias'),
$this->Paginator->sort('link_count'),
__('Actions'),
));
echo $tableHeaders;

$rows = array();
foreach ($menus as $menu) {
$actions = $this->Html->link(__('View links'), array(
'controller' => 'links', 'action' => 'index',
'?' => array('menu_id' => $menu['Menu']['id'])
));
$actions .= ' ' . $this->Html->link(__('Edit'), array('controller' => 'menus', 'action' => 'edit', $menu['Menu']['id']));
$actions .= ' ' . $this->Croogo->adminRowActions($menu['Menu']['id']);
$actions .= ' ' . $this->Form->postLink(__('Delete'), array(
'controller' => 'menus',
'action' => 'delete',
$menu['Menu']['id'],
), null, __('Are you sure?'));
$this->extend('/Common/admin_index');

$rows[] = array(
$menu['Menu']['id'],
$this->Html->link($menu['Menu']['title'], array('controller' => 'links', 'action' => 'index', $menu['Menu']['id'])),
$menu['Menu']['alias'],
$menu['Menu']['link_count'],
$actions,
);
}
$this->Html
->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('Menus'), $this->here);

echo $this->Html->tableCells($rows);
echo $tableHeaders;
?>
</table>
<div class="row-fluid">
<div class="span12">
<table class="table table-striped">
<?php
$tableHeaders = $this->Html->tableHeaders(array(
$this->Paginator->sort('id'),
$this->Paginator->sort('title'),
$this->Paginator->sort('alias'),
$this->Paginator->sort('link_count'),
__('Actions'),
));
?>
<thead>
<?php echo $tableHeaders; ?>
</thead>

<?php
$rows = array();
foreach ($menus as $menu):
$actions = array();
$actions[] = $this->Croogo->adminRowAction(
'',
array('controller' => 'links', 'action' => 'index', '?' => array('menu_id' => $menu['Menu']['id'])),
array('icon' => 'zoom-in', 'tooltip' => __('View links'))
);
$actions[] = $this->Croogo->adminRowActions($menu['Menu']['id']);
$actions[] = $this->Croogo->adminRowAction(
'',
array('controller' => 'menus', 'action' => 'edit', $menu['Menu']['id']),
array('icon' => 'pencil', 'tooltip' => __('Edit this item'))
);
$actions[] = $this->Croogo->adminRowAction(
'',
array('controller' => 'menus', 'action' => 'delete', $menu['Menu']['id']),
array('icon' => 'trash', 'tooltip' => __('Remove this item')),
__('Are you sure?')
);
$actions = $this->Html->div('item-actions', implode(' ', $actions));
$rows[] = array(
$menu['Menu']['id'],
$this->Html->link($menu['Menu']['title'], array('controller' => 'links', '?' => array('menu_id' => $menu['Menu']['id']))),
$menu['Menu']['alias'],
$menu['Menu']['link_count'],
$this->Html->div('item-actions', $actions),
);
endforeach;

echo $this->Html->tableCells($rows);
?>
</table>
</div>
</div>
@@ -39,8 +39,8 @@ protected function _adminTabs() {
$controller = $this->_controller->name;
$title = __('Custom Fields');
$element = 'Meta.admin/meta_tab';
Croogo::hookAdminTab("$controller/admin_add", $title, $element);
Croogo::hookAdminTab("$controller/admin_edit", $title, $element);
Croogo::hookAdminBox("$controller/admin_add", $title, $element);
Croogo::hookAdminBox("$controller/admin_edit", $title, $element);
}

}
@@ -12,7 +12,7 @@
}
}
?>
<div class="clear">&nbsp;</div>
<div class="clear"></div>
</div>
<?php
echo $this->Html->link(
@@ -69,10 +69,12 @@ public function field($key = '', $value = null, $id = null, $options = array())
'key' => array(
'label' => __('Key'),
'value' => $key,
'class' => 'span12'
),
'value' => array(
'label' => __('Value'),
'value' => $value,
'class' => 'span12'
),
);
$options = Set::merge($_options, $options);
@@ -5,6 +5,7 @@
Croogo::hookHelper('*', 'Nodes.Nodes');

CroogoNav::add('content', array(
'icon' => array('edit', 'large'),
'title' => __('Content'),
'url' => array(
'plugin' => 'nodes',
@@ -219,7 +219,6 @@ public function admin_edit($id = null) {
$this->redirect(array('action' => 'create'));
}

$this->set('title_for_layout', __('Edit content: %s', $type['Type']['title']));
$this->Node->type = $type['Type']['alias'];
$this->Node->Behaviors->attach('Tree', array('scope' => array('Node.type' => $this->Node->type)));

@@ -256,6 +255,8 @@ public function admin_edit($id = null) {
$this->request->data = $data;
}

$this->set('title_for_layout', __('Edit %s: %s', $type['Type']['title'], $this->request->data['Node']['title']));

$nodes = $this->Node->generateTreeList();
$roles = $this->Node->User->Role->find('list');
$users = $this->Node->User->find('list');
@@ -1,29 +1,57 @@
<div class="nodes filter form">
<?php
echo $this->Form->create('Node', array(
'url' => array_merge(array('action' => 'index'), $this->params['pass'])
));
echo $this->Form->input('type', array(
'empty' => true,
'options' => $nodeTypes
));
echo $this->Form->input('status', array(
'empty' => true,
'options' => array(
'1' => __('Published'),
'0' => __('Unpublished'),
),
));
echo $this->Form->input('promote', array(
'label' => __('Promoted'),
'empty' => true,
'options' => array(
'1' => __('Yes'),
'0' => __('No'),
),
));
echo $this->Form->input('filter', array('label' => __('Title')));
echo $this->Form->end(__('Filter'));
?>
<div class="clear">&nbsp;</div>
<div class="row-fluid">
<div class="span12">
<div class="row-fluid filter">
<?php
echo $this->Form->create('Node', array(
'class' => 'inline',
'url' => array_merge(
array('action' => 'index'), $this->params['pass']
)
));

echo $this->Form->input('filter', array(
'label' => false,
'title' => __('Search'),
'placeholder' => __('Search...'),
'div' => 'input text span3',
'class' => 'span11',
'tooltip' => false,
));

echo $this->Form->input('type', array(
'label' => false,
'options' => $nodeTypes,
'empty' => __('Type'),
'div' => 'input select span2',
'class' => 'span11'
));

echo $this->Form->input('status', array(
'label' => false,
'options' => array(
'1' => __('Published'),
'0' => __('Unpublished'),
),
'empty' => __('Status'),
'div' => 'input select span2',
'class' => 'span11'
));

echo $this->Form->input('promote', array(
'label' => false,
'options' => array(
'1' => __('Yes'),
'0' => __('No'),
),
'empty' => __('Promoted'),
'div' => 'input select span2',
'class' => 'span11'
));
echo $this->Form->submit(__('Filter'), array('class' => 'btn',
'div' => 'input submit span2'
));
echo $this->Form->end();
?>
</div>
</div>
</div>
@@ -21,7 +21,7 @@
'name' => 'q',
'value' => $qValue,
));
echo $this->Form->submit(__('Search'));
echo $this->Form->button(__('Search'));
?>
</form>
</div>
@@ -1,58 +1,90 @@
<?php $this->extend('/Common/admin_edit'); ?>
<?php $this->Html->script(array('Nodes.nodes'), false); ?>
<?php echo $this->Form->create('Node', array('url' => array('action' => 'add', $typeAlias)));?>
<fieldset>
<div class="tabs">
<ul>
<li><a href="#node-main"><span><?php echo __($type['Type']['title']); ?></span></a></li>
<li><a href="#node-access"><span><?php echo __('Access'); ?></span></a></li>
<li><a href="#node-publishing"><span><?php echo __('Publishing'); ?></span></a></li>
<?php echo $this->Croogo->adminTabs(); ?>
</ul>

<div id="node-main">
<?php

$this->extend('/Common/admin_edit');
$this->Html->script(array('Nodes.nodes'), false);

$this->Html->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('Content'), array('controller' => 'nodes', 'action' => 'index'))
->addCrumb(__('Create'), array('controller' => 'nodes', 'action' => 'create'))
->addCrumb($type['Type']['title'], $this->here);

echo $this->Form->create('Node', array('url' => array('action' => 'add', $typeAlias)));
?>
<div class="row-fluid">
<div class="span8">

<ul class="nav nav-tabs">
<li><a href="#node-main" data-toggle="tab"><?php echo __($type['Type']['title']); ?></a></li>
<li><a href="#node-access" data-toggle="tab"><?php echo __('Access'); ?></a></li>
<?php echo $this->Croogo->adminTabs(); ?>
</ul>

<div class="tab-content">

<div id="node-main" class="tab-pane">
<?php
echo $this->Form->input('parent_id', array('type' => 'select', 'options' => $nodes, 'empty' => true));
echo $this->Form->input('title');
echo $this->Form->input('slug', array('class' => 'slug'));
echo $this->Form->input('excerpt');
echo $this->Form->input('body', array('class' => 'content'));
$this->Form->inputDefaults(array(
'class' => 'span10',
));
echo $this->Form->input('title', array(
'label' => false,
'placeholder' => __('Title'),
));
echo $this->Form->input('slug', array(
'id' => 'slug',
'label' => false,
'placeholder' => __('Slug'),
'class' => 'span10 slug',
));
echo $this->Form->input('excerpt', array(
'label' => false,
'placeholder' => __('Excerpt'),
));
echo $this->Form->input('body', array(
'label' => __('Body'),
));
?>
</div>

<div id="node-access">
<?php
echo $this->Form->input('Role.Role');
?>
<div id="node-access" class="tab-pane">
<?php
echo $this->Form->input('Role.Role', array('class' => false));
?>
</div>

<div id="node-publishing">
<?php
echo $this->Form->input('status', array(
<?php echo $this->Croogo->adminTabs(); ?>
</div>

</div>
<div class="span4">
<?php
echo $this->Html->beginBox(__('Publishing')) .
$this->Form->button(__('Apply'), array('name' => 'apply', 'class' => 'btn', 'type' => 'submit')) .
$this->Form->button(__('Save'), array('class' => 'btn btn-primary', 'type' => 'submit')) .
$this->Html->link(__('Cancel'), array('action' => 'index'), array('class' => 'cancel btn btn-danger')) .
$this->Form->input('status', array(
'label' => __('Published'),
'checked' => 'checked',
));
echo $this->Form->input('promote', array(
'class' => false,
)) .
$this->Form->input('promote', array(
'label' => __('Promoted to front page'),
'checked' => 'checked',
));
echo $this->Form->input('user_id');
echo $this->Form->input('created');
?>
</div>
<?php echo $this->Croogo->adminTabs(); ?>
<div class="clear">&nbsp;</div>
</div>
</fieldset>
<div class="buttons">
<?php
echo $this->Form->submit(__('Apply'), array('name' => 'apply'));
echo $this->Form->submit(__('Save'));
echo $this->Html->link(__('Cancel'), array(
'action' => 'index',
), array(
'class' => 'cancel',
));
?>
'class' => false,
)) .
$this->Form->input('user_id', array(
'label' => __('Publish as '),
)) .
$this->Form->input('created', array(
'type' => 'text',
'class' => 'span10',
)) .
$this->Html->endBox();
?>

<?php echo $this->Croogo->adminBoxes(); ?>

</div>
</div>
<?php echo $this->Form->end(); ?>
@@ -1,4 +1,4 @@
<?php
Configure::write('debug', 0);
echo $this->Meta->field();
Configure::write('debug', 0);
echo $this->Meta->field();
?>
@@ -1,12 +1,22 @@
<div class="nodes create">
<h2><?php echo $title_for_layout; ?></h2>
<h2 class="hidden-desktop"><?php echo $title_for_layout; ?></h2>
<?php

<div class="types">
<?php foreach ($types as $type) { ?>
<div class="type">
<h3><?php echo $this->Html->link($type['Type']['title'], array('action' => 'add', $type['Type']['alias'])); ?></h3>
<p><?php echo $type['Type']['description']; ?></p>
$this->Html->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('Content'), array('controller' => 'nodes', 'action' => 'index'))
->addCrumb(__('Create'), $this->here);

?>
<div class="row-fluid">
<div class="span12">
<div class="box">
<div class="box-content">
<?php foreach ($types as $type): ?>
<div class="type">
<h3><?php echo $this->Html->link($type['Type']['title'], array('action' => 'add', $type['Type']['alias'])); ?></h3>
<p><?php echo $type['Type']['description']; ?></p>
</div>
<?php endforeach; ?>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
@@ -1,53 +1,92 @@
<?php $this->extend('/Common/admin_edit'); ?>
<?php $this->Html->script(array('Nodes.nodes'), false); ?>
<?php echo $this->Form->create('Node', array('url' => array('action' => 'edit')));?>
<fieldset>
<div class="tabs">
<ul>
<li><a href="#node-main"><span><?php echo __($type['Type']['title']); ?></span></a></li>
<li><a href="#node-access"><span><?php echo __('Access'); ?></span></a></li>
<li><a href="#node-publishing"><span><?php echo __('Publishing'); ?></span></a></li>
<?php echo $this->Croogo->adminTabs(); ?>
</ul>

<div id="node-main">
<?php

$this->extend('/Common/admin_edit');
$this->Html->script(array('Nodes.nodes'), false);

$this->Html
->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('Content'), array('controller' => 'nodes', 'action' => 'index'))
->addCrumb($this->request->data['Node']['title'], $this->here);

echo $this->Form->create('Node', array('url' => array('action' => 'edit')));

?>
<div class="row-fluid">
<div class="span8">

<ul class="nav nav-tabs">
<li><a href="#node-main" data-toggle="tab"><?php echo __($type['Type']['title']); ?></a></li>
<li><a href="#node-access" data-toggle="tab"><?php echo __('Access'); ?></a></li>
<?php echo $this->Croogo->adminTabs(); ?>
</ul>

<div class="tab-content">

<div id="node-main" class="tab-pane">
<?php
echo $this->Form->input('parent_id', array('type' => 'select', 'options' => $nodes, 'empty' => true), true);
echo $this->Form->input('id');
echo $this->Form->input('parent_id', array('type' => 'select', 'options' => $nodes, 'empty' => true));
echo $this->Form->input('title');
echo $this->Form->input('slug');
echo $this->Form->input('excerpt');
echo $this->Form->input('body', array('class' => 'content'));
$this->Form->inputDefaults(array(
'class' => 'span10',
));
echo $this->Form->input('title', array(
'label' => false,
'placeholder' => __('Title'),
));
echo $this->Form->input('slug', array(
'label' => false,
'placeholder' => __('Slug'),
));
echo $this->Form->input('excerpt', array(
'label' => false,
'placeholder' => __('Excerpt'),
));
echo $this->Form->input('body', array(
'label' => __('Body'),
));
?>
</div>

<div id="node-access">
<?php
echo $this->Form->input('Role.Role');
?>
</div>

<div id="node-publishing">
<div id="node-access" class="tab-pane">
<?php
echo $this->Form->input('status', array('label' => __('Published')));
echo $this->Form->input('promote', array('label' => __('Promoted to front page')));
echo $this->Form->input('user_id');
echo $this->Form->input('created');
echo $this->Form->input('Role.Role', array('class' => false));
?>
</div>

<?php echo $this->Croogo->adminTabs(); ?>
<div class="clear">&nbsp;</div>
</div>
</fieldset>
<div class="buttons">
<?php
echo $this->Form->submit(__('Apply'), array('name' => 'apply'));
echo $this->Form->submit(__('Save'));
echo $this->Html->link(__('Cancel'), array(
'action' => 'index',
), array(
'class' => 'cancel',
));
?>

</div>
<div class="span4">

<?php
echo $this->Html->beginBox(__('Publishing')) .
$this->Form->button(__('Apply'), array('name' => 'apply', 'class' => 'btn')) .
$this->Form->button(__('Save'), array('class' => 'btn btn-primary')) .
$this->Html->link(__('Cancel'), array('action' => 'index'), array('class' => 'cancel btn btn-danger')) .
$this->Form->input('status', array(
'label' => __('Published'),
'checked' => 'checked',
'class' => false,
)) .
$this->Form->input('promote', array(
'label' => __('Promoted to front page'),
'checked' => 'checked',
'class' => false,
)) .
$this->Form->input('user_id', array(
'label' => __('Publish as ')
)) .
$this->Form->input('created', array(
'type' => 'text',
'class' => 'span10',
));

echo $this->Html->endBox();
?>

<?php echo $this->Croogo->adminBoxes(); ?>

</div>
<?php echo $this->Form->end();?>
</div>
<?php echo $this->Form->end(); ?>
@@ -1,88 +1,137 @@
<?php
$this->extend('/Common/admin_index');
$this->Html->script(array('Nodes.nodes'), false);

$this->Html
->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('Content'), $this->here);

?>
<?php $this->start('tabs'); ?>
<li><?php echo $this->Html->link(__('Create content'), array('action' => 'create')); ?></li>
<li>
<?php echo $this->Html->link(
__('Create content'),
array('action'=>'create'),
array('button' => 'default')
); ?>
</li>
<?php $this->end(); ?>

<?php

if (isset($this->params['named'])) {
foreach ($this->params['named'] as $nn => $nv) {
$this->Paginator->options['url'][] = $nn . ':' . $nv;
}
}
echo $this->element('admin/nodes_filter');
?>

<?php echo $this->Form->create('Node', array('url' => array('controller' => 'nodes', 'action' => 'process'))); ?>
<table cellpadding="0" cellspacing="0">
<?php
$tableHeaders = $this->Html->tableHeaders(array(
'',
$this->Paginator->sort('id'),
$this->Paginator->sort('title'),
$this->Paginator->sort('type'),
$this->Paginator->sort('user_id'),
$this->Paginator->sort('status'),
$this->Paginator->sort('promote'),
//$this->Paginator->sort('created'),
__('Actions'),
));
echo $tableHeaders;

$rows = array();
foreach ($nodes as $node) {
$actions = $this->Html->link(__('Edit'), array('action' => 'edit', $node['Node']['id']));
$actions .= ' ' . $this->Croogo->adminRowActions($node['Node']['id']);
$actions .= ' ' . $this->Layout->processLink(__('Delete'),
'#Node' . $node['Node']['id'] . 'Id',
null, __('Are you sure?'));

$rows[] = array(
$this->Form->checkbox('Node.' . $node['Node']['id'] . '.id'),
$node['Node']['id'],
$this->Html->link($node['Node']['title'], array(
'admin' => false,
'controller' => 'nodes',
'action' => 'view',
'type' => $node['Node']['type'],
'slug' => $node['Node']['slug'],
)),
$node['Node']['type'],
$node['User']['username'],
$this->Layout->status($node['Node']['status']),
$this->Layout->status($node['Node']['promote']),
//$node['Node']['created'],
$actions,
);
}
echo $this->Form->create(
'Node',
array(
'url' => array('controller' => 'nodes', 'action' => 'process'),
'class' => 'form-inline'
)
);

echo $this->Html->tableCells($rows);
echo $tableHeaders;
?>
</table>
<div class="row-fluid">
<div class="span12">
<table class="table table-striped">
<?php
$tableHeaders = $this->Html->tableHeaders(array(
'',
$this->Paginator->sort('id'),
$this->Paginator->sort('title'),
$this->Paginator->sort('type'),
$this->Paginator->sort('user_id'),
$this->Paginator->sort('status'),
''
));
?>
<thead>
<?php echo $tableHeaders; ?>
</thead>

<div class="bulk-actions">
<?php
echo $this->Form->input('Node.action', array(
'label' => false,
'options' => array(
'publish' => __('Publish'),
'unpublish' => __('Unpublish'),
'promote' => __('Promote'),
'unpromote' => __('Unpromote'),
'delete' => __('Delete'),
),
'empty' => true,
));
$jsVarName = uniqid('confirmMessage_');
echo $this->Form->button(__('Submit'), array(
'type' => 'button',
'onclick' => sprintf('return Nodes.confirmProcess(app.%s)', $jsVarName),
));
$this->Js->set($jsVarName, __('%s selected items?'));
<tbody>
<?php foreach ($nodes as $node): ?>
<tr>
<td><?php echo $this->Form->checkbox('Node.'.$node['Node']['id'].'.id'); ?></td>
<td><?php echo $node['Node']['id']; ?></td>
<td>
<span>
<?php
echo $this->Html->link($node['Node']['title'], array(
'admin' => false,
'controller' => 'nodes',
'action' => 'view',
'type' => $node['Node']['type'],
'slug' => $node['Node']['slug']
));
?>
</span>
<?php if ($node['Node']['promote']): ?>
<span class="label label-info"><?php echo __('promoted'); ?></span>
<?php endif ?>
</td>
<td>
<?php echo $node['Node']['type']; ?>
</td>
<td>
<?php echo $node['User']['username']; ?>
</td>
<td>
<?php echo $this->Html->status($node['Node']['status']); ?>
</td>
<td>
<div class="item-actions">
<?php
echo $this->Croogo->adminRowActions($node['Node']['id']);
echo ' ' . $this->Croogo->adminRowAction(
'',
array('action' => 'edit', $node['Node']['id']),
array('icon' => 'pencil', 'tooltip' => __('Edit this item'))
);
echo ' ' . $this->Croogo->adminRowAction(
'',
'#Node' . $node['Node']['id'] . 'Id',
array('icon' => 'trash', 'tooltip' => __('Remove this item')),
__('Are you sure?')
);
?>
</div>
</td>
</tr>
<?php endforeach ?>
</tbody>

echo $this->Form->end();
?>
</table>

<div class="row-fluid">
<div class="control-group">
<?php echo $this->Form->input('Node.action', array(
'label' => __('Applying to selected'),
'div' => 'input inline',
'options' => array(
'publish' => __('Publish'),
'unpublish' => __('Unpublish'),
'promote' => __('Promote'),
'unpromote' => __('Unpromote'),
'delete' => __('Delete'),
),
'empty' => true,
)); ?>
<div class="controls">
<?php
$jsVarName = uniqid('confirmMessage_');
echo $this->Form->button(__('Submit'), array(
'type' => 'button',
'onclick' => sprintf('return Nodes.confirmProcess(app.%s)', $jsVarName),
));
$this->Js->set($jsVarName, __('%s selected items?'));
?>
</div>
</div>
</div>
</div>
</div>
<?php echo $this->Form->end(); ?>
@@ -1,17 +1,18 @@
<?php
echo $this->Html->css('admin');
echo $this->Html->script('jquery/jquery.min');

echo $this->Html->css('admin');
echo $this->Html->script('jquery/jquery.min');

?>
<script type="text/javascript">
$(document).ready(function() {
$('#nodes-for-links a').click(function() {
parent.$('#LinkLink').val($(this).attr('rel'));
parent.tb_remove();
return false;
});
<script>
$(function() {
$('#nodes-for-links a').click(function() {
parent.$('#LinkLink').val($(this).attr('rel'));
parent.tb_remove();
return false;
});
});
</script>

<div class="nodes">
<div>
<?php
@@ -21,7 +22,7 @@
}
}

__('Sort by:');
echo __('Sort by:');
echo ' ' . $this->Paginator->sort('id');
echo ', ' . $this->Paginator->sort('title');
echo ', ' . $this->Paginator->sort('created');
@@ -1,9 +1,9 @@
<?php
$this->Html->script(array('Nodes.nodes'), false);
if (Configure::read('Writing.wysiwyg')) {
$this->Html->scriptBlock($tinymce->fileBrowserCallBack(), array('inline' => false));
$this->Html->scriptBlock($tinymce->init('NodeBody'), array('inline' => false));
}
$this->Html->script(array('Nodes.nodes'), false);
if (Configure::read('Writing.wysiwyg')) {
$this->Html->scriptBlock($tinymce->fileBrowserCallBack(), array('inline' => false));
$this->Html->scriptBlock($tinymce->init('NodeBody'), array('inline' => false));
}
?>
<div class="nodes form">
<h2><?php echo $title_for_layout; ?></h2>
@@ -3,6 +3,7 @@
Croogo::hookComponent('*', 'Settings.Settings');

CroogoNav::add('settings', array(
'icon' => array('cog', 'large'),
'title' => __('Settings'),
'url' => array(
'admin' => true,
@@ -1,31 +1,53 @@
<?php $this->extend('/Common/admin_edit'); ?>
<?php echo $this->Form->create('Language'); ?>
<fieldset>
<div class="tabs">
<ul>
<li><a href="#language-basic"><?php echo __('Language'); ?></a></li>
<?php

$this->extend('/Common/admin_edit');

$this->Html
->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('Settings'), array('plugin' => 'settings', 'controller' => 'settings', 'action' => 'prefix', 'Site'))
->addCrumb(__('Language'), array('plugin' => 'settings', 'controller' => 'languages', 'action' => 'index'))
->addCrumb(__('Add'));

echo $this->Form->create('Language');

?>
<div class="row-fluid">
<div class="span8">

<ul class="nav nav-tabs">
<li><a href="#language-main" data-toggle="tab"><?php echo __('Language'); ?></a></li>
<?php echo $this->Croogo->adminTabs(); ?>
</ul>

<div id="language-basic">
<div class="tab-content">
<div id="language-main" class="tab-pane">
<?php
$this->Form->inputDefaults(array(
'class' => 'span10',
));
echo $this->Form->input('title');
echo $this->Form->input('native');
echo $this->Form->input('alias');
?>
</div>

<?php echo $this->Croogo->adminTabs(); ?>
</div>
</div>
<div class="span4">
<?php
echo $this->Form->input('title');
echo $this->Form->input('native');
echo $this->Form->input('alias');
echo $this->Form->input('status');
echo $this->Html->beginBox(__('Publishing')) .
$this->Form->button(__('Save'), array('button' => 'default')).
$this->Html->link(__('Cancel'),
array('action' => 'index'),
array('class' => 'cancel', 'button' => 'danger')
) .
$this->Form->input('status', array(
'class' => false,
)) .
$this->Html->endBox();
echo $this->Croogo->adminBoxes();
?>
</div>
<?php echo $this->Croogo->adminTabs(); ?>
</div>
</fieldset>

<div class="buttons">
<?php
echo $this->Form->end(__('Save'));
echo $this->Html->link(__('Cancel'), array(
'action' => 'index',
), array(
'class' => 'cancel',
));
?>
</div>
</div>
<?php echo $this->Form->end(); ?>
@@ -1,32 +1,63 @@
<?php $this->extend('/Common/admin_edit'); ?>
<?php echo $this->Form->create('Language'); ?>
<fieldset>
<div class="tabs">
<ul>
<li><a href="#language-basic"><?php echo __('Language'); ?></a></li>
<?php

$this->extend('/Common/admin_edit');

$this->Html
->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('Settings'), array('plugin' => 'settings', 'controller' => 'settings', 'action' => 'prefix', 'Site'))
->addCrumb(__('Language'), array('plugin' => 'settings', 'controller' => 'languages', 'action' => 'index'))
->addCrumb($this->data['Language']['title'], $this->here);

echo $this->Form->create('Language');

?>
<div class="row-fluid">
<div class="span8">
<ul class="nav nav-tabs">
<li><a href="#language-main" data-toggle="tab"><?php echo __('Language'); ?></a></li>
<?php echo $this->Croogo->adminTabs(); ?>
</ul>

<div id="language-basic">
<?php
echo $this->Form->input('id');
echo $this->Form->input('title');
echo $this->Form->input('native');
echo $this->Form->input('alias');
echo $this->Form->input('status');
?>
<div class="tab-content">
<div id="language-main" class="tab-pane">
<?php
$this->Form->inputDefaults(array(
'class' => 'span10',
));
echo $this->Form->input('id');
echo $this->Form->input('title', array(
'label' => false,
'placeholder' => __('Title'),
));
echo $this->Form->input('native', array(
'label' => false,
'placeholder' => __('Native'),
));
echo $this->Form->input('alias', array(
'label' => false,
'placeholder' => __('Alias'),
));
?>
</div>

<?php echo $this->Croogo->adminTabs(); ?>
</div>
<?php echo $this->Croogo->adminTabs(); ?>
</div>
</fieldset>

<div class="buttons">
<?php
echo $this->Form->end(__('Save'));
echo $this->Html->link(__('Cancel'), array(
'action' => 'index',
), array(
'class' => 'cancel',
));
?>
</div>
<div class="span4">
<?php
echo $this->Html->beginBox(__('Publishing')) .
$this->Form->button(__('Save'), array('button' => 'default')).
$this->Html->link(
__('Cancel'),
array('action' => 'index'),
array('class' => 'cancel', 'button' => 'danger')
) .
$this->Form->input('status', array('class' => false)) .
$this->Html->endBox();

echo $this->Croogo->adminBoxes();
?>
</div>
</div>
<?php $this->Form->end(); ?>
@@ -1,39 +1,67 @@
<?php $this->extend('/Common/admin_index'); ?>

<table cellpadding="0" cellspacing="0">
<?php
$tableHeaders = $this->Html->tableHeaders(array(
$this->Paginator->sort('id'),
$this->Paginator->sort('title'),
$this->Paginator->sort('native'),
$this->Paginator->sort('alias'),
$this->Paginator->sort('status'),
__('Actions'),
));
echo $tableHeaders;

$rows = array();
foreach ($languages as $language) {
$actions = $this->Html->link(__('Move up'), array('action' => 'moveup', $language['Language']['id']));
$actions .= ' ' . $this->Html->link(__('Move down'), array('action' => 'movedown', $language['Language']['id']));
$actions .= ' ' . $this->Html->link(__('Edit'), array('action' => 'edit', $language['Language']['id']));
$actions .= ' ' . $this->Croogo->adminRowActions($language['Language']['id']);
$actions .= ' ' . $this->Form->postLink(__('Delete'), array(
'action' => 'delete',
$language['Language']['id'],
), null, __('Are you sure?'));
$this->extend('/Common/admin_index');

$rows[] = array(
$language['Language']['id'],
$language['Language']['title'],
$language['Language']['native'],
$language['Language']['alias'],
$this->Layout->status($language['Language']['status']),
$actions,
);
}
$this->Html->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('Settings'), array('plugin' => 'settings', 'controller' => 'settings', 'action' => 'prefix', 'Site'))
->addCrumb(__('Languages'), $this->here);

echo $this->Html->tableCells($rows);
echo $tableHeaders;
?>
</table>
<div class="row-fluid">
<div class="span12">
<table class="table table-striped">
<?php
$tableHeaders = $this->Html->tableHeaders(array(
$this->Paginator->sort('id'),
$this->Paginator->sort('title'),
$this->Paginator->sort('native'),
$this->Paginator->sort('alias'),
$this->Paginator->sort('status'),
__('Actions'),
));
?>
<thead>
<?php echo $tableHeaders; ?>
</thead>
<?php

$rows = array();
foreach ($languages as $language) {
$actions = array();
$actions[] = $this->Croogo->adminRowActions($language['Language']['id']);
$actions[] = $this->Croogo->adminRowAction('',
array('action' => 'moveup', $language['Language']['id']),
array('icon' => 'chevron-up', 'tooltip' => __('Move up'))
);
$actions[] = $this->Croogo->adminRowAction('',
array('action' => 'movedown', $language['Language']['id']),
array('icon' => 'chevron-down', 'tooltip' => __('Move down'))
);
$actions[] = $this->Croogo->adminRowAction('',
array('action' => 'edit', $language['Language']['id']),
array('icon' => 'pencil', 'tooltip' => __('Edit this item'))
);
$actions[] = $this->Croogo->adminRowAction('',
array('action' => 'delete', $language['Language']['id']),
array('icon' => 'trash', 'tooltip' => __('Remove this item')),
__('Are you sure?')
);

$actions = $this->Html->div('item-actions', implode(' ', $actions));

$rows[] = array(
$language['Language']['id'],
$language['Language']['title'],
$language['Language']['native'],
$language['Language']['alias'],
$this->Html->status($language['Language']['status']),
$actions,
);
}

echo $this->Html->tableCells($rows);
?>
</table>
</div>
</div>
</div>
@@ -1,12 +1,33 @@
<div class="languages">
<h2><?php echo $title_for_layout; ?></h2>
<?php

<div class="actions">
<ul>
<li><?php echo $this->Html->link(__('New Language'), array('action' => 'add')); ?></li>
$this->Html
->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('Settings'), array('plugin' => 'settings', 'controller' => 'settings', 'action' => 'index'))
->addCrumb(__('Languages'), array('plugin' => 'settings', 'controller' => 'languages', 'action' => 'index'))
;

?>
<div class="row-fluid">

<div class="span12 actions">
<ul class="nav-buttons">
<li>
<?php
echo $this->Html->link(
__('New Language'),
array('action'=>'add'),
array('button' => 'default')
);
?>
</li>
</ul>
</div>

<div class="languages span12">

<h4><?php echo $title_for_layout; ?></h4>

<ul>
<?php
foreach ($languages as $language) {
$title = $language['Language']['title'] . ' (' . $language['Language']['native'] . ')';
@@ -18,7 +39,10 @@
$modelAlias,
'locale' => $language['Language']['alias'],
));
echo '<h3>' . $link . '</h3>';
echo '<li>' . $link . '</li>';
}
?>
</ul>
</div>

</div>
@@ -1,40 +1,80 @@
<?php $this->extend('/Common/admin_edit'); ?>
<?php echo $this->Form->create('Setting');?>
<fieldset>
<div class="tabs">
<ul>
<li><a href="#setting-basic"><span><?php echo __('Settings'); ?></span></a></li>
<li><a href="#setting-misc"><span><?php echo __('Misc.'); ?></span></a></li>
<?php
$this->extend('/Common/admin_edit');

$this->Html
->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('Settings'), array(
'admin' => true,
'plugin' => 'settings',
'controller' => 'settings',
'action' => 'index',
))
->addCrumb(__('Add'));

echo $this->Form->create('Setting');

?>
<div class="row-fluid">
<div class="span8">
<ul class="nav nav-tabs">
<li><a href="#setting-basic" data-toggle="tab"><?php echo __('Settings'); ?></a></li>
<li><a href="#setting-misc" data-toggle="tab"><?php echo __('Misc.'); ?></a></li>
</ul>

<div id="setting-basic">
<div class="tab-content">
<div id="setting-basic" class="tab-pane">
<?php
echo $this->Form->input('key', array('rel' => __("e.g., 'Site.title'")));
echo $this->Form->input('value');
$this->Form->inputDefaults(array(
'label' => false,
'class' => 'span10',
));
echo $this->Form->input('key', array(
'rel' => __("e.g., 'Site.title'"),
'placeholder' => __('Key'),
));
echo $this->Form->input('value', array(
'placeholder' => __('Value'),
));
?>
</div>
</div>

<div id="setting-misc">
<div id="setting-misc" class="tab-pane">
<?php
echo $this->Form->input('title');
echo $this->Form->input('description');
echo $this->Form->input('input_type', array('rel' => __("e.g., 'text' or 'textarea'")));
echo $this->Form->input('editable', array('checked' => 'checked'));
//echo $this->Form->input('weight');
echo $this->Form->input('params');
echo $this->Form->input('title', array(
'placeholder' => __('Title'),
));
echo $this->Form->input('description', array(
'placeholder' => __('Description'),
));
echo $this->Form->input('input_type', array(
'placeholder' => __('Input Type'),
'rel' => __("e.g., 'text' or 'textarea'"),
));
echo $this->Form->input('editable', array(
'label' => __('Editable'),
'class' => false,
));
echo $this->Form->input('params', array(
'placeholder' => __('Params'),
));
?>
</div>

<?php echo $this->Croogo->adminTabs(); ?>
</div>
</div>

<div class="span4">
<?php
echo $this->Html->beginBox(__('Publishing')) .
$this->Form->button(__('Save'), array('button' => 'default')) .
$this->Html->link(__('Cancel'), array('action' => 'index'), array(
'button' => 'danger')) .
$this->Html->endBox();

echo $this->Croogo->adminBoxes();
?>
</div>
</fieldset>

<div class="buttons">
<?php
echo $this->Form->end(__('Save'));
echo $this->Html->link(__('Cancel'), array(
'action' => 'index',
), array(
'class' => 'cancel',
));
?>
</div>
<?php echo $this->Form->end(); ?>
@@ -1,3 +1,6 @@
<div class="dashboard index">
<h2><?php echo $title_for_layout; ?></h2>
</div>
<h2 class="hidden-desktop"><?php echo $title_for_layout; ?></h2>
<?php
$this->Html
->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('Dashboard'), $this->here);
?>
@@ -1,40 +1,81 @@
<?php $this->extend('/Common/admin_edit'); ?>
<?php echo $this->Form->create('Setting');?>
<fieldset>
<div class="tabs">
<ul>
<li><a href="#setting-basic"><span><?php echo __('Settings'); ?></span></a></li>
<li><a href="#setting-misc"><span><?php echo __('Misc.'); ?></span></a></li>
<?php
$this->extend('/Common/admin_edit');

$this->Html
->addCrumb($this->Html->icon('home'), '/admin')
->addCrumb(__('Settings'), array(
'admin' => true,
'plugin' => 'settings',
'controller' => 'settings',
'action' => 'index',
))
->addCrumb($this->data['Setting']['key']);

echo $this->Form->create('Setting');

?>
<div class="row-fluid">
<div class="span8">
<ul class="nav nav-tabs">
<li><a href="#setting-basic" data-toggle="tab"><?php echo __('Settings'); ?></a></li>
<li><a href="#setting-misc" data-toggle="tab"><?php echo __('Misc.'); ?></a></li>
</ul>

<div id="setting-basic">
<div class="tab-content">
<div id="setting-basic" class="tab-pane">
<?php
echo $this->Form->input('id');
echo $this->Form->input('key', array('rel' => __("e.g., 'Site.title'")));
echo $this->Form->input('value');
$this->Form->inputDefaults(array(
'label' => false,
'class' => 'span10',
));
echo $this->Form->input('key', array(
'rel' => __("e.g., 'Site.title'"),
'placeholder' => __('Key'),
));
echo $this->Form->input('value', array(
'placeholder' => __('Value'),
));
?>
</div>
</div>

<div id="setting-misc">
<div id="setting-misc" class="tab-pane">
<?php
echo $this->Form->input('title');
echo $this->Form->input('description');
echo $this->Form->input('input_type', array('rel' => __("e.g., 'text' or 'textarea'")));
echo $this->Form->input('editable');
//echo $this->Form->input('weight');
echo $this->Form->input('params');
echo $this->Form->input('title', array(
'placeholder' => __('Title'),
));
echo $this->Form->input('description', array(
'placeholder' => __('Description'),
));
echo $this->Form->input('input_type', array(
'placeholder' => __('Input Type'),
'rel' => __("e.g., 'text' or 'textarea'"),
));
echo $this->Form->input('editable', array(
'label' => __('Editable'),
'class' => false,
));
echo $this->Form->input('params', array(
'placeholder' => __('Params'),
));
?>
</div>

<?php echo $this->Croogo->adminTabs(); ?>
</div>
</div>
</fieldset>

<div class="buttons">
<?php
echo $this->Form->end(__('Save'));
echo $this->Html->link(__('Cancel'), array(
'action' => 'index',
), array(
'class' => 'cancel',
));
?>
</div>
<div class="span4">
<?php
echo $this->Html->beginBox(__('Publishing')) .
$this->Form->button(__('Save'), array('button' => 'default')) .
$this->Html->link(__('Cancel'), array('action' => 'index'), array(
'button' => 'danger')) .
$this->Html->endBox();

echo $this->Croogo->adminBoxes();
?>
</div>

</div>
<?php echo $this->Form->end(); ?>
@@ -1,6 +1,20 @@
<?php $this->extend('/Common/admin_index'); ?>
<?php

$this->extend('/Common/admin_index');

<table cellpadding="0" cellspacing="0">
$this->Html
->addCrumb('', '/admin', array('icon' => 'home'))
->addCrumb(__('Settings'), array(
'admin' => true,
'plugin' => 'settings',
'controller' => 'settings',
'action' => 'index',
));
if (!empty($this->request->params['named']['p'])) {
$this->Html->addCrumb($this->request->params['named']['p']);
}
?>
<table class="table table-striped">
<?php
$tableHeaders = $this->Html->tableHeaders(array(
$this->Paginator->sort('id'),
@@ -9,19 +23,31 @@
$this->Paginator->sort('editable'),
__('Actions'),
));
echo $tableHeaders;

?>
<thead>
<?php echo $tableHeaders; ?>
</thead>
<?php
$rows = array();
foreach ($settings as $setting) {
$actions = $this->Html->link(__('Move up'), array('controller' => 'settings', 'action' => 'moveup', $setting['Setting']['id']));
$actions .= ' ' . $this->Html->link(__('Move down'), array('controller' => 'settings', 'action' => 'movedown', $setting['Setting']['id']));
$actions .= ' ' . $this->Html->link(__('Edit'), array('controller' => 'settings', 'action' => 'edit', $setting['Setting']['id']));
$actions .= ' ' . $this->Croogo->adminRowActions($setting['Setting']['id']);
$actions .= ' ' . $this->Form->postLink(__('Delete'), array(
'controller' => 'settings',
'action' => 'delete',
$setting['Setting']['id'],
), null, __('Are you sure?'));
foreach ($settings as $setting):
$actions = array();
$actions[] = $this->Croogo->adminRowAction('',
array('controller' => 'settings', 'action' => 'moveup', $setting['Setting']['id']),
array('icon' => 'chevron-up', 'tooltip' => __('Move up'))
);
$actions[] = $this->Croogo->adminRowAction('',
array('controller' => 'settings', 'action' => 'movedown', $setting['Setting']['id']),
array('icon' => 'chevron-down', 'tooltip' => __('Move down'))
);
$actions[] = $this->Croogo->adminRowAction('',
array('controller' => 'settings', 'action' => 'edit', $setting['Setting']['id']),
array('icon' => 'pencil', 'tooltip' => __('Edit this item'))
);
$actions[] = $this->Croogo->adminRowActions($setting['Setting']['id']);
$actions[] = $this->Croogo->adminRowAction('',
array('controller' => 'settings', 'action' => 'delete', $setting['Setting']['id']),
array('icon' => 'trash','tooltip' => __('Remove this item')),
__('Are you sure?'));

$key = $setting['Setting']['key'];
$keyE = explode('.', $key);
@@ -31,17 +57,16 @@
} else {
$keyTitle = '';
}

$actions = $this->Html->div('item-actions', implode(' ', $actions));
$rows[] = array(
$setting['Setting']['id'],
$this->Html->link($keyPrefix, array('controller' => 'settings', 'action' => 'index', 'p' => $keyPrefix)) . $keyTitle,
$this->Text->truncate($setting['Setting']['value'], 20),
$setting['Setting']['editable'],
$actions,
);
}
endforeach;

echo $this->Html->tableCells($rows);
echo $tableHeaders;
?>
</table>