Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Players #869

Open
wants to merge 12 commits into
base: development
Choose a base branch
from
2 changes: 2 additions & 0 deletions dev-ops/local.team-opencaching.de/actions/find-old.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
lines=`grep -R --exclude-dir=htdocs/vendor --exclude-dir=htdocs/app/Resources/translations --exclude-dir=htdocs/var/cache2/smarty/compiled --exclude-dir=htdocs/var/cache2/smarty/cache -n --color=always __SEARCH__ htdocs/*` && count=`echo " $lines" | wc -l` && echo "\033[0;31mFound $count occurrences:\033[0m" && echo "\033[0m$lines"
35 changes: 27 additions & 8 deletions htdocs/lang/de/ocstyle/main.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,18 @@ function flashbutton(bname)
document.getElementsByName(bname)[0].className = "formbutton_active";
window.setTimeout('resetbutton(\'' + bname + '\')', 350);
}

function toggleMenu(divid) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here I would like if we use one way of writing names which is already used.

var divnode = document.getElementById(divid);
divnode.style.display = divnode.style.display == 'none' ? 'block' : 'none';
localStorage.setItem('opencaching.menu.' + divid, divnode.style.display);
}

function initMenu(divid) {
var display = localStorage.getItem('opencaching.menu.' + divid);
var divnode = document.getElementById(divid);
divnode.style.display = display ? display : 'none';
}
//-->
</script>
<link rel="stylesheet" type="text/css" media="print" href="resource2/{style}/css/style_print.css?ft={print_css_time}" />
Expand Down Expand Up @@ -252,8 +264,8 @@ function flashbutton(bname)
}
?>
<!-- Länderknoten -->
<p class="sidebar-maintitle">{t}Country sites{/t}</p>
<div style="text-align: center;" class="nodeflags">
<p class="sidebar-maintitle" style="cursor: pointer;" onclick="javascript:toggleMenu('countriesdiv');">{t}Country sites{/t} &gt;</p>
<div style="text-align: center; display: none;" class="nodeflags" id="countriesdiv">
<a href="http://www.opencaching.cz" target="_blank"><img src="resource2/ocstyle/images/nodes/oc-cz.png" width="100" height="22" /></a><br />
<a href="https://www.opencaching.de" target="_blank"><img src="resource2/ocstyle/images/nodes/oc-de.png" width="100" height="22" /></a><br />
<a href="http://www.opencaching.nl" target="_blank"><img src="resource2/ocstyle/images/nodes/oc-nl.png" width="100" height="22" /></a><br />
Expand All @@ -262,18 +274,20 @@ function flashbutton(bname)
<a href="https://opencache.uk" target="_blank"><img src="resource2/ocstyle/images/nodes/oc-org-uk.png" width="100" height="22" /></a><br />
<a href="http://www.opencaching.us" target="_blank"><img src="resource2/ocstyle/images/nodes/oc-us.png" width="100" height="22" /></a>
</div>
<script>initMenu('countriesdiv')</script>

<!-- Paypalbutton -->
<?php
if (isset($opt['page']['showdonations']) && $opt['page']['showdonations']) {
?>
<p class="sidebar-maintitle">{t}Donations{/t}</p>
<div style="margin-top:16px;width:100%;text-align:center;">
<p class="sidebar-maintitle" style="cursor: pointer;" onclick="javascript:toggleMenu('donodiv');">{t}Donations{/t} &gt;</p>
<div style="margin-top:16px;width:100%;text-align:center; display: none;" id="donodiv">
<a href="articles.php?page=donations">
<img src="resource2/ocstyle/images/misc/donate.gif" alt="{t}Donations{/t}" style="border:0px;" />
</a><br />
&nbsp;
</div>
<script>initMenu('donodiv')</script>
<?php

}
Expand All @@ -283,8 +297,8 @@ function flashbutton(bname)
<?php
if (isset($opt['page']['showsocialmedia']) && $opt['page']['showsocialmedia']) {
?>
<p class="sidebar-maintitle">{t}Social media{/t}</p>
<div style="margin-top: 10px; margin-bottom: 14px; margin-left: auto; margin-right: auto; text-align: center">
<p class="sidebar-maintitle" style="cursor: pointer;" onclick="javascript:toggleMenu('socialdiv');">{t}Social media{/t} &gt;</p>
<div style="margin-top: 10px; margin-bottom: 14px; margin-left: auto; margin-right: auto; text-align: center; display: none;" id="socialdiv">
<table style="margin-left: auto; margin-right: auto;">
<tr>
<td class="mediumsmalltext">{t}Follow us:{/t}</td>
Expand Down Expand Up @@ -333,16 +347,21 @@ function flashbutton(bname)
</tr>
</table>
</div>
<script>initMenu('socialdiv')</script>
<?php

}
?>

<!-- Datalicense -->
{license_disclaimer}
<p class="sidebar-maintitle" style="cursor: pointer;" onclick="javascript:toggleMenu('licensediv');">{t}Datalicense{/t} &gt;</p>
<div style="margin:20px 0 16px 0; width:100%; text-align:center; display: none;" id="licensediv">
{license_disclaimer}
</div>
<script>initMenu('licensediv')</script>

<!-- page statistics -->
<div class="sidebar-txtbox-noshade">
<div class="sidebar-txtbox-noshade" style="position: absolute; bottom: 50px;">
<p class="content-txtbox-noshade-size5">
<small>
{t}Page performance:{/t} {scripttime} {t}sec{/t}<br />
Expand Down
4 changes: 1 addition & 3 deletions htdocs/lib/common.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,7 @@ function tpl_BuildTemplate($dbDisconnect = true): void
$ltext = mb_ereg_replace('%1', $lurl, $ltext);
$ltext = mb_ereg_replace('{site}', $opt['page']['sitename'], $ltext);

$ld = '<p class="sidebar-maintitle">' . $translate->t('Datalicense', '', '', 0) . '</p>' .
'<div style="margin:20px 0 16px 0; width:100%; text-align:center;">' . $ltext . '</div>';
tpl_set_var('license_disclaimer', $ld);
tpl_set_var('license_disclaimer', $ltext);
} else {
tpl_set_var('license_disclaimer', '');
}
Expand Down
34 changes: 25 additions & 9 deletions htdocs/templates2/ocstyle/sys_main.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,18 @@
window.setTimeout('resetbutton(\'' + bname + '\')', 350);
}

function toggleMenu(divid) {
var divnode = document.getElementById(divid);
divnode.style.display = divnode.style.display == 'none' ? 'block' : 'none';
localStorage.setItem('opencaching.menu.' + divid, divnode.style.display);
}

function initMenu(divid) {
var display = localStorage.getItem('opencaching.menu.' + divid);
var divnode = document.getElementById(divid);
divnode.style.display = display ? display : 'none';
}

var img1 = new Image();
img1.src = "resource2/ocstyle/images/page/nav2-bg.png";
var img2 = new Image();
Expand Down Expand Up @@ -266,8 +278,8 @@
{/nocache}
</ul>

<p class="sidebar-maintitle">{t}Country sites{/t}</p>
<div style="text-align: center;" class="nodeflags">
<p class="sidebar-maintitle" style="cursor: pointer;" onclick="javascript:toggleMenu('countriesdiv');">{t}Country sites{/t} &gt;</p>
<div style="text-align: center; display: none;" class="nodeflags" id="countriesdiv">
<a href="https://www.opencaching.cz" target="_blank"><img
src="resource2/{$opt.template.style}/images/nodes/oc-cz.png" width="100"
height="22"/></a><br/>
Expand All @@ -292,23 +304,25 @@
<a href="https://www.opencaching.us" target="_blank"><img
src="resource2/{$opt.template.style}/images/nodes/oc-us.png" width="100" height="22"/></a>
</div>
<script>initMenu('countriesdiv')</script>

{* <!-- Paypalbutton --> *}
{if $opt.page.showdonations}
<p class="sidebar-maintitle">{t}Donations{/t}</p>
<div style="margin-top:16px; width:100%; text-align:center;">
<p class="sidebar-maintitle" style="cursor: pointer;" onclick="javascript:toggleMenu('donodiv');">{t}Donations{/t} &gt;</p>
<div style="margin-top:16px; width:100%; text-align:center; display: none;" id="donodiv">
<a href="articles.php?page=donations">
<img src="resource2/{$opt.template.style}/images/misc/donate.gif" alt="{t}Donations{/t}"
style="border:0px;"/>
</a><br/>
&nbsp;
</div>
<script>initMenu('donodiv')</script>
{/if}

{* <!-- Social Media --> *}
{if $opt.page.showsocialmedia}
<p class="sidebar-maintitle">{t}Social media{/t}</p>
<div style="margin-top: 10px; margin-bottom: 14px; margin-left: auto; margin-right: auto; text-align: center">
<p class="sidebar-maintitle" style="cursor: pointer;" onclick="javascript:toggleMenu('socialdiv');">{t}Social media{/t} &gt;</p>
<div style="margin-top: 10px; margin-bottom: 14px; margin-left: auto; margin-right: auto; text-align: center; display: none;" id="socialdiv">
<table style="margin-left: auto; margin-right: auto;">
<tr>
<td class="mediumsmalltext" colspan="3">{t}Follow us:{/t}</td>
Expand Down Expand Up @@ -396,18 +410,20 @@
</tr>
</table>
</div>
<script>initMenu('socialdiv')</script>
{/if}


{if $license_disclaimer != ""}
<!-- Datalicense -->
<p class="sidebar-maintitle">{t}Datalicense{/t}</p>
<div style="margin:20px 0 16px 0; width:100%; text-align:center;">
<p class="sidebar-maintitle" style="cursor: pointer;" onclick="javascript:toggleMenu('licensediv');">{t}Datalicense{/t} &gt;</p>
<div style="margin:20px 0 16px 0; width:100%; text-align:center; display: none;" id="licensediv">
{$license_disclaimer}
</div>
<script>initMenu('licensediv')</script>
{/if}

<div class="sidebar-txtbox-noshade">
<div class="sidebar-txtbox-noshade" style="position: absolute; bottom: 50px;">
<p class="content-txtbox-noshade-size5">
<small>
{nocache}
Expand Down
Loading