/** * @inheritdoc */ protected function renderDataCellContent($model, $key, $index) { $value = $this->getDataCellValue($model, $key, $index); $name = $this->getLabelName($model, $key, $index, $value); $class = ArrayHelper::getValue($this->cssCLasses, $value, 'default'); $html = Html::tag('span', Html::encode($name), ['class' => 'label label-' . $class]); return $value === null ? $this->grid->emptyCell : $html; }
protected function renderDataCellContent($model, $key, $index) { $value = $this->getDataCellValue($model, $key, $index); $label = $value ? $this->getRoleLabel($value) : $value; $class = $value == $this->defaultRole ? 'primary' : 'danger'; $html = Html::tag('span', Html::encode($label), ['class' => 'label label-' . $class]); return $value === null ? $this->grid->emptyCell : $html; }
echo $form->field($model, 'file')->fileInput(); ?> </div> </div> <div class="form-group row"> <div class="col-md-12"> <fieldset> <legend> <?php echo Yii::t('app', 'Add property groups to each new object: '); ?> </legend> <?php echo $form->field($model, 'addPropertyGroups')->checkboxList(\yii\helpers\ArrayHelper::map(\app\models\PropertyGroup::getForObjectId($object->id), 'id', 'name'), ['item' => function ($index, $label, $name, $checked, $value) { $line = Html::beginTag('div', ['class' => 'checkbox']); $line .= Html::checkbox($name, $checked, ['value' => $value, 'label' => Html::encode($label)]); $line .= '</div>'; return $line; }])->label(''); ?> </fieldset> </div> </div> <?php } ?> <?php if (!$importMode) { ?> <?php
<?php echo Html::encode($this->title); ?> <br /> <small> <?php echo Html::a($model->votes_up, ['voteup', 'id' => $model->id, 'redirect' => 'view?id=' . $model->id], ['class' => 'like glyphicon glyphicon-thumbs-up nounderline', 'data' => ['toggle' => 'tooltip', 'placement' => 'right'], 'title' => 'Vote me Up']); ?> <?php echo Html::a($model->votes_down, ['votedown', 'id' => $model->id, 'redirect' => 'view?id=' . $model->id], ['class' => 'unlike glyphicon glyphicon-thumbs-down nounderline', 'data' => ['toggle' => 'tooltip', 'placement' => 'right'], 'title' => 'Vote me Down']); ?> </small> </h1> <h3 class="col-md-8 text-center"> <?php echo Html::encode($model->description); ?> </h3> <h1 class="col-md-1"> <small> <?php if ($model->api0->name !== 'core') { ?> <?php echo Html::a(Html::icon('pencil', ['data' => ['toggle' => 'tooltip', 'placement' => 'right'], 'title' => 'Update']), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']); ?> <?php echo Html::a(Html::icon('trash', ['data' => ['toggle' => 'tooltip', 'placement' => 'right'], 'title' => 'Delete']), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => 'Are you sure you want to delete this item?', 'method' => 'post']]); ?> <?php }
<?php ActiveForm::end(); ?> <section style="display: none" data-type="x-tmpl-underscore" id="parameter-template"> <div class="row form-group parameter"> <label class="col-md-2 control-label" for="PropertyValue_<%- index %>"> <select class="property_id form-control"> <option value="0">- <?php echo Yii::t('app', 'select'); ?> -</option> <?php foreach ($static_values_properties as $prop) { echo "<option value=\"" . $prop['property']->id . "\">" . Html::encode($prop['property']->name) . "</option>"; } ?> </select> </label> <div class="col-md-10"> <div class="input-group"> <select id="PropertyValue_<%- index %>" class="form-control select"> </select> <span class="input-group-btn"> <a class="btn btn-danger btn-remove"> <?php echo Icon::show('thrash-o'); ?> <?php echo Yii::t('app', 'Remove');
</div> <div class="form-group field-page-name"> <p class="control-label col-md-2" ><?php echo Yii::t('app', 'Form'); ?> </p> <div class="col-md-10"> <?php $form = Form::findById($review->submission->form_id); ?> <?php if (null !== $form) { ?> <?php echo Html::encode($form->name); ?> <?php } ?> </div> <div class="col-md-offset-2 col-md-10"></div> </div> <div class="form-group field-page-name"> <p class="control-label col-md-2" ><?php echo Yii::t('app', 'IP'); ?> </p> <div class="col-md-10"> <?php
use yii\widgets\Pjax; use app\modules\page\models\backend\Page; use app\widgets\grid\SetColumn; /* @var $this yii\web\View */ /* @var $searchModel app\modules\page\models\backend\search\PageSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = 'Страницы'; $this->params['breadcrumbs'][] = $this->title; ?> <h1><?php echo Html::encode($this->title); ?> </h1> <p class="pull-left"> <?php echo Html::a('<i class="material-icons">add</i> Добавить страницу', ['create'], ['class' => 'btn btn-success']); ?> </p> <?php Pjax::begin(['enablePushState' => false]); echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\CheckboxColumn', 'contentOptions' => ['class' => 'check-column']], ['attribute' => 'title', 'format' => 'raw', 'value' => function ($model, $key, $index, $column) { /** @var \app\modules\page\models\backend\Page $model */ return Html::a(Html::encode($model->title), ['/page/node/view', 'slug' => $model->slug]); }], ['attribute' => 'updated_at', 'format' => 'datetime', 'contentOptions' => ['class' => 'at-column']], ['class' => SetColumn::className(), 'filter' => Page::getStatusesArray(), 'attribute' => 'status', 'name' => 'statusName', 'cssCLasses' => [Page::STATUS_ACTIVE => 'success', Page::STATUS_WAIT => 'warning'], 'contentOptions' => ['class' => 'status-column']], ['class' => 'app\\widgets\\grid\\ActionColumn', 'buttons' => ['view' => function ($url, $model, $key) { /** @var \app\modules\page\models\backend\Page $model */ return Html::a('<i class="material-icons">visibility</i>', ['/page/node/view', 'slug' => $model->slug]); }]]]]); Pjax::end();
<?php use kartik\helpers\Html; use app\modules\admin\rbac\Rbac as AdminRbac; /* @var $this yii\web\View */ /* @var $model app\modules\slider\models\backend\Slider */ ?> <?php $this->beginBlock('title'); echo Yii::$app->user->can(AdminRbac::PERMISSION_ADMIN_PANEL) ? Html::a('<i class="material-icons">mode_edit</i>', ['/admin/sliders/default/update', 'id' => $model->id]) : false; echo Html::encode($model->title); $this->endBlock(); ?> <div class="container"> <div class="field-body"> <?php echo $model->body; ?> </div> </div>
* @var \app\modules\shop\models\OrderItem[] $items * @var \yii\web\View $this */ use app\modules\shop\models\Product; use kartik\helpers\Html; foreach ($items as $item) { ?> <tr class="warning" style="color: #666; font-size: 12px;"> <td style="padding-left: 40px;"> <?php echo \app\modules\image\widgets\ObjectImageWidget::widget(['limit' => 1, 'model' => $item->product]); ?> </td> <td> <?php echo Html::encode($item->product->name); ?> </td> <td><?php echo $item->product->formattedPrice(null, false, false); ?> </td> <td> <?php if ($immutable === true) { ?> <?php echo $item->quantity; ?> <?php } else {
if (count($model->images) > 1) { ?> <div class="other-images"> <?php echo ObjectImageWidget::widget(['model' => $model]); ?> </div> <?php } ?> </div> </div> <div class="col-md-6 col-sm-6 col-xs-12 col-lg-8"> <h1 itemprop="name"> <?php echo Html::encode($model->h1); ?> </h1> <div class="row"> <div class="col-md-6 col-sm-6 col-xs-12 col-lg-8"> <div itemprop="description"> <?php if (empty($this->blocks['announce'])) { $propertiesShowedInAnnounce = true; echo \app\properties\PropertiesWidget::widget(['model' => $model, 'viewFile' => 'show-properties-widget']); } else { echo $this->blocks['announce']; } ?> </div>
<?php use kartik\helpers\Html; use yii\widgets\ListView; use yii\widgets\Pjax; /* @var $this yii\web\View */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = 'Галерея'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="gallery-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php Pjax::begin(); ?> <div class="gallery-view-block"> <?php echo ListView::widget(['dataProvider' => $dataProvider, 'itemOptions' => ['class' => 'item'], 'layout' => '{items}{pager}', 'itemView' => function ($model, $key, $index, $widget) { return Html::a(Html::tag('div', Html::icon('folder-open')) . Html::tag('div', Html::encode($model->name), ['class' => 'gallery-view-box-name']), ['view', 'id' => $model->id], ['class' => 'gallery-view-box text-center']); }]); ?> </div> <?php Pjax::end(); ?> </div>
<?php use yii\widgets\Pjax; use kartik\helpers\Html; use yii\helpers\ArrayHelper; Pjax::begin(['id' => 'answer-poll', 'timeout' => 5000]); if (empty($answerPoll)) { if (isset($alertMessage) && $alertMessage != '') { echo $alertMessage; } echo Html::beginForm(['/'], 'post', ['data-pjax' => '1', 'class' => '']); echo Html::radioList('answer_id', $answersData[0]->id, ArrayHelper::map($answersData, 'id', 'answer'), ['item' => function ($index, $label, $name, $checked, $value) { return Html::tag('div', Html::radio($name, $checked, ['value' => $value, 'label' => Html::encode($label)]), ['class' => 'radio']); }]); echo Html::input('hidden', 'question_id', $questions['id']); echo Html::submitButton('Голосовать', ['class' => 'btn btn-sm btn-primary', 'name' => 'hash-button']); echo Html::endForm(); } else { $sumOfVoices = 0; foreach ($answersData as $item) { $sumOfVoices = $sumOfVoices + $item->how_many; } for ($i = 0; $i < count($answersData); $i++) { $voicesPer = 0; if ($sumOfVoices == 0) { $voicesPer = 0; } else { $voicesPer = round($answersData[$i]->how_many / $sumOfVoices, 4) * 100; } ?> <div class="poll-option-block">
乐宝 = 1 永利会 = 2 落地 <script type="text/javascript" src="//tj.sasa8.com/ld.js"></script> 推广 <script type="text/javascript" src="//tj.sasa8.com/tg.js"></script> 注册 <script type="text/javascript" src="//tj.sasa8.com/zc.js"></script> CODE; ?> <?php echo \kartik\helpers\Html::encode($str); ?> </pre> </td> </tr> </table> </div> </div>
<?php /** * @var $attribute_name string * @var $form \yii\widgets\ActiveForm * @var $label string * @var $model \app\properties\AbstractModel * @var $multiple boolean * @var $property_id integer * @var $property_key string * @var $this \app\properties\handlers\Handler * @var $values array */ use app\models\Property; use kartik\helpers\Html; ?> <dl> <?php if (count($values->values) == 0) { return; } $property = Property::findById($property_id); echo Html::tag('dt', $property->name); foreach ($values->values as $val) { if (isset($val['value'])) { echo Html::tag('dd', Html::encode($val['value'])); } } ?> </dl>
</th> </tr> </thead> <tbody> <?php foreach ($items as $item) { ?> <tr> <td class="product-image"> <?php echo \app\modules\image\widgets\ObjectImageWidget::widget(['limit' => 1, 'model' => $item->product, 'thumbnailOnDemand' => true, 'thumbnailWidth' => 140, 'thumbnailHeight' => 140]); ?> </td> <td> <?php echo Html::a(Html::encode($item->product->name), \yii\helpers\Url::to(['/shop/product/show', 'model' => $item->product, 'category_group_id' => $item->product->category->category_group_id])); ?> </td> <td> <?php echo $mainCurrency->format($item->price_per_pcs); ?> </td> <td><?php echo $item->quantity; ?> </td> <td> <span class="item-price"> <?php if ($item->discount_amount > 0) {
*/ use app\modules\image\widgets\ObjectImageWidget; use kartik\helpers\Html; ?> <div class="row"> <div class="span2"> <?php echo ObjectImageWidget::widget(['limit' => 1, 'model' => $product]); ?> </div> <div class="span4"> <h5><a href="<?php echo $url; ?> "><?php echo Html::encode($product->name); ?> </a></h5> <p> <?php echo $product->announce; ?> </p> <a class="btn btn-small pull-right" href="<?php echo $url; ?> "><?php echo Yii::t('app', 'View details'); ?> </a>
</th> <th> <?php echo Yii::t('app', 'Actions'); ?> </th> </tr> </thead> <tbody> <?php foreach ($model->applying as $widget_applying) { ?> <tr> <td> <?php echo Html::encode($widget_applying->part->name); ?> </td> <td> <?php echo Html::a(Icon::show('trash-o') . ' ' . Yii::t('app', 'Remove'), ['remove-applying', 'part_id' => $widget_applying->part->id, 'id' => $model->id], ['class' => 'btn btn-xs btn-danger']); ?> </td> </tr> <?php } ?> </tbody> </table> </fieldset> <?php
<?php use kartik\helpers\Html; /* @var $this yii\web\View */ /* @var $name string */ /* @var $message string */ /* @var $exception Exception */ $this->title = $name; ?> <?php $this->beginBlock('title'); echo Html::encode($this->title); $this->endBlock(); ?> <div class="container"> <div class="alert alert-danger"> <?php echo nl2br(Html::encode($message)); ?> </div> </div>
<table> <?php foreach ($model->getAttributes() as $name => $value) { ?> <?php if ($name === 'verifyCode') { continue; } ?> <tr> <td><?php echo $model->getAttributeLabel($name); ?> </td> <td><?php echo Html::encode($value); ?> </td> </tr> <?php } ?> </table> <style> table { border: 1px solid #ccc; } table td { padding: 4px; border: 1px solid #ccc;
<?php } ?> <?php BackendWidget::end(); ?> </article> <article class="col-xs-12 col-sm-6 col-md-6 col-lg-6"> <h2><?php echo Yii::t('app', 'Variation:'); ?> <small> <?php echo Html::encode($variation->name); ?> </small> </h2> </article> </div> </section> <?php $saveSortedUrl = \yii\helpers\Json::encode(Url::to(['save-sorted'])); $js = <<<JS var saveSortedIds = function(ids) { \$.ajax({ 'url': {$saveSortedUrl}, 'method': 'POST',
$values_allowed = explode(",", $property->depended_property_values); if (!in_array($current_selections['properties'][$depended_property_id][0], $values_allowed)) { continue; } } else { continue; } } if (count($select) > 0) { ?> <li class="property-name property-<?php echo $property_id; ?> "> <div class="name"><?php echo Html::encode($property->name); ?> </div> <?php $hide_others = false; $dont_hide_value_id = null; if (Property::findById($property_id)->hide_other_values_if_selected) { if (isset($current_selections['properties'][$property_id])) { $hide_others = true; $dont_hide_value_id = $current_selections['properties'][$property_id][0]; } } $checkboxes = []; foreach ($select as $value) { if ($hide_others) { if ($dont_hide_value_id != $value['id']) {
/** * @param integer $id * @return array * @throws \yii\web\BadRequestHttpException */ public function actionChangeManager($id) { Yii::$app->response->format = Response::FORMAT_JSON; $order = $this->findModel($id); if (!isset($_POST['Order']['manager_id'])) { throw new BadRequestHttpException(); } /** @var \app\modules\user\models\User|null $user */ $user = User::findOne($_POST['Order']['manager_id']); if (is_null($user) || !Yii::$app->authManager->checkAccess($user->id, 'order manage')) { throw new BadRequestHttpException(); } $order->scenario = 'changeManager'; $oldManager = $order->manager; $order->load($_POST); if (!$order->save()) { return ['message' => Yii::t('app', 'Cannot change manager')]; } if (is_null($oldManager) || $oldManager->id != $order->manager_id) { // send message try { $to = [$user->email]; if (!is_null($oldManager)) { $to[] = $oldManager->email; $subject = Yii::t('app', 'Manager has been changed from {oldManagerName} to {newManagerName}. Order #{orderId}', ['oldManagerName' => $oldManager->getDisplayName(), 'newManagerName' => $user->getDisplayName(), 'orderId' => $order->id]); Notification::addNotification($oldManager->id, Yii::t('app', 'You are not a manager of <a href="{orderUrl}" target="_blank">order #{orderId}</a> already', ['orderId' => $order->id, 'orderUrl' => Url::toRoute(['/backend/order/view', 'id' => $order->id])]), 'Order', 'info'); } else { $subject = Yii::t('app', 'Manager has been changed to {newManagerName}. Order #{orderId}', ['newManagerName' => $user->getDisplayName(), 'orderId' => $order->id]); } Notification::addNotification($user->id, Yii::t('app', 'You are a new manager of <a href="{orderUrl}" target="_blank">order #{orderId}</a>', ['orderId' => $order->id, 'orderUrl' => Url::toRoute(['/backend/order/view', 'id' => $order->id])]), 'Order', 'info'); Yii::$app->mail->compose('@app/backend/views/order/change-manager-email-template', ['manager' => $user, 'oldManager' => $oldManager, 'order' => $order, 'user' => Yii::$app->user->getIdentity()])->setTo($to)->setFrom(Yii::$app->mail->transport->getUsername())->setSubject($subject)->send(); } catch (\Exception $e) { // do nothing } } return ['output' => Html::encode($user->username)]; }
?> <div class="row review"> <div class="col-md-4"> <div class="review-date_submitted label label-default"> <?php echo Icon::show('calendar') . date("d.m.Y H:i:s", strtotime($model->submission->date_received)); ?> </div> <div class="review-author"> <?php echo Icon::show('user') . $userName; ?> </div> </div> <div class="col-md-8"><?php echo Html::encode($model->review_text); ?> <?php foreach ($groups as $group) { ?> <?php $properties = Property::getForGroupId($group->id); ?> <?php foreach ($properties as $property) { ?> <?php if ($propertyValues = $model->submission->getPropertyValuesByPropertyId($property->id)) { ?> <?php echo $property->handler('form', $model->submission->abstractModel, $propertyValues, 'frontend_render_view');
<?php use kartik\helpers\Html; use kartik\grid\GridView; /* @var $this yii\web\View */ /* @var $searchModel app\models\ObjectsSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = 'Objects'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="objects-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <?php echo GridView::widget(['tableOptions' => ['class' => 'text-center'], 'headerRowOptions' => ['class' => 'text-center'], 'rowOptions' => ['class' => 'text-center'], 'dataProvider' => $dataProvider, 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], ['attribute' => 'name', 'value' => function ($model, $key, $index, $widget) { return Html::a($model->name, ['view', 'id' => $model->id]); }, 'format' => 'raw', 'hAlign' => GridView::ALIGN_CENTER, 'vAlign' => GridView::ALIGN_MIDDLE], ['attribute' => 'description', 'hAlign' => GridView::ALIGN_CENTER, 'vAlign' => GridView::ALIGN_MIDDLE], ['attribute' => 'api0.name', 'hAlign' => GridView::ALIGN_CENTER, 'vAlign' => GridView::ALIGN_MIDDLE], ['attribute' => 'inherited0.name', 'hAlign' => GridView::ALIGN_CENTER, 'vAlign' => GridView::ALIGN_MIDDLE], ['attribute' => 'privacy', 'hAlign' => GridView::ALIGN_CENTER, 'vAlign' => GridView::ALIGN_MIDDLE], ['attribute' => 'createdBy.username', 'value' => function ($model, $key, $index, $widget) { return Html::a($model->createdBy->username, ['/profile/view', 'id' => $model->createdBy->id]); }, 'format' => 'raw', 'hAlign' => GridView::ALIGN_CENTER, 'vAlign' => GridView::ALIGN_MIDDLE], ['attribute' => 'created_at', 'format' => 'date', 'hAlign' => GridView::ALIGN_CENTER, 'vAlign' => GridView::ALIGN_MIDDLE], ['attribute' => '', 'label' => 'Votes', 'value' => function ($model, $key, $index, $widget) { return Html::a($model->votes_up, ['objects/voteup', 'id' => $model->id, 'redirect' => 'index'], ['class' => 'like glyphicon glyphicon-thumbs-up nounderline', 'data' => ['toggle' => 'tooltip', 'placement' => 'right'], 'title' => 'Vote me Up']) . ' / ' . Html::a($model->votes_down, ['objects/votedown', 'id' => $model->id, 'redirect' => 'index'], ['class' => 'unlike glyphicon glyphicon-thumbs-down nounderline', 'data' => ['toggle' => 'tooltip', 'placement' => 'right'], 'title' => 'Vote me Down']); }, 'format' => 'raw', 'hAlign' => GridView::ALIGN_CENTER, 'vAlign' => GridView::ALIGN_MIDDLE], ['class' => 'kartik\\grid\\ActionColumn']]]); ?> </div>
<?php $_raw = $order->paymentType; echo Html::encode(!empty($_raw) ? $_raw->name : Yii::t('yii', '(not set)')); ?> </td> </tr> <?php foreach ($order->abstractModel->attributes as $attribute => $value) { ?> <tr> <th><?php echo $order->abstractModel->getAttributeLabel($attribute); ?> </th> <td><?php echo empty($value) ? Yii::t('yii', '(not set)') : Html::encode($value); ?> </td> </tr> <?php } ?> </tbody> </table> <h2><?php echo Yii::t('app', 'Order items'); ?> </h2> <?php echo $this->render('_items', ['model' => $order, 'items' => $order->items]); ?>
"> <meta name="viewport" content="width=device-width, initial-scale=1"> <?php echo Html::csrfMetaTags(); ?> <title><?php echo Html::encode($this->title); ?> </title> <!-- tambahan variable untuk template Author: --ptr.nov-- !--> <title><?php echo Html::encode($this->sideMenu); ?> </title> <title><?php echo Html::encode($this->sideCorp); ?> </title> <?php if (!Yii::$app->user->isGuest) { ?> <meta http-equiv="refresh" content="<?php echo Yii::$app->params['sessionTimeoutSeconds']; ?> ;"/> <?php } ?> <?php $this->head();
* @var $values array */ use app\models\Property; use kartik\helpers\Html; ?> <?php if (count($values->values) == 0) { return; } ?> <?php $property = Property::findById($property_id); $result = ""; $valuesRendered = 0; foreach ($values->values as $val) { if (isset($val['value'])) { if (!empty(trim($val['value']))) { if ($valuesRendered === 0) { $result .= '<meta itemprop="main" content="True"/>'; } $valuesRendered++; $result .= Html::tag('dd', Html::encode($val['value']), ['itemprop' => 'value']); } } } $result = trim($result); if (!empty($result)) { echo '<dl itemprop="itemListElement" itemscope itemtype="http://schema.org/NameValueStructure">' . Html::tag('dt', $property->name, ['itemprop' => 'name']) . $result . "</dl>\n\n"; }