Example #1
0
 * Time: 16:43
 * @var $event \common\models\Event
 * @var $this  \yii\web\View
 */
use common\helpers\String;
?>
<div class="panel panel-default">
	<div class="panel-body">
		<h3 class="event-title"><?php 
echo $event->name;
?>
 </h3>
		<hr>
		<p class="text-muted" id="event-description">
			<?php 
echo \common\helpers\Html::bb2html(html_entity_decode($event->description));
?>
		</p>
		<hr/>

		<?php 
if (!empty($event->tags)) {
    ?>
			<?php 
    foreach ($event->tags as $tag) {
        ?>
				<a href="<?php 
        echo \yii\helpers\Url::to(['site/index', 'act' => \common\models\Event::GROUP_ALL, 'tag' => $tag->name]);
        ?>
" class="label label-primary tag-link" title="<?php 
        echo $tag->name;
Example #2
0
 /**
  * @param $id
  * @param $stream
  * @param $stream_preview
  * @param bool|false $isRespond
  * @param string $class
  * @param bool $showPlayer - выводить Ziggeo player
  * @return string
  */
 static function getImage($id, $stream, $stream_preview, $isRespond = false, $class = "video-preview", $showPlayer = false)
 {
     $image = "<img class=\"no-image\" src=\"" . Url::base(true) . "" . \common\helpers\Html::noImage() . "\" >";
     ///$default_ext = ".mp4";
     if (is_null($stream)) {
         return $image;
     }
     $ziggeo_video_url = Yii::$app->params['ziggeo']['video_url'] . "/" . Yii::$app->params['ziggeo']['api_version'] . "/applications/" . Yii::$app->params['ziggeo']['application_token'] . "/videos/:token/video.mp4";
     $scheme = "";
     // Stream is an Image
     if (preg_match('/^http(s)?:\\/\\/([\\w\\d-\\.]*)(.)*\\.(png|jpg|jpeg|gif|wav|mp3|mp4)$/i', $stream) and is_null($stream_preview)) {
         return $image;
     }
     if (preg_match('/^http(s)?:\\/\\/([\\w\\d-\\.]*)(.)*\\.(png|jpg|jpeg|gif|wav|mp3|mp4)$/i', $stream_preview)) {
         // Stream is pure Url
         $image = "<img class=\"{$class}\"  data-video=\"{$stream}\" src=\"{$stream_preview}\">";
     } elseif (preg_match('/(http(s)?:\\/\\/){0,1}[a-z\\.]*ziggeo(.)*/i', $stream_preview)) {
         // Preview is Ziggeo url
         if ($showPlayer === true) {
             $image = self::getPlayer($stream);
         } else {
             if (!preg_match('/http/i', $stream_preview)) {
                 $scheme = "http://";
             }
             $src = str_replace(':token', $stream, $ziggeo_video_url);
             $image = "<img class=\"{$class}\"  data-video=\"{$src}\" src=\"{$scheme}{$stream_preview}\">";
         }
     } else {
         if (preg_match('/([\\w\\d])*/i', $stream) and !preg_match('/(http)/i', $stream) or is_null($stream_preview)) {
             // It seems like Stream is a Ziggeo Token
             if (is_null($stream_preview)) {
                 // Запросить урл имаджа через апи и положить его в базу
                 try {
                     $video = self::getInstance()->videos()->get($stream);
                     if (is_object($video)) {
                         ///$default_ext = $video->default_stream->video_type;
                         if (isset($video->embed_image_url)) {
                             $src = str_replace(':token', $stream, $ziggeo_video_url);
                             $image = "<img class=\"{$class}\" data-video=\"{$src}\" src=\"http://{$video->embed_image_url}\">";
                             $razz = Razz::findOne($id);
                             $razz->pureUpdate = true;
                             if ($isRespond) {
                                 $razz->responder_stream_preview = $video->embed_image_url;
                             } else {
                                 $razz->stream_preview = $video->embed_image_url;
                             }
                             $razz->fb_friend = $razz->facebook_id;
                             if (!$razz->save()) {
                                 self::addError(serialize($razz->getErrors()));
                                 $logger = Yii::$app->getLog()->getLogger();
                                 $logger->log('ZiggeoHelper error', \yii\log\Logger::LEVEL_INFO);
                                 $logger->log($razz->getErrors(), \yii\log\Logger::LEVEL_ERROR);
                             }
                         }
                     }
                 } catch (ZiggeoException $e) {
                     self::addError($e->getMessage());
                 }
             } else {
                 // Только сгенерить имадж
                 // FIXME - Сюда заходит, когда в базе битый урл
                 $razz = Razz::findOne($id);
                 $video_src = str_replace(':token', $stream, $ziggeo_video_url);
                 if ($isRespond) {
                     $preview = $razz->responder_stream_preview;
                 } else {
                     $preview = $razz->stream_preview;
                 }
                 if (!preg_match('/http/i', $preview)) {
                     $preview = "http://" . $preview;
                 }
                 $image = "<img class=\"{$class}\" data-video=\"{$video_src}\" src=\"{$preview}\">";
             }
             if ($showPlayer === true) {
                 $image = self::getPlayer($stream);
             }
         }
     }
     return $image;
 }
Example #3
0
?>
							<p class="text-muted" id="event-description">
								<?php 
echo \common\helpers\Html::bb2html(html_entity_decode($event->description));
?>
							</p>

							<hr class="separator"/>
							<div class="media">
								<div class="media-left">
									<a href="<?php 
echo Url::to(['user/index', 'id' => $event->user_id]);
?>
">
										<?php 
echo \common\helpers\Html::avatar($event->user, User::AVATAR_60, ['class' => 'media-object img-circle']);
?>
									</a>
								</div>
								<div class="media-body">
									<h5 class="media-heading"><?php 
echo $event->user->username;
?>
</h5>
									Опубликовал событие <?php 
echo \common\helpers\Time::dateNormalize($event->created_at);
?>
								</div>
							</div>
						</div>
Example #4
0
	<div class="event-img">
		<a href="<?php 
echo Url::to(['/event/view', 'id' => $event->id]);
?>
"><?php 
echo $event->getImage(\common\models\Event::IMAGE_MAIN, ['class' => 'img-responsive']);
?>
</a>
	</div>
	<div class="event-body">
		<a href="<?php 
echo Url::to(['/user/index', 'id' => $event->user->id]);
?>
">
			<?php 
echo \common\helpers\Html::avatar($event->user, 50, ['alt' => $event->user->username, 'class' => 'media-object img-circle owner-img']);
?>
		</a>

		<div class="event-title"><?php 
echo $event->name;
?>
</div>
		<div class="event-description"><?php 
echo \common\helpers\String::truncate($event->description, $context->descriptionLength);
?>
</div>
		<div class="event-date"><?php 
echo \common\helpers\Time::dateNormalize($event->begin);
?>
</div>
Example #5
0
if (!$this->title) {
    $this->title = Html::encode($page['title']);
}
//$this->params['breadcrumbs'][] = $this->title;
?>

<div class="header <?php 
if (Yii::$app->user->isGuest) {
    ?>
not_registered <?php 
}
?>
cf">
    <div class="user_block main_view">
        <?php 
echo HtmlHelper::logiINlogOUT();
?>
    </div>
</div>

<div class="page-block">
    <div class="">
        <div class="caption-box">
            <h1><?php 
echo Html::encode($page['title']);
?>
</h1>
        </div>

        <div class="body">
            <?php 
<?php

\yii\bootstrap\Modal::begin(['id' => 'imageModal', 'header' => '<h3>上传图片</h3>', 'footer' => \common\helpers\Html::button('插入', ['class' => 'btn btn-success', 'data-dismiss' => 'modal'])]);
echo \yidashi\webuploader\Webuploader::widget(['name' => 'markdown-image']);
?>

<?php 
\yii\bootstrap\Modal::end();
Example #7
0
?>





<div class="header <?php 
if (Yii::$app->user->isGuest) {
    ?>
not_registered <?php 
}
?>
cf">
	<div class="user_block main_view">
		<?php 
echo HtmlHelper::logiINlogOUT("profile", $profile->id);
?>
	</div>
</div>



<div class="banner-convert">
    <div class="vertical-banner">
        <!--img  src="/images/vertical-banner.gif" alt="image_description"-->
    </div>
    <div class="site-profile add-banner-off">

        <div class="jumbotron">
            <section class="profile-section">
Example #8
0
 protected function createPreviewTemplate()
 {
     $str = [];
     $str[] = Html::tag('div', Html::img('', ['data-dz-thumbnail' => '']), ['class' => 'dz-image']);
     $str[] = Html::beginTag('div', ['class' => 'dz-details']) . Html::tag('div', Html::tag('span', '', ['data-dz-size' => '']), ['class' => 'dz-size']) . Html::tag('div', Html::tag('span', '', ['data-dz-name' => '']), ['class' => 'dz-filename']) . Html::endTag('div');
     $str[] = Html::tag('div', Html::tag('span', '', ['class' => 'dz-upload', 'data-dz-uploadprogress' => '']), ['class' => 'dz-progress']);
     $str[] = Html::tag('div', Html::tag('span', '', ['data-dz-errormessage' => '']), ['class' => 'dz-error-message']);
     $str[] = Html::beginTag('div', ['class' => 'dz-success-mark']) . Html::beginTag('svg', ['width' => '54px', 'height' => '54px', 'viewBox' => '0 0 54 54', 'version' => '1.1', 'xmlns' => 'http://www.w3.org/2000/svg', 'xmlns:xlink' => 'http://www.w3.org/1999/xlink', 'xmlns:sketch' => 'http://www.bohemiancoding.com/sketch/ns']) . Html::tag('title', 'Check') . Html::tag('defs') . Html::beginTag('g', ['id' => 'Page-1', 'stroke' => 'none', 'stroke-width' => '1', 'fill' => 'none', 'fill-rule' => 'evenodd', 'sketch:type' => 'MSPage']) . Html::tag('path', '', ['d' => 'M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z', 'id' => 'Oval-2', 'stroke-opacity' => '0.198794158', 'stroke' => '#747474', 'fill-opacity' => '0.816519475', 'fill' => '#FFFFFF', 'sketch:type' => 'MSShapeGroup']) . Html::endTag('g') . Html::endTag('svg') . Html::endTag('div');
     $str[] = Html::beginTag('div', ['class' => 'dz-error-mark']) . Html::beginTag('svg', ['width' => '54px', 'height' => '54px', 'viewBox' => '0 0 54 54', 'version' => '1.1', 'xmlns' => 'http://www.w3.org/2000/svg', 'xmlns:xlink' => 'http://www.w3.org/1999/xlink', 'xmlns:sketch' => 'http://www.bohemiancoding.com/sketch/ns']) . Html::tag('title', 'Error') . Html::tag('defs') . Html::beginTag('g', ['id' => 'Page-1', 'stroke' => 'none', 'stroke-width' => '1', 'fill' => 'none', 'fill-rule' => 'evenodd', 'sketch:type' => 'MSPage']) . Html::beginTag('g', ['id' => 'Check-+-Oval-2', 'stroke' => '#747474', 'stroke-opacity' => '0.198794158', 'fill' => '#FFFFFF', 'fill-opacity' => '0.816519475', 'sketch:type' => 'MSLayerGroup']) . Html::tag('path', '', ['d' => 'M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z', 'id' => 'Oval-2', 'sketch:type' => 'MSShapeGroup']) . Html::endTag('g') . Html::endTag('g') . Html::endTag('svg') . Html::endTag('div');
     $str = Html::tag('div', implode("\n", $str), ['class' => 'dz-preview dz-file-preview']);
     return $str;
 }
Example #9
0
use common\helpers\String;
use common\models\User;
use yii\helpers\Url;
/* @var $userAuth User */
/* @var $userView User */
/* @var $eventSubscribe  \common\models\Event[] */
/* @var $eventCreate  \common\models\Event[] */
frontend\assets\User::register($this);
$isSubscribed = $userAuth ? $userView->isSubscribed($userAuth) : false;
$this->title = $userView->username;
?>
<div class="row">
	<div class="col-md-3 user-left col-md-offset-1">
		<div class="avatar-edit" style="overflow: hidden;position: relative">
			<?php 
echo \common\helpers\Html::avatar($userView, User::AVATAR_240, ['class' => 'img-responsive user-avatar center-block img-circle ']);
?>
			<?php 
if ($userView->isMy()) {
    ?>
				<a href="<?php 
    echo Url::to(['user/avatar-change']);
    ?>
" title="Сменить аватар" class="avatar-edit-click"><i
						class="md md-camera-alt md-5x"></i></a>
			<?php 
}
?>
		</div>
		<div class="panel panel-default">
			<div class="panel-body">
Example #10
0
<div class="wrap">
	<?php 
\yii\bootstrap\NavBar::begin(['innerContainerOptions' => ['class' => 'container'], 'brandLabel' => 'Findspree', 'brandUrl' => Yii::$app->homeUrl, 'options' => ['class' => 'navbar navbar-inverse navbar-fixed-top']]);
$menuItems[] = ['label' => 'О сервисе', 'url' => '#', 'options' => ['data-toggle' => 'modal', 'data-target' => '#hello']];
$menuItems[] = ['label' => 'Обратная связь', 'url' => ['/site/feedback']];
$menuItems[] = ['label' => 'Карта', 'url' => ['/event/map']];
$menuItems[] = ['label' => 'События', 'url' => ['/site/index']];
$menuItems[] = ['label' => 'Добавить событие', 'url' => ['/event/edit']];
?>

	<?php 
if (Yii::$app->user->isGuest) {
    $menuItems[] = ['label' => 'Регистрация', 'url' => ['/site/signup']];
    $menuItems[] = ['label' => 'Вход', 'url' => ['/site/login']];
} else {
    $menuItems[] = ['label' => Html::avatar(Yii::$app->user->identity, 50, ['class' => 'img-circle hidden-xs']) . ' ' . \yii\helpers\Html::tag('span', Yii::$app->user->identity->username, ['class' => 'username']), 'encode' => false, 'options' => ['class' => 'user-main-avatar'], 'linkOptions' => ['id' => 'user-main-link'], 'items' => [['label' => 'Профиль', 'url' => ['/user/index']], '<li role="presentation" class="divider"></li>', ['label' => 'Выход', 'url' => ['/site/logout']]]];
}
echo \yii\bootstrap\Nav::widget(['activateParents' => true, 'options' => ['class' => 'navbar-nav navbar-right'], 'items' => $menuItems]);
\yii\bootstrap\NavBar::end();
?>
	<div class="container page">
		<?php 
echo $content;
?>
	</div>

	<div id="hello" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"
		 aria-hidden="true">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-body">