Beispiel #1
0
 /**
  * Runs the widget
  */
 public function run()
 {
     parent::run();
     if ($this->useSessionFlash) {
         $this->renderFlashAlerts();
     } else {
         $this->renderAlerts();
     }
     echo "\n" . Html::endTag('div');
 }
 public function run()
 {
     parent::run();
     if ($this->options !== null) {
         $tag = ArrayHelper::remove($this->options, 'tag', 'div');
         $options = ArrayHelper::merge(['id' => $this->id], $this->options);
         echo Html::tag($tag, '', $options);
         $this->clientOptions['chart']['renderTo'] = $this->id;
     }
     $this->registerClientScripts();
 }
 public function run()
 {
     parent::run();
     if ($this->useFlash) {
         $this->_renderWithSession();
     } else {
         if (!isset($this->jsOptions['type']) || !isset($this->jsOptions['text'])) {
             throw new InvalidConfigException('`type` and `text` must be set. please check it.');
         }
         $this->_renderDirect();
     }
 }
Beispiel #4
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     echo Html::beginTag('div', $this->options);
     echo Html::tag('div', Html::tag('h3', $this->header) . Html::tag('p', $this->text), ['class' => 'inner']);
     if (!empty($this->icon)) {
         echo Html::tag('div', new Icon($this->icon), ['class' => 'icon']);
     }
     if (!empty($this->linkLabel)) {
         echo Html::a($this->linkLabel, $this->linkRoute, ['class' => 'small-box-footer']);
     }
     echo Html::endTag('div');
     parent::run();
 }
Beispiel #5
0
 public function run()
 {
     parent::run();
     $limit_ad = FConfigParam::find()->where(['name' => 'NUMBER_AD_IN_BODY'])->one();
     if ($limit_ad) {
         $limit = $limit_ad->value;
     } else {
         $limit = 3;
     }
     $query = FAdvertise::find()->where(['is_show' => 1, 'position' => 'body', 'show_in' => $this->lan_center])->andwhere(['<=', 'start_at', new Expression('NOW()')])->andwhere(['>=', 'end_at', new Expression('NOW()')]);
     $advertise = $query->limit($limit)->all();
     return $this->render('@frontend/views/widgets/banner', ['advertises' => $advertise]);
 }
Beispiel #6
0
 public function run()
 {
     parent::run();
     $limit_Lang_most = FConfigParam::find()->where(['name' => 'NUMBER_LANGUE_IN_MOST'])->one();
     if ($limit_Lang_most) {
         $limit = $limit_Lang_most->value;
     } else {
         $limit = 10;
     }
     $query = FLanguecenter::find()->where(['is_show' => 1])->orderBy('number DESC');
     $mostViewlangs = $query->limit($limit)->all();
     return $this->render('@frontend/views/widgets/mostView', ['mostViewlangs' => $mostViewlangs]);
 }
Beispiel #7
0
 public function run()
 {
     parent::run();
     $limit_ad = FConfigParam::find()->where(['name' => 'NUMBER_IMAGE_TOP'])->one();
     if ($limit_ad) {
         $limit = $limit_ad->value;
     } else {
         $limit = 3;
     }
     $query = FAdvertise::find()->where(['is_show' => 1, 'position' => 'top', 'type' => 'image', 'show_in' => $this->lan_center]);
     $advertise = $query->limit($limit)->all();
     $banner = null;
     if (!$advertise) {
         $query1 = FAdvertise::find()->where(['is_show' => 1, 'position' => 'top', 'type' => 'image', 'show_in' => null]);
         $banner = $query1->one();
         //print_r($banner);
         //die('hello');
     }
     return $this->render('@frontend/views/widgets/bannertop', ['advertises' => $advertise, 'banner' => $banner]);
 }
Beispiel #8
0
    public function run()
    {
        parent::run();
        $content = Html::submitButton($this->model->isNewRecord ? self::t('messages', 'Create') : self::t('messages', 'Update'), ['class' => $this->model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
        $jsCreateClose = <<<JS
            var action = \$(this).parents('form').attr('action');
            var submitButton =  \$(this).parent().find('button[type=submit]');
            \$(this).parents('form').attr('action', action + '&close=true');
            submitButton.click();
            return false;
JS;
        $content .= ' ' . Html::a($this->model->isNewRecord ? self::t('messages', 'Create and close') : self::t('messages', 'Update and close'), '#', ['class' => 'btn btn-default btn-sm', 'onclick' => $jsCreateClose]);
        $returnUrl = null;
        if (\Yii::$app->controller->defaultAction === null) {
            $returnUrl = \Yii::$app->user->returnUrl;
        } else {
            $returnUrl = [\Yii::$app->controller->defaultAction];
        }
        $content .= ' ' . Html::a(self::t('messages', 'Close'), $returnUrl, ['class' => 'btn btn-default btn-sm']);
        $content = Html::tag('div', $content, ['class' => 'col-sm-8']) . Html::tag('div', $this->getInfoRecord(), ['class' => 'col-sm-4 text-right']);
        return Html::tag('div', $content, ['class' => 'form-group well row']);
    }
 /**
  * Output collected content
  * @return string
  */
 public function run()
 {
     parent::run();
     return $this->content;
 }
Beispiel #10
0
 public function run()
 {
     parent::run();
     return $this->render('@frontend/views/widget/cropImg', ['btn_name' => $this->btn_name]);
 }
Beispiel #11
0
 public function run()
 {
     parent::run();
     return $this->render('//site/login');
 }
Beispiel #12
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     echo Html::endTag('div');
     echo Html::endTag('div');
     parent::run();
 }
Beispiel #13
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     parent::run();
     echo $this->getGridOutput();
 }
Beispiel #14
0
 public function run()
 {
     parent::run();
 }
Beispiel #15
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     echo Html::tag('div', '', ['id' => $this->options['id']]);
     $this->registerAssets();
     parent::run();
 }
Beispiel #16
0
 public function run()
 {
     parent::run();
     return Html::activeTextarea($this->model, $this->attribute, $this->htmlOptions);
 }
Beispiel #17
0
 public function run()
 {
     parent::run();
     $magazin = new FMagazin();
     return $this->render('@frontend/views/widgets/magazin', ['magazin' => $magazin]);
 }