コード例 #1
0
ファイル: tree.php プロジェクト: igorrebega/yii2-git
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
$this->title = 'Tree';
$this->params['breadcrumbs'][] = ['label' => 'Repositories', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $git->repository, 'url' => ['view', 'id' => $git->repository]];
$this->params['breadcrumbs'][] = ['label' => 'Commit ' . substr($hash, 0, 7), 'url' => ['commitview', 'id' => $git->repository, 'hash' => $hash]];
$this->params['breadcrumbs'][] = $this->title;
?>

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    
    <?php 
echo DetailView::widget(['model' => $commit, 'attributes' => [['label' => 'Commit', 'attribute' => 'h'], ['label' => 'Ref', 'format' => 'html', 'value' => empty($commit["rev"]) ? "Nothing" : strip_tags($commit["rev"], '<span>')], ['label' => 'Author Datetime', 'attribute' => 'author_datetime'], ['label' => 'Author Name', 'attribute' => 'author_name'], ['label' => 'Author Mail', 'attribute' => 'author_mail'], ['label' => 'Committer Datetime', 'attribute' => 'committer_datetime'], ['label' => 'Committer Name', 'attribute' => 'committer_name'], ['label' => 'Committer Mail', 'attribute' => 'committer_mail'], ['label' => 'Message', 'format' => 'html', 'name' => 'message', 'value' => '<p>' . $commit["message"] . '</p>'], ['label' => 'Files', 'name' => 'tree', 'format' => 'html', 'value' => Html::a('<span class="">' . $commit["tree"] . '</span>', ['tree', 'id' => $git->repository, "hash" => $commit["h"], "tree" => $commit["tree"]], ['title' => Yii::t('app', 'Summary')])], ['label' => 'Parent(s)', 'format' => 'html', 'value' => implode("<br>", $commit["parents"])]]]);
echo yii\base\View::render('_files', array('providerFiles' => $providerFiles));
コード例 #2
0
ファイル: trash.php プロジェクト: hendrasyp/YII2-Setup
<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $searchModel common\models\MtCountriesSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Countries');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="box box-primary">
	<?php 
echo yii\base\View::render('_menu', ['title' => 'Deleted Cities']);
?>
	<div class="box-body mt-cities-trash">
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'layout' => "{items}\n{summary}", 'tableOptions' => ['class' => 'table table-striped table-bordered'], 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'city_name', ['class' => 'yii\\grid\\ActionColumn', 'header' => 'Action', 'template' => '{restore}', 'buttons' => ['restore' => function ($url, $model) {
    return Html::a('<span class="fa fa-reply"></span>', $url, ['title' => Yii::t('app', 'Restore')]);
}], 'urlCreator' => function ($action, $model, $key, $index) {
    if ($action === 'restore') {
        $url = Yii::$app->urlManager->createUrl('configurations/regional/cities/restore?id=' . $model->city_id);
        // your own url generation logic
        return $url;
    }
}]]]);
?>
	</div>
</div>
コード例 #3
0
ファイル: update.php プロジェクト: hendrasyp/YII2-Setup
<?php

use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\MtCountries */
$this->title = Yii::t('app', 'Update {modelClass}: ', ['modelClass' => 'Mt Countries']) . ' ' . $model->country_id;
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Mt Countries'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->country_id, 'url' => ['view', 'id' => $model->country_id]];
$this->params['breadcrumbs'][] = Yii::t('app', 'Update');
?>
<div class="box box-primary">
	<?php 
echo yii\base\View::render('_menu', ['title' => 'Edit']);
?>
	<div class="box-body mt-countries-create">
		<?php 
echo $this->render('_form', ['model' => $model]);
?>
	</div>
</div>
コード例 #4
0
ファイル: blob.php プロジェクト: igorrebega/yii2-git
use yii\helpers\Html;
use yii\widgets\DetailView;
$this->title = 'Archivo ' . substr($hash_file, 0, 7);
$this->params['breadcrumbs'][] = ['label' => 'Repositories', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $git->repository, 'url' => ['view', 'id' => $git->repository]];
$this->params['breadcrumbs'][] = ['label' => 'Commit ' . substr($hash, 0, 7), 'url' => ['commitview', 'id' => $git->repository, 'hash' => $hash]];
$this->params['breadcrumbs'][] = $this->title;
?>

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    
    <?php 
echo yii\base\View::render('_commit', array('commit' => $commit, 'git' => $git));
?>

    <div class="git-source-view">
    	<div class="git-source-header">
    		<div class="meta"><?php 
echo $file['name'];
?>
</div>
    		<div class="btn-group pull-right">Download</div>
    	</div>
    	<div>
            <table>
            	<tbody>
                
                <?php 
コード例 #5
0
ファイル: create.php プロジェクト: hendrasyp/YII2-Setup
<?php

use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\Companies */
$this->title = Yii::t('app', 'Create Companies');
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Companies'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="box box-primary companies-create">
	<?php 
echo yii\base\View::render('_menu', ['title' => 'Create Company']);
?>

    <?php 
echo $this->render('_form', ['model' => $model]);
?>

</div>
コード例 #6
0
ファイル: create.php プロジェクト: hendrasyp/YII2-Setup
<?php

use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\Mtprovinces */
$this->title = Yii::t('app', 'Create Mtprovinces');
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Mtprovinces'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="box box-primary mtprovinces-create">
	<?php 
echo yii\base\View::render('_menu', ['title' => 'Create Province']);
?>
	<?php 
echo $this->render('_form', ['model' => $model]);
?>

</div>
コード例 #7
0
ファイル: index.php プロジェクト: hendrasyp/YII2-Setup
<?php

use yii\helpers\Html;
use yii\helpers\Url;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel common\models\MtmembergroupsSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Relationships > Member Types');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="box box-primary mtmembergroups-index">
		<?php 
echo yii\base\View::render('_menu', ['title' => 'Member Types']);
?>
    <?php 
//echo $this->render('_search', ['model' => $searchModel]);
?>
		<div class="box-body mt-countries-index">
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'id' => 'grid-mtcountries', 'filterModel' => $searchModel, 'layout' => "{items}\n{pager}\n{summary}", 'columns' => [['class' => 'yii\\grid\\CheckboxColumn', 'headerOptions' => ['width' => '20']], ['class' => 'yii\\grid\\SerialColumn', 'headerOptions' => ['width' => '20']], ['attribute' => 'member_group_code', 'label' => Yii::t('app', 'Group Code')], ['attribute' => 'member_group_name', 'label' => Yii::t('app', 'Name')], ['attribute' => 'member_group_price', 'label' => Yii::t('app', 'Price')], ['attribute' => 'member_group_date', 'contentOptions' => ['style' => 'text-align:center'], 'label' => 'Last Update', 'format' => ['date', 'php:d M Y'], 'headerOptions' => ['width' => '120']], ['class' => 'yii\\grid\\ActionColumn', 'header' => 'Action', 'template' => '{update} {delete}', 'headerOptions' => ['width' => '60'], 'buttons' => ['update' => function ($url, $model) {
    return Html::a('<span class="fa fa-pencil"></span>', $url);
}, 'link' => function ($url, $model, $key) {
    return Html::a('Action', $url);
}]]], 'tableOptions' => ['class' => 'table table-striped table-bordered'], 'showFooter' => false]);
?>
	</div>
</div>
コード例 #8
0
ファイル: index.php プロジェクト: hendrasyp/YII2-Setup
<?php

use yii\helpers\Html;
use yii\helpers\Url;
use yii\grid\GridView;
use kartik\grid\GridView as gview;
/* @var $this yii\web\View */
/* @var $searchModel common\models\MtprovincesSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Regional > Provinces');
$this->params['breadcrumbs'][] = $this->title;
?>

<div class="box box-primary">
	<?php 
echo yii\base\View::render('_menu', ['title' => 'Provinces']);
?>
	<div class="box-body mtprovinces-index">

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'id' => 'grid-provinces', 'layout' => "{items}\n{pager}\n{summary}", 'tableOptions' => ['class' => 'table table-striped table-bordered'], 'showFooter' => false, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'province_country_id', 'label' => 'Country', 'value' => 'provinceCountry.country_name'], 'province_name', ['attribute' => 'province_updated', 'label' => 'Latest Update', 'format' => ['date', 'php:d M Y h:i:s']], ['class' => 'yii\\grid\\ActionColumn']]]);
?>
		
</div>
</div>
<?php 
$this->registerJsFile('scripts/provinces.js', ['depends' => [backend\assets\DashboardAsset::className()]], \yii\web\View::POS_END);
$this->registerJs('var gridview_id = "grid-provinces";', \yii\web\View::POS_END);
$this->registerJs('var columns = "1";', \yii\web\View::POS_END);
コード例 #9
0
 /**
  * Get block with top 6 news
  * @return array Data
  */
 public static function getTop6News($cache = true)
 {
     if ($cache) {
         $cacheBlock = CacheBlock::find()->where(['machine_name' => 'top6News'])->one();
         if (isset($cacheBlock)) {
             return ['view' => '@frontend/views/blocks/cache_block', 'data' => ['content' => $cacheBlock->content]];
         }
     }
     $postTable = Post::tableName();
     $assetTable = Asset::tableName();
     // TOP 6
     $query = Post::find()->innerJoin($assetTable, "{$assetTable}.assetable_id = {$postTable}.id")->where(['is_public' => 1, 'is_top' => 1, 'content_category_id' => Post::CATEGORY_NEWS, "{$assetTable}.assetable_type" => Asset::ASSETABLE_POST, "{$assetTable}.thumbnail" => Asset::THUMBNAIL_NEWS]);
     $top6News = $query->andWhere(['not in', "{$postTable}.id", self::$postExcludeIds])->orderBy(['created_at' => SORT_DESC])->limit(6)->all();
     foreach ($top6News as $post) {
         self::$postExcludeIds[] = $post->id;
     }
     $block = ['view' => '@frontend/views/blocks/main_news_block', 'data' => ['top6News' => $top6News]];
     if (!$cache) {
         $view = new \yii\base\View();
         return $view->renderFile($block['view'] . '.php', $block['data']);
     }
     return $block;
 }
コード例 #10
0
ファイル: index.php プロジェクト: hendrasyp/YII2-Setup
<?php

use yii\helpers\Html;
use yii\helpers\Url;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel common\models\MtCountriesSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Regional > Countries');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="box box-primary">
	<?php 
echo yii\base\View::render('_menu', ['title' => 'Countries']);
?>
    <?php 
//= $this->renderPartial( '_menu');
?>
	<div class="box-body mt-countries-index">
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'id' => 'grid-mtcountries', 'filterModel' => $searchModel, 'layout' => "{items}\n{pager}\n{summary}", 'columns' => [['class' => 'yii\\grid\\CheckboxColumn', 'headerOptions' => ['width' => '20']], ['class' => 'yii\\grid\\SerialColumn', 'headerOptions' => ['width' => '20']], ['attribute' => 'country_name', 'label' => Yii::t('app', 'Name')], ['attribute' => 'country_updated', 'contentOptions' => ['style' => 'text-align:center'], 'label' => 'Last Update', 'format' => ['date', 'php:d M Y'], 'headerOptions' => ['width' => '120']], ['class' => 'yii\\grid\\ActionColumn', 'header' => 'Action', 'template' => '{update} {delete}', 'headerOptions' => ['width' => '60'], 'buttons' => ['update' => function ($url, $model) {
    return Html::a('<span class="fa fa-pencil"></span>', $url);
}, 'link' => function ($url, $model, $key) {
    return Html::a('Action', $url);
}]]], 'tableOptions' => ['class' => 'table table-striped table-bordered'], 'showFooter' => false]);
?>
	</div>
</div>

<?php 
$this->registerJs('var baseURL=\'' . Url::base() . '/configurations/regional/countries/' . '\'', \yii\web\View::POS_END);
コード例 #11
0
ファイル: create.php プロジェクト: hendrasyp/YII2-Setup
<?php

use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\Mtmembergroups */
$this->title = Yii::t('app', 'Create Mtmembergroups');
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Mtmembergroups'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="box box-primary mtmembergroups-create">
	<?php 
echo yii\base\View::render('_menu', ['title' => 'Create Member Type']);
?>
	
		<?php 
echo $this->render('_form', ['model' => $model]);
?>
</div>