allow to hide all tools

This commit is contained in:
Roland Gruber 2012-08-13 17:43:48 +00:00
parent 1d8988114b
commit 78e54bb324
11 changed files with 25 additions and 6 deletions

View File

@ -697,7 +697,8 @@ class lamList {
echo "<button id=\"delButton\" name=\"del\">" . $this->labels['deleteEntry'] . "</button>\n";
}
$type = new $this->type();
if ($type->supportsFileUpload()) {
$toolSettings = $_SESSION['config']->getToolSettings();
if ($type->supportsFileUpload() && !(isset($toolSettings['tool_hide_toolFileUpload']) && ($toolSettings['tool_hide_toolFileUpload'] == 'true'))) {
echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
echo "<button id=\"fileUploadButton\" name=\"fileUpload\">" . _('File upload') . "</button>\n";
}

View File

@ -123,7 +123,7 @@ class toolFileUpload implements LAMTool {
* @return boolean hideable
*/
function isHideable() {
return false;
return true;
}
}

View File

@ -123,7 +123,7 @@ class toolPDFEditor implements LAMTool {
* @return boolean hideable
*/
function isHideable() {
return false;
return true;
}
}

View File

@ -123,7 +123,7 @@ class toolProfileEditor implements LAMTool {
* @return boolean hideable
*/
function isHideable() {
return false;
return true;
}
}

View File

@ -249,8 +249,11 @@ class lamDHCPList extends lamList {
if (!$createOnly) {
echo ("<button id=\"delButton\" name=\"del\">" . $this->labels['deleteEntry'] . "</button>\n");
}
$toolSettings = $_SESSION['config']->getToolSettings();
if (!(isset($toolSettings['tool_hide_toolFileUpload']) && ($toolSettings['tool_hide_toolFileUpload'] == 'true'))) {
echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
echo "<button id=\"fileUploadButton\" name=\"fileUpload\">" . _('File upload') . "</button>\n";
}
echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
echo ("<button id=\"dhcpDefaultsButton\" name=\"dhcpDefaults\">" . $this->labels['dhcpDefaults'] . "</button>\n");
echo "&nbsp;&nbsp;&nbsp;";

View File

@ -131,6 +131,7 @@ foreach ($toSort as $key => $value) {
</li>
<?php
}
if (sizeof($tools) > 0) {
?>
<li>
<a href="<?php echo $headerPrefix; ?>tools.php"><img height="16" width="16" alt="tools" src="<?php echo $headerPrefix; ?>../graphics/tools.png">&nbsp;<?php echo _("Tools") ?></a>
@ -160,6 +161,7 @@ foreach ($toSort as $key => $value) {
</ul>
</li>
<?php
}
if ($_SESSION['config']->get_Suffix('tree') != "") {
?>
<li>

View File

@ -41,6 +41,9 @@ include_once('../lib/modules.inc');
// Start session
startSecureSession();
// check if this tool may be run
checkIfToolIsActive('toolFileUpload');
// die if no write access
if (!checkIfWriteAccessIsAllowed()) die();

View File

@ -45,6 +45,9 @@ include_once('../lib/pdf.inc');
// Start session
startSecureSession();
// check if this tool may be run
checkIfToolIsActive('toolFileUpload');
// die if no write access
if (!checkIfWriteAccessIsAllowed()) die();

View File

@ -43,6 +43,9 @@ include_once('../lib/pdfstruct.inc');
// Start session
startSecureSession();
// check if this tool may be run
checkIfToolIsActive('toolFileUpload');
// die if no write access
if (!checkIfWriteAccessIsAllowed()) die();

View File

@ -51,6 +51,8 @@ startSecureSession();
// die if no write access
if (!checkIfWriteAccessIsAllowed()) die();
checkIfToolIsActive('toolPDFEditor');
setlanguage();
// check if user is logged in, if not go to login

View File

@ -47,6 +47,8 @@ startSecureSession();
// die if no write access
if (!checkIfWriteAccessIsAllowed()) die();
checkIfToolIsActive('toolProfileEditor');
setlanguage();
// check if user is logged in, if not go to login