• R/O
  • SSH
  • HTTPS

jinrousiki: Commit


Commit MetaInfo

Révision2778 (tree)
l'heure2021-08-17 19:19:27
Auteurumethyl

Message de Log

OptionManager::GetUserEntryUnameWarning()

Change Summary

Modification

--- trunk/include/data/option_filter_data_class.php (revision 2777)
+++ trunk/include/data/option_filter_data_class.php (revision 2778)
@@ -66,6 +66,9 @@
6666 ];
6767
6868 //-- UserManager --//
69+ //ユーザー名入力欄注意事項 (順番依存あり)
70+ public static $user_entry_uname_warning = ['necessary_name', 'necessary_trip'];
71+
6972 //追加希望役職
7073 public static $add_wish_role = [
7174 'poison', 'assassin', 'boss_wolf', 'depraver', 'poison_wolf', 'possessed_wolf',
--- trunk/include/html/controller/user_manager_html_class.php (revision 2777)
+++ trunk/include/html/controller/user_manager_html_class.php (revision 2778)
@@ -71,21 +71,12 @@
7171 TableHTML::OutputTd(RQ::Get()->uname);
7272 TableHTML::OutputTd($str, 'explain');
7373 } elseif (GameConfig::TRIP) { //トリップ対応
74- if (DB::$ROOM->IsOption('necessary_name') && DB::$ROOM->IsOption('necessary_trip')) {
75- $warning = Text::BR . HTML::GenerateSpan(UserManagerMessage::NECESSARY_NAME_TRIP);
76- } elseif (DB::$ROOM->IsOption('necessary_name')) {
77- $warning = Text::BR . HTML::GenerateSpan(UserManagerMessage::NECESSARY_NAME);
78- } elseif (DB::$ROOM->IsOption('necessary_trip')) {
79- $warning = Text::BR . HTML::GenerateSpan(UserManagerMessage::NECESSARY_TRIP);
80- } else {
81- $warning = '';
82- }
83-
8474 Text::Printf(self::GetFormUnameWithTrip(),
8575 RQ::Get()->uname, Message::TRIP_KEY, RQ::Get()->trip,
8676 UserManagerMessage::UNAME_EXPLAIN_HEADER,
8777 UserManagerMessage::UNAME_EXPLAIN_FOOTER, Text::BR,
88- Message::TRIP_KEY, UserManagerMessage::TRIP, $warning
78+ Message::TRIP_KEY, UserManagerMessage::TRIP,
79+ OptionManager::GetUserEntryUnameWarning()
8980 );
9081 } else {
9182 Text::Printf(self::GetFormUnameWithoutTrip(),
--- trunk/include/option/necessary_name.php (revision 2777)
+++ trunk/include/option/necessary_name.php (revision 2778)
@@ -1,6 +1,8 @@
11 <?php
22 /*
33 ◆ユーザ名必須 (necessary_name)
4+ ○仕様
5+ ・ユーザー登録:ユーザー名設定必須
46 */
57 class Option_necessary_name extends OptionCheckbox {
68 public $group = OptionGroup::GAME;
@@ -20,4 +22,15 @@
2022 public function GetExplain() {
2123 return 'トリップのみのユーザ名登録はできません';
2224 }
25+
26+ //ユーザー名入力欄注意事項取得
27+ public function GetUserEntryUnameWarning() {
28+ //トリップ必須 (necessary_trip) と同時設定 > 単独設定
29+ if (DB::$ROOM->IsOption('necessary_trip')) {
30+ $message = UserManagerMessage::NECESSARY_NAME_TRIP;
31+ } else {
32+ $message = UserManagerMessage::NECESSARY_NAME;
33+ }
34+ return Text::BR . HTML::GenerateSpan($message);
35+ }
2336 }
--- trunk/include/option/necessary_trip.php (revision 2777)
+++ trunk/include/option/necessary_trip.php (revision 2778)
@@ -1,6 +1,8 @@
11 <?php
22 /*
33 ◆トリップ必須 (necessary_trip)
4+ ○仕様
5+ ・ユーザー登録:トリップ設定必須
46 */
57 class Option_necessary_trip extends OptionCheckbox {
68 public $group = OptionGroup::GAME;
@@ -20,4 +22,10 @@
2022 public function GetExplain() {
2123 return 'ユーザ登録名にトリップが必須です';
2224 }
25+
26+ //ユーザー名入力欄注意事項取得
27+ public function GetUserEntryUnameWarning() {
28+ //ユーザ名必須と同時設定時の処理は necessary_name に委譲
29+ return Text::BR . HTML::GenerateSpan(UserManagerMessage::NECESSARY_TRIP);
30+ }
2331 }
--- trunk/include/option/option_class.php (revision 2777)
+++ trunk/include/option/option_class.php (revision 2778)
@@ -151,6 +151,22 @@
151151 }
152152 }
153153
154+ //-- UserManager --//
155+ //ユーザー名入力欄注意事項取得
156+ public static function GetUserEntryUnameWarning() {
157+ $filter = self::GetFilter('user_entry_uname_warning');
158+ if (null === $filter) {
159+ return '';
160+ } else {
161+ return $filter->GetUserEntryUnameWarning();
162+ }
163+ }
164+
165+ //希望役職リスト取得
166+ public static function GetWishRoleList() {
167+ return OptionLoader::Load('wish_role')->GetWishRole();
168+ }
169+
154170 //-- Room --//
155171 //霊界公開判定
156172 public static function IsRoomOpenCast() {
@@ -174,11 +190,6 @@
174190 }
175191
176192 //-- 個別オプション判定 --//
177- //希望役職リスト取得
178- public static function GetWishRoleList() {
179- return OptionLoader::Load('wish_role')->GetWishRole();
180- }
181-
182193 //天啓封印対象判定
183194 public static function IsSealMessage($type) {
184195 $option = 'seal_message';
Afficher sur ancien navigateur de dépôt.