Exemplo n.º 1
0
<?php

MParams::setPageLabel(Yii::t('page', 'Delete expense'));
MUserFlash::setTopError(_CHtml::errorSummary($model));
if (!MUserFlash::hasTopSuccess() && !MUserFlash::hasTopInfo() && !MUserFlash::hasTopError()) {
    MUserFlash::setContentInfo(Yii::t('hint', 'Are you sure you want to delete this record? Deleted records may not be restored!'));
}
MUserFlash::setSidebarInfo(Yii::t('hint', 'Required: {authRoles}.', $model->invoiceId >= 1 ? array(1, '{authRoles}' => implode(', ', array(Yii::t('t', User::ADMINISTRATOR_T)))) : array(2, '{authRoles}' => implode(', ', array(Yii::t('t', User::MANAGER_T), Yii::t('t', User::ADMINISTRATOR_T))))));
MLinkList::set('sidebar', array('links' => array(array('text' => Yii::t('link', 'Show expense'), 'url' => array('show', 'id' => $model->id), 'icon' => 'zoomin', 'visible' => Yii::app()->user->checkAccess($this->id . '/show')), array('text' => Yii::t('link', 'Edit expense'), 'url' => array('update', 'id' => $model->id), 'icon' => 'pencil', 'visible' => Yii::app()->user->checkAccess($this->id . '/update', array('model' => $model))), array('text' => Yii::t('link', 'List of expenses'), 'url' => array('list'), 'icon' => 'grip-solid-horizontal', 'visible' => false), array('text' => Yii::t('link', 'Grid of expenses'), 'url' => array('grid'), 'icon' => 'calculator', 'visible' => Yii::app()->user->checkAccess($this->id . '/grid')), array('text' => Yii::t('link', 'Create a new expense'), 'url' => array('create'), 'icon' => 'plus', 'visible' => Yii::app()->user->checkAccess($this->id . '/create')))));
$this->widget('application.components.WContentHeader', array('breadcrumbs' => array(array('text' => Yii::t('link', 'Expenses'), 'url' => array($this->id . '/' . $this->defaultAction), 'active' => false, 'visible' => Yii::app()->user->checkAccess($this->id . '/' . $this->defaultAction)), array('text' => Yii::t('link', 'Expense number "{expenseNumber}"', array('{expenseNumber}' => $model->id)), 'url' => array('show', 'id' => $model->id), 'active' => false, 'visible' => Yii::app()->user->checkAccess($this->id . '/show')), array('url' => array($this->action->id, 'id' => $model->id), 'active' => true))));
?>
<div class="w3-main-form-box ui-widget-content ui-corner-all">

<?php 
echo _CHtml::beginForm('', 'post', array('class' => 'w3-main-form')) . "\n";
?>

<div class="w3-form-row w3-first">
  <div class="w3-form-row-input w3-form-row-2columns w3-center">
    <div class="w3-form-row-text">
      <?php 
echo Yii::t('hint', '{saveButton} or {cancelLink}', array('{saveButton}' => _CHtml::submitButton(Yii::t('link', 'Delete'), array('class' => 'w3-input-button ui-state-default ui-corner-all')), '{cancelLink}' => CHtml::link(Yii::t('link', 'Cancel[form]'), array('show', 'id' => $model->id)))) . "\n";
?>
    </div>
  </div>
  <div class="clear">&nbsp;</div>
</div>

<?php 
echo _CHtml::endForm();
?>
Exemplo n.º 2
0
 /**
  * User flash messages displayed in the 'top' part of the page,
  * between header and the main part.
  */
 public function topSummary()
 {
     if (MUserFlash::hasTopSuccess() || MUserFlash::hasTopInfo() || MUserFlash::hasTopError()) {
         $data = array('success' => MUserFlash::getTopSuccess(), 'info' => MUserFlash::getTopInfo(), 'error' => MUserFlash::getTopError());
         $this->render('wUserFlash/topSummary', $data);
     }
 }