コード例 #1
0
ファイル: Alert.php プロジェクト: goncharovln/keywords
 public function init()
 {
     parent::init();
     $session = \Yii::$app->getSession();
     $flashes = $session->getAllFlashes();
     $appendCss = isset($this->options['class']) ? ' ' . $this->options['class'] : '';
     foreach ($flashes as $type => $data) {
         if (isset($this->alertTypes[$type])) {
             $data = (array) $data;
             foreach ($data as $i => $message) {
                 /* initialize css class for each alert box */
                 $this->options['class'] = $this->alertTypes[$type] . $appendCss;
                 /* assign unique id to each alert box */
                 $this->options['id'] = $this->getId() . '-' . $type . '-' . $i;
                 echo Growl::widget(['body' => $message, 'closeButton' => $this->closeButton, 'options' => $this->options, 'delay' => false, 'pluginOptions' => ['showProgressbar' => false, 'placement' => ['from' => 'top', 'align' => 'right']]]);
                 /*
                                     echo \yii\bootstrap\Alert::widget([
                                         'body' => $message,
                                         'closeButton' => $this->closeButton,
                                         'options' => $this->options,
                 
                                     ]);*/
             }
             $session->removeFlash($type);
         }
     }
 }
コード例 #2
0
ファイル: _form.php プロジェクト: slavam/placement
echo $form->field($model, 'rec_status_id')->radioList(ArrayHelper::map(\app\models\RecStatus::find()->active()->all(), 'id', 'name'), ['class' => 'btn-group', 'data-toggle' => 'buttons', 'unselect' => null, 'item' => function ($index, $label, $name, $checked, $value) {
    return '<label class="btn btn-default' . ($checked ? ' active' : '') . '">' . Html::radio($name, $checked, ['value' => $value, 'class' => 'project-status-btn']) . $label . '</label>';
}]);
?>

    <?php 
echo $form->field($model, 'user_id')->dropDownList(ArrayHelper::map(\app\models\User::find()->active()->all(), 'id', 'name'), ['prompt' => '']);
?>

    <?php 
echo $form->field($model, 'dc')->textInput();
?>

    <div class="form-group">
        <div class="col-lg-offset-2 col-lg-10">
            <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Save') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
        </div>
    </div>

    <?php 
ActiveForm::end();
?>

</div>

<?php 
if ($model->hasErrors()) {
    echo \kartik\growl\Growl::widget(['type' => \kartik\growl\Growl::TYPE_DANGER, 'title' => 'Необходимо исправить следующие ошибки:', 'icon' => 'glyphicon glyphicon-exclamation-sign', 'body' => \yii\helpers\BaseHtml::errorSummary($model, ['header' => '']), 'showSeparator' => true, 'delay' => 10, 'pluginOptions' => ['placement' => ['from' => 'top', 'align' => 'right']]]);
}
コード例 #3
0
ファイル: index.php プロジェクト: rvences/mopoua
/* @var $model backend\modules\mrp\models\Proveedores */
$this->title = 'Listado de Proveedores';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="proveedores-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
if (Yii::$app->session->getFlash('borrar')) {
    echo growl\Growl::widget(['type' => growl\Growl::TYPE_DANGER, 'title' => 'Registro Eliminado', 'icon' => 'glyphicon glyphicon-remove-sign', 'body' => 'Se elimino correctamente ' . Yii::$app->session->getFlash('borrar'), 'showSeparator' => true, 'delay' => 0, 'pluginOptions' => ['placement' => ['from' => 'top', 'align' => 'right']]]);
} else {
    if (Yii::$app->session->getFlash('crear')) {
        echo growl\Growl::widget(['type' => growl\Growl::TYPE_SUCCESS, 'title' => 'Registro Creado', 'icon' => 'glyphicon glyphicon-ok-sign', 'body' => 'Se agrego correctamente ' . Yii::$app->session->getFlash('crear'), 'showSeparator' => true, 'delay' => 0, 'pluginOptions' => ['placement' => ['from' => 'top', 'align' => 'right']]]);
    }
}
?>
    <?php 
echo GridView::widget(['export' => false, 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['class' => 'kartik\\grid\\ActionColumn', 'template' => '{view} &nbsp;&nbsp;{update} &nbsp;&nbsp;{delete}', 'width' => '105px'], 'nombre_corto', 'contacto', 'telefono']]);
?>

</div>


<div class="proveedores-create">

    <?php 
echo $this->render('_form', ['model' => $model]);
?>
コード例 #4
0
ファイル: main.php プロジェクト: philippfrenzel/wortundtat
?>
</head>
<body>
<?php 
$this->beginBody();
?>

<?php 
if (Yii::$app->session->hasFlash('success')) {
    ?>
    <?php 
    echo Growl::widget(['type' => Growl::TYPE_INFO, 'icon' => 'glyphicon glyphicon-ok-sign', 'title' => 'Hinweis', 'delay' => 0, 'showSeparator' => true, 'useAnimation' => true, 'body' => Yii::$app->session->getFlash('success'), 'pluginOptions' => ['placement' => ['from' => 'top', 'align' => 'right']]]);
} elseif (Yii::$app->session->hasFlash('error')) {
    ?>
    <?php 
    echo Growl::widget(['type' => Growl::TYPE_WARNING, 'icon' => 'glyphicon glyphicon-ok-sign', 'title' => 'Alert', 'delay' => 0, 'showSeparator' => true, 'useAnimation' => true, 'body' => Yii::$app->session->getFlash('error'), 'pluginOptions' => ['placement' => ['from' => 'top', 'align' => 'right']]]);
}
?>

<div class="wrap">

    <?php 
NavBar::begin(['brandLabel' => '<i class="fa fa-retweet"></i>  ' . getenv('APP_NAME') . '(beta)', 'brandUrl' => Yii::$app->homeUrl, 'options' => ['class' => 'navbar-default']]);
echo Nav::widget(['options' => ['class' => 'navbar-nav'], 'encodeLabels' => false, 'items' => \dmstr\modules\pages\models\Tree::getMenuItems('root_' . Yii::$app->language)]);
$menuItems = [];
$menuItems[] = ['label' => 'Documentation', 'url' => ['/site/view']];
if (Yii::$app->hasModule('user')) {
    if (Yii::$app->user->isGuest) {
        $menuItems[] = ['label' => 'Signup', 'url' => ['/user/registration/register']];
        $menuItems[] = ['label' => 'Login', 'url' => ['/user/security/login']];
    } else {
コード例 #5
0
ファイル: AlertBlock.php プロジェクト: aoopvn/EduSec4.0.0
 /**
  * Renders manually set alerts
  */
 public function renderAlerts()
 {
     $type = $this->type == self::TYPE_GROWL ? self::TYPE_GROWL : self::TYPE_ALERT;
     foreach ($this->alertSettings as $alert => $settings) {
         if (!empty($settings['body'])) {
             echo $type == self::TYPE_GROWL ? Growl::widget($settings) : Alert::widget($settings);
         }
     }
 }
コード例 #6
0
ファイル: main.php プロジェクト: jc21/snippets-site
            </ul>
        </div>

        <div id="content">
            <h1><?php 
echo $this->title ? Html::encode($this->title) : 'Snippets Home';
?>
</h1>
            <?php 
echo $content;
?>
        </div>
    </div>

    <div id="footer">
        <p>&copy; jc21.com 2007</p>
    </div>

    <?php 
foreach (Yii::$app->session->getAllFlashes() as $message) {
    print Growl::widget(['type' => !empty($message['type']) ? $message['type'] : 'danger', 'title' => !empty($message['title']) ? Html::encode($message['title']) : null, 'icon' => !empty($message['icon']) ? $message['icon'] : 'fa fa-info', 'body' => !empty($message['message']) ? Html::encode($message['message']) : 'Message Not Set!', 'showSeparator' => true, 'delay' => 1, 'pluginOptions' => ['delay' => !empty($message['duration']) ? $message['duration'] : 4000, 'placement' => ['from' => !empty($message['positonY']) ? $message['positonY'] : 'top', 'align' => !empty($message['positonX']) ? $message['positonX'] : 'right']], 'options' => ['style' => 'font-size:13px']]);
}
?>

    <?php 
$this->endBody();
?>
</body>
</html>
<?php 
$this->endPage();
コード例 #7
0
ファイル: main.php プロジェクト: apuc/api
use frontend\assets\AppAsset;
use frontend\modules\news;
use frontend\widgets\Alert;
use kartik\growl\Growl;
use yii\helpers\Html;
/* @var $this \yii\web\View */
/* @var $content string */
AppAsset::register($this);
$user = Yii::$app->user->identity;
if (empty($user->photo)) {
    $user->photo = "img/avatar5.png";
}
if (Yii::$app->session->hasFlash('message')) {
    $message = Yii::$app->session->getFlash('message');
    echo Growl::widget(['type' => $message['type'], 'title' => 'Уведомление', 'icon' => 'fa fa-info', 'body' => $message['message'], 'showSeparator' => true, 'delay' => 500, 'pluginOptions' => ['delay' => 4000, 'placement' => ['from' => 'bottom', 'align' => 'right']]]);
}
$this->beginPage();
?>
<!DOCTYPE html>
<html lang="<?php 
echo Yii::$app->language;
?>
">
<head>
    <meta name="interkassa-verification" content="20a6e6203abeee743ba065eee429c803"/>

    <meta charset="<?php 
echo Yii::$app->charset;
?>
">
コード例 #8
0
<?php

/** @var $session \yii\web\Session */
use kartik\growl\Growl;
use yii\helpers\Html;
$session = Yii::$app->session;
if ($session->hasFlash('growl')) {
    $message = $session->getFlash('growl');
    Growl::widget(['type' => !empty($message['type']) ? $message['type'] : 'success', 'title' => !empty($message['title']) ? Html::encode($message['title']) : 'Title Not Set!', 'icon' => !empty($message['icon']) ? $message['icon'] : 'fa fa-check-circle', 'body' => !empty($message['message']) ? Html::encode($message['message']) : 'Message Not Set!', 'showSeparator' => true, 'delay' => 1, 'pluginOptions' => ['delay' => !empty($message['duration']) ? $message['duration'] : 3500, 'placement' => ['from' => !empty($message['positonY']) ? $message['positonY'] : 'top', 'align' => !empty($message['positonX']) ? $message['positonX'] : 'right']]]);
}
コード例 #9
0
ファイル: main.php プロジェクト: tqsq2005/Yii2adv
    </head>
    <body class="hold-transition skin-blue sidebar-mini layout-boxed">
    <?php 
    $this->beginBody();
    ?>

    <!--//Get all flash messages and loop through them-->
    <?php 
    foreach (Yii::$app->session->getAllFlashes() as $type => $message) {
        ?>
        <?php 
        $icon_type = '';
        if (empty($message['icon'])) {
            $icon_type = "'icon_type'=> 'image',";
        }
        echo \kartik\growl\Growl::widget(['type' => !empty($type) ? $type : \kartik\growl\Growl::TYPE_INFO, 'title' => !empty($message['title']) ? Html::encode($message['title']) : '<strong>计划生育信息管理系统</strong>&nbsp;<img src="' . Yii::getAlias('@web') . '/images/js18.png" />', 'icon' => !empty($message['icon']) ? $message['icon'] : 'fa fa-cog fa-lg fa-fw fa-spin', 'body' => '&nbsp;<i class="fa fa-quote-left fa-pull-left"></i>&nbsp;<i class="fa fa-commenting-o fa-lg fa-fw fa-pull-right"></i>&nbsp;' . (!empty($message['message']) ? $message['message'] : $message) . '&nbsp;&nbsp;<i class="fa fa-quote-right"></i>', 'showSeparator' => true, 'delay' => 5, 'pluginOptions' => ['delay' => !empty($message['duration']) ? $message['duration'] : 10000, 'showProgressbar' => true, 'placement' => ['from' => !empty($message['positonY']) ? $message['positonY'] : 'top', 'align' => !empty($message['positonX']) ? $message['positonX'] : 'right']]]);
        ?>
    <?php 
    }
    ?>
    <!--//flash messages end-->

    <div class="wrapper">

        <?php 
    echo $this->render('header.php', ['directoryAsset' => $directoryAsset]);
    ?>

        <?php 
    echo $this->render('left.php', ['directoryAsset' => $directoryAsset]);
    ?>
コード例 #10
0
ファイル: _form.php プロジェクト: slavam/placement
$other_errors = '';
//echo print_r($model->errors);
if ($model->hasErrors()) {
    echo \kartik\growl\Growl::widget(['type' => \kartik\growl\Growl::TYPE_DANGER, 'title' => 'Ошибки в резюме:', 'icon' => 'glyphicon glyphicon-exclamation-sign', 'body' => \yii\helpers\BaseHtml::errorSummary($model, ['header' => '']), 'showSeparator' => true, 'delay' => 100, 'pluginOptions' => ['placement' => ['from' => 'top', 'align' => 'right']]]);
    $main_err = $model->hasErrors('salary') + 0;
    $model_errors = $main_err ? ' <span title="Количество ошибок" style="margin-left: 10px;" class="label label-danger pull-right" > ' . $main_err . '</span>' : '';
    $other_errors = count($model->errors) > $main_err ? ' <span title="Количество ошибок" style="margin-left: 10px;" class="label label-danger pull-right" > ' . (count($model->errors) - $main_err) . '</span>' : '';
    if ($active_tab == 0 && $main_err > 0) {
        $active_tab = 1;
    }
    if ($active_tab == 0 && count($model->errors) > $main_err) {
        $active_tab = 2;
    }
}
if ($person->hasErrors() || $person_address->hasErrors()) {
    echo \kartik\growl\Growl::widget(['type' => \kartik\growl\Growl::TYPE_DANGER, 'title' => 'Ошибки в личных данных соискателя:', 'icon' => 'glyphicon glyphicon-exclamation-sign', 'body' => \yii\helpers\BaseHtml::errorSummary($person, ['header' => '']) . \yii\helpers\BaseHtml::errorSummary($person_address, ['header' => '']), 'showSeparator' => true, 'delay' => 1100, 'pluginOptions' => ['placement' => ['from' => 'top', 'align' => 'right']]]);
    $person_errors = count($person->errors) || count($person_address->errors) ? ' <span title="Количество ошибок" style="margin-left: 10px;" class="label label-danger pull-right" > ' . (count($person->errors) + count($person_address->errors)) . '</span>' : '';
    if ($active_tab != 1) {
        $active_tab = 3;
    }
}
?>

<div class="resume-form">

<?php 
$form = ActiveForm::begin(['enableClientValidation' => true, 'validateOnSubmit' => false, 'options' => ['class' => 'form-horizontal'], 'fieldConfig' => ['template' => "{label}\n<div class=\"col-lg-4\">{input}</div>\n<div class=\"col-lg-6\">{error}</div>", 'labelOptions' => ['class' => 'col-lg-2 control-label']]]);
?>

<?php 
$this->beginBlock('main');
コード例 #11
0
    </div>
    <?php 
if (Yii::$app->session->hasFlash('error-magazin')) {
    ?>
    <?php 
    echo Growl::widget(['type' => Growl::TYPE_WARNING, 'title' => Yii::t('frontend', 'Sorry!'), 'icon' => 'glyphicon glyphicon-exclamation-sign', 'body' => Yii::$app->session->getFlash('error-magazin'), 'showSeparator' => false, 'delay' => 3000, 'pluginOptions' => ['showProgressbar' => false, 'placement' => ['from' => 'bottom', 'align' => 'left']]]);
    ?>
    <?php 
}
?>

    <?php 
if (Yii::$app->session->hasFlash('success-magazin')) {
    ?>
     <?php 
    echo Growl::widget(['type' => Growl::TYPE_SUCCESS, 'title' => Yii::t('frontend', 'Sent mail done!'), 'icon' => 'glyphicon glyphicon-ok-sign', 'body' => Yii::$app->session->getFlash('success-magazin'), 'showSeparator' => false, 'delay' => 3000, 'pluginOptions' => ['showProgressbar' => false, 'placement' => ['from' => 'bottom', 'align' => 'left']]]);
    ?>
    <?php 
}
?>
    <div id="goTop">
        <img src="<?php 
echo Yii::$app->urlManager->baseUrl . '/images/top.png';
?>
" alt='<?php 
echo Yii::t('frontend', 'Top');
?>
' title="<?php 
echo Yii::t('frontend', 'Top');
?>
" />
コード例 #12
0
ファイル: login.php プロジェクト: baobkath/lenguage_center
?>
<div class="site-login">
    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p><?php 
echo Yii::t('backend', 'Please fill out the following fields to login:'******'error-rate')) {
    ?>
    <?php 
    echo Growl::widget(['type' => Growl::TYPE_WARNING, 'title' => 'Not login!', 'icon' => 'glyphicon glyphicon-exclamation-sign', 'body' => Yii::$app->session->getFlash('error-login'), 'showSeparator' => false, 'delay' => 3000, 'pluginOptions' => ['showProgressbar' => false, 'placement' => ['from' => 'bottom', 'align' => 'left']]]);
    ?>
    <?php 
}
?>
    <div class="row">
        <div class="col-lg-5">
            <?php 
$form = ActiveForm::begin(['id' => 'login-form']);
?>

                <?php 
echo $form->field($model, 'login');
?>

                <?php 
コード例 #13
0
ファイル: main.php プロジェクト: ufrgs-hyman/meican
</b>
        </div>
        <!-- Default to the left -->
        <strong>&copy; 2016 <a href="http://www.rnp.br" target="_blank">RNP</a></strong>
    </footer>
    <?php 
}
?>

</div>
<!-- ./wrapper -->

<?php 
$this->endBody();
foreach (Yii::$app->session->getAllFlashes() as $key => $message) {
    echo Growl::widget(['type' => $key, 'icon' => 'glyphicon glyphicon-ok-sign', 'body' => $message, 'pluginOptions' => ['delay' => 20000, 'newest_on_top' => true, 'placement' => ['from' => 'top', 'align' => 'right'], 'offset' => ['y' => 60, 'x' => 20]]]);
}
Modal::begin(['id' => 'feedback-modal', 'header' => 'Feedback', 'footer' => '<button class="send-btn btn btn-primary">Send</button><button class="cancel-btn btn btn-default">Cancel</button>']);
$form = \yii\bootstrap\ActiveForm::begin(['id' => 'feedback-form', 'layout' => 'horizontal']);
$model = new FeedbackForm();
echo $form->field($model, 'subject')->textInput();
echo $form->field($model, 'message')->textArea(['rows' => 6, 'resize' => false]);
\yii\bootstrap\ActiveForm::end();
Modal::end();
?>

<?php 
echo Analytics::build();
?>
</body>
<?php 
コード例 #14
-1
ファイル: main.php プロジェクト: sergey-exu/kio
echo $content;
?>
                
            </section><!-- /.content -->
        </aside><!-- /.right-side -->


    </div>
    
    
    
    
    <?php 
//yii2 widget growl from krajee
foreach (Yii::$app->session->getAllFlashes() as $message) {
    ?>
            <?php 
    echo Growl::widget(['type' => !empty($message['type']) ? $message['type'] : 'danger', 'title' => !empty($message['title']) ? Html::encode($message['title']) : 'Title Not Set!', 'icon' => !empty($message['icon']) ? $message['icon'] : 'fa fa-info', 'body' => !empty($message['message']) ? Html::encode($message['message']) : 'Message Not Set!', 'showSeparator' => true, 'delay' => 1, 'pluginOptions' => ['showProgressbar' => true, 'delay' => !empty($message['duration']) ? $message['duration'] : 3000, 'placement' => ['from' => !empty($message['positonY']) ? $message['positonY'] : 'top', 'align' => !empty($message['positonX']) ? $message['positonX'] : 'right']]]);
    ?>
        <?php 
}
?>


    <?php 
$this->endBody();
?>
</body>
</html>
<?php 
$this->endPage();