From: Andrey Kutejko Date: Tue, 17 Dec 2013 05:12:35 +0000 (+0200) Subject: admin: move repeating params to context X-Git-Tag: 0.5~9 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=b8bb93646df890dffdc5f918cc1ca8b3d2583bfd;p=ipf.git admin: move repeating params to context --- diff --git a/ipf/admin/app.php b/ipf/admin/app.php index 0af7c96..8c74d61 100644 --- a/ipf/admin/app.php +++ b/ipf/admin/app.php @@ -32,6 +32,8 @@ class IPF_Admin_App extends IPF_Application return array( 'IPF_VER' => IPF::version(), 'ADMIN_MEDIA_URL' => IPF::get('static_url') . 'admin/', + 'admin_title' => IPF::get('admin_title'), + 'indexpage_url' => IPF::get('indexpage_url', '/'), ); } diff --git a/ipf/admin/model.php b/ipf/admin/model.php index 794cf3f..d39f992 100644 --- a/ipf/admin/model.php +++ b/ipf/admin/model.php @@ -682,8 +682,6 @@ class IPF_Admin_Model 'lapp'=>$lapp, 'perms'=>$perms, 'lmodel'=>$lmodel, - 'admin_title' => IPF::get('admin_title'), - 'indexpage_url'=>IPF::get('indexpage_url','/'), 'objecttools' => array(), ); return $this->renderToResponse($this->_getAddTemplate(), $context, $request); @@ -713,8 +711,6 @@ class IPF_Admin_Model 'lmodel'=>$lmodel, 'affected'=>array(), 'ipf_referrer'=>@$request->GET['ipf_referrer'], - 'admin_title' => IPF::get('admin_title'), - 'indexpage_url'=>IPF::get('indexpage_url','/'), ); return $this->renderToResponse('admin/delete.html', $context, $request); } @@ -785,8 +781,6 @@ class IPF_Admin_Model 'lapp'=>$lapp, 'perms'=>$perms, 'lmodel'=>$lmodel, - 'admin_title' => IPF::get('admin_title'), - 'indexpage_url'=>IPF::get('indexpage_url','/'), 'objecttools' => $objecttools, ); return $this->renderToResponse($this->_getChangeTemplate(), $context, $request); @@ -841,12 +835,10 @@ class IPF_Admin_Model 'title_add'=>$this->titleAdd(), 'perms'=>$perms, 'filters'=>$this->filters, - 'admin_title' => IPF::get('admin_title'), 'is_search' => $this->_isSearch(), 'search_value' => $this->search_value, 'lapp'=>$lapp, 'lmodel'=>$lmodel, - 'indexpage_url'=>IPF::get('indexpage_url','/'), ); return $this->renderToResponse($this->_getListTemplate(), $context, $request); } diff --git a/ipf/admin/views.php b/ipf/admin/views.php index c7b87cc..b650d95 100644 --- a/ipf/admin/views.php +++ b/ipf/admin/views.php @@ -51,8 +51,6 @@ function IPF_Admin_Views_Index($request, $match) 'page_title' => __('Site Administration'), 'app_list' => $app_list, 'admin_log' => $admin_log, - 'admin_title' => IPF::get('admin_title'), - 'indexpage_url'=>IPF::get('indexpage_url','/'), ); return IPF_Shortcuts::RenderToResponse('admin/index.html', $context, $request); } @@ -262,8 +260,6 @@ function IPF_Admin_Views_ChangePassword($request, $match) 'extra_js' => array(), 'lapp'=>$lapp, 'lmodel'=>$lmodel, - 'admin_title' => IPF::get('admin_title'), - 'indexpage_url'=>IPF::get('indexpage_url','/'), ); return IPF_Shortcuts::RenderToResponse('admin/changepassword.html', $context, $request); @@ -296,8 +292,6 @@ function IPF_Admin_Views_Login($request, $match) 'form' => $form, 'form_html' => IPF_Admin_App::renderForm($form), 'extra_js' => $form->extra_js(), - 'admin_title' => IPF::get('admin_title'), - 'indexpage_url'=>IPF::get('indexpage_url','/'), ); return IPF_Shortcuts::RenderToResponse('admin/login.html', $context, $request); } @@ -307,8 +301,6 @@ function IPF_Admin_Views_Logout($request, $match) IPF_Auth_App::logout($request); $context = array( 'page_title' => IPF::get('admin_title'), - 'admin_title' => IPF::get('admin_title'), - 'indexpage_url'=>IPF::get('indexpage_url','/'), ); return IPF_Shortcuts::RenderToResponse('admin/logout.html', $context, $request); } @@ -456,7 +448,6 @@ function IPF_Admin_Views_FileBrowser($request, $match) 'path' => $path, 'upload_url' => $upload_url, 'curr_dir' => $curr_dir, - 'indexpage_url'=>IPF::get('indexpage_url','/'), ); return IPF_Shortcuts::RenderToResponse('admin/filebrowser.html', $context, $request); }