Skip to content

Commit

Permalink
Dev: Applied Button Changes and Moved Quick Add to left (label sets l…
Browse files Browse the repository at this point in the history
…ist)
  • Loading branch information
thedirtypanda committed Jul 14, 2021
1 parent 16bc4db commit f1fbad6
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 21 deletions.
12 changes: 11 additions & 1 deletion application/controllers/admin/labels.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,19 @@ function ($mixed, $item) {
$aData['labelbar']['buttons']['view'] = true;
} else {
$aData['labelbar']['buttons']['delete'] = true;

// Save Button
$aData['labelbar']['savebutton']['form'] = 'mainform';
$aData['labelbar']['savebutton']['text'] = gT("Save");
$aData['labelbar']['closebutton']['url'] = Yii::app()->request->getUrlReferrer(Yii::app()->createUrl('admin/labels/sa/view'));

// Save and Close Button
$aData['labelbar']['saveandclosebutton']['form'] = 'mainform';
$aData['labelbar']['saveandclosebutton']['text'] = gT('Save and Close');

// White Close Button
$aData['labelbar']['white_closebutton']['url'] = Yii::app()->request->getUrlReferrer(Yii::app()->createUrl('admin/labels/sa/view'));;
$aData['labelbar']['white_closebutton']['text'] = gT('Close');

$aData['labelbar']['buttons']['edition'] = true;

$aData['labelbar']['buttons']['edit'] = true;
Expand Down
6 changes: 2 additions & 4 deletions application/views/admin/labels/_labelviewtabcontent_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,15 @@ class="btn btn-default btn-sm htmleditor--openmodal"
</tbody>
</table>


<div class="action-buttons">
<!-- Action Buttons Quick Add and Save Changes -->
<div class="action-buttons text-left">
<?php $i++;
if (Permission::model()->hasGlobalPermission('labelsets','update'))
{ ?>
<button type="button" id='btnquickadd_<?php echo $i ?>' class="btnquickadd btn btn-default " data-toggle="modal" data-target="#quickadd">
<?php eT('Quick add...') ?>
</button>
<?php }; ?>
<input type='submit' class="btn btn-success" name='method' value='<?php eT("Save changes") ?>' id='saveallbtn_<?php echo $lslanguage ?>' />
</div>
</div>
<?php $first=false;
endforeach;?>
Expand Down
45 changes: 29 additions & 16 deletions application/views/admin/labels/labelsetsbar_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,7 @@
</span>
<?php endif; ?>
<?php endif; ?>
<!-- view action buttons-->

<!-- 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']; ?>"
style="margin: 10px 0 10px 0;">
<span class="fa fa-floppy-o"></span>
<?php echo $labelbar['savebutton']['text'];?>
</a>

<?php endif;?>
<!-- view action buttons-->

<?php if (isset($labelbar['buttons']['return'])):?>

Expand All @@ -130,6 +115,34 @@
</a>
<?php endif;?>

<!-- White Close button -->
<?php if (isset($labelbar['white_closebutton']['url'])) :?>
<a class="btn btn-default" href="<?php echo $labelbar['white_closebutton']['url']; ?>" role="button">
<span class="fa fa-close"></span>
<?php eT("Close");?>
</a>
<?php endif;?>

<!-- Save and Close -->
<?php if(isset($labelbar['saveandclosebutton']['form'])):?>
<a class="btn btn-default" href="#" role="button" id="save-and-close-form-button" onclick="$(this).addClass('disabled').attr('onclick', 'return false;');" data-form-id="<?php echo $labelbar['saveandclosebutton']['form']; ?>">
<span class="fa fa-saved"></span>
<?php eT("Save and close");?>
</a>
<?php endif; ?>

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

0 comments on commit f1fbad6

Please sign in to comment.