Exemplo n.º 1
0
     $PAGE->add_body_class('forumng-iframe');
 }
 // See if this is a save action or a form view
 require_once 'editpost_form.php';
 if ($cloneid) {
     // Clone parameter is required for all actions
     $params['clone'] = $cloneid;
 }
 // Iframe parameter always available.
 if ($iframe) {
     $params['iframe'] = 1;
 }
 // Expand parameter always available
 $params['expand'] = $expand;
 $mform = new mod_forumng_editpost_form('editpost.php', array('params' => $params, 'isdiscussion' => $isdiscussion, 'forum' => $forum, 'edit' => $edit, 'ispost' => $ispost, 'islock' => $islock, 'post' => isset($post) ? $post : null, 'isroot' => $isroot, 'iframe' => $iframe ? true : false, 'timelimit' => $ispost && $edit && !$post->can_ignore_edit_time_limit() ? $post->get_edit_time_limit() : 0, 'draft' => $draft));
 if ($mform->is_cancelled()) {
     if ($edit) {
         redirect('discuss.php?' . $post->get_discussion()->get_link_params(mod_forumng::PARAM_PLAIN) . $expandparam);
     } else {
         if ($islock || $replytoid) {
             redirect('discuss.php?' . $discussion->get_link_params(mod_forumng::PARAM_PLAIN) . $expandparam);
         } else {
             redirect('view.php?' . $forum->get_link_params(mod_forumng::PARAM_PLAIN));
         }
     }
 } else {
     if ($fromform = $mform->get_data()) {
         // Set up values which might not be defined
         if ($ispost) {
             // Blank subject counts as null
             if (trim($fromform->subject) === '') {