%%policy-create-editor-html%%
progmin : / (context #136)
2002-04-25 02:26:14

%%preprocess%%
$this->beryliumToForm(); 
$sstatus= "status".$this->status; 
$this->{$sstatus}= "selected"; 

// build folder menu
$this->foldermenu= "<select name='folderid'>";
$query= "SELECT * FROM folder AS obj WHERE obj.siteid='$site->id' $this->statuswhere $this->publicwhere ORDER BY name ASC";
$result= mysql_query($query);
while ($array= mysql_fetch_array($result)) {
	if ($folder->name== $array[name]) $selected= "selected";
	else $selected= "";
	$name= htmlentities($array[name]);
	$this->foldermenu.= "
	  <option value='$array[id]' $selected>$name</option>";
	}
$this->foldermenu.="</select>";








%%header%%





%%css%%





%%template%%
empty template







%%listrow%%





%%nullobject%%
<form method='post' enctype="multipart/form-data" action='$this->refreshURL?method=savenew$session->cgi' class='.form'>
  <table width='' border='0' cellspacing='0' cellpadding='5' align='center'>
    <tr> 
      <td colspan='2'><b>Create a new policy in $folder->name:</b> </td>
    </tr>
    <tr> 
      <td colspan='2'><b>$session->alert</b> </td>
    </tr>
    <tr> 
      <td align='right' valign='top'>policy name:</td>
      <td valign='top'> 
        <input type='text' name='name' size='42' maxlength='255' value="$this->name">
      </td>
    </tr>
    <tr> 
      <td align='right' valign='top'>policy flavor (role):</td>
      <td valign='top'> 
        <input type='text' name='flavor' size='42' maxlength='255' value="$this->flavor">
      </td>
    </tr>
    <tr> 
      <td colspan='2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prequery:<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
        <textarea name='prequery' cols='100' wrap='off' rows='10'>
\$this->whereposted= " AND status='posted' ";
\$this->wherepublic= " AND public=1 ";

\$this->insertstatus= "new";
\$this->insertpublic= "0";
\$this->insertrank= "100";

\$this->updatestatus= "new";
\$this->updatepublic= "0";
\$this->updaterank= "0";

if (\$getvars[orderby]!="") {
	if (\$getvars[direction]!="") \$direct= strtoupper(addslashes(\$getvars[direction]));
	\$orderby= strtoupper(addslashes(\$getvars[orderby]));
	\$this->orderby= "ORDER BY \$orderby \$direction";
	}
else \$this->orderby= "ORDER BY id ASC";
if (\$getvars[limit]!="") {
	\$offset= strtoupper(addslashes(\$getvars[offset]));
	\$limit= strtoupper(addslashes(\$getvars[limit]));

	if (\$offset!="") \$this->limit= "LIMIT \$offset, \$limit ";
	else \$this->limit= "LIMIT \$limit ";
	}
else \$this->limit= "LIMIT 30 ";
   </textarea>
      </td>
    </tr>
    <tr> 
      <td colspan='2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;object addons:<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
        <textarea name='addons' cols='100' wrap='off' rows='8'>
\$this->itemOwner=1; 
\$this->itemEditor=1; 
\$this->canAddChild=1; 
\$this->canSave[all]=1; 
\$this->canSavenew[all]=1; 
</textarea>
      </td>
    </tr>
    <tr> 
      <td align='right' valign='top'>policy file (on your harddrive):</td>
      <td valign='top'> 
        <input name="policyfile" type="file" size="32">
      </td>
    </tr>
    <tr valign='top'> 
      <td align='right'>status:</td>
      <td> 
        <select name='status'>
          <option value='new' $statusnew>new</option>
          <option value='posted' $statusposted>posted</option>
          <option value='hidden' $statushidden>hidden</option>
          <option value='deleted' $statusdeleted>deleted</option>
        </select>
      </td>
    </tr>
    <tr> 
      <td>&nbsp;</td>
      <td> 
        <input type='submit' name='Submit2' value='create new' class='buttonstyle'>
      </td>
    </tr>
  </table>
      </form>







%%footer%%





%%postprocess%%





%%end of context%%
