Skip to content

Commit

Permalink
Fixed issue: Page Header in Manage Label Sets
Browse files Browse the repository at this point in the history
- Added Green Bar.
- Adjusted Action Buttons.
- Renamed 'Return to Admin Home' Button to 'Back'.
  • Loading branch information
thedirtypanda committed Jun 4, 2021
1 parent 9bbdc5e commit 3ceaf6a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
9 changes: 5 additions & 4 deletions application/controllers/admin/labels.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public function index($sa, $lid = 0)
* @param int $lid
* @return void
*/
public function view($lid = 0)
public function view(int $lid = 0)
{
if (!Permission::model()->hasGlobalPermission('labelsets', 'read')) {
Yii::app()->session['flashmessage'] = gT('Access denied!');
Expand All @@ -248,8 +248,7 @@ public function view($lid = 0)
$model = LabelSet::model()->findByPk($lid);
// If there is label id in the variable $lid and there are labelset records in the database
$labelset_exists = $model !== null;



if ($lid > 0 && $labelset_exists) {
// Now recieve all labelset information and display it
$aData['lid'] = $lid;
Expand All @@ -273,7 +272,6 @@ function ($mixed, $item) {
0
);


Yii::app()->loadHelper("surveytranslator");
$results = $model->labels;
$aViewUrls['labelview_view'][] = array(
Expand Down Expand Up @@ -312,6 +310,9 @@ function ($mixed, $item) {
Yii::app()->user->setState('pageSize', (int) $_GET['pageSize']);
}

// Green SurveyManagerBar Page Title
$aData['pageTitle'] = 'Label sets list';

$this->_renderWrappedTemplate('labels', $aViewUrls, $aData);
}

Expand Down
1 change: 0 additions & 1 deletion application/views/admin/labels/labelsets_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
?>
<?php $pageSize=Yii::app()->user->getState('pageSize',Yii::app()->params['defaultPageSize']);?>
<div class="col-lg-12">
<div class="pagetitle h3"><?php eT('Label sets list'); ?></div>

<div class="row">
<div class="col-lg-12 content-right">
Expand Down
12 changes: 6 additions & 6 deletions application/views/admin/labels/labelsetsbar_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@
<!-- View buttons -->
<?php if (isset($labelbar['buttons']['view'])):?>
<?php if (Permission::model()->hasGlobalPermission('labelsets','create') || Permission::model()->hasGlobalPermission('labelsets','import')):?>
<!-- Add -->
<a class="btn btn-default" href="<?php echo $this->createUrl("admin/labels/sa/newlabelset");?>" role="button">
<!-- Create or Import -->
<a class="btn btn-default" href="<?php echo $this->createUrl("admin/labels/sa/newlabelset");?>" role="button" style="margin-top: 10px;">
<span class="icon-add text-success"></span>
<?php eT("Create or import new label set(s)"); ?>
</a>
<?php endif; ?>
<!-- Export Multiple -->
<?php if ( count($labelsets) > 0 ): ?>
<?php if (Permission::model()->hasGlobalPermission('labelsets','export')):?>
<a class="btn btn-default" href="<?php echo $this->createUrl("admin/labels/sa/exportmulti");?>" role="button">
<a class="btn btn-default" href="<?php echo $this->createUrl("admin/labels/sa/exportmulti");?>" role="button" style="margin-top: 10px;">
<span class="icon-export text-success"></span>
<?php eT("Export multiple label sets"); ?>
</a>
<?php endif; ?>
<?php else:?>
<?php if (Permission::model()->hasGlobalPermission('labelsets','export')):?>
<span title="<?php eT("No label sets available"); ?>" data-toggle="tooltip" data-placement="bottom" style="display: inline-block">
<a class="btn btn-default disabled" role="button" >
<a class="btn btn-default disabled" role="button" style="margin-top: 10px;">
<span class="icon-export text-success"></span>
<?php eT("Export multiple label sets"); ?>
</a>
Expand Down Expand Up @@ -92,10 +92,10 @@
<?php if (isset($labelbar['buttons']['view'])):?>

<!-- return to admin panel -->
<a class="btn btn-default pull-right" href="<?php echo $this->createUrl('admin/index'); ?>" role="button" style="display: block">
<a class="btn btn-default pull-right" href="<?php echo $this->createUrl('admin/index'); ?>" role="button" style="display: block; margin-top: 10px;">
<span class="fa fa-backward"></span>
&nbsp;&nbsp;
<?php eT('Return to admin home'); ?>
<?php eT('Back'); ?>
</a>

<?php endif; ?>
Expand Down

0 comments on commit 3ceaf6a

Please sign in to comment.