From 8301c0f6af2edef3a402b0efa2dd2a18e23456a5 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 23 Feb 2014 14:54:35 +1100 Subject: [PATCH] Updates from lnApp --- .../classes/Controller/TemplateDefault.php | 27 ---- application/classes/Menu.php | 7 +- application/classes/ORM.php | 147 +----------------- application/classes/Request.php | 19 +-- application/classes/URL.php | 78 ---------- application/media/js/custom.js | 16 -- application/media/js/search.js | 14 -- application/views/theme/baseadmin/page.php | 10 +- .../views/theme/baseadmin/pages/navbar.php | 10 -- modules/lnApp | 2 +- 10 files changed, 13 insertions(+), 317 deletions(-) delete mode 100644 application/classes/URL.php delete mode 100644 application/media/js/search.js delete mode 100644 application/views/theme/baseadmin/pages/navbar.php diff --git a/application/classes/Controller/TemplateDefault.php b/application/classes/Controller/TemplateDefault.php index 68a61d12..47ad8896 100644 --- a/application/classes/Controller/TemplateDefault.php +++ b/application/classes/Controller/TemplateDefault.php @@ -12,33 +12,6 @@ abstract class Controller_TemplateDefault extends lnApp_Controller_TemplateDefault { protected $auth_required = TRUE; - // Our acccount object - protected $ao; - - public function __construct(Request $request, Response $response) { - $this->template = Config::theme().'/page'; - - return parent::__construct($request,$response); - } - - public function before() { - // If our action doesnt exist, no point processing any further. - if (! method_exists($this,'action_'.Request::current()->action())) - return; - - if ($this->auth_required) { - if (! count($this->secure_actions) OR (! isset($this->secure_actions[Request::current()->action()]))) - throw HTTP_Exception::factory(403,'Class has no security defined :class, or no security configured for :method',array(':class'=>get_class($this),':method'=>Request::current()->action())); - - $this->ao = Auth::instance()->get_user(); - - if (! is_null($this->ao) AND (is_string($this->ao) OR ! $this->ao->loaded())) - throw HTTP_Exception::factory(501,'Account doesnt exist :account ?',array(':account'=>(is_string($this->ao) OR is_null($this->ao)) ? $this->ao : Auth::instance()->get_user()->id)); - } - - parent::before(); - } - // @todo To rework public function after() { $dc = URL::link('user','welcome/index'); diff --git a/application/classes/Menu.php b/application/classes/Menu.php index f5a9d66e..3dcf722a 100644 --- a/application/classes/Menu.php +++ b/application/classes/Menu.php @@ -9,7 +9,7 @@ * @copyright (c) 2009-2013 Open Source Billing * @license http://dev.osbill.net/license.html */ -class Menu { +class Menu extends lnApp_Menu { private static function collapse(array $array) { $result = array(); @@ -46,16 +46,15 @@ class Menu { return self::collapse($result); } - public static function ul(array $result,array $append=NULL,$sub=FALSE) { + public static function ul($type,array $result,array $append=NULL,$sub=FALSE,$method=NULL) { $output = $sub ? '