Ejemplo n.º 1
0
    ?>
">
    <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 
Ejemplo n.º 2
0
 /**
  * Set the template set name to use
  * 
  * @param $tplSetName
  * 
  * @return void
  */
 public static function setTplSetName($tplSetName)
 {
     self::$tplSetName = $tplSetName;
 }
Ejemplo n.º 3
0
    $right_tpl = $action == 'artikel' ? 'catandtag.tpl' : 'tagcloud.tpl';
} else {
    $right_tpl = 'startpage.tpl';
}
//
// Load template files and set template variables
// Check on mobile devices first, if iPhone detected, switch to iPhone layout
//
/*
if (stristr($_SERVER['HTTP_USER_AGENT'], 'iPhone')) {
	$templateSet = 'mobile';
} else {
	$templateSet = $faqconfig->get('main.templateSet');
}
*/
$tpl = new PMF_Template(array('index' => 'index.tpl', 'loginBox' => $login_tpl, 'rightBox' => $right_tpl, 'writeContent' => $inc_tpl), $faqconfig->get('main.templateSet'));
$tpl->ajax_active = $faqconfig->get('main.useAjaxMenu');
if ($tpl->ajax_active) {
    switch ($_SERVER['REQUEST_METHOD']) {
        case "GET":
            $tpl->ajax_request = PMF_Filter::filterInput(INPUT_GET, 'ajax', FILTER_SANITIZE_STRING);
            break;
        case "POST":
            $tpl->ajax_request = PMF_Filter::filterInput(INPUT_POST, 'ajax', FILTER_SANITIZE_STRING);
            break;
    }
    if ($tpl->ajax_request && $tpl->ajax_request != 'ajax_init') {
        // If it's not the ajax initialization, set the request
        switch ($_SERVER['REQUEST_METHOD']) {
            case "GET":
                $true_request = PMF_Filter::filterInput(INPUT_GET, 'action', FILTER_SANITIZE_STRING);
Ejemplo n.º 4
0
    $writeLangAdress = '?' . $sids;
}
//
// Set right column
//
// Check in any tags with at leat one entry exist
$hasTags = $oTag->existTagRelations();
if ($hasTags && ($action == 'artikel' || $action == 'show')) {
    $right_tpl = $action == 'artikel' ? 'catandtag.tpl' : 'tagcloud.tpl';
} else {
    $right_tpl = 'startpage.tpl';
}
//
// Load template files and set template variables
//
$tpl = new PMF_Template(array('index' => 'index.tpl', 'loginBox' => $login_tpl, 'rightBox' => $right_tpl, 'writeContent' => $inc_tpl), $faqconfig->get('main.templateSet'));
$usersOnLine = getUsersOnline();
$totUsersOnLine = $usersOnLine[0] + $usersOnLine[1];
$systemUri = PMF_Link::getSystemUri('index.php');
$helper = PMF_Helper_Category::getInstance();
$helper->setCategory($category);
$main_template_vars = array('title' => $faqconfig->get('main.titleFAQ') . $title, 'baseHref' => $systemUri, 'version' => $faqconfig->get('main.currentVersion'), 'header' => str_replace('"', '', $faqconfig->get('main.titleFAQ')), 'metaTitle' => str_replace('"', '', $faqconfig->get('main.titleFAQ')), 'metaDescription' => $faqconfig->get('main.metaDescription'), 'metaKeywords' => $faqconfig->get('main.metaKeywords') . $keywords, 'metaPublisher' => $faqconfig->get('main.metaPublisher'), 'metaLanguage' => $PMF_LANG['metaLanguage'], 'metaCharset' => $PMF_LANG['metaCharset'], 'phpmyfaqversion' => $faqconfig->get('main.currentVersion'), 'stylesheet' => $PMF_LANG['dir'] == 'rtl' ? 'style.rtl' : 'style', 'action' => $action, 'dir' => $PMF_LANG['dir'], 'msgCategory' => $PMF_LANG['msgCategory'], 'showCategories' => $helper->renderCategoryNavigation($cat), 'searchBox' => $PMF_LANG['msgSearch'], 'languageBox' => $PMF_LANG['msgLangaugeSubmit'], 'writeLangAdress' => $writeLangAdress, 'switchLanguages' => PMF_Language::selectLanguages($LANGCODE, true), 'userOnline' => $plr->getMsg('plmsgUserOnline', $totUsersOnLine) . $plr->getMsg('plmsgGuestOnline', $usersOnLine[0]) . $plr->getMsg('plmsgRegisteredOnline', $usersOnLine[1]), 'stickyRecordsHeader' => $PMF_LANG['stickyRecordsHeader'], 'copyright' => 'powered by <a href="http://www.phpmyfaq.de" target="_blank">phpMyFAQ</a> ' . $faqconfig->get('main.currentVersion'));
$stickyRecordsParams = $faq->getStickyRecords();
if (!isset($stickyRecordsParams['error'])) {
    $tpl->processBlock('index', 'stickyRecordsList', array('stickyRecordsUrl' => $stickyRecordsParams['url'], 'stickyRecordsTitle' => $stickyRecordsParams['title']));
}
if ($faqconfig->get('main.enableRewriteRules')) {
    $links_template_vars = array("faqHome" => $_SERVER['PHP_SELF'], "msgSearch" => '<a href="' . $systemUri . 'search.html">' . $PMF_LANG["msgAdvancedSearch"] . '</a>', 'msgAddContent' => '<a href="' . $systemUri . 'addcontent.html">' . $PMF_LANG["msgAddContent"] . '</a>', "msgQuestion" => '<a href="' . $systemUri . 'ask.html">' . $PMF_LANG["msgQuestion"] . '</a>', "msgOpenQuestions" => '<a href="' . $systemUri . 'open.html">' . $PMF_LANG["msgOpenQuestions"] . '</a>', 'msgHelp' => '<a href="' . $systemUri . 'help.html">' . $PMF_LANG["msgHelp"] . '</a>', "msgContact" => '<a href="' . $systemUri . 'contact.html">' . $PMF_LANG["msgContact"] . '</a>', "backToHome" => '<a href="' . $systemUri . 'index.html">' . $PMF_LANG["msgHome"] . '</a>', "allCategories" => '<a href="' . $systemUri . 'showcat.html">' . $PMF_LANG["msgShowAllCategories"] . '</a>', "writeSendAdress" => $systemUri . 'search.html', 'showInstantResponse' => '<a href="' . $systemUri . 'instantresponse.html">' . $PMF_LANG['msgInstantResponse'] . '</a>', 'showSitemap' => getLinkHtmlAnchor($_SERVER['PHP_SELF'] . '?' . $sids . 'action=sitemap&amp;lang=' . $LANGCODE, $PMF_LANG['msgSitemap']), 'opensearch' => $systemUri . 'search.html');
} else {
    $links_template_vars = array("faqHome" => $_SERVER['PHP_SELF'], "msgSearch" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=search">' . $PMF_LANG["msgAdvancedSearch"] . '</a>', "msgAddContent" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=add">' . $PMF_LANG["msgAddContent"] . '</a>', "msgQuestion" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=ask">' . $PMF_LANG["msgQuestion"] . '</a>', "msgOpenQuestions" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=open">' . $PMF_LANG["msgOpenQuestions"] . '</a>', "msgHelp" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=help">' . $PMF_LANG["msgHelp"] . '</a>', "msgContact" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=contact">' . $PMF_LANG["msgContact"] . '</a>', "allCategories" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=show">' . $PMF_LANG["msgShowAllCategories"] . '</a>', "backToHome" => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . '">' . $PMF_LANG["msgHome"] . '</a>', "writeSendAdress" => $_SERVER['PHP_SELF'] . '?' . $sids . 'action=search', 'showInstantResponse' => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=instantresponse">' . $PMF_LANG['msgInstantResponse'] . '</a>', 'showSitemap' => '<a href="' . $_SERVER['PHP_SELF'] . '?' . $sids . 'action=sitemap&amp;lang=' . $LANGCODE . '">' . $PMF_LANG['msgSitemap'] . '</a>', 'opensearch' => $_SERVER['PHP_SELF'] . '?' . $sids . 'action=search');
}
Ejemplo n.º 5
0
    // Overwrite English strings with the ones we have in the current language
    if (!file_exists(PMF_ROOT_DIR . '/lang/language_' . $LANGCODE . '.php')) {
        $LANGCODE = 'en';
    }
    require PMF_ROOT_DIR . '/lang/language_' . $LANGCODE . '.php';
} else {
    $LANGCODE = 'en';
}
//
// Initalizing static string wrapper
//
PMF_String::init($LANGCODE);
//
// Set actual template set name
//
PMF_Template::setTplSetName($faqConfig->get('main.templateSet'));
//
// Initialize attachment factory
//
PMF_Attachment_Factory::init($faqConfig->get('records.attachmentsStorageType'), $faqConfig->get('records.defaultAttachmentEncKey'), $faqConfig->get('records.enableAttachmentEncryption'));
//
// Create a new phpMyFAQ system object
//
$faqSystem = new PMF_System();
//
// Create a new FAQ object
//
$faq = new PMF_Faq($faqConfig);
//
// use mbstring extension if available and when possible
//
Ejemplo n.º 6
0
    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');
            ?>
Ejemplo n.º 7
0
                break;
        }
    }
} else {
    $indexSet = 'index.tpl';
}
//
// phpMyFAQ installtion is in maintenance mode
//
if ($faqConfig->get('main.maintenanceMode')) {
    $indexSet = 'indexMaintenance.tpl';
}
//
// Load template files and set template variables
//
$tpl = new PMF_Template(array('index' => $indexSet, 'rightBox' => $rightSidebarTemplate, 'writeContent' => $includeTemplate), $faqConfig->get('main.templateSet'));
if ($faqConfig->get('main.enableUserTracking')) {
    $users = $faqsession->getUsersOnline();
    $totUsers = $users[0] + $users[1];
    $usersOnline = $plr->getMsg('plmsgUserOnline', $totUsers) . ' | ' . $plr->getMsg('plmsgGuestOnline', $users[0]) . $plr->getMsg('plmsgRegisteredOnline', $users[1]);
} else {
    $usersOnline = '';
}
$faqSystem = new PMF_System();
$categoryHelper = new PMF_Helper_Category();
$categoryHelper->setCategory($category);
$categoryHelper->setConfiguration($faqConfig);
$keywordsArray = array_merge(explode(',', $keywords), explode(',', $faqConfig->get('main.metaKeywords')));
$keywordsArray = array_filter($keywordsArray, 'strlen');
shuffle($keywordsArray);
$keywords = implode(',', $keywordsArray);
Ejemplo n.º 8
0
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('<', '&lt;', str_replace('>', '&gt;', $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('"', '&quot;', $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('"', '&quot;', $faqconfig->get($key)), $faqconfig->get($key));
            break;
    }
}
Ejemplo n.º 9
0
 * @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']);
Ejemplo n.º 10
0
/**
 * @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('<', '&lt;', str_replace('>', '&gt;', $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('"', '&quot;', $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('"', '&quot;', $faqconfig->get($key)), $faqconfig->get($key));
            break;
    }
}
Ejemplo n.º 11
0
 /**
  * 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;
 }
Ejemplo n.º 12
0
 * @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;
Ejemplo n.º 13
0
    if ($auth) {
        $indexSet = 'index.tpl';
    } else {
        if ('register' == $action || 'thankyou' == $action) {
            $indexSet = 'indexNewUser.tpl';
        } else {
            $indexSet = 'indexLogin.tpl';
        }
    }
} else {
    $indexSet = 'index.tpl';
}
//
// Load template files and set template variables
//
$tpl = new PMF_Template(array('index' => $indexSet, 'loginBox' => $loginTemplate, 'rightBox' => $rightSidebarTemplate, 'writeContent' => $includeTemplate), $faqconfig->get('main.templateSet'));
$usersOnLine = $faqsession->getUsersOnline();
$totUsersOnLine = $usersOnLine[0] + $usersOnLine[1];
$systemUri = PMF_Link::getSystemUri('index.php');
$helper = PMF_Helper_Category::getInstance();
$helper->setCategory($category);
$keywordsArray = array_merge(explode(',', $keywords), explode(',', $faqconfig->get('main.metaKeywords')));
$keywordsArray = array_filter($keywordsArray, 'strlen');
shuffle($keywordsArray);
$keywords = implode(',', $keywordsArray);
if (is_null($error)) {
    $loginMessage = '<p>' . $PMF_LANG['ad_auth_insert'] . '</p>';
} else {
    $loginMessage = '<p class="error">' . $error . '</p>';
}
$main_template_vars = array('msgRegisterUser' => '<a href="?' . $sids . 'action=register">' . $PMF_LANG['msgRegisterUser'] . '</a>', 'msgLoginUser' => $PMF_LANG['msgLoginUser'], 'title' => $faqconfig->get('main.titleFAQ') . $title, 'baseHref' => $systemUri, 'version' => $faqconfig->get('main.currentVersion'), 'header' => str_replace('"', '', $faqconfig->get('main.titleFAQ')), 'metaTitle' => str_replace('"', '', $faqconfig->get('main.titleFAQ')), 'metaDescription' => $metaDescription, 'metaKeywords' => $keywords, 'metaPublisher' => $faqconfig->get('main.metaPublisher'), 'metaLanguage' => $PMF_LANG['metaLanguage'], 'metaCharset' => 'utf-8', 'phpmyfaqversion' => $faqconfig->get('main.currentVersion'), 'stylesheet' => $PMF_LANG['dir'] == 'rtl' ? 'style.rtl' : 'style', 'action' => $action, 'dir' => $PMF_LANG['dir'], 'msgCategory' => $PMF_LANG['msgCategory'], 'showCategories' => $helper->renderCategoryNavigation($cat), 'msgExportAllFaqs' => $PMF_LANG['msgExportAllFaqs'], 'languageBox' => $PMF_LANG['msgLangaugeSubmit'], 'writeLangAdress' => $writeLangAdress, 'switchLanguages' => PMF_Language::selectLanguages($LANGCODE, true), 'userOnline' => $plr->getMsg('plmsgUserOnline', $totUsersOnLine) . ' | ' . $plr->getMsg('plmsgGuestOnline', $usersOnLine[0]) . $plr->getMsg('plmsgRegisteredOnline', $usersOnLine[1]), 'stickyRecordsHeader' => $PMF_LANG['stickyRecordsHeader'], 'copyright' => 'powered by <a href="http://www.phpmyfaq.de" target="_blank">phpMyFAQ</a> ' . $faqconfig->get('main.currentVersion'), 'registerUser' => '<a href="?action=register">' . $PMF_LANG['msgRegistration'] . '</a>', 'sendPassword' => '<a href="./admin/password.php">' . $PMF_LANG['lostPassword'] . '</a>', 'loginHeader' => $PMF_LANG['msgLoginUser'], 'loginMessage' => $loginMessage, 'writeLoginPath' => $systemUri . '?' . PMF_Filter::getFilteredQueryString(), 'faqloginaction' => $action, 'login' => $PMF_LANG['ad_auth_ok'], 'username' => $PMF_LANG['ad_auth_user'], 'password' => $PMF_LANG['ad_auth_passwd']);