// Fix Page header toolbar
This commit is contained in:
1 parent
7643a45d81
commit
235af94a92
5 files changed
+60
-20
No files matched your search
@@ -25,6 +25,26 @@
|
|||||||
|
|
||||||
{if isset($content)}
|
{if isset($content)}
|
||||||
{if isset($show_page_header_toolbar) && $show_page_header_toolbar}
|
{if isset($show_page_header_toolbar) && $show_page_header_toolbar}
|
||||||
|
<div class="leadin">
|
||||||
|
{foreach from=$page_header_toolbar_btn item=btn key=k}
|
||||||
|
{if $k == 'modules-list'}
|
||||||
|
<div class="modal fade" id="modules_list_container">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
<h3 class="modal-title">{l s='Modules'}</h3>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div id="modules_list_container_tab" style="display:none;"></div>
|
||||||
|
<div id="modules_list_loader"><img src="../img/loader.gif" alt=""/></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
{/foreach}
|
||||||
|
</div>
|
||||||
{include file="page_header_toolbar.tpl" toolbar_btn=$page_header_toolbar_btn title=$page_header_toolbar_title}
|
{include file="page_header_toolbar.tpl" toolbar_btn=$page_header_toolbar_btn title=$page_header_toolbar_title}
|
||||||
{/if}
|
{/if}
|
||||||
{$content}
|
{$content}
|
||||||
|
|||||||
@@ -40,22 +40,6 @@
|
|||||||
<i class="{if isset($btn.icon)}{$btn.icon}{else}process-icon-{if isset($btn.imgclass)}{$btn.imgclass}{else}{$k}{/if}{/if} {if isset($btn.class)}{$btn.class}{/if}" ></i>
|
<i class="{if isset($btn.icon)}{$btn.icon}{else}process-icon-{if isset($btn.imgclass)}{$btn.imgclass}{else}{$k}{/if}{/if} {if isset($btn.class)}{$btn.class}{/if}" ></i>
|
||||||
<div {if isset($btn.force_desc) && $btn.force_desc == true } class="locked" {/if}>{$btn.desc}</div>
|
<div {if isset($btn.force_desc) && $btn.force_desc == true } class="locked" {/if}>{$btn.desc}</div>
|
||||||
</a>
|
</a>
|
||||||
{if $k == 'modules-list'}
|
|
||||||
<div class="modal fade" id="modules_list_container">
|
|
||||||
<div class="modal-dialog">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
||||||
<h3 class="modal-title">{l s='Modules'}</h3>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<div id="modules_list_container_tab" style="display:none;"></div>
|
|
||||||
<div id="modules_list_loader"><img src="../img/loader.gif" alt=""/></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
</li>
|
</li>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -1102,6 +1102,8 @@ class AdminControllerCore extends Controller
|
|||||||
'page_header_toolbar_title' => $this->page_header_toolbar_title,
|
'page_header_toolbar_title' => $this->page_header_toolbar_title,
|
||||||
'page_header_toolbar_btn' => $this->page_header_toolbar_btn
|
'page_header_toolbar_btn' => $this->page_header_toolbar_btn
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$this->addPageHeaderToolBarModulesListButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1551,6 +1553,7 @@ class AdminControllerCore extends Controller
|
|||||||
elseif (is_array($this->tab_modules_list['slider_list']) && count($this->tab_modules_list['slider_list']))
|
elseif (is_array($this->tab_modules_list['slider_list']) && count($this->tab_modules_list['slider_list']))
|
||||||
{
|
{
|
||||||
$this->addToolBarModulesListButton();
|
$this->addToolBarModulesListButton();
|
||||||
|
$this->addPageHeaderToolBarModulesListButton();
|
||||||
$this->context->smarty->assign(array(
|
$this->context->smarty->assign(array(
|
||||||
'tab_modules_list' => implode(',', $this->tab_modules_list['slider_list']),
|
'tab_modules_list' => implode(',', $this->tab_modules_list['slider_list']),
|
||||||
'admin_module_ajax_url' => $this->context->link->getAdminLink('AdminModules'),
|
'admin_module_ajax_url' => $this->context->link->getAdminLink('AdminModules'),
|
||||||
@@ -1559,6 +1562,28 @@ class AdminControllerCore extends Controller
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function addPageHeaderToolBarModulesListButton()
|
||||||
|
{
|
||||||
|
if (!$this->isFresh(Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, 86400))
|
||||||
|
file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, Tools::addonsRequest('native'));
|
||||||
|
|
||||||
|
$country_module_list = file_get_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST);
|
||||||
|
if (!empty($country_module_list) && $country_module_list_xml = simplexml_load_string($country_module_list))
|
||||||
|
{
|
||||||
|
$country_module_list_array = array();
|
||||||
|
foreach ($country_module_list_xml->module as $k => $m)
|
||||||
|
$country_module_list_array[] = (string)$m->name;
|
||||||
|
|
||||||
|
$this->tab_modules_list['slider_list'] = array_intersect($this->tab_modules_list['slider_list'], $country_module_list_array);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_array($this->tab_modules_list['slider_list']) && count($this->tab_modules_list['slider_list']))
|
||||||
|
$this->page_header_toolbar_btn['modules-list'] = array(
|
||||||
|
'href' => '#',
|
||||||
|
'desc' => $this->l('Modules List')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
protected function addToolBarModulesListButton()
|
protected function addToolBarModulesListButton()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ class AdminAccessControllerCore extends AdminController
|
|||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->bootstrap = true;
|
$this->bootstrap = true;
|
||||||
|
$this->show_toolbar = false;
|
||||||
$this->table = 'access';
|
$this->table = 'access';
|
||||||
$this->className = 'Profile';
|
$this->className = 'Profile';
|
||||||
$this->multishop_context = Shop::CONTEXT_ALL;
|
$this->multishop_context = Shop::CONTEXT_ALL;
|
||||||
@@ -44,6 +45,12 @@ class AdminAccessControllerCore extends AdminController
|
|||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function initPageHeaderToolbar()
|
||||||
|
{
|
||||||
|
$this->page_header_toolbar_title = $this->l('Permissions');
|
||||||
|
parent::initPageHeaderToolbar();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AdminController::renderForm() override
|
* AdminController::renderForm() override
|
||||||
* @see AdminController::renderForm()
|
* @see AdminController::renderForm()
|
||||||
@@ -118,6 +125,8 @@ class AdminAccessControllerCore extends AdminController
|
|||||||
if (!$this->loadObject(true))
|
if (!$this->loadObject(true))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
$this->initPageHeaderToolbar();
|
||||||
|
|
||||||
$this->content .= $this->renderForm();
|
$this->content .= $this->renderForm();
|
||||||
$this->context->smarty->assign(array(
|
$this->context->smarty->assign(array(
|
||||||
'content' => $this->content,
|
'content' => $this->content,
|
||||||
|
|||||||
@@ -35,12 +35,14 @@ class AdminInformationControllerCore extends AdminController
|
|||||||
|
|
||||||
public function initContent()
|
public function initContent()
|
||||||
{
|
{
|
||||||
|
$this->show_toolbar = false;
|
||||||
$this->display = 'view';
|
$this->display = 'view';
|
||||||
parent::initContent();
|
parent::initContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderView()
|
public function renderView()
|
||||||
{
|
{
|
||||||
|
$this->initPageHeaderToolbar();
|
||||||
$this->tpl_view_vars = array(
|
$this->tpl_view_vars = array(
|
||||||
'version' => array(
|
'version' => array(
|
||||||
'php' => phpversion(),
|
'php' => phpversion(),
|
||||||
@@ -74,12 +76,12 @@ class AdminInformationControllerCore extends AdminController
|
|||||||
|
|
||||||
return parent::renderView();
|
return parent::renderView();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function initToolBar()
|
public function initPageHeaderToolbar()
|
||||||
{
|
{
|
||||||
return;
|
$this->page_header_toolbar_title = $this->l('Configuration information');
|
||||||
|
parent::initPageHeaderToolbar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get all tests
|
* get all tests
|
||||||
|
|||||||
Reference in new issue
Block a user