:::

5-6-2 套用所見即所得編輯器

您沒有觀看影片的權限

您沒有觀看影片的權限

請先登入,登入後,確認您的權限後,即可觀看影片。

  1. 所見即所得編輯器完整用法可參考:https://www.tad0616.net/modules/tad_book3/page.php?tbsn=15&tbdsn=363
  2. 編輯 class\Tad_signup_actions.php,先在最上方加入:
    use XoopsModules\Tadtools\CkEditor;

     

  3. 編輯 class\Tad_signup_actions.php 中的 create(),在最最後加入:
    //編輯表單
    public static function create($id = '')
    {
        global $xoopsTpl, $xoopsUser;
    
        /*--略--*/
    
        My97DatePicker::render();
        $CkEditor = new CkEditor("tad_signup", "detail", $detail);
        $CkEditor->setHeight(350);
        $editor = $CkEditor->render();
        $xoopsTpl->assign('editor', $editor);
    
    }

     

  4. 修改 templates\op_tad_signup_actions_create.tpl,將原本<textarea>改為:
    <div class="form-group row">
        <label class="col-sm-2 control-label col-form-label text-md-right">
            活動說明
        </label>
        <div class="col-sm-10">
            <{$editor}>
        </div>
    </div>

     

  5. 搜尋 class\Tad_signup_actions.php 中有用到 displayTarea 的地方,將之改為:
    $data['detail'] = $myts->displayTarea($data['detail'], 1, 0, 0, 0, 0);

     

link to https://github.com/tadlearn/tad_signup/commit/2e6cbfe919a2e23df33003a0dde7394516151f77 \


:::

搜尋

QR Code 區塊

https%3A%2F%2Fwww.tad0616.net%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbsn%3D48%26tbdsn%3D1724

書籍目錄

展開 | 闔起

線上使用者

56人線上 (7人在瀏覽線上書籍)

會員: 0

訪客: 56

更多…