8-3-2
寫入 PDF 設定
您沒有觀看影片的權限
請先登入,登入後,確認您的權限後,即可觀看影片。
- 在
index.php
加入對應流程:
//儲存pdf的匯出設定
case 'tad_signup_data_pdf_setup_save':
Tad_signup_data::pdf_setup_save($action_id, $pdf_setup_col);
header("location: pdf_signup.php?id=$action_id");
exit;
- 記得過濾變數:
$pdf_setup_col = Request::getString('pdf_setup_col');
- 在
class\Tad_signup_data.php
加入對應方法:
//儲存pdf的匯出設定
public static function pdf_setup_save($action_id, $pdf_setup_col = '')
{
$TadDataCenter = new TadDataCenter('tad_signup');
$TadDataCenter->set_col('pdf_setup_id', $action_id);
$TadDataCenter->saveCustomData(['pdf_setup_col' => [$pdf_setup_col]]);
}
- 順便完成
pdf_setup
方法
//進行pdf的匯出設定
public static function pdf_setup($action_id)
{
global $xoopsTpl;
$action = Tad_signup_actions::get($action_id);
$xoopsTpl->assign('action', $action);
$TadDataCenter = new TadDataCenter('tad_signup');
$TadDataCenter->set_col('pdf_setup_id', $action_id);
$pdf_setup_col = $TadDataCenter->getData('pdf_setup_col', 0);
$to_arr = explode(',', $pdf_setup_col);
// 製作標題
$head_arr = self::get_head($action);
$from_arr = array_diff($head_arr, $to_arr);
$hidden_arr = [];
$tmt_box = Tmt::render('pdf_setup_col', $from_arr, $to_arr, $hidden_arr, true, false);
$xoopsTpl->assign('tmt_box', $tmt_box);
}
link to https://github.com/tadlearn/tad_signup/commit/176afe2c19f39990c53db498fb2507f271ac3314 \