4 If you load this plugin, pages with names ending in "...Template"
5 would be shown as <select> list, whenever a new page was to be
10 $ewiki_plugins["edit_form_final"][] = "ewiki_aedit_templates";
11 $ewiki_plugins["edit_hook"][] = "ewiki_edit_load_template";
14 function ewiki_aedit_templates(&$html, $id, &$data, $action)
16 if (!$data["content"]) {
18 #-- search template pages
20 $result = ewiki_db::SEARCH("id","Template");
21 while ($row = $result->get(0, 0x21, EWIKI_DB_F_TEXT)) {
22 if (preg_match('/Template$/', $row["id"])) {
29 $o = '<form action="'.ewiki_script("", $id).'" method="POST" entype="multipart/form-data">'
30 . '<input type="hidden" name="id" value="'.$action.'/'.$id.'">'
31 . '<input type="submit" value="load"> '
32 . '<select name="load_template">';
33 foreach ($list as $i) {
34 $o .= '<option value="'.$i.'">'.$i.'</option>';
36 $o .= '</select></form>';
45 function ewiki_edit_load_template($id, &$data, $action)
47 if ($id = $_REQUEST["load_template"]) {
48 $d2 = ewiki_db::GET($id);
49 $data["content"] = $d2["content"];