|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Extended User Profile |
|
4
|
|
|
* |
|
5
|
|
|
* You may not change or alter any portion of this comment or credits |
|
6
|
|
|
* of supporting developers from this source code or any supporting source code |
|
7
|
|
|
* which is considered copyrighted (c) material of the original comment or credit authors. |
|
8
|
|
|
* This program is distributed in the hope that it will be useful, |
|
9
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
11
|
|
|
* |
|
12
|
|
|
* @copyright (c) 2000-2016 XOOPS Project (www.xoops.org) |
|
13
|
|
|
* @license GNU GPL 2 (http://www.gnu.org/licenses/gpl-2.0.html) |
|
14
|
|
|
* @package profile |
|
15
|
|
|
* @since 2.3.0 |
|
16
|
|
|
* @author Jan Pedersen |
|
17
|
|
|
* @author Taiwen Jiang <[email protected]> |
|
18
|
|
|
*/ |
|
19
|
|
|
|
|
20
|
|
|
// defined('XOOPS_ROOT_PATH') || exit("XOOPS root path not defined"); |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* Class YogurtRegstep |
|
24
|
|
|
*/ |
|
25
|
|
|
class YogurtRegstep extends XoopsObject |
|
26
|
|
|
{ |
|
27
|
|
|
/** |
|
28
|
|
|
* |
|
29
|
|
|
*/ |
|
30
|
|
|
public function __construct() |
|
31
|
|
|
{ |
|
32
|
|
|
$this->initVar('step_id', XOBJ_DTYPE_INT); |
|
33
|
|
|
$this->initVar('step_name', XOBJ_DTYPE_TXTBOX); |
|
34
|
|
|
$this->initVar('step_desc', XOBJ_DTYPE_TXTAREA); |
|
35
|
|
|
$this->initVar('step_order', XOBJ_DTYPE_INT, 1); |
|
36
|
|
|
$this->initVar('step_save', XOBJ_DTYPE_INT, 0); |
|
37
|
|
|
} |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* Class YogurtRegstepHandler |
|
42
|
|
|
*/ |
|
43
|
|
|
class YogurtRegstepHandler extends XoopsPersistableObjectHandler |
|
44
|
|
|
{ |
|
45
|
|
|
/** |
|
46
|
|
|
* @param null|object $db |
|
47
|
|
|
*/ |
|
48
|
|
|
public function __construct($db) |
|
49
|
|
|
{ |
|
50
|
|
|
parent::__construct($db, 'yogurt_profile_regstep', 'yogurtregstep', 'step_id', 'step_name'); |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* Delete an object from the database |
|
55
|
|
|
* @see XoopsPersistableObjectHandler |
|
56
|
|
|
* |
|
57
|
|
|
* @param XoopsObject $obj |
|
58
|
|
|
* @param bool $force |
|
59
|
|
|
* |
|
60
|
|
|
* @return bool |
|
61
|
|
|
*/ |
|
62
|
|
|
public function delete(XoopsObject $obj, $force = false) |
|
63
|
|
|
{ |
|
64
|
|
|
if (parent::delete($obj, $force)) { |
|
65
|
|
|
$field_handler = xoops_getModuleHandler('field'); |
|
66
|
|
|
|
|
67
|
|
|
return $field_handler->updateAll('step_id', 0, new Criteria('step_id', $obj->getVar('step_id')), $force); |
|
|
|
|
|
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
|
return false; |
|
71
|
|
|
} |
|
72
|
|
|
} |
|
73
|
|
|
|