function fncexportform() { global $_CONF; global $_USERBOX_CONF; global $LANG_USERBOX_ADMIN; global $LANG_ADMIN; $pi_name = "userbox"; //----- $tmpl = new Template($_CONF['path'] . "plugins/" . THIS_PLUGIN . "/templates/admin/"); $tmpl->set_file(array('exportform' => 'exportform.thtml')); $tmpl->set_var('site_admin_url', $_CONF['site_admin_url']); $token = SEC_createToken(); $retval .= SEC_getTokenExpiryNotice($token); $tmpl->set_var('gltoken_name', CSRF_TOKEN); $tmpl->set_var('gltoken', $token); $tmpl->set_var('xhtml', XHTML); $tmpl->set_var('script', THIS_SCRIPT); $tmpl->set_var('actionname', $LANG_USERBOX_ADMIN['export']); $tmpl->set_var('lang_inst', $LANG_USERBOX_ADMIN['inst_dataexport']); //fieldset_id $fieldset_id = "all"; $tmpl->set_var('lang_fieldset', $LANG_USERBOX_ADMIN['fieldset']); $list_fieldset = DATABOX_getoptionlist("fieldset", $fieldset_id, 0, $pi_name, "", "all"); $tmpl->set_var('list_fieldset', $list_fieldset); $tmpl->set_var('lang_export', $LANG_USERBOX_ADMIN["export"]); $tmpl->set_var('lang_cancel', $LANG_ADMIN['cancel']); $tmpl->parse('output', 'exportform'); $exportform = $tmpl->finish($tmpl->get_var('output')); $retval .= $exportform; return $retval; }
function LIB_Edit($pi_name, $id, $edt_flg, $msg = '', $errmsg = "", $mode = "edit") { global $_CONF; global $_TABLES; global $LANG_ADMIN; global $MESSAGE; global $LANG_ACCESS; global $_USER; $lang_box_admin = "LANG_" . strtoupper($pi_name) . "_ADMIN"; global ${$lang_box_admin}; $lang_box_admin = ${$lang_box_admin}; $lang_box = "LANG_" . strtoupper($pi_name); global ${$lang_box}; $lang_box = ${$lang_box}; $lang_box_allow_display = "LANG_" . strtoupper($pi_name) . "_ALLOW_DISPLAY"; global ${$lang_box_allow_display}; $lang_box_allow_display = ${$lang_box_allow_display}; $table = $_TABLES[strtoupper($pi_name) . '_def_category']; $table2 = $_TABLES[strtoupper($pi_name) . '_category']; //$lang_box_noyes="LANG_".strtoupper($pi_name)."_NOYES"; //global $$lang_box_noyes; //$lang_box_noyes=$$lang_box_noyes; $retval = ''; $delflg = false; $wkcnt = DB_count($table2, "category_id", $id); if (!empty($msg)) { $retval .= COM_showMessage($msg, $pi_name); $retval .= $errmsg; // clean 'em up $code = COM_applyFilter($_POST['code']); $name = COM_applyFilter($_POST['name']); $description = COM_applyFilter($_POST['description']); $defaulttemplatesdirectory = COM_applyFilter($_POST['defaulttemplatesdirectory']); //@@@@@@ $parent_id = COM_applyFilter($_POST['parent_id'], true); $categorygroup_id = COM_applyFilter($_POST['group'], true); //@@@@@@ $orderno = COM_applyFilter($_POST['orderno']); $allow_display = COM_applyFilter($_POST['allow_display'], true); $allow_edit = COM_applyFilter($_POST['allow_edit'], true); $uuid = $_USER['uid']; } else { if (empty($id)) { $id = 0; $code = ""; $name = ""; $description = ""; $defaulttemplatesdirectory = ""; $categorygroup_id = ""; $parent_id = ""; $orderno = ""; $allow_display = ""; $uuid = 0; $udatetime = ""; //""; } else { $sql = "SELECT "; $sql .= " *"; $sql .= " ,UNIX_TIMESTAMP(udatetime) AS udatetime_un" . LB; $sql .= " FROM "; $sql .= $table; $sql .= " WHERE "; $sql .= " category_id = {$id}"; $result = DB_query($sql); $A = DB_fetchArray($result); $code = COM_stripslashes($A['code']); $name = COM_stripslashes($A['name']); $description = COM_stripslashes($A['description']); $defaulttemplatesdirectory = COM_stripslashes($A['defaulttemplatesdirectory']); $parent_id = COM_stripslashes($A['parent_id']); $categorygroup_id = COM_stripslashes($A['categorygroup_id']); $orderno = COM_stripslashes($A['orderno']); $allow_display = COM_stripslashes($A['allow_display']); $uuid = COM_stripslashes($A['uuid']); $wary = COM_getUserDateTimeFormat(COM_stripslashes($A['udatetime_un'])); $udatetime = $wary[0]; // データがあれば削除させない if ($edt_flg == FALSE) { $delflg = true; } } } if ($mode === "copy") { $id = 0; //作成日付 $created = 0; $created_month = 0; $created_day = 0; $created_year = 0; $created_hour = 0; $created_minute = 0; // $delflg = false; } $retval .= COM_startBlock($lang_box_admin['edit'], '', COM_getBlockTemplate('_admin_block', 'header')); $tmplfld = DATABOX_templatePath('admin', 'default', $pi_name); $templates = new Template($tmplfld); $templates->set_file('editor', "category_editor.thtml"); //-- $templates->set_var('about_thispage', $lang_box_admin['about_admin_category']); $templates->set_var('lang_must', $lang_box_admin['must']); $templates->set_var('site_url', $_CONF['site_url']); $templates->set_var('site_admin_url', $_CONF['site_admin_url']); //-- $token = SEC_createToken(); $retval .= SEC_getTokenExpiryNotice($token); $templates->set_var('gltoken_name', CSRF_TOKEN); $templates->set_var('gltoken', $token); $templates->set_var('xhtml', XHTML); $templates->set_var('script', THIS_SCRIPT); // $templates->set_var('lang_link_admin', $lang_box_admin['link_admin']); $templates->set_var('lang_link_admin_top', $lang_box_admin['link_admin_top']); //id $templates->set_var('lang_category_id', $lang_box_admin['category_id']); $templates->set_var('id', $id); //コード、名前&説明 $templates->set_var('lang_code', $lang_box_admin['code']); $templates->set_var('code', $code); $templates->set_var('lang_name', $lang_box_admin['name']); $templates->set_var('name', $name); $templates->set_var('lang_description', $lang_box_admin['description']); $templates->set_var('description', $description); // $templates->set_var('lang_defaulttemplatesdirectory', $lang_box_admin['defaulttemplatesdirectory']); $templates->set_var('defaulttemplatesdirectory', $defaulttemplatesdirectory); $select_defaulttemplatesdirectory = LIB_templatesdirectory($pi_name, $defaulttemplatesdirectory); $templates->set_var('select_defaulttemplatesdirectory', $select_defaulttemplatesdirectory); //parent $templates->set_var('lang_parent', $lang_box_admin['parent']); if ($wkcnt > 0) { $disabled = "disabled"; } else { $disabled = ""; } $list_parent = DATABOX_getoptionlist("parent", $parent_id, 0, $pi_name, $disabled); $templates->set_var('list_parent', $list_parent); //group $templates->set_var('lang_group', $lang_box_admin['group']); $list_group = DATABOX_getoptionlist("group", $categorygroup_id, 0, $pi_name, "", 0); //@@@@@ $templates->set_var('list_group', $list_group); //順序 $templates->set_var('lang_orderno', $lang_box_admin['orderno']); $templates->set_var('orderno', $orderno); $templates->set_var('lang_allow_display', $lang_box_admin['allow_display']); $list_allow_display = DATABOX_getradiolist($lang_box_allow_display, "allow_display", $allow_display, 1); $templates->set_var('list_allow_display', $list_allow_display); //保存日時 $templates->set_var('lang_udatetime', $lang_box_admin['udatetime']); $templates->set_var('udatetime', $udatetime); $templates->set_var('lang_uuid', $lang_box_admin['uuid']); $templates->set_var('uuid', $uuid); // SAVE、CANCEL ボタン $templates->set_var('lang_save', $LANG_ADMIN['save']); $templates->set_var('lang_cancel', $LANG_ADMIN['cancel']); $templates->set_var('lang_preview', $LANG_ADMIN['preview']); //delete_option if ($delflg) { if ($wkcnt > 0) { $templates->set_var('lang_delete_help', $lang_box_admin['delete_help_category']); } else { $delbutton = '<input type="submit" value="' . $LANG_ADMIN['delete'] . '" name="mode"%s>'; $jsconfirm = ' onclick="return confirm(\'' . $MESSAGE[76] . '\');"'; $templates->set_var('delete_option', sprintf($delbutton, $jsconfirm)); } } // $templates->parse('output', 'editor'); $retval .= $templates->finish($templates->get_var('output')); $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer')); return $retval; }
function LIB_Edit($pi_name, $id, $edt_flg, $msg = '', $errmsg = "", $mode = "edit") { global $_CONF; global $_TABLES; global $LANG_ADMIN; global $MESSAGE; global $LANG_ACCESS; global $_USER; $box_conf = "_" . strtoupper($pi_name) . "_CONF"; global ${$box_conf}; $box_conf = ${$box_conf}; $lang_box_admin = "LANG_" . strtoupper($pi_name) . "_ADMIN"; global ${$lang_box_admin}; $lang_box_admin = ${$lang_box_admin}; $lang_box = "LANG_" . strtoupper($pi_name); global ${$lang_box}; $lang_box = ${$lang_box}; $lang_box_noyes = "LANG_" . strtoupper($pi_name) . "_NOYES"; global ${$lang_box_noyes}; $lang_box_noyes = ${$lang_box_noyes}; $lang_box_type = "LANG_" . strtoupper($pi_name) . "_TYPE"; global ${$lang_box_type}; $lang_box_type = ${$lang_box_type}; $lang_box_allow_display = "LANG_" . strtoupper($pi_name) . "_ALLOW_DISPLAY"; global ${$lang_box_allow_display}; $lang_box_allow_display = ${$lang_box_allow_display}; $lang_box_allow_edit = "LANG_" . strtoupper($pi_name) . "_ALLOW_EDIT"; global ${$lang_box_allow_edit}; $lang_box_allow_edit = ${$lang_box_allow_edit}; $lang_box_textcheck = "LANG_" . strtoupper($pi_name) . "_TEXTCHECK"; global ${$lang_box_textcheck}; $lang_box_textcheck = ${$lang_box_textcheck}; $lang_box_textconv = "LANG_" . strtoupper($pi_name) . "_TEXTCONV"; global ${$lang_box_textconv}; $lang_box_textconv = ${$lang_box_textconv}; $table = $_TABLES[strtoupper($pi_name) . '_def_field']; // $cur_year = date( 'Y' ); // $year_startoffset=1990 - $cur_year +1; // $year_endoffset=0; $retval = ''; $delflg = false; //メッセージ表示 if (!empty($msg)) { $retval .= COM_showMessage($msg, $pi_name); $retval .= $errmsg; // clean 'em up $name = COM_applyFilter($_POST['name']); $templatesetvar = COM_applyFilter($_POST['templatesetvar']); $type = COM_applyFilter($_POST['type']); $description = COM_applyFilter($_POST['description']); $allow_display = COM_applyFilter($_POST['allow_display'], true); $allow_edit = COM_applyFilter($_POST['allow_edit'], true); $textcheck = COM_applyFilter($_POST['textcheck'], true); $textconv = COM_applyFilter($_POST['textconv'], true); $searchtarget = COM_applyFilter($_POST['searchtarget'], true); $initial_value = COM_applyFilter($_POST['initial_value']); $range_start = COM_applyFilter($_POST['range_start']); $range_end = COM_applyFilter($_POST['range_end']); $dfid = COM_applyFilter($_POST['dfid'], true); $selection = COM_applyFilter($_POST['selection']); $selectlist = COM_applyFilter($_POST['selectlist']); $checkrequried = COM_applyFilter($_POST['checkrequried']); $size = COM_applyFilter($_POST['size'], true); $maxlength = COM_applyFilter($_POST['maxlength'], true); $rows = COM_applyFilter($_POST['rows'], true); $br = COM_applyFilter($_POST['br'], true); $orderno = COM_applyFilter($_POST['orderno']); $uuid = $_USER['uid']; } else { if (empty($id)) { $id = 0; $name = ""; $templatesetvar = ""; $description = ""; $allow_display = ""; $allow_edit = ""; $textcheck = ""; $textconv = ""; $searchtarget = ""; $initial_value = ""; $range_start = ""; $range_end = ""; $dfid = 0; $type = ""; $selection = ""; $selectlist = ""; $checkrequried = ""; $size = 60; $maxlength = 500; $rows = 3; $br = 0; $orderno = ""; $uuid = 0; $udatetime = ""; //""; } else { $sql = "SELECT "; $sql .= " *"; $sql .= " ,UNIX_TIMESTAMP(udatetime) AS udatetime_un" . LB; $sql .= " FROM "; $sql .= $table; $sql .= " WHERE "; $sql .= " field_id = {$id}"; $result = DB_query($sql); $A = DB_fetchArray($result); $name = COM_stripslashes($A['name']); $templatesetvar = COM_stripslashes($A['templatesetvar']); $description = $A['description']; //COM_stripslashes($A['description']); $allow_edit = COM_stripslashes($A['allow_edit']); $allow_display = COM_stripslashes($A['allow_display']); $textcheck = COM_stripslashes($A['textcheck']); $textconv = COM_stripslashes($A['textconv']); $searchtarget = COM_stripslashes($A['searchtarget']); $initial_value = COM_stripslashes($A['initial_value']); $range_start = COM_stripslashes($A['range_start']); $range_end = COM_stripslashes($A['range_end']); $dfid = COM_stripslashes($A['dfid']); $type = COM_stripslashes($A['type']); $selection = COM_stripslashes($A['selection']); $selectlist = COM_stripslashes($A['selectlist']); $checkrequried = COM_stripslashes($A['checkrequried']); $size = COM_stripslashes($A['size']); $maxlength = COM_stripslashes($A['maxlength']); $rows = COM_stripslashes($A['rows']); $br = COM_stripslashes($A['br']); $orderno = COM_stripslashes($A['orderno']); $uuid = COM_stripslashes($A['uuid']); $wary = COM_getUserDateTimeFormat(COM_stripslashes($A['udatetime_un'])); $udatetime = $wary[0]; if ($edt_flg == FALSE) { $delflg = true; } } } if ($mode === "copy") { $id = 0; //作成日付 $created = 0; // $delflg = false; } $tmplfld = DATABOX_templatePath('admin', 'default', $pi_name); $templates = new Template($tmplfld); $templates->set_file('editor', "field_editor.thtml"); //-- $templates->set_var('about_thispage', $lang_box_admin['about_admin_field']); $templates->set_var('lang_must', $lang_box_admin['must']); $templates->set_var('site_url', $_CONF['site_url']); $templates->set_var('site_admin_url', $_CONF['site_admin_url']); $token = SEC_createToken(); $retval .= SEC_getTokenExpiryNotice($token); $templates->set_var('gltoken_name', CSRF_TOKEN); $templates->set_var('gltoken', $token); $templates->set_var('xhtml', XHTML); $templates->set_var('script', THIS_SCRIPT); // $templates->set_var('lang_link_admin', $lang_box_admin['link_admin']); $templates->set_var('lang_link_admin_top', $lang_box_admin['link_admin_top']); //id $templates->set_var('lang_field_id', $lang_box_admin['field_id']); $templates->set_var('id', $id); //document link $lang = COM_getLanguageName(); $path = 'admin/plugins/' . strtolower($pi_name) . '/docs/'; if (!file_exists($_CONF['path_html'] . $path . $lang . '/')) { $lang = 'japanese'; //'english'; } $document_url = $_CONF['site_url'] . '/' . $path . $lang . '/'; $templates->set_var('document_url', $document_url); $templates->set_var('lang_document', $LANG_DATABOX_ADMIN['document']); //名前&テンプレート変数&説明 $templates->set_var('lang_name', $lang_box_admin['name']); $templates->set_var('name', $name); $templates->set_var('lang_templatesetvar', $lang_box_admin['templatesetvar']); $templates->set_var('templatesetvar', $templatesetvar); $templates->set_var('lang_description', $lang_box_admin['description']); $templates->set_var('description', $description); $templates->set_var('lang_allow_display', $lang_box_admin['allow_display']); $list_allow_display = DATABOX_getoptionlistary($lang_box_allow_display, "allow_display", $allow_display, $pi_name); $templates->set_var('list_allow_display', $list_allow_display); $templates->set_var('lang_allow_edit', $lang_box_admin['allow_edit']); $list_allow_edit = DATABOX_getoptionlistary($lang_box_allow_edit, "allow_edit", $allow_edit, $pi_name); $templates->set_var('list_allow_edit', $list_allow_edit); //textcheck $templates->set_var('lang_textcheck', $lang_box_admin['textcheck']); $list_textcheck = DATABOX_getoptionlistary($lang_box_textcheck, "textcheck", $textcheck, $pi_name); $templates->set_var('list_textcheck', $list_textcheck); //textconv $templates->set_var('lang_textconv', $lang_box_admin['textconv']); $list_textconv = DATABOX_getoptionlistary($lang_box_textconv, "textconv", $textconv, $pi_name); $templates->set_var('list_textconv', $list_textconv); //searchtarget $templates->set_var('lang_searchtarget', $lang_box_admin['searchtarget']); $list_searchtarget = DATABOX_getradiolist($lang_box_noyes, "searchtarget", $searchtarget); $templates->set_var('list_searchtarget', $list_searchtarget); //初期値 範囲 日時フォーマット initial value range dfid $templates->set_var('lang_initial_value', $lang_box_admin['initial_value']); $templates->set_var('help_initial_value', $lang_box_admin['help_initial_value']); $templates->set_var('initial_value', $initial_value); $templates->set_var('lang_range', $lang_box_admin['range']); $templates->set_var('help_range', $lang_box_admin['help_range']); $templates->set_var('range_start', $range_start); $templates->set_var('range_end', $range_end); $templates->set_var('lang_dfid', $lang_box_admin['dfid']); $templates->set_var('help_dfid', $lang_box_admin['help_dfid']); //$list_dfid=DATABOX_getoptionlistary ($lang_box_textcheck,"textcheck",$textcheck,$pi_name); $list_dfid = '<select id="dfid" name="dfid">' . LB . COM_optionList($_TABLES['dateformats'], 'dfid,description', $dfid) . '</select>'; $templates->set_var('list_dfid', $list_dfid); //type $templates->set_var('lang_type', $lang_box_admin['type']); $list_type = DATABOX_getoptionlistary($lang_box_type, "type", $type, $pi_name); $templates->set_var('list_type', $list_type); //checkrequried $templates->set_var('lang_checkrequried', $lang_box_admin['checkrequried']); $list_checkrequried = DATABOX_getradiolist($lang_box_noyes, "checkrequried", $checkrequried); $templates->set_var('list_checkrequried', $list_checkrequried); //size maxlength rows br $templates->set_var('lang_size', $lang_box_admin['size']); $templates->set_var('size', $size); $templates->set_var('lang_maxlength', $lang_box_admin['maxlength']); $templates->set_var('maxlength', $maxlength); $templates->set_var('lang_rows', $lang_box_admin['rows']); $templates->set_var('rows', $rows); $templates->set_var('lang_br', $lang_box_admin['br']); $templates->set_var('help_br', $lang_box_admin['help_br']); $templates->set_var('br', $br); //selection $templates->set_var('lang_selection', $lang_box_admin['selection']); $templates->set_var('selection', $selection); //selectlist $templates->set_var('lang_selectlist', $lang_box_admin['selectlist']); $list_selectlist = DATABOX_getoptionlist("selectlist", $selectlist, 0, $pi_name); $templates->set_var('list_selectlist', $list_selectlist); //順序 $templates->set_var('lang_orderno', $lang_box_admin['orderno']); $templates->set_var('orderno', $orderno); //保存日時 $templates->set_var('lang_udatetime', $lang_box_admin['udatetime']); $templates->set_var('udatetime', $udatetime); $templates->set_var('lang_uuid', $lang_box_admin['uuid']); $templates->set_var('uuid', $uuid); // SAVE、CANCEL ボタン $templates->set_var('lang_save', $LANG_ADMIN['save']); $templates->set_var('lang_cancel', $LANG_ADMIN['cancel']); $templates->set_var('lang_preview', $LANG_ADMIN['preview']); //delete_option if ($delflg) { $delbutton = '<input type="submit" value="' . $LANG_ADMIN['delete'] . '" name="mode"%s>'; $jsconfirm = ' onclick="return confirm(\'' . $MESSAGE[76] . '\');"'; $templates->set_var('delete_option', sprintf($delbutton, $jsconfirm)); // $templates->set_var('lang_delete_help', $lang_box_admin['delete_help_field']); } // $templates->parse('output', 'editor'); $retval .= $templates->finish($templates->get_var('output')); return $retval; }
function LIB_Edit($pi_name, $id, $edt_flg, $msg = '', $errmsg = "", $mode = "edit") { global $_CONF; global $_TABLES; global $LANG_ADMIN; global $MESSAGE; global $LANG_ACCESS; global $_USER; $box_conf = "_" . strtoupper($pi_name) . "_CONF"; global ${$box_conf}; $box_conf = ${$box_conf}; $lang_box_admin = "LANG_" . strtoupper($pi_name) . "_ADMIN"; global ${$lang_box_admin}; $lang_box_admin = ${$lang_box_admin}; $lang_box = "LANG_" . strtoupper($pi_name); global ${$lang_box}; $lang_box = ${$lang_box}; $lang_box_noyes = "LANG_" . strtoupper($pi_name) . "_NOYES"; global ${$lang_box_noyes}; $lang_box_noyes = ${$lang_box_noyes}; $lang_box_type = "LANG_" . strtoupper($pi_name) . "_TYPE"; global ${$lang_box_type}; $lang_box_type = ${$lang_box_type}; $lang_box_allow_display = "LANG_" . strtoupper($pi_name) . "_ALLOW_DISPLAY"; global ${$lang_box_allow_display}; $lang_box_allow_display = ${$lang_box_allow_display}; $lang_box_allow_edit = "LANG_" . strtoupper($pi_name) . "_ALLOW_EDIT"; global ${$lang_box_allow_edit}; $lang_box_allow_edit = ${$lang_box_allow_edit}; $table = $_TABLES[strtoupper($pi_name) . '_def_field']; // $cur_year = date( 'Y' ); // $year_startoffset=1990 - $cur_year +1; // $year_endoffset=0; $retval = ''; $delflg = false; //メッセージ表示 if (!empty($msg)) { $retval .= COM_showMessage($msg, $pi_name); $retval .= $errmsg; // clean 'em up $name = COM_applyFilter($_POST['name']); $templatesetvar = COM_applyFilter($_POST['templatesetvar']); $fieldgroup_id = COM_applyFilter($_POST['group'], true); $type = COM_applyFilter($_POST['type']); $description = COM_applyFilter($_POST['description']); $allow_display = COM_applyFilter($_POST['allow_display'], true); $allow_edit = COM_applyFilter($_POST['allow_edit'], true); $selection = COM_applyFilter($_POST['selection']); $selectlist = COM_applyFilter($_POST['selectlist']); $checkrequried = COM_applyFilter($_POST['checkrequried']); $size = COM_applyFilter($_POST['size'], true); $maxlength = COM_applyFilter($_POST['maxlength'], true); $rows = COM_applyFilter($_POST['rows'], true); $orderno = COM_applyFilter($_POST['orderno']); $uuid = $_USER['uid']; } else { if (empty($id)) { $id = 0; $name = ""; $templatesetvar = ""; $description = ""; $allow_display = ""; $allow_edit = ""; $type = ""; $selection = ""; $selectlist = ""; $checkrequried = ""; $size = 60; $maxlength = 160; $rows = 2; $br = 0; $fieldgroup_id = ""; $orderno = ""; $uuid = 0; $udatetime = ""; //""; } else { $sql = "SELECT "; $sql .= " *"; $sql .= " FROM "; $sql .= $table; $sql .= " WHERE "; $sql .= " field_id = {$id}"; $result = DB_query($sql); $A = DB_fetchArray($result); $name = COM_stripslashes($A['name']); $templatesetvar = COM_stripslashes($A['templatesetvar']); $description = $A['description']; //COM_stripslashes($A['description']); $allow_edit = COM_stripslashes($A['allow_edit']); $allow_display = COM_stripslashes($A['allow_display']); $type = COM_stripslashes($A['type']); $fieldgroup_id = COM_stripslashes($A['fieldgroup_id']); $selection = COM_stripslashes($A['selection']); $selectlist = COM_stripslashes($A['selectlist']); $checkrequried = COM_stripslashes($A['checkrequried']); $br = COM_stripslashes($A['br']); $size = COM_stripslashes($A['size']); $maxlength = COM_stripslashes($A['maxlength']); $rows = COM_stripslashes($A['rows']); $br = COM_stripslashes($A['br']); $orderno = COM_stripslashes($A['orderno']); $uuid = COM_stripslashes($A['uuid']); $udatetime = COM_stripslashes($A['udatetime']); if ($edt_flg == FALSE) { $delflg = true; } } } if ($mode === "copy") { $id = 0; //作成日付 $created = 0; $created_month = 0; $created_day = 0; $created_year = 0; $created_hour = 0; $created_minute = 0; // $delflg = false; } $retval .= COM_startBlock($lang_box_admin['edit'], '', COM_getBlockTemplate('_admin_block', 'header')); $tmplfld = DATABOX_templatePath('admin', 'default', $pi_name); $templates = new Template($tmplfld); $templates->set_file('editor', "field_editor.thtml"); //-- $templates->set_var('about_thispage', $lang_box_admin['about_admin_field']); $templates->set_var('lang_must', $lang_box_admin['must']); $templates->set_var('site_url', $_CONF['site_url']); $templates->set_var('site_admin_url', $_CONF['site_admin_url']); $token = SEC_createToken(); $retval .= SEC_getTokenExpiryNotice($token); $templates->set_var('gltoken_name', CSRF_TOKEN); $templates->set_var('gltoken', $token); $templates->set_var('xhtml', XHTML); $templates->set_var('script', THIS_SCRIPT); // $templates->set_var('lang_link_admin', $lang_box_admin['link_admin']); $templates->set_var('lang_link_admin_top', $lang_box_admin['link_admin_top']); //id $templates->set_var('lang_field_id', $lang_box_admin['field_id']); $templates->set_var('id', $id); //名前&テンプレート変数&説明 $templates->set_var('lang_name', $lang_box_admin['name']); $templates->set_var('name', $name); $templates->set_var('lang_templatesetvar', $lang_box_admin['templatesetvar']); $templates->set_var('templatesetvar', $templatesetvar); $templates->set_var('lang_description', $lang_box_admin['description']); $templates->set_var('description', $description); $templates->set_var('lang_allow_display', $lang_box_admin['allow_display']); $list_allow_display = DATABOX_getradiolist($lang_box_allow_display, "allow_display", $allow_display, "<br/>"); $templates->set_var('list_allow_display', $list_allow_display); $templates->set_var('lang_allow_edit', $lang_box_admin['allow_edit']); $list_allow_edit = DATABOX_getradiolist($lang_box_allow_edit, "allow_edit", $allow_edit, "<br/>"); $templates->set_var('list_allow_edit', $list_allow_edit); //type $templates->set_var('lang_type', $lang_box_admin['type']); $list_type = DATABOX_getradiolist($lang_box_type, "type", $type, "<br/>"); $templates->set_var('list_type', $list_type); //checkrequried $templates->set_var('lang_checkrequried', $lang_box_admin['checkrequried']); $list_checkrequried = DATABOX_getradiolist($lang_box_noyes, "checkrequried", $checkrequried); $templates->set_var('list_checkrequried', $list_checkrequried); //size maxlength rows br $templates->set_var('lang_size', $lang_box_admin['size']); $templates->set_var('size', $size); $templates->set_var('lang_maxlength', $lang_box_admin['maxlength']); $templates->set_var('maxlength', $maxlength); $templates->set_var('lang_rows', $lang_box_admin['rows']); $templates->set_var('rows', $rows); $templates->set_var('lang_br', $lang_box_admin['br']); $list_br = DATABOX_getradiolist($lang_box_noyes, "br", $br); $templates->set_var('list_br', $list_br); //selection $templates->set_var('lang_selection', $lang_box_admin['selection']); $templates->set_var('selection', $selection); //selectlist $templates->set_var('lang_selectlist', $lang_box_admin['selectlist']); $list_selectlist = DATABOX_getoptionlist("selectlist", $selectlist, 0, $pi_name); $templates->set_var('list_selectlist', $list_selectlist); //group $templates->set_var('lang_group', $lang_box_admin['group']); $list_group = DATABOX_getoptionlist("group", $fieldgroup_id, 0, $pi_name, "", 0); $templates->set_var('list_group', $list_group); //順序 $templates->set_var('lang_orderno', $lang_box_admin['orderno']); $templates->set_var('orderno', $orderno); //保存日時 $templates->set_var('lang_udatetime', $lang_box_admin['udatetime']); $templates->set_var('udatetime', $udatetime); $templates->set_var('lang_uuid', $lang_box_admin['uuid']); $templates->set_var('uuid', $uuid); // SAVE、CANCEL ボタン $templates->set_var('lang_save', $LANG_ADMIN['save']); $templates->set_var('lang_cancel', $LANG_ADMIN['cancel']); $templates->set_var('lang_preview', $LANG_ADMIN['preview']); //delete_option if ($delflg) { $delbutton = '<input type="submit" value="' . $LANG_ADMIN['delete'] . '" name="mode"%s>'; $jsconfirm = ' onclick="return confirm(\'' . $MESSAGE[76] . '\');"'; $templates->set_var('delete_option', sprintf($delbutton, $jsconfirm)); // $templates->set_var('lang_delete_help', $lang_box_admin['delete_help_field']); } // $templates->parse('output', 'editor'); $retval .= $templates->finish($templates->get_var('output')); $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer')); return $retval; }
function fncNew($template) { global $_CONF; global $LANG_DATABOX_ADMIN; global $LANG_ADMIN; $pi_name = "databox"; $retval = ''; //----- $tmplfld = DATABOX_templatePath('mydata', $template, $pi_name); $templates = new Template($tmplfld); $templates->set_file('editor', "selectset.thtml"); $templates->set_var('site_url', $_CONF['site_url']); $templates->set_var('site_admin_url', $_CONF['site_admin_url']); $token = SEC_createToken(); $retval .= SEC_getTokenExpiryNotice($token); $templates->set_var('gltoken_name', CSRF_TOKEN); $templates->set_var('gltoken', $token); $templates->set_var('xhtml', XHTML); $script = THIS_SCRIPT; if ($template != "") { $script .= "?template=" . $template; } $templates->set_var('script', $script); //fieldset_id $fieldset_id = 0; $templates->set_var('lang_fieldset', $LANG_DATABOX_ADMIN['fieldset']); $list_fieldset = DATABOX_getoptionlist("fieldset", $fieldset_id, 0, $pi_name, "", 0); $templates->set_var('list_fieldset', $list_fieldset); $templates->set_var('lang_inst_newdata', $LANG_DATABOX_ADMIN['inst_newdata']); $templates->set_var('lang_new', $LANG_DATABOX_ADMIN['new']); $templates->set_var('lang_cancel', $LANG_ADMIN['cancel']); $templates->parse('output', 'editor'); $retval .= $templates->finish($templates->get_var('output')); return $retval; }
function fncEdit($id, $edt_flg, $msg = '', $errmsg = "", $mode = "edit") { $pi_name = "userbox"; global $_CONF; global $_TABLES; global $LANG_ADMIN; global $MESSAGE; global $LANG_ACCESS; global $_USER; global $LANG28; global $_SCRIPTS; global $_USERBOX_CONF; global $LANG_USERBOX_ADMIN; $retval = ''; $delflg = false; $addition_def = DATABOX_getadditiondef($pi_name); //メッセージ表示 if (!empty($msg)) { $retval .= COM_showMessage($msg, $pi_name); $retval .= $errmsg; // clean 'em up $code = COM_applyFilter($_POST['code']); $title = COM_applyFilter($_POST['title']); $username = COM_applyFilter($_POST['username']); //@@@@@ $fullname = COM_applyFilter($_POST['fullname']); //@@@@@ $page_title = COM_applyFilter($_POST['page_title']); $description = $_POST['description']; //COM_applyFilter($_POST['description']); $draft_flag = COM_applyFilter($_POST['draft_flag'], true); $language_id = COM_applyFilter($_POST['language_id']); $category = $_POST['category']; $additionfields = $_POST['afield']; $additionfields_fnm = $_POST['afield_fnm']; //@@@@@ $additionfields_del = $_POST['afield_del']; $additionfields_date = array(); $additionfields_alt = $_POST['afield_alt']; $additionfields = DATABOX_cleanaddtiondatas($additionfields, $addition_def, $additionfields_fnm, $additionfields_del, $additionfields_date, $additionfields_alt, false); //作成日付 $created_month = COM_applyFilter($_POST['created_month'], true); $created_day = COM_applyFilter($_POST['created_day'], true); $created_year = COM_applyFilter($_POST['created_year'], true); $created_hour = COM_applyFilter($_POST['created_hour'], true); $created_minute = COM_applyFilter($_POST['created_minute'], true); $created = COM_applyFilter($_POST['created']); $orderno = COM_applyFilter($_POST['orderno']); $uuid = $_USER['uid']; $udatetime = COM_applyFilter($_POST['udatetime']); //""; $fieldset_id = COM_applyFilter($_POST['fieldset'], true); //""; $fieldset_name = COM_applyFilter($_POST['fieldset_name']); //""; } else { $sql = "SELECT "; $sql .= " t.*"; $sql .= " ,t2.name AS fieldset_name" . LB; $sql .= " ,UNIX_TIMESTAMP(t.modified) AS modified_un" . LB; $sql .= " ,UNIX_TIMESTAMP(t.released) AS released_un" . LB; $sql .= " ,UNIX_TIMESTAMP(t.comment_expire) AS comment_expire_un" . LB; $sql .= " ,UNIX_TIMESTAMP(t.expired) AS expired_un" . LB; $sql .= " ,UNIX_TIMESTAMP(t.udatetime) AS udatetime_un" . LB; $sql .= " ,UNIX_TIMESTAMP(t.created) AS created_un" . LB; $sql .= " ,t1.username"; $sql .= " ,t1.fullname"; $sql .= " ,unix_timestamp(modified) AS modified_u "; $sql .= " FROM "; $sql .= $_TABLES['USERBOX_base'] . " AS t"; $sql .= "," . $_TABLES['users'] . " AS t1"; $sql .= "," . $_TABLES['USERBOX_def_fieldset'] . " AS t2 " . LB; $sql .= " WHERE "; $sql .= " t.id = {$id}"; $sql .= " AND t.id = t1.uid"; $sql .= " AND t.fieldset_id = t2.fieldset_id" . LB; $result = DB_query($sql); $A = DB_fetchArray($result); $fieldset_id = COM_stripslashes($A['fieldset_id']); $fieldset_name = COM_stripslashes($A['fieldset_name']); $code = COM_stripslashes($A['code']); $title = COM_stripslashes($A['title']); $username = COM_stripslashes($A['username']); //@@@@@ $fullname = COM_stripslashes($A['fullname']); //@@@@@ $page_title = COM_stripslashes($A['page_title']); $description = COM_stripslashes($A['description']); $language_id = COM_stripslashes($A['language_id']); $owner_id = COM_stripslashes($A['owner_id']); $group_id = COM_stripslashes($A['group_id']); $perm_owner = COM_stripslashes($A['perm_owner']); $perm_group = COM_stripslashes($A['perm_group']); $perm_members = COM_stripslashes($A['perm_members']); $perm_anon = COM_stripslashes($A['perm_anon']); $category = DATABOX_getdatas("category_id", $_TABLES['USERBOX_category'], "id = {$id}"); //追加項目 $additionfields = DATABOX_getadditiondatas($id, $pi_name); $additionfields_fnm = array(); //@@@@@ $additionfields_del = array(); $additionfields_date = ""; $draft_flag = COM_stripslashes($A['draft_flag']); //編集日 $wary = COM_getUserDateTimeFormat(COM_stripslashes($A['modified_un'])); $modified = $wary[1]; $modified_month = date('m', $modified); $modified_day = date('d', $modified); $modified_year = date('Y', $modified); $modified_hour = date('H', $modified); $modified_minute = date('i', $modified); //公開日 $wary = COM_getUserDateTimeFormat(COM_stripslashes($A['released_un'])); $released = $wary[1]; $released_month = date('m', $released); $released_day = date('d', $released); $released_year = date('Y', $released); $released_hour = date('H', $released); $released_minute = date('i', $released); //公開終了日 $expired = COM_stripslashes($A['expired']); if ($expired === "0000-00-00 00:00:00") { $expired_flag = 0; $w = mktime(0, 0, 0, date('m'), date('d') + $_CONF['article_comment_close_days'], date('Y')); $expired_year = date('Y', $w); $expired_month = date('m', $w); $expired_day = date('d', $w); $expired_hour = 0; $expired_minute = 0; } else { $expired_flag = 1; $wary = COM_getUserDateTimeFormat(COM_stripslashes($A['expired_un'])); $expired = $wary[1]; $expired_year = date('Y', $expired); $expired_month = date('m', $expired); $expired_day = date('d', $expired); $expired_hour = date('H', $expired); $expired_minute = date('i', $expired); } //作成日付 $wary = COM_getUserDateTimeFormat(COM_stripslashes($A['created_un'])); $created = $wary[0]; $created_un = $wary[1]; $orderno = COM_stripslashes($A['orderno']); $uuid = COM_stripslashes($A['uuid']); $wary = COM_getUserDateTimeFormat(COM_stripslashes($A['udatetime_un'])); $udatetime = $wary[0]; $defaulttemplatesdirectory = $A['defaulttemplatesdirectory']; if ($_CONF['allow_account_delete']) { if ($edt_flg == FALSE) { $delflg = true; } } } $chk_user = DATABOX_chkuser($group_id, $owner_id, "userbox.admin"); //----- $retval .= COM_startBlock($LANG_USERBOX_ADMIN['edit'], '', COM_getBlockTemplate('_admin_block', 'header')); //template フォルダ if (is_null($template) or $template === "") { $set_defaulttemplatesdirectory = DB_getItem($_TABLES['USERBOX_def_fieldset'], "defaulttemplatesdirectory", "fieldset_id=" . $fieldset_id); if ($defaulttemplatesdirectory != "") { $template = $defaulttemplatesdirectory; } elseif ($set_defaulttemplatesdirectory != "") { $template = $set_defaulttemplatesdirectory; } else { $template = "default"; } } $tmplfld = DATABOX_templatePath('myprofile', 'default', $pi_name); $templates = new Template($tmplfld); $templates->set_file(array('editor' => 'profile_editor.thtml', 'row' => 'row.thtml', 'col' => "profile_col_detail.thtml")); // Loads jQuery UI datepicker geeklog >=2.1.0 $_SCRIPTS->setJavaScriptLibrary('jquery.ui.datepicker'); $_SCRIPTS->setJavaScriptLibrary('jquery-ui-i18n'); $_SCRIPTS->setJavaScriptLibrary('jquery-ui-timepicker-addon'); $_SCRIPTS->setJavaScriptLibrary('jquery-ui-timepicker-addon-i18n'); $_SCRIPTS->setJavaScriptFile('datepicker', '/javascript/datepicker.js'); $_SCRIPTS->setJavaScriptFile('datetimepicker', '/javascript/datetimepicker.js'); $langCode = COM_getLangIso639Code(); $toolTip = $MESSAGE[118]; $imgUrl = $_CONF['site_url'] . '/images/calendar.png'; //-- if ($_CONF['meta_tags'] > 0 && $_USERBOX_CONF['meta_tags'] > 0) { $templates->set_var('hide_meta', ''); } else { $templates->set_var('hide_meta', ' style="display:none;"'); } $templates->set_var('maxlength_description', $_USERBOX_CONF['maxlength_description']); $templates->set_var('about_thispage', $LANG_USERBOX_ADMIN['about_myprofile_profile']); $templates->set_var('lang_must', $LANG_USERBOX_ADMIN['must']); $templates->set_var('site_url', $_CONF['site_url']); $templates->set_var('site_admin_url', $_CONF['site_admin_url']); $templates->set_var('lang_view', $LANG_USERBOX_ADMIN['view']); $token = SEC_createToken(); $retval .= SEC_getTokenExpiryNotice($token); $templates->set_var('gltoken_name', CSRF_TOKEN); $templates->set_var('gltoken', $token); $templates->set_var('xhtml', XHTML); $templates->set_var('script', THIS_SCRIPT); $templates->set_var('dateformat', $_USERBOX_CONF['dateformat']); // $templates->set_var('lang_link_admin', $LANG_USERBOX_ADMIN['link_admin']); $templates->set_var('lang_link_admin_top', $LANG_USERBOX_ADMIN['link_admin_top']); $templates->set_var('lang_link_public', $LANG_USERBOX_ADMIN['link_public']); $templates->set_var('lang_link_list', $LANG_USERBOX_ADMIN['link_list']); $templates->set_var('lang_link_detail', $LANG_USERBOX_ADMIN['link_detail']); //fieldset_id $templates->set_var('lang_fieldset', $LANG_USERBOX_ADMIN['fieldset']); $templates->set_var('fieldset_id', $fieldset_id); $templates->set_var('fieldset_name', $fieldset_name); //id $templates->set_var('lang_id', $LANG_USERBOX_ADMIN['id']); //@@@@@ $templates->set_var('help_id', $LANG_USERBOX_ADMIN['help']); $templates->set_var('id', $id); //$LANG28 = array( // 2 => 'ユーザID', // 3 => 'ユーザ名', username // 4 => '氏名', fullname $templates->set_var('lang_uid', $LANG28['2']); $templates->set_var('lang_username', $LANG28['3']); $templates->set_var('username', $username); $templates->set_var('lang_fullname', $LANG28['4']); $templates->set_var('fullname', $fullname); //下書 $templates->set_var('lang_draft', $LANG_USERBOX_ADMIN['draft']); if ($draft_flag == 1) { $templates->set_var('draft_flag', "checked=checked"); $templates->set_var('draft_msg', $LANG_USERBOX_ADMIN['draft_msg']); } else { $templates->set_var('draft_flag', ""); $templates->set_var('draft_msg', ""); } // $templates->set_var('lang_field', $LANG_USERBOX_ADMIN['field']); $templates->set_var('lang_fields', $LANG_USERBOX_ADMIN['fields']); $templates->set_var('lang_content', $LANG_USERBOX_ADMIN['content']); $templates->set_var('lang_templatesetvar', $LANG_USERBOX_ADMIN['templatesetvar']); //基本項目 $templates->set_var('lang_basicfields', $LANG_USERBOX_ADMIN['basicfields']); //コード&タイトル&説明&テンプレートセット値 $templates->set_var('lang_code', $LANG_USERBOX_ADMIN['code']); if ($_USERBOX_CONF['datacode']) { $templates->set_var('lang_must_code', $LANG_USERBOX_ADMIN['must']); } else { $templates->set_var('lang_must_code', ""); } $templates->set_var('code', $code); $templates->set_var('lang_title', $LANG_USERBOX_ADMIN['title']); $templates->set_var('title', $title); $templates->set_var('lang_page_title', $LANG_USERBOX_ADMIN['page_title']); $templates->set_var('page_title', $page_title); $templates->set_var('lang_description', $LANG_USERBOX_ADMIN['description']); $templates->set_var('description', $description); //language_id if (is_array($_CONF['languages'])) { $templates->set_var('hide_language_id', ''); $select_language_id = DATABOX_getoptionlist("language_id", $language_id, 0, $pi_name, "", 0); } else { $templates->set_var('hide_language_id', ' style="display:none;"'); $select_language_id = ""; } $templates->set_var('lang_language_id', $LANG_USERBOX_ADMIN['language_id']); $templates->set_var('language_id', $language_id); $templates->set_var('select_language_id', $select_language_id); //@@@@@ //編集日 $templates->set_var('lang_modified_autoupdate', $LANG_USERBOX_ADMIN['modified_autoupdate']); $templates->set_var('lang_modified', $LANG_USERBOX_ADMIN['modified']); $w = COM_convertDate2Timestamp($modified_year . "-" . $modified_month . "-" . $modified_day, $modified_hour . ":" . $modified_minute . "::00"); $datetime_modified = DATABOX_datetimeedit($w, "LANG_DATABOX_ADMIN", "modified"); $templates->set_var('datetime_modified', $datetime_modified); //カテゴリ $templates->set_var('lang_category', $LANG_USERBOX_ADMIN['category']); $checklist_category = DATABOX_getcategoriesinp($category, $fieldset_id, $pi_name); $templates->set_var('checklist_category', $checklist_category); //追加項目 $templates->set_var('lang_additionfields', $LANG_USERBOX_ADMIN['additionfields']); $rt = DATABOX_getaddtionfieldsEdit($additionfields, $addition_def, $templates, $chk_user, $pi_name, $additionfields_fnm, $additionfields_del, $fieldset_id, $additionfields_date); //保存日時 $templates->set_var('lang_udatetime', $LANG_USERBOX_ADMIN['udatetime']); $templates->set_var('udatetime', $udatetime); $templates->set_var('lang_uuid', $LANG_USERBOX_ADMIN['uuid']); $templates->set_var('uuid', $uuid); //作成日付 $templates->set_var('lang_created', $LANG_USERBOX_ADMIN['created']); $templates->set_var('created', $created); // SAVE、CANCEL ボタン $templates->set_var('lang_save', $LANG_ADMIN['save']); $templates->set_var('lang_cancel', $LANG_ADMIN['cancel']); $templates->set_var('lang_preview', $LANG_ADMIN['preview']); //delete_option if ($delflg) { $delbutton = '<input type="submit" value="' . $LANG_ADMIN['delete'] . '" name="mode"%s>'; $jsconfirm = ' onclick="return confirm(\'' . $MESSAGE[76] . '\');"'; $templates->set_var('delete_option', sprintf($delbutton, $jsconfirm)); } // $templates->parse('output', 'editor'); $retval .= $templates->finish($templates->get_var('output')); $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer')); return $retval; }