mirror of
https://github.com/processwire/processwire.git
synced 2025-08-13 02:04:35 +02:00
Minor updates related to the add-new links in the dropdown nav page-tree
This commit is contained in:
@@ -24,7 +24,18 @@
|
|||||||
* @property int $cssVersion Current version number of core CSS/LESS files
|
* @property int $cssVersion Current version number of core CSS/LESS files
|
||||||
* @property string $themeName One of blank (original) or name of theme style
|
* @property string $themeName One of blank (original) or name of theme style
|
||||||
* @property array $themeInfos where theme style files are located
|
* @property array $themeInfos where theme style files are located
|
||||||
|
*
|
||||||
|
* Settings specific to default theme
|
||||||
|
* ----------------------------------
|
||||||
|
* @property string $defaultMainColor Main color or 'custom' (default='red')
|
||||||
|
* @property string $defaultMainColorCustom Main custom color hex code when `defaultMainColor=custom` (default='#eb1d61')
|
||||||
|
* @property string $defaultStyleName Style name, one of 'dark', 'light' or 'auto' (default='auto')
|
||||||
|
* @property array $defaultToggles Toggles for specific behaviors (default=[])
|
||||||
|
* @property string $defaultCustomCss Custom CSS rules string (default='')
|
||||||
|
* @property string $defaultCustomCssFile URL to custom CSS file, relative to installation root (default='')
|
||||||
*
|
*
|
||||||
|
* Hookable methods
|
||||||
|
* ----------------
|
||||||
* @method string renderBreadcrumbs()
|
* @method string renderBreadcrumbs()
|
||||||
* @method string getUikitCSS()
|
* @method string getUikitCSS()
|
||||||
*
|
*
|
||||||
@@ -121,7 +132,16 @@ class AdminThemeUikit extends AdminThemeFramework implements Module, Configurabl
|
|||||||
'table' => 'uk-table uk-table-divider uk-table-justify uk-table-small',
|
'table' => 'uk-table uk-table-divider uk-table-justify uk-table-small',
|
||||||
'dl' => 'uk-description-list uk-description-list-divider',
|
'dl' => 'uk-description-list uk-description-list-divider',
|
||||||
));
|
));
|
||||||
|
|
||||||
|
// settings specific to default theme/style
|
||||||
|
$this->setArray([
|
||||||
|
'defaultStyleName' => 'auto',
|
||||||
|
'defaultMainColor' => 'red',
|
||||||
|
'defaultMainColorCustom' => '#eb1d61',
|
||||||
|
'defaultToggles' => [],
|
||||||
|
'defaultCustomCss' => '',
|
||||||
|
'defaultCustomCssFile' => '',
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function wired() {
|
public function wired() {
|
||||||
@@ -190,6 +210,10 @@ class AdminThemeUikit extends AdminThemeFramework implements Module, Configurabl
|
|||||||
$this->addBodyClass('AdminThemeUikit');
|
$this->addBodyClass('AdminThemeUikit');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$themeName = $this->themeName;
|
||||||
|
if(empty($themeName)) $themeName = 'Original';
|
||||||
|
$this->addBodyClass('AdminThemeUikit' . ucfirst($themeName));
|
||||||
|
|
||||||
$session->removeFor('Page', 'appendEditUrl');
|
$session->removeFor('Page', 'appendEditUrl');
|
||||||
|
|
||||||
/** @var JqueryUI $jqueryUI */
|
/** @var JqueryUI $jqueryUI */
|
||||||
|
@@ -437,6 +437,8 @@ var ProcessWireAdminTheme = {
|
|||||||
var $li = $("<li></li>").addClass('pw-nav-dup').append($a2);
|
var $li = $("<li></li>").addClass('pw-nav-dup').append($a2);
|
||||||
$ul.append($li);
|
$ul.append($li);
|
||||||
if(data.add) {
|
if(data.add) {
|
||||||
|
var addUrl = data.add.url;
|
||||||
|
if(addUrl.indexOf('/') !== 0) addUrl = data.url + addUrl;
|
||||||
var $li2 = $(
|
var $li2 = $(
|
||||||
"<li class='pw-nav-add'>" +
|
"<li class='pw-nav-add'>" +
|
||||||
"<a href='" + data.url + data.add.url + "'>" +
|
"<a href='" + data.url + data.add.url + "'>" +
|
||||||
|
File diff suppressed because one or more lines are too long
@@ -721,12 +721,19 @@ class ProcessPageList extends Process implements ConfigurableModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($parent->addable()) {
|
if($parent->addable()) {
|
||||||
$data['list'][] = array(
|
$themeName = $this->wire()->adminTheme->get('themeName');
|
||||||
|
$add = [
|
||||||
'url' => $urls->admin . "page/add/?parent_id=$parentID",
|
'url' => $urls->admin . "page/add/?parent_id=$parentID",
|
||||||
'label' => __('Add New', '/wire/templates-admin/default.php'),
|
'label' => __('Add New', '/wire/templates-admin/default.php'),
|
||||||
'icon' => 'plus-circle',
|
'icon' => 'plus-circle',
|
||||||
'className' => 'separator pw-nav-add',
|
'className' => 'pw-nav-add add',
|
||||||
);
|
];
|
||||||
|
if(empty($themeName) || $themeName === 'original') {
|
||||||
|
$add['className'] = 'separator pw-nav-add';
|
||||||
|
$data['list'][] = $add;
|
||||||
|
} else {
|
||||||
|
$data['add'] = $add;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($config->ajax) header("Content-Type: application/json");
|
if($config->ajax) header("Content-Type: application/json");
|
||||||
|
@@ -323,9 +323,11 @@ var ProcessWireAdmin = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(data.add) {
|
if(data.add) {
|
||||||
|
var addUrl = data.add.url;
|
||||||
|
if(addUrl.indexOf('/') !== 0) addUrl = data.url + addUrl;
|
||||||
var $li = $(
|
var $li = $(
|
||||||
"<li class='ui-menu-item add'>" +
|
"<li class='ui-menu-item add'>" +
|
||||||
"<a href='" + data.url + data.add.url + "'>" +
|
"<a href='" + addUrl + "'>" +
|
||||||
"<i class='fa fa-fw fa-" + data.add.icon + "'></i>" +
|
"<i class='fa fa-fw fa-" + data.add.icon + "'></i>" +
|
||||||
data.add.label + "</a>" +
|
data.add.label + "</a>" +
|
||||||
"</li>"
|
"</li>"
|
||||||
|
2
wire/templates-admin/scripts/main.min.js
vendored
2
wire/templates-admin/scripts/main.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user