File: 0.02.50a/server/web/view.edit.php (View as HTML)

  1: <?php
  2: /* -------------------------------------------------------------
  3: This file is part of FreeNATS
  4: 
  5: FreeNATS is (C) Copyright 2008 PurplePixie Systems
  6: 
  7: FreeNATS is free software: you can redistribute it and/or modify
  8: it under the terms of the GNU General Public License as published by
  9: the Free Software Foundation, either version 3 of the License, or
 10: (at your option) any later version.
 11: 
 12: FreeNATS is distributed in the hope that it will be useful,
 13: but WITHOUT ANY WARRANTY; without even the implied warranty of
 14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 15: GNU General Public License for more details.
 16: 
 17: You should have received a copy of the GNU General Public License
 18: along with FreeNATS.  If not, see www.gnu.org/licenses
 19: 
 20: For more information see www.purplepixie.org/freenats
 21: -------------------------------------------------------------- */
 22: 
 23: ob_start();
 24: require("include.php");
 25: $NATS->Start();
 26: if (!$NATS_Session->Check($NATS->DB))
 27: 	{
 28: 	header("Location: ./?login_msg=Invalid+Or+Expired+Session");
 29: 	exit();
 30: 	}
 31: if ($NATS_Session->userlevel<5) UL_Error("Edit View");
 32: ob_end_flush();
 33: Screen_Header("View Editor",1);
 34: ?>
 35: <br>
 36: <?php
 37: 
 38: $q="SELECT * FROM fnview WHERE viewid=".ss($_REQUEST['viewid'])." LIMIT 0,1";
 39: $r=$NATS->DB->Query($q);
 40: if (!$row=$NATS->DB->Fetch_Array($r))
 41: 	{
 42: 	echo "No such view.<br><br>";
 43: 	Screen_Footer();
 44: 	exit();
 45: 	}
 46: $NATS->DB->Free($r);
 47: echo "<b class=\"minortitle\">Editing View: <a href=view.php?viewid=".$_REQUEST['viewid'].">".$row['vtitle']."</a></b><br><br>";
 48: 
 49: 
 50: echo "<table class=\"nicetable\">";
 51: echo "<form action=group.edit.php method=post>";
 52: echo "<input type=hidden name=action value=save_edit>";
 53: echo "<input type=hidden name=viewid value=".$_REQUEST['viewid'].">";
 54: 
 55: echo "<tr><td align=left valign=top><b>View Title";
 56: echo "</b></td><td align=left>";
 57: echo "<input type=text name=vtitle size=30 maxlength=64 value=\"".$row['vtitle']."\">";
 58: echo "</td></tr>";
 59: echo "<tr><td colspan=2>&nbsp;<br></td></tr>";
 60: 
 61: echo "<tr><td><b>Public View</b></td>";
 62: echo "<td>";
 63: if ($row['vpublic']==1) $s=" checked";
 64: else $s="";
 65: echo "<input type=checkbox name=vpublic value=1".$s."> ".hlink("View:Public");
 66: echo "</td></tr>";
 67: echo "<tr><td colspan=2>&nbsp;<br></td></tr>";
 68: 
 69: echo "<tr><td align=left valign=top><b>Page Style</b></td>";
 70: echo "<td>";
 71: if ($row['vstyle']=="standard") $s=" checked";
 72: else $s="";
 73: echo "<b><input type=radio name=vstyle value=standard".$s."> Standard</b><br>";
 74: echo "Standard full-page headers and footers with &quot;local&quot; page and style includes<br><br>";
 75: if ($row['vstyle']=="mobile") $s=" checked";
 76: else $s="";
 77: echo "<b><input type=radio name=vstyle value=mobile".$s."> Mobile/Minimal</b><br>";
 78: echo "Very minimal and absolute page style suitable for mobile browser and/or inline JS usage<br><br>";
 79: if ($row['vstyle']=="plain") $s=" checked";
 80: else $s="";
 81: echo "<b><input type=radio name=vstyle value=plain".$s."> Plain</b><br>";
 82: echo "Totally plain output<br><br>";
 83: 
 84: echo "</td></tr>";
 85: 
 86: echo "<tr><td align=left valign=top><b>Link Types</b></td>";
 87: echo "<td>";
 88: if ($row['vclick']=="standard") $s=" checked";
 89: else $s="";
 90: echo "<b><input type=radio name=vclick value=standard".$s."> Standard</b><br>";
 91: echo "Standard <i>a href</i> links for same window/frame<br><br>";
 92: if ($row['vclick']=="frametop") $s=" checked";
 93: else $s="";
 94: echo "<b><input type=radio name=vclick value=frametop".$s."> Same Window (Frame Top)</b><br>";
 95: echo "<i>a href</i> link to the window/frame top<br><br>";
 96: if ($row['vclick']=="newwindow") $s=" checked";
 97: else $s="";
 98: echo "<b><input type=radio name=vclick value=newwindow".$s."> New Window</b><br>";
 99: echo "Open a New Window<br><br>";
100: if ($row['vclick']=="disabled") $s=" checked";
101: else $s="";
102: echo "<b><input type=radio name=vclick value=disabled".$s."> Disabled</b><br>";
103: echo "No links (disabled)<br><br>";
104: 
105: echo "</td></tr>";
106: echo "<tr><td><b>Refresh";
107: echo "</b></td><td align=left>";
108: echo "<input type=text name=vrefresh size=6 maxlength=6 value=\"".$row['vrefresh']."\"> ".hlink("View:Refresh");
109: echo "</td></tr>";
110: 
111: echo "<tr><td><b>Save</b></td><td><input type=submit value=\"Save View Settings\"></td></tr>";
112: echo "</form>";
113: echo "</table>";
114: 
115: ?>
116: 
117: 
118: <?php
119: Screen_Footer();
120: ?>
121: