Ejemplo n.º 1
0
    ?>
</p>
    <ul>
    <?php 
    foreach ($delete->getChildren() as $child) {
        ?>
        <li><?php 
        echo Html::a(e($child->title), ['page/view', 'id' => $child->id]);
        ?>
</li>
    <?php 
    }
    ?>
    </ul>
    <p class="lead"><?php 
    echo Yii::t('app', 'Please select what to do with these pages: ');
    ?>
</p>
    <?php 
    echo $form->field($delete, 'mode')->widget(Check::className(), ['type' => Check::TYPE_RADIO, 'options' => ['class' => 'checkbox-list-vert'], 'items' => $delete->getChoices()]);
    ?>
    <?php 
    echo $form->field($delete, 'parentId')->widget(Select2::className(), ['hideSearch' => false, 'remote' => ['wiki-suggest', 'ign' => $delete->getWiki()->id]])->label(false);
    ?>
    <hr>
<?php 
}
?>

<?php 
ActiveForm::endWithActions(['save' => ['label' => Yii::t('app', 'DELETE'), 'options' => ['class' => 'btn btn-flat bg-red']], 'cancel' => ['url' => ['page/view', 'id' => $delete->getWiki()->id]]]);
Ejemplo n.º 2
0
 /**
  * Renders tab section content.
  * @param string $section
  * @return string
  */
 protected function renderSection($section)
 {
     $configs = isset($this->_configs[$section]) ? $this->_configs[$section] : Param::getConfigsBySection($section);
     ob_start();
     ob_implicit_flush(false);
     if ($this->pjax) {
         Pjax::begin($this->pjaxOptions);
     }
     $form = ActiveForm::begin(['action' => [$this->id, 'tab' => $section], 'pjax' => $this->pjax]);
     echo Html::hiddenInput('section', $section);
     foreach ($configs as $config) {
         if (!Param::isAccess($config)) {
             continue;
         }
         $title = Yii::t('app', $config->title);
         $field = $form->field($config, "[{$config->id}]value")->hint(Yii::t('app', $config->desc));
         switch ($config->value_type) {
             case Config::TYPE_TEXT:
             case Config::TYPE_URL:
             case Config::TYPE_EMAIL:
             case Config::TYPE_INT:
             case Config::TYPE_NUM:
                 echo $field->textInput()->label($title);
                 break;
             case Config::TYPE_EDITOR:
                 echo $field->textArea()->label($title);
                 break;
             case Config::TYPE_SWITCH:
                 echo $field->widget(Check::className(), ['label' => $title])->label(false);
                 break;
             case Config::TYPE_SELECT:
                 echo $field->widget(Select2::className(), ['items' => $config->options])->label($title);
                 break;
             case Config::TYPE_PASSWORD:
                 echo $field->passwordInput()->label($title);
                 break;
         }
     }
     ActiveForm::endWithActions(['cancel' => false]);
     if ($this->pjax) {
         Pjax::end();
     }
     return ob_get_clean();
 }
Ejemplo n.º 3
0
Box::begin(['box' => Box::BOX_WARNING, 'label' => 'Box 2', 'removable' => true, 'actions' => [['label' => 'Configure', 'options' => ['class' => 'configure']]]]);
?>
            The body of the box. The body of the box. The body of the box.
        <?php 
Box::end();
?>
            
        <?php 
Box::begin(['box' => Box::BOX_SUCCESS, 'label' => 'Select2 widget']);
?>
            <?php 
echo Select2::widget(['name' => 'demo-select2', 'items' => [1 => 'Zoo', 2 => 'Park', 3 => 'Cinema']]);
?>
            <hr>
            <?php 
echo Select2::widget(['name' => 'demo-select2', 'hideSearch' => false, 'items' => [1 => 'Zoo', 2 => 'Park', 3 => 'Cinema', 4 => 'Shop', 5 => 'Market']]);
?>
        <?php 
Box::end();
?>
            
        <?php 
Box::begin(['label' => 'Item list', 'box' => Box::BOX_DANGER]);
?>
            <?php 
echo ItemList::widget(['items' => [['title' => 'Created by', 'value' => 'user'], ['title' => 'Date', 'value' => '2016.08.09'], ['title' => 'Status', 'value' => 'Enabled']]]);
?>
        <?php 
Box::end();
?>
    </div>