diff --git a/lib/documentmanagement/DocumentLink.inc b/lib/documentmanagement/DocumentLink.inc
index 0cca05e..5042506 100644
--- a/lib/documentmanagement/DocumentLink.inc
+++ b/lib/documentmanagement/DocumentLink.inc
@@ -8,32 +8,32 @@
* KnowledgeTree Open Source Edition
* Document Management Made Simple
* Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited
- *
+ *
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation.
- *
+ *
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program. If not, see
';
- var_dump($_REQUEST);
- exit(0);
- */
+ $oParentDocument =& $this->oDocument;
+ $iParentId = $oParentDocument->getId();
+ $aTemplateData = array(
+ 'context' => $this,
+ 'iDocId' => $iParentId,
+ 'link_types' => LinkType::getList("id > 0"),
+ );
- $oTargetDocument = Document::get(KTUtil::arrayGet($_REQUEST, '_d'));
- if (PEAR::isError($oTargetDocument)) {
- $this->errorRedirectToMain(_kt('Invalid target document selected.'));
- exit(0);
- }
+ $oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/link_external');
+ return $oTemplate->render($aTemplateData);
+ }
+
+ // select a type for the link
+ function do_type_select() {
+ $this->oPage->setBreadcrumbDetails(_kt("link"));
+
+ $sType = (isset($_REQUEST['linktype'])) ? $_REQUEST['linktype'] : 'internal';
+ $sTarget = '';
+ $aTarget = array();
+ if($sType == 'external'){
+ $iParentId = $_REQUEST['fDocumentId'];
+ $aTarget['url'] = $_REQUEST['target_url'];
+ $aTarget['name'] = $_REQUEST['target_name'];
+ $aDocuments = array($iParentId);
+
+ $this->oValidator->validateUrl($aTarget['url']);
+ if(empty($aTarget['name'])){
+ $aTarget['name'] = $aTarget['url'];
+ }
+ }else{
+ $iParentId = $_REQUEST['fDocumentId'];
+ $aDocuments = $_REQUEST['linkselection'];
+ if(empty($aDocuments)){
+ $this->errorRedirectToMain(_kt('No documents have been selected.'));
+ exit;
+ }
+ }
+ $sDocuments = serialize($aDocuments);
+ $sTarget = serialize($aTarget);
// form fields
$aFields = array();
-
+
$aVocab = array();
foreach(LinkType::getList("id > 0") as $oLinkType) {
$aVocab[$oLinkType->getID()] = $oLinkType->getName();
- }
+ }
$aOptions = array('vocab' => $aVocab);
$aFields[] = new KTLookupWidget(
- _kt('Link Type'),
- _kt('The type of link you wish to use'),
- 'fLinkTypeId',
+ _kt('Link Type'),
+ _kt('The type of link you wish to use'),
+ 'fLinkTypeId',
null,
$this->oPage,
true,
null,
null,
$aOptions);
-
+
$aTemplateData = array(
'context' => $this,
- 'parent_id' => $oParentDocument->getId(),
- 'target_id' => $oTargetDocument->getId(),
+ 'parent_id' => $iParentId,
+ 'target_id' => $sDocuments,
+ 'target_url' => $sTarget,
'fields' => $aFields,
);
-
- $oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/link_type_select');
- return $oTemplate->render($aTemplateData);
-
+ $oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/link_type_select');
+ return $oTemplate->render($aTemplateData);
}
-
-
// make the link
function do_make_link() {
$this->oPage->setBreadcrumbDetails(_kt("link"));
-
- // check validity of things
- $oParentDocument = Document::get(KTUtil::arrayGet($_REQUEST, 'fDocumentId'));
- if (PEAR::isError($oParentDocument)) {
- $this->errorRedirectToMain(_kt('Invalid parent document selected.'));
- exit(0);
- }
-
- $oTargetDocument = Document::get(KTUtil::arrayGet($_REQUEST, 'fTargetDocumentId'));
- if (PEAR::isError($oTargetDocument)) {
- $this->errorRedirectToMain(_kt('Invalid target document selected.'));
- exit(0);
- }
-
- $oLinkType = LinkType::get(KTUtil::arrayGet($_REQUEST, 'fLinkTypeId'));
- if (PEAR::isError($oLinkType)) {
+ $iParentId = $_REQUEST['fDocumentId'];
+ $iLinkTypeId = $_REQUEST['fLinkTypeId'];
+ $sDocIds = $_REQUEST['fTargetDocumentId'];
+ $aDocIds = unserialize($sDocIds);
+ $sTarget = $_REQUEST['fTargetUrl'];
+ $aTarget = unserialize($sTarget);
+
+ $oLinkType = LinkType::get($iLinkTypeId);
+ if (PEAR::isError($oLinkType)) {
$this->errorRedirectToMain(_kt('Invalid link type selected.'));
exit(0);
}
+ $sTargetUrl = '';
+ $sTargetName = '';
+ if(!empty($aTarget)){
+ $sTargetUrl = $aTarget['url'];
+ $sTargetName = $aTarget['name'];
+ }
- // create document link
+ // create document links
$this->startTransaction();
-
- $oDocumentLink =& DocumentLink::createFromArray(array(
- 'iParentDocumentId' => $oParentDocument->getId(),
- 'iChildDocumentId' => $oTargetDocument->getId(),
- 'iLinkTypeId' => $oLinkType->getId(),
- ));
- if (PEAR::isError($oDocumentLink)) {
- $this->errorRedirectToMain(_kt('Could not create document link'), sprintf('fDocumentId=%d', $oParentDocument->getId()));
- exit(0);
+ if(!empty($aDocIds)){
+ foreach ($aDocIds as $iDocId){
+
+ $oDocumentLink =& DocumentLink::createFromArray(array(
+ 'iParentDocumentId' => $iParentId,
+ 'iChildDocumentId' => $iDocId,
+ 'iLinkTypeId' => $iLinkTypeId,
+ 'sTargetUrl' => $sTargetUrl,
+ 'sTargetName' => $sTargetName,
+ ));
+
+ if (PEAR::isError($oDocumentLink)) {
+ $this->rollbackTransaction();
+ $this->errorRedirectToMain(_kt('Could not create document link'), sprintf('fDocumentId=%d', $iParentId));
+ exit(0);
+ }
+ }
}
$this->commitTransaction();
- $this->successRedirectToMain(_kt('Document link created'), sprintf('fDocumentId=%d', $oParentDocument->getId()));
+ $this->successRedirectToMain(_kt('Document link created'), sprintf('fDocumentId=%d', $iParentId));
exit(0);
}
@@ -357,30 +405,29 @@ class KTDocumentLinkAction extends KTDocumentAction {
// check security
$oPermission =& KTPermission::getByName('ktcore.permissions.write');
- if (PEAR::isError($oPermission) ||
+ if (PEAR::isError($oPermission) ||
!KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPermission, $this->oDocument)) {
$this->errorRedirectToMain(_kt('You do not have sufficient permissions to delete a link'), sprintf("fDocumentId=%d", $this->oDocument->getId()));
exit(0);
}
-
// check validity of things
$oDocumentLink = DocumentLink::get(KTUtil::arrayGet($_REQUEST, 'fDocumentLinkId'));
- if (PEAR::isError($oDocumentLink)) {
+ if (PEAR::isError($oDocumentLink)) {
$this->errorRedirectToMain(_kt('Invalid document link selected.'));
exit(0);
}
$oParentDocument = Document::get(KTUtil::arrayGet($_REQUEST, 'fDocumentId'));
- if (PEAR::isError($oParentDocument)) {
+ if (PEAR::isError($oParentDocument)) {
$this->errorRedirectToMain(_kt('Invalid document selected.'));
exit(0);
}
-
+
// do deletion
$this->startTransaction();
-
+
$res = $oDocumentLink->delete();
-
+
if (PEAR::isError($res)) {
$this->errorRedirectToMain(_kt('Could not delete document link'), sprintf('fDocumentId=%d', $oParentDocument->getId()));
exit(0);
@@ -391,7 +438,61 @@ class KTDocumentLinkAction extends KTDocumentAction {
$this->successRedirectToMain(_kt('Document link deleted'), sprintf('fDocumentId=%d', $oParentDocument->getId()));
exit(0);
}
+
+ function _generate_breadcrumbs($oFolder, $iFolderId, $aURLParams) {
+ static $aFolders = array();
+ static $aBreadcrumbs = array();
+
+ // Check if selected folder is a parent of the current folder
+ if(in_array($iFolderId, $aFolders)){
+ $temp = array_flip($aFolders);
+ $key = $temp[$iFolderId];
+ array_splice($aFolders, $key);
+ array_splice($aBreadcrumbs, $key);
+ return $aBreadcrumbs;
+ }
+
+ // Check for the parent of the selected folder unless its the root folder
+ $iParentId = $oFolder->getParentID();
+ if($iFolderId != 1 && in_array($iParentId, $aFolders)){
+ $temp = array_flip($aFolders);
+ $key = $temp[$iParentId];
+ array_splice($aFolders, $key);
+ array_splice($aBreadcrumbs, $key);
+ array_push($aFolders, $iFolderId);
+
+ $aParams = $aURLParams;
+ $aParams['fFolderId'] = $iFolderId;
+ $url = KTUtil::addQueryString($_SERVER['PHP_SELF'], $aParams);
+ $aBreadcrumbs[] = array('url' => $url, 'name' => $oFolder->getName());
+ return $aBreadcrumbs;
+ }
+
+ // Create the breadcrumbs
+ $folder_path_names = $oFolder->getPathArray();
+ $folder_path_ids = explode(',', $oFolder->getParentFolderIds());
+ $folder_path_ids[] = $oFolder->getId();
+ if ($folder_path_ids[0] == 0) {
+ array_shift($folder_path_ids);
+ array_shift($folder_path_names);
+ }
+
+ $iCount = count($folder_path_ids);
+ $range = range(0, $iCount - 1);
+ foreach ($range as $index) {
+ $id = $folder_path_ids[$index];
+ $name = $folder_path_names[$index];
+
+ $aParams = $aURLParams;
+ $aParams['fFolderId'] = $id;
+ $url = KTUtil::addQueryString($_SERVER['PHP_SELF'], $aParams);
+ $aBreadcrumbs[] = array('url' => $url, 'name' => $name);
+ }
+ $aFolders = $folder_path_ids;
+ return $aBreadcrumbs;
+ }
}
+
class KTDocLinkAdminDispatcher extends KTAdminDispatcher {
var $sHelpPage = 'ktcore/admin/link type management.html';
@@ -403,17 +504,17 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher {
function do_main() {
$this->aBreadcrumbs[] = array('name' => _kt('Document Links'));
$this->oPage->setBreadcrumbDetails(_kt("view"));
-
+
$aLinkTypes =& LinkType::getList('id > 0');
-
+
$addLinkForm = array();
- // KTBaseWidget($sLabel, $sDescription, $sName, $value, $oPage, $bRequired = false, $sId = null, $aErrors = null, $aOptions = null)
+ // KTBaseWidget($sLabel, $sDescription, $sName, $value, $oPage, $bRequired = false, $sId = null, $aErrors = null, $aOptions = null)
$addLinkForm[] = new KTStringWidget(_kt('Name'), _kt('A short, human-readable name for the link type.'), 'fName', null, $this->oPage, true);
$addLinkForm[] = new KTStringWidget(_kt('Description'), _kt('A short brief description of the relationship implied by this link type.'), 'fDescription', null, $this->oPage, true);
-
-
+
+
$oTemplating =& KTTemplating::getSingleton();
- $oTemplate = $oTemplating->loadTemplate('ktcore/document/admin/linktypesadmin');
+ $oTemplate = $oTemplating->loadTemplate('ktcore/document/admin/linktypesadmin');
$oTemplate->setData(array(
"context" => $this,
"add_form" => $addLinkForm,
@@ -421,28 +522,28 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher {
));
return $oTemplate;
}
-
+
function do_edit() {
$link_id = KTUtil::arrayGet($_REQUEST, 'fLinkTypeId', null, false);
if ($link_id === null) {
$this->errorRedirectToMain(_kt("Please specify a link type to edit."));
}
-
+
$oLinkType =& LinkType::get($link_id);
-
+
$this->aBreadcrumbs[] = array('name' => _kt('Document Links'));
$this->oPage->setBreadcrumbDetails(_kt("view"));
-
+
$aLinkTypes =& LinkType::getList('id > 0');
-
+
$editLinkForm = array();
- // KTBaseWidget($sLabel, $sDescription, $sName, $value, $oPage, $bRequired = false, $sId = null, $aErrors = null, $aOptions = null)
+ // KTBaseWidget($sLabel, $sDescription, $sName, $value, $oPage, $bRequired = false, $sId = null, $aErrors = null, $aOptions = null)
$editLinkForm[] = new KTStringWidget(_kt('Name'), _kt('A short, human-readable name for the link type.'), 'fName', $oLinkType->getName(), $this->oPage, true);
$editLinkForm[] = new KTStringWidget(_kt('Description'), _kt('A short brief description of the relationship implied by this link type.'), 'fDescription', $oLinkType->getDescription(), $this->oPage, true);
-
-
+
+
$oTemplating =& KTTemplating::getSingleton();
- $oTemplate = $oTemplating->loadTemplate('ktcore/document/admin/linktypesadmin');
+ $oTemplate = $oTemplating->loadTemplate('ktcore/document/admin/linktypesadmin');
$oTemplate->setData(array(
"context" => $this,
"edit_form" => $editLinkForm,
@@ -450,54 +551,54 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher {
"links" => $aLinkTypes,
));
return $oTemplate;
- }
-
+ }
+
function do_update() {
$link_id = KTUtil::arrayGet($_REQUEST, 'fLinkTypeId', null, false);
if ($link_id === null) {
$this->errorRedirectToMain(_kt("Please specify a link type to update."));
}
-
- $name = KTUtil::arrayGet($_REQUEST, 'fName');
+
+ $name = KTUtil::arrayGet($_REQUEST, 'fName');
$description = KTUtil::arrayGet($_REQUEST, 'fDescription');
if (empty($name) || empty($description)) { // for bonus points, make this go to edit, and edit catch it.
$this->errorRedirectToMain(_kt('Please enter information for all fields.'));
}
-
+
$oLinkType =& LinkType::get($link_id);
-
+
$oLinkType->setName($name);
$oLinkType->setDescription($description);
$oLinkType->update();
-
+
$this->successRedirectToMain(_kt("Link Type updated."));
}
-
+
function do_add() {
- $name = KTUtil::arrayGet($_REQUEST, 'fName');
+ $name = KTUtil::arrayGet($_REQUEST, 'fName');
$description = KTUtil::arrayGet($_REQUEST, 'fDescription');
if (empty($name) || empty($description)) {
$this->errorRedirectToMain(_kt('Please enter information for all fields.'));
}
-
+
$oLinkType = new LinkType($name, $description);
$oLinkType->create();
-
+
//$oLinkType =& LinkType::createFromArray(array("sName" => $name, "sDescription" => $description));
-
+
$this->successRedirectToMain(_kt("Link Type created."));
}
-
+
function do_delete() {
$types_to_delete = KTUtil::arrayGet($_REQUEST, 'fLinksToDelete'); // is an array.
if (empty($types_to_delete)) {
$this->errorRedirectToMain(_kt('Please select one or more link types to delete.'));
}
-
+
$count = 0;
foreach ($types_to_delete as $link_id) {
$oLinkType = LinkType::get($link_id);
@@ -505,13 +606,13 @@ class KTDocLinkAdminDispatcher extends KTAdminDispatcher {
foreach(DocumentLink::getList(sprintf("link_type_id = %d", $link_id)) as $oLink) {
$oLink->delete();
}
-
+
$oLinkType->delete(); // technically, this is a bad thing
- $count += 1;
+ $count += 1;
}
-
+
//$oLinkType =& LinkType::createFromArray(array("sName" => $name, "sDescription" => $description));
-
+
$this->successRedirectToMain($count . " " . _kt("Link types deleted."));
}
diff --git a/plugins/rssplugin/KTrss.inc.php b/plugins/rssplugin/KTrss.inc.php
index dddea9d..d8ca6a3 100644
--- a/plugins/rssplugin/KTrss.inc.php
+++ b/plugins/rssplugin/KTrss.inc.php
@@ -84,6 +84,27 @@ class KTrss{
return $response;
}
+ // Get the data for the document or folder
+ function getExternalInternalFeed($sFeed, $iUserId){
+ $aRss = array();
+ $pos = strpos($sFeed, 'docId');
+
+ if($pos === false){
+ $pos = strpos($sFeed, 'folderId');
+ $folderId = substr($sFeed, $pos+9);
+ $aRss[] = KTrss::getOneFolder($folderId, $iUserId);
+ }else{
+ $docId = substr($sFeed, $pos+6);
+ $aRss[] = KTrss::getOneDocument($docId, $iUserId);
+ }
+
+ if($aRss){
+ $internalFeed = KTrss::arrayToXML($aRss);
+ $response = rss2arrayBlock($internalFeed);
+ }
+ return $response;
+ }
+
// Get list of document subscriptions
function getDocumentList($iUserId){
$sQuery = "SELECT document_id as id FROM document_subscriptions WHERE user_id = ?";
diff --git a/plugins/rssplugin/loadFeed.inc.php b/plugins/rssplugin/loadFeed.inc.php
index 0153137..ec20e6d 100644
--- a/plugins/rssplugin/loadFeed.inc.php
+++ b/plugins/rssplugin/loadFeed.inc.php
@@ -5,49 +5,69 @@
* KnowledgeTree Open Source Edition
* Document Management Made Simple
* Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited
- *
+ *
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation.
- *
+ *
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
- *
+ *
* You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place,
* Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com.
- *
+ *
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
- *
+ *
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
- * KnowledgeTree" logo and retain the original copyright notice. If the display of the
+ * KnowledgeTree" logo and retain the original copyright notice. If the display of the
* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
- * must display the words "Powered by KnowledgeTree" and retain the original
- * copyright notice.
+ * must display the words "Powered by KnowledgeTree" and retain the original
+ * copyright notice.
* Contributor( s): ______________________________________
*
*/
require_once('../../config/dmsDefaults.php');
require_once(KT_DIR. '/plugins/rssplugin/rss2array.inc.php');
require_once(KT_DIR. '/plugins/rssplugin/KTrss.inc.php');
-
+
$feed = $_GET["feed"];
$user = $_GET["user"];
-
+
+ // URL must start with http:// - change it if it starts with feed://
+ if(preg_match("/^feed:\/\/([^\/]+)(.*)$/", $feed, $matches)){
+ $feed = preg_replace("/^feed:\/\//", "http://", $feed);
+ }
+
// Check if the feed matches a url
if(!preg_match("/^http:\/\/([^\/]+)(.*)$/", $feed, $matches)){
// If not, it is an internal feed
$aRSSArray = KTrss::getInternalFeed($user);
}else{
// If it is a url, it is an external feed
- $aRSSArray = rss2array($feed);
+ // However, sometimes internal documents get added as external feeds
+ // Check that the url isn't an internal one.
+ global $default;
+ $rootUrl = $default->rootUrl;
+ $bSSL = $default->sslEnabled;
+
+ $sProtocol = ($bSSL) ? 'https' : 'http';
+ $sBaseUrl = $sProtocol.'://'.$_SERVER['HTTP_HOST'].$rootUrl;
+
+ $sInternal = $sBaseUrl.'/rss.php';
+ if(!(strpos($feed, $sInternal) === FALSE)){
+ // Feed is internal
+ $aRSSArray = KTrss::getExternalInternalFeed($feed, $user);
+ }else{
+ $aRSSArray = rss2array($feed);
+ }
}
if(count($aRSSArray[errors]) > 0){
for($i=0;$i
";
}
$response .= "
";
-
+
echo $response;
-?>
+?>
\ No newline at end of file
diff --git a/plugins/rssplugin/rss2array.inc.php b/plugins/rssplugin/rss2array.inc.php
index e7fa981..92c2b82 100644
--- a/plugins/rssplugin/rss2array.inc.php
+++ b/plugins/rssplugin/rss2array.inc.php
@@ -143,7 +143,10 @@
xml_parser_free($xml_parser);
}
-
+ else if($status == 401)
+ {
+ $rss2array_globals[errors][] = "Password authenticated feeds are not supported.";
+ }
else {
$rss2array_globals[errors][] = "Can't get feed: HTTP status code $status";
diff --git a/sql/mysql/install/structure.sql b/sql/mysql/install/structure.sql
index 9a0ba74..79d9595 100644
--- a/sql/mysql/install/structure.sql
+++ b/sql/mysql/install/structure.sql
@@ -318,6 +318,8 @@ CREATE TABLE `document_link` (
`parent_document_id` int(11) NOT NULL default '0',
`child_document_id` int(11) NOT NULL default '0',
`link_type_id` int(11) NOT NULL default '0',
+ `external_url` varchar(255),
+ `external_name` varchar(50),
PRIMARY KEY (`id`),
KEY `parent_document_id` (`parent_document_id`),
KEY `child_document_id` (`child_document_id`),
diff --git a/sql/mysql/upgrade/3.5.2/document_link.sql b/sql/mysql/upgrade/3.5.2/document_link.sql
new file mode 100644
index 0000000..20af4b9
--- /dev/null
+++ b/sql/mysql/upgrade/3.5.2/document_link.sql
@@ -0,0 +1 @@
+ALTER TABLE `document_link` ADD `external_url` varchar(255), ADD `external_name` varchar(50);
\ No newline at end of file
diff --git a/templates/ktstandard/action/document_links.smarty b/templates/ktstandard/action/document_links.smarty
index 34c1281..f99a044 100644
--- a/templates/ktstandard/action/document_links.smarty
+++ b/templates/ktstandard/action/document_links.smarty
@@ -19,7 +19,7 @@
-{if $links_from || $links_to}
+{if $links_from || $links_to || $links_external}
{foreach from=$links_from item=link}
@@ -35,7 +35,7 @@
{/if}
- getId()}&qs[action]=main">{$target->getName()|sanitize}
+ getId()}&qs[action]=main" title="{"viewDocument"|generateControllerUrl}&qs[fDocumentId]={$target->getId()}&qs[action]=main">{$target->getName()|sanitize}
{$type->getName()}
{i18n}Linked from this document{/i18n}
@@ -55,14 +55,34 @@
{/if}
-
- getId()}&qs[action]=main">{$target->getName()|sanitize}
+ getId()}&qs[action]=main" href="{"viewDocument"|generateControllerUrl}&qs[fDocumentId]={$target->getId()}&qs[action]=main">{$target->getName()|sanitize}
{$type->getName()}
{i18n}Links to this document{/i18n}
{/foreach}
+{foreach from=$links_external item=link}
+
+{assign var="type" value=$link->getLinkType()}
+{assign var="url" value=$link->getTargetUrl()}
+{assign var="name" value=$link->getTargetName()}
+
+
+
+ {if $write_permission}
+ {i18n}Delete{/i18n}
+ {else}
+
+ {/if}
+
+
+ {$link->getTargetName()|sanitize}
+ {$type->getName()}
+ {i18n}External link from this document{/i18n}
+
+
+{/foreach}
{else}
{i18n}There are no links to or from this document.{/i18n}
@@ -78,6 +98,10 @@
{if $write_permission}
{i18n}Add a new link{/i18n}
oDocument->getId()}&fFolderId={$context->oDocument->getFolderId()}{/addQS}">{i18n}Add a new link{/i18n}.
+href="{addQS}action=new&fDocumentId={$context->oDocument->getId()}&fFolderId={$context->oDocument->getFolderId()}{/addQS}">{i18n}Add a new link{/i18n}
+
+{i18n}Add a new link{/i18n}
+oDocument->getFolderId()}{/addQS}">{i18n}Add an external link{/i18n}.
{/if}
diff --git a/templates/ktstandard/action/link.smarty b/templates/ktstandard/action/link.smarty
index a752f6d..d453fae 100644
--- a/templates/ktstandard/action/link.smarty
+++ b/templates/ktstandard/action/link.smarty
@@ -5,6 +5,14 @@
{i18n}Select a target document to link to.{/i18n}
+{foreach from=$breadcrumbs item=breadcrumb name=bc}
+ {if !$smarty.foreach.bc.last}
+ {$breadcrumb.name|sanitize} »
+ {else}
+ {$breadcrumb.name|sanitize}
+ {/if}
+{/foreach}
+