Example #1
0
 /**
  * 初期処理
  * @access public
  * @param Object $contextt context
  * @return boolean 処理結果
  */
 public function initialize($context)
 {
     parent::initialize($context);
     /* 初期値をセットする */
     $this->controller = $context->getController();
     $this->request = $context->getRequest();
     $this->user = $context->getUser();
     $this->moduleName = $context->getModuleName();
     $this->actionName = $context->getActionName();
     $this->messages =& CommonMessages::getInstance();
     /* フォーム登録リストのフォームをsmartyにすべてセットする */
     $o_smarty =& $this->getEngine();
     $o_smarty->register_object("style", $this, array("request", "checkErrorElement"));
     $this->quickformSmarty = new HTML_QuickForm_Renderer_ArraySmarty($this->getEngine());
     $formList = $this->request->getAttribute('formList');
     foreach ($formList as $formName) {
         $this->setForm($formName);
     }
     /* メッセージをsmartyにセットする */
     if ($this->request->hasAttribute('messages')) {
         $messages =& $this->request->getAttribute('messages');
         $messages = array_unique($messages);
         $this->setAttributeByRef('messages', $messages);
     }
     /* エラーメッセージをsmartyにセットする */
     if ($this->request->hasErrors()) {
         $errors =& $this->request->getErrors();
         $errors = array_unique($errors);
         $this->setAttributeByRef('errors', $errors);
     }
     // 共通の CSS をセット
     array_push($this->css_file_array, ACS_SELECTION_CSS_DIR . 'default.css');
     $this->setAttribute('include_css_array', $this->css_file_array);
     // 共通の JS をセット
     array_push($this->js_file_array, ACS_JS_DIR . 'swap.js');
     $this->setAttribute('include_script_array', $this->js_file_array);
     return true;
 }