4 This mpi allows you to insert another wikipage into the current
5 one using <?plugin Insert ThisWikiPage ?>. You can also temporarily
6 change some rendering parameters, by supplying them as optional
8 <?plugins insert PageName split_title=0 control_line=0 ?>
10 The table=0 parameter would disable the optional table+border
11 around the inserted page:
12 <?plugins insert PageName table=0 ?>
14 Please note, that the inserted page will be requested through
15 an "sub-request" with ewiki_page(), thus usually incorporating
16 all settings from the main page.
18 As additional extension, you can have a split view (vertical) with
20 <?plugins insert PageOne PageTwo ?>
23 # you can disable the <table> generation, if you style pages via CSS
24 define("EWIKI_MPI_INSERT_TBL", 1);
27 $ewiki_plugins["mpi"]["insert"] = "ewiki_mpi_insert";
28 $ewiki_config["mpi_insert"] = array(
29 "table" => EWIKI_MPI_INSERT_TBL,
33 function ewiki_mpi_insert($action="html", $args, &$iii, &$s) {
39 "id", "config", "title", "ring", "author",
43 foreach ($save as $name) {
44 $prevG["$name"] = $GLOBALS["ewiki_$name"];
47 #-- use any params as _config settings
48 $args = $args + $ewiki_config["mpi_insert"];
49 foreach ($args as $set=>$val) {
51 $ewiki_config[$set] = $val;
55 #-- render requested page, through sub-request
57 $o[] = ewiki_page($args["id"]);
58 for ($n=1; $n<=10; $n++) {
59 if ($id = $args[$n]) {
60 $o[] = ewiki_page($id);
65 foreach ($save as $name) {
66 $GLOBALS["ewiki_$name"] = $prevG[$name];
69 #-- mk table around output
71 if ($args["table"] || ($on >= 2)) {
72 $o = implode("</td>\n<td valign=\"top\">", $o);
73 $o = '<table border="'.$args["table"].'" cellpadding="5" cellspacing="5">'
74 // . '<colgroups>' . str_repeat('<col width="'.((int)(100/$on)).'%" />', $on) . '</colgroups>'
75 . '<tr><td valign="top">' . $o . '</td></tr></table>';
78 $o = implode("\n<br /><!-- cut-here --><br />\n", $o);
80 $o = '<div class="mpi-insert">' . $o . '</div>';