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", theme_advanced_statusbar_location : "bottom", relative_urls : false, convert_urls : false, remove_linebreaks : false, use_native_selects : true, extended_valid_elements : "code", // Ajax-based file manager file_browser_callback : "ajaxfilemanager", // Example content CSS (should be your site CSS) content_css : "../template/css/<?php print PMF_Template::getTplSetName(); ?> /style.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "js/template_list.js", // Replace values for the template plugin template_replace_values : { username : "******", user_id : "<?php print $user->userdata->get('user_id'); ?>
?> "> <meta name="publisher" content="phpMyFAQ Team"> <link rel="stylesheet" href="assets/css/style.css?v=1"> <script src="../assets/js/libs/modernizr.min.js"></script> <script src="../assets/js/libs/jquery.min.js"></script> <script src="../assets/js/phpmyfaq.js"></script> <link rel="shortcut icon" href="../assets/template/<?php echo PMF_Template::getTplSetName(); ?> /favicon.ico"> <link rel="apple-touch-icon" href="../assets/template/<?php echo PMF_Template::getTplSetName(); ?> /apple-touch-icon.png"> </head> <body class="attachments"> <?php } if (is_null($currentAction) && $auth && $user->perm->checkRight($user->getUserId(), 'addattachment')) { $recordId = filter_input(INPUT_GET, 'record_id', FILTER_VALIDATE_INT); $recordLang = filter_input(INPUT_GET, 'record_lang', FILTER_SANITIZE_STRING); ?> <form action="attachment.php?action=save" enctype="multipart/form-data" method="post" accept-charset="utf-8"> <fieldset> <legend> <?php
function printInputFieldByType($key, $type) { global $PMF_LANG; $faqconfig = PMF_Configuration::getInstance(); switch ($type) { case 'area': printf('<textarea name="edit[%s]" cols="60" rows="6" style="width: 500px;">%s</textarea>', $key, str_replace('<', '<', str_replace('>', '>', $faqconfig->get($key)))); printf("<br />\n"); break; case 'input': printf('<input type="text" name="edit[%s]" size="75" value="%s" style="width: 500px;" />', $key, str_replace('"', '"', $faqconfig->get($key))); printf("<br />\n"); break; case 'select': printf('<select name="edit[%s]" size="1" style="width: 500px;">', $key); switch ($key) { case 'main.language': $languages = PMF_Language::getAvailableLanguages(); if (count($languages) > 0) { print PMF_Language::languageOptions(str_replace(array("language_", ".php"), "", $faqconfig->get('main.language')), false, true); } else { print '<option value="language_en.php">English</option>'; } break; case 'records.orderby': print sortingOptions($faqconfig->get($key)); break; case 'records.sortby': printf('<option value="DESC"%s>%s</option>', 'DESC' == $faqconfig->get($key) ? ' selected="selected"' : '', $PMF_LANG['ad_conf_desc']); printf('<option value="ASC"%s>%s</option>', 'ASC' == $faqconfig->get($key) ? ' selected="selected"' : '', $PMF_LANG['ad_conf_asc']); break; case 'main.permLevel': print PMF_Perm::permOptions($faqconfig->get($key)); break; case "main.templateSet": /** * TODO: do get availiable template sets in the PMF_Template */ foreach (new DirectoryIterator('../template') as $item) { if (!$item->isDot() && $item->isDir()) { $selected = PMF_Template::getTplSetName() == $item ? ' selected="selected"' : ''; printf("<option%s>%s</option>", $selected, $item); } } break; case "main.attachmentsStorageType": foreach ($PMF_LANG['att_storage_type'] as $i => $item) { $selected = $faqconfig->get($key) == $i ? ' selected="selected"' : ''; printf('<option value="%d"%s>%s</option>', $i, $selected, $item); } break; } print "</select>\n<br />\n"; break; case 'checkbox': printf('<input type="checkbox" name="edit[%s]" value="true"', $key); if ($faqconfig->get($key)) { print ' checked="checked"'; } print " /><br />\n"; break; case 'print': printf('<input type="hidden" name="edit[%s]" size="80" value="%s" />%s<br />', $key, str_replace('"', '"', $faqconfig->get($key)), $faqconfig->get($key)); break; } }
* @link http://www.phpmyfaq.de * @since 2003-02-26 */ use PMF\Helper\AdminMenuBuilder; 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; } $httpHeader = new PMF_Helper_Http(); $httpHeader->setContentType('text/html'); $httpHeader->addHeader(); $templateVars = array('PMF_LANG' => $PMF_LANG, 'appleTouchIcon' => '../assets/template/' . PMF_Template::getTplSetName() . '/apple-touch-icon.png', 'baseUrl' => $faqConfig->get('main.referenceURL') . '/admin/', 'editorAutosaveActive' => 'editentry' === $action && $faqConfig->get('records.autosaveActive'), 'editorAutosaveSeconds' => $faqConfig->get('records.autosaveSecs'), 'gravatarActive' => $faqConfig->get('main.enableGravatarSupport'), 'isAuthenticated' => isset($auth) && in_array(true, $permission), 'pmfVersion' => $faqConfig->get('main.currentVersion'), 'secLevelEntries' => '', 'shortcutIcon' => '../assets/template/' . PMF_Template::getTplSetName() . '/favicon.ico', 'time' => time(), 'titleFAQ' => $faqConfig->get('main.titleFAQ'), 'userDisplayName' => isset($user) ? $user->getUserData('display_name') : '', 'userTooltip' => isset($user) ? $PMF_LANG['ad_user_loggedin'] . $user->getLogin() : '', 'userEmail' => isset($user) ? $user->getUserData('email') : ''); if (isset($user) && $faqConfig->get('main.enableGravatarSupport')) { $avatar = new PMF_Services_Gravatar($faqConfig); $templateVars['gravatarImage'] = $avatar->getImage($user->getUserData('email'), array('size' => 30)); unset($avatar); } else { $templateVars['gravatarImage'] = ''; } $adminMenuBuilder = new AdminMenuBuilder($twig); $adminMenuBuilder->setUser($user); switch ($action) { case 'user': case 'group': case 'passwd': case 'cookies': $adminMenuBuilder->setHeader($PMF_LANG['admin_mainmenu_users']);
/** * @param $key * @param $type * @return void */ function printInputFieldByType($key, $type) { global $PMF_LANG; $faqconfig = PMF_Configuration::getInstance(); switch ($type) { case 'area': printf('<textarea name="edit[%s]" cols="60" rows="6" style="width: 300px;">%s</textarea>', $key, str_replace('<', '<', str_replace('>', '>', $faqconfig->get($key)))); printf("</p>\n"); break; case 'input': if ('' == $faqconfig->get($key) && 'socialnetworks.twitterAccessTokenKey' == $key) { $value = $_SESSION['access_token']['oauth_token']; } elseif ('' == $faqconfig->get($key) && 'socialnetworks.twitterAccessTokenSecret' == $key) { $value = $_SESSION['access_token']['oauth_token_secret']; } else { $value = str_replace('"', '"', $faqconfig->get($key)); } printf('<input type="text" name="edit[%s]" size="75" value="%s" style="width: 300px;" />', $key, $value); printf("</p>\n"); break; case 'select': printf('<select name="edit[%s]" size="1" style="width: 300px;">', $key); switch ($key) { case 'main.language': $languages = PMF_Language::getAvailableLanguages(); if (count($languages) > 0) { print PMF_Language::languageOptions(str_replace(array('language_', '.php'), '', $faqconfig->get('main.language')), false, true); } else { print '<option value="language_en.php">English</option>'; } break; case 'records.orderby': print sortingOptions($faqconfig->get($key)); break; case 'records.sortby': printf('<option value="DESC"%s>%s</option>', 'DESC' == $faqconfig->get($key) ? ' selected="selected"' : '', $PMF_LANG['ad_conf_desc']); printf('<option value="ASC"%s>%s</option>', 'ASC' == $faqconfig->get($key) ? ' selected="selected"' : '', $PMF_LANG['ad_conf_asc']); break; case 'security.permLevel': print PMF_Perm::permOptions($faqconfig->get($key)); break; case "main.templateSet": /** * TODO: do get available template sets in the PMF_Template */ foreach (new DirectoryIterator('../template') as $item) { if (!$item->isDot() && $item->isDir()) { $selected = PMF_Template::getTplSetName() == $item ? ' selected="selected"' : ''; printf("<option%s>%s</option>", $selected, $item); } } break; case "records.attachmentsStorageType": foreach ($PMF_LANG['att_storage_type'] as $i => $item) { $selected = $faqconfig->get($key) == $i ? ' selected="selected"' : ''; printf('<option value="%d"%s>%s</option>', $i, $selected, $item); } break; case "records.orderingPopularFaqs": printf('<option value="visits"%s>%s</option>', 'visits' == $faqconfig->get($key) ? ' selected="selected"' : '', $PMF_LANG['records.orderingPopularFaqs.visits']); printf('<option value="voting"%s>%s</option>', 'voting' == $faqconfig->get($key) ? ' selected="selected"' : '', $PMF_LANG['records.orderingPopularFaqs.voting']); break; case "search.relevance": printf('<option value="thema,content,keywords"%s>%s</option>', 'thema,content,keywords' == $faqconfig->get($key) ? ' selected="selected"' : '', $PMF_LANG['search.relevance.thema-content-keywords']); printf('<option value="thema,keywords,content"%s>%s</option>', 'thema,keywords,content' == $faqconfig->get($key) ? ' selected="selected"' : '', $PMF_LANG['search.relevance.thema-keywords-content']); printf('<option value="content,thema,keywords"%s>%s</option>', 'content,thema,keywords' == $faqconfig->get($key) ? ' selected="selected"' : '', $PMF_LANG['search.relevance.content-thema-keywords']); printf('<option value="content,keywords,thema"%s>%s</option>', 'content,keywords,thema' == $faqconfig->get($key) ? ' selected="selected"' : '', $PMF_LANG['search.relevance.content-keywords-thema']); printf('<option value="keywords,content,thema"%s>%s</option>', 'keywords,content,thema' == $faqconfig->get($key) ? ' selected="selected"' : '', $PMF_LANG['search.relevance.keywords-content-thema']); printf('<option value="keywords,thema,content"%s>%s</option>', 'keywords,thema,content' == $faqconfig->get($key) ? ' selected="selected"' : '', $PMF_LANG['search.relevance.keywords-thema-content']); break; } print "</select>\n</p>\n"; break; case 'checkbox': printf('<input type="checkbox" name="edit[%s]" value="true"', $key); if ($faqconfig->get($key)) { print ' checked="checked"'; } print " /></p>\n"; break; case 'print': printf('<input type="hidden" name="edit[%s]" size="80" value="%s" />%s</p>', $key, str_replace('"', '"', $faqconfig->get($key)), $faqconfig->get($key)); break; } }
/** * Returns all available templates as array * * @return array */ public function getAvailableTemplates() { $templates = []; foreach (new DirectoryIterator(PMF_ROOT_DIR . '/assets/template') as $item) { $basename = $item->getBasename(); if (!$item->isDot() && $item->isDir()) { $templates[$basename] = PMF_Template::getTplSetName() === $basename ? true : false; } } return $templates; }
* @link http://www.phpmyfaq.de * @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;