public function direct() { $id = $_GET["id"]; if ($id) { $this->assign("page", D("Pages")->find($id)); } import("ORG.Net.Keditor"); $ke = new Keditor(); // $ke->items="little";//定义工具栏项目,little表示精简。 $ke->id = "content"; //指定textarea的id $ke->fileManagerJson = __APP__ . "/Keditor/filemanager"; //浏览过程 $ke->imageUploadJson = __APP__ . "/Keditor/upload"; //上传过程 $ke->allowFileManager = true; //允许浏览服务器图片,注意,为true或false的属性值,不要使用引号 $ke->imgid = "img"; // // $ke->upload(__ROOT__.'/Public/Upload/', 'http://localhost/chinaihe/Public/Upload/',array('gif', 'jpg', 'jpeg', 'png', 'bmp'),1000000); $ke->jspath = __ROOT__ . "/Public/editor/kindeditor.js"; $keshow = $ke->show(); //生成js代码 $this->assign("keshow", $keshow); $ke->id = "content2"; //指定textarea的id $keshow2 = $ke->show(); //生成js代码 $this->assign("keshow2", $keshow2); $this->display(); }
/** +---------------------------------------------------------- * 默认操作 +---------------------------------------------------------- */ public function index() { if (isset($_POST['bank'])) { $bank_arr = array(); foreach ($_POST['bank'] as $k => $v) { $bank_arr[$k] = array('bank' => stripslashes($v), 'payee' => stripslashes($_POST['payee'][$k]), 'account' => stripslashes($_POST['account'][$k]), 'address' => stripslashes($_POST['address'][$k])); } $info = $_POST['info']; $this->saveConfig($bank_arr, $info); $this->success("操作成功", __URL__); exit; } import("ORG.Net.Keditor"); $ke = new Keditor(); $ke->id = "info"; $ke->width = "700px"; $ke->height = "300px"; $ke->items = "['source', '|', 'fullscreen', 'undo', 'redo', 'print', 'cut', 'copy', 'paste',\n 'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',\n 'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',\n 'superscript', '|', 'selectall', '-',\n 'title', 'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold',\n 'italic', 'underline', 'strikethrough', 'removeformat', '|','table', 'hr', 'emoticons', 'link', 'unlink', '|', 'about']\n "; $ke->resizeMode = 1; $ke->jspath = "/Style/kindeditor/kindeditor.js"; $ke->form = "bankForm"; $keshow = $ke->show(); $this->assign("keshow", $keshow); $config = FS("Webconfig/payoff"); $this->assign('bank', $config['BANK']); $this->assign('info', $config['BANK_INFO']); $this->display(); }
function demo8() { //自定义上传和浏览的过程。 import("ORG.Net.Keditor"); $ke = new Keditor(); $ke->id = "content"; //指定textarea的id $ke->allowFileManager = true; $ke->fileManagerJson = __URL__ . "/filemanager"; //浏览过程 $ke->imageUploadJson = __URL__ . "/upload"; //上传过程 $keshow = $ke->show(); //生成js代码 $this->assign("keshow", $keshow); $this->display(); }