XOOPS
2.6.0
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
DtypeAbstract.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
12
namespace
Xoops\Core\Kernel\Dtype
;
13
14
use
Xoops\Core\Kernel\XoopsObject
;
15
27
abstract
class
DtypeAbstract
28
{
32
protected
$db
;
33
37
protected
$ts
;
38
42
public
function
init
()
43
{
44
$this->
db
=
\Xoops::getInstance
()->db();
45
$this->ts =
\MyTextSanitizer::getInstance
();
46
}
47
55
public
function
cleanVar
(
XoopsObject
$obj, $key, $quote =
true
)
56
{
57
$value = $obj->vars[$key][
'value'
];
58
if
($quote) {
59
$value = str_replace(
'\\"'
,
'"'
, $this->
db
->quote($value));
60
}
61
return
$value;
62
}
63
71
public
function
getVar
(
XoopsObject
$obj, $key, $format)
72
{
73
$value = $obj->vars[$key][
'value'
];
74
if
($obj->vars[$key][
'options'
] !=
''
&& $value !=
''
) {
75
switch
(strtolower($format)) {
76
case
's'
:
77
case
'show'
:
78
$selected = explode(
'|'
, $value);
79
$options
= explode(
'|'
, $obj->vars[$key][
'options'
]);
80
$i
= 1;
81
$ret = array();
82
foreach
(
$options
as
$op
) {
83
if
(in_array(
$i
, $selected)) {
84
$ret[] =
$op
;
85
}
86
++
$i
;
87
}
88
return
implode(
', '
, $ret);
89
case
'e'
:
90
case
'edit'
:
91
return
explode(
'|'
, $value);
92
default
:
93
}
94
}
95
return
$value;
96
}
97
}
Xoops\db
db()
Definition:
Xoops.php:175
$i
$i
Definition:
dialog.php:68
Xoops\getInstance
static getInstance()
Definition:
Xoops.php:160
Xoops\Core\Kernel\Dtype\DtypeAbstract\getVar
getVar(XoopsObject $obj, $key, $format)
Definition:
DtypeAbstract.php:71
$options
$options['editor']
Definition:
sampleform.inc.php:44
Xoops\Core\Kernel\Dtype\DtypeAbstract\cleanVar
cleanVar(XoopsObject $obj, $key, $quote=true)
Definition:
DtypeAbstract.php:55
Xoops\Core\Kernel\Dtype\DtypeAbstract\init
init()
Definition:
DtypeAbstract.php:42
XoopsObject
Xoops\Core\Kernel\Dtype\DtypeAbstract\$db
$db
Definition:
DtypeAbstract.php:32
Xoops\Core\Kernel\Dtype\DtypeAbstract\$ts
$ts
Definition:
DtypeAbstract.php:37
Xoops\Core\Kernel\XoopsObject
Definition:
XoopsObject.php:47
Xoops\Core\Kernel\Dtype
Definition:
DtypeAbstract.php:12
$op
$op
Definition:
xoops_images.php:31
Xoops\Core\Kernel\Dtype\DtypeAbstract
Definition:
DtypeAbstract.php:27
MyTextSanitizer\getInstance
static getInstance()
Definition:
module.textsanitizer.php:254
usr64
htdocs
xoops_lib
Xoops
Core
Kernel
Dtype
DtypeAbstract.php
Generated on Fri May 22 2015 03:07:05 for XOOPS by
1.8.9.1