Commit 42d8c58b authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Merge branch 'permission92' into 'master-cakephp'

Permission92

Please accept permission92

See merge request !374
parents 62fcdec4 d8cbd3fa
......@@ -2,8 +2,22 @@
body {
padding-top: 50px;
}
.pagination .current a {
background-color: #EEEEEE;
}
</style>
<script type="text/javascript">
function confirmDelete(msg, link)
{
if (confirm(msg)) {
location.href = link;
} else {
return false;
}
}
</script>
<div style="padding: 15px 15px">
<div class="row"><?php echo $this->element('left_panel'); ?>
<div class="col-md-10"><legend><?php echo __('Realm Attribute List'); ?></legend>
......@@ -16,8 +30,10 @@ body {
<th><a><?php echo __('Value'); ?></a></th>
<th><a><?php echo __('Disabled'); ?></a></th>
<?php
if ($this->Access->check($groupName, 'RealmAttributesEdit') ||
$this->Access->check($groupName, 'RealmAttributesDelete')) {
if (
$this->Access->check($groupName, 'RealmAttributesEdit') ||
$this->Access->check($groupName, 'RealmAttributesDelete')
) {
?>
<th><a><?php echo __('Actions'); ?></a></th>
<?php
......@@ -33,7 +49,7 @@ body {
<tr>
<td><?php echo h($realmAttributes['RealmAttribute']['ID']); ?></td>
<td><?php echo h($realmAttributes['RealmAttribute']['Name']); ?></td>
<td><?php echo h($options[$realmAttributes['RealmAttribute']['Operator']]); ?></td>
<td><?php echo h($realmAttributes['RealmAttribute']['Operator']); ?></td>
<td><?php echo h($realmAttributes['RealmAttribute']['Value']); ?></td>
<td><?php echo (h($realmAttributes['RealmAttribute']['Disabled']) == 1) ? 'true' : 'false'; ?></td>
<td>
......@@ -56,19 +72,30 @@ body {
?>
<?php
if ($this->Access->check($groupName, 'RealmAttributesDelete')) {
echo $this->Html->image(
"/resources/custom/images/silk/icons/table_delete.png",
array(
"alt" => "Delete",
"url" => array(
'controller' => 'realm_attributes',
'action' => 'remove',
$realmAttributes['RealmAttribute']['ID'],
$realmId
),
"title" => "Remove attribute"
)
);
?>
<a href="#" onclick="return confirmDelete(
'Are you sure you want to delete.',
'<?php
echo $this->Html->url(
array(
'controller' => 'realm_attributes',
'action' => 'remove',
$realmAttributes['RealmAttribute']['ID'],
$realmId
)
); ?>'
)">
<?php
echo $this->Html->image(
"/resources/custom/images/silk/icons/table_delete.png",
array(
"alt" => "Delete",
"title" => "Delete attribute"
)
);
?>
</a>
<?php
}
?>
</td>
......@@ -85,26 +112,39 @@ body {
)
);
if ($total > 1) {
echo $this->Paginator->prev(
'<<',
null,
null,
array(
'class' => 'disabled'
)
);
echo $this->Paginator->numbers();
// Shows the next and previous links.
echo $this->Paginator->next(
'>>',
null,
null,
array(
'class' => 'disabled'
)
);
// Prints X of Y, where X is current page and Y is number of pages.
?>
<ul class="pagination">
<?php
if ($this->Paginator->first()) {
echo $this->Paginator->first('First', array('tag' => 'li'), null, null);
} else {
echo '<li class="disabled"><a href="#">First</a></li>';
}
if ($this->Paginator->hasPrev()) {
echo $this->Paginator->prev('&laquo;', array('tag' => 'li', 'escape' => false), null, null);
} else {
echo '<li class="disabled"><a href="#">&laquo;</a></li>';
}
echo $this->Paginator->numbers(array('separator' => false, 'tag' => 'li', 'currentTag' => 'a'));
if ($this->Paginator->hasNext()) {
echo $this->Paginator->next('&raquo;', array('tag' => 'li', 'escape' => false), null, null);
} else {
echo '<li class="disabled"><a href="#">&raquo;</a></li>';
}
if ($this->Paginator->last()) {
echo $this->Paginator->last('Last', array('tag' => 'li'), null, null);
} else {
echo '<li class="disabled"><a href="#">Last</a></li>';
}
echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
?>
</ul>
<?php
}
?>
</td>
......@@ -115,7 +155,7 @@ body {
<?php
if ($this->Access->check($groupName, 'RealmAttributesAdd')) {
echo $this->Html->link(
__('Add'),
'Add',
array(
'action' => 'add',
$realmId
......@@ -128,7 +168,7 @@ body {
?>
<?php
echo $this->Html->link(
__('Cancel'),
'Cancel',
array(
'controller' => 'realms',
'action' => 'index'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment