Commit df7a7a2777cfeb7213ade9e28a6f67e41c8c801e

Authored by kevin_fourie
1 parent ff55ab09

Merged in from STABLE trunk...

KTS-3585
"The webDAV dashlet should not contain a reference to "To connect with the KnowledgeTree Tools Suite, use this address......""
Fixed. Added a check for the wintools plugin.

Committed by: Megan Watson
Reviewed by: Conrad Vermeulen


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/branches/3.5.3-Release-Branch@9161 c91229c3-7414-0410-bfa2-8a42b809f60b
plugins/ktstandard/KTWebDAVDashletPlugin.php
@@ -7,31 +7,31 @@ @@ -7,31 +7,31 @@
7 * Document Management Made Simple 7 * Document Management Made Simple
8 * Copyright (C) 2008 KnowledgeTree Inc. 8 * Copyright (C) 2008 KnowledgeTree Inc.
9 * Portions copyright The Jam Warehouse Software (Pty) Limited 9 * Portions copyright The Jam Warehouse Software (Pty) Limited
10 - * 10 + *
11 * This program is free software; you can redistribute it and/or modify it under 11 * This program is free software; you can redistribute it and/or modify it under
12 * the terms of the GNU General Public License version 3 as published by the 12 * the terms of the GNU General Public License version 3 as published by the
13 * Free Software Foundation. 13 * Free Software Foundation.
14 - * 14 + *
15 * This program is distributed in the hope that it will be useful, but WITHOUT 15 * This program is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18 * details. 18 * details.
19 - * 19 + *
20 * You should have received a copy of the GNU General Public License 20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>. 21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 - *  
23 - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, 22 + *
  23 + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
24 * California 94120-7775, or email info@knowledgetree.com. 24 * California 94120-7775, or email info@knowledgetree.com.
25 - * 25 + *
26 * The interactive user interfaces in modified source and object code versions 26 * The interactive user interfaces in modified source and object code versions
27 * of this program must display Appropriate Legal Notices, as required under 27 * of this program must display Appropriate Legal Notices, as required under
28 * Section 5 of the GNU General Public License version 3. 28 * Section 5 of the GNU General Public License version 3.
29 - * 29 + *
30 * In accordance with Section 7(b) of the GNU General Public License version 3, 30 * In accordance with Section 7(b) of the GNU General Public License version 3,
31 * these Appropriate Legal Notices must retain the display of the "Powered by 31 * these Appropriate Legal Notices must retain the display of the "Powered by
32 - * KnowledgeTree" logo and retain the original copyright notice. If the display of the 32 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
33 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices 33 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
34 - * must display the words "Powered by KnowledgeTree" and retain the original 34 + * must display the words "Powered by KnowledgeTree" and retain the original
35 * copyright notice. 35 * copyright notice.
36 * Contributor( s): ______________________________________ 36 * Contributor( s): ______________________________________
37 * 37 *
@@ -49,7 +49,7 @@ class KTWebDAVDashletPlugin extends KTPlugin { @@ -49,7 +49,7 @@ class KTWebDAVDashletPlugin extends KTPlugin {
49 $res = parent::KTPlugin($sFilename); 49 $res = parent::KTPlugin($sFilename);
50 $this->sFriendlyName = _kt('WebDAV Dashlet Plugin'); 50 $this->sFriendlyName = _kt('WebDAV Dashlet Plugin');
51 return $res; 51 return $res;
52 - } 52 + }
53 53
54 function setup() { 54 function setup() {
55 $this->registerDashlet('KTWebDAVDashlet', 'ktstandard.ktwebdavdashlet.dashlet', __FILE__); 55 $this->registerDashlet('KTWebDAVDashlet', 'ktstandard.ktwebdavdashlet.dashlet', __FILE__);
@@ -61,7 +61,7 @@ class KTWebDAVDashletPlugin extends KTPlugin { @@ -61,7 +61,7 @@ class KTWebDAVDashletPlugin extends KTPlugin {
61 61
62 class KTWebDAVDashlet extends KTBaseDashlet { 62 class KTWebDAVDashlet extends KTBaseDashlet {
63 var $sClass = "ktInfo"; 63 var $sClass = "ktInfo";
64 - 64 +
65 function KTWebDAVDashlet( ) { 65 function KTWebDAVDashlet( ) {
66 $this->sTitle = _kt('WebDAV Connection Information'); 66 $this->sTitle = _kt('WebDAV Connection Information');
67 } 67 }
@@ -79,8 +79,18 @@ class KTWebDAVDashlet extends KTBaseDashlet { @@ -79,8 +79,18 @@ class KTWebDAVDashlet extends KTBaseDashlet {
79 79
80 $sURL = $sProtocol . '://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $sRoot . "/"; 80 $sURL = $sProtocol . '://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $sRoot . "/";
81 81
  82 + // Check if this is a commercial installation - before displaying the KT Tools webdav link
  83 + // Shortcut: Check if the the wintools plugin exists and set to true.
  84 + // Long way: Check that a license is installed - this is only text so having a license is not a requirement.
  85 + $isComm = false;
  86 + $keyUtil = KT_DIR . '/plugins/wintools/baobabkeyutil.inc.php';
  87 + if(file_exists($keyUtil)){
  88 + $isComm = true;
  89 + }
  90 +
82 $aTemplateData = array( 91 $aTemplateData = array(
83 'url' => $sURL, 92 'url' => $sURL,
  93 + 'hasLicense' => $isComm
84 ); 94 );
85 return $oTemplate->render($aTemplateData); 95 return $oTemplate->render($aTemplateData);
86 } 96 }
templates/ktstandard/ktwebdavdashlet/dashlet.smarty
1 <div> 1 <div>
2 -{i18n arg_appname="$appname"}To connect to #appname# via a third-party WebDAV client, please use the following address{/i18n}:<br/>  
3 -<b><a href="{$url}ktwebdav/ktwebdav.php" target="_blank">{$url}ktwebdav/ktwebdav.php</a></b><br/><br/>  
4 -{i18n arg_appname="$appname"}To connect with the #appname# Tools Suite, use this address{/i18n}:<br/>  
5 -<b>{$url}</b><br/><br/> 2 + {i18n arg_appname="$appname"}To connect to #appname# via a third-party WebDAV client, please use the following address{/i18n}:<br/>
  3 + <b><a href="{$url}ktwebdav/ktwebdav.php" target="_blank">{$url}ktwebdav/ktwebdav.php</a></b><br/><br/>
  4 +
  5 + {if $hasLicense}
  6 + {i18n arg_appname="$appname"}To connect with the #appname# Tools Suite, use this address{/i18n}:<br/>
  7 + <b>{$url}</b><br/><br/>
  8 + {/if}
6 </div> 9 </div>
7 \ No newline at end of file 10 \ No newline at end of file