• R/O
  • SSH
  • HTTPS

jinrousiki: Commit


Commit MetaInfo

Revision2304 (tree)
Time2018-12-24 23:35:53
Authorumethyl

Log Message

Text::LineFeed()

Change Summary

Incremental Difference

--- trunk/include/controller/admin_class.php (revision 2303)
+++ trunk/include/controller/admin_class.php (revision 2304)
@@ -56,7 +56,7 @@
5656 //ログ生成
5757 public static function GenerateLog() {
5858 $format = sprintf('../log_test/%s', RQ::Get()->prefix) . '%d%s.html';
59- $footer = Text::Add(HTML::FOOTER);
59+ $footer = Text::LineFeed(HTML::FOOTER);
6060 for ($i = RQ::Get()->min_room_no; $i <= RQ::Get()->max_room_no; $i++) {
6161 RQ::Set(RequestDataGame::ID, $i);
6262 foreach (array(false, true) as $flag) {
--- trunk/include/functions.php (revision 2303)
+++ trunk/include/functions.php (revision 2304)
@@ -37,19 +37,19 @@
3737 //整形
3838 public static function Format(...$stack) {
3939 $format = array_shift($stack);
40- return self::Add(vsprintf($format, $stack));
40+ return self::LineFeed(vsprintf($format, $stack));
4141 }
4242
43+ //改行追加
44+ public static function LineFeed($str) {
45+ return $str . self::LF;
46+ }
47+
4348 //改行結合 (Text::BRLF 固定)
4449 public static function Join(...$stack) {
4550 return ArrayFilter::Concat($stack, self::BRLF);
4651 }
4752
48- //改行追加
49- public static function Add($str) {
50- return $str . self::LF;
51- }
52-
5353 //ヘッダ追加
5454 public static function AddHeader($str, $header, $delimiter = ': ') {
5555 return self::Exists($header) ? $header . $delimiter . $str : $str;
@@ -62,7 +62,7 @@
6262
6363 //折り返し
6464 public static function Fold($count, $str, $base = Position::BASE) {
65- return ($count > 0 && $count % $base == 0) ? self::Add($str) : null;
65+ return ($count > 0 && $count % $base == 0) ? self::LineFeed($str) : null;
6666 }
6767
6868 //カッコで括る
@@ -206,7 +206,7 @@
206206 /* 出力 */
207207 //出力
208208 public static function Output($str = '', $line = false) {
209- echo self::Add($str . ($line ? self::BR : ''));
209+ echo self::LineFeed($str . (true === $line ? self::BR : ''));
210210 }
211211
212212 //出力 (NULL 対応版)
@@ -223,7 +223,7 @@
223223 //出力 (整形用)
224224 public static function Printf(...$stack) {
225225 $format = array_shift($stack);
226- echo self::Add(vsprintf($format, $stack));
226+ echo self::LineFeed(vsprintf($format, $stack));
227227 }
228228
229229 /* 更新系 */
--- trunk/include/html/controller/room_manager_html_class.php (revision 2303)
+++ trunk/include/html/controller/room_manager_html_class.php (revision 2304)
@@ -142,11 +142,11 @@
142142
143143 //エラーの説明リストを生成
144144 private static function GenerateErrorList(array $list) {
145- $result = Text::Add('<ul>');
145+ $result = Text::LineFeed('<ul>');
146146 foreach ($list as $str) {
147147 $result .= Text::Format('<li>%s</li>', $str);
148148 }
149- return Text::Add($result . '</ul>');
149+ return Text::LineFeed($result . '</ul>');
150150 }
151151
152152 //村作成画面パスワードタグ
--- trunk/include/html/game_html_class.php (revision 2303)
+++ trunk/include/html/game_html_class.php (revision 2304)
@@ -45,7 +45,7 @@
4545 $str .= ' ' . self::GenerateHeaderLink($url . URL::GetReload($time), $value);
4646 }
4747
48- return Text::Add(GameMessage::AUTO_RELOAD . Text::Quote($str));
48+ return Text::LineFeed(GameMessage::AUTO_RELOAD . Text::Quote($str));
4949 }
5050
5151 //勝敗生成
@@ -73,7 +73,7 @@
7373 //$stack->p(null, '◆Player');
7474
7575 $count = 0; //改行カウントを初期化
76- $str = Text::Add(self::GetPlayerHeader());
76+ $str = Text::LineFeed(self::GetPlayerHeader());
7777 foreach (DB::$USER->Get() as $id => $user) {
7878 $str .= Text::Fold($count++, TableHTML::GenerateTrLine());
7979
@@ -111,9 +111,9 @@
111111 $str .= self::GenerateOpenPlayer($id, $user, $stack);
112112 }
113113
114- $str .= Text::Add(Text::BR . $live . TableHTML::GenerateTdFooter());
114+ $str .= Text::LineFeed(Text::BR . $live . TableHTML::GenerateTdFooter());
115115 }
116- return Text::Add($str . self::GetPlayerFooter());
116+ return Text::LineFeed($str . self::GetPlayerFooter());
117117 }
118118
119119 //死亡メッセージ生成
@@ -625,7 +625,7 @@
625625 break;
626626 }
627627
628- $str = Text::Add(TableHTML::GenerateHeader('dead-type', false));
628+ $str = Text::LineFeed(TableHTML::GenerateHeader('dead-type', false));
629629 $str .= TableHTML::GenerateTrHeader(is_null($class) ? null : 'dead-type-' . $class);
630630 $str .= TableHTML::GenerateTd($name . DeadMessage::${$base ? 'deadman' : $action});
631631 if (isset($reason)) {
@@ -632,8 +632,8 @@
632632 $str .= TableHTML::GenerateTrLine();
633633 $str .= TableHTML::GenerateTd(Text::Quote($name . DeadMessage::$$reason));
634634 }
635- $str .= Text::Add(TableHTML::GenerateTrFooter());
636- $str .= Text::Add(TableHTML::GenerateFooter(false));
635+ $str .= Text::LineFeed(TableHTML::GenerateTrFooter());
636+ $str .= Text::LineFeed(TableHTML::GenerateFooter(false));
637637 return $str;
638638 }
639639
--- trunk/include/html/html_class.php (revision 2303)
+++ trunk/include/html/html_class.php (revision 2304)
@@ -45,17 +45,17 @@
4545
4646 //JavaScript ヘッダ生成
4747 public static function GenerateJavaScriptHeader() {
48- return Text::Add(self::GetJavaScriptHeader());
48+ return Text::LineFeed(self::GetJavaScriptHeader());
4949 }
5050
5151 //JavaScript フッタ生成
5252 public static function GenerateJavaScriptFooter() {
53- return Text::Add(self::GetJavaScriptFooter());
53+ return Text::LineFeed(self::GetJavaScriptFooter());
5454 }
5555
5656 //ページジャンプ用 JavaScript 生成
5757 public static function GenerateSetLocation() {
58- $str = Text::Add('if (top != self) { top.location.href = self.location.href; }');
58+ $str = Text::LineFeed('if (top != self) { top.location.href = self.location.href; }');
5959 return self::GenerateJavaScriptHeader() . $str . self::GenerateJavaScriptFooter();
6060 }
6161
--- trunk/include/html/info_html_class.php (revision 2303)
+++ trunk/include/html/info_html_class.php (revision 2304)
@@ -95,7 +95,7 @@
9595 $header .= RoleDataHTML::GenerateMain($role, 'th');
9696 }
9797 $header .= TableHTML::GenerateTrFooter();
98- Text::Output(Text::Add(TableHTML::GenerateHeader('member', false)) . $header);
98+ Text::Output(Text::LineFeed(TableHTML::GenerateHeader('member', false)) . $header);
9999
100100 //人数毎の配役を表示
101101 foreach (CastConfig::$role_list as $key => $value) {
--- trunk/include/html/old_log_html_class.php (revision 2303)
+++ trunk/include/html/old_log_html_class.php (revision 2304)
@@ -52,13 +52,13 @@
5252 $str .= Text::Join(
5353 HTML::GenerateLink(URL::GetHeaderDB('old_log'), Message::BACK),
5454 RoomHTML::GenerateLogTitle(), RoomOption::GenerateImage(),
55- Text::Add(HTML::GenerateLink('#beforegame', OldLogMessage::BEFORE))
55+ Text::LineFeed(HTML::GenerateLink('#beforegame', OldLogMessage::BEFORE))
5656 );
5757 for ($i = 1; $i <= DB::$ROOM->last_date; $i++) {
58- $str .= Text::Add(HTML::GenerateLink('#date' . $i, $i));
58+ $str .= Text::LineFeed(HTML::GenerateLink('#date' . $i, $i));
5959 }
6060 $str .= HTML::GenerateLink('#aftergame', OldLogMessage::AFTER) . Message::SPACER;
61- $str .= Text::Add(RQ::Get()->GetURL());
61+ $str .= Text::LineFeed(RQ::Get()->GetURL());
6262 if (DB::$ROOM->IsOn(RoomMode::AUTO_PLAY)) {
6363 $str .= Text::Format('<a href="#game_top" onClick="start_auto_play();">%s</a>', '開始');
6464 }
@@ -157,7 +157,7 @@
157157 if ($current_time - strtotime(DB::$ROOM->finish_datetime) > RoomConfig::KEEP_SESSION) {
158158 $login = '';
159159 } else {
160- $login = Text::Add(HTML::GenerateLink(URL::GetRoom('login'), OldLogMessage::LOGIN));
160+ $login = Text::LineFeed(HTML::GenerateLink(URL::GetRoom('login'), OldLogMessage::LOGIN));
161161 }
162162
163163 if (RQ::Get()->watch) {
@@ -196,7 +196,7 @@
196196 );
197197 }
198198
199- $str .= Text::Add(self::GetListFooter());
199+ $str .= Text::LineFeed(self::GetListFooter());
200200 if ($cache_flag) {
201201 JinrouCacheManager::Store($str);
202202 }
@@ -208,7 +208,7 @@
208208 RQ::Set('reverse', Switcher::OFF);
209209 if (RQ::Get()->max_room_no < 1) return false;
210210 $header = sprintf('../log/%sindex', RQ::Get()->prefix);
211- $footer = Text::Add('</body></html>');
211+ $footer = Text::LineFeed('</body></html>');
212212 $end_page = ceil((RQ::Get()->max_room_no - RQ::Get()->min_room_no + 1) / OldLogConfig::VIEW);
213213 for ($i = 1; $i <= $end_page; $i++) {
214214 RQ::Set('page', $i);
--- trunk/include/html/role/role_html_class.php (revision 2303)
+++ trunk/include/html/role/role_html_class.php (revision 2304)
@@ -343,10 +343,16 @@
343343
344344 //個別能力発動結果表示
345345 public static function OutputAbilityResult($header, $target, $footer = null) {
346- $str = Text::Add(TableHTML::GenerateHeader('ability-result'));
347- if (isset($header)) $str .= Text::Add(ImageManager::Role()->Generate($header, null, true));
348- if (isset($target)) $str .= Text::Add(TableHTML::GenerateTd($target));
349- if (isset($footer)) $str .= Text::Add(ImageManager::Role()->Generate($footer, null, true));
346+ $str = Text::LineFeed(TableHTML::GenerateHeader('ability-result'));
347+ if (true === isset($header)) {
348+ $str .= Text::LineFeed(ImageManager::Role()->Generate($header, null, true));
349+ }
350+ if (true === isset($target)) {
351+ $str .= Text::LineFeed(TableHTML::GenerateTd($target));
352+ }
353+ if (true === isset($footer)) {
354+ $str .= Text::LineFeed(ImageManager::Role()->Generate($footer, null, true));
355+ }
350356 echo $str;
351357 TableHTML::OutputFooter();
352358 }
--- trunk/include/html/table_html_class.php (revision 2303)
+++ trunk/include/html/table_html_class.php (revision 2304)
@@ -35,7 +35,7 @@
3535
3636 //tr 改行生成
3737 public static function GenerateTrLine() {
38- return Text::Add(self::GenerateTrFooter()) . self::GenerateTrHeader();
38+ return Text::LineFeed(self::GenerateTrFooter()) . self::GenerateTrHeader();
3939 }
4040
4141 //td 生成
--- trunk/include/html/talk_html_class.php (revision 2303)
+++ trunk/include/html/talk_html_class.php (revision 2304)
@@ -28,12 +28,12 @@
2828 if (DB::$ROOM->IsOn(RoomMode::AUTO_PLAY)) {
2929 $class .= ' hide';
3030 }
31- return Text::Add(TableHTML::GenerateHeader($class, false, $id));
31+ return Text::LineFeed(TableHTML::GenerateHeader($class, false, $id));
3232 }
3333
3434 //フッター生成
3535 public static function GenerateFooter() {
36- return Text::Add(TableHTML::GenerateFooter(false));
36+ return Text::LineFeed(TableHTML::GenerateFooter(false));
3737 }
3838
3939 //ユーザ名生成
--- trunk/include/request/old_log.php (revision 2303)
+++ trunk/include/request/old_log.php (revision 2304)
@@ -45,7 +45,7 @@
4545 }
4646 $base_url .= ($this->$i ? '' : URL::GetSwitch($i)) . URL::GetAddDB();
4747 $link_url = OldLogHTML::GenerateSwitchLink($base_url, $name, Switcher::Get($this->$i));
48- $url .= Text::Add($link_url);
48+ $url .= Text::LineFeed($link_url);
4949 }
5050
5151 return $url;
--- trunk/include/request/session_class.php (revision 2303)
+++ trunk/include/request/session_class.php (revision 2304)
@@ -106,8 +106,8 @@
106106 //観戦ページ移動
107107 private static function OutputJump() {
108108 $url = URL::GetRoom('game_view', RQ::Get()->room_no);
109- $jump = URL::GetJump($url);
110- $str = Text::Add(Text::Join(Message::VIEW_BODY, $jump)) . HTML::GenerateSetLocation();
109+ $body = Text::Join(Message::VIEW_BODY, URL::GetJump($url));
110+ $str = Text::LineFeed($body) . HTML::GenerateSetLocation();
111111 HTML::OutputResult(Message::VIEW_TITLE, $str, $url);
112112 }
113113 }
--- trunk/include/role/role_class.php (revision 2303)
+++ trunk/include/role/role_class.php (revision 2304)
@@ -624,11 +624,13 @@
624624 return $this->GetVoteMix()->$name($user, $id, $live);
625625 }
626626
627- if (! $this->IsVoteCheckbox($user, $live)) return '';
627+ if (false === $this->IsVoteCheckbox($user, $live)) {
628+ return '';
629+ }
628630 $checked = HTML::GenerateChecked($this->IsVoteCheckboxChecked($user));
629631 $str = sprintf(' id="%d" value="%d"%s>', $id, $id, $checked);
630632 $type = $this->GetVoteCheckboxType();
631- return Text::Add(RoleHTML::GetVoteCheckboxHeader($type) . $str);
633+ return Text::LineFeed(RoleHTML::GetVoteCheckboxHeader($type) . $str);
632634 }
633635
634636 //投票対象判定 (生死 / 本人 / 身代わり君 / 追加判定)
--- trunk/include/talk/auto_play_talk_class.php (revision 2303)
+++ trunk/include/talk/auto_play_talk_class.php (revision 2304)
@@ -56,7 +56,7 @@
5656 //データ隠蔽
5757 public static function Hide($str, $class) {
5858 $scene = self::Stack()->Get(self::DATE);
59- $header = Text::Add(HTML::GenerateDivHeader('hide', $class . '_' . $scene));
59+ $header = Text::LineFeed(HTML::GenerateDivHeader('hide', $class . '_' . $scene));
6060 return $header . $str . HTML::GenerateDivFooter(true);
6161 }
6262
@@ -104,7 +104,7 @@
104104 $str .= Text::Format(self::GetJavaScriptHeader(),
105105 ArrayFilter::ConcatReverse($scene_stack, ',')
106106 );
107- $str .= Text::Add(ArrayFilter::Concat($talk_stack, Text::LF));
107+ $str .= Text::LineFeed(ArrayFilter::Concat($talk_stack, Text::LF));
108108 $str .= HTML::GenerateJavaScriptFooter();
109109 return $str;
110110 }
Show on old repository browser