Exemple #1
0
/**
 * The HTML form to post a new thread
 * 
 * @return string
 */
function cpm_page_new()
{
    $html = '<h2>' . __('Send PM', 'cubepm') . '</h2>';
    if ($_POST['cpm_form_submit'] != '') {
        $cpm_errors = cpm_page_new_process();
        if (count($cpm_errors->get_error_messages()) > 0) {
            $html .= cpm_htmlError($cpm_errors);
            $html .= cpm_page_new_form();
        } else {
            $html .= cpm_htmlMessage(__('Your PM has been sent!', 'cubepm'), __('Success', 'cubepm'));
        }
    } else {
        $html .= cpm_page_new_form();
    }
    return $html;
}
Exemple #2
0
/**
 * Build HTML to show reply form
 * 
 * @todo Add reply form here
 * 
 * @param int $thread_id
 * @param int $user_id
 * @return string
 */
function cpm_page_read_buildReply($thread_id, $user_id, $cpm_errors = null)
{
    $html = '<a name="cpm-reply"></a>';
    $html .= '<h3>' . __('Reply', 'cubepm') . '</h3>';
    if ($cpm_errors != null) {
        if (count($cpm_errors->get_error_messages()) > 0) {
            $html .= cpm_htmlError($cpm_errors);
        } else {
            $html .= cpm_htmlMessage('Reply sent!', 'Success');
        }
    }
    $html .= '<table class="cpm-thread-reply">';
    $html .= '<tbody><tr><td>';
    $html .= '<form method="post" action="' . cpm_buildURL(array('cpm_action' => 'read', 'cpm_id' => $thread_id)) . '#cpm-reply">';
    $html .= '<input type="hidden" name="cpm_form_submit" value="1" />';
    $html .= '<p><textarea name="cpm_message" id="cpm_message">' . $cpm_message . '</textarea></p>';
    $html .= '<p><input type="submit" name="cpm_submit" id="cpm_submit" value="' . __('Reply', 'cubepm') . ' &raquo;" /></p>';
    $html .= '</form>';
    $html .= '</td></tr></tbody>';
    $html .= '</table>';
    return $html;
}