public function getImg($id) { $v = $this->getField('img' . $id, ''); if ($v == '') { throw new Exception('Не установлена картинка img' . $id); } return FileUpload::getOriginal($v); }
public function update($fieldsCols = null) { return parent::update(['beforeUpdate' => function ($fields, \app\models\Form\Blog $model) { if ($fields['description'] == '') { $fields['description'] = GsssHtml::getMiniText($fields['content']); } if ($model->is_add_image) { $fields['content'] = Html::tag('p', Html::img(\cs\Widget\FileUpload2\FileUpload::getOriginal($model->image), ['class' => 'thumbnail', 'style' => 'width:100%;', 'alt' => $fields['header']])) . $fields['content']; } return $fields; }]); }
public function update($fieldsCols = null) { $fields = parent::update(['beforeUpdate' => function ($fields, \app\models\Form\Article $model) { if ($fields['description'] == '') { $fields['description'] = GsssHtml::getMiniText($fields['content']); } }]); $item = \app\models\Article::find($this->id); if ($this->is_add_image) { $content = Html::tag('p', Html::img(\cs\Widget\FileUpload2\FileUpload::getOriginal($item->getImage()), ['class' => 'thumbnail', 'style' => 'width:100%;', 'alt' => $item->getField('header')])) . $item->getField('content'); $item->update(['content' => $content]); } }
public function insert($fieldsCols = null) { $row = parent::insert(['beforeInsert' => function ($fields) { $fields['date_insert'] = time(); $fields['id_string'] = Str::rus2translit($fields['header']); $fields['date'] = gmdate('Y-m-d'); return $fields; }]); $item = new \app\models\Praktice($row); $fields = ['content' => Html::tag('p', Html::img(\cs\Widget\FileUpload2\FileUpload::getOriginal($item->getField('image')), ['class' => 'thumbnail', 'style' => 'width:100%;'])) . $item->getField('content')]; if ($row['description'] == '') { $item = new NewsItem($row); $fields['description'] = GsssHtml::getMiniText($row['content']); } $item->update($fields); return $item; }
<p class="text-center">Принцип работы тренажера Birdly®</p> <p class="text-center"><img src="/images/controller/site/media/11990631_10208204145722207_6888214533972897372_n.jpg" class="img-center" style="border-radius: 10px; width:100%;"></p> <p class="text-center">Изображения</p> <?php \app\assets\SlideShow\Asset::register($this); ?> <div class="row"> <?php foreach (\app\models\Picture::query()->all() as $foto) { ?> <div class="col-sm-2"> <a href="<?php echo \cs\Widget\FileUpload2\FileUpload::getOriginal($foto['image']); ?> " rel="lightbox[example]" class="highslide" onclick="return hs.expand(this)"> <img src="<?php echo $foto['image']; ?> " alt="<?php echo $foto['name']; ?> " width="100%" style="margin-bottom: 20px;"> </a> </div> <?php } ?> </div>
</p> <?php } ?> <?php } ?> <hr> <?php echo \app\services\Page::linkToSite($item->getField('link')); ?> <?php echo $this->render('../blocks/share', ['image' => \cs\Widget\FileUpload2\FileUpload::getOriginal(\yii\helpers\Url::to($item->getField('img'), true), false), 'url' => \yii\helpers\Url::current([], true), 'title' => $item->getField('name'), 'description' => trim(\cs\services\Str::sub(strip_tags($item->getField('description')), 0, 200))]); //\cs\services\VarDumper::dump($category); ?> <?php if ($item->hasShop() && \yii\helpers\ArrayHelper::getValue(Yii::$app->params, 'isShop', 0) == 1) { ?> <a class="btn btn-primary" href="<?php echo \yii\helpers\Url::to(['union_shop/index', 'id' => $item->getId(), 'category' => $category->getField('id_string')]); ?> ">Магазин</a> <?php } ?> </div>
<?php if ($item['source'] != '') { ?> <?php echo Html::a('Ссылка на источник »', $item['source'], ['class' => 'btn btn-primary', 'target' => '_blank']); ?> <?php } ?> <?php } $image = $item['image']; ?> <?php echo $this->render('../blocks/share', ['image' => \cs\Widget\FileUpload2\FileUpload::getOriginal(Url::to($item['image'], true), false), 'url' => Url::current([], true), 'title' => $item['header'], 'description' => trim(Str::sub(strip_tags($item['content']), 0, 200))]); ?> <?php //= \app\modules\Comment\Service::render(\app\modules\Comment\Model::TYPE_ARTICLE, $item['id']); ?> </div> <div class="col-lg-4"> <?php if (\yii\helpers\ArrayHelper::getValue(Yii::$app->params, 'isMarketing', 0) == 1 && date('Y-m-d') < '2015-10-30') { ?> <?php echo $this->render('../blocks/reklama'); ?> <?php
use yii\bootstrap\ActiveForm; use yii\captcha\Captcha; $this->title = 'Контакты'; $this->params['breadcrumbs'][] = $this->title; $page = \app\models\Page::find(1); ?> <div class="box"> <h1 class="title"><?php echo $page->getField('header'); ?> </h1> <div class="one-third"> <div class="outer none"><span class="inset"><a href="<?php echo \cs\Widget\FileUpload2\FileUpload::getOriginal($page->getField('image')); ?> " target="_blank"><img src="<?php echo $page->getField('image'); ?> " ></a></span></div> </div> <div class="two-third last"> <?php echo $page->getField('content'); ?> </div> <div class="clear"></div>
<?php if ($item['source'] != '') { ?> <?php echo Html::a('Ссылка на источник »', $item['source'], ['class' => 'btn btn-primary', 'target' => '_blank']); ?> <?php } ?> <?php } $image = $item['img'] . ''; ?> <?php echo $this->render('../blocks/share', ['image' => $image != '' ? \cs\Widget\FileUpload2\FileUpload::getOriginal(Url::to($item['img'], true), false) : '', 'url' => Url::current([], true), 'title' => $item['header'], 'description' => $item['description']]); ?> <?php echo $this->render('../blocks/yandexMoney2'); ?> <!-- Комментарии --> <!-- --><?php //= \app\modules\Comment\Service::render(\app\modules\Comment\Model::TYPE_CHENNELING, $item['id']); ?> </div> <div class="col-lg-4"> <?php if (\yii\helpers\ArrayHelper::getValue(Yii::$app->params, 'isMarketing', 0) == 1 && date('Y-m-d') < '2015-10-30') { ?>
<img src="<?php echo $item['image']; ?> " width="100%" class="thumbnail"> </a> </div> <div class="col-lg-8"> <p><?php echo $item['description']; ?> </p> <hr> <p><?php echo Yii::$app->formatter->asDecimal($item['price']); ?> </p> <button class="btn btn-default btn-lg buttonAdd" style="100%">Добавить</button> </div> </div> <?php } ?> <hr> <?php echo $this->render('../blocks/share', ['image' => \cs\Widget\FileUpload2\FileUpload::getOriginal(Url::to($union->getImage(), true), false), 'url' => Url::current([], true), 'title' => $union->getName() . '. Магазин', 'description' => 'ff']); ?> </div> </div>
echo $product->getImage(); ?> "> </div> <div class="col-lg-8"> <p><?php echo $product->getField('content'); ?> </p> <hr> <p>Цена: <?php echo Yii::$app->formatter->asDecimal($product->getField('price'), 0); ?> руб</p> <hr> <p><button class="btn btn-default" id="addToCart" data-id="<?php echo $product->getId(); ?> ">В корзину</button></p> <hr> <?php echo $this->render('../blocks/share', ['image' => \cs\Widget\FileUpload2\FileUpload::getOriginal(Url::to($product->getImage(), true), false), 'url' => Url::current([], true), 'title' => $product->getField('name'), 'description' => 'ff']); ?> </div> </div>
<h1 class="page-header"><?php echo $this->title; ?> </h1> </div> <div class="col-lg-12"> <div class="col-lg-4 col-lg-offset-4"> <p class="text-center"> <img class="thumbnail" src="<?php echo $item->getField('image'); ?> " width="100%" alt=""> </p> </div> </div> <div class="col-lg-12"> <div class="col-lg-10 col-lg-offset-1"> <?php echo $item->getField('content'); ?> <hr> <?php echo $this->render('../blocks/share', ['image' => $item->getField('image') != '' ? Url::to(\cs\Widget\FileUpload2\FileUpload::getOriginal($item->getField('image')), true) : '', 'url' => Url::current([], true), 'title' => $item->getField('name'), 'description' => trim(\cs\services\Str::sub(strip_tags($item->getField('content')), 0, 200))]); ?> </div> </div> </div>
<?php echo $item->getField('content'); ?> </div> <!-- End Post --> </div> <div class="sidebar box"> <div class="sidebox widget"> <a href="/"><img src="/images/home1.png" width="20"/><br><br></a> <h3 class="widget-title"> Поиск</h3> <form class="searchform" method="get" action="/search"> <input type="text" name="term" value="Введите слово ..." onFocus="this.value=''" onBlur="this.value='Введите слово ...'"/> </form> </div> </div> <div class="clear"></div> <div class="intro"> </div> <?php echo $this->render('../blocks/share', ['url' => \yii\helpers\Url::current([], true), 'image' => \cs\Widget\FileUpload2\FileUpload::getOriginal($item->getImage()), 'title' => $this->title, 'description' => \app\services\GsssHtml::getMiniText($item->getField('content'))]);
?> <hr> <?php $source = $item->getField('source', ''); if ($source) { ?> <?php echo Html::a('Ссылка на источник »', $source, ['class' => 'btn btn-primary', 'target' => '_blank']); ?> <?php } $image = $item->getImage(); ?> <?php echo $this->render('../blocks/share', ['image' => \cs\Widget\FileUpload2\FileUpload::getOriginal(Url::to($image, true), false), 'url' => Url::current([], true), 'title' => $item->getName(), 'description' => $item->getField('description')]); ?> <?php //= \app\modules\Comment\Service::render(\app\modules\Comment\Model::TYPE_ARTICLE, $item['id']); ?> </div> <div class="col-lg-4"> <?php if (\yii\helpers\ArrayHelper::getValue(Yii::$app->params, 'isMarketing', 0) == 1 && date('Y-m-d') < '2015-10-30') { ?> <?php echo $this->render('../blocks/reklama'); ?> <?php