本文整理汇总了PHP中TbHtml::alert方法的典型用法代码示例。如果您正苦于以下问题:PHP TbHtml::alert方法的具体用法?PHP TbHtml::alert怎么用?PHP TbHtml::alert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TbHtml
的用法示例。
在下文中一共展示了TbHtml::alert方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Runs the widget.
*/
public function run()
{
/* @var $user CWebUser */
$user = Yii::app()->getUser();
echo CHtml::openTag('div', $this->htmlOptions);
foreach ($this->alerts as $style => $alert) {
if (isset($alert['visible']) && !$alert['visible']) {
continue;
}
if ($user->hasFlash($style)) {
$htmlOptions = TbHtml::popOption('htmlOptions', $alert, array());
$htmlOptions = TbHtml::defaultOption('closeText', $this->closeText, $htmlOptions);
$htmlOptions = TbHtml::defaultOption('block', $this->block, $htmlOptions);
$htmlOptions = TbHtml::defaultOption('fade', $this->fade, $htmlOptions);
echo TbHtml::alert($style, $user->getFlash($style), $htmlOptions);
}
}
echo '</div>';
$this->registerEvents("#{$this->htmlOptions['id']} > .alert", $this->events);
}
示例2: run
/**
* Runs the widget.
*/
public function run()
{
/* @var $user CWebUser */
$user = Yii::app()->getUser();
if (count($user->getFlashes(false)) == 0) {
return;
}
echo TbHtml::openTag('div', $this->htmlOptions);
foreach ($this->alerts as $color => $alert) {
if (isset($alert['visible']) && !$alert['visible']) {
continue;
}
if ($user->hasFlash($color)) {
$htmlOptions = TbArray::popValue('htmlOptions', $alert, array());
TbArray::defaultValue('closeText', $this->closeText, $htmlOptions);
TbArray::defaultValue('block', $this->block, $htmlOptions);
TbArray::defaultValue('fade', $this->fade, $htmlOptions);
echo TbHtml::alert($color, $user->getFlash($color), $htmlOptions);
}
}
echo '</div>';
$this->registerEvents("#{$this->htmlOptions['id']} > .alert", $this->events);
}
示例3: array
<?php
$items = array();
$actions = array(array(PowerOffManager::SHUTDOWN, 'powerOff/shutdown', Yii::t('PowerOff', 'Shutdown')), array(PowerOffManager::SUSPEND, 'powerOff/suspend', Yii::t('PowerOff', 'Suspend')), array(PowerOffManager::HIBERNATE, 'powerOff/hibernate', Yii::t('PowerOff', 'Hibernate')), array(PowerOffManager::REBOOT, 'powerOff/reboot', Yii::t('PowerOff', 'Reboot')));
foreach ($actions as $action) {
list($action, $url, $label) = $action;
if (Yii::app()->powerOffManager->isActionAllowed($action)) {
$items[] = array('label' => $label, 'url' => array($url));
}
}
echo TbHtml::alert(TbHtml::ALERT_COLOR_WARNING, Yii::t('PowerOff', 'Turning off the backend will break the connection for all users currently using the backend'), array('closeText' => false));
echo TbHtml::stackedTabs($items);
示例4: array
<?php
// $model: algo que implementa a ICrugeStoredUser,
if (Yii::app()->user->hasFlash('profile-flash')) {
echo TbHtml::alert(TbHtml::ALERT_COLOR_ERROR, Yii::app()->user->getFlash('profile-flash'));
} else {
if (Yii::app()->user->hasFlash('error')) {
echo TbHtml::alert(TbHtml::ALERT_COLOR_ERROR, Yii::app()->user->getFlash('error'));
}
}
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'crugestoreduser-form', 'layout' => TbHtml::FORM_LAYOUT_HORIZONTAL, 'enableAjaxValidation' => false, 'enableClientValidation' => false, 'clientOptions' => array('validateOnSubmit' => true), 'htmlOptions' => array('class' => 'well')));
?>
<fieldset>
<p class="note">Campos con <span class="required">*</span> son requeridos.</p>
<legend>Registrar Usuario</legend>
<?php
echo $form->errorSummary($user);
?>
<?php
echo $form->textFieldControlGroup($user, 'username', array('append' => TbHtml::icon(TbHtml::ICON_USER), 'placeholder' => 'Username', 'required' => true));
?>
<?php
echo $form->textFieldControlGroup($user, 'email', array('append' => TbHtml::icon(TbHtml::ICON_ENVELOPE), 'placeholder' => 'test@example.com', 'required' => true));
?>
示例5: if
<?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm',array(
'id'=>'upload_decisions-form',
// Please note: When you enable ajax validation, make sure the corresponding
// controller action is handling ajax validation correctly.
// There is a call to performAjaxValidation() commented in generated controller code.
// See class documentation of CActiveForm for details on this.
'enableAjaxValidation'=>false,
'htmlOptions'=>array(
'enctype'=>'multipart/form-data'
)
));?>
<fieldset>
<legend>Upload Decisions</legend>
<?php if(Yii::app()->user->hasFlash('success')):?>
<?php echo TbHtml::alert(TbHtml::ALERT_COLOR_SUCCESS, Yii::app()->user->getFlash('success'))?>
<?php endif;?>
<?php echo $form->errorSummary($model); ?>
<?php echo $form->dropDownListControlGroup($model,'decision_source', TbHtml::listData(EacLookup::model()->findAll('type=:type',array(':type'=> EacLookup::DECISION_SOURCE)),"id","description"),
array('prompt'=>'--select--')); ?>
<?php echo $form->fileFieldControlGroup($model,'upload_file'); ?>
<div class="form-actions">
<?php echo TbHtml::submitButton('Import Decisions',array(
'color'=>TbHtml::BUTTON_COLOR_SUCCESS,
'size'=>TbHtml::BUTTON_SIZE_DEFAULT,
)); ?>
</div>
</fieldset>
<?php $this->endWidget();?>
</div>
示例6: array
<?php
echo TbHtml::alert(TbHtml::ALERT_COLOR_SUCCESS, $message, $htmlOptions = array('closeText' => false,'style' => 'font-size:18px; text-align:center;'));
?>
示例7: if
<?php
/* @var $this SiteController */
$this->pageTitle=Yii::app()->name;
?>
<?php //echo TbHtml::pageHeader('', Yii::t('strings',CHtml::encode(Yii::app()->name)))?>
<?php if(!empty(Yii::app()->user->getState('pending-decisions-message'))) : ?>
<?php echo TbHtml::alert(TbHtml::ALERT_COLOR_INFO, Yii::app()->user->getState('pending-decisions-message'),array('style'=>'position:fixed;width:50%;height:200px;margin-left:15%;margin-right:15%')); ?>
<?php Yii::app()->user->setState('pending-decisions-message','');?>
<?php endif; ?>
<?php $aboutContent =
TbHtml::link('',$this->createUrl('//page/update',array('id'=>$model->id)),array('class'=>TbHtml::ICON_PENCIL)).
"
<h3>$model->title</h3>
<div style='font-size:14px;height:150px;'>
$model->body
</div>
" ;
?>
<?php echo TbHtml::heroUnit(null,$aboutContent);?>
示例8: array
<?php
$this->pageTitle = Yii::app()->name . ' - ' . Yii::t('quotes', 'Error');
?>
<div class="row-fluid">
<legend>Error <?php
echo $code;
?>
</legend>
<?php
echo TbHtml::alert(TbHtml::ALERT_COLOR_WARNING, CHtml::encode($message), array('closeText' => false));
?>
</div>
示例9:
$save = $model['param']['save'] == 'update' ? '更新' : '添加';
?>
<?php
if (isset($model['param']['result']) && $model['param']['result'] == 'success') {
?>
<?php
echo TbHtml::alert(TbHtml::ALERT_COLOR_SUCCESS, '操作员' . $save . '成功');
?>
<?php
}
?>
<?php
if (isset($model['param']['result']) && $model['param']['result'] == 'fail') {
?>
<?php
echo TbHtml::alert(TbHtml::ALERT_COLOR_DANGER, '操作员' . $save . '失败,可能是添加数据错误或者没有更改操作');
?>
<?php
}
?>
<div class="row">
<div class="col-xs-12">
<form class="form-horizontal" action="?r=desktop/user/update&user_id=<?php
echo $model['user_row']['user_id'];
?>
" method="post">
<div class="form-group">
<label for="form-field-1" class="col-sm-3 control-label no-padding-right"> 姓名</label>
<div class="col-sm-9">
示例10: array
<div class="row">
<div class="" style="padding-top: 20px; margin-left: -10px;">
<?php
$this->widget('common.widgets.twofactorauth.TwoFactorAuth', array('form' => $form, 'name' => 'wire_submit', 'label' => Yii::t('translation', 'withdrawal_bank_button'), 'deliveras' => $deliveras, 'icon' => 'ok'));
?>
</div>
</div>
</div>
</div>
</div>
<div id="opt_paypal" class="payopt" style='display: none;'>
<div class="panel panel-default" style="padding: 10px 60px 60px 60px">
<?php
if ($model_paypal->hasErrors()) {
echo TbHtml::alert(TbHtml::ALERT_COLOR_DANGER, Yii::t('translation', 'Unable to create transaction') . $form->errorSummary($model_bank));
}
?>
<div class="row">
<center>
<div style="padding: 0 10px 0 10px">
<h4><?php
echo Yii::t('translation', 'withdrawal_paypal_title');
?>
</h4>
<div>
<?php
Yii::t('translation', 'USD Balance:');
?>
</span><span
style="color: #8EC919; font-weight: 700; font-size: 2em;"><?php
示例11: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
if (isset($_GET['updatePassword'])) {
$updatePass = "<div>" . TbHtml::alert(TbHtml::ALERT_COLOR_SUCCESS, 'Well Done! You Successfully update password user!') . "</div>";
} else {
$updatePass = '';
}
$sukses = false;
$gagal = false;
$alreadyUser = false;
$userExists = false;
if (isset($_POST['User'])) {
Yii::import('ext.phpexcelreader.JPhpExcelReader');
$model = new User();
$model->attributes = $_POST['User'];
$fileUpload = CUploadedFile::getInstance($model, 'filee');
$path = Yii::getPathOfAlias('webroot') . '/FileExcel/' . $fileUpload;
if ($fileUpload == '') {
die('Please Insert File Excel 2003 with format template! ');
}
if (substr($path, -3, 3) != 'xls') {
die('Please Insert File Excel 2003! ');
}
$fileUpload->saveAs($path);
if (!file_exists($path)) {
die('File could not be found at: ' . $path);
}
$data = new JPhpExcelReader($path);
$baris = $data->rowcount($sheet_index = 0);
$sukses = 0;
$gagal = 0;
$alreadyUser = 0;
for ($i = 2; $i <= $baris; $i++) {
for ($n = 1; $n <= 14; $n++) {
$rowData[$n] = str_replace(",", "", $data->val($i, $n));
}
$command = Yii::app()->db->createCommand();
if (User::model()->findByAttributes(array('username' => $rowData[1])) != null) {
$alreadyUser++;
$userExists[$rowData[1]] = $rowData[1];
} else {
try {
$command->insert('users', array('username' => $rowData[1], 'password' => Yii::app()->controller->module->encrypting($rowData[14]), 'email' => $rowData[1] . '@morena.co.id', 'create_at' => date('Y-m-d H:i:s'), 'status' => 1));
$idUsersCreate = User::model()->findByAttributes(array('username' => $rowData[1]));
$command->insert('profiles', array('user_id' => $idUsersCreate->id, 'nip' => $rowData[1], 'firstname' => $rowData[2], 'lastname' => $rowData[3], 'birthdate' => $rowData[4], 'address' => $rowData[5], 'location' => $rowData[6], 'position' => $rowData[7], 'departement' => $rowData[8], 'class' => $rowData[9], 'joinDate' => $rowData[10], 'hireDate' => $rowData[11], 'state' => $rowData[12], 'marriageStatus' => $rowData[13]));
$command->insert('authassignment', array('itemname' => 'employee', 'userid' => $idUsersCreate['id']));
$sukses++;
} catch (Exception $e) {
$gagal++;
}
}
}
unlink($path);
}
$model = new User('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['User'])) {
$model->attributes = $_GET['User'];
}
$this->render('index', array('model' => $model, 'sukses' => $sukses, 'gagal' => $gagal, 'alreadyUser' => $alreadyUser, 'userExists' => $userExists, 'updatePass' => $updatePass));
/*$dataProvider=new CActiveDataProvider('User', array(
'pagination'=>array(
'pageSize'=>Yii::app()->controller->module->user_page_size,
),
));
$this->render('index',array(
'dataProvider'=>$dataProvider,
));//*/
}
示例12: actionViewmodalidadajax
public function actionViewmodalidadajax()
{
$id = $_POST['id'];
$modalidad = $_POST['modalidad'];
$model = $this->loadModel($id);
Yii::app()->clientScript->scriptMap['jquery.js'] = false;
if (!isset($model->{$modalidad})) {
echo TbHtml::alert(TbHtml::ALERT_COLOR_ERROR, 'No hay modalidad cargada!', $htmlOptions = array('closeText' => false, 'style' => 'font-size:18px;'));
// la opcions closeText hace que
Yii::app()->end();
// no aparezca el icono de cerrar el mensaje
}
echo "<embed type='application/pdf' width='1000' height='500' src='" . Yii::app()->controller->createUrl('osplan/viewmodalidad', array('id' => $model->idosplan, 'modalidad' => $modalidad)) . "'/>";
Yii::app()->end();
}
示例13: actionViewcontratoajax
public function actionViewcontratoajax()
{
$id = $_POST['id'];
$model = $this->loadModel($id);
Yii::app()->clientScript->scriptMap['jquery.js'] = false;
if (!isset($model->contratoimg)) {
// echo TbHtml::heroUnit('','NO hay contrato cargado!',array('class'=>'centrado','style'=>'background-color:#C8BAC8;'));
echo TbHtml::alert(TbHtml::ALERT_COLOR_ERROR, 'No hay contrato cargado!', $htmlOptions = array('closeText' => false, 'style' => 'font-size:18px;'));
// la opcions closeText hace que
Yii::app()->end();
// no aparezca el icono de cerrar el mensaje
}
if ($model->imgtipo == 'application/pdf') {
// muestra pdf
echo "<embed type={$model->imgtipo} width='1000' height='500' src='" . Yii::app()->controller->createUrl('contrato/viewcontrato', array('id' => $model->idcontrato)) . "'/>";
Yii::app()->end();
} else {
// muestra imagen
echo CHtml::image(Yii::app()->controller->createUrl('contrato/viewcontrato', array('id' => $model->idcontrato)));
Yii::app()->end();
}
}
示例14: array
<?php
//=============== BUTTON ADVANCED SEARCH, UPLOAD, DOWNLOAD ==============
echo TBHtml::button("Remove Selected Items", array('color' => TbHtml::BUTTON_COLOR_DANGER, "id" => "butt"));
?>
<span style="float:right";> </span>
<button style="float:right"; class="btn btn-primary" type="button" name="yt13" data-target="#print" data-toggle="modal" >Download Salary Slip</button>
<span style="float:right";> </span>
<button style="float:right"; class="btn btn-primary" type="button" name="yt13" data-target="#upload" data-toggle="modal" >Upload Salary Slip</button>
<br/><br/>
<?php
if ($dateStamp['count(id)'] > 0) {
echo TbHtml::alert(TbHtml::ALERT_COLOR_INFO, 'Today you successfully insert ' . $dateStamp['count(id)'] . ' data.');
}
?>
<?php
//=============== END OF BUTTON ADVANCED SEARCH, UPLOAD, DOWNLOAD ==============
?>
<?php
//==================== FORM UPLOAD DATA EMPLOYEE===================
?>
<div id="upload" class="modal hide fade" tabindex="-1" role="dialog" style="left:45%;width:800px;">
<div class="modal-header"style="text-align:center;">
<button class="close" type="button" data-dismiss="modal">×</button>
<br/><h3>Upload Data Salary Slip</h3>
示例15: if
<td><?php echo TbHtml::imageRounded(Yii::app()->request->baseUrl.'/images/eac_logo.png', '',array('width'=>100,'height'=>100,'class'=>'eac'))?></td>
</tr>
</table>
</div>
<?php if(isset($this->breadcrumbs)):?>
<?php
// $this->widget('bootstrap.widgets.TbBreadcrumb', array(
// 'links' => $this->breadcrumbs,
// ));
?><!-- breadcrumbs -->
<?php endif?>
<?php foreach(Yii::app()->user->getFlashes() as $key => $message) : ?>
<?php echo TbHtml::alert($key, $message); ?>
<?php endforeach; ?>
<?php echo $content; ?>
<div class="clear"></div>
<div id="footer" class="well" style="text-align: center">
<?php if(!Yii::app()->user->isGuest): ?>
Currently logged in as: <i><?php echo Yii::app()->user->getState('loggedInUser');?></i> Current date: <?php echo date('Y-m-d @ H:i:s')?>
<br />
<?php endif;?>
Copyright © <?php echo date('Y'); ?> by <?php echo Yii::app()->params['owner'] ?>
All Rights Reserved.<br/>
<?php //echo Yii::powered(); ?>
</div><!-- footer -->
</div><!-- page -->