Skip to content

Commit

Permalink
doing the layout showing the tree a bit better
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Jan 29, 2010
1 parent 7c1f8dc commit f40b72a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
16 changes: 15 additions & 1 deletion infinitas/management/models/menu_item.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,19 @@ class MenuItem extends ManagementAppModel{
'Management.Group'
);

var $order = array(
'MenuItem.menu_id' => 'ASC',
'MenuItem.lft' => 'ASC'
);

function getMenu($type = null){
if (!$type) {
return false;
}

$menus = Cache::read('menu_'.$type);
if (!empty($menus)) {
return $menus;
//return $menus;
}

$menus = $this->find(
Expand All @@ -37,6 +42,15 @@ function getMenu($type = null){
'MenuItem.id',
'MenuItem.name',
'MenuItem.link',

'MenuItem.prefix',
'MenuItem.plugin',
'MenuItem.controller',
'MenuItem.action',
'MenuItem.params',
'MenuItem.force_backend',
'MenuItem.force_frontend',

'MenuItem.class',
'MenuItem.active',
'MenuItem.menu_id',
Expand Down
15 changes: 8 additions & 7 deletions infinitas/management/views/menu_items/admin_index.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,15 @@
<?php
$paths = ClassRegistry::init('Management.MenuItem')->getPath($menuItem['MenuItem']['id']);
$links = array();
foreach($paths as $path){
$links[] = $this->Html->link(
Inflector::humanize($path['MenuItem']['name']),
array('action' => 'edit', $path['MenuItem']['id'])
);
}

echo implode(' :: ', $links);
if (count($paths) > 1) {
echo '<b>', str_repeat('- ', count($paths)-1), ' |</b> ';
}

echo $this->Html->link(
Inflector::humanize($menuItem['MenuItem']['name']),
array('action' => 'edit', $menuItem['MenuItem']['id'])
);
?>&nbsp;
</td>
<td>
Expand Down
2 changes: 1 addition & 1 deletion views/layouts/admin.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@
</div>
<?php echo $this->element( 'admin/bottom' ); ?>
</body>
</html>
</html>

0 comments on commit f40b72a

Please sign in to comment.