Пример #1
0
 /**
  * Renders the main body content
  * @param  CActiveForm $form  The Form we're working with
  */
 private function renderMain($form)
 {
     // #main .content
     echo CHtml::openTag('div', array('id' => 'main', 'class' => 'nano'));
     echo CHtml::openTag('div', array('class' => 'nano-content'));
     echo CHtml::openTag('fieldset');
     // If we want a custom form view, render that view instead of the default behavior
     if ($this->model->form !== NULL) {
         $this->controller->renderPartial($this->model->form, array('model' => $this->model, 'properties' => $this->properties, 'form' => $form));
     } else {
         if (count($this->properties) == 0) {
             echo CHtml::tag('legend', array(), Yii::t('Dashboard.main', 'Change Theme Settings'));
             echo CHtml::tag('div', array('class' => 'alert alert-info'), Yii::t('Dashboard.main', 'There are no settings for this section.'));
         } else {
             $groups = $this->model->groups();
             if (!empty($groups)) {
                 foreach ($groups as $name => $attributes) {
                     echo CHtml::tag('legend', array(), $name);
                     echo CHtml::tag('div', array('class' => 'clearfix'), NULL);
                     foreach ($attributes as $property) {
                         $p = new StdClass();
                         $p->name = $property;
                         $this->renderProperties($form, $p);
                     }
                 }
             } else {
                 echo CHtml::tag('legend', array(), CiiInflector::titleize(get_class($this->model)));
                 foreach ($this->properties as $property) {
                     $this->renderProperties($form, $property);
                 }
             }
         }
     }
     echo CHtml::closeTag('div');
     echo CHtml::closeTag('div');
     echo CHtml::closeTag('div');
 }