Commit 76543999c0c3d6fb20eb48079e4477ede7d51244
1 parent
9e97723b
No more users of PatternMainPage remaining.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4327 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
0 additions
and
373 deletions
lib/visualpatterns/PatternMainPage.inc deleted
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * $Id$ | |
| 4 | - * | |
| 5 | - * Main page of the document management system. Consists of a 2 x 2 HTML table. | |
| 6 | - * Custom defined payloads can be placed in each of the table cells, giving a reasonable | |
| 7 | - * amount of layout/design flexibility | |
| 8 | - * | |
| 9 | - * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com | |
| 10 | - * | |
| 11 | - * This program is free software; you can redistribute it and/or modify | |
| 12 | - * it under the terms of the GNU General Public License as published by | |
| 13 | - * the Free Software Foundation; either version 2 of the License, or | |
| 14 | - * (at your option) any later version. | |
| 15 | - * | |
| 16 | - * This program is distributed in the hope that it will be useful, | |
| 17 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | - * GNU General Public License for more details. | |
| 20 | - * | |
| 21 | - * You should have received a copy of the GNU General Public License | |
| 22 | - * along with this program; if not, write to the Free Software | |
| 23 | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 | - * | |
| 25 | - * @version $Revision$ | |
| 26 | - * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa | |
| 27 | - * @package lib.visualpatterns | |
| 28 | - */ | |
| 29 | -class PatternMainPage { | |
| 30 | - | |
| 31 | - /** property holder for $oNorthWestPayload */ | |
| 32 | - var $oNorthWestPayload; | |
| 33 | - /** bg colour **/ | |
| 34 | - var $sNorthWestPayloadBackGroundColour; | |
| 35 | - | |
| 36 | - /** property holder for $oWestPayload */ | |
| 37 | - var $oWestPayload; | |
| 38 | - /** bg colour **/ | |
| 39 | - var $sWestPayloadBackGroundColour; | |
| 40 | - | |
| 41 | - /** property holder for $oEastPayload */ | |
| 42 | - var $oCentralPayload; | |
| 43 | - /** bg colour **/ | |
| 44 | - var $sCentralPayloadBackGroundColour; | |
| 45 | - | |
| 46 | - /** property holder for $oNorthPayload */ | |
| 47 | - var $oNorthPayload; | |
| 48 | - /** bg colour **/ | |
| 49 | - var $sNorthPayloadBackGroundColour; | |
| 50 | - | |
| 51 | - /** form action*/ | |
| 52 | - var $sFormAction; | |
| 53 | - /** form enctype */ | |
| 54 | - var $sFormEncType; | |
| 55 | - /** form submit method */ | |
| 56 | - var $sSubmitMethod = "POST"; | |
| 57 | - /** whether the form has fields that require javascript checking */ | |
| 58 | - var $bHasRequiredFields = false; | |
| 59 | - /** default page error message */ | |
| 60 | - var $sErrorMessage = array(); | |
| 61 | - | |
| 62 | - var $sHelpContext = "browse"; | |
| 63 | - /** javascript to execute on body load **/ | |
| 64 | - var $onLoadJavaScript; | |
| 65 | - /** more javascript */ | |
| 66 | - var $additionalJavaScript; | |
| 67 | - /** whether or not to use dhtml scrolling **/ | |
| 68 | - var $bScroll; | |
| 69 | - var $aBreadcrumbs = array(); | |
| 70 | - | |
| 71 | - var $bFormDisabled = false; | |
| 72 | - | |
| 73 | - | |
| 74 | - function PatternMainPage() { | |
| 75 | - global $default; | |
| 76 | - $this->sFormAction = "$default->rootUrl/control.php"; | |
| 77 | - $this->bScroll = $default->contentPaneScrolling; | |
| 78 | - } | |
| 79 | - | |
| 80 | - function setNorthWestPayload($oNewVal) { | |
| 81 | - $this->oNorthWestPayload = & $oNewVal; | |
| 82 | - } | |
| 83 | - | |
| 84 | - function setNorthWestPayloadBackGroundColour($sColour) { | |
| 85 | - $this->sNorthWestPayloadBackGroundColour = $sColour; | |
| 86 | - } | |
| 87 | - | |
| 88 | - function setNorthPayload($oNewVal) { | |
| 89 | - $this->oNorthPayload = & $oNewVal; | |
| 90 | - } | |
| 91 | - | |
| 92 | - function setNorthPayloadBackGroundColour($sColour) { | |
| 93 | - $this->sNorthPayloadBackGroundColour = $sColour; | |
| 94 | - } | |
| 95 | - | |
| 96 | - function setCentralPayload($oNewVal) { | |
| 97 | - $this->oCentralPayload = & $oNewVal; | |
| 98 | - } | |
| 99 | - | |
| 100 | - function setCentralPayloadBackGroundColour($sColour) { | |
| 101 | - $this->sCentralPayloadBackGroundColour = $sColour; | |
| 102 | - } | |
| 103 | - | |
| 104 | - function setWestPayload($oNewVal) { | |
| 105 | - $this->oWestPayload = & $oNewVal; | |
| 106 | - } | |
| 107 | - | |
| 108 | - function setWestPayloadBackGroundColour($sColour) { | |
| 109 | - $this->sWestPayloadBackGroundColour = $sColour; | |
| 110 | - } | |
| 111 | - | |
| 112 | - function getFormAction() { | |
| 113 | - return $this->sFormAction; | |
| 114 | - } | |
| 115 | - | |
| 116 | - function setFormAction($sNewVal) { | |
| 117 | - $this->sFormAction = & $sNewVal; | |
| 118 | - } | |
| 119 | - | |
| 120 | - function setErrorMessage($sNewValue) { | |
| 121 | - $this->sErrorMessage[] = $sNewValue; | |
| 122 | - } | |
| 123 | - | |
| 124 | - function setFormEncType($sNewValue) { | |
| 125 | - $this->sFormEncType = $sNewValue; | |
| 126 | - } | |
| 127 | - | |
| 128 | - function setHasRequiredFields($bNewValue) { | |
| 129 | - $this->bHasRequiredFields = $bNewValue; | |
| 130 | - } | |
| 131 | - | |
| 132 | - function setHelpContext($sNewValue) { | |
| 133 | - $this->sHelpContext = $sNewValue; | |
| 134 | - } | |
| 135 | - | |
| 136 | - function setOnLoadJavaScript($sJavaScript) { | |
| 137 | - $this->onLoadJavaScript = $sJavaScript; | |
| 138 | - } | |
| 139 | - function getOnLoadJavaScript() { | |
| 140 | - return $this->onLoadJavaScript; | |
| 141 | - } | |
| 142 | - | |
| 143 | - function setDHTMLScrolling($sNewValue) { | |
| 144 | - $this->bScroll = $sNewValue; | |
| 145 | - } | |
| 146 | - | |
| 147 | - function setSubmitMethod($sNewValue) { | |
| 148 | - $this->sSubmitMethod = $sNewValue; | |
| 149 | - } | |
| 150 | - | |
| 151 | - function setBreadcrumbs($aNewValue) { | |
| 152 | - $this->aBreadcrumbs = $aNewValue; | |
| 153 | - } | |
| 154 | - | |
| 155 | - /** | |
| 156 | - * Render the page in HTML | |
| 157 | - */ | |
| 158 | - function render() { | |
| 159 | - global $default; | |
| 160 | - require_once(KT_LIB_DIR . "/templating/templating.inc.php"); | |
| 161 | - | |
| 162 | - $oTemplating = KTTemplating::getSingleton(); | |
| 163 | - $oTemplate = $oTemplating->loadTemplate("ktcore/standard_page"); | |
| 164 | - | |
| 165 | - $aTemplateData = array( | |
| 166 | - "sessiontimeout" => $default->sessionTimeout+3, | |
| 167 | - "javascript" => PatternMainPage::getJavaScript(), | |
| 168 | - "treeicon" => "$default->graphicsUrl/tree.ico", | |
| 169 | - "jsfiles" => array( | |
| 170 | - "$default->uiUrl/js/datePicker.js", | |
| 171 | - "$default->uiUrl/js/misc.js", | |
| 172 | - "$default->uiUrl/js/divSwitch.js", | |
| 173 | - "$default->uiUrl/js/OptionTransfer.js", | |
| 174 | - ), | |
| 175 | - "stylesheet" => "$default->uiUrl/stylesheet.php", | |
| 176 | - "onloadjavascript" => $this->onLoadJavaScript, | |
| 177 | - "formdisabled" => $this->bFormDisabled, | |
| 178 | - "formaction" => $this->sFormAction, | |
| 179 | - "formenctype" => $this->sFormEncType, | |
| 180 | - "formsubmitmethod" => $this->sSubmitMethod, | |
| 181 | - "hasrequiredfields" => $this->bHasRequiredFields, | |
| 182 | - "pageheight" => $default->pageHeight, | |
| 183 | - "nwbgcolour" => $this->sNorthWestPayloadBackGroundColour, | |
| 184 | - "nwpayload" => $this->oNorthWestPayload, | |
| 185 | - "nbgcolour" => $this->sNorthPayloadBackGroundColour, | |
| 186 | - "npayload" => $this->oNorthPayload, | |
| 187 | - "wbgcolour" => $this->sWestPayloadBackGroundColour, | |
| 188 | - "wpayload" => $this->oWestPayload, | |
| 189 | - "cbgcolour" => $this->sCentralPayloadBackGroundColour, | |
| 190 | - "cpayload" => $this->oCentralPayload, | |
| 191 | - "errormessages" => $this->sErrorMessage, | |
| 192 | - "kterrormessages" => $_SESSION['KTErrorMessage'], | |
| 193 | - "breadcrumbs" => $this->aBreadcrumbs, | |
| 194 | - ); | |
| 195 | - | |
| 196 | - $aTopMenuWords = array( | |
| 197 | - _("Dashboard"), | |
| 198 | - _("Browse Collections"), | |
| 199 | - _("Advanced Search"), | |
| 200 | - _("Admin"), | |
| 201 | - _("Preferences"), | |
| 202 | - _("Logout"), | |
| 203 | - ); | |
| 204 | - | |
| 205 | - $aTopMenuLinks = array(generateControllerUrl("dashboard"), | |
| 206 | - generateControllerUrl($default->siteMap->getDefaultAction("Manage Documents")), | |
| 207 | - generateControllerUrl($default->siteMap->getDefaultAction("Advanced Search")), | |
| 208 | - generateControllerUrl($default->siteMap->getDefaultAction("Administration")), | |
| 209 | - generateControllerUrl($default->siteMap->getDefaultAction("Preferences")), | |
| 210 | - generateControllerUrl($default->siteMap->getDefaultAction("Logout"))); | |
| 211 | - | |
| 212 | - $aTemplateData["navbar"] = array_combine($aTopMenuWords, $aTopMenuLinks); | |
| 213 | - | |
| 214 | - $_SESSION['KTErrorMessage'] = array(); | |
| 215 | - | |
| 216 | - $sToRender = $oTemplate->render($aTemplateData); | |
| 217 | - echo $sToRender; | |
| 218 | - } | |
| 219 | - | |
| 220 | - /** | |
| 221 | - * Returns links to javascript that has 3 functions: | |
| 222 | - * o validateString - validates a string | |
| 223 | - * o validateNumber - validates a number | |
| 224 | - * o setActionAndSubmit - sets the MainForm action to newAction and submits | |
| 225 | - * And includes the dhtml text scrolling routine | |
| 226 | - */ | |
| 227 | - function getJavaScript() { | |
| 228 | - global $default; | |
| 229 | - $sUrl = $default->uiUrl; | |
| 230 | - $sJavaScript .= $this->getHelpJavaScript(); | |
| 231 | - $sJavaScript .= $this->getAdditionalJavaScript(); | |
| 232 | - return $sJavaScript; | |
| 233 | - } | |
| 234 | - | |
| 235 | - function getHelpJavaScript() { | |
| 236 | - global $default; | |
| 237 | - return "\n\n<SCRIPT LANGUAGE=\"javascript\">\n " . | |
| 238 | - "<!--\n" . | |
| 239 | - "function helpWindow() {\n" . | |
| 240 | - "window.open ('" . generateControllerUrl("help", "fAction=" . urlencode($default->siteMap->getActionFromPage((substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))))) . "&fSection=" . urlencode($default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))))) . "', 'newwindow', config='height=400,width=600,left=400,top=300, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, directories=no, status=no');\n" . | |
| 241 | - "return false;\n" . | |
| 242 | - "}\n" . | |
| 243 | - "//-->\n" . | |
| 244 | - "</SCRIPT>\n\n"; | |
| 245 | - } | |
| 246 | - | |
| 247 | - function setAdditionalJavaScript($sJavaScript) { | |
| 248 | - $this->additionalJavaScript = $sJavaScript; | |
| 249 | - } | |
| 250 | - function getAdditionalJavaScript() { | |
| 251 | - return $this->additionalJavaScript; | |
| 252 | - } | |
| 253 | -} | |
| 254 | -?> |
templates/ktcore/standard_page.smarty deleted
| 1 | -<html> | |
| 2 | - <head> | |
| 3 | - <title>The KnowledgeTree</title> | |
| 4 | - <meta http-equiv="refresh" content="{$sessiontimeout};"> | |
| 5 | - <link rel="SHORTCUT ICON" href="{$treeicon}"> | |
| 6 | - <link rel="stylesheet" href="{$stylesheet}"> | |
| 7 | - | |
| 8 | - { foreach from="$jsfiles" item="jsfile" } | |
| 9 | - <script type="text/javascript" src="{$jsfile}"></script> | |
| 10 | - { /foreach } | |
| 11 | - {$javascript} | |
| 12 | - </head> | |
| 13 | - { if $onloadjavascript } | |
| 14 | - { assign var="onloadjavascript" value="onload=\"$onloadjavascript\"" } | |
| 15 | - { /if } | |
| 16 | - <body marginleft="0" marginheight="0" {$onloadjavascript}> | |
| 17 | - | |
| 18 | - <input type="hidden" name="kt-core-baseurl" id="kt-core-baseurl" value="{$config->get("KnowledgeTree/rootUrl")}" /> | |
| 19 | - | |
| 20 | - { if ! $formdisabled } | |
| 21 | - { if $formenctype } | |
| 22 | - { assign var="formenctype" value="enctype=\"$formenctype\"" } | |
| 23 | - { /if } | |
| 24 | - { if $hasrequiredfields } | |
| 25 | - { assign var="onsubmit" value="onsubmit=\"return validateForm(this)\"" } | |
| 26 | - { /if } | |
| 27 | - <form name="MainForm" {$formenctype} action="{$formaction}" method="{$formsubmitmethod}" {$onsubmit}> | |
| 28 | - { /if } | |
| 29 | - | |
| 30 | - <table cellpadding="0" cellspacing="0" border="0" width="700" height="{$pageheight}"> | |
| 31 | - <tr> | |
| 32 | - { if $nwbgcolour } | |
| 33 | - { assign var="nwbgcolour" value="bgcolor=\"$nwbgcolour\"" } | |
| 34 | - { /if } | |
| 35 | - <td height="0" valign="top" {$nwbgcolour}> | |
| 36 | - { if $nwpayload } | |
| 37 | - { $nwpayload->render() } | |
| 38 | - { else } | |
| 39 | - Northwest payload not set | |
| 40 | - { /if } | |
| 41 | - </td> | |
| 42 | - | |
| 43 | - { if $nbgcolour } | |
| 44 | - { assign var="nbgcolour" value="bgcolor=\"$nbgcolour\"" } | |
| 45 | - { /if } | |
| 46 | - <td valign="top" align="left" {$nbgcolour}> | |
| 47 | - { if $npayload } | |
| 48 | - { $npayload->render() } | |
| 49 | - { else } | |
| 50 | - North payload not set | |
| 51 | - { /if } | |
| 52 | - </td> | |
| 53 | - </tr> | |
| 54 | - | |
| 55 | - <tr> | |
| 56 | - { if $wbgcolour } | |
| 57 | - { assign var="wbgcolour" value="bgcolor=\"$wbgcolour\"" } | |
| 58 | - { /if } | |
| 59 | - <td height="100%" valign="top" {$wbgcolour}> | |
| 60 | - { if $wpayload } | |
| 61 | - { $wpayload->render() } | |
| 62 | - { else } | |
| 63 | - West payload not set | |
| 64 | - { /if } | |
| 65 | - </td> | |
| 66 | - | |
| 67 | - { if $cbgcolour } | |
| 68 | - { assign var="cbgcolour" value="bgcolor=\"$cbgcolour\"" } | |
| 69 | - { /if } | |
| 70 | - <td valign="top" {$cbgcolour}> | |
| 71 | - { if $breadcrumbs} | |
| 72 | - <p class="breadcrumbs"><span | |
| 73 | -class="intro">You are here: </span> <span class="breadcrumbs"> | |
| 74 | - { foreach name=bc from=$breadcrumbs item=breadcrumb } | |
| 75 | - { if $smarty.foreach.bc.first } | |
| 76 | - {if $breadcrumb.url} | |
| 77 | - <a class="primary" href="{$breadcrumb.url}">{$breadcrumb.name}</a> | |
| 78 | - {elseif $breadcrumb.action} | |
| 79 | - <a class="primary" href="{$breadcrumb.action|generateControllerLink:$breadcrumb.query}">{$breadcrumb.name}</a> | |
| 80 | - {else} | |
| 81 | - <span class="primary">{$breadcrumb.name}</span> | |
| 82 | - {/if} | |
| 83 | - { else } | |
| 84 | - {if $breadcrumb.url} | |
| 85 | - <a href="{$breadcrumb.url}">{$breadcrumb.name}</a> | |
| 86 | - {elseif $breadcrumb.action} | |
| 87 | - <a href="{$breadcrumb.action|generateControllerLink:$breadcrumb.query}">{$breadcrumb.name}</a> | |
| 88 | - {else} | |
| 89 | - {$breadcrumb.name} | |
| 90 | - {/if} | |
| 91 | - { /if } | |
| 92 | - { if !$smarty.foreach.bc.last } | |
| 93 | - » | |
| 94 | - { /if } | |
| 95 | - { /foreach } </span></p> | |
| 96 | - { /if } | |
| 97 | - { foreach item=errorMessage from=$errormessages } | |
| 98 | - <table border="0"><tr><td><p class="errorText">{$errorMessage}</p></td></tr></table> | |
| 99 | - { /foreach } | |
| 100 | - { foreach item=errorMessage from=$kterrormessages } | |
| 101 | - <table border="0"><tr><td><p class="errorText">{$errorMessage}</p></td></tr></table> | |
| 102 | - { /foreach } | |
| 103 | - { if $cpayload } | |
| 104 | - { if $cpayload|is_string } | |
| 105 | - { $cpayload } | |
| 106 | - { else } | |
| 107 | - { $cpayload->render() } | |
| 108 | - { /if } | |
| 109 | - { else } | |
| 110 | - Central payload not set | |
| 111 | - { /if } | |
| 112 | - </td> | |
| 113 | - </tr> | |
| 114 | - </table> | |
| 115 | - { if ! $formdisabled } | |
| 116 | - </form> | |
| 117 | - { /if } | |
| 118 | - </body> | |
| 119 | -</html> |