Added automated disabling of admin and development menu items (at least the ones that are explicitly added to those sections of the menu).
git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@765 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -213,44 +213,39 @@ class AppController extends Controller {
|
||||
/* array('controller' => 'tenders', 'action' => 'deposit'), null, */
|
||||
/* 'SITE', $this->op_area); */
|
||||
|
||||
if ($this->params['admin']) {
|
||||
$this->addSideMenuLink('Accounts',
|
||||
array('controller' => 'accounts', 'action' => 'index'), null,
|
||||
'SITE', $this->admin_area);
|
||||
$this->addSideMenuLink('Contacts',
|
||||
array('controller' => 'contacts', 'action' => 'index'), null,
|
||||
'SITE', $this->admin_area);
|
||||
$this->addSideMenuLink('Ledgers',
|
||||
array('controller' => 'ledgers', 'action' => 'index'), null,
|
||||
'SITE', $this->admin_area);
|
||||
$this->addSideMenuLink('Tenders',
|
||||
array('controller' => 'tenders', 'action' => 'index'), null,
|
||||
'SITE', $this->admin_area);
|
||||
$this->addSideMenuLink('Transactions',
|
||||
array('controller' => 'transactions', 'action' => 'index'), null,
|
||||
'SITE', $this->admin_area);
|
||||
$this->addSideMenuLink('Ldgr Entries',
|
||||
array('controller' => 'ledger_entries', 'action' => 'index'), null,
|
||||
'SITE', $this->admin_area);
|
||||
$this->addSideMenuLink('Stmt Entries',
|
||||
array('controller' => 'statement_entries', 'action' => 'index'), null,
|
||||
'SITE', $this->admin_area);
|
||||
$this->addSideMenuLink('Assess Charges',
|
||||
array('controller' => 'leases', 'action' => 'assess_all'), null,
|
||||
'SITE', $this->admin_area);
|
||||
}
|
||||
|
||||
if ($this->params['dev']) {
|
||||
$this->addSideMenuLink('Un-Nuke',
|
||||
'#', array('htmlAttributes' =>
|
||||
array('onclick' => '$(".pr-section").show(); return false;')),
|
||||
'SITE', $this->dev_area);
|
||||
$this->addSideMenuLink('New Ledgers',
|
||||
array('controller' => 'accounts', 'action' => 'newledger'), null,
|
||||
'SITE', $this->dev_area);
|
||||
//array('name' => 'RESET DATA', array('controller' => 'accounts', 'action' => 'reset_data'));
|
||||
}
|
||||
$this->addSideMenuLink('Accounts',
|
||||
array('controller' => 'accounts', 'action' => 'index'), null,
|
||||
'SITE', $this->admin_area);
|
||||
$this->addSideMenuLink('Contacts',
|
||||
array('controller' => 'contacts', 'action' => 'index'), null,
|
||||
'SITE', $this->admin_area);
|
||||
$this->addSideMenuLink('Ledgers',
|
||||
array('controller' => 'ledgers', 'action' => 'index'), null,
|
||||
'SITE', $this->admin_area);
|
||||
$this->addSideMenuLink('Tenders',
|
||||
array('controller' => 'tenders', 'action' => 'index'), null,
|
||||
'SITE', $this->admin_area);
|
||||
$this->addSideMenuLink('Transactions',
|
||||
array('controller' => 'transactions', 'action' => 'index'), null,
|
||||
'SITE', $this->admin_area);
|
||||
$this->addSideMenuLink('Ldgr Entries',
|
||||
array('controller' => 'ledger_entries', 'action' => 'index'), null,
|
||||
'SITE', $this->admin_area);
|
||||
$this->addSideMenuLink('Stmt Entries',
|
||||
array('controller' => 'statement_entries', 'action' => 'index'), null,
|
||||
'SITE', $this->admin_area);
|
||||
$this->addSideMenuLink('Assess Charges',
|
||||
array('controller' => 'leases', 'action' => 'assess_all'), null,
|
||||
'SITE', $this->admin_area);
|
||||
|
||||
$this->addSideMenuLink('Un-Nuke',
|
||||
'#', array('htmlAttributes' =>
|
||||
array('onclick' => '$(".pr-section").show(); return false;')),
|
||||
'SITE', $this->dev_area);
|
||||
$this->addSideMenuLink('New Ledgers',
|
||||
array('controller' => 'accounts', 'action' => 'newledger'), null,
|
||||
'SITE', $this->dev_area);
|
||||
//array('name' => 'RESET DATA', array('controller' => 'accounts', 'action' => 'reset_data'));
|
||||
|
||||
$this->sideMenuAreaName('Operations', 'SITE', $this->op_area);
|
||||
}
|
||||
@@ -274,6 +269,13 @@ class AppController extends Controller {
|
||||
|
||||
$this->addDefaultSideMenuLinks();
|
||||
$this->sideMenuEnable('SITE', $this->op_area, false);
|
||||
|
||||
foreach ($this->sidemenu['areas'] AS $area_name => $area) {
|
||||
if (empty($this->params['dev']))
|
||||
$this->sideMenuEnable($area_name, $this->dev_area, false);
|
||||
if (empty($this->params['admin']))
|
||||
$this->sideMenuEnable($area_name, $this->admin_area, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -204,10 +204,10 @@ class AccountsController extends AppController {
|
||||
|
||||
$this->addSideMenuLink('New Ledger',
|
||||
array('action' => 'newledger', $id), null,
|
||||
'ACTION');
|
||||
'ACTION', $this->admin_area);
|
||||
$this->addSideMenuLink('Collected',
|
||||
array('action' => 'collected', $id), null,
|
||||
'ACTION');
|
||||
'ACTION', $this->admin_area);
|
||||
|
||||
// Prepare to render
|
||||
$title = 'Account: ' . $account['Account']['name'];
|
||||
|
||||
@@ -424,14 +424,13 @@ class TransactionsController extends AppController {
|
||||
array('action' => 'deposit_slip', $id), null,
|
||||
'ACTION');
|
||||
|
||||
if ($this->params['dev'])
|
||||
$this->addSideMenuLink('Destroy',
|
||||
array('action' => 'destroy', $id),
|
||||
array('confirmMessage' =>
|
||||
"This may leave the database in an unstable state." .
|
||||
" Do NOT do this unless you know what you're doing." .
|
||||
" Proceed anyway?"),
|
||||
'ACTION', $this->dev_area);
|
||||
$this->addSideMenuLink('Destroy',
|
||||
array('action' => 'destroy', $id),
|
||||
array('confirmMessage' =>
|
||||
"This may leave the database in an unstable state." .
|
||||
" Do NOT do this unless you know what you're doing." .
|
||||
" Proceed anyway?"),
|
||||
'ACTION', $this->dev_area);
|
||||
|
||||
// OK, prepare to render.
|
||||
$title = 'Transaction #' . $transaction['Transaction']['id'];
|
||||
|
||||
Reference in New Issue
Block a user