From c766afd954271b02be0976bb10f13b8baba492ce Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 13 Apr 2017 08:54:59 -0700 Subject: [PATCH] Theme selection fix. Admin-ui carousel pagination fix. --- e107_admin/theme.php | 24 +++++++++++++++- e107_handlers/admin_ui.php | 33 +++++++++++++--------- e107_handlers/theme_handler.php | 7 +++-- e107_languages/English/admin/lan_theme.php | 1 + 4 files changed, 49 insertions(+), 16 deletions(-) diff --git a/e107_admin/theme.php b/e107_admin/theme.php index 90966c12e..f314ddd7b 100644 --- a/e107_admin/theme.php +++ b/e107_admin/theme.php @@ -280,6 +280,28 @@ class theme_admin_ui extends e_admin_ui public function ChooseObserver() // action = choose { + $mes = e107::getMessage(); + $tp = e107::getParser(); + + if(!empty($_POST['selectmain'])) + { + $id = key($_POST['selectmain']); + $message = $tp->lanVars(TPVLAN_94,$id); + + if($this->themeObj->setTheme($id)) + { + + $mes->addSuccess($message); + } + else + { + $mes->addError($message); + } + } + + + + $param = array(); $this->perPage = 0; $param['limitFrom'] = (int) $this->getQuery('from', 0); @@ -851,7 +873,7 @@ class theme_admin_form_ui extends e_admin_form_ui $infoPath = e_SELF."?mode=".$_GET['mode']."&id=".$theme['path']."&action=info&iframe=1"; $previewPath = $tp->replaceConstants($theme['thumbnail'],'abs'); - $main_icon = ($pref['sitetheme'] != $theme['path']) ? "" : ""; + $main_icon = ($pref['sitetheme'] != $theme['path']) ? "" : ""; $info_icon = "".$tp->toGlyph('fa-info-circle',array('size'=>'2x')).""; // $admin_icon = ($pref['admintheme'] != $theme['path'] ) ? "" : ""; diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index 439a947dd..aceffa02d 100644 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -6565,17 +6565,32 @@ class e_admin_form_ui extends e_form } + /** + * Render pagination + * @return string + */ public function renderPagination() { if($this->getController()->getGrid('carousel') === true) { return '
- - 1 - -
'; + + 1 + + '; } + $tree = $this->getController()->getTreeModel(); + $totalRecords = $tree->getTotal(); + $perPage = $this->getController()->getPerPage(); + $fromPage = $this->getController()->getQuery('from', 0); + + $vars = $this->getController()->getQuery(); + $vars['from'] = '[FROM]'; + + $paginate = http_build_query($vars); + + return $this->pagination(e_REQUEST_SELF.'?'.$paginate,$totalRecords,$fromPage,$perPage,array('template'=>'basic')); } @@ -6627,15 +6642,7 @@ class e_admin_form_ui extends e_form // $tree = $this->getTree(); // $total = $this->getTotal(); - $tree = $this->getController()->getTreeModel(); - $totalRecords = $tree->getTotal(); - $perPage = $this->getController()->getPerPage(); - $fromPage = $this->getController()->getQuery('from', 0); - $vars = $this->getController()->getQuery(); - $vars['from'] = '[FROM]'; - // var_dump($vars); - $paginate = http_build_query($vars); $text = "
@@ -6656,7 +6663,7 @@ class e_admin_form_ui extends e_form
".implode("\n", $filter_preserve_var)." ".$this->admin_button('etrigger_filter', 'etrigger_filter', 'filter e-hide-if-js', ADMIN_FILTER_ICON, array('id' => false,'title'=>LAN_FILTER))." - ".$this->pagination(e_REQUEST_SELF.'?'.$paginate,$totalRecords,$fromPage,$perPage,array('template'=>'basic'))." + ".$this->renderPagination()."