/** * 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; }
/** * 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; }
/** * 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; }