XOOPS
2.6.0
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
decorator.php
Go to the documentation of this file.
1
<?php
2
/*
3
You may not change or alter any portion of this comment or credits
4
of supporting developers from this source code or any supporting source code
5
which is considered copyrighted (c) material of the original comment or credit authors.
6
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
*/
11
21
class
MenusSmartyDecorator
extends
MenusDecoratorAbstract
implements
MenusDecoratorInterface
22
{
23
function
hasAccess
(
$menu
, &$hasAccess)
24
{
25
}
26
27
function
accessFilter
(&$accessFilter)
28
{
29
}
30
31
function
start
()
32
{
33
}
34
35
function
end
(&$menus)
36
{
37
}
38
39
function
decorateMenu
(&
$menu
)
40
{
41
$decorations = array(
'link'
,
'image'
,
'title'
,
'alt_title'
);
42
foreach
($decorations as $decoration) {
43
$menu
[$decoration] = self::_doDecoration(
$menu
[$decoration]);
44
}
45
}
46
47
function
_doDecoration
($string)
48
{
49
$xoops
=
Xoops::getInstance
();
50
if
(!preg_match(
'/{(.*\|.*)}/i'
, $string, $reg)) {
51
return
$string;
52
}
53
54
$expression = $reg[0];
55
list($validator, $value) = array_map(
'strtolower'
, explode(
'|'
, $reg[1]));
56
57
if
($validator ==
'smarty'
) {
58
if
(isset(
$xoops
->tpl()->_tpl_vars[$value])) {
59
$string = str_replace($expression,
$xoops
->tpl()->_tpl_vars[$value], $string);
60
}
61
}
62
63
return
$string;
64
}
65
66
}
Xoops\getInstance
static getInstance()
Definition:
Xoops.php:160
MenusSmartyDecorator\_doDecoration
_doDecoration($string)
Definition:
decorator.php:47
MenusSmartyDecorator\end
end(&$menus)
Definition:
decorator.php:35
MenusSmartyDecorator\accessFilter
accessFilter(&$accessFilter)
Definition:
decorator.php:27
$xoops
$xoops
Definition:
admin.php:25
MenusSmartyDecorator\hasAccess
hasAccess($menu, &$hasAccess)
Definition:
decorator.php:23
$menu
$menu
Definition:
_localsupport.php:4
MenusSmartyDecorator\start
start()
Definition:
decorator.php:31
MenusDecoratorInterface
Definition:
decorator.php:88
MenusDecoratorAbstract
Definition:
decorator.php:62
MenusSmartyDecorator\decorateMenu
decorateMenu(&$menu)
Definition:
decorator.php:39
MenusSmartyDecorator
Definition:
decorator.php:21
usr64
htdocs
modules
menus
decorators
smarty
decorator.php
Generated on Fri May 22 2015 03:07:04 for XOOPS by
1.8.9.1