Fixed breadcrumb, added submode()

This commit is contained in:
Deon George
2011-12-09 15:10:53 +11:00
parent 56c11507f4
commit 08eab4b5f9
13 changed files with 75 additions and 26 deletions

View File

@@ -39,9 +39,16 @@ abstract class Controller_lnApp_TemplateDefault extends Controller_Template {
* @var array actions that require a valid user
*/
protected $secure_actions = array(
'menu' => FALSE,
);
public function __construct(Request $request, Response $response) {
// Our Menu's can run without method authentication by default.
if (! isset($this->secure_actions['menu']))
$this->secure_actions['menu'] = FALSE;
return parent::__construct($request,$response);
}
/**
* Check and see if this controller needs authentication
*
@@ -197,6 +204,10 @@ abstract class Controller_lnApp_TemplateDefault extends Controller_Template {
// In case there any style sheets for this render.
$this->response->bodyadd(Style::factory());
// Since we are ajax, we should re-render the breadcrumb
Session::instance()->set('breadcrumb',(string)Breadcrumb::factory());
$this->response->bodyadd(Script::add(array('type'=>'stdin','data'=>'$().ready($("#ajCONTROL").load("'.URL::site('welcome/breadcrumb').'",null,function(x,s,r) {}));')));
// In case there any javascript for this render.
$this->response->bodyadd(Script::factory());

View File

@@ -101,7 +101,7 @@ $(function () {
'attr'=>array('id'=>sprintf('B_%s',$branch['id'])),
'state'=>$branch['state'],
'data'=>array('title'=>$branch['name']),
'attr'=>array('id'=>sprintf('N_%s',$branch['id']),'href'=>empty($branch['attr_href']) ? URL::site(sprintf('%s/menu',$branch['name'])) : $branch['attr_href']),
'attr'=>array('id'=>sprintf('N_%s',$branch['id']),'href'=>empty($branch['attr_href']) ? URL::site(sprintf('user/%s/menu',$branch['name'])) : $branch['attr_href']),
)
);
}