Skip to content

Commit

Permalink
Fixed issue: Page Header in Create or Import new Label Sets
Browse files Browse the repository at this point in the history
- Added Green Bar.
- Adjusted Save and Close Buttons.
  • Loading branch information
thedirtypanda committed Jun 4, 2021
1 parent 3ceaf6a commit cf648bc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
14 changes: 10 additions & 4 deletions application/controllers/admin/labels.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,18 @@ public function index($sa, $lid = 0)
if ($sa == "newlabelset" && Permission::model()->hasGlobalPermission('labelsets', 'create')) {
$langids = Yii::app()->session['adminlang'];
$tabitem = gT("New label set");
$pageTitle = 'Create or import new label set(s)';
} else {
$tabitem = gT("Edit label set");
$tabitem = gT("Edit label set");
$pageTitle = 'Edit label set';
}

$langidsarray = explode(" ", trim($langids)); // Make an array of it

if (isset($row['lid'])) {
$panecookie = $row['lid'];
$panecookie = $row['lid'];
} else {
$panecookie = 'new';
$panecookie = 'new';
}

$aData['langids'] = $langids;
Expand All @@ -209,12 +211,16 @@ public function index($sa, $lid = 0)
$aViewUrls['editlabel_view'][] = $aData;
}


// Label Bar
$aData['labelbar']['buttons']['delete'] = ($sa != "newlabelset") ? true : false;
$aData['labelbar']['buttons']['edition'] = true;
$aData['labelbar']['savebutton']['form'] = 'labelsetform';
$aData['labelbar']['savebutton']['text'] = gT("Save");
$aData['labelbar']['closebutton']['url'] = Yii::app()->request->getUrlReferrer(Yii::app()->createUrl('admin/labels/sa/view')); // Close button, UrlReferrer

// Green SurveyManagerBar
$aData['pageTitle'] = gT($pageTitle);

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

Expand Down
2 changes: 0 additions & 2 deletions application/views/admin/labels/editlabel_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
</script>

<div class="col-lg-12 list-surveys">
<h3><?php if ($action == "newlabelset") { eT("Create or import new label set(s)");} else {eT("Edit label set"); } ?></h3>
<?=// DO NOT REMOVE This is for automated testing to validate we see that page
viewHelper::getViewTestTag('createLabelSets');?>


<div class="row">
<div class="col-lg-12 content-right">

Expand Down
6 changes: 2 additions & 4 deletions application/views/admin/labels/labelsetsbar_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@

</div>


<!-- Right action buttons -->
<div class="col-lg-6 text-right">

Expand All @@ -102,16 +101,15 @@

<!-- edition action buttons -->
<?php if (isset($labelbar['buttons']['edition'])):?>
<a class="btn btn-success" href="#" role="button" id="save-form-button" data-form-id="<?php echo $labelbar['savebutton']['form']; ?>">
<a class="btn btn-success" href="#" role="button" id="save-form-button" data-form-id="<?php echo $labelbar['savebutton']['form']; ?>" style="margin-top: 10px;">
<span class="fa fa-floppy-o"></span>

<?php echo $labelbar['savebutton']['text'];?>
</a>
<?php endif;?>

<!-- Close -->
<?php if(isset($labelbar['closebutton']['url'])):?>
<a class="btn btn-danger" href="<?php echo $labelbar['closebutton']['url']; ?>" role="button">
<a class="btn btn-danger" href="<?php echo $labelbar['closebutton']['url']; ?>" role="button" style="margin-top: 10px;">
<span class="fa fa-close"></span>
<?php eT("Close");?>
</a>
Expand Down

0 comments on commit cf648bc

Please sign in to comment.