Moved all controllers to the new addGridViewSideMenuLinks virtual function.
git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@777 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -8,31 +8,13 @@ class AccountsController extends AppController {
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
* override: addDefaultSideMenuLinks
|
||||
* - Adds controller specific default side menu links
|
||||
* override: addGridViewSideMenuLinks
|
||||
* - Adds grid view navigation side menu links
|
||||
*/
|
||||
|
||||
function addDefaultSideMenuLinks() {
|
||||
parent::addDefaultSideMenuLinks();
|
||||
}
|
||||
function addGridViewSideMenuLinks() {
|
||||
parent::addGridViewSideMenuLinks();
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
* action: index / asset / liability / equity / income / expense / all
|
||||
* - Generate a chart of accounts
|
||||
*/
|
||||
|
||||
function index() { $this->all(); }
|
||||
function asset() { $this->gridView('Asset Accounts'); }
|
||||
function liability() { $this->gridView('Liability Accounts'); }
|
||||
function equity() { $this->gridView('Equity Accounts'); }
|
||||
function income() { $this->gridView('Income Accounts'); }
|
||||
function expense() { $this->gridView('Expense Accounts'); }
|
||||
function all() { $this->gridView('All Accounts', 'all'); }
|
||||
|
||||
function gridView($title, $action = null, $element = null) {
|
||||
$this->addSideMenuLink('Asset',
|
||||
array('controller' => 'accounts', 'action' => 'asset'), null,
|
||||
'CONTROLLER');
|
||||
@@ -51,10 +33,25 @@ class AccountsController extends AppController {
|
||||
$this->addSideMenuLink('All',
|
||||
array('controller' => 'accounts', 'action' => 'all'), null,
|
||||
'CONTROLLER');
|
||||
parent::gridView($title, $action, $element);
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
* action: index / asset / liability / equity / income / expense / all
|
||||
* - Generate a chart of accounts
|
||||
*/
|
||||
|
||||
function index() { $this->all(); }
|
||||
function asset() { $this->gridView('Asset Accounts'); }
|
||||
function liability() { $this->gridView('Liability Accounts'); }
|
||||
function equity() { $this->gridView('Equity Accounts'); }
|
||||
function income() { $this->gridView('Income Accounts'); }
|
||||
function expense() { $this->gridView('Expense Accounts'); }
|
||||
function all() { $this->gridView('All Accounts', 'all'); }
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user