Location: PHPKode > projects > QuickTicket > quickticket/qti_p_staffmenu.php
<?php

// QTI 2.5 build:20101222 used in qti_topic

// When Moderator change actor+status, actor must be changed first to notify him on the status change...

if ( isset($_POST['Maction']) ) {
if ( !empty($_POST['Mactor']) || !empty($_POST['Maction']) ) {

  $oVIP->exiturl = 'qti_topics.php?s='.$s;
  $oVIP->exitname = $L['Section'];

  if ( !empty($_POST['Mactor']) )
  {
    if ( $_POST['Mactor']=='actor*' ) $oHtml->Redirect('qti_change.php?a=topicactor&amp;s='.$s.'&amp;t='.$t.'&amp;v=*&amp;old='.$_POST['Moldactor'],$L['Change'].' '.$L['Status'] );
    $oTopic = new cTopic($t);
    $oTopic->SetActor(intval($_POST['Mactor']));
    // exit (if no action, if action, continue with action
    if ( empty($_POST['Maction']) )
    {
      $oVIP->selfname = $L['Change'].' '.$L['Userrole_MA'];
      $oVIP->EndMessage(NULL,$L['S_update'],$_SESSION[QT]['skin_dir'],2);
    }
  }

  if ( substr($_POST['Maction'],0,7)=='status_' ) $oHtml->Redirect('qti_change.php?a=topicstatus&amp;s='.$s.'&amp;t='.$t.'&amp;v='.substr($_POST['Maction'],-1,1),$L['Change'].' '.$L['Status'] );
  if ( substr($_POST['Maction'],0,5)=='type_' ) $oHtml->Redirect('qti_change.php?a=topictype&amp;s='.$s.'&amp;t='.$t.'&amp;v='.substr($_POST['Maction'],-1,1),$L['Change'].' '.$L['Status'] );
  if ($_POST['Maction']=='reply') $oHtml->Redirect('qti_form_edit.php?s='.$s.'&amp;t='.$t.'&amp;a=re',$L['Post_reply'] );
  if ($_POST['Maction']=='move') $oHtml->Redirect('qti_change.php?a=topicmove&amp;s='.$s.'&amp;t='.$t,$L['Move'] );
  if ($_POST['Maction']=='delete') $oHtml->Redirect('qti_change.php?a=topicdelete&amp;s='.$s.'&amp;t='.$t,$L['Delete'] );

}}

if ( !isset($strStaffMenu) ) $strStaffMenu='';

$strStaffMenu .= '
<!-- Moderator actions -->
<form method="post" action="'.Href().'" id="modaction">
<div class="modboard">
<span class="modboard">'.$L['Topic'].' <input type="hidden" name="s" value="'.$oTopic->parentid.'" />
<input type="hidden" name="t" value="'.$oTopic->id.'" />
<input type="hidden" name="Mref" value="'.$oTopic->numid.'" />
<select name="Maction" class="small" onchange="document.getElementById(\'modaction\').submit();">
<option value="">&nbsp;</option>
<option value="reply">'.$L['Post_reply'].'...</option>
<option value="move">'.$L['Move'].'...</option>
<option value="delete">'.$L['Delete'].'...</option>
<option value="" disabled="disabled">-----------------</option>
';
foreach($oVIP->statuses as $strId=>$strValue) $strStaffMenu .= '<option value="status_'.$strId.'"'.($oTopic->status==$strId ? ' class="bold"' : '').'>'.$L['Status'].': '.$strValue['statusname'].'</option>
';
$strStaffMenu .= '<option value="" disabled="disabled">-----------------</option>
';
foreach($oVIP->types as $strId=>$strValue) $strStaffMenu .= '<option value="type_'.$strId.'"'.($oTopic->type==$strId ? ' class="bold"' : '').'>'.$L['Type'].': '.$strValue['name'].'</option>
';
$strStaffMenu .= '</select>&nbsp;'.$L['Change_actor'].'&nbsp;
<select name="Mactor" class="small" onchange="document.getElementById(\'modaction\').submit();">
<option value="">&nbsp;</option>
';
$arr = GetUsers('M','','numpost DESC,name ASC',13);
if ( count($arr)>12 ) { $b=array_pop($arr); $b=true; } else { $b=false; }
asort($arr);
foreach($arr as $intId=>$strValue) $strStaffMenu .= '<option value="'.$intId.'"'.($oTopic->actorid==$intId ? ' class="bold"' : '').'>'.$strValue.'</option>
';
if ( $b ) $strStaffMenu .= '<option value="" disabled="disabled">-----------------</option>
<option value="actor*">'.$L['More'].'...</option>
';
$strStaffMenu .= '</select> <input type="submit" name="Msubmit" value="'.$L['Ok'].'" class="small" id="action_ok" />
<script type="text/javascript">document.getElementById("action_ok").style.display="none";</script>
</span>
</div>
</form>
';

?>
Return current item: QuickTicket