Пример #1
0
function drawItem($d)
{
    $html = [];
    $html[] = Html::img(\Yii::$app->assetManager->getBundle('app\\assets\\Maya\\Asset')->baseUrl . "/images/stamp/{$d['stamp']}.jpg", ['height' => 40, 'alt' => \cs\models\Calendar\Maya::$stampRows[$d['stamp'] - 1][0], 'title' => \cs\models\Calendar\Maya::$stampRows[$d['stamp'] - 1][0], 'class' => 'js-stamp']);
    $html[] = Html::tag('span', $d['day'] . '.' . $d['month'], ['class' => 'js-stamp', 'title' => GsssHtml::dateString($d['date'])]);
    $html[] = Html::tag('br');
    $html[] = 'kin: ' . $d['kin'];
    $html[] = $d['nearPortal'] == 0 ? 'п' : '';
    return join('', $html);
}
Пример #2
0
 public function run()
 {
     $this->registerAssets();
     $items = ['<a href="' . $this->home['url'] . '" class="btn btn-default">' . $this->home['name'] . '</a>', '<div class="btn btn-default">...</div>'];
     foreach ($this->items as $item) {
         if (is_array($item)) {
             $url = $item['url'];
             $name = $item['label'];
         } else {
             $url = 'javascript:void();';
             $name = $item;
         }
         $items[] = Html::a(Html::tag('div', $name), Url::to($url), ['class' => 'btn btn-default']);
     }
     $items = join('', $items);
     return Html::tag('div', $items, ['class' => 'btn-group btn-breadcrumb']);
 }
Пример #3
0
 public static function articleItem($row, $category)
 {
     if (!is_array($row)) {
         $id = $row;
         $item = \app\models\Article::find($id);
         if (is_null($item)) {
             return '';
         }
         $row = $item->getFields();
     }
     // Заголовок
     $html[] = Html::tag('div', Html::tag('h4', $row['header']), ['class' => 'header']);
     // ссылка
     $item2 = ['id' => $row['id_string'], 'year' => substr($row['date_insert'], 0, 4), 'month' => substr($row['date_insert'], 5, 2), 'day' => substr($row['date_insert'], 8, 2), 'category' => $category];
     $link = "/category/{$item2['category']}/article/{$item2['year']}/{$item2['month']}/{$item2['day']}/{$item2['id']}";
     // картинка с ссылкой
     $html[] = Html::tag('p', Html::a(Html::img($row['image'], ['width' => '100%', 'class' => 'thumbnail']), $link));
     // Описание
     $content = $row['description'];
     if ($content . '' == '') {
         $content = self::getMiniText($row['content']);
     } else {
         $content = self::getMiniText($content);
     }
     $html[] = Html::tag('p', $content);
     return Html::tag('div', join('', $html), ['class' => 'col-lg-4 articleItem']);
 }