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_Backend backend¥ª¥Ö¥¸¥§¥¯¥È */
29 /** @var object Ethna_Config ÀßÄꥪ¥Ö¥¸¥§¥¯¥È */
32 /** @var object Ethna_I18N i18n¥ª¥Ö¥¸¥§¥¯¥È */
35 /** @var object Ethna_Logger ¥í¥°¥ª¥Ö¥¸¥§¥¯¥È */
38 /** @var object Ethna_Plugin ¥×¥é¥°¥¤¥ó¥ª¥Ö¥¸¥§¥¯¥È */
41 /** @var object Ethna_ActionError ¥¢¥¯¥·¥ç¥ó¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È */
44 /** @var object Ethna_ActionError ¥¢¥¯¥·¥ç¥ó¥¨¥é¡¼¥ª¥Ö¥¸¥§¥¯¥È(¾Êά·Á) */
47 /** @var object Ethna_ActionForm ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È */
50 /** @var object Ethna_ActionForm ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È(¾Êά·Á) */
53 /** @var array ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È(helper) */
54 var $helper_action_form = array();
56 /** @var array helper¤Çhtml¤Îattribute¤Ë¤Ï¤·¤Ê¥Ñ¥é¥á¡¼¥¿¤Î°ìÍ÷ */
57 var $helper_parameter_keys = array('default', 'option', 'separator');
59 /** @var object Ethna_Session ¥»¥Ã¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È */
62 /** @var string Á«°Ü̾ */
65 /** @var string Á«°ÜÀè¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë̾ */
70 // {{{ Ethna_ViewClass
72 * Ethna_ViewClass¤Î¥³¥ó¥¹¥È¥é¥¯¥¿
75 * @param object Ethna_Backend $backend backend¥ª¥Ö¥¸¥§¥¯¥È
76 * @param string $forward_name ¥Ó¥å¡¼¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤Æ¤¤¤ëÁ«°Ü̾
77 * @param string $forward_path ¥Ó¥å¡¼¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤Æ¤¤¤ë¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë̾
79 function Ethna_ViewClass(&$backend, $forward_name, $forward_path)
81 $c =& $backend->getController();
82 $this->backend =& $backend;
83 $this->config =& $this->backend->getConfig();
84 $this->i18n =& $this->backend->getI18N();
85 $this->logger =& $this->backend->getLogger();
86 $this->plugin =& $this->backend->getPlugin();
88 $this->action_error =& $this->backend->getActionError();
89 $this->ae =& $this->action_error;
91 $this->action_form =& $this->backend->getActionForm();
92 $this->af =& $this->action_form;
94 $this->session =& $this->backend->getSession();
96 $this->forward_name = $forward_name;
97 $this->forward_path = $forward_path;
99 foreach (array_keys($this->helper_action_form) as $action) {
100 $this->addActionFormHelper($action);
109 * ¥Æ¥ó¥×¥ì¡¼¥È¤ËÀßÄꤹ¤ëÃͤǥ³¥ó¥Æ¥¥¹¥È¤Ë°Í¸¤·¤Ê¤¤¤â¤Î¤Ï
110 * ¤³¤³¤ÇÀßÄꤹ¤ë(Îã:¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹Åù)
114 function preforward()
121 * Á«°Ü̾¤ËÂбþ¤¹¤ë²èÌ̤ò½ÐÎϤ¹¤ë
123 * Æüì¤Ê²èÌ̤òɽ¼¨¤¹¤ë¾ì¹ç¤ò½ü¤¤¤ÆÆä˥ª¡¼¥Ð¡¼¥é¥¤¥É¤¹¤ëɬÍפÏ̵¤¤
124 * (preforward()¤Î¤ß¥ª¡¼¥Ð¡¼¥é¥¤¥É¤¹¤ì¤ÐÎɤ¤)
130 $renderer =& $this->_getRenderer();
131 $this->_setDefault($renderer);
132 $renderer->perform($this->forward_path);
136 // {{{ addActionFormHelper
138 * helper¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òÀßÄꤹ¤ë
142 function addActionFormHelper($action)
144 if (isset($this->helper_action_form[$action])
145 && is_object($this->helper_action_form[$action])) {
149 $ctl =& Ethna_Controller::getInstance();
150 if ($action === $ctl->getCurrentActionName()) {
151 $this->helper_action_form[$action] =& $this->af;
155 $form_name = $ctl->getActionFormName($action);
156 if ($form_name === null) {
157 $this->logger->log(LOG_WARNING,
158 'action form for the action [%s] not found.', $action);
162 $this->helper_action_form[$action] =& new $form_name($ctl);
166 // {{{ clearActionFormHelper
168 * helper¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òºï½ü¤¹¤ë
172 function clearActionFormHelper($action)
174 unset($this->helper_action_form[$action]);
178 // {{{ _getHelperActionForm
180 * ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È(helper)¤ò¼èÆÀ¤¹¤ë
181 * $action === null ¤Ç $name ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤È¤¤Ï¡¢$name¤ÎÄêµÁ¤ò
185 * @param string action ¼èÆÀ¤¹¤ë¥¢¥¯¥·¥ç¥ó̾
186 * @param string name ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ò´üÂÔ¤¹¤ë¥Õ¥©¡¼¥à̾
187 * @return object Ethna_ActionForm¤Þ¤¿¤Ï·Ñ¾µ¥ª¥Ö¥¸¥§¥¯¥È
189 function &_getHelperActionForm($action = null, $name = null)
191 // $action ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç
192 if ($action !== null) {
193 if (isset($this->helper_action_form[$action])
194 && is_object($this->helper_action_form[$action])) {
195 return $this->helper_action_form[$action];
197 $this->logger->log(LOG_WARNING,
198 'helper action form for action [%s] not found',
204 // ºÇ½é¤Ë $this->af ¤òÄ´¤Ù¤ë
205 $def = $this->af->getDef($name);
210 // $this->helper_action_form ¤ò½ç¤ËÄ´¤Ù¤ë
211 foreach (array_keys($this->helper_action_form) as $action) {
212 if (is_object($this->helper_action_form[$action]) === false) {
215 $af =& $this->helper_action_form[$action];
216 $def = $af->getDef($name);
217 if (is_null($def) === false) {
223 $this->logger->log(LOG_WARNING,
224 'action form defining form [%s] not found', $name);
231 * »ØÄꤵ¤ì¤¿¥Õ¥©¡¼¥à¹àÌܤËÂбþ¤¹¤ë¥Õ¥©¡¼¥à̾(w/ ¥ì¥ó¥À¥ê¥ó¥°)¤ò¼èÆÀ¤¹¤ë
235 function getFormName($name, $action, $params)
237 $af =& $this->_getHelperActionForm($action, $name);
242 $def = $af->getDef($name);
243 if ($def === null || isset($def['name']) === false) {
253 * submit¥Ü¥¿¥ó¤ò¼èÆÀ¤¹¤ë(Á÷¿®À襢¥¯¥·¥ç¥ó¤Ç¼õ¤±¼è¤ë¤è¤¦
254 * ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¤È¤¤Ë¡¢¤¿¤ó¤Ësubmit¥Ü¥¿¥ó¤òºî¤ë¤Î¤Ë»È¤¦)
258 function getFormSubmit($params)
260 if (isset($params['type']) === false) {
261 $params['type'] = 'submit';
263 return $this->_getFormInput_Html('input', $params);
269 * »ØÄꤵ¤ì¤¿¥Õ¥©¡¼¥à¹àÌܤËÂбþ¤¹¤ë¥Õ¥©¡¼¥à¥¿¥°¤ò¼èÆÀ¤¹¤ë
272 * @todo JavaScriptÂбþ
274 function getFormInput($name, $action, $params)
276 $af =& $this->_getHelperActionForm($action, $name);
281 $def = $af->getDef($name);
286 if (isset($def['form_type']) === false) {
287 $def['form_type'] = FORM_TYPE_TEXT;
290 // ÇÛÎó¥Õ¥©¡¼¥à¤¬²¿²ó¸Æ¤Ð¤ì¤¿¤«¤òÊݸ¤¹¤ë¥«¥¦¥ó¥¿
291 if (isset($def['type']) && is_array($def['type'])) {
292 static $form_counter = array();
293 if (isset($form_counter[$action]) === false) {
294 $form_counter[$action] = array();
296 if (isset($form_counter[$action][$name]) === false) {
297 $form_counter[$action][$name] = 0;
299 $def['_form_counter'] = $form_counter[$action][$name]++;
302 switch ($def['form_type']) {
303 case FORM_TYPE_BUTTON:
304 $input = $this->_getFormInput_Button($name, $def, $params);
307 case FORM_TYPE_CHECKBOX:
308 $def['option'] = $this->_getSelectorOptions($af, $def, $params);
309 $input = $this->_getFormInput_Checkbox($name, $def, $params);
313 $input = $this->_getFormInput_File($name, $def, $params);
316 case FORM_TYPE_HIDDEN:
317 $input = $this->_getFormInput_Hidden($name, $def, $params);
320 case FORM_TYPE_PASSWORD:
321 $input = $this->_getFormInput_Password($name, $def, $params);
324 case FORM_TYPE_RADIO:
325 $def['option'] = $this->_getSelectorOptions($af, $def, $params);
326 $input = $this->_getFormInput_Radio($name, $def, $params);
329 case FORM_TYPE_SELECT:
330 $def['option'] = $this->_getSelectorOptions($af, $def, $params);
331 $input = $this->_getFormInput_Select($name, $def, $params);
334 case FORM_TYPE_SUBMIT:
335 $input = $this->_getFormInput_Submit($name, $def, $params);
338 case FORM_TYPE_TEXTAREA:
339 $input = $this->_getFormInput_Textarea($name, $def, $params);
344 $input = $this->_getFormInput_Text($name, $def, $params);
354 * ¥Õ¥©¡¼¥à¥¿¥°¤ò¼èÆÀ¤¹¤ë(type="form")
358 function getFormBlock($content, $params)
361 if (isset($params['method']) === false) {
362 $params['method'] = 'post';
365 return $this->_getFormInput_Html('form', $params, $content, false);
369 // {{{ _getSelectorOptions
371 * select, radio, checkbox ¤ÎÁªÂò»è¤ò¼èÆÀ¤¹¤ë
375 function _getSelectorOptions(&$af, $def, $params)
377 // $params, $def ¤Î½ç¤ÇÄ´¤Ù¤ë
379 if (isset($params['option'])) {
380 $source = $params['option'];
381 } else if (isset($def['option'])) {
382 $source = $def['option'];
385 // ̤ÄêµÁ or ÄêµÁºÑ¤ß¤Î¾ì¹ç¤Ï¤½¤Î¤Þ¤Þ
386 if ($source === null) {
388 } else if (is_array($source)) {
394 $split = array_map("trim", explode(',', $source));
395 if (count($split) === 1) {
396 // ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à¤«¤é¼èÆÀ
397 $method_or_property = $split[0];
398 if (method_exists($af, $method_or_property)) {
399 $options = $af->$method_or_property();
401 $options = $af->$method_or_property;
404 // ¥Þ¥Í¡¼¥¸¥ã¤«¤é¼èÆÀ
405 $mgr =& $this->backend->getManager($split[0]);
406 $attr_list = $mgr->getAttrList($split[1]);
407 if (is_array($attr_list)) {
408 foreach ($attr_list as $key => $val) {
409 $options[$key] = $val['name'];
414 if (is_array($options) === false) {
415 $this->logger->log(LOG_WARNING,
416 'selector option is not valid. [actionform=%s, option=%s]',
417 get_class($af), $source);
425 // {{{ _getFormInput_Button
427 * ¥Õ¥©¡¼¥à¥¿¥°¤ò¼èÆÀ¤¹¤ë(type="button")
431 function _getFormInput_Button($name, $def, $params)
433 $params['type'] = 'button';
435 if (isset($def['type'])) {
436 $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
438 $params['name'] = $name;
440 if (isset($params['value']) === false) {
441 if (isset($def['name'])) {
442 $params['value'] = $def['name'];
445 if (isset($params['value']) && is_array($params['value'])) {
446 $params['value'] = $params['value'][0];
449 return $this->_getFormInput_Html('input', $params);
453 // {{{ _getFormInput_Checkbox
455 * ¥Á¥§¥Ã¥¯¥Ü¥Ã¥¯¥¹¥¿¥°¤ò¼èÆÀ¤¹¤ë(type="check")
459 function _getFormInput_Checkbox($name, $def, $params)
461 $params['type'] = 'checkbox';
462 if (isset($def['type'])) {
463 $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
465 $params['name'] = $name;
468 // ¥ª¥×¥·¥ç¥ó¤Î°ìÍ÷(alist)¤ò¼èÆÀ
469 if (isset($def['option']) && is_array($def['option'])) {
470 $options = $def['option'];
476 if (isset($params['default'])) {
477 $current_value = $params['default'];
478 } else if (isset($def['default'])) {
479 $current_value = $def['default'];
481 $current_value = array();
483 $current_value = array_map('strval', to_array($current_value));
486 if (isset($params['separator'])) {
487 $separator = $params['separator'];
494 foreach ($options as $key => $value) {
495 $params['value'] = $key;
496 $params['id'] = $name . '_' . $i++;
499 if (in_array((string) $key, $current_value, true)) {
500 $params['checked'] = 'checked';
502 unset($params['checked']);
505 // <input type="checkbox" />
506 $input_tag = $this->_getFormInput_Html('input', $params);
508 // <label for="id">..</label>
509 $ret[] = $this->_getFormInput_Html('label', array('for' => $params['id']),
510 $input_tag . $value, false);
513 return implode($separator, $ret);
517 // {{{ _getFormInput_File
519 * ¥Õ¥©¡¼¥à¥¿¥°¤ò¼èÆÀ¤¹¤ë(type="file")
523 function _getFormInput_File($name, $def, $params)
525 $params['type'] = 'file';
526 if (isset($def['type'])) {
527 $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
529 $params['name'] = $name;
531 $params['value'] = '';
533 return $this->_getFormInput_Html('input', $params);
537 // {{{ _getFormInput_Hidden
539 * ¥Õ¥©¡¼¥à¥¿¥°¤ò¼èÆÀ¤¹¤ë(type="hidden")
543 function _getFormInput_Hidden($name, $def, $params)
545 $params['type'] = 'hidden';
546 if (isset($def['type'])) {
547 $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
549 $params['name'] = $name;
554 if (isset($params['value'])) {
555 $value = $params['value'];
556 } else if (isset($params['default'])) {
557 $value = $params['default'];
558 } else if (isset($def['default'])) {
559 $value = $def['default'];
561 if (is_array($value)) {
562 if ($def['_form_counter'] < count($value)) {
563 $params['value'] = $value[$def['_form_counter']];
565 $params['value'] = '';
568 $params['value'] = $value;
571 return $this->_getFormInput_Html('input', $params);
575 // {{{ _getFormInput_Password
577 * ¥Õ¥©¡¼¥à¥¿¥°¤ò¼èÆÀ¤¹¤ë(type="password")
581 function _getFormInput_Password($name, $def, $params)
583 $params['type'] = 'password';
584 if (isset($def['type'])) {
585 $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
587 $params['name'] = $name;
592 if (isset($params['value'])) {
593 $value = $params['value'];
594 } else if (isset($params['default'])) {
595 $value = $params['default'];
596 } else if (isset($def['default'])) {
597 $value = $def['default'];
599 if (is_array($value)) {
600 if ($def['_form_counter'] < count($value)) {
601 $params['value'] = $value[$def['_form_counter']];
603 $params['value'] = '';
606 $params['value'] = $value;
610 if (isset($def['max']) && $def['max']) {
611 $params['maxlength'] = $def['max'];
614 return $this->_getFormInput_Html('input', $params);
618 // {{{ _getFormInput_Radio
620 * ¥é¥¸¥ª¥Ü¥¿¥ó¥¿¥°¤ò¼èÆÀ¤¹¤ë(type="radio")
624 function _getFormInput_Radio($name, $def, $params)
626 $params['type'] = 'radio';
627 if (isset($def['type'])) {
628 $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
630 $params['name'] = $name;
633 // ¥ª¥×¥·¥ç¥ó¤Î°ìÍ÷(alist)¤ò¼èÆÀ
634 if (isset($def['option']) && is_array($def['option'])) {
635 $options = $def['option'];
641 if (isset($params['default'])) {
642 $current_value = $params['default'];
643 } else if (isset($def['default'])) {
644 $current_value = $def['default'];
646 $current_value = null;
650 if (isset($params['separator'])) {
651 $separator = $params['separator'];
658 foreach ($options as $key => $value) {
659 $params['value'] = $key;
660 $params['id'] = $name . '_' . $i++;
663 if (strcmp($current_value,$key) === 0) {
664 $params['checked'] = 'checked';
666 unset($params['checked']);
669 // <input type="radio" />
670 $input_tag = $this->_getFormInput_Html('input', $params);
672 // <label for="id">..</label>
673 $ret[] = $this->_getFormInput_Html('label', array('for' => $params['id']),
674 $input_tag . $value, false);
677 return implode($separator, $ret);
681 // {{{ _getFormInput_Select
683 * ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹¥¿¥°¤ò¼èÆÀ¤¹¤ë(type="select")
687 function _getFormInput_Select($name, $def, $params)
689 if (isset($def['type'])) {
690 $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
692 $params['name'] = $name;
695 // ¥ª¥×¥·¥ç¥ó¤Î°ìÍ÷(alist)¤ò¼èÆÀ
696 if (isset($def['option']) && is_array($def['option'])) {
697 $options = $def['option'];
703 if (isset($params['default'])) {
704 $current_value = $params['default'];
705 } else if (isset($def['default'])) {
706 $current_value = $def['default'];
708 $current_value = array();
710 $current_value = array_map('strval', to_array($current_value));
713 if (isset($params['separator'])) {
714 $separator = $params['separator'];
719 // select¥¿¥°¤ÎÃæ¿È¤òºî¤ë
722 foreach ($options as $key => $value) {
723 $attr = array('value' => $key);
724 if (in_array((string) $key, $current_value, true)) {
725 $attr['selected'] = 'selected';
728 $contents[] = $this->_getFormInput_Html('option', $attr, $value);
732 if (isset($params['emptyoption'])) {
733 $attr = array('value' => '');
734 if ($selected === false) {
735 $attr['selected'] = 'selected';
737 array_unshift($contents,
738 $this->_getFormInput_Html('option',
740 $params['emptyoption']));
741 unset($params['emptyoption']);
744 $element = $separator . implode($separator, $contents) . $separator;
745 return $this->_getFormInput_Html('select', $params, $element, false);
749 // {{{ _getFormInput_Submit
751 * ¥Õ¥©¡¼¥à¥¿¥°¤ò¼èÆÀ¤¹¤ë(type="submit")
755 function _getFormInput_Submit($name, $def, $params)
757 $params['type'] = 'submit';
758 if (isset($def['type'])) {
759 $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
761 $params['name'] = $name;
763 if (isset($params['value']) === false) {
764 if (isset($def['name'])) {
765 $params['value'] = $def['name'];
768 if (is_array($params['value'])) {
769 $params['value'] = $params['value'][0];
772 return $this->_getFormInput_Html('input', $params);
776 // {{{ _getFormInput_Textarea
778 * ¥Õ¥©¡¼¥à¥¿¥°¤ò¼èÆÀ¤¹¤ë(textarea)
782 function _getFormInput_Textarea($name, $def, $params)
784 if (isset($def['type'])) {
785 $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
787 $params['name'] = $name;
792 if (isset($params['value'])) {
793 $element = $params['value'];
794 unset($params['value']);
795 } else if (isset($params['default'])) {
796 $element = $params['default'];
797 } else if (isset($def['default'])) {
798 $element = $def['default'];
800 if (is_array($element)) {
801 if ($def['_form_counter'] < count($element)) {
802 $element = $element[$def['_form_counter']];
807 $params['value'] = $element;
810 return $this->_getFormInput_Html('textarea', $params, $element);
814 // {{{ _getFormInput_Text
816 * ¥Õ¥©¡¼¥à¥¿¥°¤ò¼èÆÀ¤¹¤ë(type="text")
820 function _getFormInput_Text($name, $def, $params)
823 $params['type'] = 'text';
826 if (isset($def['type'])) {
827 $params['name'] = is_array($def['type']) ? $name . '[]' : $name;
829 $params['name'] = $name;
834 if (isset($params['value'])) {
835 $value = $params['value'];
836 } else if (isset($params['default'])) {
837 $value = $params['default'];
838 } else if (isset($def['default'])) {
839 $value = $def['default'];
841 if (is_array($value)) {
842 if ($def['_form_counter'] < count($value)) {
843 $params['value'] = $value[$def['_form_counter']];
845 $params['value'] = '';
848 $params['value'] = $value;
852 if (isset($def['max']) && $def['max']) {
853 $params['maxlength'] = $def['max'];
856 return $this->_getFormInput_Html('input', $params);
860 // {{{ _getFormInput_Html
866 function _getFormInput_Html($tag, $attr, $element = null, $escape_element = true)
868 // ÉÔÍפʥѥé¥á¡¼¥¿¤Ï¾Ã¤¹
869 foreach ($this->helper_parameter_keys as $key) {
875 foreach ($attr as $key => $value) {
876 if ($value === null) {
877 $r .= sprintf(' %s', $key);
879 $r .= sprintf(' %s="%s"', $key, htmlspecialchars($value, ENT_QUOTES));
883 if ($element === null) {
885 } else if ($escape_element) {
886 $r .= sprintf('>%s</%s>', htmlspecialchars($element, ENT_QUOTES), $tag);
888 $r .= sprintf('>%s</%s>', $element, $tag);
897 * ¥ì¥ó¥À¥é¥ª¥Ö¥¸¥§¥¯¥È¤ò¼èÆÀ¤¹¤ë
900 * @return object Ethna_Renderer ¥ì¥ó¥À¥é¥ª¥Ö¥¸¥§¥¯¥È
902 function &_getRenderer()
904 $_ret_object =& $this->_getTemplateEngine();
909 // {{{ _getTemplateEngine
911 * ¥ì¥ó¥À¥é¥ª¥Ö¥¸¥§¥¯¥È¤ò¼èÆÀ¤¹¤ë(¤½¤Î¤¦¤Á_getRenderer()¤ËÅý¹ç¤µ¤ì¤ëͽÄê)
914 * @return object Ethna_Renderer ¥ì¥ó¥À¥é¥ª¥Ö¥¸¥§¥¯¥È
917 function &_getTemplateEngine()
919 $c =& $this->backend->getController();
920 $renderer =& $c->getRenderer();
922 $form_array =& $this->af->getArray();
923 $app_array =& $this->af->getAppArray();
924 $app_ne_array =& $this->af->getAppNEArray();
925 $renderer->setPropByRef('form', $form_array);
926 $renderer->setPropByRef('app', $app_array);
927 $renderer->setPropByRef('app_ne', $app_ne_array);
928 $message_list = Ethna_Util::escapeHtml($this->ae->getMessageList());
929 $renderer->setPropByRef('errors', $message_list);
930 if (isset($_SESSION)) {
931 $tmp_session = Ethna_Util::escapeHtml($_SESSION);
932 $renderer->setPropByRef('session', $tmp_session);
934 $renderer->setProp('script',
935 htmlspecialchars(basename($_SERVER['SCRIPT_NAME']), ENT_QUOTES));
936 $renderer->setProp('request_uri',
937 isset($_SERVER['REQUEST_URI'])
938 ? htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES)
940 $renderer->setProp('config', $this->config->get());
951 * @param object Ethna_Renderer ¥ì¥ó¥À¥é¥ª¥Ö¥¸¥§¥¯¥È
953 function _setDefault(&$renderer)