Skip to content

Commit

Permalink
adding the infinitas helper to app_controller
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Jan 19, 2010
1 parent c142844 commit e40e705
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class AppController extends Controller {
var $helpers = array(
'Html', 'Form', 'Javascript', 'Session',

'Libs.Status', 'Libs.Image', 'Libs.Design'
);
'Libs.Infinitas', 'Libs.Status', 'Libs.Image', 'Libs.Design'
);

var $components = array(
'Libs.Infinitas',
Expand All @@ -36,15 +36,15 @@ class AppController extends Controller {
// components
'Filter.Filter' => array(
'actions' => array('admin_index')
)
);
)
);

/**
* actions where viewable will work.
*/
var $viewableActions = array(
'view'
);
);

function beforeFilter() {
parent::beforeFilter();
Expand Down
45 changes: 45 additions & 0 deletions infinitas/management/models/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,50 @@ class Module extends ManagementAppModel{
'unique' => true
)
);

function getModules($position = null){
if (!$position) {
return array();
}

$positions = $this->find(
'all',
array(
'fields' => array(
'Module.id',
'Module.name',
'Module.content',
'Module.module',
'Module.config',
'Module.show_heading'
),
'conditions' => array(
'Position.name' => $position
),
'contain' => array(
'Position' => array(
'fields' => array(
'Position.id',
'Position.name'
)
),
'Group' => array(
'fields' => array(
'Group.id',
'Group.name'
)
),
'Route' => array(
'fields' => array(
'Route.id',
'Route.name'
)
)
)
)
);

return $positions;
}
}
?>

0 comments on commit e40e705

Please sign in to comment.