示例#1
0
 /**
  * Renders the buttons in this form.
  * @return string the rendering result.
  */
 public function renderButtons()
 {
     $buttons = array();
     foreach ($this->getButtons() as $button) {
         $buttons[] = $this->renderElement($button);
     }
     return !empty($buttons) ? BsHtml::tag('div', array('class' => 'form-actions'), implode("\n", $buttons)) : '';
 }
示例#2
0
 public function run()
 {
     $type = $this->type;
     echo BsHtml::openTag('div', array('id' => $this->id));
     /*** Nav tabs ***/
     echo BsHtml::$type($this->_labels);
     /*** Tab panes ***/
     echo BsHtml::openTag('div', array('class' => 'tab-content'));
     foreach ($this->_content as $content) {
         $class = 'tab-pane' . ($content['active'] == true ? ' active' : '');
         echo BsHtml::tag('div', array('class' => $class, 'id' => $content['id'], 'role' => 'tabpanel'), $content['content']);
     }
     echo BsHtml::closeTag('div');
     echo BsHtml::closeTag('div');
     /*** clientScript ***/
     $cs = Yii::app()->getClientScript();
     $navs = '
         $("#' . $this->id . ' ul.nav a").on("click",function(e){
               e.preventDefault();
               $(this).tab("show");
         })
     ';
     $cs->registerScript("navs-" . $this->id, $navs);
 }
示例#3
0
<?php

/* @var $this SurveyController */
/* @var $simplePage SimplePage */
/* @var $dataProvider MultiLocatedSurveysDataProvider */
$columns = array(array("name" => "Название проекта", 'type' => 'raw', 'value' => '$data->title'), array("name" => "Aнкета", 'type' => 'raw', 'value' => '\'<a href="\'.Yii::app()->createUrl(\'survey/view\', array(\'id\' => $data->sid, \'location\' => $data->location)).\'" target="_blank">Открыть</a>\''), array('class' => "QuotasInfoDataColumn", 'quotaType' => 'limit', "name" => "Требуется анкет"), array("name" => "Сделано анкет", 'class' => "QuotasInfoDataColumn", 'quotaType' => 'totalCount', 'needLink' => true, 'needShowQuotaType' => 'limit'), array("name" => "Массив данных в SPSS", 'type' => 'raw', 'value' => '\'<a href="\'.Yii::app()->createUrl(\'survey/exportSPSSStructure\', array(\'id\' => $data->sid, \'location\' => $data->location)).\'" target="_blank">Скачать синтаксис</a>
                          <br/>
                          <a href="\'.Yii::app()->createUrl(\'survey/exportSPSSData\', array(\'id\' => $data->sid, \'location\' => $data->location)).\'" target="_blank">Скачать данные</a>\''), array("name" => "Массив данных в Excel", 'type' => 'raw', 'value' => '\'<a href="\'.Yii::app()->createUrl(\'survey/exportExcel\', array(\'id\' => $data->sid, \'location\' => $data->location)).\'" target="_blank">Скачать</a>\''), array("name" => "Быстрая аналитика", 'type' => 'raw', 'value' => '\'<a href="\'.Yii::app()->createUrl(\'survey/quickAnalytics\', array(\'id\' => $data->sid, \'location\' => $data->location)).\'" target="_blank">Открыть</a>\''), array("name" => "Полная аналитика", 'class' => 'DownloadFilesColumn', 'fileType' => AttachedFile::FILE_TYPE_FULL_ANALYTICS, 'nullValue' => array('value' => '\'<a href="\'.Yii::app()->createUrl(\'survey/orderAnalytics\', array(\'id\' => $data->sid, \'location\' => $data->location)).\'" class="offer-analytics" target="_blank">Не предусмотрено, заказать</a>\'', 'type' => 'raw'), 'linkValue' => 'Посмотреть структуру будущего отчёта'));
if (Yii::app()->user->checkAccess('survey.edit')) {
    $columns[] = array('name' => '', 'type' => 'raw', 'value' => '\'<a class="update" data-title="Редактировать" title="" data-toggle="tooltip" href="\'.Yii::app()->createUrl(\'survey/update\', array(\'id\' => $data->sid, \'location\' => $data->location)).\'" data-original-title="Редактировать">
        <span class="glyphicon glyphicon-pencil"></span>
    </a>\'', 'htmlOptions' => array('class' => 'button-column'));
}
?>

<?php 
if ($simplePage) {
    echo '<h1>' . $simplePage->title . '</h1>';
    echo BsHtml::tag('div', array('class' => 'page-text'), $simplePage->content);
} else {
    echo '<h1>Активные проекты</h1>';
}
$this->widget('bootstrap.widgets.BsGridView', array('id' => 'surveys-grid', 'dataProvider' => $dataProvider, 'columns' => $columns));
示例#4
0
 /**
  * Renders the empty message when there is no data.
  */
 public function renderEmptyText()
 {
     $emptyText = $this->emptyText === null ? Yii::t('zii', 'No results found.') : $this->emptyText;
     echo BsHtml::tag('div', array('class' => 'empty col-md-12'), $emptyText);
 }
示例#5
0
 /**
  * Runs the widget.
  */
 public function run()
 {
     $brand = $this->brandLabel !== false ? BsHtml::navbarBrandLink($this->brandLabel, $this->brandUrl, $this->brandOptions) : '';
     ob_start();
     foreach ($this->items as $item) {
         if (is_string($item)) {
             echo $item;
         } else {
             $widgetClassName = BsArray::popValue('class', $item);
             if ($widgetClassName !== null) {
                 $this->controller->widget($widgetClassName, $item);
             }
         }
     }
     $items = ob_get_clean();
     ob_start();
     if ($this->collapse !== false) {
         BsHtml::addCssClass('collapse navbar-collapse', $this->collapseOptions);
         ob_start();
         /* @var BsCollapse $collapseWidget */
         $collapseWidget = $this->controller->widget('bootstrap.widgets.BsCollapse', array('toggle' => false, 'content' => $items, 'htmlOptions' => $this->collapseOptions));
         $collapseContent = ob_get_clean();
         $collapseLink = BsHtml::navbarCollapseLink('#' . $collapseWidget->getId());
         echo BsHtml::tag('div', array('class' => 'navbar-header'), $collapseLink . $brand) . $collapseContent;
     } else {
         echo BsHtml::tag('div', array('class' => 'navbar-header'), $brand) . $items;
     }
     $containerContent = ob_get_clean();
     if (isset($this->position) && ($this->position === BsHtml::NAVBAR_POSITION_FIXED_TOP || $this->position === BsHtml::NAVBAR_POSITION_STATIC_TOP)) {
         $fluid = BsArray::popValue('containerOptions', $this->htmlOptions, false);
         $containerOptions = BsArray::popValue('containerOptions', $this->htmlOptions, array());
         $containerClass = 'container';
         if ($fluid) {
             $containerOptions = BsArray::removeValue('fluid', $this->htmlOptions, array());
             $containerClass = 'container-fluid';
         }
         BsHtml::addCssClass($containerClass, $containerOptions);
         $content = BsHtml::tag('div', $containerOptions, $containerContent);
         echo BsHtml::navbar($content, $this->htmlOptions);
         return;
     }
     echo BsHtml::navbar($containerContent, $this->htmlOptions);
 }
示例#6
0
 /**
  * Renders the decoration for the portlet.
  * The default implementation will render the title if it is set.
  */
 protected function renderDecoration()
 {
     if ($this->title !== null) {
         echo "<div class=\"{$this->decorationCssClass}\">\n";
         echo ($this->titleTag ? BsHtml::tag($this->titleTag, array('class' => $this->titleCssClass), $this->title) : $this->title) . "\n";
         echo "</div>\n";
     }
 }
示例#7
0
 /**
  * Renders the header HTML markup of the modal
  */
 public function renderModalHeader()
 {
     echo '<div class="modal-header">' . PHP_EOL;
     if ($this->closeText) {
         echo BsHtml::closeButton($this->closeText, array('data-dismiss' => 'modal'));
     }
     echo BsHtml::tag('h3', array(), $this->header);
     echo '</div>' . PHP_EOL;
 }