Thursday, October 2, 2008

trying to add new pages and use same layout page in Bakesale

Hi All. I am trying to edit the Bakesale library I downloaded from the
internet, which runs on cake. BakeSale uses, to layouts - admin, and
show. I have added 2 new sets of controllers, views, models. If I type
in users/register , it keeps opening up in the 'CakePHP: the rapid
development php framework' default page, and NOT in the show - layout.
I have been looking everywhere, and can not findout where they 'force'
the views to open up in the specific layout. ( I have created a
'default' layout - and this kind of work) but this is not what I want
to do. Does anyone have any ideas, it would be grate - the only code I
find that might explain it is in the app_controller, posted below.

function beforeFilter() {
$this->_checkLogin();
if (!isset($this->params['requested'])) {
Configure::load('custom/bakesale_config');
Configure::write('Config.language',
Configure::read('Site.locale'));
$this->theme = Configure::read('Site.theme');
$this->_setDefaults();
$this->addUrl();
}
}

function _setDefaults() {
$bodyClass = $checked = $selected = '';
$extraCss = array();
$isAdmin = $simpleLayout = false;
if($this->Session->check('Auth.User.role')== 'role') {
$isAdmin = true;
}
$this->set(compact('bodyClass', 'checked', 'selected', 'isAdmin',
'extraCss', 'simpleLayout'));

if(!isset($this->params['admin'])) {
$this->layout = 'shop';
} else {
$this->Session->write('Admin.id', '1');
$this->layout = 'admin';
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: