/**
  * Renders the data cell content.
  * @param integer $row the row number (zero-based).
  * @param mixed $data the data associated with the row.
  */
 protected function renderDataCellContent($row, $data)
 {
     /* @var $am CAuthManager|AuthBehavior */
     $am = Yii::app()->getAuthManager();
     if ($am->hasParent($this->itemName, $data['name'])) {
         echo BsHtml::linkButton(BsHtml::icon(BsHtml::GLYPHICON_REMOVE), array('color' => BsHtml::BUTTON_COLOR_LINK, 'size' => BsHtml::BUTTON_SIZE_MINI, 'url' => array('removeParent', 'itemName' => $this->itemName, 'parentName' => $data['name']), 'rel' => 'tooltip', 'title' => Yii::t('AuthModule.main', 'Remove')));
     } else {
         if ($am->hasChild($this->itemName, $data['name'])) {
             echo BsHtml::linkButton(BsHtml::icon(BsHtml::GLYPHICON_REMOVE), array('color' => BsHtml::BUTTON_COLOR_LINK, 'size' => BsHtml::BUTTON_SIZE_MINI, 'url' => array('removeChild', 'itemName' => $this->itemName, 'childName' => $data['name']), 'rel' => 'tooltip', 'title' => Yii::t('AuthModule.main', 'Remove')));
         }
     }
 }
Exemplo n.º 2
0
<?php

$this->breadcrumbs[] = 'Добавление пользователя';
?>
    
    
<?php 
$this->beginWidget('bootstrap.widgets.BsPanel', array('title' => $this->navigation));
?>

    <div class="buttons_for_panel">
        <?php 
echo BsHtml::linkButton('Вернуться к списку пользователей', array('icon' => BsHtml::GLYPHICON_BACKWARD, 'color' => BsHtml::BUTTON_COLOR_DEFAULT, 'url' => array('index')));
?>
    </div>

    <?php 
$this->renderPartial('_form', array('model' => $model));
?>

<?php 
$this->endWidget();
 /**
  * Renders the data cell content.
  * @param integer $row the row number (zero-based).
  * @param mixed $data the data associated with the row.
  */
 protected function renderDataCellContent($row, $data)
 {
     if (!Yii::app()->user->isAdmin) {
         echo BsHtml::linkButton(BsHtml::icon(BsHtml::GLYPHICON_EYE_OPEN), array('color' => BsHtml::BUTTON_COLOR_LINK, 'size' => BsHtml::BUTTON_SIZE_MINI, 'url' => array('view', 'id' => $data->{$this->idColumn}), 'htmlOptions' => array('rel' => 'tooltip', 'title' => Yii::t('AuthModule.main', 'View'))));
     }
 }
 /**
  * Renders the data cell content.
  * @param integer $row the row number (zero-based).
  * @param mixed $data the data associated with the row.
  */
 protected function renderDataCellContent($row, $data)
 {
     if ($this->userId !== null) {
         echo BsHtml::linkButton(BsHtml::icon(BsHtml::GLYPHICON_REMOVE), array('color' => BsHtml::BUTTON_COLOR_LINK, 'size' => BsHtml::BUTTON_SIZE_MINI, 'url' => array('revoke', 'itemName' => $data['name'], 'userId' => $this->userId), 'rel' => 'tooltip', 'title' => Yii::t('AuthModule.main', 'Revoke')));
     }
 }
Exemplo n.º 5
0
<?php

$this->breadcrumbs[] = 'Список записей';
?>
    
    
<?php 
$this->beginWidget('bootstrap.widgets.BsPanel', array('title' => $this->navigation));
?>

    <div class="buttons_for_panel">
        <?php 
echo BsHtml::linkButton('Добавить запись', array('icon' => BsHtml::GLYPHICON_PLUS, 'color' => BsHtml::BUTTON_COLOR_SUCCESS, 'url' => array('create')));
?>
    </div>

    <?php 
$this->widget('bootstrap.widgets.BsGridView', array('id' => 'user-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'type' => BsHtml::GRID_TYPE_HOVER, 'template' => '{summary}{items}{pager}', 'pager' => array('class' => 'bootstrap.widgets.BsPager', 'size' => BsHtml::PAGINATION_SIZE_DEFAULT), 'nullDisplay' => '-', 'selectableRows' => 0, 'columns' => array('id', array('name' => 'date_create', 'value' => 'Yii::app()->dateFormatter->format("dd MMMM yyyy, HH:mm", $data->date_create)', 'filter' => false), 'login', array('name' => 'role', 'value' => '$data->_role', 'filter' => $model::$roles), 'name', array('header' => '', 'value' => '' . 'BsHtml::linkButton("", array("url"=>array("delete", "id"=>$data->id), "size"=>BsHtml::BUTTON_SIZE_SMALL, "data-toggle"=>"tooltip", "title"=>"Удалить", "icon"=>BsHtml::GLYPHICON_TRASH, "color"=>BsHtml::BUTTON_COLOR_DEFAULT, "onclick"=>"if ( !confirm(\'Действительно удалить?\') ) return false;"))." ".' . 'BsHtml::linkButton("", array("url"=>array("update", "id"=>$data->id), "size"=>BsHtml::BUTTON_SIZE_SMALL, "data-toggle"=>"tooltip", "title"=>"Изменить", "icon"=>BsHtml::GLYPHICON_PENCIL, "color"=>BsHtml::BUTTON_COLOR_WARNING))." ".' . 'BsHtml::linkButton("", array("url"=>array("view", "id"=>$data->id), "size"=>BsHtml::BUTTON_SIZE_SMALL, "data-toggle"=>"tooltip", "title"=>"Обзор", "icon"=>BsHtml::GLYPHICON_EYE_OPEN, "color"=>BsHtml::BUTTON_COLOR_INFO))', 'htmlOptions' => array('class' => 'myActions'), 'type' => 'raw'))));
?>
    
    
<?php 
$this->endWidget();
Exemplo n.º 6
0
<?php

$this->breadcrumbs[] = 'Обзор пользователя №' . $model->id;
?>
    
<?php 
$this->beginWidget('bootstrap.widgets.BsPanel', array('title' => $this->navigation));
?>
       

    <div class="buttons_for_panel">
        <?php 
echo BsHtml::linkButton('Вернуться к списку пользователей', array('icon' => BsHtml::GLYPHICON_BACKWARD, 'color' => BsHtml::BUTTON_COLOR_DEFAULT, 'url' => array('index')));
?>
        <?php 
echo BsHtml::linkButton('Удалить пользователя', array('icon' => BsHtml::GLYPHICON_TRASH, 'color' => BsHtml::BUTTON_COLOR_DANGER, 'url' => array('delete', 'id' => $model->id), 'onclick' => 'if ( !confirm(\'Действительно удалить?\') ) return false;'));
?>
        <?php 
echo BsHtml::linkButton('Изменить пользователя', array('icon' => BsHtml::GLYPHICON_PENCIL, 'color' => BsHtml::BUTTON_COLOR_WARNING, 'url' => array('update', 'id' => $model->id)));
?>
    </div>

    <?php 
$this->widget('bootstrap.widgets.BsDetailView', array('data' => $model, 'attributes' => array('id', array('name' => 'date_create', 'value' => Yii::app()->dateFormatter->format('dd MMMM yyyy, HH:mm', $model->date_create)), 'login', array('name' => 'role', 'value' => $model->_role), 'name', 'time_rest_day1', 'time_rest_day2', 'time_rest_day3', 'time_rest_day4', 'time_rest_day5', 'time_rest_day6', 'time_rest_day7', 'time_work_day1', 'time_work_day2', 'time_work_day3', 'time_work_day4', 'time_work_day5', 'time_work_day6', 'time_work_day7')));
?>
    
<?php 
$this->endWidget();
Exemplo n.º 7
0
/* @var $model AuthItemForm */
/* @var $form BsActiveForm */
$this->breadcrumbs = array($this->capitalize($this->getTypeText(true)) => array('index'), Yii::t('AuthModule.main', 'New {type}', array('{type}' => $this->getTypeText())));
?>

    <h1><?php 
echo Yii::t('AuthModule.main', 'New {type}', array('{type}' => $this->getTypeText()));
?>
</h1>

<?php 
$form = $this->beginWidget('bootstrap.widgets.BsActiveForm', array('layout' => BsHtml::FORM_LAYOUT_HORIZONTAL));
?>

<?php 
echo $form->hiddenField($model, 'type');
echo $form->textFieldControlGroup($model, 'name');
echo $form->textFieldControlGroup($model, 'description');
?>

    <div class="form-actions">
        <?php 
echo BsHtml::submitButton(Yii::t('AuthModule.main', 'Create'), array('color' => BsHtml::BUTTON_COLOR_PRIMARY));
?>
        <?php 
echo BsHtml::linkButton(Yii::t('AuthModule.main', 'Cancel'), array('color' => BsHtml::BUTTON_COLOR_LINK, 'url' => array('index')));
?>
    </div>

<?php 
$this->endWidget();
Exemplo n.º 8
0
<h1>
    <?php 
echo CHtml::encode($item->description);
?>
    <small><?php 
echo $this->getTypeText();
?>
</small>
</h1>

<?php 
$form = $this->beginWidget('bootstrap.widgets.BsActiveForm', array('layout' => BsHtml::FORM_LAYOUT_HORIZONTAL));
?>

<?php 
echo $form->hiddenField($model, 'type');
echo $form->textFieldControlGroup($model, 'name', array('disabled' => true, 'title' => Yii::t('AuthModule.main', 'System name cannot be changed after creation.')));
echo $form->textFieldControlGroup($model, 'description');
?>

    <div class="form-actions">
        <?php 
echo BsHtml::submitButton(Yii::t('AuthModule.main', 'Save'), array('color' => BsHtml::BUTTON_COLOR_PRIMARY));
?>
        <?php 
echo BsHtml::linkButton(Yii::t('AuthModule.main', 'Cancel'), array('color' => BsHtml::BUTTON_COLOR_LINK, 'url' => array('view', 'name' => $item->name)));
?>
    </div>

<?php 
$this->endWidget();
Exemplo n.º 9
0
<?php

/* @var $this OperationController|TaskController|RoleController */
/* @var $dataProvider AuthItemDataProvider */
$this->breadcrumbs = array($this->capitalize($this->getTypeText(true)));
?>

<h1><?php 
echo $this->capitalize($this->getTypeText(true));
?>
</h1>

<?php 
echo BsHtml::linkButton(Yii::t('AuthModule.main', 'Add {type}', array('{type}' => $this->getTypeText())), array('color' => BsHtml::BUTTON_COLOR_PRIMARY, 'url' => array('create')));
?>

<?php 
$this->widget('bootstrap.widgets.BsGridView', array('type' => 'striped hover', 'dataProvider' => $dataProvider, 'emptyText' => Yii::t('AuthModule.main', 'No {type} found.', array('{type}' => $this->getTypeText(true))), 'template' => "{items}\n{pager}", 'columns' => array(array('name' => 'name', 'type' => 'raw', 'header' => Yii::t('AuthModule.main', 'System name'), 'htmlOptions' => array('class' => 'item-name-column'), 'value' => "CHtml::link(\$data->name, array('view', 'name'=>\$data->name))"), array('name' => 'description', 'header' => Yii::t('AuthModule.main', 'Description'), 'htmlOptions' => array('class' => 'item-description-column')), array('class' => 'bootstrap.widgets.BsButtonColumn', 'viewButtonLabel' => Yii::t('AuthModule.main', 'View'), 'viewButtonUrl' => "Yii::app()->controller->createUrl('view', array('name'=>\$data->name))", 'updateButtonLabel' => Yii::t('AuthModule.main', 'Edit'), 'updateButtonUrl' => "Yii::app()->controller->createUrl('update', array('name'=>\$data->name))", 'deleteButtonLabel' => Yii::t('AuthModule.main', 'Delete'), 'deleteButtonUrl' => "Yii::app()->controller->createUrl('delete', array('name'=>\$data->name))", 'deleteConfirmation' => Yii::t('AuthModule.main', 'Are you sure you want to delete this item?')))));
Exemplo n.º 10
0
                </div>
                <div class="col-xs-6">
                    <div class="checkbox aw_check">
                        <input type="checkbox" id="hasPhoto" name="hasPhoto">
                        <label for="hasPhoto">
                            С фото
                        </label>
                    </div>
                </div>
            </div>
        </div>
        <div class="sf_el">

        </div>
        <!--div class="sf_el text-right">
            <?php 
echo BsHtml::link('Подробный поиск', '#', array('onclick' => 'return false;'));
?>
        </div-->
    </div>
</div>

<?php 
echo BsHtml::linkButton('Найти', array('color' => BsHtml::BUTTON_COLOR_SUCCESS, 'block' => true, 'icon' => BsHtml::GLYPHICON_SEARCH, 'url' => '#', 'onclick' => 'return false;', 'id' => 'sa_submit'));
?>

<div class="add_search_area">
    <?php 
echo BsHtml::link('Подробный поиск', '#', array('onclick' => 'return false;'));
?>
</div>
Exemplo n.º 11
0
<?php

$this->breadcrumbs[] = 'Изменение пользователя №' . $model->id;
?>
    
    
<?php 
$this->beginWidget('bootstrap.widgets.BsPanel', array('title' => $this->navigation));
?>

    <div class="buttons_for_panel">
        <?php 
echo BsHtml::linkButton('Вернуться к списку пользователей', array('icon' => BsHtml::GLYPHICON_BACKWARD, 'color' => BsHtml::BUTTON_COLOR_DEFAULT, 'url' => array('index')));
?>
        
        <?php 
echo BsHtml::linkButton('Удалить пользователя', array('icon' => BsHtml::GLYPHICON_TRASH, 'color' => BsHtml::BUTTON_COLOR_DANGER, 'url' => array('delete', 'id' => $model->id), 'onclick' => 'if ( !confirm(\'Действительно удалить?\') ) return false;'));
?>
        
        <?php 
echo BsHtml::linkButton('Обзор пользователя', array('icon' => BsHtml::GLYPHICON_EYE_OPEN, 'color' => BsHtml::BUTTON_COLOR_INFO, 'url' => array('view', 'id' => $model->id)));
?>
        
    </div>

    <?php 
$this->renderPartial('_form', array('model' => $model));
?>

<?php 
$this->endWidget();
Exemplo n.º 12
0
 public static function linkButton($label = 'Submit', $url = '#', $htmlOptions = array())
 {
     $btn = BsHtml::linkButton($label, $htmlOptions);
     $btn = str_replace('"#"', '"' . $url . '"', $btn);
     return $btn;
 }