print $LANGCODE; ?> " style="border: none;" width="0" height="0"></iframe> <?php if (isset($auth) && ('takequestion' == $action || 'editentry' == $action || 'editpreview' == $action || 'addnews' == $action || 'editnews' == $action || 'copyentry' == $action)) { if ($faqconfig->get('main.enableWysiwygEditor') == true) { ?> <!-- tinyMCE --> <script type="text/javascript"> /*<![CDATA[*/ //<!-- tinyMCE.init({ // General options mode : "exact", language : "<?php print PMF_Language::isASupportedTinyMCELanguage($LANGCODE) ? $LANGCODE : 'en'; ?> ", elements : "content", width : "720", height : "480", theme : "advanced", plugins : "spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,syntaxhl,phpmyfaq", theme_advanced_blockformats : "p,div,h1,h2,h3,h4,h5,h6,blockquote,dt,dd,code,samp", // Theme options theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,phpmyfaq,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,syntaxhl,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen,help", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left",
exit; } $translationLanguage = PMF_Filter::filterInput(INPUT_POST, 'translation', FILTER_SANITIZE_STRIPPED, $LANGCODE); if (!PMF_Language::isASupportedLanguage($translationLanguage)) { $translationLanguage = $LANGCODE; } $faqSource['id'] = 'writeSourceFaqId'; $faqSource['lang'] = $translationLanguage; $faqSource['title'] = 'writeSourceTitle'; $faqSource['content'] = 'writeSourceContent'; $faqSource['keywords'] = 'writeSourceKeywords'; try { $faqsession->userTracking('new_translation_entry', 0); } catch (PMF_Exception $e) { // @todo handle the exception } $id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT); $categoryId = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT); $srclang = PMF_Filter::filterInput(INPUT_GET, 'srclang', FILTER_SANITIZE_STRIPPED); if (!is_null($id) && !is_null($srclang) && PMF_Language::isASupportedLanguage($srclang)) { $oFaq = new PMF_Faq($faqConfig); $oFaq->getRecord($id); $faqSource = $oFaq->faqRecord; } $captchaHelper = new PMF_Helper_Captcha($faqConfig); // Enable/Disable WYSIWYG editor if ($faqConfig->get('main.enableWysiwygEditorFrontend')) { $tpl->parseBlock('writeContent', 'enableWysiwygEditor', array('currentTimestamp' => $_SERVER['REQUEST_TIME'])); } $tpl->parse('writeContent', array('writeSourceFaqId' => $faqSource['id'], 'writeSourceTitle' => $faqSource['title'], 'writeSourceContent' => strip_tags($faqSource['content']), 'writeSourceKeywords' => $faqSource['keywords'], 'categoryId' => $categoryId, 'msgNewTranslationHeader' => $PMF_LANG['msgNewTranslationHeader'], 'msgNewTranslationAddon' => $PMF_LANG['msgNewTranslationAddon'], 'msgNewTransSourcePane' => $PMF_LANG['msgNewTransSourcePane'], 'msgNewTranslationPane' => $PMF_LANG['msgNewTranslationPane'], 'writeSendAdress' => '?' . $sids . 'action=save', 'defaultContentName' => $user ? $user->getUserData('display_name') : '', 'defaultContentMail' => $user ? $user->getUserData('email') : '', 'msgNewTranslationQuestion' => $PMF_LANG['msgNewContentTheme'], 'msgNewTranslationAnswer' => $PMF_LANG['msgNewContentArticle'], 'msgNewTranslationName' => $PMF_LANG['msgNewTranslationName'], 'msgNewTranslationMail' => $PMF_LANG['msgNewTranslationMail'], 'msgNewTranslationKeywords' => $PMF_LANG['msgNewTranslationKeywords'], 'writeTransFaqLanguage' => $translationLanguage, 'captchaFieldset' => $captchaHelper->renderCaptcha($captcha, 'translate', $PMF_LANG['msgCaptcha'], $auth), 'msgNewTranslationSubmit' => $PMF_LANG['msgNewTranslationSubmit'], 'tinyMCELanguage' => PMF_Language::isASupportedTinyMCELanguage($LANGCODE) ? $LANGCODE : 'en')); $tpl->merge('writeContent', 'index');
* @since 2006-11-12 */ if (!defined('IS_VALID_PHPMYFAQ')) { header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME'])); exit; } $captcha = new PMF_Captcha($db, $Language); $captcha->setSessionId($sids); if (!is_null($showCaptcha)) { $captcha->showCaptchaImg(); exit; } $translationLanguage = PMF_Filter::filterInput(INPUT_POST, 'translation', FILTER_SANITIZE_STRIPPED, $LANGCODE); if (!PMF_Language::isASupportedLanguage($translationLanguage)) { $translationLanguage = $LANGCODE; } $faqSource['id'] = 'writeSourceFaqId'; $faqSource['lang'] = $translationLanguage; $faqSource['title'] = 'writeSourceTitle'; $faqSource['content'] = 'writeSourceContent'; $faqSource['keywords'] = 'writeSourceKeywords'; $faqsession->userTracking('new_translation_entry', 0); $id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT); $srclang = PMF_Filter::filterInput(INPUT_GET, 'srclang', FILTER_SANITIZE_STRIPPED); if (!is_null($id) && !is_null($srclang) && PMF_Language::isASupportedLanguage($srclang)) { $oFaq = new PMF_Faq(); $oFaq->getRecord($id); $faqSource = $oFaq->faqRecord; } $tpl->processTemplate('writeContent', array('writeSourceFaqId' => $faqSource['id'], 'writeSourceTitle' => $faqSource['title'], 'writeSourceContent' => $faqSource['content'], 'writeSourceKeywords' => $faqSource['keywords'], 'msgNewTranslationHeader' => $PMF_LANG['msgNewTranslationHeader'], 'msgNewTranslationAddon' => $PMF_LANG['msgNewTranslationAddon'], 'msgNewTransSourcePane' => $PMF_LANG['msgNewTransSourcePane'], 'msgNewTranslationPane' => $PMF_LANG['msgNewTranslationPane'], 'writeSendAdress' => '?' . $sids . 'action=save', 'defaultContentName' => $user ? $user->getUserData('display_name') : '', 'defaultContentMail' => $user ? $user->getUserData('email') : '', 'msgNewTranslationName' => $PMF_LANG['msgNewTranslationName'], 'msgNewTranslationMail' => $PMF_LANG['msgNewTranslationMail'], 'msgNewTranslationKeywords' => $PMF_LANG['msgNewTranslationKeywords'], 'writeTransFaqLanguage' => $translationLanguage, 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('translate')), 'msgNewTranslationSubmit' => $PMF_LANG['msgNewTranslationSubmit'], 'tinyMCELanguage' => PMF_Language::isASupportedTinyMCELanguage($LANGCODE) ? $LANGCODE : 'en')); $tpl->includeTemplate('writeContent', 'index');
* @since 2003-02-26 */ if (!defined('IS_VALID_PHPMYFAQ')) { $protocol = 'http'; if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') { $protocol = 'https'; } header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME'])); exit; } $templateVars = array('PMF_LANG' => $PMF_LANG, 'debugInformation' => DEBUG ? $faqConfig->getDb()->log() : '', 'formAction' => 'index.php' . (isset($action) ? '?action=' . $action : ''), 'isAuthenticated' => isset($auth), 'languageSelector' => PMF_Language::selectLanguages($LANGCODE, true), 'pmfVersion' => $faqConfig->get('main.currentVersion'), 'sessionKeepaliveUrl' => 'session.keepalive.php?lang=' . $LANGCODE, 'userDisplayName' => isset($user) ? $user->userdata->get('display_name') : '', 'userId' => isset($user) ? $user->userdata->get('user_id') : ''); $wysiwygActions = array('takequestion', 'editentry', 'editpreview', 'addnews', 'editnews', 'copyentry'); if (isset($auth) && in_array($action, $wysiwygActions) && $faqConfig->get('main.enableWysiwygEditor')) { $templateVars['wysiwygActive'] = true; $templateVars['tinyMceContentCss'] = '../assets/template/' . PMF_Template::getTplSetName() . '/css/style.css'; $templateVars['tinyMceLanguage'] = PMF_Language::isASupportedTinyMCELanguage($LANGCODE) ? $LANGCODE : 'en'; if ('addnews' == $action || 'editnews' == $action) { $templateVars['tinyMceElements'] = 'news'; $templateVars['tinyMceSave'] = ''; } else { $templateVars['tinyMceElements'] = 'answer'; $templateVars['tinyMceSave'] = 'save,|,'; } if (isset($faqData['id']) && $faqData['id'] == 0) { $templateVars['tinyMceSaveCallbackAction'] = 'recordAdd'; } else { $templateVars['tinyMceSaveCallbackAction'] = 'recordSave'; } } else { $templateVars['wysiwygActive'] = false; $twig->loadTemplate('footer.twig')->display($templateVars);