admin/functions.php
<?php declare(strict_types=1);
/*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* @copyright {@link https://xoops.org/ XOOPS Project}
* @license {@link https://www.gnu.org/licenses/gpl-2.0.html GNU GPL 2 or later}
* @author XOOPS Development Team
* @param mixed $tablename
* @param mixed $iconname
*/
/**
* Function used to display a menu similar to the launcher on OS X
*
* Enable webmasters to navigate thru the module's features.
* Each time you select an option in the admin panel of the news module, this option is highlighted in this menu
*
* NOTE : Please give credits if you copy this code !
*
* @param string $tablename
* @param string $iconname
* @copyright:: (c) Hervé Thouzard (https://www.herve-thouzard.com)
* @author :: Hervé Thouzard (https://www.herve-thouzard.com) & Dojo Javscript Toolkit
*/
function news_collapsableBar($tablename = '', $iconname = ''): void
{
?>
<script type="text/javascript">
// function goto_URL(object) {
// window.location.href = object.options[object.selectedIndex].value;
// }
//
// function toggle(id) {
// if (document.getElementById) {
// obj = document.getElementById(id);
// }
// if (document.all) {
// obj = document.all[id];
// }
// if (document.layers) {
// obj = document.layers[id];
// }
// if (obj) {
// if (obj.style.display === "none") {
// obj.style.display = "";
// } else {
// obj.style.display = "none";
// }
// }
//
// return false;
// }
//
// var iconClose = new Image();
// iconClose.src = '../images/icons/close12.gif';
// var iconOpen = new Image();
// iconOpen.src = '../images/icons/open12.gif';
//
// function toggleIcon(iconName) {
// if (document.images[iconName].src == window.iconOpen.src) {
// document.images[iconName].src = window.iconClose.src;
// }
// elseif(document.images[iconName].src == window.iconClose.src) {
// document.images[iconName].src = window.iconOpen.src;
// }
//
// return;
// }
//
</script>
<?php
echo "<h4 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('" . $tablename . "'); toggleIcon('" . $iconname . "');\">";
}