/
plg_Help_LC_Page_Plugin_Help_Config.php
134 lines (122 loc) · 3.67 KB
/
plg_Help_LC_Page_Plugin_Help_Config.php
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
127
128
129
130
131
132
133
134
<?php
/*
* Help
*
* Copyright(c) 2009-2012 CUORE CO.,LTD. All Rights Reserved.
*
* http://ec.cuore.jp/
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// {{{ requires
require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
/**
* ヘルプの設定クラス
*
* @package Help
* @author CUORE CO.,LTD.
*/
class LC_Page_Plugin_Help_Config extends LC_Page_Admin_Ex {
var $arrForm = array();
/**
* 初期化する.
*
* @return void
*/
function init() {
parent::init();
$this->tpl_mainpage = PLUGIN_UPLOAD_REALDIR ."Help/templates/plg_Help_config.tpl";
$this->tpl_subtitle = "ヘルプ";
}
/**
* プロセス.
*
* @return void
*/
function process() {
$this->action();
$this->sendResponse();
}
/**
* Page のアクション.
*
* @return void
*/
function action() {
$objFormParam = new SC_FormParam_Ex();
$this->lfInitParam($objFormParam);
$objFormParam->setParam($_POST);
$objFormParam->convParam();
$arrForm = array();
switch ($this->getMode()) {
case 'edit':
$arrForm = $objFormParam->getHashArray();
$this->arrErr = $objFormParam->checkError();
// エラーなしの場合にはデータを更新
if (count($this->arrErr) == 0) {
// データ更新
$this->arrErr = $this->updateData($arrForm, $css_file_path);
if (count($this->arrErr) == 0) {
$this->tpl_onload = "alert('登録が完了しました。');";
}
}
break;
default:
// プラグイン情報を取得.
$plugin = SC_Plugin_Util_Ex::getPluginByPluginCode("Help");
$arrForm['title'] = $plugin['free_field1'];
break;
}
$this->arrForm = $arrForm;
$this->setTemplate($this->tpl_mainpage);
}
/**
* デストラクタ.
*
* @return void
*/
function destroy() {
parent::destroy();
}
/**
* パラメーター情報の初期化
*
* @param object $objFormParam SC_FormParamインスタンス
* @return void
*/
function lfInitParam(&$objFormParam) {
$objFormParam->addParam('表記', 'title', array('EXIST_CHECK'));
}
/**
*
* @param type $arrData
* @return type
*/
function updateData($arrData, $css_file_path) {
$arrErr = array();
$objQuery =& SC_Query_Ex::getSingletonInstance();
$objQuery->begin();
// UPDATEする値を作成する。
$sqlval = array();
$sqlval['free_field1'] = $arrData['title'];
$sqlval['update_date'] = 'CURRENT_TIMESTAMP';
$where = "plugin_code = 'Help'";
// UPDATEの実行
$objQuery->update('dtb_plugin', $sqlval, $where);
$objQuery->commit();
return $arrErr;
}
}
?>