public function doConfigPageInit($page)
 {
     $request = $_REQUEST;
     $action = isset($request['action']) ? $request['action'] : '';
     if (isset($request['delete'])) {
         $action = 'delete';
     }
     $announcement_id = isset($request['announcement_id']) ? $request['announcement_id'] : false;
     $view = isset($request['view']) ? $request['view'] : 'form';
     $description = isset($request['description']) ? $request['description'] : '';
     $recording_id = isset($request['recording_id']) ? $request['recording_id'] : '';
     $allow_skip = isset($request['allow_skip']) ? $request['allow_skip'] : 0;
     $return_ivr = isset($request['return_ivr']) ? $request['return_ivr'] : 0;
     $noanswer = isset($request['noanswer']) ? $request['noanswer'] : 0;
     $post_dest = isset($request['post_dest']) ? $request['post_dest'] : '';
     $repeat_msg = isset($request['repeat_msg']) ? $request['repeat_msg'] : '';
     if (isset($request['goto0']) && $request['goto0']) {
         // 'ringgroup_post_dest'  'ivr_post_dest' or whatever
         $post_dest = $request[$request['goto0'] . '0'];
     }
     switch ($action) {
         case 'add':
             $_REQUEST['extdisplay'] = announcement_add($description, $recording_id, $allow_skip, $post_dest, $return_ivr, $noanswer, $repeat_msg);
             needreload();
             $this->freepbx->View->redirect_standard('extdisplay', 'view');
             break;
         case 'edit':
             announcement_edit($announcement_id, $description, $recording_id, $allow_skip, $post_dest, $return_ivr, $noanswer, $repeat_msg);
             needreload();
             $this->freepbx->View->redirect_standard('extdisplay', 'view');
             break;
         case 'delete':
             announcement_delete($_REQUEST['extdisplay']);
             needreload();
             $this->freepbx->View->redirect_standard();
             break;
     }
 }
Beispiel #2
0
    // 'ringgroup_post_dest'  'ivr_post_dest' or whatever
    $post_dest = $_POST[$_POST['goto0'] . '0'];
}
switch ($action) {
    case 'add':
        announcement_add($description, $recording_id, $allow_skip, $post_dest, $return_ivr, $noanswer, $repeat_msg);
        needreload();
        redirect_standard();
        break;
    case 'edit':
        announcement_edit($announcement_id, $description, $recording_id, $allow_skip, $post_dest, $return_ivr, $noanswer, $repeat_msg);
        needreload();
        redirect_standard('extdisplay');
        break;
    case 'delete':
        announcement_delete($announcement_id);
        needreload();
        redirect_standard();
        break;
}
?>
 
</div>

<div class="rnav"><ul>
<?php 
// Eventually I recon the drawListMenu could be built into the new component class thus making
// the relevent page.php file unnessassary
echo '<li><a href="config.php?display=announcement&amp;type=setup">' . _('Add Announcement') . '</a></li>';
foreach (announcement_list() as $row) {
    echo '<li><a href="config.php?display=announcement&amp;type=setup&amp;extdisplay=' . $row[0] . '" class="">' . $row[1] . '</a></li>';