wCMF
3.6
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Groups
Pages
function.linktext.php
Go to the documentation of this file.
1
<?php
2
/**
3
* wCMF - wemove Content Management Framework
4
* Copyright (C) 2005-2014 wemove digital solutions GmbH
5
*
6
* Licensed under the terms of any of the following licenses
7
* at your choice:
8
*
9
* - GNU Lesser General Public License (LGPL)
10
* http://www.gnu.org/licenses/lgpl.html
11
* - Eclipse Public License (EPL)
12
* http://www.eclipse.org/org/documents/epl-v10.php
13
*
14
* See the license.txt file distributed with this work for
15
* additional information.
16
*
17
* $Id: function.linktext.php 1462 2014-02-04 23:52:27Z iherwig $
18
*/
19
require_once(BASE.
"wcmf/lib/presentation/class.InternalLink.php"
);
20
21
/*
22
* Smarty plugin
23
* -------------------------------------------------------------
24
* File: function.linktext.php
25
* Type: function
26
* Name: linktext
27
* Purpose: extract the link name from an url (get the corresponding display value of an internal link,
28
* strip http://)
29
* Usage: e.g. {linktext url="javascript:doDisplay('Category:285'); submitAction('')"}
30
* -------------------------------------------------------------
31
*/
32
function
smarty_function_linktext
($params, &$smarty)
33
{
34
$url = $params[
'url'
];
35
if
(
InternalLink::isLink
($url))
36
{
37
// get the display value
38
$persistenceFacade = &
PersistenceFacade::getInstance
();
39
$node = $persistenceFacade->load(
InternalLink::getReferencedOID
($url),
BUILDDEPTH_SINGLE
);
40
$value = $node->getDisplayValue();
41
}
42
else
43
$value = preg_replace(
'/^http:\/\//'
,
''
, $url);
44
45
echo $value;
46
}
47
?>
PersistenceFacade\getInstance
& getInstance()
Definition:
class.PersistenceFacade.php:47
InternalLink\isLink
isLink($link)
Definition:
class.InternalLink.php:61
smarty_function_linktext
smarty_function_linktext($params, &$smarty)
Definition:
function.linktext.php:32
InternalLink\getReferencedOID
getReferencedOID($link)
Definition:
class.InternalLink.php:70
BUILDDEPTH_SINGLE
const BUILDDEPTH_SINGLE
Definition:
class.NodeXMLDBMapper.php:38
wcmf3.x
SVN
framework
wcmf
lib
presentation
smarty_plugins
function.linktext.php
Generated on Wed Feb 5 2014 10:51:06 for wCMF by
1.8.6