@@ 21-69 (lines=49) @@ | ||
18 | //------------------------------------------------------// |
|
19 | // クラス定義 |
|
20 | //------------------------------------------------------// |
|
21 | class AddEntry extends \Risoluto\RisolutoControllerBase implements \Risoluto\RisolutoControllerInterface |
|
22 | { |
|
23 | // View関連の処理を使用する |
|
24 | use \Risoluto\RisolutoViewTrait; |
|
25 | ||
26 | /** |
|
27 | * play() |
|
28 | * |
|
29 | * 主処理を行う |
|
30 | * |
|
31 | * @access public |
|
32 | * |
|
33 | * @param void |
|
34 | * |
|
35 | * @return void なし |
|
36 | */ |
|
37 | public function play() |
|
38 | { |
|
39 | // セッションをスタート |
|
40 | $sess = new \Risoluto\Session(); |
|
41 | $sess->start(); |
|
42 | ||
43 | // 共通処理クラスを呼び出し |
|
44 | $common = new \RisolutoApps\Admin\AdminCommon; |
|
45 | $detail = $common->loginCheck( $sess, true ); |
|
46 | $groups = $common->getGroupList( 'name_only' ); |
|
47 | ||
48 | // セッションにフォーム入力情報が存在した場合は取得 |
|
49 | $entered = [ ]; |
|
50 | if ($sess->isThere( 'form' )) { |
|
51 | $entered = $sess->load( 'form' ); |
|
52 | $sess->revoke( 'form' ); |
|
53 | } |
|
54 | ||
55 | // ヘッダ情報のセット |
|
56 | $header = $this->getDefaultHeader(); |
|
57 | $header = $this->replaceHeader( $header, 'robots', 'NOINDEX,NOFOLLOW' ); |
|
58 | ||
59 | // テンプレートエンジン関連の処理 |
|
60 | $assign_value = [ |
|
61 | 'header' => $header, |
|
62 | 'detail' => $detail, |
|
63 | 'groups' => $groups, |
|
64 | 'entered' => $entered, |
|
65 | 'csrf_token' => $sess->load( 'csrf_token' ) |
|
66 | ]; |
|
67 | $this->risolutoView( $assign_value ); |
|
68 | } |
|
69 | } |
@@ 21-72 (lines=52) @@ | ||
18 | //------------------------------------------------------// |
|
19 | // クラス定義 |
|
20 | //------------------------------------------------------// |
|
21 | class ModEntry extends \Risoluto\RisolutoControllerBase implements \Risoluto\RisolutoControllerInterface |
|
22 | { |
|
23 | // View関連の処理を使用する |
|
24 | use \Risoluto\RisolutoViewTrait; |
|
25 | ||
26 | /** |
|
27 | * play() |
|
28 | * |
|
29 | * 主処理を行う |
|
30 | * |
|
31 | * @access public |
|
32 | * |
|
33 | * @param void |
|
34 | * |
|
35 | * @return void なし |
|
36 | * @throws \Exception フォームデータを取得できなかった場合はThrow |
|
37 | */ |
|
38 | public function play() |
|
39 | { |
|
40 | // セッションをスタート |
|
41 | $sess = new \Risoluto\Session(); |
|
42 | $sess->start(); |
|
43 | ||
44 | // 共通処理クラスを呼び出し |
|
45 | $common = new \RisolutoApps\Admin\AdminCommon; |
|
46 | $detail = $common->loginCheck( $sess, true ); |
|
47 | $groups = $common->getGroupList( 'name_only' ); |
|
48 | ||
49 | if ($sess->isThere( 'form' )) { |
|
50 | // セッションにフォーム入力情報が存在した場合は取得 |
|
51 | $entered = $sess->load( 'form' ); |
|
52 | $sess->revoke( 'form' ); |
|
53 | } else { |
|
54 | // 存在しない場合は例外をThrow |
|
55 | throw new \Exception( 'Cannot get form data.' ); |
|
56 | } |
|
57 | ||
58 | // ヘッダ情報のセット |
|
59 | $header = $this->getDefaultHeader(); |
|
60 | $header = $this->replaceHeader( $header, 'robots', 'NOINDEX,NOFOLLOW' ); |
|
61 | ||
62 | // テンプレートエンジン関連の処理 |
|
63 | $assign_value = [ |
|
64 | 'header' => $header, |
|
65 | 'detail' => $detail, |
|
66 | 'groups' => $groups, |
|
67 | 'entered' => $entered, |
|
68 | 'csrf_token' => $sess->load( 'csrf_token' ) |
|
69 | ]; |
|
70 | $this->risolutoView( $assign_value ); |
|
71 | } |
|
72 | } |