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
MenusConstantDecorator
extends
MenusDecoratorAbstract
implements
MenusDecoratorInterface
22
{
23
function
hasAccess
(
$menu
, &$hasAccess)
24
{
25
}
26
27
function
accessFilter
(&$accessFilter)
28
{
29
}
30
31
function
formLinkDescription
($registry)
32
{
33
}
34
35
function
start
()
36
{
37
}
38
39
function
end
(&$menus)
40
{
41
}
42
43
function
decorateMenu
(&
$menu
)
44
{
45
$decorations = array(
'link'
,
'image'
,
'title'
,
'alt_title'
);
46
foreach
($decorations as $decoration) {
47
$menu
[$decoration] = self::_doDecoration(
$menu
[$decoration]);
48
}
49
}
50
51
function
_doDecoration
($string)
52
{
53
if
(!preg_match(
'/{(.*\|.*)}/i'
, $string, $reg)) {
54
return
$string;
55
}
56
57
$expression = $reg[0];
58
list($validator, $value) = array_map(
'strtoupper'
, explode(
'|'
, $reg[1]));
59
60
if
($validator ==
'CONSTANT'
) {
61
if
(defined($value)) {
62
$string = str_replace($expression, constant($value), $string);
63
}
64
}
65
66
return
$string;
67
}
68
}
MenusConstantDecorator\hasAccess
hasAccess($menu, &$hasAccess)
Definition:
decorator.php:23
MenusConstantDecorator\decorateMenu
decorateMenu(&$menu)
Definition:
decorator.php:43
MenusConstantDecorator\formLinkDescription
formLinkDescription($registry)
Definition:
decorator.php:31
MenusConstantDecorator\start
start()
Definition:
decorator.php:35
$menu
$menu
Definition:
_localsupport.php:4
MenusDecoratorInterface
Definition:
decorator.php:88
MenusDecoratorAbstract
Definition:
decorator.php:62
MenusConstantDecorator\accessFilter
accessFilter(&$accessFilter)
Definition:
decorator.php:27
MenusConstantDecorator
Definition:
decorator.php:21
MenusConstantDecorator\end
end(&$menus)
Definition:
decorator.php:39
MenusConstantDecorator\_doDecoration
_doDecoration($string)
Definition:
decorator.php:51
usr64
htdocs
modules
menus
decorators
constant
decorator.php
Generated on Fri May 22 2015 03:07:04 for XOOPS by
1.8.9.1