public function run()
 {
     if (!$this->model) {
         return Html::tag('div', Html::tag('b', Yii::t('yii', 'Error')) . ': ' . $this->getModule()->t('attachments', 'The model cannot be empty.'), ['class' => 'alert alert-danger']);
     }
     $hasFileBehavior = false;
     foreach ($this->model->getBehaviors() as $behavior) {
         if ($behavior->className() == FileBehavior::className()) {
             $hasFileBehavior = true;
         }
     }
     if (!$hasFileBehavior) {
         return Html::tag('div', Html::tag('b', Yii::t('yii', 'Error')) . ': ' . $this->getModule()->t('attachments', 'The behavior FileBehavior has not been attached to the model.'), ['class' => 'alert alert-danger']);
     }
     Url::remember(Url::current());
     return GridView::widget(['dataProvider' => new ArrayDataProvider(['allModels' => $this->model->getFiles()]), 'layout' => '{items}', 'tableOptions' => $this->tableOptions, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['label' => $this->getModule()->t('attachments', 'File name'), 'format' => 'raw', 'value' => function ($model) {
         return Html::a("{$model->name}.{$model->type}", $model->getUrl(), ['class' => ' group' . $model->itemId, 'onclick' => 'return false;']);
     }], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{delete}', 'buttons' => ['delete' => function ($url, $model, $key) {
         return Html::a('<span class="glyphicon glyphicon-trash"></span>', ['/file/file/delete', 'id' => $model->id], ['title' => Yii::t('yii', 'Delete'), 'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'), 'data-method' => 'post']);
     }]]]]) . Colorbox::widget(['targets' => ['.group' . $this->model->id => ['rel' => '.group' . $this->model->id, 'photo' => true, 'scalePhotos' => true, 'width' => '100%', 'height' => '100%', 'maxWidth' => 800, 'maxHeight' => 600]], 'coreStyle' => 4]);
 }
    public function run()
    {
        if (!$this->model) {
            return Html::tag('div', Html::tag('b', Yii::t('yii', 'Error')) . ': ' . $this->getModule()->t('attachments', 'The model cannot be empty.'), ['class' => 'alert alert-danger']);
        }
        $hasFileBehavior = false;
        foreach ($this->model->getBehaviors() as $behavior) {
            if ($behavior instanceof FileBehavior) {
                $hasFileBehavior = true;
                break;
            }
        }
        if (!$hasFileBehavior) {
            return Html::tag('div', Html::tag('b', Yii::t('yii', 'Error')) . ': ' . $this->getModule()->t('attachments', 'The behavior FileBehavior has not been attached to the model.'), ['class' => 'alert alert-danger']);
        }
        $confirm = Yii::t('yii', 'Are you sure you want to delete this item?');
        $js = <<<JS
        \$(".delete-button").click(function(){
            var tr = this.closest('tr');
            var url = \$(this).data('url');
            if (confirm("{$confirm}")) {
                \$.ajax({
                    method: "POST",
                    url: url,
                    success: function(data) {
                        if (data) {
                            tr.remove();
                        }
                    }
                });
            }
        });
JS;
        Yii::$app->view->registerJs($js);
        return GridView::widget(['dataProvider' => new ArrayDataProvider(['allModels' => $this->model->getFiles()]), 'layout' => '{items}', 'tableOptions' => $this->tableOptions, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['label' => $this->getModule()->t('attachments', 'File name'), 'format' => 'raw', 'value' => function ($model) {
            return Html::a("{$model->name}.{$model->type}", $model->getUrl(), ['class' => ' group' . $model->itemId, 'onclick' => 'return false;']);
        }], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{delete}', 'buttons' => ['delete' => function ($url, $model, $key) {
            return Html::a('<span class="glyphicon glyphicon-trash"></span>', '#', ['class' => 'delete-button', 'title' => Yii::t('yii', 'Delete'), 'data-url' => Url::to(['/attachments/file/delete', 'id' => $model->id])]);
        }]]]]) . Colorbox::widget(['targets' => ['.group' . $this->model->id => ['rel' => '.group' . $this->model->id, 'photo' => true, 'scalePhotos' => true, 'width' => '100%', 'height' => '100%', 'maxWidth' => 800, 'maxHeight' => 600]], 'coreStyle' => 4]);
    }
예제 #3
0
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use himiklab\colorbox\Colorbox;
/* @var $this yii\web\View */
/* @var $model app\models\Blog */
$this->title = $model->title;
$this->params['breadcrumbs'][] = ['label' => 'Блог', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->category->name, 'url' => ['category/' . $model->id_category]];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="blog-view">

	<?php 
echo Colorbox::widget(['targets' => ['.colorbox' => ['maxWidth' => 1000, 'maxHeight' => 1000]], 'coreStyle' => 1]);
?>
	<?php 
$user = '';
if ($model->user->id != Yii::$app->user->identity->id) {
    $user = '******' . $model->user->name . ')';
}
?>
	<h1><?php 
echo Html::encode($this->title . $user);
?>
</h1>



	<?php 
예제 #4
0
<?php

use yii\helpers\Html;
use yii\web\View;
$this->registerJsFile(Yii::getAlias('@web') . '/js/popup.js', ['depends' => [yii\web\JqueryAsset::className()]]);
$this->title = 'Mountain-Evo - ' . ucfirst(Yii::$app->controller->action->id);
use himiklab\colorbox\Colorbox;
use sibilino\y2dygraphs\DygraphsWidget;
?>

<?php 
echo Colorbox::widget(['targets' => ['.colorbox' => ['width' => 800, 'height' => 600]], 'coreStyle' => 1]);
?>
<div class="site-observatory">

    <div class="container warning-message">
        <div class='row'>
            <div class="col-lg-12  text-center">
                <p>
                    <?php 
echo \Yii::t('infobar', 'This is the information for');
?>
 <span class='highlight'><?php 
echo htmlentities($sensor->name);
?>
</span>, <?php 
echo \Yii::t('infobar', 'located in');
?>
 <span class='highlight'><?php 
echo htmlentities($sensor->catchment->name);
?>
예제 #5
0
파일: main.php 프로젝트: bariew/sitown
<?php

use yii\helpers\Html;
use yii\bootstrap\Alert;
use yii\widgets\Breadcrumbs;
use app\web\themes\null\AppAsset;
use yii\bootstrap\NavBar;
/**
 * @var \yii\web\View $this
 * @var string $content
 */
raoul2000\bootswatch\BootswatchAsset::$theme = 'journal';
AppAsset::register($this);
\himiklab\colorbox\Colorbox::widget(['coreStyle' => 4]);
$this->beginPage();
?>
<!DOCTYPE html>
<html lang="<?php 
echo Yii::$app->language;
?>
">
<head>
    <?php 
echo Html::csrfMetaTags();
?>
    <meta charset="<?php 
echo Yii::$app->charset;
?>
"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?php 
예제 #6
0
<?php

use yii\helpers\Html;
use yii\web\View;
$this->registerJsFile(Yii::getAlias('@web') . '/js/popup.js', ['depends' => [yii\web\JqueryAsset::className()]]);
$this->title = 'Mountain-Evo - Observatory';
use himiklab\colorbox\Colorbox;
?>

<?php 
echo Colorbox::widget(['targets' => ['.colorbox' => ['initialWidth' => "800", 'initialHeight' => "600"]], 'coreStyle' => 1]);
?>
<div class="site-observatory">

    <div class="container warning-message">
        <div class='row'>
            <div class="col-lg-12  text-center">
                <p><?php 
echo \Yii::t('infobar', 'Use these graphs and maps to explore data collected by local environmental sensors.');
?>
 
                   <?php 
echo Html::a(\Yii::t('infobar', 'select a sensor'), ['sensorpopup'], ['class' => 'popupss']);
?>
 <?php 
echo \Yii::t('infobar', 'to start.');
?>
</p>
            </div>
        </div>
    </div>
예제 #7
0
파일: index.php 프로젝트: maxodrom/testbook
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Книги';
$this->params['breadcrumbs'][] = $this->title;
$monthes = [1 => 'января', 2 => 'февраля', 3 => 'марта', 4 => 'апреля', 5 => 'мая', 6 => 'июня', 7 => 'июля', 8 => 'августа', 9 => 'сентября', 10 => 'октября', 11 => 'ноября', 12 => 'декабря'];
$this->registerCss('#cboxLoadedContent {padding: 10px;}');
/*$this->registerAssetBundle(ColorboxAsset::className());
$this->registerJs(
    "
        $('.cbox').colorbox();
    ",
    View::POS_READY
);*/
?>

<?php 
echo Colorbox::widget(['targets' => ['.cbox' => ['maxWidth' => 800, 'maxHeight' => 600]], 'coreStyle' => 3]);
?>
<div class="book-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a('Добавить книгу', ['create'], ['class' => 'btn btn-success']);
?>
예제 #8
0
				<?php 
foreach ($model->getArchived() as $m) {
    echo '<li>' . Html::a(date('M Y', strtotime($m["month"])), ["//yes/product/index", "time" => $m["month"]]) . '</li>';
}
?>
				
			</ul>
			<hr>
			<div class="shopcart-box">
				<h4><?php 
echo Yii::t("app", "Shopping Cart");
?>
 <span class="shopcart-badge badge"></span> <small class="pull-right"></small></h4>
				<table class="table table-striped table-bordered">
				</table>
				<?php 
echo Html::a(Yii::t("app", "Checkout"), ["//yes/order/create"], ["class" => "btn btn-success pull-right"]);
?>
			</div>
		</div>
		<!-- End Sidebar -->
	</div>

</div>

<?php 
echo Colorbox::widget(['targets' => ['.colorbox' => ['maxWidth' => 800, 'maxHeight' => 600, 'rel' => 'colorbox', 'slideshow' => true]], 'coreStyle' => 1]);
?>

<?php 
$this->render('@amilna/yes/views/product/_script_add', ['model' => $model]);
예제 #9
0
<?php

use himiklab\colorbox\Colorbox;
use elgorm\sharebuttons\ShareButtons;
echo Colorbox::widget(['targets' => ['.colorbox' => ['maxWidth' => "50%"]], 'coreStyle' => 1]);
$this->title = empty($model->title) || is_null($model->title) || !isset($model->title) ? $model->alternativeTitle : $model->title;
if ($model->category) {
    $this->params['breadcrumbs'][] = ['label' => $model->category->title, 'url' => $model->category->url];
}
$this->params['breadcrumbs'][] = $this->title;
?>
<p><span class="glyphicon glyphicon-time"></span> <?php 
echo Yii::t("app/posts", "Posted on {0}", [Yii::$app->formatter->asDateTime($model->created_at)]);
?>
</p>
<?php 
echo ShareButtons::widget(['clientOptions' => ['services' => 'vkontakte,facebook,gplus,moimir,odnoklassniki', 'size' => 's']]);
?>
<hr>
<p>
    <?php 
echo $model->content;
?>
</p>
<hr>
	<?php 
if ($model->activePhotos) {
    \app\custom\customMasonry::begin(['clientOptions' => ['itemSelector' => '.mastumb', 'columnWidth' => "100%"]]);
    ?>
    <?php 
    foreach ($model->activePhotos as $photo) {
예제 #10
0
        <div class="container">
            <?php 
echo Breadcrumbs::widget(['links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : []]);
?>
            <?php 
echo $content;
?>
        </div>
    </div>

    <footer class="footer">
        <div class="container">
            <p class="pull-left">&copy; My Company <?php 
echo date('Y');
?>
</p>
            <p class="pull-right"><?php 
echo Yii::powered();
?>
</p>
        </div>
    </footer>
<?php 
echo Colorbox::widget(['targets' => ['.colorbox' => []], 'coreStyle' => 1]);
$this->endBody();
?>
</body>
</html>
<?php 
$this->endPage();
예제 #11
0
파일: index.php 프로젝트: tpoxa/cmars
        <?php 
echo $form->field($switchForm, 'menu_id')->dropDownList($switchForm->getItems(), ['prompt' => 'Select menu to edit', 'onchange' => new JsExpression('this.form.submit();')]);
?>

        <?php 
echo Html::a('+', ['create'], ['class' => 'btn btn-success']);
?>

        <?php 
ActiveForm::end();
?>
        <hr/>
        <?php 
//print_r($model->getItemsMenu());
?>
        <?php 
echo NestedList::widget(['items' => $model->getItemsMenu()]);
?>
    </div>
    <div class="col-md-7 pull-right newmenutype" style="padding-top: 12px">
        <?php 
echo Tabs::widget(['items' => $this->context->getMenuSections($model)]);
?>
    </div>
</div>

<?php 
echo Colorbox::widget(['targets' => ['.colorbox' => ['maxWidth' => 800, 'maxHeight' => 600, 'width' => 800, 'height' => 300]]]);
?>

예제 #12
0
			<?php 
    if ($cartellone->disponibileDa != new \DateTime()) {
        ?>
			<h3 style="color: red;">Disponibile da: <?php 
        echo $cartellone->disponibileDa->format('d/m/Y');
        ?>
</h3>
			<?php 
    } else {
        ?>
			<h3 style="color: green;">Disponibile da: oggi</h3>
			<?php 
    }
    ?>
		</div>
		<div class="prenota_cartellone" style="display: inline-block;">
			<button style="background-color: green; color:white;">Verifica disponibilità</button>
			<br>
			<font size="-1">e blocca l'affissione per 24h</font>
		</div>
		<hr/>	
	</div>
<?php 
}
echo LinkPager::widget(['pagination' => $pagination]);
?>
</div>

<?php 
echo Colorbox::widget(['targets' => ['.colorbox' => ['iframe' => 'true', 'width' => '90%', 'height' => '90%']], 'coreStyle' => 2]);
예제 #13
0
use himiklab\colorbox\Colorbox;
/* @var $this yii\web\View */
/* @var $searchModel amilna\yes\models\ProductSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Products');
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'YES'), 'url' => ['/yes/default']];
$this->params['breadcrumbs'][] = $this->title;
$this->params['cboxTarget'] = [];
$dataProvider->pagination = ['pageSize' => 12];
?>
<div class="post-index">
        
	<h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>
    
		
	<?php 
echo ListView::widget(['dataProvider' => $dataProvider, 'itemOptions' => ['class' => 'col-md-3 col-sm-6 item', 'tag' => 'div'], 'itemView' => '_itemIndex', 'options' => ['class' => 'row text-center list-view'], 'layout' => "{items}\n{pager}", 'pager' => ['class' => \kop\y2sp\ScrollPager::className()]]);
?>
	

</div>

<?php 
echo Colorbox::widget(['targets' => $this->params['cboxTarget'], 'coreStyle' => 1]);
예제 #14
0
파일: _tile.php 프로젝트: andreyvaslv/crb
    ?>
            <div class="file text-center">
                <?php 
    if ($file->isImage()) {
        ?>
                    <?php 
        echo Html::a(Html::img($file->thumbnail), $file->webPath, ['rel' => $model->slug, 'target' => '_blank']);
        ?>
 <br>
                    <?php 
        echo $file->name;
        ?>
                <?php 
    } else {
        ?>
                    <?php 
        echo Html::a($file->name, $file->webPath, ['target' => '_blank']);
        ?>
                <?php 
    }
    ?>
            </div>
        <?php 
}
?>
    </div>
</div>

<?php 
echo Colorbox::widget(['targets' => ['[href $= "png"]' => ['maxWidth' => '100%', 'maxHeight' => '100%'], '[href $= "jpg"]' => ['maxWidth' => '100%', 'maxHeight' => '100%'], '[href $= "pdf"]' => ['iframe' => true, 'width' => '90%', 'height' => '100%']], 'coreStyle' => 2]);