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,7 +428,7 @@ function displayViewButton($oDocument, $bEdit) { | ||
| 428 | if ($default->useTextButtons === false) { | 428 | if ($default->useTextButtons === false) { |
| 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"; | 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 | } else { | 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,12 +455,12 @@ function displayCheckInOutButton($oDocument, $bEdit) { | ||
| 455 | if (!$bEdit) { | 455 | if (!$bEdit) { |
| 456 | $sDisabledText = _("You do not have write access to this document"); | 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 | function displayEmailButton($oDocument) { | 461 | function displayEmailButton($oDocument) { |
| 462 | global $default; | 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 | function displayDeleteButton($oDocument, $bEdit) { | 466 | function displayDeleteButton($oDocument, $bEdit) { |
| @@ -472,12 +472,12 @@ function displayDeleteButton($oDocument, $bEdit) { | @@ -472,12 +472,12 @@ function displayDeleteButton($oDocument, $bEdit) { | ||
| 472 | } else { | 472 | } else { |
| 473 | $sDisabledText = _("You do not have write access to this document"); | 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 | function displayHistoryButton($oDocument) { | 478 | function displayHistoryButton($oDocument) { |
| 479 | global $default; | 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 | function displayMoveButton($oDocument, $bEdit) { | 482 | function displayMoveButton($oDocument, $bEdit) { |
| 483 | if ($bEdit) { | 483 | if ($bEdit) { |
| @@ -493,7 +493,7 @@ function displayMoveButton($oDocument, $bEdit) { | @@ -493,7 +493,7 @@ function displayMoveButton($oDocument, $bEdit) { | ||
| 493 | } else { | 493 | } else { |
| 494 | $sDisabledText = _("You do not have write access to this document"); | 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 | function displaySubscriptionButton($oDocument) { | 499 | function displaySubscriptionButton($oDocument) { |
| @@ -506,12 +506,12 @@ function displaySubscriptionButton($oDocument) { | @@ -506,12 +506,12 @@ function displaySubscriptionButton($oDocument) { | ||
| 506 | $sAction = "addSubscription"; | 506 | $sAction = "addSubscription"; |
| 507 | $sImageName = "subscribe"; | 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 | function displayDiscussionButton($oDocument, $bEdit) { | 512 | function displayDiscussionButton($oDocument, $bEdit) { |
| 513 | global $default; | 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 | function displayArchiveButton($oDocument, $bEdit) { | 517 | function displayArchiveButton($oDocument, $bEdit) { |
| @@ -531,12 +531,12 @@ function displayArchiveButton($oDocument, $bEdit) { | @@ -531,12 +531,12 @@ function displayArchiveButton($oDocument, $bEdit) { | ||
| 531 | } else { | 531 | } else { |
| 532 | $sDisabledText = _("You do not have write access to this document"); | 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 | function displayDependantDocumentButton($oDocument, $bEdit) { | 537 | function displayDependantDocumentButton($oDocument, $bEdit) { |
| 538 | global $default; | 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 | function displayPublishButton($oDocument, $bEdit) { | 542 | function displayPublishButton($oDocument, $bEdit) { |
| @@ -566,7 +566,7 @@ function displayPublishButton($oDocument, $bEdit) { | @@ -566,7 +566,7 @@ function displayPublishButton($oDocument, $bEdit) { | ||
| 566 | $sDisabledText = _("This document has been marked as pending publishing and the web publisher has been notified."); | 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,11 +590,7 @@ function displayActionButtons($oDocument, $bEdit) { | ||
| 590 | 590 | ||
| 591 | function renderSectionDiv($sDivName, $sHtml) { | 591 | function renderSectionDiv($sDivName, $sHtml) { |
| 592 | global $default; | 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 | function renderDocumentSection($sSectionName, $sHeadingText, $bDisplayLink, $iDocumentID) { | 596 | function renderDocumentSection($sSectionName, $sHeadingText, $bDisplayLink, $iDocumentID) { |
| @@ -603,18 +599,18 @@ function renderDocumentSection($sSectionName, $sHeadingText, $bDisplayLink, $iDo | @@ -603,18 +599,18 @@ function renderDocumentSection($sSectionName, $sHeadingText, $bDisplayLink, $iDo | ||
| 603 | } else { | 599 | } else { |
| 604 | $sLink = "<a href=\"#\" onClick=\"switchDiv('$sSectionName', 'document');\">$sHeadingText</a>"; | 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 | function getPage($oDocument, $bEdit, $sStatusMessage = "") { | 605 | function getPage($oDocument, $bEdit, $sStatusMessage = "") { |
| 610 | global $default; | 606 | global $default; |
| 611 | 607 | ||
| 612 | - $sToRender = "<div id=\"headings\" style=\"position:relative;visibility:visible;top:2px;left:2px;\">"; | ||
| 613 | $sToRender .= renderHeading(_("Document Detail")); | 608 | $sToRender .= renderHeading(_("Document Detail")); |
| 614 | $sToRender .= renderDocumentPath($oDocument, true) . "\n\n"; | 609 | $sToRender .= renderDocumentPath($oDocument, true) . "\n\n"; |
| 615 | $sToRender .= "<table cellspacing=\"0\" cellpadding=\"0\" id=\"headingTable\">"; | 610 | $sToRender .= "<table cellspacing=\"0\" cellpadding=\"0\" id=\"headingTable\">"; |
| 616 | $sToRender .= "<tr><td valign=\"top\">"; | 611 | $sToRender .= "<tr><td valign=\"top\">"; |
| 617 | $sToRender .= "<table border=\"0\" width=\"530\">"; | 612 | $sToRender .= "<table border=\"0\" width=\"530\">"; |
| 613 | + $sToRender .= "<tr><td>"; | ||
| 618 | 614 | ||
| 619 | // if we have a status message, then make the section links refresh to viewDocument with the fShowSection variable | 615 | // if we have a status message, then make the section links refresh to viewDocument with the fShowSection variable |
| 620 | // ie. effectively removes statusMessage on next click | 616 | // ie. effectively removes statusMessage on next click |
| @@ -626,19 +622,18 @@ function getPage($oDocument, $bEdit, $sStatusMessage = "") { | @@ -626,19 +622,18 @@ function getPage($oDocument, $bEdit, $sStatusMessage = "") { | ||
| 626 | $sToRender .= renderDocumentSection("archiveSettings", _("Archive Settings"), $bDisplayLink, $oDocument->getID()); | 622 | $sToRender .= renderDocumentSection("archiveSettings", _("Archive Settings"), $bDisplayLink, $oDocument->getID()); |
| 627 | $sToRender .= renderDocumentSection("documentRouting", _("Document Routing"), $bDisplayLink, $oDocument->getID()); | 623 | $sToRender .= renderDocumentSection("documentRouting", _("Document Routing"), $bDisplayLink, $oDocument->getID()); |
| 628 | $sToRender .= renderDocumentSection("linkedDocuments", _("Linked Documents"), $bDisplayLink, $oDocument->getID()); | 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 | $sToRender .= displayActionButtons($oDocument, $bEdit); | 630 | $sToRender .= displayActionButtons($oDocument, $bEdit); |
| 633 | - $sToRender .= "</table>\n"; | 631 | + $sToRender .= "</table>\n"; |
| 634 | $sToRender .= "</td></tr>"; | 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 | $sToRender .= renderSectionDiv("documentData", renderDocumentData($oDocument, $bEdit, $sStatusMessage)); | 637 | $sToRender .= renderSectionDiv("documentData", renderDocumentData($oDocument, $bEdit, $sStatusMessage)); |
| 643 | $sToRender .= renderSectionDiv("genericMetaData", renderGenericMetaData($oDocument, $bEdit)); | 638 | $sToRender .= renderSectionDiv("genericMetaData", renderGenericMetaData($oDocument, $bEdit)); |
| 644 | $sToRender .= renderSectionDiv("typeSpecificMetaData", renderTypeSpecificMetaData($oDocument, $bEdit)); | 639 | $sToRender .= renderSectionDiv("typeSpecificMetaData", renderTypeSpecificMetaData($oDocument, $bEdit)); |
| @@ -650,9 +645,23 @@ function getPage($oDocument, $bEdit, $sStatusMessage = "") { | @@ -650,9 +645,23 @@ function getPage($oDocument, $bEdit, $sStatusMessage = "") { | ||
| 650 | $sToRender .= renderSectionDiv("documentRouting", renderNonEditableDocumentRouting($oDocument)); | 645 | $sToRender .= renderSectionDiv("documentRouting", renderNonEditableDocumentRouting($oDocument)); |
| 651 | $sToRender .= renderSectionDiv("linkedDocuments", renderNonEditableLinkedDocuments($oDocument, $bEdit) . renderDependantDocuments($oDocument, $bEdit)); | 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 | return $sToRender; | 665 | return $sToRender; |
| 657 | } | 666 | } |
| 658 | 667 |