Commit 848b075d89f107e8f7a4d21af66b2a8501652d6e

Authored by kevin_fourie
1 parent 9e8ab4ef

KTS-1968

"Create WebDAV connection Dashlet"
Done.

Committed By: Kevin
Reviewed By: Conrad

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6616 c91229c3-7414-0410-bfa2-8a42b809f60b
plugins/ktstandard/KTWebDAVDashletPlugin.php 0 → 100644
  1 +<?php
  2 +
  3 +/**
  4 + * $Id: KTWebDAVDashletPlugin.php 5758 2006-07-27 10:17:43Z kevin_fourie $
  5 + *
  6 + * The contents of this file are subject to the KnowledgeTree Public
  7 + * License Version 1.1 ("License"); You may not use this file except in
  8 + * compliance with the License. You may obtain a copy of the License at
  9 + * http://www.ktdms.com/KPL
  10 + *
  11 + * Software distributed under the License is distributed on an "AS IS"
  12 + * basis,
  13 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  14 + * for the specific language governing rights and limitations under the
  15 + * License.
  16 + *
  17 + * The Original Code is: KnowledgeTree Open Source
  18 + *
  19 + * The Initial Developer of the Original Code is The Jam Warehouse Software
  20 + * (Pty) Ltd, trading as KnowledgeTree.
  21 + * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright
  22 + * (C) 2006 The Jam Warehouse Software (Pty) Ltd;
  23 + * All Rights Reserved.
  24 + *
  25 + */
  26 +
  27 +require_once(KT_LIB_DIR . '/plugins/plugin.inc.php');
  28 +require_once(KT_LIB_DIR . '/plugins/pluginregistry.inc.php');
  29 +require_once(KT_LIB_DIR . '/dashboard/dashlet.inc.php');
  30 +
  31 +class KTWebDAVDashletPlugin extends KTPlugin {
  32 + var $sNamespace = "ktstandard.ktwebdavdashlet.plugin";
  33 + var $autoRegister = true;
  34 +
  35 + function KTWebDAVDashletPlugin($sFilename = null) {
  36 + $res = parent::KTPlugin($sFilename);
  37 + $this->sFriendlyName = _kt('WebDAV Dashlet Plugin');
  38 + return $res;
  39 + }
  40 +
  41 + function setup() {
  42 + $this->registerDashlet('KTWebDAVDashlet', 'ktstandard.ktwebdavdashlet.dashlet', __FILE__);
  43 +
  44 + require_once(KT_LIB_DIR . "/templating/templating.inc.php");
  45 + $oTemplating =& KTTemplating::getSingleton();
  46 + }
  47 +}
  48 +
  49 +class KTWebDAVDashlet extends KTBaseDashlet {
  50 + var $sClass = "ktInfo";
  51 +
  52 + function KTWebDAVDashlet( ) {
  53 + $this->sTitle = "WebDAV Connection Information";
  54 + }
  55 +
  56 + function render() {
  57 + $oTemplating =& KTTemplating::getSingleton();
  58 + $oTemplate = $oTemplating->loadTemplate('ktstandard/ktwebdavdashlet/dashlet');
  59 +
  60 + $oConfig =& KTConfig::getSingleton();
  61 + $bSSL = $oConfig->get('sslEnabled', false);
  62 + $sRoot = $oConfig->get('rootUrl');
  63 +
  64 + if($bSSL) { $sProtocol = 'https'; }
  65 + else { $sProtocol = 'http'; }
  66 +
  67 + $sURL = $sProtocol . '://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $sRoot . "/";
  68 +
  69 + $aTemplateData = array(
  70 + 'url' => $sURL,
  71 + );
  72 + return $oTemplate->render($aTemplateData);
  73 + }
  74 +}
  75 +
  76 +$oPluginRegistry =& KTPluginRegistry::getSingleton();
  77 +$oPluginRegistry->registerPlugin('KTWebDAVDashletPlugin', 'ktstandard.ktwebdavdashlet.plugin', __FILE__);
  78 +?>
... ...
templates/ktstandard/ktwebdavdashlet/dashlet.smarty 0 → 100644
  1 +<div>
  2 +<p>{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 +</p>
  5 +</div>
  6 +
... ...