1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-10 16:54:44 +02:00

Minor updates related to the add-new links in the dropdown nav page-tree

This commit is contained in:
Ryan Cramer
2025-05-07 12:41:37 -04:00
parent 77fbde3409
commit e0f96733e6
6 changed files with 42 additions and 7 deletions

View File

@@ -24,7 +24,18 @@
* @property int $cssVersion Current version number of core CSS/LESS files
* @property string $themeName One of blank (original) or name of theme style
* @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 getUikitCSS()
*
@@ -121,7 +132,16 @@ class AdminThemeUikit extends AdminThemeFramework implements Module, Configurabl
'table' => 'uk-table uk-table-divider uk-table-justify uk-table-small',
'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() {
@@ -190,6 +210,10 @@ class AdminThemeUikit extends AdminThemeFramework implements Module, Configurabl
$this->addBodyClass('AdminThemeUikit');
}
$themeName = $this->themeName;
if(empty($themeName)) $themeName = 'Original';
$this->addBodyClass('AdminThemeUikit' . ucfirst($themeName));
$session->removeFor('Page', 'appendEditUrl');
/** @var JqueryUI $jqueryUI */

View File

@@ -437,6 +437,8 @@ var ProcessWireAdminTheme = {
var $li = $("<li></li>").addClass('pw-nav-dup').append($a2);
$ul.append($li);
if(data.add) {
var addUrl = data.add.url;
if(addUrl.indexOf('/') !== 0) addUrl = data.url + addUrl;
var $li2 = $(
"<li class='pw-nav-add'>" +
"<a href='" + data.url + data.add.url + "'>" +

File diff suppressed because one or more lines are too long

View File

@@ -721,12 +721,19 @@ class ProcessPageList extends Process implements ConfigurableModule {
}
if($parent->addable()) {
$data['list'][] = array(
$themeName = $this->wire()->adminTheme->get('themeName');
$add = [
'url' => $urls->admin . "page/add/?parent_id=$parentID",
'label' => __('Add New', '/wire/templates-admin/default.php'),
'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");

View File

@@ -323,9 +323,11 @@ var ProcessWireAdmin = {
}
if(data.add) {
var addUrl = data.add.url;
if(addUrl.indexOf('/') !== 0) addUrl = data.url + addUrl;
var $li = $(
"<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>" +
data.add.label + "</a>" +
"</li>"

File diff suppressed because one or more lines are too long