From 0950176dc7de2971199489d89f4c63607dd19b14 Mon Sep 17 00:00:00 2001 From: liugang Date: Sat, 8 Jul 2023 17:26:54 +0800 Subject: [PATCH] * my: add tips after form title. --- module/my/control.php | 20 ++++++++++++++------ module/my/ui/managecontacts.html.php | 21 +++++++++++++++------ 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/module/my/control.php b/module/my/control.php index 9562ab88d1..cdc347feb4 100755 --- a/module/my/control.php +++ b/module/my/control.php @@ -1388,13 +1388,21 @@ EOF; $list = $listID ? $this->user->getContactListByID($listID) : null; $userList = !empty($list->userList) ? $list->userList : ''; - $canEdit = empty($list) || (!empty($list->account) && $list->account == $this->app->user->account); - $this->view->title = $this->lang->my->common . $this->lang->colon . ($listID ? $this->lang->user->contacts->createList : $this->lang->user->contacts->manage); - $this->view->users = $this->user->getPairs('noletter|noempty|noclosed|noclosed', $userList, $this->config->maxCount); - $this->view->lists = $this->user->getContactLists($this->app->user->account, '', 'list'); - $this->view->canEdit = $canEdit; - $this->view->list = $list; + $mode = 'create'; + $label = $this->lang->my->createContacts; + if($list) + { + $mode = $list->account == $this->app->user->account ? 'edit' : 'view'; + $label = $list->account == $this->app->user->account ? $this->lang->my->manageContacts : $this->lang->my->viewContacts; + } + + $this->view->title = $this->lang->my->common . $this->lang->colon . $label; + $this->view->users = $this->user->getPairs('noletter|noempty|noclosed|noclosed', $userList, $this->config->maxCount); + $this->view->lists = $this->user->getContactLists($this->app->user->account, '', 'list'); + $this->view->mode = $mode; + $this->view->label = $label; + $this->view->list = $list; $this->display(); } diff --git a/module/my/ui/managecontacts.html.php b/module/my/ui/managecontacts.html.php index 46128890ee..8202afabf4 100644 --- a/module/my/ui/managecontacts.html.php +++ b/module/my/ui/managecontacts.html.php @@ -40,10 +40,6 @@ if(!empty($list->userList)) foreach(explode(',', $list->userList) as $account) $userList[] = zget($users, $account); } -$manageTitle = $lang->my->createContacts; -if($canEdit && $list) $manageTitle = $lang->my->manageContacts; -if(!$canEdit) $manageTitle = $lang->my->viewContacts; - panel ( setClass('panel-form px-4 mx-auto size-lg'), @@ -99,9 +95,22 @@ panel div ( set('class', 'panel-title text-lg flex w-full py-6'), - $manageTitle + $label, + $mode == 'edit' ? array + ( + span + ( + setClass('text-warning'), + icon('info') + ), + span + ( + setClass('text-gray text-base font-normal'), + $lang->my->manageSelf + ) + ) : null ), - $canEdit ? form + ($mode == 'create' || $mode == 'edit') ? form ( set::actions(array()), formRow