forked from netcommons/NetCommons2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAction.class.php
More file actions
126 lines (115 loc) · 2.96 KB
/
Action.class.php
File metadata and controls
126 lines (115 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?php
/**
* メニューテーブル登録用クラス
*
* @package NetCommons.component
* @author Noriko Arai,Ryuji Masukawa
* @copyright 2006-2007 NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
* @project NetCommons Project, supported by National Institute of Informatics
* @access public
*/
class Mobile_Components_Action {
/**
* @var DBオブジェクトを保持
*
* @access private
*/
var $_db = null;
var $_container = null;
/**
* コンストラクター
*
* @access public
*/
function Mobile_Components_Action()
{
$this->_container =& DIContainerFactory::getContainer();
$this->_db =& $this->_container->getComponent("DbObject");
}
/**
* MenuDetail Insert
* @param array (block_id,page_id,visibility_flag)
* @return boolean true or false
* @access public
*/
function insMenuDetail($params)
{
$result = $this->_db->insertExecute("mobile_menu_detail", $params, true);
if ($result === false) {
return false;
}
return $result;
}
/**
* MenuDetail Update
* @param array (block_id,page_id,theme_name,temp_name,visibility_flag)
* @return boolean true or false
* @access public
*/
function updMenuDetail($params)
{
$set_params = array("visibility_flag" => $params['visibility_flag']);
$where_params = array(
"block_id" =>$params['block_id'],
"page_id" =>$params['page_id']
);
$result = $this->_db->updateExecute("mobile_menu_detail", $set_params, $where_params, true);
if ($result === false) {
return false;
}
return true;
}
/**
* block_idによるMenuDetail削除処理
*
* @return boolean true or false
* @access public
*/
function delMenuDetailById($block_id,$page_id)
{
$params = array(
"block_id" => $block_id,
"page_id" => $page_id
);
$result = $this->_db->execute("DELETE FROM {mobile_menu_detail} WHERE block_id=? AND page_id=? ", $params);
if ($result === false) {
$this->_db->addError();
return false;
}
return true;
}
/**
* block_idによるMenuDetail削除処理
*
* @return boolean true or false
* @access public
*/
function delMenuDetailByPageId($page_id, $visibility_flag = _OFF )
{
$params = array(
"page_id" => $page_id,
"visibility_flag" => $visibility_flag
);
$result = $this->_db->execute("DELETE FROM {mobile_menu_detail} WHERE page_id=? AND visibility_flag = ?" .
" ",$params);
if ($result === false) {
$this->_db->addError();
return false;
}
return true;
}
function insMenuDetailByPageId($page_id, $visibility_flag = _ON )
{
$params = array( "block_id" => 0,
"page_id" => $page_id,
"visibility_flag" => $visibility_flag
);
$result = $this->_db->insertExecute("mobile_menu_detail", $params, true);
if ($result === false) {
return false;
}
return true;
}
}
?>