2 // vim: foldmethod=marker
6 * @author Masaki Fujimoto <fujimoto@php.net>
7 * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
12 // {{{ Ethna_ViewClass
16 * @author Masaki Fujimoto <fujimoto@php.net>
26 /** @var object Ethna_Controller Controllerオブジェクト */
29 /** @var object Ethna_Backend backendオブジェクト */
32 /** @var object Ethna_Config 設定オブジェクト */
35 /** @var object Ethna_I18N i18nオブジェクト */
38 /** @var object Ethna_Logger ログオブジェクト */
41 /** @var object Ethna_Plugin プラグインオブジェクト */
44 /** @var object Ethna_ActionError アクションエラーオブジェクト */
47 /** @var object Ethna_ActionError アクションエラーオブジェクト(省略形) */
50 /** @var object Ethna_ActionForm アクションフォームオブジェクト */
53 /** @var object Ethna_ActionForm アクションフォームオブジェクト(省略形) */
56 /** @var array アクションフォームオブジェクト(helper) */
57 var $helper_action_form = array();
59 /** @var array helperでhtmlのattributeにはしないパラメータの一覧 */
60 var $helper_parameter_keys = array('default', 'option', 'separator');
62 /** @var object Ethna_Session セッションオブジェクト */
65 /** @var string 遷移名 */
68 /** @var string 遷移先テンプレートファイル名 */
71 /** @var boolean 配列フォームを呼んだカウンタをリセットするか否か */
72 var $reset_counter = false;
80 /** @var string レイアウト(HTMLの外枠を記述するファイル)のテンプレートファイルを指定(拡張子は除く) */
81 var $_layout_file = 'layout';
89 /** @var boolean レイアウトテンプレートの使用フラグ */
90 var $use_layout = true;
92 /** @var boolean デフォルトのヘッダ出力を使用するか否か */
93 /** ヘッダ出力を改造する場合はfalseにする */
94 var $has_default_header = true;
96 /** @var array デフォルトのヘッダ出力を使用するか否か */
97 /** ヘッダ出力を改造する場合はfalseにする */
98 var $default_header = array(
99 'Pragma' => 'no-cache',
100 'Cache-Control' => 'no-cache, no-store, must-revalidate',
103 // {{{ Ethna_ViewClass
105 * Ethna_ViewClassのコンストラクタ
108 * @param object Ethna_Backend $backend backendオブジェクト
109 * @param string $forward_name ビューに関連付けられている遷移名
110 * @param string $forward_path ビューに関連付けられているテンプレートファイル名
112 function Ethna_ViewClass(&$backend, $forward_name, $forward_path)
114 $c =& $backend->getController();
116 $this->backend =& $backend;
117 $this->config =& $this->backend->getConfig();
118 $this->i18n =& $this->backend->getI18N();
119 $this->logger =& $this->backend->getLogger();
120 $this->plugin =& $this->backend->getPlugin();
122 $this->action_error =& $this->backend->getActionError();
123 $this->ae =& $this->action_error;
125 $this->action_form =& $this->backend->getActionForm();
126 $this->af =& $this->action_form;
128 $this->session =& $this->backend->getSession();
130 $this->forward_name = $forward_name;
131 $this->forward_path = $forward_path;
133 foreach (array_keys($this->helper_action_form) as $action) {
134 $this->addActionFormHelper($action);
143 * テンプレートに設定する値でコンテキストに依存しないものは
144 * ここで設定する(例:セレクトボックス等)
147 * @param mixed $params アクションクラスから返された引数
148 * array('forward_name', $param) の形でアクション
149 * から値を返すことで、$params に値が渡されます。
151 function preforward($params = NULL)
160 * 特殊な画面を表示する場合を除いて特にオーバーライドする必要は無い
161 * (preforward()のみオーバーライドすれば良い)
167 $renderer =& $this->_getRenderer();
168 $this->_setDefault($renderer);
170 if ($this->has_default_header) {
171 $this->default_header['Content-Type'] = 'text/html; charset=' . $this->ctl->getClientEncoding();
172 $this->header($this->default_header);
175 // using layout.tpl flag
176 if ($this->use_layout) {
178 // check : layout file existance
179 $layout = $this->getLayout();
180 if ($this->templateExists($layout)) {
181 $content = $renderer->perform($this->forward_path, true);
183 if (Ethna::isError($content)) {
184 if ($content->getCode() == E_GENERAL) {
191 $this->error($error);
192 $content = $renderer->perform($this->forward_path, true);
195 $renderer->setProp('content', $content);
196 $renderer->perform($layout, serialize($_SERVER['REQUEST_URI']));
198 return Ethna::raiseWarning('file "'.$layout.'" not found');
201 $renderer->perform($this->forward_path);
210 * @param mixed ヘッダを設定する値
211 * 配列指定の場合、header => value の形式
212 * 整数指定の場合は、HTTPステータスコード
213 * 文字列で指定する場合は、ヘッダ出力をそのまま指定
216 function header($status)
218 if (is_array($status)) {
219 foreach ($status as $key => $status) {
220 header ($key . ": " . $status);
222 } else if (is_int($status)) {
225 101 => "Switching Protocols",
229 203 => "Non-Authoritative Information",
231 205 => "Reset Content",
232 206 => "Partial Content",
233 300 => "Multiple Choices",
234 301 => "Moved Permanently",
237 304 => "Not Modified",
239 307 => "Temporary Redirect",
240 400 => "Bad Request",
241 401 => "Unauthorized",
242 402 => "Payment Required",
245 405 => "Method Not Allowed",
246 406 => "Not Acceptable",
247 407 => "Proxy Authentication Required",
248 408 => "Request Time-out",
251 411 => "Length Required",
252 412 => "Precondition Failed",
253 413 => "Request Entity Too Large",
254 414 => "Request-URI Too Large",
255 415 => "Unsupported Media Type",
256 416 => "Requested range not satisfiable",
257 417 => "Expectation Failed",
258 500 => "Internal Server Error",
259 501 => "Not Implemented",
260 502 => "Bad Gateway",
261 503 => "Service Unavailable",
262 504 => "Gateway Time-out"
265 if (array_key_exists($status, $codes)) {
266 header("HTTP/1.1: {$status} {$codes[$status]}");
269 // check valid header
270 if (preg_match("/^.+\:\s.+$/", $status)) {
281 * - レイアウトテンプレートの使用をしない
283 * @param string リダイレクト先(URL)
284 * @param int HTTPステータスコード (3xx)
287 function redirect($url, $staus_code = 302)
289 $this->has_default_header = false;
290 $this->use_layout = false;
292 $this->header($staus_code);
293 $this->header(array('Location' => $url));
299 * レイアウトテンプレートのファイル名を設定します。
300 * レイアウトテンプレートは、HTML の外枠を設定するのに使用します。
302 * @param string $filename レイアウトファイル名
305 function setLayout($filename)
307 // check layout file existance
308 if ($this->templateExists($filename . '.' . $this->ctl->ext['tpl'])) {
309 $this->_layout_file = $filename;
312 return Ethna::raiseWarning('file "'. $filename . '.' . $this->ctl->ext['tpl'] . '" not found');
319 * レイアウトテンプレートファイル名を取得します。
321 * @return string レイアウトテンプレートのファイル名
326 return $this->_layout_file . '.' . $this->ctl->ext['tpl'];
330 // {{{ templateExists
332 * テンプレートファイルが存在するか否かを返します。
334 * @param string $filename チェック対象のテンプレートファイル
336 * @return boolean 指定したテンプレートファイルが存在すればtrue
339 function templateExists($filename)
341 $renderer = $this->_getRenderer();
342 if ($renderer->templateExists($filename)) {
353 * エラーページ出力用のHTTPステータスコードを指定します。
355 * @param int HTTPステータスコード
358 function error($code)
360 $this->has_default_header = false;
361 $this->header($code);
363 // template 以下に error404.tpl とかがあれば,
364 // preforward で $this->error(404); とかすればいい
365 $this->forward_path = "error{$code}.tpl";
369 // {{{ addActionFormHelper
371 * helperアクションフォームオブジェクトを設定する
373 * @param string $action アクション名
374 * @param boolean $dynamic_helper 動的フォームヘルパを呼ぶか否か
377 function addActionFormHelper($action, $dynamic_helper = false)
380 // 既に追加されている場合は処理をしない
382 if (isset($this->helper_action_form[$action])
383 && is_object($this->helper_action_form[$action])) {
387 // 現在のアクションと等しければ、対応する
389 $ctl =& Ethna_Controller::getInstance();
390 if ($action === $ctl->getCurrentActionName()) {
391 $this->helper_action_form[$action] =& $this->af;
394 $form_name = $ctl->getActionFormName($action);
395 if ($form_name === null) {
396 $this->logger->log(LOG_WARNING,
397 'action form for the action [%s] not found.', $action);
400 $this->helper_action_form[$action] =& new $form_name($ctl);
403 // 動的フォームを設定するためのヘルパメソッドを呼ぶ
404 if ($dynamic_helper) {
405 $af =& $this->helper_action_form[$action];
406 $af->setFormDef_ViewHelper();
411 // {{{ clearActionFormHelper
413 * helperアクションフォームオブジェクトを削除する
417 function clearActionFormHelper($action)
419 unset($this->helper_action_form[$action]);
423 // {{{ _getHelperActionForm
425 * アクションフォームオブジェクト(helper)を取得する
426 * $action === null で $name が指定されているときは、$nameの定義を
430 * @param string action 取得するアクション名
431 * @param string name 定義されていることを期待するフォーム名
432 * @return object Ethna_ActionFormまたは継承オブジェクト
434 function &_getHelperActionForm($action = null, $name = null)
436 // $action が指定されている場合
437 if ($action !== null) {
438 if (isset($this->helper_action_form[$action])
439 && is_object($this->helper_action_form[$action])) {
440 return $this->helper_action_form[$action];
442 $this->logger->log(LOG_WARNING,
443 'helper action form for action [%s] not found',
449 // 最初に $this->af を調べる
450 $def = $this->af->getDef($name);
455 // $this->helper_action_form を順に調べる
456 foreach (array_keys($this->helper_action_form) as $action) {
457 if (is_object($this->helper_action_form[$action]) === false) {
460 $af =& $this->helper_action_form[$action];
461 $def = $af->getDef($name);
462 if (is_null($def) === false) {
468 $this->logger->log(LOG_WARNING,
469 'action form defining form [%s] not found', $name);
474 // {{{ resetFormCounter
476 * フォームヘルパ用、内部フォームカウンタをリセットする
480 function resetFormCounter()
482 $this->reset_counter = true;
488 * 指定されたフォーム項目に対応するフォーム名(w/ レンダリング)を取得する
492 function getFormName($name, $action, $params)
494 $af =& $this->_getHelperActionForm($action, $name);
499 $def = $af->getDef($name);
500 if ($def === null || isset($def['name']) === false) {
510 * submitボタンを取得する(送信先アクションで受け取るよう
511 * 定義されていないときに、たんにsubmitボタンを作るのに使う)
515 function getFormSubmit($params)
517 if (isset($params['type']) === false) {
518 $params['type'] = 'submit';
520 return $this->_getFormInput_Html('input', $params);
526 * 指定されたフォーム項目に対応するフォームタグを取得する
531 function getFormInput($name, $action, $params)
533 $af =& $this->_getHelperActionForm($action, $name);
538 $def = $af->getDef($name);
543 if (isset($def['form_type']) === false) {
544 $def['form_type'] = FORM_TYPE_TEXT;
547 // 配列フォームが何回呼ばれたかを保存するカウンタ
548 if (isset($def['type']) && is_array($def['type'])) {
549 static $form_counter = array();
550 if ($this->reset_counter) {
551 $form_counter = array();
552 $this->reset_counter = false;
555 if (isset($form_counter[$action]) === false) {
556 $form_counter[$action] = array();
558 if (isset($form_counter[$action][$name]) === false) {
559 $form_counter[$action][$name] = 0;
561 $def['_form_counter'] = $form_counter[$action][$name]++;
564 switch ($def['form_type']) {
565 case FORM_TYPE_BUTTON:
566 $input = $this->_getFormInput_Button($name, $def, $params);
569 case FORM_TYPE_CHECKBOX:
570 $def['option'] = $this->_getSelectorOptions($af, $def, $params);
571 $input = $this->_getFormInput_Checkbox($name, $def, $params);
575 $input = $this->_getFormInput_File($name, $def, $params);
578 case FORM_TYPE_HIDDEN:
579 $input = $this->_getFormInput_Hidden($name, $def, $params);
582 case FORM_TYPE_PASSWORD:
583 $input = $this->_getFormInput_Password($name, $def, $params);
586 case FORM_TYPE_RADIO:
587 $def['option'] = $this->_getSelectorOptions($af, $def, $params);
588 $input = $this->_getFormInput_Radio($name, $def, $params);
591 case FORM_TYPE_SELECT:
592 $def['option'] = $this->_getSelectorOptions($af, $def, $params);
593 $input = $this->_getFormInput_Select($name, $def, $params);
596 case FORM_TYPE_SUBMIT:
597 $input = $this->_getFormInput_Submit($name, $def, $params);
600 case FORM_TYPE_TEXTAREA:
601 $input = $this->_getFormInput_Textarea($name, $def, $params);
606 $input = $this->_getFormInput_Text($name, $def, $params);
616 * フォームタグを取得する(type="form")
620 function getFormBlock($content, $params)
623 if (isset($params['method']) === false) {
624 $params['method'] = 'post';
627 return $this->_getFormInput_Html('form', $params, $content, false);
631 // {{{ _getSelectorOptions
633 * select, radio, checkbox の選択肢を取得する
637 function _getSelectorOptions(&$af, $def, $params)
639 // $params, $def の順で調べる
641 if (isset($params['option'])) {
642 $source = $params['option'];
643 } else if (isset($def['option'])) {
644 $source = $def['option'];
647 // 未定義 or 定義済みの場合はそのまま
648 if ($source === null) {
650 } else if (is_array($source)) {
656 $split = array_map("trim", explode(',', $source));
657 if (count($split) === 1) {
659 $method_or_property = $split[0];
660 if (method_exists($af, $method_or_property)) {
661 $options = $af->$method_or_property();
663 $options = $af->$method_or_property;
667 $mgr =& $this->backend->getManager($split[0]);
668 $attr_list = $mgr->getAttrList($split[1]);
669 if (is_array($attr_list)) {
670 foreach ($attr_list as $key => $val) {
671 $options[$key] = $val['name'];
676 if (is_array($options) === false) {
677 $this->logger->log(LOG_WARNING,
678 'selector option is not valid. [actionform=%s, option=%s]',
679 get_class($af), $source);
687 // {{{ _getFormInput_Button
689 * フォームタグを取得する(type="button")
693 function _getFormInput_Button($name, $def, $params)
695 $params['type'] = 'button';
697 if (isset($def['type'])) {
698 $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
700 $params['name'] = $name;
702 if (isset($params['value']) === false) {
703 if (isset($def['name'])) {
704 $params['value'] = $def['name'];
707 if (isset($params['value']) && is_array($params['value'])) {
708 $params['value'] = $params['value'][0];
711 return $this->_getFormInput_Html('input', $params);
715 // {{{ _getFormInput_Checkbox
717 * チェックボックスタグを取得する(type="check")
721 function _getFormInput_Checkbox($name, $def, $params)
723 $params['type'] = 'checkbox';
724 if (isset($def['type'])) {
725 $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
727 $params['name'] = $name;
730 // オプションの一覧(alist)を取得
731 if (isset($def['option']) && is_array($def['option'])) {
732 $options = $def['option'];
738 if (isset($params['default'])) {
739 $current_value = $params['default'];
740 } else if (isset($def['default'])) {
741 $current_value = $def['default'];
743 $current_value = array();
745 $current_value = array_map('strval', to_array($current_value));
748 if (isset($params['separator'])) {
749 $separator = $params['separator'];
756 foreach ($options as $key => $value) {
757 $params['value'] = $key;
758 $params['id'] = $name . '_' . $i++;
761 if (in_array((string) $key, $current_value, true)) {
762 $params['checked'] = 'checked';
764 unset($params['checked']);
767 // <input type="checkbox" />
768 $input_tag = $this->_getFormInput_Html('input', $params);
770 // <label for="id">..</label>
771 $ret[] = $this->_getFormInput_Html('label', array('for' => $params['id']),
772 $input_tag . $value, false);
775 return implode($separator, $ret);
779 // {{{ _getFormInput_File
781 * フォームタグを取得する(type="file")
785 function _getFormInput_File($name, $def, $params)
787 $params['type'] = 'file';
788 if (isset($def['type'])) {
789 $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
791 $params['name'] = $name;
793 $params['value'] = '';
795 return $this->_getFormInput_Html('input', $params);
799 // {{{ _getFormInput_Hidden
801 * フォームタグを取得する(type="hidden")
805 function _getFormInput_Hidden($name, $def, $params)
807 $params['type'] = 'hidden';
808 if (isset($def['type'])) {
809 $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
811 $params['name'] = $name;
816 if (isset($params['value'])) {
817 $value = $params['value'];
818 } else if (isset($params['default'])) {
819 $value = $params['default'];
820 } else if (isset($def['default'])) {
821 $value = $def['default'];
823 if (is_array($value)) {
824 if ($def['_form_counter'] < count($value)) {
825 $params['value'] = $value[$def['_form_counter']];
827 $params['value'] = '';
830 $params['value'] = $value;
833 return $this->_getFormInput_Html('input', $params);
837 // {{{ _getFormInput_Password
839 * フォームタグを取得する(type="password")
843 function _getFormInput_Password($name, $def, $params)
845 $params['type'] = 'password';
846 if (isset($def['type'])) {
847 $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
849 $params['name'] = $name;
854 if (isset($params['value'])) {
855 $value = $params['value'];
856 } else if (isset($params['default'])) {
857 $value = $params['default'];
858 } else if (isset($def['default'])) {
859 $value = $def['default'];
861 if (is_array($value)) {
862 if ($def['_form_counter'] < count($value)) {
863 $params['value'] = $value[$def['_form_counter']];
865 $params['value'] = '';
868 $params['value'] = $value;
871 // maxlength と フォーム定義のmax連携はサポートしない
872 // @see http://sourceforge.jp/ticket/browse.php?group_id=1343&tid=16325
874 return $this->_getFormInput_Html('input', $params);
878 // {{{ _getFormInput_Radio
880 * ラジオボタンタグを取得する(type="radio")
884 function _getFormInput_Radio($name, $def, $params)
886 $params['type'] = 'radio';
887 if (isset($def['type'])) {
888 $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
890 $params['name'] = $name;
893 // オプションの一覧(alist)を取得
894 if (isset($def['option']) && is_array($def['option'])) {
895 $options = $def['option'];
901 if (isset($params['default'])) {
902 $current_value = $params['default'];
903 } else if (isset($def['default'])) {
904 $current_value = $def['default'];
906 $current_value = null;
910 if (isset($params['separator'])) {
911 $separator = $params['separator'];
918 foreach ($options as $key => $value) {
919 $params['value'] = $key;
920 $params['id'] = $name . '_' . $i++;
923 if (strcmp($current_value,$key) === 0) {
924 $params['checked'] = 'checked';
926 unset($params['checked']);
929 // <input type="radio" />
930 $input_tag = $this->_getFormInput_Html('input', $params);
932 // <label for="id">..</label>
933 $ret[] = $this->_getFormInput_Html('label', array('for' => $params['id']),
934 $input_tag . $value, false);
937 return implode($separator, $ret);
941 // {{{ _getFormInput_Select
943 * セレクトボックスタグを取得する(type="select")
947 function _getFormInput_Select($name, $def, $params)
949 if (isset($def['type'])) {
950 $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
952 $params['name'] = $name;
955 // オプションの一覧(alist)を取得
956 if (isset($def['option']) && is_array($def['option'])) {
957 $options = $def['option'];
963 if (isset($params['default'])) {
964 $current_value = $params['default'];
965 } else if (isset($def['default'])) {
966 $current_value = $def['default'];
968 $current_value = array();
970 $current_value = array_map('strval', to_array($current_value));
973 if (isset($params['separator'])) {
974 $separator = $params['separator'];
982 foreach ($options as $key => $value) {
983 $attr = array('value' => $key);
984 $def['_form_counter'] = empty($def['_form_counter']) ? 0 : $def['_form_counter'];
985 if (isset($params['multiple']) &&
986 in_array((string)$key, $current_value, true) ||
987 !isset($params['multiple']) && $selected === false &&
988 strcmp($current_value[$def['_form_counter']], $key) === 0) {
989 $attr['selected'] = 'selected';
992 $contents[] = $this->_getFormInput_Html('option', $attr, $value);
996 if (isset($params['emptyoption'])) {
997 $attr = array('value' => '');
998 if ($selected === false) {
999 $attr['selected'] = 'selected';
1001 array_unshift($contents,
1002 $this->_getFormInput_Html('option',
1004 $params['emptyoption']));
1005 unset($params['emptyoption']);
1008 $element = $separator . implode($separator, $contents) . $separator;
1009 return $this->_getFormInput_Html('select', $params, $element, false);
1013 // {{{ _getFormInput_Submit
1015 * フォームタグを取得する(type="submit")
1019 function _getFormInput_Submit($name, $def, $params)
1021 $params['type'] = 'submit';
1022 if (isset($def['type'])) {
1023 $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
1025 $params['name'] = $name;
1027 if (isset($params['value']) === false) {
1028 if (isset($def['name'])) {
1029 $params['value'] = $def['name'];
1032 if (is_array($params['value'])) {
1033 $params['value'] = $params['value'][0];
1036 return $this->_getFormInput_Html('input', $params);
1040 // {{{ _getFormInput_Textarea
1042 * フォームタグを取得する(textarea)
1046 function _getFormInput_Textarea($name, $def, $params)
1048 if (isset($def['type'])) {
1049 $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
1051 $params['name'] = $name;
1056 if (isset($params['value'])) {
1057 $element = $params['value'];
1058 } else if (isset($params['default'])) {
1059 $element = $params['default'];
1060 } else if (isset($def['default'])) {
1061 $element = $def['default'];
1063 if (is_array($element)) {
1064 if ($def['_form_counter'] < count($element)) {
1065 $element = $element[$def['_form_counter']];
1071 return $this->_getFormInput_Html('textarea', $params, $element);
1075 // {{{ _getFormInput_Text
1077 * フォームタグを取得する(type="text")
1081 function _getFormInput_Text($name, $def, $params)
1084 $params['type'] = 'text';
1087 if (isset($def['type'])) {
1088 $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
1090 $params['name'] = $name;
1095 if (isset($params['value'])) {
1096 $value = $params['value'];
1097 } else if (isset($params['default'])) {
1098 $value = $params['default'];
1099 } else if (isset($def['default'])) {
1100 $value = $def['default'];
1102 if (is_array($value)) {
1103 if ($def['_form_counter'] < count($value)) {
1104 $params['value'] = $value[$def['_form_counter']];
1106 $params['value'] = '';
1109 $params['value'] = $value;
1112 // maxlength と フォーム定義のmax連携はサポートしない
1113 // @see http://sourceforge.jp/ticket/browse.php?group_id=1343&tid=16325
1115 return $this->_getFormInput_Html('input', $params);
1119 // {{{ _getFormInput_Html
1125 function _getFormInput_Html($tag, $attr, $element = null, $escape_element = true)
1128 foreach ($this->helper_parameter_keys as $key) {
1134 foreach ($attr as $key => $value) {
1135 if ($value === null) {
1136 $r .= sprintf(' %s', $key);
1138 $r .= sprintf(' %s="%s"', $key, htmlspecialchars($value, ENT_QUOTES));
1142 if ($element === null) {
1144 } else if ($escape_element) {
1145 $r .= sprintf('>%s</%s>', htmlspecialchars($element, ENT_QUOTES), $tag);
1147 $r .= sprintf('>%s</%s>', $element, $tag);
1159 * @return object Ethna_Renderer レンダラオブジェクト
1161 function &_getRenderer()
1163 $c =& $this->backend->getController();
1164 $renderer =& $c->getRenderer();
1166 $form_array =& $this->af->getArray();
1167 $app_array =& $this->af->getAppArray();
1168 $app_ne_array =& $this->af->getAppNEArray();
1169 $renderer->setPropByRef('form', $form_array);
1170 $renderer->setPropByRef('app', $app_array);
1171 $renderer->setPropByRef('app_ne', $app_ne_array);
1172 $message_list = Ethna_Util::escapeHtml($this->ae->getMessageList());
1173 $renderer->setPropByRef('errors', $message_list);
1174 if (isset($_SESSION)) {
1175 $tmp_session = Ethna_Util::escapeHtml($_SESSION);
1176 $renderer->setPropByRef('session', $tmp_session);
1178 $renderer->setProp('script',
1179 htmlspecialchars(basename($_SERVER['SCRIPT_NAME']), ENT_QUOTES));
1180 $renderer->setProp('request_uri',
1181 isset($_SERVER['REQUEST_URI'])
1182 ? htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES)
1184 $renderer->setProp('config', $this->config->get());
1195 * @param object Ethna_Renderer レンダラオブジェクト
1197 function _setDefault(&$renderer)