* zin: fix zin header not work in compatible mode.

This commit is contained in:
sunhao
2023-11-21 14:44:14 +08:00
parent 0b9cd784f5
commit 74a14cf9e6
+42 -37
View File
@@ -139,38 +139,40 @@ class header extends wg
if(!isset($app->user)) return;
$user = $app->user;
$isGuest = $user->account == 'guest';
$items = array();
$user = $app->user;
$isGuest = $user->account == 'guest';
$items = array();
$modalClass = (isset($config->zin->mode) && $config->zin->mode == 'compatible') ? 'open-in-parent' : null;
if(!$isGuest)
{
$noRole = empty($user->role) || !isset($lang->user->roleList[$user->role]);
$items[] = array
(
'url' => createLink('my', 'profile', '', '', true),
'url' => createLink('my', 'profile', '', '', true),
'leadingClass' => 'row items-center gap-2 px-2 py-1 text-inherit',
'icon' => ' hidden',
'title' => empty($user->realname) ? $user->account : $user->realname,
'titleClass' => 'text-lg',
'subtitle' => $noRole ? null : $lang->user->roleList[$user->role],
// 'style' => array('padding-left' => 0),
'data-toggle' => 'modal',
'data-size' => 700,
'data-id' => 'profile',
'leading' => array('html' => userAvatar(set::user($user))->render(), 'className' => 'center mr-1')
'icon' => ' hidden',
'title' => empty($user->realname) ? $user->account : $user->realname,
'titleClass' => 'text-lg',
'subtitle' => $noRole ? null : $lang->user->roleList[$user->role],
'innerClass' => $modalClass,
'data-toggle' => 'modal',
'data-size' => 700,
'data-id' => 'profile',
'leading' => array('html' => userAvatar(set::user($user))->render(), 'className' => 'center mr-1')
);
$items[] = array('type' => 'divider');
$items[] = array
(
'url' => createLink('my', 'profile', '', '', true),
'icon' => 'account',
'text' => $lang->profile,
'url' => createLink('my', 'profile', '', '', true),
'icon' => 'account',
'text' => $lang->profile,
'innerClass' => $modalClass,
'data-toggle' => 'modal',
'data-size' => 700,
'data-id' => 'profile'
'data-size' => 700,
'data-id' => 'profile'
);
if($app->config->vision === 'rnd')
@@ -179,26 +181,28 @@ class header extends wg
{
$items[] = array
(
'url' => createLink('tutorial', 'start'),
'icon' => 'guide',
'text' => $lang->tutorialAB,
'class' => '800',
'outerClass' => 'user-tutorial',
'data-width' => 700,
'url' => createLink('tutorial', 'start'),
'icon' => 'guide',
'text' => $lang->tutorialAB,
'class' => '800',
'outerClass' => 'user-tutorial',
'data-width' => 700,
'data-class-name' => 'modal-inverse',
'data-headerless' => true,
'data-backdrop' => true,
'data-keyboard' => true,
'data-toggle' => 'modal'
'data-backdrop' => true,
'data-keyboard' => true,
'innerClass' => $modalClass,
'data-toggle' => 'modal'
);
}
$items[] = array
(
'url' => createLink('my', 'preference', 'showTip=false', '', true),
'icon' => 'controls',
'text' => $lang->preference,
'data-width' => 700,
'url' => createLink('my', 'preference', 'showTip=false', '', true),
'icon' => 'controls',
'text' => $lang->preference,
'data-width' => 700,
'innerClass' => $modalClass,
'data-toggle' => 'modal'
);
}
@@ -207,11 +211,12 @@ class header extends wg
{
$items[] = array
(
'url' => createLink('my', 'changepassword', '', '', true),
'icon' => 'cog-outline',
'text' => $lang->changePassword,
'url' => createLink('my', 'changepassword', '', '', true),
'icon' => 'cog-outline',
'text' => $lang->changePassword,
'innerClass' => $modalClass,
'data-toggle' => 'modal',
'data-size' => 'sm'
'data-size' => 'sm'
);
}
@@ -241,12 +246,12 @@ class header extends wg
$helpItems = array();
$manualUrl = ((!empty($config->isINT)) ? $config->manualUrl['int'] : $config->manualUrl['home']) . '&theme=' . $_COOKIE['theme'];
$helpItems[] = array('text' => $lang->manual, 'url' => $manualUrl, 'attrs' => array('data-app' => 'help'));
$helpItems[] = array('text' => $lang->changeLog, 'url' => createLink('misc', 'changeLog'), 'data-toggle' => 'modal');
$helpItems[] = array('text' => $lang->changeLog, 'url' => createLink('misc', 'changeLog'), 'data-toggle' => 'modal', 'innerClass' => $modalClass);
$items[] = array('text' => $lang->help, 'icon' => 'help', 'items' => $helpItems);
/* printClientLink */
$items[] = array('text' => $lang->aboutZenTao, 'icon' => 'about', 'url' => createLink('misc', 'about'), 'data-toggle' => 'modal');
$items[] = array('text' => $lang->aboutZenTao, 'icon' => 'about', 'url' => createLink('misc', 'about'), 'data-toggle' => 'modal', 'innerClass' => $modalClass);
$items[] = array('type' => 'html', 'className' => 'menu-item', 'html' => $lang->designedByAIUX);
$items[] = array('type' => 'divider');