Skip to content

Commit

Permalink
fixing up the categories and code format
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed May 21, 2010
1 parent cf458e6 commit 4627d38
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 21 deletions.
4 changes: 3 additions & 1 deletion extensions/categories/categories_app_controller.php
@@ -1,4 +1,6 @@
<?php
class CategoriesAppController extends AppController {

var $helpers = array(
'Categories.Categories'
);
}
44 changes: 44 additions & 0 deletions extensions/categories/views/categories/admin_form.ctp
@@ -0,0 +1,44 @@
<?php
/**
* Comment Template.
*
* @todo -c Implement .this needs to be sorted out.
*
* Copyright (c) 2009 Carl Sutton ( dogmatic69 )
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright (c) 2009 Carl Sutton ( dogmatic69 )
* @link http://infinitas-cms.org
* @package sort
* @subpackage sort.comments
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @since 0.5a
*/

echo $this->Form->create('Category', array('action' => 'edit'));
echo $this->Infinitas->adminEditHead($this);
echo $this->Design->niceBox();
?>
<div class="data">
<?php
echo $this->Form->input('id');
echo $this->Form->input('title', array('class' => 'title'));
echo $this->Categories->wysiwyg('Category.description');
?>
</div>
<div class="config">
<?php
echo $this->Design->niceBox();
echo $this->Form->input('parent_id');
echo $this->Form->input('group_id', array('label' => __('Min Group', true), 'empty' => __('Public', true)));
echo $this->Form->input('active');
echo $this->Design->niceBoxEnd();
?>
</div>
<?php
echo $this->Design->niceBoxEnd();
echo $this->Form->end();
?>
43 changes: 23 additions & 20 deletions extensions/categories/views/categories/admin_index.ctp
Expand Up @@ -25,6 +25,7 @@
'preview',
'toggle',
'copy',
'move',
'delete'
)
);
Expand All @@ -35,39 +36,37 @@
<?php
echo $this->Infinitas->adminTableHeader(
array(
$this->Form->checkbox( 'all' ) => array(
$this->Form->checkbox('all') => array(
'class' => 'first',
'style' => 'width:25px;'
),
$this->Paginator->sort( 'title' ),
$this->Paginator->sort( 'Parent', 'Section.title' ),
$this->Paginator->sort( 'Group', 'Group.name' ) => array(
$this->Paginator->sort('title'),
$this->Paginator->sort('Group', 'Group.name') => array(
'style' => 'width:100px;'
),
$this->Paginator->sort( 'Items', 'content_count' ) => array(
$this->Paginator->sort('Items', 'content_count') => array(
'style' => 'width:35px;'
),
$this->Paginator->sort( 'views' ) => array(
$this->Paginator->sort('views') => array(
'style' => 'width:40px;'
),
$this->Paginator->sort( 'modified' ) => array(
$this->Paginator->sort('modified') => array(
'style' => 'width:100px;'
),
$this->Paginator->sort( 'ordering' ) => array(
$this->Paginator->sort('ordering') => array(
'style' => 'width:50px;'
),
__( 'Status', true ) => array(
__('Status', true) => array(
'style' => 'width:50px;'
)
)
);

$i = 0;
foreach ( $categories as $category )
{
foreach ($categories as $category){
?>
<tr class="<?php echo $this->Infinitas->rowClass(); ?>">
<td><?php echo $this->Form->checkbox( $category['Category']['id'] ); ?>&nbsp;</td>
<td><?php echo $this->Form->checkbox($category['Category']['id']); ?>&nbsp;</td>
<td>
<?php
$paths = ClassRegistry::init('Cms.Category')->getPath($category['Category']['id']);
Expand All @@ -84,10 +83,14 @@
?>
</td>
<td>
<?php echo $this->Html->link( $category['Parent']['title'], array('controller' => 'categories', 'action' => 'edit', $category['Parent']['id'] ) ); ?>
</td>
<td>
<?php echo $category['Group']['name']; ?>
<?php
if(!empty($category['Group']['name'])){
echo $category['Group']['name'];
}
else{
echo __('Public', true);
}
?>
</td>
<td style="text-align:center;">
<?php echo $category['Category']['item_count']; ?>
Expand All @@ -96,15 +99,15 @@
<?php echo $category['Category']['views']; ?>
</td>
<td>
<?php echo $this->Time->niceShort( $category['Category']['modified'] ); ?>
<?php echo $this->Time->niceShort($category['Category']['modified']); ?>
</td>
<td>
<?php echo $this->Infinitas->treeOrdering( $category['Category'] ); ?>&nbsp;
<?php echo $this->Infinitas->treeOrdering($category['Category']); ?>&nbsp;
</td>
<td>
<?php
echo $this->Infinitas->status( $category['Category']['active'], $category['Category']['id'] ),
$this->Infinitas->locked( $category, 'Category' );
echo $this->Infinitas->status($category['Category']['active'], $category['Category']['id']),
$this->Infinitas->locked($category, 'Category');
?>
</td>
</tr>
Expand Down
4 changes: 4 additions & 0 deletions extensions/categories/views/helpers/categories.php
@@ -0,0 +1,4 @@
<?php
class CategoriesHelper extends AppHelper{

}

0 comments on commit 4627d38

Please sign in to comment.