/**
  * Gets the users assignments.
  * @param boolean whether to display the authorization item type.
  * @return string the assignments markup.
  */
 public function getAssignments($displayType = false)
 {
     $authorizer = Rights::getAuthorizer();
     $assignments = $authorizer->authManager->getAuthAssignments($this->getId());
     $items = $authorizer->authManager->getAuthItemsByNames(array_keys($assignments));
     $items = $authorizer->attachAuthItemBehavior($items);
     $assignedItems = array();
     foreach ($items as $itemName => $item) {
         $itemMarkup = $item->getNameText();
         if ($displayType === true) {
             $itemMarkup .= ' (<span class="type-text">' . Rights::getAuthItemTypeName($item->type) . '</span>)';
         }
         $assignedItems[] = $itemMarkup;
     }
     return implode('<br />', $assignedItems);
 }
 /**
  * Returns the markup for a inherited permission.
  * @param array the parents for this item.
  * @param boolean whether to display the parent item type.
  * @return string the markup.
  */
 public function getInheritedPermissionText($parents, $displayType = false)
 {
     $items = array();
     foreach ($parents as $itemName => $item) {
         $itemMarkup = $item->getNameText();
         if ($displayType === true) {
             $itemMarkup .= ' (' . Rights::getAuthItemTypeName($item->type) . ')';
         }
         $items[] = $itemMarkup;
     }
     return '<span class="inherited-item" title="' . implode('<br />', $items) . '">' . Rights::t('core', 'Inherited') . ' *</span>';
 }
Пример #3
0
<?php $this->breadcrumbs = array(
	'Rights'=>Rights::getBaseUrl(),
	Rights::t('core', 'Create :type', array(':type'=>Rights::getAuthItemTypeName($_GET['type']))),
); ?>

<div class="createAuthItem">

	<h2 style="color:#427FED;border-bottom:2px solid #ff503f;padding: 10px 1%;width: 98%;"><?php echo Rights::t('core', 'Create :type', array(
		':type'=>Rights::getAuthItemTypeName($_GET['type']),
	)); ?></h2>

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

</div>
Пример #4
0
<?php

$this->breadcrumbs = array('Rights' => Rights::getBaseUrl(), Rights::t('core', 'Create :type', array(':type' => Rights::getAuthItemTypeName($_GET['type']))));
$this->title = '<h2>' . Rights::t('core', 'Create :type', array(':type' => Rights::getAuthItemTypeName($_GET['type']))) . '</h2>';
?>

<?php 
echo $this->renderPartial('/_menu', array('list' => array()));
?>

<?php 
$this->renderPartial('/_flash');
?>

<?php 
$this->renderPartial('_form', array('model' => $formModel));
Пример #5
0
<?php

$this->breadcrumbs = array('Rights' => Rights::getBaseUrl(), Rights::getAuthItemTypeNamePlural($model->type) => Rights::getAuthItemRoute($model->type), $model->name);
$this->renderPartial('/_menu');
?>

<div id="updatedAuthItem">

    <h2><?php 
echo Rights::t('core', 'Update :name', array(':name' => $model->name, ':type' => Rights::getAuthItemTypeName($model->type)));
?>
</h2>

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

    <div class="relations span-11 last">

        <h3><?php 
echo Rights::t('core', 'Relations');
?>
</h3>

        <?php 
if ($model->name !== Rights::module()->superuserName) {
    ?>

            <div class="parents">

                <h4><?php 
Пример #6
0
<div class="form span-12 first">

<?php if( $model->scenario==='update' ): ?>

	<h3><?php echo Rights::getAuthItemTypeName($model->type); ?></h3>

<?php endif; ?>
	
<?php $form=$this->beginWidget('CActiveForm'); ?>

	<div class="row">
		<?php echo $form->labelEx($model, 'name'); ?>
		<?php echo $form->textField($model, 'name', array('maxlength'=>255, 'class'=>'text-field')); ?>
		<?php echo $form->error($model, 'name'); ?>
		<p class="hint" style="color:#2793CC">&nbsp;&nbsp;&nbsp;&nbsp;<i class="fa fa-info-circle"></i> <?php echo Rights::t('core', 'Do not change the name unless you know what you are doing.'); ?></p>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model, 'description'); ?>
		<?php echo $form->textField($model, 'description', array('maxlength'=>255, 'class'=>'text-field')); ?>
		<?php echo $form->error($model, 'description'); ?>
		<p class="hint" style="color:#2793CC">&nbsp;&nbsp;&nbsp;&nbsp;<i class="fa fa-info-circle"></i> <?php echo Rights::t('core', 'A descriptive name for this item.'); ?></p>
	</div>

	<?php if( Rights::module()->enableBizRule===true ): ?>

		<div class="row">
			<?php echo $form->labelEx($model, 'bizRule'); ?>
			<?php echo $form->textField($model, 'bizRule', array('maxlength'=>255, 'class'=>'text-field')); ?>
			<?php echo $form->error($model, 'bizRule'); ?>
			<p class="hint"><?php echo Rights::t('core', 'Code that will be executed when performing access checking.'); ?></p>
Пример #7
0
<?php

$this->breadcrumbs = array('Phân quyền' => Rights::getBaseUrl(), Rights::t('core', 'Create :type', array(':type' => Rights::getAuthItemTypeName($_GET['type']))));
?>

<div class="createAuthItem">

	<h2><?php 
echo Rights::t('core', 'Create :type', array(':type' => Rights::getAuthItemTypeName($_GET['type'])));
?>
</h2>

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

</div>
Пример #8
0
<?php

$this->breadcrumbs = array('Rights' => Rights::getBaseUrl(), Rights::t('core', 'Create :type', array(':type' => Rights::getAuthItemTypeName($_GET['type']))));
?>

<div class="createAuthItem">

	<?php 
Yii::app()->controller->pageTitle = Rights::t('core', 'Create :type', array(':type' => Rights::getAuthItemTypeName($_GET['type'])));
?>

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

</div>
Пример #9
0
<?php

$this->breadcrumbs = array('Rights' => Rights::getBaseUrl(), Rights::getAuthItemTypeNamePlural($model->type) => Rights::getAuthItemRoute($model->type), $model->name);
?>

<div id="updatedAuthItem">
        <?php 
$this->beginWidget('MiniForm', array('header' => Rights::t('core', 'Update :name', array(':name' => $model->name, ':type' => Rights::getAuthItemTypeName($model->type)))));
?>
	

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

	<div class="relations span-11 last">

		<h3><?php 
echo Rights::t('core', 'Relations');
?>
</h3>

		<?php 
if ($model->name !== Rights::module()->superuserName) {
    ?>

			<div class="parents">

				<h4><?php 
    echo Rights::t('core', 'Parents');
    ?>
Пример #10
0
<?php

$this->breadcrumbs = array('Rights' => Rights::getBaseUrl(), Rights::t('core', 'Create :type', array(':type' => Rights::getAuthItemTypeName($_GET['type']))));
?>

<div class="createAuthItem">
            <?php 
$this->beginWidget('booster.widgets.TbPanel', array('title' => Rights::getAuthItemTypeName($_GET['type']), 'headerIcon' => 'icon-user '));
?>

	<?php 
$this->renderPartial('_form', array('model' => $formModel));
?>
    <?php 
$this->endContent();
?>
</div>
Пример #11
0
<?php $this->breadcrumbs = array(
	'Rights'=>Rights::getBaseUrl(),
	Rights::getAuthItemTypeNamePlural($model->type)=>Rights::getAuthItemRoute($model->type),
	$model->name,
); ?>

<div id="updatedAuthItem">

	<h2><?php echo Rights::t('core', 'Update :name', array(
		':name'=>$model->name,
		':type'=>Rights::getAuthItemTypeName($model->type),
	)); ?></h2>

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

	<div class="relations span-11 last">

		<h3><?php echo Rights::t('core', 'Relations'); ?></h3>

		<?php if( $model->name!==Rights::module()->superuserName ): ?>

			<div class="parents">

				<h4><?php echo Rights::t('core', 'Parents'); ?></h4>

				<?php $this->widget('zii.widgets.grid.CGridView', array(
					'dataProvider'=>$parentDataProvider,
					'template'=>'{items}',
					'hideHeader'=>true,
					'emptyText'=>Rights::t('core', 'This item has no parents.'),
					'htmlOptions'=>array('class'=>'grid-view parent-table mini'),
Пример #12
0
<?php

$this->breadcrumbs = array('Home' => $this->createUrl('/admin'), 'Права доступа' => Rights::getBaseUrl(), Rights::t('core', 'Create :type', array(':type' => Rights::getAuthItemTypeName($_GET['type']))));
$this->pageHeader = Rights::t('core', 'Create :type', array(':type' => Rights::getAuthItemTypeName($_GET['type'])));
?>

<div class="createAuthItem">
	<?php 
$this->renderPartial('_form', array('model' => $formModel));
?>
</div>
Пример #13
0
<?php

$this->breadcrumbs = array('Rights' => Rights::getBaseUrl(), Rights::t('core', 'Create :type', array(':type' => Rights::getAuthItemTypeName($_GET['type']))));
?>

<div class="createAuthItem">
    <?php 
$this->beginWidget('MiniForm', array('header' => Rights::t('core', 'Create :type', array(':type' => Rights::getAuthItemTypeName($_GET['type'])))));
?>
	

	<?php 
$this->renderPartial('_form', array('model' => $formModel));
?>
    <?php 
$this->endWidget();
?>
</div>
Пример #14
0
<?php

$this->breadcrumbs = array('Home' => $this->createUrl('/admin'), 'Права доступа' => Rights::getBaseUrl(), Rights::getAuthItemTypeNamePlural($model->type) => Rights::getAuthItemRoute($model->type), $model->name);
$this->pageHeader = Rights::t('core', 'Update :name', array(':name' => $model->name, ':type' => Rights::getAuthItemTypeName($model->type)));
$this->sidebarContent = $this->renderPartial('/_menu', null, true);
?>

<div id="rights" class="">
<div id="updatedAuthItem">

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

	<div class="relations padding-all">

		<h3><?php 
echo Rights::t('core', 'Relations');
?>
</h3>

		<?php 
if ($model->name !== Rights::module()->superuserName) {
    ?>

	<div class="form wide">
		<div class="row">
			<label><?php 
    echo Rights::t('core', 'Parents');
    ?>
</label>
Пример #15
0
<?php

$this->breadcrumbs = array('Rights' => Rights::getBaseUrl(), Rights::getAuthItemTypeNamePlural($model->type) => Rights::getAuthItemRoute($model->type), $model->name);
$this->title = '<h2>' . Rights::t('core', 'Update :name', array(':name' => $model->name, ':type' => Rights::getAuthItemTypeName($model->type))) . '</h2>';
?>

<?php 
echo $this->renderPartial('/_menu', array('list' => array()));
?>

<?php 
$this->renderPartial('/_flash');
?>

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

<div class="relations span-11 last">

	<h3>
		<?php 
echo Rights::t('core', 'Relations');
?>
	</h3>

	<?php 
if ($model->name !== Rights::module()->superuserName) {
    ?>

		<?php 
Пример #16
0
<div class="form wide padding-all">

<?php 
if ($model->scenario === 'update') {
    ?>

	<h3><?php 
    echo Rights::getAuthItemTypeName($model->type);
    ?>
</h3>

<?php 
}
?>
	
<?php 
$form = $this->beginWidget('CActiveForm');
?>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'name');
?>
		<?php 
echo $form->textField($model, 'name', array('maxlength' => 255, 'class' => 'text-field'));
?>
		<?php 
echo $form->error($model, 'name');
?>
		<p class="hint"><?php 
echo Rights::t('core', 'Do not change the name unless you know what you are doing.');
Пример #17
0
<?php

$this->breadcrumbs = array('Rights' => Rights::getBaseUrl(), Rights::getAuthItemTypeNamePlural($model->type) => Rights::getAuthItemRoute($model->type), $model->name);
?>

<div id="updatedAuthItem">

	<?php 
Yii::app()->controller->pageTitle = Rights::t('core', 'Update :name', array(':name' => $model->name, ':type' => Rights::getAuthItemTypeName($model->type)));
?>

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

	<div class="relations span-11 last">

		<h3><?php 
echo Rights::t('core', 'Relations');
?>
</h3>

		<?php 
if ($model->name !== Rights::module()->superuserName) {
    ?>

			<div class="parents">

				<h4><?php 
    echo Rights::t('core', 'Parents');
    ?>
Пример #18
0
<?php

$this->breadcrumbs = array('Rights' => Rights::getBaseUrl(), Rights::getAuthItemTypeNamePlural($model->type) => Rights::getAuthItemRoute($model->type), $model->name);
?>

<div id="updatedAuthItem">
            <?php 
$this->beginWidget('booster.widgets.TbPanel', array('title' => Rights::t('core', 'Update :name', array(':name' => $model->name, ':type' => Rights::getAuthItemTypeName($model->type))), 'headerIcon' => 'user'));
?>

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

	<div class="relations span-11 last">

		<h3><?php 
echo Rights::t('core', 'Relations');
?>
</h3>

		<?php 
if ($model->name !== Rights::module()->superuserName) {
    ?>

			<div class="parents">

				<h4><?php 
    echo Rights::t('core', 'Parents');
    ?>
</h4>