From 45984864d3d5c7525560044925847d5dde28081f Mon Sep 17 00:00:00 2001 From: tekstrand Date: Sat, 7 Sep 2019 08:33:29 -0500 Subject: [PATCH] Change order of icons, support for bootstrap --- main.inc.php | 18 ++++++++++++++++++ template/rotate_buttons.tpl | 33 ++++++++++++++++++++++++--------- 2 files changed, 42 insertions(+), 9 deletions(-) diff --git a/main.inc.php b/main.inc.php index 317479b..9f52c55 100644 --- a/main.inc.php +++ b/main.inc.php @@ -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; + } } /** diff --git a/template/rotate_buttons.tpl b/template/rotate_buttons.tpl index 8cb63a2..c74d869 100644 --- a/template/rotate_buttons.tpl +++ b/template/rotate_buttons.tpl @@ -11,13 +11,28 @@ $(document).ready(function() { }); {/literal}{/footer_script} +{if ROTATE_BOOTSTRAP == 1} + + +{elseif ROTATE_BOOTSTRAP == 0} + + + {'EasyRotate'|translate} + + + + {'EasyRotate'|translate} + +{/if} - - - {'EasyRotate'|translate} - - - - {'EasyRotate'|translate} - -{/strip} \ No newline at end of file +{/strip}