protected function procPermaLink() { $id = $this->id . '-permalink'; $this->view->registerCss(sprintf('.label-permalink{%s}', Html::cssStyleFromArray(['cursor' => 'pointer', 'display' => 'inline-block', 'font-size' => '11px', 'font-weight' => '500', 'height' => '20px', 'padding' => '5px 8px 1px 6px', 'vertical-align' => 'top']))); if ($this->looksClipboardWorks) { ClipboardJsAsset::register($this->view); $this->view->registerCss(sprintf('.label-permalink:hover{%s}', Html::cssStyleFromArray(['background-color' => '#1b3a63']))); $this->view->registerJs(sprintf('jQuery("#%s").permaLink();', $id)); return Html::tag('span', sprintf('%s %s', FontAwesome::icon('anchor')->tag('span')->render(), Html::encode(Yii::t('app', 'Permalink'))), ['id' => $id, 'class' => ['label', 'label-success', 'label-permalink', 'auto-tooltip'], 'title' => Yii::t('app', 'Click to copy')]); } else { $this->view->registerCss(sprintf('.label-permalink{%s}', Html::cssStyleFromArray(['cursor' => 'not-allowed']))); return Html::tag('span', sprintf('%s %s', FontAwesome::icon('anchor')->tag('span')->render(), Html::encode(Yii::t('app', 'PermaLink'))), ['id' => $id, 'class' => ['label', 'label-default', 'label-permalink', 'auto-tooltip'], 'title' => Yii::t('app', 'Your browser does not support this action.')]); } }
public function testCssStyleFromArray() { $this->assertEquals('width: 100px; height: 200px;', Html::cssStyleFromArray(['width' => '100px', 'height' => '200px'])); $this->assertNull(Html::cssStyleFromArray([])); }
$maya = Yii::$app->cache->get(Yii::$app->session->getId() . '/maya'); if ($maya) { $this->registerJs("LayoutMenu.init({$maya['maya']});"); } else { $this->registerJs("LayoutMenu.init();"); } if (Yii::$app->deviceDetect->isMobile()) { $link = Url::to(['calendar/index']); $options = []; } else { $link = 'javascript:void(0);'; $options = ['title' => 'Сегодня', 'id' => 'linkCalendar', 'data' => ['toggle' => 'popover', 'template' => '<div class="popover" role="tooltip" style="width: 500px;"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content" style="padding-bottom:30px;"></div></div>', 'html' => true, 'placement' => 'bottom']]; } ?> <li><?php echo Html::a(Html::tag('span', $maya !== false ? $maya['date'] : '# ### #### г.', ['style' => Html::cssStyleFromArray(['padding-right' => '10px']), 'id' => 'dateThis']) . Html::img($mayaAsset->getStampSrc($maya !== false ? $maya['stamp'] : \cs\models\Calendar\Maya::calc()['stamp']), ['height' => 20, 'width' => 20, 'id' => 'calendarMayaStamp']), $link, $options); ?> </li> </ul> </div> </div> </nav> <div class="hide" id="calendarMayaDescription"> <noindex> <h4>Красный Дракон</h4> <p>Откройтесь энергиям Рождения и Упования - Высшей Веры во всемогущесто бытия и стремитись найти им выражение в своей жизни. Фокусируйтесь на самоподдержании и принятии необходимой энергии от Вселенной, и тогда ваши глубинные потребности начнут восполняться самой жизнью. Позвольте энергии рождения инициировать и проявлять все ваши начинания!</p>
$this->params['breadcrumbs'][] = $this->title; ?> <div class="site-contact"> <h1><?php echo Html::encode($this->title); ?> </h1> <hr> <?php echo Html::tag('hoogl', '111', ['class' => 'hoogl', 'data' => '1212']); ?> <?php echo Html::cssFile('/asssets/q.css'); ?> <?php print_r(Html::cssStyleFromArray(['width' => '100px', 'height' => '200px'])); ?> <hr> <?php if (Yii::$app->session->hasFlash('contactFormSubmitted')) { ?> <div class="alert alert-success"> Thank you for contacting us. We will respond to you as soon as possible. </div> <p> Note that if you turn on the Yii debugger, you should be able to view the mail message on the mail panel of the debugger. <?php
/** * Return current flag for dynamic fields * @param $flagPic * @return string */ private function getLangFieldFlagStyle($flagPic) { $flagClass = ['background-image' => "url(" . $flagPic . ")", 'background-repeat' => 'no-repeat', 'background-position' => '99% 10px', 'background-size' => '16px 11px']; return "<style> .mlang{" . Html::cssStyleFromArray($flagClass) . "}</style>"; }