diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc b/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc index daf6a26..7b80a5a 100644 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc +++ b/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc @@ -384,17 +384,37 @@ function renderDependantDocuments($oDocument, $bEdit) { return $sToRender; } +$aImageNameToLabel = array( + "dependentdoc" => "Link new doc", +); + function displayButton($sAction, $sQueryString, $sImageName, $sDisabledText = "") { global $default; + global $aImageNameToLabel; // the active is active if there is no disabled text $bActive = !strlen($sDisabledText) > 0; - $sImage = "graphicsUrl/widgets/docactions/"; - if ($bActive) { - $sImage .= "$sImageName.gif\""; - } else { - $sImage .= "disabled-$sImageName.gif\" title=\"$sDisabledText\""; - } - $sImage .= "/>"; + if ($default->useTextButtons === false) { + $sImage = "graphicsUrl/widgets/docactions/"; + if ($bActive) { + $sImage .= "$sImageName.gif\""; + } else { + $sImage .= "disabled-$sImageName.gif\" title=\"$sDisabledText\""; + } + $sImage .= "/>"; + } else { + if (array_key_exists($sImageName, $aImageNameToLabel)) { + $sLabel = $aImageNameToLabel[$sImageName]; + } else { + $sLabel = $sImageName; + } + $sLabel = strtoupper($sLabel); + if ($bActive) { + $sClass = "button"; + } else { + $sClass = "disabledbutton"; + } + $sImage = "$sLabel"; + } if ($bActive) { return generateControllerLink($sAction, $sQueryString, $sImage); } else { @@ -405,7 +425,11 @@ function displayButton($sAction, $sQueryString, $sImageName, $sDisabledText = "" function displayViewButton($oDocument, $bEdit) { global $default; $sViewAlert = _("This will download a copy of the document and is not the same as Checking Out a document. Changes to this downloaded file will not be managed in the DMS."); + if ($default->useTextButtons === false) { return "graphicsUrl/widgets/docactions/view.gif\" border=\"0\" title=\"" . _("View the document") . "\"/>\n"; + } else { + return "VIEW\n"; + } } function displayCheckInOutButton($oDocument, $bEdit) { @@ -436,7 +460,7 @@ function displayCheckInOutButton($oDocument, $bEdit) { function displayEmailButton($oDocument) { global $default; - return "graphicsUrl/widgets/docactions/email.gif\" border=\"0\" />\n"; + return "" . displayButton("emailDocument", "fDocumentID=" . $oDocument->getID(), "email") . "\n"; } function displayDeleteButton($oDocument, $bEdit) { @@ -453,7 +477,7 @@ function displayDeleteButton($oDocument, $bEdit) { function displayHistoryButton($oDocument) { global $default; - return "graphicsUrl/widgets/docactions/history.gif\" border=\"0\" />\n"; + return "" . displayButton("viewHistory", "fDocumentID=" . $oDocument->getID(), "history") . "\n"; } function displayMoveButton($oDocument, $bEdit) { if ($bEdit) { @@ -487,7 +511,7 @@ function displaySubscriptionButton($oDocument) { function displayDiscussionButton($oDocument, $bEdit) { global $default; - return "graphicsUrl/widgets/docactions/discussion.gif\" border=\"0\" />\n"; + return "" . displayButton("viewDiscussion", "fDocumentID=" . $oDocument->getID() . "&fForDiscussion=1", "discussion") . "\n"; } function displayArchiveButton($oDocument, $bEdit) { @@ -512,7 +536,7 @@ function displayArchiveButton($oDocument, $bEdit) { function displayDependantDocumentButton($oDocument, $bEdit) { global $default; - return "graphicsUrl/widgets/docactions/dependentdoc.gif\" border=\"0\" />\n"; + return "" . displayButton("createDependantDocument", "fDocumentID=" . $oDocument->getID(), "dependentdoc") . "\n"; } function displayPublishButton($oDocument, $bEdit) {