diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-06-28 19:45:11 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-06-28 19:45:11 -0700 |
commit | c4f991bb7d7e90f8c55897f89888d9196c7e438f (patch) | |
tree | 6f4c164a8881f0bd1560e4966f4984e711c287c5 /modules/gallery/libraries/Admin_View.php | |
parent | 228962f0e836c303174d0be6d0ff246628ea85d9 (diff) |
Clean up the combined javascript change and refactor out the
Gallery_View base class from Theme_View and Admin_View.
1) Move all the theme specific jquery stuff from gallery_theme::head()
and admin_head() into the theme files. Use $theme->script() as
appropriate.
2) Get rid of the extra boolean on $theme->url() that we were using so
that we could call $theme->script($theme->url(...)) -- add
$theme->theme_script() instead (poorly named, but still clearer than
what we had before)
3) Fix the bug that combined scripts didn't work at all in the admin
theme.
4) Get rid of $theme->display() in favor of new View(...)
Diffstat (limited to 'modules/gallery/libraries/Admin_View.php')
-rw-r--r-- | modules/gallery/libraries/Admin_View.php | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/modules/gallery/libraries/Admin_View.php b/modules/gallery/libraries/Admin_View.php index 7a7396eb..01496c0d 100644 --- a/modules/gallery/libraries/Admin_View.php +++ b/modules/gallery/libraries/Admin_View.php @@ -17,9 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class Admin_View_Core extends View { - private $theme_name = null; - +class Admin_View_Core extends Gallery_View { /** * Attempts to load a view and pre-load view data. * @@ -46,15 +44,6 @@ class Admin_View_Core extends View { $this->set_global("user", user::active()); } - public function url($path, $absolute_url=false) { - $arg = "themes/{$this->theme_name}/$path"; - return $absolute_url ? url::abs_file($arg) : url::file($arg); - } - - public function display($page_name, $view_class="View") { - return new $view_class($page_name); - } - public function admin_menu() { $menu = Menu::factory("root"); gallery_menu::admin($menu, $this); @@ -109,6 +98,10 @@ class Admin_View_Core extends View { } } + if ($function == "admin_head") { + array_unshift($blocks, $this->combine_script()); + } + if (Session::instance()->get("debug")) { if ($function != "admin_head") { array_unshift( |