Location: PHPKode > projects > CsWebmail > cswebmail-3.10/cswebmail-3.10/templates_mobile/edit_folders.php
<?
if(VALID_DOCUMENT != 1) die('what?');
if($action == 'folders-delete'){
  $mailbox = get_var('mailbox');
  $_SESSION['mboxes']->delete($mailbox);
  // $_SESSION['mboxes'] = new MBoxes;
  location_header($_SERVER['PHP_SELF'].'?action=folders-edit');
}
else if($action == 'folders-empty'){
  $mailbox = get_var('mailbox');
  $_SESSION['mboxes']->delete($mailbox);
  $_SESSION['mboxes']->create($mailbox);
  // $_SESSION['mboxes'] = new MBoxes;
  location_header($_SERVER['PHP_SELF'].'?action=folders-edit');
}
else if($action == 'folders-view'){
  $boxes = get_var('boxes');
  $_SESSION['preferences']->setMailboxesList($boxes);
  $_SESSION['preferences']->store();
  $_SESSION['mboxes']->refresh();
  location_header($_SERVER['PHP_SELF'].'?action=folders-edit');
}
else if($action == 'folders-new'){?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post" enctype="application/x-www-form-urlencoded">
<input name="action" value="" type="hidden"/>
<table align="left" border="1" cellpadding="1" cellspacing="0" frame="hsides" rules="rows">
   <tr><th>Enter Mailbox Name</th></tr>
  <tr><td>
   <b><?=$_SESSION['preferences']->getMailDir()?>/ </b>
   <input name="mailbox" size="30" type="text"/></td></tr>
  <tr><td>
<input value="create" onclick="action.value='folders-create';submit();" type="button"/>
<input value="cancel" onclick="action.value='folders-cancel';submit();" type="button"/>
<input name="clear" value="clear" type="reset"/>
  </td></tr>
</table>
</form>
<?}else if($action == 'folders-show-rename'){  $mailbox = get_var('mailbox'); ?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post" enctype="application/x-www-form-urlencoded">
<input name="action" value="" type="hidden"/>
<input name="old-mailbox" value="<?=$mailbox?>" type="hidden"/>
<table align="left" border="1" cellpadding="1" cellspacing="0" frame="hsides" rules="rows">
   <tr><th>Enter Mailbox Name</th></tr>
  <tr><td>
   <b><?=dirname($mailbox)?>/ </b>
   <input name="mailbox" value="<?=basename($mailbox)?>" size="30" type="text"/></td></tr>
  <tr><td>
<input value="rename" onclick="action.value='folders-rename';submit();" type="button"/>
<input value="cancel" onclick="action.value='folders-cancel';submit();" type="button"/>
<input name="clear" value="clear" type="reset"/>
  </td></tr>
</table>
</form>
<?}else if($action == 'folders-rename'){
  $old = get_var('old-mailbox');
  $new = get_var('mailbox');
  if($old != $new && !eregi("[/]",$new)){
    $_SESSION['mboxes']->rename($old,dirname($old).'/'.$new);
  }
  location_header($_SERVER['PHP_SELF'].'?action=folders-edit');
}
else if($action == 'folders-create'){
  $_SESSION['mboxes']->create($_SESSION['preferences']->getMailDir().'/'.get_var('mailbox'));
  location_header($_SERVER['PHP_SELF'].'?action=folders-edit');
}
else{?>
<div style="<?=RED_STYLE?>">Warning: do not choose files that NOT mailboxes.</div>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<input name="action" value="folders-view" type="hidden"/>
<div style="<?=HEADER_STYLE?>">Choose Mail Folders</div>
<?=$_SESSION['mboxes']->get_simple_choose_folders_presentation()?>
<input value="choose checked folders" type="submit"/>
</form>
<?}?>
Return current item: CsWebmail