コード例 #1
0
ファイル: form.php プロジェクト: openly/Openjuice-Package
 public function getFieldGroupMarkup($fieldGroup, $args = null)
 {
     if ($args == null) {
         $args = $this->getFieldValues();
     }
     $grpTemplate = $this->groupTemplate;
     $fieldTemplate = $this->fieldTemplate;
     $grpHead = '';
     if (isset($this->fieldGroups[$fieldGroup])) {
         $grpDesc = $this->fieldGroups[$fieldGroup];
         $grpTemplate = $grpDesc['template'] ? $grpDesc['template'] : $grpTemplate;
         $fieldTemplate = $grpDesc['field_template'] ? $grpDesc['field_template'] : $fieldTemplate;
         $grpHead = $grpDesc['group_name'];
         //echo $fieldTemplate;
     }
     $renderedFields = array();
     foreach ($this->fields as $field) {
         if (is_array($this->values)) {
             $this->applyFormRules($field, array_merge($this->values, $args));
         } else {
             $this->applyFormRules($field, $args);
         }
         if (!$field['field_group'] || $field['field_group'] != $fieldGroup) {
             continue;
         }
         $fieldMarkup = OJGenerator::getField($field, $this->fieldPrefix, $fieldTemplate, $this->formRules[$field['name']])->getMarkup();
         $renderedFields[] = array('field' => $fieldMarkup);
     }
     $r = new Renderable($grpTemplate);
     $fGroupParams = array('group_name' => $grpHead, 'fields' => $renderedFields, 'group_id' => $fieldGroup);
     return $r->getMarkup($fGroupParams);
 }
コード例 #2
0
 /**
  * getFooter
  * 
  * @access public
  *
  * @return mixed Value.
  */
 public function getFooter()
 {
     $m = new Renderable($this->footerTemplate);
     return $m->getMarkup($this->_pagination);
 }
コード例 #3
0
 /**
  * getDetailForm
  * 
  * @access private
  *
  * @return mixed Value.
  */
 public function getFooter()
 {
     $r = new Renderable($this->footerTemplate);
     $vars = array('is_wizzard' => $this->model->usesWizzard(), 'is_form' => !$this->model->usesWizzard());
     //Mustache is logicless templating...
     if ($vars['is_wizzard']) {
         $vars['has_prev_btn'] = $this->form->hasPrevStep();
         $vars['has_next_btn'] = $this->form->hasNextStep();
         $vars['has_finish_btn'] = $this->form->canFinishAtThisStep();
         $vars['prev_btn_name'] = $this->form->getPrevButtonName();
         $vars['next_btn_name'] = $this->form->getNextButtonName();
         $vars['finish_btn_name'] = $this->form->getFinishButtonName();
     } else {
         $vars['has_finish_btn'] = true;
         $vars['finish_btn_name'] = $this->form->getSubmitButtonName();
     }
     $vars['listURL'] = view::url($this->listURL);
     $retStr = $r->getMarkup($vars);
     return $retStr . '</form>';
 }
コード例 #4
0
ファイル: field.php プロジェクト: openly/Openjuice-Package
 public function getMarkup()
 {
     $this->initialize();
     return parent::getMarkup();
 }