Exemplo n.º 1
0
}
/*=================================================================
  Display Section
 =================================================================*/
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Forums'), 'index.php');
$noPHP_SELF = true;
$out = '';
// display tool title
$out .= claro_html_tool_title(get_lang('Forums'), $is_allowedToEdit ? 'help_forum.php' : false);
if (!$allowed) {
    $out .= $dialogBox->render();
} else {
    // Display new topic page
    if (isset($_REQUEST['submit']) && !$error) {
        // Display success message
        $out .= disp_confirmation_message(get_lang('Your message has been entered'), $forum_id, $topic_id);
    } else {
        if ($error) {
            // display error message
            $out .= $dialogBox->render();
        }
        $out .= disp_forum_breadcrumb($pagetype, $forum_id, $forum_name) . claro_html_menu_horizontal(disp_forum_toolbar($pagetype, $forum_id, 0, 0)) . '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">' . "\n" . '<input type="hidden" name="forum" value="' . $forum_id . '" />' . "\n" . claro_form_relay_context() . '<table border="0" width="100%">' . "\n" . '<tr valign="top">' . "\n" . '<td align="right"><label for="subject">' . get_lang('Subject') . '</label> : </td>' . '<td><input type="text" name="subject" id="subject" size="50" maxlength="100" value="' . htmlspecialchars($subject) . '" /></td>' . '</tr>' . '<tr  valign="top">' . "\n" . '<td align="right"><br />' . get_lang('Message body') . ' :</td>';
        if (!empty($message)) {
            $content = $message;
        } else {
            $content = '';
        }
        $out .= '<td>' . claro_html_textarea_editor('message', $content) . '</td>' . '</tr>' . '<tr  valign="top"><td>&nbsp;</td>' . '<td><input type="submit" name="submit" value="' . get_lang('Ok') . '" />&nbsp; ' . '&nbsp;<input type="submit" name="cancel" value="' . get_lang('Cancel') . '" />' . "\n" . '</td></tr>' . '</table>' . '</form>' . "\n";
    }
}
// end allowed
Exemplo n.º 2
0
/*=================================================================
  Display Section
 =================================================================*/
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Forums'), 'index.php');
$noPHP_SELF = true;
$out = '';
// Forum Title
$out .= claro_html_tool_title(get_lang('Forums'), $is_allowedToEdit ? 'help_forum.php' : false);
if (!$allowed || !$is_allowedToEdit) {
    $out .= $dialogBox->render();
} else {
    if (isset($_REQUEST['submit']) && !$error) {
        if (!isset($_REQUEST['delete'])) {
            $out .= disp_confirmation_message(get_lang('Your message has been entered'), $forum_id, $topic_id);
        } else {
            $out .= disp_confirmation_message(get_lang('Your message has been deleted'), $forum_id);
        }
    } else {
        $first_post = is_first_post($topic_id, $post_id);
        if ($error) {
            $out .= $dialogBox->render();
        }
        $out .= disp_forum_breadcrumb($pagetype, $forum_id, $forum_name, $topic_id, $subject) . claro_html_menu_horizontal(disp_forum_toolbar($pagetype, $forum_id, $topic_id, 0)) . '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post" >' . "\n" . claro_form_relay_context() . '<input type="hidden" name="post_id" value="' . $post_id . '" />' . "\n" . '<table border="0" width="100%" >' . "\n";
        if ($first_post) {
            $out .= '<tr valign="top">' . "\n" . '<td align="right">' . "\n" . '<label for="subject">' . get_lang('Subject') . '</label> : ' . '</td>' . "\n" . '<td>' . "\n" . '<input type="text" name="subject" id="subject" size="50" maxlength="100" value="' . htmlspecialchars($subject) . '" />' . '</td>' . "\n" . '</tr>' . "\n";
        }
        $out .= '<tr valign="top">' . "\n" . '<td align="right">' . "\n" . '<br />' . get_lang('Message body') . ' : ' . "\n" . '</td>' . "\n" . '<td>' . "\n" . claro_html_textarea_editor('message', $message) . '</td>' . "\n" . '</tr>' . "\n" . '<tr valign="top">' . "\n" . '<td align="right">' . "\n" . '<label for="delete" >' . get_lang('Delete') . '</label>' . "\n" . ' : ' . "\n" . '</td>' . "\n" . '<td>' . "\n" . '<input type="checkbox" name="delete" id="delete" />' . "\n" . '</td>' . "\n" . '</tr>' . "\n" . '<tr>' . '<td>&nbsp;</td>' . "\n" . '<td>' . '<input type="submit" name="submit" value="' . get_lang('Ok') . '" />&nbsp; ' . '<input type="submit" name="cancel" value="' . get_lang('Cancel') . '" />' . '</td>' . "\n" . '</tr>' . "\n" . '</table>' . "\n" . '</form>' . "\n" . '<br />' . "\n" . '<center>' . '<a href="' . htmlspecialchars(Url::Contextualize(get_module_url('CLFRM') . '/viewtopic.php?topic=' . $topic_id)) . '" target="_blank">' . get_lang('Topic review') . '</a>' . '</center>' . '<br />' . "\n";
    }
    // end // else if ! isset submit
}
$claroline->display->body->appendContent($out);