public function run()
 {
     if (!empty($this->clientEvents)) {
         $events = $this->registerCKFInderEvents();
         $this->clientOptions['onInit'] = new JsExpression("function(finder){ {$events}}");
     }
     $options = empty($this->clientOptions) ? '' : Json::encode($this->clientOptions);
     $this->getView()->registerJs("\$('#{$this->options['id']}-popup').on('click', function(){ CKFinder.{$this->type}({$options}); });");
     CKFinderAsset::register($this->getView());
     Html::addCssClass($this->options, 'form-control');
     $input = $this->hasModel() ? Html::activeTextInput($this->model, $this->attribute, $this->options) : Html::textInput($this->name, $this->value, $this->options);
     return implode("\n", [Html::beginTag('div', ['class' => 'input-group']), $input, Html::beginTag('span', ['class' => 'input-group-btn']), Button::widget(['id' => $this->options['id'] . '-popup', 'label' => $this->buttonLabel, 'options' => $this->buttonOptions]), Html::endTag('span'), Html::endTag('div')]);
 }
Exemple #2
1
 protected function getButtons()
 {
     $content = '';
     foreach ($this->buttons as $button) {
         $content .= Button::widget($button) . "\n";
     }
     return $content;
 }
 /**
  * Generates the button dropdown.
  * @return string the rendering result.
  */
 protected function renderButton()
 {
     Html::addCssClass($this->options, 'btn');
     $label = $this->label;
     if ($this->encodeLabel) {
         $label = Html::encode($label);
     }
     $options = $this->options;
     $splitButton = '';
     $caretHtml = $this->caretHtml ? $this->caretHtml : '<span class="caret"></span>';
     if ($this->split) {
         $options = $this->options;
         $this->options['data-toggle'] = 'dropdown';
         Html::addCssClass($this->options, 'dropdown-toggle');
         $splitButton = Button::widget(['label' => $this->caretHtml ? $this->caretHtml : '<span class="caret"></span>', 'encodeLabel' => false, 'options' => $this->options, 'view' => $this->getView()]);
     } else {
         $label .= ' ' . $this->caretHtml ? $this->caretHtml : '<span class="caret"></span>';
         $options = $this->options;
         if (!isset($options['href'])) {
             $options['href'] = '#';
         }
         Html::addCssClass($options, 'dropdown-toggle');
         $options['data-toggle'] = 'dropdown';
     }
     return Button::widget(['tagName' => $this->tagName, 'label' => $label, 'options' => $options, 'encodeLabel' => false, 'view' => $this->getView()]) . "\n" . $splitButton;
 }
Exemple #4
0
 /**
  * Runs the widget.
  *
  * @return string the rendering result of this widget.
  */
 public function run()
 {
     $this->options = ArrayHelper::merge($this->getDefaultOptions(), $this->options);
     Html::addCssClass($this->options, $this->selector);
     $this->registerPlugin('popover');
     $this->getView()->registerJs('
         $(".' . $this->selector . '").popover();
     ');
     return parent::run();
 }
Exemple #5
0
 /**
  * Generates the buttons that compound the group as specified on [[buttons]].
  * @return string the rendering result.
  */
 protected function renderButtons()
 {
     $buttons = [];
     foreach ($this->buttons as $button) {
         if (is_array($button)) {
             $label = ArrayHelper::getValue($button, 'label');
             $options = ArrayHelper::getValue($button, 'options');
             $buttons[] = Button::widget(['label' => $label, 'options' => $options, 'encodeLabel' => $this->encodeLabels, 'view' => $this->getView()]);
         } else {
             $buttons[] = $button;
         }
     }
     return implode("\n", $buttons);
 }
 /**
  * Generates the buttons that compound the group as specified on [[buttons]].
  * @return string the rendering result.
  */
 protected function renderButtons()
 {
     $buttons = [];
     foreach ($this->buttons as $button) {
         if (is_array($button)) {
             $button['view'] = $this->getView();
             if (!isset($button['encodeLabel'])) {
                 $button['encodeLabel'] = $this->encodeLabels;
             }
             $buttons[] = Button::widget($button);
         } else {
             $buttons[] = $button;
         }
     }
     return implode("\n", $buttons);
 }
Exemple #7
0
 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     if (static::TYPE_DEFAULT !== $this->type) {
         Html::addCssClass($this->options, sprintf('btn-%s', $this->type));
     }
     Html::addCssClass($this->options, $this->color);
     if (in_array($this->size, $this->_sizes)) {
         Html::addCssClass($this->options, 'btn-' . $this->size);
     }
     if ($this->disabled === true) {
         Html::addCssClass($this->options, 'disabled');
     }
     if ($this->block === true) {
         Html::addCssClass($this->options, 'btn-block');
     }
     $this->options['type'] = 'button';
 }
?>

    <div id="form-contents">    
        <p id='form-error'><?php 
echo \Yii::t('app', '{h}Enter Valid Email or username you registered with{ch}', ['h' => '<b>', 'ch' => '</b>']);
?>
</p>
       <p> <input type="text" id="email" class="form-control" /></p>
       
        <div id="pbar" class="progress progress-striped active">
          <div class="progress-bar"  role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%">
          </div>
        </div>

        <p><?php 
echo Button::widget(['label' => Yii::t('app', 'Reset Password'), 'options' => ['class' => 'btn-sm btn-danger', 'id' => 'submitReset']]);
?>
        
        </p>
        <p><?php 
echo Html::checkbox('activation', false, ['id' => 'resendActivation']) . ' ' . \Yii::t('app', 'Only Resend Activation Code');
?>
</p>
    </div>
<?php 
Dialog::end();
?>

    <!-- Login part -->
<div class="site-login">
    <h1><?php 
Exemple #9
0
<?php

use yii\bootstrap\Button;
use yii\bootstrap\Modal;
use yii\helpers\Html;
Modal::begin(['id' => 'modal-fav', 'header' => '添加收藏', 'clientOptions' => ['show' => false], 'footer' => Button::widget(['label' => '保存', 'id' => 'btn-fav-save', 'options' => ['class' => 'btn btn-primary']])]);
?>


<div class="row">
    <?php 
if (empty($this->context->collections)) {
    ?>
        no fav co
    <?php 
} else {
    ?>
        <?php 
    foreach ($this->context->collections as $model) {
        ?>
            <div class="col-md-4 col-xs-6">
                <span>
                    <?php 
        echo Html::radio("collections", false, ['value' => $model->id, 'class' => 'collection']);
        ?>
                </span>
                <span>
                    <?php 
        echo Html::label($model->name);
        ?>
                </span>
Exemple #10
0
														<?php 
echo Html::passwordInput('password', '', ['class' => 'form-control', 'required' => 'required', 'placeholder' => 'กรุณากรอกรหัสผ่านใหม่']);
?>
														</div>
												</div>
												
												</div>
												
											</div>
									
											<div class="row rowbb">
												<div class="col-md-12">
													<div class="form-actions fluid">
														<div class="text-center">
														<?php 
echo Button::widget(['label' => 'บันทึก', 'options' => ['class' => 'btn green', 'type' => 'submit']]);
?>
														 <a href="<?php 
echo Url::toRoute('user/list');
?>
" class="btn default" >ยกเลิก </a>
														</div>
													</div>
												</div>
											</div>
								
								</div>
							</div>

						</div>
					</div>
 /**
  * Generates the dropdown menu.
  * 
  * @return string the rendering result.
  */
 protected function renderDropdown()
 {
     $buttons = [];
     foreach ($this->buttons as $key => $button) {
         $options = $this->options;
         unset($options['id']);
         $url = $this->createUrl($this->key, $key);
         $label = $this->encodeLabels ? Html::encode($button['label']) : $button['label'];
         $buttons[] = ['label' => isset($button['icon']) ? Html::icon($button['icon'], ['class' => 'text-' . $button['type']]) . ' ' . $label : $label, 'url' => $url, 'linkOptions' => $options];
     }
     if (count($buttons) <= 1) {
         return '';
     }
     $splitButton = Button::widget(['label' => '<span class="caret"></span>', 'encodeLabel' => false, 'options' => ['data-toggle' => 'dropdown', 'aria-haspopup' => 'true', 'class' => 'btn-default dropdown-toggle btn-xs']]);
     return $splitButton . "\n" . Dropdown::widget(['items' => $buttons, 'encodeLabels' => false, 'options' => ['class' => 'pull-right']]);
 }
        <img id="user-avatar" class="img-responsive" alt="<?php 
echo $model->fullname;
?>
"  src="<?php 
echo $model->image;
?>
"/>
    </div>
     
    <!-- Allow user to update only their profiles -->
    <?php 
if (!\Yii::$app->user->isGuest && \Yii::$app->user->identity->id == $model->id) {
    ?>
        <div style="padding-bottom:5px;">
            <?php 
    echo Button::widget(['label' => Yii::t('app', 'Change Avatar'), 'options' => ['class' => 'btn-sm btn-warning', 'id' => 'updateAvatar']]);
    ?>
            <?php 
    echo Html::a(Yii::t('app', 'Update Profile'), ['update', 'id' => $model->id], ['class' => 'btn btn-sm btn-primary']);
    ?>

        </div>
    <?php 
}
?>
    
    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['email:email', 'fname', 'lname', 'username', 'mobile', 'regtime:date', ['label' => $model->getAttributeLabel('gender'), 'value' => $model->gender == 1 ? Yii::t('app', 'Male') : Yii::t('app', 'Female')]]]);
?>
    
    <?php 
<?php

use yii\bootstrap\Button;
?>

<ul id="filelist"></ul>

<?php 
echo Button::widget(['label' => 'Browse', 'options' => ['id' => 'browse', 'class' => 'btn-default']]);
?>

<?php 
echo Button::widget(['label' => 'Start Upload', 'options' => ['id' => 'start-upload', 'class' => 'btn-default']]);
?>

<?php 
echo \indica\yii2plupload\widgets\CoreWidget::widget(['varName' => 'uploader', 'settings' => ['browse_button' => 'browse', 'url' => ['default/upload']]]);
?>

<h3>Console</h3>
<pre id="console"></pre>

<?php 
$this->registerJs("\n\tuploader.bind('FilesAdded', function(up, files) {\n\t\tvar html = '';\n\t\tplupload.each(files, function(file) {\n\t\t\thtml += '<li id=\"' + file.id + '\">' + file.name + ' (' + plupload.formatSize(file.size) + ') <b></b></li>';\n\t\t});\n\t\tdocument.getElementById('filelist').innerHTML += html;\n\t});\n\tuploader.bind('UploadProgress', function(up, file) {\n\t\tdocument.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = '<span>' + file.percent + \"%</span>\";\n\t});\n\tuploader.bind('Error', function(up, err) {\n\t\tdocument.getElementById('console').innerHTML += \"\\nError #\" + err.code + \": \" + err.message;\n\t});\n\tdocument.getElementById('start-upload').onclick = function() {\n\t\tuploader.start();\n\t};\n");
<?php

use kartik\form\ActiveForm;
use kartik\icons\Icon;
use kartik\widgets\Select2;
use yii\helpers\Html;
?>
<div class="well">
    <?php 
echo $this->render('alert');
?>
    <?php 
$form = ActiveForm::begin(['id' => 'Administrator', 'action' => \yii\helpers\Url::to(['']), 'type' => ActiveForm::TYPE_HORIZONTAL, 'enableClientScript' => false, 'enableClientValidation' => true, 'encodeErrorSummary' => false, 'formConfig' => ['labelSpan' => 3], 'options' => ['onkeypress' => "return event.keyCode != 13;"]]);
echo $form->errorSummary($admin, ['class' => 'alert alert-danger']);
?>
    <?php 
echo $form->field($admin, 'name')->textInput(['autocomplete' => 'off', 'placeholder' => $admin->getAttributeLabel('name')]);
?>
    <?php 
echo $form->field($admin, 'password')->passwordInput(['autocomplete' => 'off', 'placeholder' => $admin->getAttributeLabel('password')]);
?>
    <?php 
echo $form->field($admin, 'email')->textInput(['autocomplete' => 'off', 'placeholder' => $admin->getAttributeLabel('email')]);
?>
    <?php 
echo \yii\bootstrap\Button::widget(['id' => 'backButton', 'label' => Icon::show('arrow-circle-left') . Yii::t('install', 'Back'), 'encodeLabel' => false, 'options' => ['class' => 'btn btn-info', 'onClick' => new \yii\web\JsExpression("\n            \$('#stepsMenu a:eq({$previousStep})').click();\n            return false;")]]);
echo Html::a(Icon::show('arrow-circle-right') . Yii::t('install', 'Continue'), '', ['class' => 'btn btn-info', 'style' => 'margin-left: 10px;', 'onClick' => new \yii\web\JsExpression("\n        \$('#Administrator').submit();\n        return false;")]);
?>
</div>
Exemple #15
0
<div class="panel panel-default own-panel">
    <div class="panel-body">
        <div class="row">
            <div class="col-xs-12 col-sm-10">
                <?php 
echo \yii\bootstrap\Button::widget(['label' => '<span id="own-date-start">2016-01-01</span> - <span id="own-date-end">2016-01-05</span>&nbsp;&nbsp;<i class="fa fa-calendar"></i>', 'options' => ['id' => 'own-date-filter', 'class' => 'btn btn-success'], 'encodeLabel' => false]);
?>
                <div class="btn-group" role="group" id="own-filter-date-quick">
                    <button type="button" class="btn btn-default" data-date="0">今天</button>
                    <button type="button" class="btn btn-default" data-date="-1">昨天</button>
                    <button type="button" class="btn btn-default" data-date="-7">近7天</button>
                    <button type="button" class="btn btn-default" data-date="-15">近15天</button>
                    <button type="button" class="btn btn-default" data-date="-30">近30天</button>
                </div>
                <?php 
echo \yii\helpers\Html::button('<i class="fa fa-refresh"></i>&nbsp;&nbsp;刷新一下', ['class' => 'btn btn-success btn-sm', 'id' => 'own-refresh-chart']);
?>
            </div>
            <div class="col-xs-12 col-sm-2">
                <?php 
\yii\bootstrap\Modal::begin(['options' => ['class' => 'own-filter'], 'header' => '<h5><label>筛选</label></h5>', 'footer' => '<button type="button" class="btn btn-primary" data-dismiss="modal">取消</button>
                                                     <button type="button" class="btn btn-primary" id="own-sure-filter">确认</button>', 'toggleButton' => ['label' => '<i class="fa fa-filter"></i>&nbsp;&nbsp;过滤', 'class' => 'btn btn-success btn-sm pull-right']]);
?>
                <div class="btn-group" role="group" id="own-filter-tab">
                    <button type="button" class="btn btn-success" id="own-filter-tag-platform">平台</button>
                    <button type="button" class="btn btn-default" id="own-filter-tag-server">区服</button>
                    <button type="button" class="btn btn-default" id="own-filter-tag-channel">渠道</button>
                </div>
                <hr>
                <div class="btn-group pull-right btn-group-xs" role="group">
                    <button type="button" class="btn btn-success" id="own-filter-check-all">全选</button>
Exemple #16
0
use yii\bootstrap\Button;
/**
 * @var $elements []
 * @var $model SettingsModel
 */
$form = ActiveForm::begin();
$message = \Yii::$app->session->getFlash('settings');
if ($message) {
    echo Alert::widget(['options' => ['class' => 'alert-success'], 'body' => $message]);
}
foreach ($elements as $key => $element) {
    if (is_callable($element['input'])) {
        echo $element['input']($model, $key);
    } else {
        switch ($element['input']) {
            case 'dropdown':
                echo $form->field($model, $key)->dropDownList($element['options']);
                break;
            case 'checkboxList':
                echo $form->field($model, $key)->checkboxList($element['options']);
                break;
            default:
            case 'text':
                echo $form->field($model, $key);
        }
    }
}
echo '<div class="form-group">';
echo Button::widget(['label' => Yii::t('yii2settings', 'Save'), 'options' => ['class' => 'btn-primary']]);
echo '</div>';
$form->end();
Exemple #17
0
									<strong class="pull-right primary-font">Bhaumik Patel</strong>
								</div>
								<p>
									Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales.
								</p>
							</div>
						</li>
					</ul>
				</div>
				<!-- /.panel-body -->
				<div class="panel-footer">
					<div class="input-group">
						<input id="btn-input" type="text" class="form-control input-sm" placeholder="Type your message here..." />
						<span class="input-group-btn">
							<?php 
echo Button::widget(['label' => 'Send', 'options' => ['class' => 'btn btn-warning btn-sm', 'id' => 'btn-chat']]);
?>
						</span>
					</div>
				</div>
				<!-- /.panel-footer -->
			</div><!-- /.panel .chat-panel -->
		</div>
	</div>

	<!-- this goes on every site file in p2made demos -->
	<br><div class="alert alert-success" role="alert">
		<ul class="fa-ul">
			<li>
				<?php 
echo FA::fw(FA::_CODE)->li()->size(FA::SIZE_LARGE);
<?php

use karpoff\icrop\CropImageUpload;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;
use yii\grid\GridView;
echo \yii\bootstrap\Button::widget(['options' => ['id' => 'button-add', 'href' => Url::to('crop/edit'), 'class' => 'btn btn-primary'], 'tagName' => 'a', 'label' => 'Add']);
echo GridView::widget(array_merge(['id' => 'list-grid'], $grid_config));
Exemple #19
0
            $author = isset($v['config']['author']) ? "开发者:" . $v['config']['author'] : '';
            $email = isset($v['config']['email']) ? "联系方式:" . $v['config']['email'] : '';
            $dependencies = isset($v['config']['dependencies']) ? $v['config']['dependencies'] : '';
            $v['config']['description'] = mb_substr($v['config']['description'], 0, "255");
            $v['config']['description'] .= "<br/>" . $author . ", " . $email;
            if (!empty($dependencies)) {
                $v['config']['description'] .= "<br/>" . "依赖插件:" . $dependencies;
            }
            if (!empty($v['config']['needed'])) {
                $v['config']['description'] .= "<br/>" . "<font color='#f00' id='needed'>缺失依赖插件:</font>" . $v['config']['needed'];
            }
            //增加操作类型
            $btn_setup = Button::widget(array('label' => '安装', 'options' => array('class' => 'btn-xs btn-success', 'style' => 'margin-right:10px;', 'onclick' => 'plugin_action(this,"setup")')), true);
            $btn_unsetup = Button::widget(array('label' => '卸载', 'options' => array('class' => 'btn-xs btn-danger', 'style' => 'margin-right:10px;', 'onclick' => 'plugin_action(this,"unsetup")')), true);
            $btn_delete = Button::widget(array('label' => '删除', 'options' => array('class' => 'btn-xs btn-default', 'style' => '', 'onclick' => 'plugin_action(this,"delete")')), true);
            $btn_update = Button::widget(array('label' => '更新', 'options' => array('class' => 'btn-xs btn-info', 'style' => 'margin-right:10px;', 'onclick' => 'plugin_action(this,"update")')), true);
            $v['config']['_action_'] = '';
            if ($v['setup']) {
                $v['config']['_action_'] = $btn_unsetup;
                if ($v['update']) {
                    $v['config']['_action_'] .= $btn_update;
                }
            } else {
                $v['config']['_action_'] = $btn_setup . $btn_delete;
            }
            $data[] = $v['config'];
        }
    }
}
$gridDataProvider = new ArrayDataProvider(['allModels' => $data, 'sort' => ['attributes' => ['id', 'username', 'email']], 'pagination' => ['pageSize' => 20]]);
//$gridDataProvider->setTotalItemCount(isset($result['total']) ? $result['total'] :0);
Exemple #20
0
<?php

$form = \yii\bootstrap\ActiveForm::begin(['layout' => 'horizontal']);
echo $form->field($book, 'title');
echo $form->field($book, 'author_id')->dropDownList(\yii\helpers\ArrayHelper::map($authors, 'id', 'fullName'));
?>
    <div class="form-group field-book-date_created">
        <label class="control-label col-sm-3" for="book-date_created">Дата выхода книги </label>

        <div class="col-sm-6">
            <?php 
echo \yii\jui\DatePicker::widget(['model' => $book, 'attribute' => 'date_created', 'language' => 'ru', 'dateFormat' => 'yyyy-MM-dd']);
?>
        </div>

    </div>
<?php 
echo $form->field($book, 'preview');
echo \yii\bootstrap\Button::widget(['label' => 'Создать', 'options' => ['class' => 'col-md-offset-3']]);
Exemple #21
0
$this->title = Yii::t('app', 'Dashboard');
$form = ActiveForm::begin(['method' => 'post', 'layout' => 'inline', 'fieldConfig' => ['labelOptions' => ['class' => '']]]);
?>
    <?php 
echo $form->field($searchModel, 'groupBy')->dropDownList(['title' => Yii::t('app', 'Title'), 'process_id' => Yii::t('app', 'Process')]);
?>

    <?php 
echo $form->field($searchModel, 'dateFrom')->widget(DatePicker::className(), ['dateFormat' => 'yyyy-MM-dd']);
?>
    <?php 
echo $form->field($searchModel, 'dateTo')->widget(DatePicker::className(), ['dateFormat' => 'yyyy-MM-dd']);
?>

    <?php 
echo \yii\bootstrap\Button::widget(['label' => 'Submit', 'options' => ['class' => 'btn-primary']]);
ActiveForm::end();
?>
<div id="keys-activity-area" class="keys-activity-area clearfix"></div>
<div id="keys-activity" class="keys-activity clearfix"></div>
<div id="color-strip" class="color-strip clearfix"></div>
<div id="color-strip-clusters" class="color-strip clearfix"></div>
<div id="tasks" class="tasks-list"></div>
<div id="sunburst" class="clearfix"></div>
<div id="sunburst-clusters" class="clearfix"></div>
<div id="sunburst-task" class="clearfix"></div>


<div style="margin: 1em;" class="clearfix"><strong>Total activity:</strong> <?php 
echo Helper::formatTimeDuration($totalActivity / 1000);
?>
use app\helpers\Icon;
use app\widgets\ActiveForm;
use app\widgets\InputGroup;
use yii\bootstrap\Button;
use yii\helpers\Html;
use yii\web\JsExpression;
/** @var $this yii\web\View */
/** @var $form app\widgets\ActiveForm */
/** @var $model app\forms\user\Profile */
/** @var $emailId string */
$emailId = Html::getInputId($model, 'email');
$form = ActiveForm::begin(['id' => 'user-profile-form', 'pjax' => true, 'layout' => 'horizontal', 'enableClientValidation' => true, 'fieldConfig' => ['horizontalCssClasses' => ['label' => 'col-sm-2', 'wrapper' => 'col-sm-10']]]);
?>

    <?php 
echo $form->field($model, 'email')->widget(InputGroup::className(), ['inputOptions' => ['class' => 'form-control', 'disabled' => 'disabled'], 'button' => true, 'addon' => Button::widget(['label' => Icon::icon('glyphicon glyphicon-copy'), 'encodeLabel' => false, 'options' => ['class' => 'btn btn-default btn-flat'], 'clientEvents' => ['click' => new JsExpression("function (ev) {\n                    ev.preventDefault();\n                    \$('#{$emailId}').removeAttr('disabled').select();\n                    document.execCommand('copy');\n                    \$('#{$emailId}').attr('disabled', 'disabled');\n                }")]])]);
?>
    <?php 
echo $form->field($model, 'name');
?>
    <?php 
echo $form->field($model, 'password')->passwordInput();
?>
    <?php 
echo $form->field($model, 'password_repeat')->passwordInput();
?>

<?php 
ActiveForm::endWithActions(['cancel' => false]);
?>
        
?>
        </h4>
        <h4 class="item-content-heading">
            <?php 
echo Html::encode($region);
?>
        </h4>
        <h5><?php 
echo $model->contentTypes[$model->type] . ' | ' . Address::$permissions[$model->permission];
?>
</h5>
        <p>
            <?php 
echo Html::encode($model->description);
?>
        </p>
    </div>
    <?php 
if (!empty($buttons)) {
    ?>
        <div class="item-content-div">
            <?php 
    foreach ($buttons as $button) {
        echo Button::widget($button) . "\n";
    }
    ?>
        </div>
    <?php 
}
?>
</div>
Exemple #24
0
 * | | / // // ___//_  _//   ||  __||_   _|
 * | |/ // /(__  )  / / / /| || |     | |
 * |___//_//____/  /_/ /_/ |_||_|     |_|
 * @link http://vistart.name/
 * @copyright Copyright (c) 2016 vistart
 * @license http://vistart.name/license/
 */
use yii\bootstrap\Button;
use yii\bootstrap\ButtonDropdown;
use rho_my\modules\v1\controllers\PhoneController;
?>
<div class="panel-heading">
    <strong><?php 
echo Yii::t('my', 'Phone');
?>
</strong>
    <div class="pull-right"><!--
        <?php 
echo ButtonDropdown::widget(['label' => 'Amount', 'dropdown' => ['items' => [['label' => 'All', 'url' => '#'], '<li role="separator" class="divider"></li>', ['label' => '10', 'url' => '#'], ['label' => '20', 'url' => '#'], ['label' => '50', 'url' => '#']]], 'options' => ['class' => 'btn-primary']]);
?>
        <?php 
echo ButtonDropdown::widget(['label' => 'Type', 'dropdown' => ['items' => [['label' => 'All', 'url' => '#'], '<li role="separator" class="divider"></li>', ['label' => 'Home', 'url' => '#']]], 'options' => ['class' => 'btn-primary']]);
?>
-->
        <?php 
echo Button::widget(['label' => '<span class="glyphicon glyphicon-plus"></span> ' . 'Add', 'encodeLabel' => false, 'options' => ['class' => 'btn-success', 'data-toggle' => 'modal', 'data-target' => '#modal-new']]);
?>
    </div>
</div>
<?php 
echo \rho_my\widgets\item\FormWidget::widget(['model' => $newModel, 'action' => PhoneController::getRouteNew()]);
Exemple #25
0
$this->title = 'Edit chipset';
$this->params['breadcrumbs'][] = ['label' => 'Chipsets', 'url' => '/chipset'];
$this->params['breadcrumbs'][] = 'Edit';
?>
<div class="box">
<?php 
$form = ActiveForm::begin(['id' => 'edit-chipset-form', 'action' => 'save']);
?>
  <?php 
echo Html::activeHiddenInput($model, 'id');
?>
  <div class="box-body">
    <div class="form-group">
      <?php 
echo $form->field($model, 'value');
?>
    </div>
    <div class="box-footer">
      <?php 
echo Button::widget(['label' => 'Save', 'options' => ['class' => 'btn btn-primary']]);
?>
      <?php 
echo Html::a('Cancel', Yii::$app->request->referrer, ['class' => 'btn btn-default']);
?>
    </div>
  </div>
<?php 
ActiveForm::end();
?>
</div>
Exemple #26
0
<?php

/**
 * @link http://www.bigbrush-agency.com/
 * @copyright Copyright (c) 2015 Big Brush Agency ApS
 * @license http://www.bigbrush-agency.com/license/
 */
use yii\helpers\Html;
use yii\grid\GridView;
use yii\bootstrap\Button;
use yii\bootstrap\ButtonGroup;
use bigbrush\cms\widgets\DeleteButton;
?>
<div class="table-responsive">
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['header' => Yii::t('cms', 'Title'), 'format' => 'raw', 'value' => function ($data) {
    return str_repeat('<i class="fa fa-caret-right tree-indent"></i>', $data->depth - 1) . Html::a($data->title, ['edit', 'id' => $data->id]);
}], ['header' => Yii::t('cms', 'Default'), 'format' => 'raw', 'options' => ['width' => '1%'], 'contentOptions' => ['style' => 'text-align:center; vertical-align:middle;'], 'value' => function ($data) {
    return $data->is_default ? '<i class="fa fa-star"></i>' : '';
}], ['header' => Yii::t('cms', 'Ordering'), 'headerOptions' => ['style' => 'text-align:center; vertical-align:middle;'], 'format' => 'raw', 'options' => ['width' => '10%'], 'contentOptions' => ['style' => 'text-align:center; vertical-align:middle;'], 'value' => function ($data) {
    $options = ['class' => 'btn btn-default changeDirectionBtn', 'data-pid' => $data->id];
    return ButtonGroup::widget(['options' => ['class' => 'btn-group btn-group-xs'], 'buttons' => [Button::widget(['label' => '<i class="fa fa-arrow-up"></i>', 'encodeLabel' => false, 'options' => ['data-direction' => 'up'] + $options]), Button::widget(['label' => '<i class="fa fa-arrow-down"></i>', 'encodeLabel' => false, 'options' => ['data-direction' => 'down'] + $options])]]);
}], ['header' => Yii::t('cms', 'Delete'), 'format' => 'raw', 'options' => ['width' => '1%'], 'contentOptions' => ['style' => 'text-align:center; vertical-align:middle;'], 'value' => function ($data) {
    return DeleteButton::widget(['model' => $data, 'options' => ['class' => 'btn-xs']]);
}]]]);
?>
</div>
Exemple #27
0
 /**
  * Generates the buttons that compound the group as specified on [[buttons]].
  * @return string the rendering result.
  */
 protected function renderButtons()
 {
     $buttons = [];
     foreach ($this->buttons as $button) {
         if (is_array($button)) {
             $visible = ArrayHelper::remove($button, 'visible', true);
             if ($visible === false) {
                 continue;
             }
             $button['view'] = $this->getView();
             if (!isset($button['encodeLabel'])) {
                 $button['encodeLabel'] = $this->encodeLabels;
             }
             $buttons[] = Button::widget($button);
         } else {
             $buttons[] = $button;
         }
     }
     return implode("\n", $buttons);
 }
Exemple #28
0
    <div>
        <div style="width: 30%; float: left">
            <?php 
echo $form->field($searchModel, 'dateFrom')->widget(DatePicker::classname(), ['language' => 'ru'])->label(false)->textInput(['placeholder' => 'Дата выхода c']);
?>
        </div>
        <div style="width: 30%; float: left">
            <?php 
echo $form->field($searchModel, 'dateTo')->widget(DatePicker::classname(), ['language' => 'ru'])->label(false)->textInput(['placeholder' => 'Дата выхода по']);
?>
        </div>
        <div style="clear: both"></div>
    </div>
</div>
<?php 
echo Button::widget(['label' => 'search', 'options' => ['class' => 'btn-lg btn-primary']]);
ActiveForm::end();
?>


<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => ['id', 'name', ['attribute' => 'preview', 'format' => 'html', 'value' => function ($data) {
    return Html::img(Yii::getAlias('@web') . '/images/' . $data['preview'], ['width' => '30px', 'class' => 'scalable']);
}], 'fullName', 'date:date', 'date_create:date', 'actions' => ['format' => 'raw', 'value' => function ($data) {
    return ButtonGroup::widget(['encodeLabels' => false, 'options' => ['data-id' => $data['id']], 'buttons' => [['options' => ['class' => 'a-edit btn-primary'], 'label' => '<span class="glyphicon glyphicon-pencil"></span>'], ['options' => ['class' => 'a-view btn-primary', 'data-toggle' => 'modal', 'data-target' => '#modal-window'], 'label' => '<span class="glyphicon glyphicon-eye-open"></span>'], ['options' => ['class' => 'a-remove btn-primary'], 'label' => '<span class="glyphicon glyphicon-remove"></span>']]]);
}]]]);
yii\bootstrap\Modal::begin(['header' => '<h2>DetailView</h2>', 'options' => ['id' => 'modal-window']]);
?>
<div id="modal-content"></div>
<?php 
yii\bootstrap\Modal::end();
 * @var string $attribute
 * @var boolean $crop enable/disable crop
 * @var array $jcropSettings
 */
use yii\bootstrap\Button;
use yii\bootstrap\Modal;
use yii\bootstrap\Html;
use kartik\file\FileInput;
use yii\helpers\Json;
?>

<?php 
if ($crop) {
    ?>
    <?php 
    Modal::begin(['id' => $selector . '-modal', 'closeButton' => ['onclick' => 'destroyJcrop("' . $selector . '-image");', 'id' => $selector . '-image-close'], 'header' => '<h2>' . Yii::t('elgorm/image', 'Crop image') . '</h2>', 'footer' => Button::widget(['label' => 'ОК', 'options' => ['class' => 'btn btn-flat btn-primary', 'onclick' => '$("#' . $selector . '-image-close").click(); return false;']])]);
    ?>

    <img src="" id="<?php 
    echo $selector;
    ?>
-image">

    <?php 
    Modal::end();
}
?>

<div id="field-<?php 
echo $selector;
?>
 /**
  * Renders the page buttons.
  * @return string the rendering result
  */
 protected function renderPageButtons()
 {
     $pageCount = $this->pagination->getPageCount();
     if ($pageCount < 2) {
         return '';
     }
     $currentPage = $this->pagination->getPage(true) + 1;
     if ($currentPage < $pageCount) {
         return "<div style=\"display:none;\" class=\"next\">" . Html::a('next', $this->pagination->createUrl($currentPage)) . "</div><div class=\"loading\" style=\"padding: 1em 0;text-align: center;\">" . Button::widget(['label' => $this->nextPageLabel, 'options' => ['class' => $this->nextButtonCssClass ? $this->nextButtonCssClass : 'btn', 'data-loading-text' => 'Загружаем...', 'onclick' => 'return load_' . $this->widgetId . '($(this));', 'id' => 'load-more-btn_' . $this->widgetId]]) . "</div>";
     } else {
         return '';
     }
 }