2 include("t_config.php");
6 <title>edit ewiki page flags</title>
7 <link rel="stylesheet" type="text/css" href="t_config.css">
9 <body bgcolor="#ffffff" text="#000000">
10 <h1>edit page flags</h1>
15 EWIKI_DB_F_TEXT => "TXT",
16 EWIKI_DB_F_BINARY => "BIN",
17 EWIKI_DB_F_DISABLED => "OFF",
18 EWIKI_DB_F_HTML => "HTM",
19 EWIKI_DB_F_READONLY => "RO",
20 EWIKI_DB_F_WRITEABLE => "WR",
23 if (empty($_REQUEST["set"])) {
25 $result = ewiki_db::GETALL(array("version", "flags"));
27 echo '<form action="t_flags.php" method="POST" enctype="multipart/form-data">';
28 echo '<table class="list" border="0" cellspacing="3" cellpadding="2" width="96%">' . "\n";
30 while ($row = $result->get()) {
33 $data = ewiki_db::GET($row);
35 echo '<tr><td width="40%">';
36 if ($data["flags"] & EWIKI_DB_F_TEXT) {
37 echo '<a href="' . ewiki_script("", $id) . '">';
40 echo '<a href="' . ewiki_script_binary("", $id) . '">';
42 echo htmlentities($id) . '</a><small>' . (".".$row["version"]) . '</small></td>';
45 foreach ($FD as $n=>$str) {
46 echo '<input type="checkbox" name="set['. rawurlencode($id)
47 . '][' . $n . ']" value="1" '
48 . (($data["flags"] & $n) ? "CHECKED" : "")
57 echo '</table><input type="submit" value=" change settings "></form>';
62 foreach($_REQUEST["set"] as $page=>$fa) {
64 $page = rawurldecode($page);
68 foreach($fa as $num=>$isset) {
71 $fstr .= ($fstr?",":""). $FD[$num];
75 echo "ยท ".htmlentities($page)." ({$flags}=<small>[{$fstr}]</small>)";
77 $data = ewiki_db::GET($page);
79 if ($data["flags"] != $flags) {
80 $data["flags"] = $flags;
81 $data["author"] = "ewiki-tools, " . ewiki_author();
83 ewiki_db::WRITE($data);
87 echo " [not changed]";
97 function strong_htmlentities($str) {
98 return preg_replace('/([^-., \w\d])/e', '"&#".ord("\\1").";"', $str);