Commit fb34f642daecc16bf81971069b441d411ddba6b9
1 parent
ad1eb341
Make the view layout less dependent on specific pixel sizes, and use
divs in place of merely table rows for some cases. git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2985 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
40 additions
and
31 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc
| ... | ... | @@ -428,7 +428,7 @@ function displayViewButton($oDocument, $bEdit) { |
| 428 | 428 | if ($default->useTextButtons === false) { |
| 429 | 429 | return "<tr><td align=\"left\"><a onClick=\"alert('$sViewAlert '); return true;\" href=\"" . generateControllerLink("downloadDocument", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/docactions/view.gif\" border=\"0\" title=\"" . _("View the document") . "\"/></a></td></tr>\n"; |
| 430 | 430 | } else { |
| 431 | - return "<tr><td align=\"left\"><a onClick=\"alert('$sViewAlert '); return true;\" href=\"" . generateControllerLink("downloadDocument", "fDocumentID=" . $oDocument->getID()) . "\"><span class=\"button\" title=\"" . _("View the document") . "\">VIEW</span></a></td></tr>\n"; | |
| 431 | + return "<a onClick=\"alert('$sViewAlert '); return true;\" href=\"" . generateControllerLink("downloadDocument", "fDocumentID=" . $oDocument->getID()) . "\"><span class=\"button\" title=\"" . _("View the document") . "\">VIEW</span></a>\n"; | |
| 432 | 432 | } |
| 433 | 433 | } |
| 434 | 434 | |
| ... | ... | @@ -455,12 +455,12 @@ function displayCheckInOutButton($oDocument, $bEdit) { |
| 455 | 455 | if (!$bEdit) { |
| 456 | 456 | $sDisabledText = _("You do not have write access to this document"); |
| 457 | 457 | } |
| 458 | - return "<tr><td align=\"left\">" . displayButton($sAction, $sQueryString, $sImageName, $sDisabledText) . "</td></tr>\n"; | |
| 458 | + return displayButton($sAction, $sQueryString, $sImageName, $sDisabledText); | |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | function displayEmailButton($oDocument) { |
| 462 | 462 | global $default; |
| 463 | - return "<tr><td align=\"left\">" . displayButton("emailDocument", "fDocumentID=" . $oDocument->getID(), "email") . "</td></tr>\n"; | |
| 463 | + return displayButton("emailDocument", "fDocumentID=" . $oDocument->getID(), "email"); | |
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | function displayDeleteButton($oDocument, $bEdit) { |
| ... | ... | @@ -472,12 +472,12 @@ function displayDeleteButton($oDocument, $bEdit) { |
| 472 | 472 | } else { |
| 473 | 473 | $sDisabledText = _("You do not have write access to this document"); |
| 474 | 474 | } |
| 475 | - return "<tr><td align=\"left\">" . displayButton("deleteDocument", $sQueryString, "delete", $sDisabledText) . "</td></tr>\n"; | |
| 475 | + return displayButton("deleteDocument", $sQueryString, "delete", $sDisabledText); | |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | function displayHistoryButton($oDocument) { |
| 479 | 479 | global $default; |
| 480 | - return "<tr><td align=\"left\">" . displayButton("viewHistory", "fDocumentID=" . $oDocument->getID(), "history") . "</td></tr>\n"; | |
| 480 | + return displayButton("viewHistory", "fDocumentID=" . $oDocument->getID(), "history"); | |
| 481 | 481 | } |
| 482 | 482 | function displayMoveButton($oDocument, $bEdit) { |
| 483 | 483 | if ($bEdit) { |
| ... | ... | @@ -493,7 +493,7 @@ function displayMoveButton($oDocument, $bEdit) { |
| 493 | 493 | } else { |
| 494 | 494 | $sDisabledText = _("You do not have write access to this document"); |
| 495 | 495 | } |
| 496 | - return "<tr><td align=\"left\">" . displayButton("moveDocument", $sQueryString, "move", $sDisabledText) . "</td></tr>\n"; | |
| 496 | + return displayButton("moveDocument", $sQueryString, "move", $sDisabledText); | |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | function displaySubscriptionButton($oDocument) { |
| ... | ... | @@ -506,12 +506,12 @@ function displaySubscriptionButton($oDocument) { |
| 506 | 506 | $sAction = "addSubscription"; |
| 507 | 507 | $sImageName = "subscribe"; |
| 508 | 508 | } |
| 509 | - return "<tr><td align=\"left\">" . displayButton($sAction, "fDocumentID=" . $oDocument->getID(), $sImageName) . "</td></tr>\n"; | |
| 509 | + return displayButton($sAction, "fDocumentID=" . $oDocument->getID(), $sImageName); | |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | function displayDiscussionButton($oDocument, $bEdit) { |
| 513 | 513 | global $default; |
| 514 | - return "<tr><td align=\"left\">" . displayButton("viewDiscussion", "fDocumentID=" . $oDocument->getID() . "&fForDiscussion=1", "discussion") . "</td></tr>\n"; | |
| 514 | + return displayButton("viewDiscussion", "fDocumentID=" . $oDocument->getID() . "&fForDiscussion=1", "discussion"); | |
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | function displayArchiveButton($oDocument, $bEdit) { |
| ... | ... | @@ -531,12 +531,12 @@ function displayArchiveButton($oDocument, $bEdit) { |
| 531 | 531 | } else { |
| 532 | 532 | $sDisabledText = _("You do not have write access to this document"); |
| 533 | 533 | } |
| 534 | - return "<tr><td align=\"left\">" . displayButton("archiveDocument", "fDocumentID=" . $oDocument->getID(), "archive", $sDisabledText) . "</td></tr>\n"; | |
| 534 | + return displayButton("archiveDocument", "fDocumentID=" . $oDocument->getID(), "archive", $sDisabledText); | |
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 | function displayDependantDocumentButton($oDocument, $bEdit) { |
| 538 | 538 | global $default; |
| 539 | - return "<td align=\"left\">" . displayButton("createDependantDocument", "fDocumentID=" . $oDocument->getID(), "dependentdoc") . "</td>\n"; | |
| 539 | + return displayButton("createDependantDocument", "fDocumentID=" . $oDocument->getID(), "dependentdoc"); | |
| 540 | 540 | } |
| 541 | 541 | |
| 542 | 542 | function displayPublishButton($oDocument, $bEdit) { |
| ... | ... | @@ -566,7 +566,7 @@ function displayPublishButton($oDocument, $bEdit) { |
| 566 | 566 | $sDisabledText = _("This document has been marked as pending publishing and the web publisher has been notified."); |
| 567 | 567 | } |
| 568 | 568 | } |
| 569 | - return "<tr><td align=\"left\">" . displayButton("viewDocument", "fDocumentID=" . $oDocument->getID() . "&fForPublish=1", "publish", $sDisabledText) . "</td></tr>\n"; | |
| 569 | + return displayButton("viewDocument", "fDocumentID=" . $oDocument->getID() . "&fForPublish=1", "publish", $sDisabledText); | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | /** |
| ... | ... | @@ -590,11 +590,7 @@ function displayActionButtons($oDocument, $bEdit) { |
| 590 | 590 | |
| 591 | 591 | function renderSectionDiv($sDivName, $sHtml) { |
| 592 | 592 | global $default; |
| 593 | - if ($default->bNN4) { | |
| 594 | - return "<div id=\"$sDivName\" style=\"position:absolute;visibility:hidden;left:135px;\">$sHtml</div>"; | |
| 595 | - } else { | |
| 596 | - return "<div id=\"$sDivName\" style=\"position:absolute;visibility:hidden;left:5px;\">$sHtml</div>"; | |
| 597 | - } | |
| 593 | + return "<div id=\"$sDivName\" style=\"visibility:hidden;position:absolute;top:5px;left:5px;\">$sHtml</div>"; | |
| 598 | 594 | } |
| 599 | 595 | |
| 600 | 596 | function renderDocumentSection($sSectionName, $sHeadingText, $bDisplayLink, $iDocumentID) { |
| ... | ... | @@ -603,18 +599,18 @@ function renderDocumentSection($sSectionName, $sHeadingText, $bDisplayLink, $iDo |
| 603 | 599 | } else { |
| 604 | 600 | $sLink = "<a href=\"#\" onClick=\"switchDiv('$sSectionName', 'document');\">$sHeadingText</a>"; |
| 605 | 601 | } |
| 606 | - return "<tr bgcolor=\"" . getColour($iColour) . "\"><td width=\"100%\">$sLink</td></tr>\n"; | |
| 602 | + return '<span style="display:block; background-color:' . getColour($iColour) . '">' . $sLink . '</span>' . "\n"; | |
| 607 | 603 | } |
| 608 | 604 | |
| 609 | 605 | function getPage($oDocument, $bEdit, $sStatusMessage = "") { |
| 610 | 606 | global $default; |
| 611 | 607 | |
| 612 | - $sToRender = "<div id=\"headings\" style=\"position:relative;visibility:visible;top:2px;left:2px;\">"; | |
| 613 | 608 | $sToRender .= renderHeading(_("Document Detail")); |
| 614 | 609 | $sToRender .= renderDocumentPath($oDocument, true) . "\n\n"; |
| 615 | 610 | $sToRender .= "<table cellspacing=\"0\" cellpadding=\"0\" id=\"headingTable\">"; |
| 616 | 611 | $sToRender .= "<tr><td valign=\"top\">"; |
| 617 | 612 | $sToRender .= "<table border=\"0\" width=\"530\">"; |
| 613 | + $sToRender .= "<tr><td>"; | |
| 618 | 614 | |
| 619 | 615 | // if we have a status message, then make the section links refresh to viewDocument with the fShowSection variable |
| 620 | 616 | // ie. effectively removes statusMessage on next click |
| ... | ... | @@ -626,19 +622,18 @@ function getPage($oDocument, $bEdit, $sStatusMessage = "") { |
| 626 | 622 | $sToRender .= renderDocumentSection("archiveSettings", _("Archive Settings"), $bDisplayLink, $oDocument->getID()); |
| 627 | 623 | $sToRender .= renderDocumentSection("documentRouting", _("Document Routing"), $bDisplayLink, $oDocument->getID()); |
| 628 | 624 | $sToRender .= renderDocumentSection("linkedDocuments", _("Linked Documents"), $bDisplayLink, $oDocument->getID()); |
| 629 | - $sToRender .= "</table>"; | |
| 630 | - $sToRender .= "</td><td>"; | |
| 631 | - $sToRender .= "<table cellspacing=\"0\" cellpadding=\"0\">\n"; | |
| 625 | + | |
| 626 | + $sToRender .= "</td></tr>"; | |
| 627 | + $sToRender .= "</table>"; | |
| 628 | + $sToRender .= '</td><td rowspan="2" valign="top">'; | |
| 629 | + $sToRender .= "<table cellspacing=\"0\" cellpadding=\"0\">\n"; | |
| 632 | 630 | $sToRender .= displayActionButtons($oDocument, $bEdit); |
| 633 | - $sToRender .= "</table>\n"; | |
| 631 | + $sToRender .= "</table>\n"; | |
| 634 | 632 | $sToRender .= "</td></tr>"; |
| 635 | - $sToRender .= "</table>"; | |
| 636 | - $sToRender .= "</div>"; | |
| 637 | 633 | |
| 638 | - // ugly netscape hacks | |
| 639 | - if (!$default->bNN4) { | |
| 640 | - $sToRender .= "<div id=\"contentDiv\" style=\"position:relative;visibility:hidden;top:-80px;width:500px;\">"; | |
| 641 | - } | |
| 634 | + $sToRender .= "<tr><td>"; | |
| 635 | + | |
| 636 | + $sToRender .= '<div style="position:relative;">'; | |
| 642 | 637 | $sToRender .= renderSectionDiv("documentData", renderDocumentData($oDocument, $bEdit, $sStatusMessage)); |
| 643 | 638 | $sToRender .= renderSectionDiv("genericMetaData", renderGenericMetaData($oDocument, $bEdit)); |
| 644 | 639 | $sToRender .= renderSectionDiv("typeSpecificMetaData", renderTypeSpecificMetaData($oDocument, $bEdit)); |
| ... | ... | @@ -650,9 +645,23 @@ function getPage($oDocument, $bEdit, $sStatusMessage = "") { |
| 650 | 645 | $sToRender .= renderSectionDiv("documentRouting", renderNonEditableDocumentRouting($oDocument)); |
| 651 | 646 | $sToRender .= renderSectionDiv("linkedDocuments", renderNonEditableLinkedDocuments($oDocument, $bEdit) . renderDependantDocuments($oDocument, $bEdit)); |
| 652 | 647 | } |
| 653 | - if (!$default->bNN4) { | |
| 654 | - $sToRender .= "</div>"; | |
| 655 | - } | |
| 648 | + $sToRender .= "<br />"; | |
| 649 | + $sToRender .= "<br />"; | |
| 650 | + $sToRender .= "<br />"; | |
| 651 | + $sToRender .= "<br />"; | |
| 652 | + $sToRender .= "<br />"; | |
| 653 | + $sToRender .= "<br />"; | |
| 654 | + $sToRender .= "<br />"; | |
| 655 | + $sToRender .= "<br />"; | |
| 656 | + $sToRender .= "<br />"; | |
| 657 | + $sToRender .= "<br />"; | |
| 658 | + $sToRender .= "<br />"; | |
| 659 | + $sToRender .= "<br />"; | |
| 660 | + $sToRender .= "<br />"; | |
| 661 | + $sToRender .= "<br />"; | |
| 662 | + $sToRender .= "</div>"; | |
| 663 | + $sToRender .= "</td></tr>"; | |
| 664 | + $sToRender .= "</table>"; | |
| 656 | 665 | return $sToRender; |
| 657 | 666 | } |
| 658 | 667 | ... | ... |