No regular expressions were active.
1 |
|
<?php
|
|
1 |
|
<?php
|
2 |
|
|
|
2 |
|
|
3 |
|
/*********
**********
**********
**********
**********
**********
**********
******
|
|
3 |
|
/*********
**********
**********
**********
**********
**********
**********
******
|
4 |
|
*
D
olphin Sma
rt Communi
ty Builder
|
|
4 |
|
*
D
olphin Sma
rt Communi
ty Builder
|
5 |
|
*
---------
--------
|
|
5 |
|
*
---------
--------
|
6 |
|
* begi
n
: M
on Mar 23
2006
|
|
6 |
|
* begi
n
: M
on Mar 23
2006
|
7 |
|
* copy
right
: (
C) 2006 Bo
onEx Group
|
|
7 |
|
* copy
right
: (
C) 2006 Bo
onEx Group
|
8 |
|
* webs
ite
: h
ttp://www.
boonex.com
/
|
|
8 |
|
* webs
ite
: h
ttp://www.
boonex.com
/
|
9 |
|
* This fil
e is part
of Dolphin
- Smart C
ommunity B
uilder
|
|
9 |
|
* This fil
e is part
of Dolphin
- Smart C
ommunity B
uilder
|
10 |
|
*
|
|
10 |
|
*
|
11 |
|
* Dolphin
is free so
ftware. Th
is work is
licensed
under a Cr
eative Com
mons Attri
bution 3.0
License.
|
|
11 |
|
* Dolphin
is free so
ftware. Th
is work is
licensed
under a Cr
eative Com
mons Attri
bution 3.0
License.
|
12 |
|
* http://c
reativecom
mons.org/l
icenses/by
/3.0/
|
|
12 |
|
* http://c
reativecom
mons.org/l
icenses/by
/3.0/
|
13 |
|
*
|
|
13 |
|
*
|
14 |
|
* Dolphin
is distrib
uted in th
e hope tha
t it will
be useful,
but WITHO
UT ANY WAR
RANTY;
|
|
14 |
|
* Dolphin
is distrib
uted in th
e hope tha
t it will
be useful,
but WITHO
UT ANY WAR
RANTY;
|
15 |
|
* without
even the i
mplied war
ranty of
MERCHANTAB
ILITY or F
ITNESS FOR
A PARTICU
LAR PURPOS
E.
|
|
15 |
|
* without
even the i
mplied war
ranty of
MERCHANTAB
ILITY or F
ITNESS FOR
A PARTICU
LAR PURPOS
E.
|
16 |
|
* See the
Creative C
ommons Att
ribution 3
.0 License
for more
details.
|
|
16 |
|
* See the
Creative C
ommons Att
ribution 3
.0 License
for more
details.
|
17 |
|
* You shou
ld have re
ceived a c
opy of the
Creative
Commons At
tribution
3.0 Licens
e along wi
th Dolphin
,
|
|
17 |
|
* You shou
ld have re
ceived a c
opy of the
Creative
Commons At
tribution
3.0 Licens
e along wi
th Dolphin
,
|
18 |
|
* see lice
nse.txt fi
le; if not
, write to
marketing
@boonex.co
m
|
|
18 |
|
* see lice
nse.txt fi
le; if not
, write to
marketing
@boonex.co
m
|
19 |
|
**********
**********
**********
**********
**********
**********
**********
*****/
|
|
19 |
|
**********
**********
**********
**********
**********
**********
**********
*****/
|
20 |
|
|
|
20 |
|
|
21 |
|
/*
|
|
21 |
|
/*
|
22 |
|
* Page fo
r displayi
ng and edi
ting profi
le fields.
|
|
22 |
|
* Page fo
r displayi
ng and edi
ting profi
le fields.
|
23 |
|
*/
|
|
23 |
|
*/
|
24 |
|
|
|
24 |
|
|
25 |
|
require_on
ce( '../in
c/header.i
nc.php' );
|
|
25 |
|
require_on
ce( '../in
c/header.i
nc.php' );
|
26 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'd
esign.inc.
php' );
|
|
26 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'd
esign.inc.
php' );
|
27 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'p
rofiles.in
c.php' );
|
|
27 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'p
rofiles.in
c.php' );
|
28 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'a
dmin_desig
n.inc.php'
);
|
|
28 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'a
dmin_desig
n.inc.php'
);
|
29 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'u
tils.inc.p
hp' );
|
|
29 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'u
tils.inc.p
hp' );
|
30 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'l
anguages.i
nc.php' );
|
|
30 |
|
require_on
ce( BX_DIR
ECTORY_PAT
H_INC . 'l
anguages.i
nc.php' );
|
31 |
|
require_on
ce(
BX_DIRECTO
RY_PATH_
IN
C
.
'
m
enu.
inc.
php'
);
|
|
31 |
|
require_on
ce(
BX_DIRECTO
RY_PATH_
C
LASSES
.
'
BxDolM
enu.
php'
);
|
32 |
|
|
|
32 |
|
|
33 |
|
// Check i
f administ
rator is l
ogged in.
If not di
splay logi
n form.
|
|
33 |
|
// Check i
f administ
rator is l
ogged in.
If not di
splay logi
n form.
|
34 |
|
$logged['a
dmin']
=
member_aut
h(
1
);
|
|
34 |
|
$logged['a
dmin']
=
member_aut
h(
1
,
true,
true
);
|
35 |
|
|
|
35 |
|
|
36 |
|
|
|
36 |
|
|
37 |
|
$_page['he
ader'] =
'Menu Bui
lder';
|
|
37 |
|
$_page['he
ader'] =
'Menu Bui
lder';
|
38 |
|
$_page['cs
s_name'] =
'menu_com
pose.css';
|
|
38 |
|
$_page['cs
s_name'] =
'menu_com
pose.css';
|
39 |
|
|
|
39 |
|
|
40 |
|
|
|
40 |
|
|
|
|
41 |
|
$oMenu = n
ew BxDolMe
nu();
|
|
|
42 |
|
|
41 |
|
|
|
43 |
|
|
42 |
|
if( $_REQU
EST['actio
n'] )
|
|
44 |
|
if( $_REQU
EST['actio
n'] )
|
43 |
|
{
|
|
45 |
|
{
|
44 |
|
switch
( $_REQUES
T['action'
] )
|
|
46 |
|
switch
( $_REQUES
T['action'
] )
|
45 |
|
{
|
|
47 |
|
{
|
46 |
|
ca
se 'edit_f
orm':
|
|
48 |
|
ca
se 'edit_f
orm':
|
47 |
|
$id = (i
nt)$_REQUE
ST['id'];
|
|
49 |
|
$id = (i
nt)$_REQUE
ST['id'];
|
48 |
|
|
|
50 |
|
|
49 |
|
$aItem =
db_assoc_
arr( "SELE
CT * FROM
`TopMenu`
WHERE `ID`
= $id", 0
);
|
|
51 |
|
$aItem =
db_assoc_
arr( "SELE
CT * FROM
`TopMenu`
WHERE `ID`
= $id", 0
);
|
50 |
|
if( $aIt
em )
|
|
52 |
|
if( $aIt
em )
|
51 |
|
show
EditForm(
$aItem );
|
|
53 |
|
show
EditForm(
$aItem );
|
52 |
|
else
|
|
54 |
|
else
|
53 |
|
echo
MenuEditMs
g( 'Error'
, 'red' );
|
|
55 |
|
echo
MenuEditMs
g( 'Error'
, 'red' );
|
54 |
|
ex
it;
|
|
56 |
|
ex
it;
|
55 |
|
ca
se 'create
_item':
|
|
57 |
|
ca
se 'create
_item':
|
56 |
|
$newID =
createNew
Element( $
_GET['type
'], (int)$
_GET['sour
ce'] );
|
|
58 |
|
$newID =
createNew
Element( $
_GET['type
'], (int)$
_GET['sour
ce'] );
|
57 |
|
echo $ne
wID;
|
|
59 |
|
echo $ne
wID;
|
58 |
|
ex
it;
|
|
60 |
|
ex
it;
|
59 |
|
ca
se 'deacti
vate_item'
:
|
|
61 |
|
ca
se 'deacti
vate_item'
:
|
60 |
|
$res = d
b_res( "UP
DATE `TopM
enu` SET `
Active`=0
WHERE `ID`
=" . (int)
$_GET['id'
] );
|
|
62 |
|
$res = d
b_res( "UP
DATE `TopM
enu` SET `
Active`=0
WHERE `ID`
=" . (int)
$_GET['id'
] );
|
61 |
|
echo mys
ql_affecte
d_rows();
|
|
63 |
|
echo mys
ql_affecte
d_rows();
|
62 |
|
compile
Menus
();
|
|
64 |
|
$oMenu
->
compile
();
|
63 |
|
ex
it;
|
|
65 |
|
ex
it;
|
64 |
|
ca
se 'save_i
tem':
|
|
66 |
|
ca
se 'save_i
tem':
|
65 |
|
$id = (i
nt)$_GET['
id'];
|
|
67 |
|
$id = (i
nt)$_GET['
id'];
|
66 |
|
if( !$id
)
|
|
68 |
|
if( !$id
)
|
67 |
|
{
|
|
69 |
|
{
|
68 |
|
echo
MenuEditMs
g( 'Error'
, 'red' );
|
|
70 |
|
echo
MenuEditMs
g( 'Error'
, 'red' );
|
69 |
|
exit
;
|
|
71 |
|
exit
;
|
70 |
|
}
|
|
72 |
|
}
|
71 |
|
|
|
73 |
|
|
72 |
|
$aItemFi
elds = arr
ay( 'Name'
, 'Caption
', 'Link',
'Target'
);
|
|
74 |
|
$aItemFi
elds = arr
ay( 'Name'
, 'Caption
', 'Link',
'Target'
);
|
73 |
|
$aItem =
array();
|
|
75 |
|
$aItem =
array();
|
74 |
|
foreach(
$aItemFie
lds as $fi
eld )
|
|
76 |
|
foreach(
$aItemFie
lds as $fi
eld )
|
75 |
|
$aIt
em[$field]
= $_GET[$
field];
|
|
77 |
|
$aIt
em[$field]
= $_GET[$
field];
|
76 |
|
|
|
78 |
|
|
77 |
|
$aVis =
array();
|
|
79 |
|
$aVis =
array();
|
78 |
|
if( (int
)$_GET['Vi
sible_non'
] )
|
|
80 |
|
if( (int
)$_GET['Vi
sible_non'
] )
|
79 |
|
$aVi
s[] = 'non
';
|
|
81 |
|
$aVi
s[] = 'non
';
|
80 |
|
if( (int
)$_GET['Vi
sible_memb
'] )
|
|
82 |
|
if( (int
)$_GET['Vi
sible_memb
'] )
|
81 |
|
$aVi
s[] = 'mem
b';
|
|
83 |
|
$aVi
s[] = 'mem
b';
|
82 |
|
|
|
84 |
|
|
83 |
|
$aItem['
Visible']
= implode(
',', $aVi
s );
|
|
85 |
|
$aItem['
Visible']
= implode(
',', $aVi
s );
|
84 |
|
$res = s
aveItem( $
id, $aItem
);
|
|
86 |
|
$res = s
aveItem( $
id, $aItem
);
|
85 |
|
updateLa
ngFile( $_
GET['Capti
on'], $_GE
T['LangCap
tion'] );
|
|
87 |
|
updateLa
ngFile( $_
GET['Capti
on'], $_GE
T['LangCap
tion'] );
|
86 |
|
echo $re
s;
|
|
88 |
|
echo $re
s;
|
87 |
|
ex
it;
|
|
89 |
|
ex
it;
|
88 |
|
ca
se 'delete
_item':
|
|
90 |
|
ca
se 'delete
_item':
|
89 |
|
$id = (i
nt)$_GET['
id'];
|
|
91 |
|
$id = (i
nt)$_GET['
id'];
|
90 |
|
if( !$id
)
|
|
92 |
|
if( !$id
)
|
91 |
|
{
|
|
93 |
|
{
|
92 |
|
echo
'Item ID
is not spe
cified';
|
|
94 |
|
echo
'Item ID
is not spe
cified';
|
93 |
|
exit
;
|
|
95 |
|
exit
;
|
94 |
|
}
|
|
96 |
|
}
|
95 |
|
|
|
97 |
|
|
96 |
|
$aItem =
db_arr( "
SELECT `De
letable` F
ROM `TopMe
nu` WHERE
`ID` = $id
" );
|
|
98 |
|
$aItem =
db_arr( "
SELECT `De
letable` F
ROM `TopMe
nu` WHERE
`ID` = $id
" );
|
97 |
|
if( !$aI
tem )
|
|
99 |
|
if( !$aI
tem )
|
98 |
|
{
|
|
100 |
|
{
|
99 |
|
echo
'Item not
found';
|
|
101 |
|
echo
'Item not
found';
|
100 |
|
exit
;
|
|
102 |
|
exit
;
|
101 |
|
}
|
|
103 |
|
}
|
102 |
|
|
|
104 |
|
|
103 |
|
if( !(in
t)$aItem['
Deletable'
] )
|
|
105 |
|
if( !(in
t)$aItem['
Deletable'
] )
|
104 |
|
{
|
|
106 |
|
{
|
105 |
|
echo
'Item is
non-deleta
ble';
|
|
107 |
|
echo
'Item is
non-deleta
ble';
|
106 |
|
exit
;
|
|
108 |
|
exit
;
|
107 |
|
}
|
|
109 |
|
}
|
108 |
|
|
|
110 |
|
|
109 |
|
db_res(
"DELETE FR
OM `TopMen
u` WHERE `
ID` = $id"
);
|
|
111 |
|
db_res(
"DELETE FR
OM `TopMen
u` WHERE `
ID` = $id"
);
|
110 |
|
if( mysq
l_affected
_rows() )
|
|
112 |
|
if( mysq
l_affected
_rows() )
|
111 |
|
echo
'OK';
|
|
113 |
|
echo
'OK';
|
112 |
|
else
|
|
114 |
|
else
|
113 |
|
echo
'Couldn\'
t delete t
he item';
|
|
115 |
|
echo
'Couldn\'
t delete t
he item';
|
114 |
|
compile
Menus
();
|
|
116 |
|
$oMenu
->
compile
();
|
115 |
|
ex
it;
|
|
117 |
|
ex
it;
|
116 |
|
ca
se 'save_o
rders':
|
|
118 |
|
ca
se 'save_o
rders':
|
117 |
|
$sTop =
$_GET['top
'];
|
|
119 |
|
$sTop =
$_GET['top
'];
|
118 |
|
$aCustom
= $_GET['
custom'];
|
|
120 |
|
$aCustom
= $_GET['
custom'];
|
119 |
|
saveOrde
rs( $sTop,
$aCustom
);
|
|
121 |
|
saveOrde
rs( $sTop,
$aCustom
);
|
120 |
|
echo 'OK
';
|
|
122 |
|
echo 'OK
';
|
121 |
|
ex
it;
|
|
123 |
|
ex
it;
|
122 |
|
}
|
|
124 |
|
}
|
123 |
|
}
|
|
125 |
|
}
|
124 |
|
|
|
126 |
|
|
125 |
|
|
|
127 |
|
|
126 |
|
$sTopQuery
= "SELECT
`ID`, `Na
me` FROM `
TopMenu` W
HERE `Acti
ve`=1 AND
`Type`='to
p' ORDER B
Y `Order`"
;
|
|
128 |
|
$sTopQuery
= "SELECT
`ID`, `Na
me` FROM `
TopMenu` W
HERE `Acti
ve`=1 AND
`Type`='to
p' ORDER B
Y `Order`"
;
|
127 |
|
$rTopItems
= db_res(
$sTopQuer
y );
|
|
129 |
|
$rTopItems
= db_res(
$sTopQuer
y );
|
128 |
|
|
|
130 |
|
|
129 |
|
$sSysQuery
= "SELECT
`ID`, `Na
me` FROM `
TopMenu` W
HERE `Acti
ve`=1 AND
`Type`='sy
stem' ORDE
R BY `Orde
r`";
|
|
131 |
|
$sSysQuery
= "SELECT
`ID`, `Na
me` FROM `
TopMenu` W
HERE `Acti
ve`=1 AND
`Type`='sy
stem' ORDE
R BY `Orde
r`";
|
130 |
|
$rSysItems
= db_res(
$sSysQuer
y );
|
|
132 |
|
$rSysItems
= db_res(
$sSysQuer
y );
|
131 |
|
|
|
133 |
|
|
132 |
|
$sAllQuery
= "SELECT
`ID`, `Na
me` FROM `
TopMenu` W
HERE `Type
`!='system
'";
|
|
134 |
|
$sAllQuery
= "SELECT
`ID`, `Na
me` FROM `
TopMenu` W
HERE `Type
`!='system
'";
|
133 |
|
$rAllItems
= db_res(
$sAllQuer
y );
|
|
135 |
|
$rAllItems
= db_res(
$sAllQuer
y );
|
134 |
|
|
|
136 |
|
|
135 |
|
$sComposer
Init = "
|
|
137 |
|
$sComposer
Init = "
|
136 |
|
<scrip
t type=\"t
ext/javasc
ript\">
|
|
138 |
|
<scrip
t type=\"t
ext/javasc
ript\">
|
137 |
|
to
pParentID
= 'menu_ap
p_wrapper'
;
|
|
139 |
|
to
pParentID
= 'menu_ap
p_wrapper'
;
|
138 |
|
ur
lIconLoadi
ng = '{$si
te['url_ad
min']}imag
es/loading
.gif';
|
|
140 |
|
ur
lIconLoadi
ng = '{$si
te['url_ad
min']}imag
es/loading
.gif';
|
139 |
|
parserUrl
=
'{$_SERVER
['PHP_SELF
']}
';
|
|
141 |
|
parserUrl
=
'{$_SERVER
['PHP_SELF
']}
?
';
|
140 |
|
|
|
142 |
|
|
141 |
|
al
lowNewItem
= true;
|
|
143 |
|
al
lowNewItem
= true;
|
142 |
|
al
lowAddToTo
p = true;
|
|
144 |
|
al
lowAddToTo
p = true;
|
143 |
|
iI
nactivePer
Row = 7;
|
|
145 |
|
iI
nactivePer
Row = 7;
|
144 |
|
se
ndSystemOr
der = fals
e;
|
|
146 |
|
se
ndSystemOr
der = fals
e;
|
145 |
|
|
|
147 |
|
|
146 |
|
aC
oords = ne
w Array();
|
|
148 |
|
aC
oords = ne
w Array();
|
147 |
|
aC
oords['sta
rtX'] = 27
5;
|
|
149 |
|
aC
oords['sta
rtX'] = 27
5;
|
148 |
|
aC
oords['sta
rtY'] = 20
0;
|
|
150 |
|
aC
oords['sta
rtY'] = 20
0;
|
149 |
|
aC
oords['wid
th'] = 92
;
|
|
151 |
|
aC
oords['wid
th'] = 92
;
|
150 |
|
aC
oords['hei
ght'] = 21
;
|
|
152 |
|
aC
oords['hei
ght'] = 21
;
|
151 |
|
aC
oords['dif
fX'] = 12
2;
|
|
153 |
|
aC
oords['dif
fX'] = 12
2;
|
152 |
|
aC
oords['dif
fY'] = 32
;
|
|
154 |
|
aC
oords['dif
fY'] = 32
;
|
153 |
|
|
|
155 |
|
|
154 |
|
aT
opItems =
new Array(
);
|
|
156 |
|
aT
opItems =
new Array(
);
|
155 |
|
aC
ustomItems
= new Arr
ay();
|
|
157 |
|
aC
ustomItems
= new Arr
ay();
|
156 |
|
aS
ystemItems
= new Arr
ay();
|
|
158 |
|
aS
ystemItems
= new Arr
ay();
|
157 |
|
aA
llItems =
new Array(
);
|
|
159 |
|
aA
llItems =
new Array(
);
|
158 |
|
";
|
|
160 |
|
";
|
159 |
|
|
|
161 |
|
|
160 |
|
while( $aT
opItem = m
ysql_fetch
_assoc( $r
TopItems )
)
|
|
162 |
|
while( $aT
opItem = m
ysql_fetch
_assoc( $r
TopItems )
)
|
161 |
|
{
|
|
163 |
|
{
|
162 |
|
$sComp
oserInit .
= "
|
|
164 |
|
$sComp
oserInit .
= "
|
163 |
|
|
|
165 |
|
|
164 |
|
aT
opItems[{$
aTopItem['
ID']}] = '
" . addsla
shes( $aTo
pItem['Nam
e'] ) . "'
;
|
|
166 |
|
aT
opItems[{$
aTopItem['
ID']}] = '
" . addsla
shes( $aTo
pItem['Nam
e'] ) . "'
;
|
165 |
|
aC
ustomItems
[{$aTopIte
m['ID']}]
= new Arra
y();";
|
|
167 |
|
aC
ustomItems
[{$aTopIte
m['ID']}]
= new Arra
y();";
|
166 |
|
$sQuer
y = "SELEC
T `ID`, `N
ame` FROM
`TopMenu`
WHERE `Act
ive`=1 AND
`Type`='c
ustom' AND
`Parent`=
{$aTopItem
['ID']} OR
DER BY `Or
der`";
|
|
168 |
|
$sQuer
y = "SELEC
T `ID`, `N
ame` FROM
`TopMenu`
WHERE `Act
ive`=1 AND
`Type`='c
ustom' AND
`Parent`=
{$aTopItem
['ID']} OR
DER BY `Or
der`";
|
167 |
|
|
|
169 |
|
|
168 |
|
$rCust
omItems =
db_res( $s
Query );
|
|
170 |
|
$rCust
omItems =
db_res( $s
Query );
|
169 |
|
while(
$aCustomI
tem = mysq
l_fetch_as
soc( $rCus
tomItems )
)
|
|
171 |
|
while(
$aCustomI
tem = mysq
l_fetch_as
soc( $rCus
tomItems )
)
|
170 |
|
{
|
|
172 |
|
{
|
171 |
|
$s
ComposerIn
it .= "
|
|
173 |
|
$s
ComposerIn
it .= "
|
172 |
|
aC
ustomItems
[{$aTopIte
m['ID']}][
{$aCustomI
tem['ID']}
] = '" . a
ddslashes(
$aCustomI
tem['Name'
] ) . "';"
;
|
|
174 |
|
aC
ustomItems
[{$aTopIte
m['ID']}][
{$aCustomI
tem['ID']}
] = '" . a
ddslashes(
$aCustomI
tem['Name'
] ) . "';"
;
|
173 |
|
}
|
|
175 |
|
}
|
174 |
|
}
|
|
176 |
|
}
|
175 |
|
|
|
177 |
|
|
176 |
|
while( $aS
ystemItem
= mysql_fe
tch_assoc(
$rSysItem
s ) )
|
|
178 |
|
while( $aS
ystemItem
= mysql_fe
tch_assoc(
$rSysItem
s ) )
|
177 |
|
{
|
|
179 |
|
{
|
178 |
|
$sComp
oserInit .
= "
|
|
180 |
|
$sComp
oserInit .
= "
|
179 |
|
|
|
181 |
|
|
180 |
|
aS
ystemItems
[{$aSystem
Item['ID']
}] = '" .
addslashes
( $aSystem
Item['Name
'] ) . "';
|
|
182 |
|
aS
ystemItems
[{$aSystem
Item['ID']
}] = '" .
addslashes
( $aSystem
Item['Name
'] ) . "';
|
181 |
|
aC
ustomItems
[{$aSystem
Item['ID']
}] = new A
rray();";
|
|
183 |
|
aC
ustomItems
[{$aSystem
Item['ID']
}] = new A
rray();";
|
182 |
|
$sQuer
y = "SELEC
T `ID`, `N
ame` FROM
`TopMenu`
WHERE `Act
ive`=1 AND
`Type`='c
ustom' AND
`Parent`=
{$aSystemI
tem['ID']}
ORDER BY
`Order`";
|
|
184 |
|
$sQuer
y = "SELEC
T `ID`, `N
ame` FROM
`TopMenu`
WHERE `Act
ive`=1 AND
`Type`='c
ustom' AND
`Parent`=
{$aSystemI
tem['ID']}
ORDER BY
`Order`";
|
183 |
|
|
|
185 |
|
|
184 |
|
$rCust
omItems =
db_res( $s
Query );
|
|
186 |
|
$rCust
omItems =
db_res( $s
Query );
|
185 |
|
while(
$aCustomI
tem = mysq
l_fetch_as
soc( $rCus
tomItems )
)
|
|
187 |
|
while(
$aCustomI
tem = mysq
l_fetch_as
soc( $rCus
tomItems )
)
|
186 |
|
{
|
|
188 |
|
{
|
187 |
|
$s
ComposerIn
it .= "
|
|
189 |
|
$s
ComposerIn
it .= "
|
188 |
|
aC
ustomItems
[{$aSystem
Item['ID']
}][{$aCust
omItem['ID
']}] = '"
. addslash
es( $aCust
omItem['Na
me'] ) . "
';";
|
|
190 |
|
aC
ustomItems
[{$aSystem
Item['ID']
}][{$aCust
omItem['ID
']}] = '"
. addslash
es( $aCust
omItem['Na
me'] ) . "
';";
|
189 |
|
}
|
|
191 |
|
}
|
190 |
|
}
|
|
192 |
|
}
|
191 |
|
|
|
193 |
|
|
192 |
|
$sComposer
Init .= "\
n";
|
|
194 |
|
$sComposer
Init .= "\
n";
|
193 |
|
while( $aA
llItem = m
ysql_fetch
_assoc( $r
AllItems )
)
|
|
195 |
|
while( $aA
llItem = m
ysql_fetch
_assoc( $r
AllItems )
)
|
194 |
|
{
|
|
196 |
|
{
|
195 |
|
$sComp
oserInit .
= "
|
|
197 |
|
$sComp
oserInit .
= "
|
196 |
|
aA
llItems[{$
aAllItem['
ID']}] = '
" . addsla
shes( $aAl
lItem['Nam
e'] ) . "'
;";
|
|
198 |
|
aA
llItems[{$
aAllItem['
ID']}] = '
" . addsla
shes( $aAl
lItem['Nam
e'] ) . "'
;";
|
197 |
|
}
|
|
199 |
|
}
|
198 |
|
$sComp
oserInit .
= "
|
|
200 |
|
$sComp
oserInit .
= "
|
199 |
|
</scri
pt>
|
|
201 |
|
</scri
pt>
|
200 |
|
";
|
|
202 |
|
";
|
201 |
|
|
|
203 |
|
|
202 |
|
|
|
204 |
|
|
203 |
|
$_page['ex
traCodeInH
ead'] = <<
<EOJ
|
|
205 |
|
$_page['ex
traCodeInH
ead'] = <<
<EOJ
|
204 |
|
$sComp
oserInit
|
|
206 |
|
$sComp
oserInit
|
205 |
|
<scrip
t type="te
xt/javascr
ipt" src="
{$site['ur
l']}inc/js
/classes/B
xDolMenu.j
s"></scrip
t>
|
|
207 |
|
<scrip
t type="te
xt/javascr
ipt" src="
{$site['ur
l']}inc/js
/classes/B
xDolMenu.j
s"></scrip
t>
|
206 |
|
<scrip
t type="te
xt/javascr
ipt" src="
menu_compo
se.js"></s
cript>
|
|
208 |
|
<scrip
t type="te
xt/javascr
ipt" src="
menu_compo
se.js"></s
cript>
|
207 |
|
EOJ;
|
|
209 |
|
EOJ;
|
208 |
|
|
|
210 |
|
|
209 |
|
|
|
211 |
|
|
210 |
|
$_page['ex
traCodeInB
ody'] = <<
<EOJ
|
|
212 |
|
$_page['ex
traCodeInB
ody'] = <<
<EOJ
|
211 |
|
<div i
d="edit_fo
rm_wrapper
" style="d
isplay:non
e;" onclic
k="e = eve
nt; t = (
e.target |
| e.srcEle
ment ); if
( t.id ==
this.id )
hideEditF
orm();">
|
|
213 |
|
<div i
d="edit_fo
rm_wrapper
" style="d
isplay:non
e;" onclic
k="e = eve
nt; t = (
e.target |
| e.srcEle
ment ); if
( t.id ==
this.id )
hideEditF
orm();">
|
212 |
|
<d
iv id="edi
t_form_con
t"></div>
|
|
214 |
|
<d
iv id="edi
t_form_con
t"></div>
|
213 |
|
</div>
|
|
215 |
|
</div>
|
214 |
|
<div i
d="menu_ap
p_wrapper"
></div>
|
|
216 |
|
<div i
d="menu_ap
p_wrapper"
></div>
|
215 |
|
EOJ;
|
|
217 |
|
EOJ;
|
216 |
|
|
|
218 |
|
|
217 |
|
TopCodeAdm
in();
|
|
219 |
|
TopCodeAdm
in();
|
218 |
|
?>
|
|
220 |
|
?>
|
219 |
|
<div c
lass="pseu
do_wrapper
">
|
|
221 |
|
<div c
lass="pseu
do_wrapper
">
|
220 |
|
<d
iv class="
pseudo_hea
d">Active
Items</div
>
|
|
222 |
|
<d
iv class="
pseudo_hea
d">Active
Items</div
>
|
221 |
|
<d
iv id="pse
udo1">
|
|
223 |
|
<d
iv id="pse
udo1">
|
222 |
|
<img src
="<?= $sit
e['url_adm
in'] . 'im
ages/loadi
ng.gif' ?>
" />
|
|
224 |
|
<img src
="<?= $sit
e['url_adm
in'] . 'im
ages/loadi
ng.gif' ?>
" />
|
223 |
|
</
div>
|
|
225 |
|
</
div>
|
224 |
|
<d
iv class="
pseudo_hea
d">All Ite
ms</div>
|
|
226 |
|
<d
iv class="
pseudo_hea
d">All Ite
ms</div>
|
225 |
|
<d
iv id="pse
udo2">
|
|
227 |
|
<d
iv id="pse
udo2">
|
226 |
|
<img src
="<?= $sit
e['url_adm
in'] . 'im
ages/loadi
ng.gif' ?>
" />
|
|
228 |
|
<img src
="<?= $sit
e['url_adm
in'] . 'im
ages/loadi
ng.gif' ?>
" />
|
227 |
|
</
div>
|
|
229 |
|
</
div>
|
228 |
|
</div>
|
|
230 |
|
</div>
|
229 |
|
<?
|
|
231 |
|
<?
|
230 |
|
BottomCode
();
|
|
232 |
|
BottomCode
();
|
231 |
|
|
|
233 |
|
|
232 |
|
|
|
234 |
|
|
233 |
|
|
|
235 |
|
|
234 |
|
function s
howEditFor
m( $aItem
)
|
|
236 |
|
function s
howEditFor
m( $aItem
)
|
235 |
|
{
|
|
237 |
|
{
|
236 |
|
if( !$
aItem['Edi
table'] )
|
|
238 |
|
if( !$
aItem['Edi
table'] )
|
237 |
|
$d
isabled =
'disabled=
"disabled"
';
|
|
239 |
|
$d
isabled =
'disabled=
"disabled"
';
|
238 |
|
else
|
|
240 |
|
else
|
239 |
|
$d
isabled =
'';
|
|
241 |
|
$d
isabled =
'';
|
240 |
|
|
|
242 |
|
|
241 |
|
?>
|
|
243 |
|
?>
|
242 |
|
<form name
="formItem
Edit" id="
formItemEd
it">
|
|
244 |
|
<form name
="formItem
Edit" id="
formItemEd
it">
|
243 |
|
<table
class="po
pup_form_w
rapper">
|
|
245 |
|
<table
class="po
pup_form_w
rapper">
|
244 |
|
<t
r>
|
|
246 |
|
<t
r>
|
245 |
|
<td clas
s="corner"
><img src=
"images/op
_cor_tl.pn
g" /></td>
|
|
247 |
|
<td clas
s="corner"
><img src=
"images/op
_cor_tl.pn
g" /></td>
|
246 |
|
<td
class="sid
e_ver"><im
g
src="image
s/spacer.g
if"
/></td>
|
|
248 |
|
<td
class="sid
e_ver"><im
g
src="image
s/spacer.g
if"
alt=""
/></td>
|
247 |
|
<td clas
s="corner"
><img src=
"images/op
_cor_tr.pn
g" /></td>
|
|
249 |
|
<td clas
s="corner"
><img src=
"images/op
_cor_tr.pn
g" /></td>
|
248 |
|
</
tr>
|
|
250 |
|
</
tr>
|
249 |
|
<t
r>
|
|
251 |
|
<t
r>
|
250 |
|
<td
class="sid
e"><img
src="image
s/spacer.g
if"
/></td>
|
|
252 |
|
<td
class="sid
e"><img
src="image
s/spacer.g
if"
alt=""
/></td>
|
251 |
|
|
|
253 |
|
|
252 |
|
<td clas
s="contain
er">
|
|
254 |
|
<td clas
s="contain
er">
|
253 |
|
<div
class="ed
it_item_ta
ble_cont">
|
|
255 |
|
<div
class="ed
it_item_ta
ble_cont">
|
254 |
|
|
|
256 |
|
|
255 |
|
<table cla
ss="edit_i
tem_table"
id="tmp_i
d_name" >
|
|
257 |
|
<table cla
ss="edit_i
tem_table"
id="tmp_i
d_name" >
|
256 |
|
<tr>
|
|
258 |
|
<tr>
|
257 |
|
<t
d class="f
orm_label"
>System Na
me:</td>
|
|
259 |
|
<t
d class="f
orm_label"
>System Na
me:</td>
|
258 |
|
<t
d>
|
|
260 |
|
<t
d>
|
259 |
|
<input t
ype="text"
class="fo
rm_input_t
ext" name=
"Name" val
ue="<?= $a
Item['Name
'] ?>" <?=
$disabled?
> />
|
|
261 |
|
<input t
ype="text"
class="fo
rm_input_t
ext" name=
"Name" val
ue="<?= $a
Item['Name
'] ?>" <?=
$disabled?
> />
|
260 |
|
</
td>
|
|
262 |
|
</
td>
|
261 |
|
</tr>
|
|
263 |
|
</tr>
|
262 |
|
<tr>
|
|
264 |
|
<tr>
|
263 |
|
<t
d class="f
orm_label"
>Language
Key:</td>
|
|
265 |
|
<t
d class="f
orm_label"
>Language
Key:</td>
|
264 |
|
<t
d>
|
|
266 |
|
<t
d>
|
265 |
|
<input t
ype="text"
class="fo
rm_input_t
ext" name=
"Caption"
value="<?=
$aItem['C
aption'] ?
>" <?=$dis
abled?> />
|
|
267 |
|
<input t
ype="text"
class="fo
rm_input_t
ext" name=
"Caption"
value="<?=
$aItem['C
aption'] ?
>" <?=$dis
abled?> />
|
266 |
|
</
td>
|
|
268 |
|
</
td>
|
267 |
|
</tr>
|
|
269 |
|
</tr>
|
268 |
|
<tr>
|
|
270 |
|
<tr>
|
269 |
|
<t
d class="f
orm_label"
>Default N
ame:</td>
|
|
271 |
|
<t
d class="f
orm_label"
>Default N
ame:</td>
|
270 |
|
<t
d>
|
|
272 |
|
<t
d>
|
271 |
|
<input t
ype="text"
class="fo
rm_input_t
ext" name=
"LangCapti
on" value=
"<?= _t( $
aItem['Cap
tion'] ) ?
>" <?=$dis
abled?> />
|
|
273 |
|
<input t
ype="text"
class="fo
rm_input_t
ext" name=
"LangCapti
on" value=
"<?= _t( $
aItem['Cap
tion'] ) ?
>" <?=$dis
abled?> />
|
272 |
|
</
td>
|
|
274 |
|
</
td>
|
273 |
|
</tr>
|
|
275 |
|
</tr>
|
274 |
|
<tr>
|
|
276 |
|
<tr>
|
275 |
|
<t
d class="f
orm_label"
>URL:</td>
|
|
277 |
|
<t
d class="f
orm_label"
>URL:</td>
|
276 |
|
<t
d>
|
|
278 |
|
<t
d>
|
277 |
|
<input t
ype="text"
class="fo
rm_input_t
ext" name=
"Link" val
ue="<?= ht
mlspecialc
hars_adv(
$aItem['Li
nk'] ) ?>"
<?=$disab
led?> />
|
|
279 |
|
<input t
ype="text"
class="fo
rm_input_t
ext" name=
"Link" val
ue="<?= ht
mlspecialc
hars_adv(
$aItem['Li
nk'] ) ?>"
<?=$disab
led?> />
|
278 |
|
</
td>
|
|
280 |
|
</
td>
|
279 |
|
</tr>
|
|
281 |
|
</tr>
|
280 |
|
<tr>
|
|
282 |
|
<tr>
|
281 |
|
<t
d class="f
orm_label"
>Target Wi
ndow:</td>
|
|
283 |
|
<t
d class="f
orm_label"
>Target Wi
ndow:</td>
|
282 |
|
<t
d>
|
|
284 |
|
<t
d>
|
283 |
|
<input t
ype="radio
" name="Ta
rget" valu
e=""
<?= ( ( $
aItem['Tar
get'] == '
' )
? 'checked
="checked"
' : '' ) ?
> <?=$disa
bled?> />
Same
|
|
285 |
|
<input t
ype="radio
" name="Ta
rget" valu
e=""
<?= ( ( $
aItem['Tar
get'] == '
' )
? 'checked
="checked"
' : '' ) ?
> <?=$disa
bled?> />
Same
|
284 |
|
<input t
ype="radio
" name="Ta
rget" valu
e="_blank"
<?= ( ( $
aItem['Tar
get'] == '
_blank' )
? 'checked
="checked"
' : '' ) ?
> <?=$disa
bled?> />
New
|
|
286 |
|
<input t
ype="radio
" name="Ta
rget" valu
e="_blank"
<?= ( ( $
aItem['Tar
get'] == '
_blank' )
? 'checked
="checked"
' : '' ) ?
> <?=$disa
bled?> />
New
|
285 |
|
</
td>
|
|
287 |
|
</
td>
|
286 |
|
</tr>
|
|
288 |
|
</tr>
|
287 |
|
<tr>
|
|
289 |
|
<tr>
|
288 |
|
<t
d class="f
orm_label"
>Visible f
or:</td>
|
|
290 |
|
<t
d class="f
orm_label"
>Visible f
or:</td>
|
289 |
|
<t
d>
|
|
291 |
|
<t
d>
|
290 |
|
<input t
ype="check
box" name=
"Visible_n
on" value
="on" <?=
( ( strpos
( $aItem['
Visible'],
'non' )
=== false
) ? '' : '
checked="c
hecked"' )
?> <?=$di
sabled?> /
> Guest
|
|
292 |
|
<input t
ype="check
box" name=
"Visible_n
on" value
="on" <?=
( ( strpos
( $aItem['
Visible'],
'non' )
=== false
) ? '' : '
checked="c
hecked"' )
?> <?=$di
sabled?> /
> Guest
|
291 |
|
<input t
ype="check
box" name=
"Visible_m
emb" value
="on" <?=
( ( strpos
( $aItem['
Visible'],
'memb' )
=== false
) ? '' : '
checked="c
hecked"' )
?> <?=$di
sabled?> /
> Member
|
|
293 |
|
<input t
ype="check
box" name=
"Visible_m
emb" value
="on" <?=
( ( strpos
( $aItem['
Visible'],
'memb' )
=== false
) ? '' : '
checked="c
hecked"' )
?> <?=$di
sabled?> /
> Member
|
292 |
|
</
td>
|
|
294 |
|
</
td>
|
293 |
|
</tr>
|
|
295 |
|
</tr>
|
294 |
|
<tr>
|
|
296 |
|
<tr>
|
295 |
|
<t
d class="f
orm_colspa
n" colspan
="2">
|
|
297 |
|
<t
d class="f
orm_colspa
n" colspan
="2">
|
296 |
|
<? if( $
aItem['Edi
table'] ){
?><input
type="butt
on" value=
"Save Chan
ges" oncli
ck="saveIt
em(<?= $aI
tem['ID']
?>);" /><?
} ?>
|
|
298 |
|
<? if( $
aItem['Edi
table'] ){
?><input
type="butt
on" value=
"Save Chan
ges" oncli
ck="saveIt
em(<?= $aI
tem['ID']
?>);" /><?
} ?>
|
297 |
|
<input t
ype="butto
n" onclick
="hideEdit
Form();" v
alue="Canc
el" />
|
|
299 |
|
<input t
ype="butto
n" onclick
="hideEdit
Form();" v
alue="Canc
el" />
|
298 |
|
<? if( $
aItem['Del
etable'] )
{ ?><input
type="but
ton" value
="Delete"
onclick="d
eleteItem(
<?= $aItem
['ID'] ?>)
;" /><? }
?>
|
|
300 |
|
<? if( $
aItem['Del
etable'] )
{ ?><input
type="but
ton" value
="Delete"
onclick="d
eleteItem(
<?= $aItem
['ID'] ?>)
;" /><? }
?>
|
299 |
|
</
td>
|
|
301 |
|
</
td>
|
300 |
|
</table>
|
|
302 |
|
</table>
|
301 |
|
|
|
303 |
|
|
302 |
|
</di
v>
|
|
304 |
|
</di
v>
|
303 |
|
</td>
|
|
305 |
|
</td>
|
304 |
|
|
|
306 |
|
|
305 |
|
<td
class="sid
e"><img
src="image
s/spacer.g
if"
/></td>
|
|
307 |
|
<td
class="sid
e"><img
src="image
s/spacer.g
if"
alt=""
/></td>
|
306 |
|
</
tr>
|
|
308 |
|
</
tr>
|
307 |
|
<t
r>
|
|
309 |
|
<t
r>
|
308 |
|
<td clas
s="corner"
><img src=
"images/op
_cor_bl.pn
g" /></td>
|
|
310 |
|
<td clas
s="corner"
><img src=
"images/op
_cor_bl.pn
g" /></td>
|
309 |
|
<td
class="sid
e_ver"><im
g
src="image
s/spacer.g
if"
/></td>
|
|
311 |
|
<td
class="sid
e_ver"><im
g
src="image
s/spacer.g
if"
alt=""
/></td>
|
310 |
|
<td clas
s="corner"
><img src=
"images/op
_cor_br.pn
g" onload=
"if( navig
ator.appNa
me == 'Mic
rosoft Int
ernet Expl
orer' && v
ersion >=
5.5 && ver
sion < 7 )
png_fix()
;" /></td>
|
|
312 |
|
<td clas
s="corner"
><img src=
"images/op
_cor_br.pn
g" onload=
"if( navig
ator.appNa
me == 'Mic
rosoft Int
ernet Expl
orer' && v
ersion >=
5.5 && ver
sion < 7 )
png_fix()
;" /></td>
|
311 |
|
</
tr>
|
|
313 |
|
</
tr>
|
312 |
|
</tabl
e>
|
|
314 |
|
</tabl
e>
|
313 |
|
</form>
|
|
315 |
|
</form>
|
314 |
|
<?
|
|
316 |
|
<?
|
315 |
|
}
|
|
317 |
|
}
|
316 |
|
|
|
318 |
|
|
317 |
|
function c
reateNewEl
ement( $ty
pe, $sourc
e )
|
|
319 |
|
function c
reateNewEl
ement( $ty
pe, $sourc
e )
|
318 |
|
{
|
|
320 |
|
{
|
|
|
321 |
|
global
$oMenu;
|
|
|
322 |
|
|
319 |
|
if( $s
ource )
|
|
323 |
|
if( $s
ource )
|
320 |
|
{
|
|
324 |
|
{
|
321 |
|
$s
ourceActiv
e = db_val
ue( "SELEC
T `Active`
FROM `Top
Menu` WHER
E `ID`=$so
urce" );
|
|
325 |
|
$s
ourceActiv
e = db_val
ue( "SELEC
T `Active`
FROM `Top
Menu` WHER
E `ID`=$so
urce" );
|
322 |
|
if
( !$source
Active )
|
|
326 |
|
if
( !$source
Active )
|
323 |
|
{
|
|
327 |
|
{
|
324 |
|
//conver
t to activ
e
|
|
328 |
|
//conver
t to activ
e
|
325 |
|
db_res(
"UPDATE `T
opMenu` SE
T `Active`
=1, `Type`
='$type' W
HERE `ID`=
$source" )
;
|
|
329 |
|
db_res(
"UPDATE `T
opMenu` SE
T `Active`
=1, `Type`
='$type' W
HERE `ID`=
$source" )
;
|
326 |
|
$newID =
$source;
|
|
330 |
|
$newID =
$source;
|
327 |
|
}
|
|
331 |
|
}
|
328 |
|
el
se
|
|
332 |
|
el
se
|
329 |
|
{
|
|
333 |
|
{
|
330 |
|
//create
from sour
ce
|
|
334 |
|
//create
from sour
ce
|
331 |
|
db_res(
"INSERT IN
TO `TopMen
u`
|
|
335 |
|
db_res(
"INSERT IN
TO `TopMen
u`
|
332 |
|
( `Nam
e`, `Capti
on`, `Link
`, `Visibl
e`, `Targe
t`, `Oncli
ck`, `Chec
k`, `Type`
)
|
|
336 |
|
( `Nam
e`, `Capti
on`, `Link
`, `Visibl
e`, `Targe
t`, `Oncli
ck`, `Chec
k`, `Type`
)
|
333 |
|
SELECT
|
|
337 |
|
SELECT
|
334 |
|
`Nam
e`, `Capti
on`, `Link
`, `Visibl
e`, `Targe
t`, `Oncli
ck`, `Chec
k`, '$type
'
|
|
338 |
|
`Nam
e`, `Capti
on`, `Link
`, `Visibl
e`, `Targe
t`, `Oncli
ck`, `Chec
k`, '$type
'
|
335 |
|
FROM `TopM
enu`
|
|
339 |
|
FROM `TopM
enu`
|
336 |
|
WHERE `ID`
=$source"
);
|
|
340 |
|
WHERE `ID`
=$source"
);
|
337 |
|
$newID =
mysql_ins
ert_id();
|
|
341 |
|
$newID =
mysql_ins
ert_id();
|
338 |
|
}
|
|
342 |
|
}
|
339 |
|
}
|
|
343 |
|
}
|
340 |
|
else
|
|
344 |
|
else
|
341 |
|
{
|
|
345 |
|
{
|
342 |
|
//
create new
|
|
346 |
|
//
create new
|
343 |
|
db
_res( "INS
ERT INTO `
TopMenu` (
`Name`, `
Type` ) VA
LUES ( 'NE
W ITEM', '
$type' )"
);
|
|
347 |
|
db
_res( "INS
ERT INTO `
TopMenu` (
`Name`, `
Type` ) VA
LUES ( 'NE
W ITEM', '
$type' )"
);
|
344 |
|
$n
ewID = mys
ql_insert_
id();
|
|
348 |
|
$n
ewID = mys
ql_insert_
id();
|
345 |
|
}
|
|
349 |
|
}
|
346 |
|
|
|
350 |
|
|
347 |
|
compile
Menus
();
|
|
351 |
|
$oMenu
->
compile
();
|
348 |
|
return
$newID;
|
|
352 |
|
return
$newID;
|
349 |
|
}
|
|
353 |
|
}
|
350 |
|
|
|
354 |
|
|
351 |
|
function e
choMenuEdi
tMsg( $tex
t, $color
= 'black'
)
|
|
355 |
|
function e
choMenuEdi
tMsg( $tex
t, $color
= 'black'
)
|
352 |
|
{
|
|
356 |
|
{
|
353 |
|
?>
|
|
357 |
|
?>
|
354 |
|
<d
iv onclick
="hideEdit
Form();" s
tyle="colo
r:<?= $col
or ?>;text
-align:cen
ter;"><?=
$text ?></
div>
|
|
358 |
|
<d
iv onclick
="hideEdit
Form();" s
tyle="colo
r:<?= $col
or ?>;text
-align:cen
ter;"><?=
$text ?></
div>
|
355 |
|
<s
cript type
="text/jav
ascript">s
etTimeout(
'hideEdit
Form();',
1000 )</sc
ript>
|
|
359 |
|
<s
cript type
="text/jav
ascript">s
etTimeout(
'hideEdit
Form();',
1000 )</sc
ript>
|
356 |
|
<?
|
|
360 |
|
<?
|
357 |
|
}
|
|
361 |
|
}
|
358 |
|
|
|
362 |
|
|
359 |
|
function s
aveItem( $
id, $aItem
)
|
|
363 |
|
function s
aveItem( $
id, $aItem
)
|
360 |
|
{
|
|
364 |
|
{
|
|
|
365 |
|
global
$oMenu;
|
|
|
366 |
|
|
361 |
|
$aOldI
tem = db_a
rr( "SELEC
T * FROM `
TopMenu` W
HERE `ID`=
$id" );
|
|
367 |
|
$aOldI
tem = db_a
rr( "SELEC
T * FROM `
TopMenu` W
HERE `ID`=
$id" );
|
362 |
|
|
|
368 |
|
|
363 |
|
if( !$
aOldItem )
|
|
369 |
|
if( !$
aOldItem )
|
364 |
|
re
turn echoM
enuEditMsg
( 'Error.
Item not f
ound', 're
d' );
|
|
370 |
|
re
turn echoM
enuEditMsg
( 'Error.
Item not f
ound', 're
d' );
|
365 |
|
|
|
371 |
|
|
366 |
|
if( !(
bool)(int)
$aOldItem[
'Editable'
] )
|
|
372 |
|
if( !(
bool)(int)
$aOldItem[
'Editable'
] )
|
367 |
|
re
turn echoM
enuEditMsg
( 'Error.
Item is no
n-editable
', 'red' )
;
|
|
373 |
|
re
turn echoM
enuEditMsg
( 'Error.
Item is no
n-editable
', 'red' )
;
|
368 |
|
|
|
374 |
|
|
369 |
|
$sQuer
ySet = '';
|
|
375 |
|
$sQuer
ySet = '';
|
370 |
|
foreac
h( $aItem
as $field
=> $value
)
|
|
376 |
|
foreac
h( $aItem
as $field
=> $value
)
|
371 |
|
$s
QuerySet .
= ", `$fie
ld`='" . p
rocess_db_
input( $va
lue ) ."'"
;
|
|
377 |
|
$s
QuerySet .
= ", `$fie
ld`='" . p
rocess_db_
input( $va
lue ) ."'"
;
|
372 |
|
|
|
378 |
|
|
373 |
|
$sQuer
ySet = sub
str( $sQue
rySet, 1 )
;
|
|
379 |
|
$sQuer
ySet = sub
str( $sQue
rySet, 1 )
;
|
374 |
|
|
|
380 |
|
|
375 |
|
$sQuer
y = "UPDAT
E `TopMenu
` SET $sQu
erySet WHE
RE `ID` =
$id";
|
|
381 |
|
$sQuer
y = "UPDAT
E `TopMenu
` SET $sQu
erySet WHE
RE `ID` =
$id";
|
376 |
|
|
|
382 |
|
|
377 |
|
db_res
( $sQuery
);
|
|
383 |
|
db_res
( $sQuery
);
|
378 |
|
compile
Menus
();
|
|
384 |
|
$oMenu
->
compile
();
|
379 |
|
|
|
385 |
|
|
380 |
|
$ret =
echoMenuE
ditMsg( 'S
aved', 'gr
een' );
|
|
386 |
|
$ret =
echoMenuE
ditMsg( 'S
aved', 'gr
een' );
|
381 |
|
$ret .
= '<script
type="tex
t/javascri
pt">update
Item( ' .
$id . ', \
'' . proce
ss_db_inpu
t( $aItem[
'Name'] )
. '\' );</
script>';
|
|
387 |
|
$ret .
= '<script
type="tex
t/javascri
pt">update
Item( ' .
$id . ', \
'' . proce
ss_db_inpu
t( $aItem[
'Name'] )
. '\' );</
script>';
|
382 |
|
return
$ret;
|
|
388 |
|
return
$ret;
|
383 |
|
}
|
|
389 |
|
}
|
384 |
|
|
|
390 |
|
|
385 |
|
function u
pdateLangF
ile( $key,
$string )
|
|
391 |
|
function u
pdateLangF
ile( $key,
$string )
|
386 |
|
{
|
|
392 |
|
{
|
387 |
|
$langN
ame = getP
aram( 'lan
g_default'
);
|
|
393 |
|
$langN
ame = getP
aram( 'lan
g_default'
);
|
388 |
|
$langI
D = db_val
ue( "SELEC
T `ID` FRO
M `Localiz
ationLangu
ages` WHER
E `Name` =
'" . adds
lashes( $l
angName )
. "'" );
|
|
394 |
|
$langI
D = db_val
ue( "SELEC
T `ID` FRO
M `Localiz
ationLangu
ages` WHER
E `Name` =
'" . adds
lashes( $l
angName )
. "'" );
|
389 |
|
|
|
395 |
|
|
390 |
|
$keyID
= db_valu
e( "SELECT
`ID` FROM
`Localiza
tionKeys`
WHERE `Key
` = '" . p
rocess_db_
input( $ke
y ) . "'"
);
|
|
396 |
|
$keyID
= db_valu
e( "SELECT
`ID` FROM
`Localiza
tionKeys`
WHERE `Key
` = '" . p
rocess_db_
input( $ke
y ) . "'"
);
|
391 |
|
if( $k
eyID )
|
|
397 |
|
if( $k
eyID )
|
392 |
|
{
|
|
398 |
|
{
|
393 |
|
db
_res( "UPD
ATE `Local
izationStr
ings` SET
`String` =
'" .proce
ss_db_inpu
t( $string
) . "' WH
ERE `IDKey
`=$keyID A
ND `IDLang
uage`=$lan
gID" );
|
|
399 |
|
db
_res( "UPD
ATE `Local
izationStr
ings` SET
`String` =
'" .proce
ss_db_inpu
t( $string
) . "' WH
ERE `IDKey
`=$keyID A
ND `IDLang
uage`=$lan
gID" );
|
394 |
|
}
|
|
400 |
|
}
|
395 |
|
else
|
|
401 |
|
else
|
396 |
|
{
|
|
402 |
|
{
|
397 |
|
db
_res( "INS
ERT INTO `
Localizati
onKeys` SE
T `IDCateg
ory` = 2,
`Key` = '"
. process
_db_input(
$key ) .
"'" );
|
|
403 |
|
db
_res( "INS
ERT INTO `
Localizati
onKeys` SE
T `IDCateg
ory` = 2,
`Key` = '"
. process
_db_input(
$key ) .
"'" );
|
398 |
|
db
_res( "INS
ERT INTO `
Localizati
onStrings`
SET `IDKe
y` = " . m
ysql_inser
t_id() . "
, `IDLangu
age` = $la
ngID, `Str
ing` = '"
.process_d
b_input( $
string ) .
"'" );
|
|
404 |
|
db
_res( "INS
ERT INTO `
Localizati
onStrings`
SET `IDKe
y` = " . m
ysql_inser
t_id() . "
, `IDLangu
age` = $la
ngID, `Str
ing` = '"
.process_d
b_input( $
string ) .
"'" );
|
399 |
|
}
|
|
405 |
|
}
|
400 |
|
|
|
406 |
|
|
401 |
|
compil
eLanguage(
$langID);
|
|
407 |
|
compil
eLanguage(
$langID);
|
402 |
|
}
|
|
408 |
|
}
|
403 |
|
|
|
409 |
|
|
404 |
|
function s
aveOrders(
$sTop, $a
Custom )
|
|
410 |
|
function s
aveOrders(
$sTop, $a
Custom )
|
405 |
|
{
|
|
411 |
|
{
|
|
|
412 |
|
global
$oMenu;
|
|
|
413 |
|
|
406 |
|
db_res
( "UPDATE
`TopMenu`
SET `Order
` = 0, `Pa
rent` = 0"
);
|
|
414 |
|
db_res
( "UPDATE
`TopMenu`
SET `Order
` = 0, `Pa
rent` = 0"
);
|
407 |
|
|
|
415 |
|
|
408 |
|
$sTop
= trim( $s
Top, ' ,'
);
|
|
416 |
|
$sTop
= trim( $s
Top, ' ,'
);
|
409 |
|
$aTopI
Ds = explo
de( ',', $
sTop );
|
|
417 |
|
$aTopI
Ds = explo
de( ',', $
sTop );
|
410 |
|
foreac
h( $aTopID
s as $iOrd
=> $iID )
|
|
418 |
|
foreac
h( $aTopID
s as $iOrd
=> $iID )
|
411 |
|
{
|
|
419 |
|
{
|
412 |
|
$i
ID = trim(
$iID, ' ,
' );
|
|
420 |
|
$i
ID = trim(
$iID, ' ,
' );
|
413 |
|
$i
ID = (int)
$iID;
|
|
421 |
|
$i
ID = (int)
$iID;
|
414 |
|
|
|
422 |
|
|
415 |
|
if
( !$iID )
|
|
423 |
|
if
( !$iID )
|
416 |
|
continue
;
|
|
424 |
|
continue
;
|
417 |
|
|
|
425 |
|
|
418 |
|
db
_res( "UPD
ATE `TopMe
nu` SET `O
rder` = $i
Ord, `Type
` = 'top'
WHERE `ID`
= $iID" )
;
|
|
426 |
|
db
_res( "UPD
ATE `TopMe
nu` SET `O
rder` = $i
Ord, `Type
` = 'top'
WHERE `ID`
= $iID" )
;
|
419 |
|
}
|
|
427 |
|
}
|
420 |
|
|
|
428 |
|
|
421 |
|
foreac
h( $aCusto
m as $iPar
ent => $sC
ustom )
|
|
429 |
|
foreac
h( $aCusto
m as $iPar
ent => $sC
ustom )
|
422 |
|
{
|
|
430 |
|
{
|
423 |
|
$i
Parent = (
int)$iPare
nt;
|
|
431 |
|
$i
Parent = (
int)$iPare
nt;
|
424 |
|
$s
Custom = t
rim( $sCus
tom, ' ,'
);
|
|
432 |
|
$s
Custom = t
rim( $sCus
tom, ' ,'
);
|
425 |
|
$a
CustomIDs
= explode(
',', $sCu
stom );
|
|
433 |
|
$a
CustomIDs
= explode(
',', $sCu
stom );
|
426 |
|
fo
reach( $aC
ustomIDs a
s $iOrd =>
$iID )
|
|
434 |
|
fo
reach( $aC
ustomIDs a
s $iOrd =>
$iID )
|
427 |
|
{
|
|
435 |
|
{
|
428 |
|
$iID = t
rim( $iID,
' ,' );
|
|
436 |
|
$iID = t
rim( $iID,
' ,' );
|
429 |
|
$iID = (
int)$iID;
|
|
437 |
|
$iID = (
int)$iID;
|
430 |
|
|
|
438 |
|
|
431 |
|
if( !$iI
D )
|
|
439 |
|
if( !$iI
D )
|
432 |
|
cont
inue;
|
|
440 |
|
cont
inue;
|
433 |
|
|
|
441 |
|
|
434 |
|
db_res(
"UPDATE `T
opMenu` SE
T `Order`
= $iOrd, `
Type` = 'c
ustom', `P
arent`=$iP
arent WHER
E `ID` = $
iID" );
|
|
442 |
|
db_res(
"UPDATE `T
opMenu` SE
T `Order`
= $iOrd, `
Type` = 'c
ustom', `P
arent`=$iP
arent WHER
E `ID` = $
iID" );
|
435 |
|
}
|
|
443 |
|
}
|
436 |
|
}
|
|
444 |
|
}
|
437 |
|
compile
Menus
();
|
|
445 |
|
$oMenu
->
compile
();
|
438 |
|
}
|
|
446 |
|
}
|
439 |
|
|
|
|
440 |
|
?>
|
|
|