Skip to content

Commit

Permalink
Merge pull request #6 from tekstrand/bootstrap-2
Browse files Browse the repository at this point in the history
Change order of icons, support for bootstrap, closes #2
  • Loading branch information
ramack committed Sep 7, 2019
2 parents f51a80f + 4598486 commit 3a3f169
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 9 deletions.
18 changes: 18 additions & 0 deletions main.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,24 @@
// add button on photos pages
add_event_handler('loc_end_picture', 'easyrotate_add_buttons',
EVENT_HANDLER_PRIORITY_NEUTRAL, $public_file);

// Retrieve the current user theme
$query = 'SELECT theme FROM ' . USER_INFOS_TABLE . ';';
$theme = strtolower(pwg_db_fetch_assoc(pwg_query($query))['theme']);

switch ($theme) {
case 'bootstrap_darkroom':
define('ROTATE_BOOTSTRAP', 1);
break;

case 'bootstrapdefault':
define('ROTATE_BOOTSTRAP', 1);
break;

default:
define('ROTATE_BOOTSTRAP', 0);
break;
}
}

/**
Expand Down
33 changes: 24 additions & 9 deletions template/rotate_buttons.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,28 @@ $(document).ready(function() {
});
{/literal}{/footer_script}

{if ROTATE_BOOTSTRAP == 1}
<li class="nav-item">
<a href="javascript:void(0)" onclick="onEasyRotateClicked(90)" title="{'Rotate counterclockwise'|translate}" class="pwg-state-default pwg-button nav-link" rel="nofollow">
<i class="fas fa-undo fa-fw" aria-hidden="true"></i>
<span class="pwg-button-text">{'EasyRotate'|translate}</span>
</a>
</li>
<li class="nav-item">
<a href="javascript:void(0)" onclick="onEasyRotateClicked(270)" title="{'Rotate clockwise'|translate}" class="pwg-state-default pwg-button nav-link" rel="nofollow">
<i class="fas fa-redo fa-fw" aria-hidden="true"></i>
<span class="pwg-button-text">{'EasyRotate'|translate}</span>
</a>
</li>
{elseif ROTATE_BOOTSTRAP == 0}
<a href="javascript:void(0)" onclick="onEasyRotateClicked(90)" title="{'Rotate counterclockwise'|translate}" class="pwg-state-default pwg-button" rel="nofollow">
<span class="pwg-icon easyrotate-ccw-button"> </span>
<span class="pwg-button-text">{'EasyRotate'|translate}</span>
</a>
<a href="javascript:void(0)" onclick="onEasyRotateClicked(270)" title="{'Rotate clockwise'|translate}" class="pwg-state-default pwg-button" rel="nofollow">
<span class="pwg-icon easyrotate-cw-button"> </span>
<span class="pwg-button-text">{'EasyRotate'|translate}</span>
</a>
{/if}

<a href="javascript:void(0)" onclick="onEasyRotateClicked(270)" title="{'Rotate clockwise'|translate}" class="pwg-state-default pwg-button" rel="nofollow">
<span class="pwg-icon easyrotate-cw-button"> </span>
<span class="pwg-button-text">{'EasyRotate'|translate}</span>
</a>
<a href="javascript:void(0)" onclick="onEasyRotateClicked(90)" title="{'Rotate counterclockwise'|translate}" class="pwg-state-default pwg-button" rel="nofollow">
<span class="pwg-icon easyrotate-ccw-button"> </span>
<span class="pwg-button-text">{'EasyRotate'|translate}</span>
</a>
{/strip}
{/strip}

0 comments on commit 3a3f169

Please sign in to comment.