示例#1
0
/**
* Shows a given submission form
*
* This is the submission it is modular to allow us to write as little as
* possible.  It takes a type and formats a form for the user.  Currently the
* types is story.  If no type is provided, Story is assumed.
*
* @param    string  $type   type of submission ('story')
* @param    string  $mode   calendar mode ('personal' or empty string)
* @return   string          HTML for submission form
*
*/
function submissionform($type = 'story', $mode = '')
{
    global $_CONF, $_TABLES, $LANG12;
    $retval = '';
    COM_clearSpeedlimit($_CONF['speedlimit'], 'submit');
    $last = COM_checkSpeedlimit('submit');
    if ($last > 0) {
        $retval .= COM_showMessageText($LANG12[30] . $last . $LANG12[31], $LANG12[26]);
    } else {
        if (COM_isAnonUser() && ($_CONF['loginrequired'] == 1 || $_CONF['submitloginrequired'] == 1)) {
            $retval .= SEC_loginRequiredForm();
            return $retval;
        } else {
            $retval .= COM_startBlock($LANG12[19]) . $LANG12[9] . COM_endBlock();
            if (strlen($type) > 0 && $type !== 'story') {
                $formresult = PLG_showSubmitForm($type);
                if ($formresult == false) {
                    COM_errorLog("Someone tried to submit an item to the {$type}-plugin, which cannot be found.", 1);
                    COM_displayMessageAndAbort(79, '', 410, 'Gone');
                } else {
                    $retval .= $formresult;
                }
            } else {
                $retval .= submitstory();
            }
        }
    }
    return $retval;
}
示例#2
0
/**
* Shows a given submission form
*
* This is the submission it is modular to allow us to write as little as
* possible.  It takes a type and formats a form for the user.  Currently the
* types is story.  If no type is provided, Story is assumed.
*
* @param    string  $type   type of submission ('story')
* @param    string  $mode   story mode ('personal' or empty string)
* @param    string  $topic  topic (for stories)
* @return   string          HTML for submission form
*
*/
function submissionform($type = 'story', $mode = '', $topic = '')
{
    global $_CONF, $_TABLES, $_USER, $LANG12, $LANG_LOGIN;
    $retval = '';
    $postmode = $_CONF['postmode'];
    COM_clearSpeedlimit($_CONF['speedlimit'], 'submit');
    $last = COM_checkSpeedlimit('submit');
    if ($last > 0) {
        $retval .= COM_showMessageText($LANG12[30] . $last . $LANG12[31], $LANG12[26], false, 'error');
    } else {
        if (COM_isAnonUser() && ($_CONF['loginrequired'] == 1 || $_CONF['submitloginrequired'] == 1)) {
            $display = COM_siteHeader('menu', $LANG_LOGIN[1]);
            $display .= SEC_loginRequiredForm();
            $display .= COM_siteFooter();
            echo $display;
            exit;
        } else {
            $retval .= COM_startBlock($LANG12[19], '', COM_getBlockTemplate('_submit_story', 'header')) . $LANG12[9] . COM_endBlock(COM_getBlockTemplate('_submit_story', 'footer'));
            $retval .= '<div style="border-bottom:1px solid #cccccc"></div>';
            if (strlen($type) > 0 && $type != 'story') {
                $formresult = PLG_showSubmitForm($type);
                if ($formresult == false) {
                    COM_errorLog("Someone tried to submit an item to the {$type}-plugin, which cannot be found.", 1);
                    COM_displayMessageAndAbort(79, '', 410, 'Gone');
                } else {
                    $retval .= $formresult;
                }
            } else {
                $retval .= submitstory($topic);
            }
        }
    }
    return $retval;
}
示例#3
0
 } elseif ($mode == 'edit' || $mode == 'clone') {
     $sid = '';
     if (isset($_GET['sid'])) {
         $sid = COM_applyFilter($_GET['sid']);
     }
     $display .= storyeditor($sid, $mode, '');
     $display = COM_createHTMLDocument($display, array('pagetitle' => $LANG24[5]));
     COM_output($display);
 } else {
     if ($mode == 'editsubmission') {
         $display .= storyeditor(COM_applyFilter($_GET['id']), $mode);
         $display = COM_createHTMLDocument($display, array('pagetitle' => $LANG24[5]));
         COM_output($display);
     } else {
         if ($mode == $LANG_ADMIN['save'] && !empty($LANG_ADMIN['save']) && SEC_checkToken()) {
             submitstory();
         } else {
             // 'cancel' or no mode at all
             $type = '';
             if (isset($_POST['type'])) {
                 $type = COM_applyFilter($_POST['type']);
             }
             if ($mode == $LANG24[10] && !empty($LANG24[10]) && $type == 'submission') {
                 $display = COM_refresh($_CONF['site_admin_url'] . '/moderation.php');
             } else {
                 $current_topic = '';
                 if (empty($mode)) {
                     if (!empty($_GET['tid'])) {
                         $current_topic = COM_applyFilter($_GET['tid']);
                     } elseif (!empty($_POST['tid'])) {
                         $current_topic = COM_applyFilter($_POST['tid']);
示例#4
0
/**
* Shows a given submission form
*
* This is the submission it is modular to allow us to write as little as
* possible.  It takes a type and formats a form for the user.  Currently the
* types is story.  If no type is provided, Story is assumed.
*
* @param    string  $type   type of submission ('story')
* @param    string  $mode   calendar mode ('personal' or empty string)
* @param    string  $topic  topic (for stories)
* @return   string          HTML for submission form
*
*/
function submissionform($type = 'story', $mode = '', $topic = '')
{
    global $_CONF, $_TABLES, $_USER, $LANG12, $LANG_LOGIN;
    $retval = '';
    COM_clearSpeedlimit($_CONF['speedlimit'], 'submit');
    $last = COM_checkSpeedlimit('submit');
    if ($last > 0) {
        $retval .= COM_startBlock($LANG12[26], '', COM_getBlockTemplate('_msg_block', 'header')) . $LANG12[30] . $last . $LANG12[31] . COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
    } else {
        if (empty($_USER['username']) && ($_CONF['loginrequired'] == 1 || $_CONF['submitloginrequired'] == 1)) {
            $retval .= COM_startBlock($LANG_LOGIN[1], '', COM_getBlockTemplate('_msg_block', 'header'));
            $loginreq = new Template($_CONF['path_layout'] . 'submit');
            $loginreq->set_file('loginreq', 'submitloginrequired.thtml');
            $loginreq->set_var('xhtml', XHTML);
            $loginreq->set_var('site_url', $_CONF['site_url']);
            $loginreq->set_var('site_admin_url', $_CONF['site_admin_url']);
            $loginreq->set_var('layout_url', $_CONF['layout_url']);
            $loginreq->set_var('login_message', $LANG_LOGIN[2]);
            $loginreq->set_var('lang_login', $LANG_LOGIN[3]);
            $loginreq->set_var('lang_newuser', $LANG_LOGIN[4]);
            $loginreq->parse('errormsg', 'loginreq');
            $retval .= $loginreq->finish($loginreq->get_var('errormsg'));
            $retval .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
            return $retval;
        } else {
            $retval .= COM_startBlock($LANG12[19]) . $LANG12[9] . COM_endBlock();
            if (strlen($type) > 0 && $type != 'story') {
                $formresult = PLG_showSubmitForm($type);
                if ($formresult == false) {
                    COM_errorLog("Someone tried to submit an item to the {$type}-plugin, which cannot be found.", 1);
                    COM_displayMessageAndAbort(79, '', 410, 'Gone');
                } else {
                    $retval .= $formresult;
                }
            } else {
                $retval .= submitstory($topic);
            }
        }
    }
    return $retval;
}