当前位置: 首页>>代码示例>>PHP>>正文


PHP PMF_Language::isASupportedLanguage方法代码示例

本文整理汇总了PHP中PMF_Language::isASupportedLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP PMF_Language::isASupportedLanguage方法的具体用法?PHP PMF_Language::isASupportedLanguage怎么用?PHP PMF_Language::isASupportedLanguage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PMF_Language的用法示例。


在下文中一共展示了PMF_Language::isASupportedLanguage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getInstance

 /**
  * Create and return an instance
  * 
  * @param string $language
  * 
  * @return PMF_String_Basic
  */
 public static function getInstance($encoding = null, $language = 'en')
 {
     if (!self::$instance) {
         self::$instance = new self();
         self::$instance->encoding = self::DEFAULT_ENCODING;
         self::$instance->language = PMF_Language::isASupportedLanguage($language) ? $language : self::DEFAULT_LANGUAGE;
     }
     return self::$instance;
 }
开发者ID:atlcurling,项目名称:tkt,代码行数:16,代码来源:Basic.php

示例2: switch

$stopword = PMF_Filter::filterInput(INPUT_GET, 'stopword', FILTER_SANITIZE_STRING);
$stopwords_lang = PMF_Filter::filterInput(INPUT_GET, 'stopwords_lang', FILTER_SANITIZE_STRING);
switch ($ajax_action) {
    case 'load_stop_words_by_lang':
        if (PMF_Language::isASupportedLanguage($stopwords_lang)) {
            $stop_words_list = PMF_Stopwords::getInstance()->getByLang($stopwords_lang);
            header('Content-Type: application/json');
            print json_encode($stop_words_list);
        }
        break;
    case 'delete_stop_word':
        if (null != $stopword_id && PMF_Language::isASupportedLanguage($stopwords_lang)) {
            $pmf_sw = PMF_Stopwords::getInstance();
            $pmf_sw->setLanguage($stopwords_lang);
            $pmf_sw->remove($stopword_id);
        }
        break;
    case 'save_stop_word':
        if (null != $stopword && PMF_Language::isASupportedLanguage($stopwords_lang)) {
            $pmf_sw = PMF_Stopwords::getInstance();
            $pmf_sw->setLanguage($stopwords_lang);
            if (null !== $stopword_id && -1 < $stopword_id) {
                $pmf_sw->update($stopword_id, $stopword);
            } else {
                if (!$pmf_sw->match($stopword)) {
                    $pmf_sw->add($stopword);
                }
            }
        }
        break;
}
开发者ID:noon,项目名称:phpMyFAQ,代码行数:31,代码来源:ajax.config.php

示例3: define

define('IS_VALID_PHPMYFAQ', null);
//
// Bootstrapping
//
require PMF_ROOT_DIR . '/inc/Bootstrap.php';
/**
 * Initialize attachment factory
 */
PMF_Attachment_Factory::init($faqConfig->get('records.attachmentsStorageType'), $faqConfig->get('records.defaultAttachmentEncKey'), $faqConfig->get('records.enableAttachmentEncryption'));
$currentSave = PMF_Filter::filterInput(INPUT_POST, 'save', FILTER_SANITIZE_STRING);
$currentAction = PMF_Filter::filterInput(INPUT_GET, 'action', FILTER_SANITIZE_STRING);
$currentToken = PMF_Filter::filterInput(INPUT_POST, 'csrf', FILTER_SANITIZE_STRING);
$Language = new PMF_Language($faqConfig);
$LANGCODE = $Language->setLanguage($faqConfig->get('main.languageDetection'), $faqConfig->get('main.language'));
require_once PMF_ROOT_DIR . '/lang/language_en.php';
if (isset($LANGCODE) && PMF_Language::isASupportedLanguage($LANGCODE)) {
    require_once PMF_ROOT_DIR . '/lang/language_' . $LANGCODE . '.php';
} else {
    $LANGCODE = 'en';
}
$auth = false;
$user = PMF_User_CurrentUser::getFromSession($faqConfig);
if ($user) {
    $auth = true;
} else {
    $error = $PMF_LANG['ad_auth_sess'];
    $user = null;
    unset($user);
}
if (is_null($currentAction) || !is_null($currentSave)) {
    ?>
开发者ID:maggiofrancesco,项目名称:phpMyFAQ,代码行数:31,代码来源:attachment.php

示例4: array

// Send headers
$http = PMF_Helper_Http::getInstance();
$http->setContentType('application/json');
$http->addHeader();
// Set user permissions
$current_user = -1;
$current_groups = array(-1);
$action = PMF_Filter::filterInput(INPUT_GET, 'action', FILTER_SANITIZE_STRING);
$language = PMF_Filter::filterInput(INPUT_GET, 'lang', FILTER_SANITIZE_STRING, 'en');
$categoryId = PMF_Filter::filterInput(INPUT_GET, 'categoryId', FILTER_VALIDATE_INT);
$recordId = PMF_Filter::filterInput(INPUT_GET, 'recordId', FILTER_VALIDATE_INT);
// Get language (default: english)
$Language = new PMF_Language();
$language = $Language->setLanguage($faqconfig->get('main.languageDetection'), $faqconfig->get('main.language'));
// Set language
if (PMF_Language::isASupportedLanguage($language)) {
    require 'lang/language_' . $language . '.php';
} else {
    require 'lang/language_en.php';
}
$plr = new PMF_Language_Plurals($PMF_LANG);
PMF_String::init($language);
// Set empty result
$result = array();
// Handle actions
switch ($action) {
    case 'getVersion':
        $result = array('version' => $faqconfig->get('main.currentVersion'));
        break;
    case 'getApiVersion':
        $result = array('apiVersion' => (int) $faqconfig->get('main.currentApiVersion'));
开发者ID:atlcurling,项目名称:tkt,代码行数:31,代码来源:api.php

示例5: sprintf

        if (is_null($sid_cookie)) {
            if (!is_null($sid_get)) {
                $sids = sprintf('sid=%d&amp;lang=%s&amp;', $sid_get, $LANGCODE);
            }
        }
    }
} else {
    if (!setcookie(PMF_GET_KEY_NAME_LANGUAGE, $LANGCODE, $_SERVER['REQUEST_TIME'] + PMF_LANGUAGE_EXPIRED_TIME)) {
        $sids = sprintf('lang=%s&amp;', $LANGCODE);
    }
}
//
// Found a article language?
//
$lang = PMF_Filter::filterInput(INPUT_POST, 'artlang', FILTER_SANITIZE_STRING);
if (is_null($lang) && !PMF_Language::isASupportedLanguage($lang)) {
    $lang = $LANGCODE;
}
//
// Create a new FAQ object
//
$faq = new PMF_Faq($current_user, $current_groups);
//
// Create a new Category object
//
$category = new PMF_Category($current_user, $current_groups);
//
// Create a new Tags object
//
$oTag = new PMF_Tags();
//
开发者ID:noon,项目名称:phpMyFAQ,代码行数:31,代码来源:index.php

示例6: isset

$output = '';
$isCronRequest = false;
$isRequestedByCLI = isset($_SERVER['argv']) && isset($_SERVER['argv'][0]);
$isRequestedByWebLocalhost = isset($_SERVER['REMOTE_ADDR']) && '127.0.0.1' == $_SERVER['REMOTE_ADDR'];
$isCronRequest = $isRequestedByCLI || $isRequestedByWebLocalhost;
if ($isCronRequest && file_exists(PMF_ROOT_DIR . '/config/database.php')) {
    // Hack: set dummy values for those entries evaluated during a Web request but not during a CLI request
    if ($isRequestedByCLI) {
        $_SERVER['HTTP_HOST'] = '';
        $_SERVER['HTTP_USER_AGENT'] = '';
    }
    define('IS_VALID_PHPMYFAQ', null);
    require PMF_ROOT_DIR . '/inc/Bootstrap.php';
    // Preload English strings
    require_once PMF_ROOT_DIR . '/lang/language_en.php';
    if (LANGCODE != 'en' && PMF_Language::isASupportedLanguage(LANGCODE)) {
        // Overwrite English strings with the ones we have in the current language
        require_once PMF_ROOT_DIR . '/lang/language_' . LANGCODE . '.php';
    }
    //Load plurals support for selected language
    $plr = new PMF_Language_Plurals(LANGCODE);
    //
    // Initalizing static string wrapper
    //
    PMF_String::init(LANGCODE);
    $oLnk = new PMF_Linkverifier($faqConfig);
    $faq = new PMF_Faq($faqConfig);
    $totStart = microtime(true);
    // Read the data directly from the faqdata table (all faq records in all languages)
    $start = microtime(true);
    $output .= $isRequestedByWebLocalhost ? '' : "\n";
开发者ID:maggiofrancesco,项目名称:phpMyFAQ,代码行数:31,代码来源:cron.verifyurls.php

示例7: PMF_Category

 $category = new PMF_Category();
 $name = PMF_Filter::filterInput(INPUT_POST, 'name', FILTER_SANITIZE_STRING);
 $email = PMF_Filter::filterInput(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL);
 $faqid = PMF_Filter::filterInput(INPUT_POST, 'faqid', FILTER_VALIDATE_INT);
 $faqlanguage = PMF_Filter::filterInput(INPUT_POST, 'faqlanguage', FILTER_SANITIZE_STRING);
 $question = PMF_Filter::filterInput(INPUT_POST, 'question', FILTER_SANITIZE_STRIPPED);
 $answer = PMF_Filter::filterInput(INPUT_POST, 'answer', FILTER_SANITIZE_STRIPPED);
 $translation = PMF_Filter::filterInput(INPUT_POST, 'translated_answer', FILTER_SANITIZE_STRING);
 $contentlink = PMF_Filter::filterInput(INPUT_POST, 'contentlink', FILTER_VALIDATE_URL);
 $keywords = PMF_Filter::filterInput(INPUT_POST, 'keywords', FILTER_SANITIZE_STRIPPED);
 $categories = PMF_Filter::filterInputArray(INPUT_POST, array('rubrik' => array('filter' => FILTER_VALIDATE_INT, 'flags' => FILTER_REQUIRE_ARRAY)));
 // Check on translation
 if (is_null($answer) && !is_null($translation)) {
     $answer = $translation;
 }
 if (!is_null($name) && !empty($name) && !is_null($email) && !empty($email) && !is_null($question) && !empty($question) && checkBannedWord(PMF_String::htmlspecialchars($question)) && !is_null($answer) && !empty($answer) && checkBannedWord(PMF_String::htmlspecialchars($answer)) && (is_null($faqid) && !is_null($categories['rubrik']) || !is_null($faqid) && !is_null($faqlanguage) && PMF_Language::isASupportedLanguage($faqlanguage))) {
     $isNew = true;
     if (!is_null($faqid)) {
         $isNew = false;
         $faqsession->userTracking('save_new_translation_entry', 0);
     } else {
         $faqsession->userTracking('save_new_entry', 0);
     }
     $isTranslation = false;
     if (!is_null($faqlanguage)) {
         $isTranslation = true;
         $newLanguage = $faqlanguage;
     }
     if (PMF_String::substr($contentlink, 7) != "") {
         $answer = sprintf('%s<br /><div id="newFAQContentLink">%s<a href="http://%s" target="_blank">%s</a></div>', $answer, $PMF_LANG['msgInfo'], PMF_String::substr($contentlink, 7), $contentlink);
     }
开发者ID:atlcurling,项目名称:tkt,代码行数:31,代码来源:ajaxservice.php

示例8: define

 */
//
// Prepend and start the PHP session
//
require_once 'inc/Init.php';
define('IS_VALID_PHPMYFAQ', null);
PMF_Init::cleanRequest();
session_name(PMF_COOKIE_NAME_AUTH . trim($faqconfig->get('main.phpMyFAQToken')));
session_start();
$searchString = PMF_Filter::filterInput(INPUT_POST, 'search', FILTER_SANITIZE_STRIPPED);
$ajaxLanguage = PMF_Filter::filterInput(INPUT_POST, 'ajaxlanguage', FILTER_SANITIZE_STRING, 'en');
$categoryId = PMF_Filter::filterInput(INPUT_GET, 'searchcategory', FILTER_VALIDATE_INT, '%');
$language = new PMF_Language();
$languageCode = $language->setLanguage($faqconfig->get('main.languageDetection'), $faqconfig->get('main.language'));
require_once 'lang/language_en.php';
if (PMF_Language::isASupportedLanguage($ajaxLanguage)) {
    $languageCode = trim($ajaxLanguage);
    require_once 'lang/language_' . $languageCode . '.php';
} else {
    $languageCode = 'en';
    require_once 'lang/language_en.php';
}
//Load plurals support for selected language
$plr = new PMF_Language_Plurals($PMF_LANG);
//
// Initalizing static string wrapper
//
PMF_String::init($languageCode);
//
// Get current user and group id - default: -1
//
开发者ID:jr-ewing,项目名称:phpMyFAQ,代码行数:31,代码来源:ajaxresponse.php

示例9: header

if (!defined('IS_VALID_PHPMYFAQ_ADMIN')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$ajax_action = PMF_Filter::filterInput(INPUT_GET, 'ajaxaction', FILTER_SANITIZE_STRING);
if ('save_sticky_records' == $ajax_action && $permission['editbt']) {
    /**
     * Expected is an array of the structure:
     * array( 0 => array((int)id, (string)langugage, (int) checked)),
     * 	      1 => .....
     * )
     */
    $items = isset($_GET['items']) && is_array($_GET['items']) ? $_GET['items'] : array();
    $faq = new PMF_Faq();
    foreach ($items as $item) {
        if (is_array($item) && count($item) == 3 && PMF_Language::isASupportedLanguage($item[1])) {
            print $faq->updateRecordSticky((int) $item[0], addslashes($item[1]), (int) $item[2]);
        }
    }
}
if ('delete_record' == $ajax_action && $permission['delbt']) {
    $record_id = PMF_Filter::filterInput(INPUT_POST, 'record_id', FILTER_VALIDATE_INT);
    $record_lang = PMF_Filter::filterInput(INPUT_POST, 'record_lang', FILTER_SANITIZE_STRING);
    adminlog('Beitragdel, ' . $record_id);
    $path = PMF_ROOT_DIR . '/attachments/' . $record_id . '/';
    if (@is_dir($path)) {
        $do = dir($path);
        while ($dat = $do->read()) {
            if ($dat != "." && $dat != "..") {
                unlink($path . $dat);
            }
开发者ID:noon,项目名称:phpMyFAQ,代码行数:31,代码来源:ajax.records.php

示例10: array

$thema = PMF_Filter::filterInput(INPUT_POST, 'thema', FILTER_SANITIZE_STRIPPED);
$content = PMF_Filter::filterInput(INPUT_POST, 'content', FILTER_SANITIZE_STRIPPED);
$tr_content = PMF_Filter::filterInput(INPUT_POST, 'translated_content', FILTER_SANITIZE_STRING);
$contentlink = PMF_Filter::filterInput(INPUT_POST, 'contentlink', FILTER_VALIDATE_URL);
$keywords = PMF_Filter::filterInput(INPUT_POST, 'keywords', FILTER_SANITIZE_STRIPPED);
$code = PMF_Filter::filterInput(INPUT_POST, 'captcha', FILTER_SANITIZE_STRING);
$categories = PMF_Filter::filterInputArray(INPUT_POST, array('rubrik' => array('filter' => FILTER_VALIDATE_INT, 'flags' => FILTER_REQUIRE_ARRAY)));
// If e-mail address is set to optional
if (!PMF_Configuration::getInstance()->get('main.optionalMailAddress') && is_null($usermail)) {
    $usermail = PMF_Configuration::getInstance()->get('main.administrationMail');
}
// Check on translation
if (is_null($content) && !is_null($tr_content)) {
    $content = $tr_content;
}
if (!is_null($username) && !is_null($usermail) && !is_null($thema) && !is_null($content) && IPCheck($_SERVER['REMOTE_ADDR']) && checkBannedWord(PMF_String::htmlspecialchars($thema)) && checkBannedWord(PMF_String::htmlspecialchars($content)) && $captcha->checkCaptchaCode($code) && (is_null($faqid) && !is_null($categories) || !is_null($faqid) && !is_null($faqlanguage) && PMF_Language::isASupportedLanguage($faqlanguage))) {
    $isNew = true;
    if (!is_null($faqid)) {
        $isNew = false;
        $faqsession->userTracking('save_new_translation_entry', 0);
    } else {
        $faqsession->userTracking('save_new_entry', 0);
    }
    $isTranslation = false;
    if (!is_null($faqlanguage)) {
        $isTranslation = true;
        $newLanguage = $faqlanguage;
    }
    if (PMF_String::substr($contentlink, 7) != "") {
        $content = $content . "<br />" . $PMF_LANG["msgInfo"] . "<a href=\"http://" . PMF_String::substr($contentlink, 7) . "\" target=\"_blank\">" . $contentlink . "</a>";
    }
开发者ID:nosch,项目名称:phpMyFAQ,代码行数:31,代码来源:save.php

示例11: define

 */
define('PMF_ROOT_DIR', dirname(__DIR__));
//
// Define the named constant used as a check by any included PHP file
//
define('IS_VALID_PHPMYFAQ', null);
//
// Bootstrapping
//
require PMF_ROOT_DIR . '/inc/Bootstrap.php';
require PMF_ROOT_DIR . '/lang/language_en.php';
//
// Get language (default: english)
//
$language = PMF_Filter::filterInput(INPUT_GET, 'lang', FILTER_SANITIZE_STRING);
if (!is_null($language) && PMF_Language::isASupportedLanguage($language)) {
    require PMF_ROOT_DIR . '/lang/language_' . $language . '.php';
}
//
// Initalizing static string wrapper
//
PMF_String::init($language);
$user = PMF_User_CurrentUser::getFromSession($faqConfig);
$refreshTime = (PMF_SESSION_ID_EXPIRES - PMF_SESSION_ID_REFRESH) * 60;
?>
<!DOCTYPE html>
<html lang="<?php 
print $PMF_LANG['metaLanguage'];
?>
" class="no-js">
<head>
开发者ID:Ravikumarsreerama,项目名称:faq,代码行数:31,代码来源:session.keepalive.php

示例12: PMF_Language

// Bootstrapping
//
require 'inc/Bootstrap.php';
// get language (default: english)
$Language = new PMF_Language($faqConfig);
$LANGCODE = $Language->setLanguage($faqConfig->get('main.languageDetection'), $faqConfig->get('main.language'));
$faqConfig->setLanguage($Language);
// Found an article language?
$lang = PMF_Filter::filterInput(INPUT_POST, 'artlang', FILTER_SANITIZE_STRING);
if (is_null($lang) && !PMF_Language::isASupportedLanguage($lang)) {
    $lang = PMF_Filter::filterInput(INPUT_GET, 'artlang', FILTER_SANITIZE_STRING);
    if (is_null($lang) && !PMF_Language::isASupportedLanguage($lang)) {
        $lang = $LANGCODE;
    }
}
if (isset($lang) && PMF_Language::isASupportedLanguage($lang)) {
    require_once "lang/language_" . $lang . ".php";
} else {
    $lang = "en";
    require_once "lang/language_en.php";
}
//
// Initalizing static string wrapper
//
PMF_String::init($LANGCODE);
// authenticate with session information
$user = PMF_User_CurrentUser::getFromSession($faqConfig);
if ($user) {
    $auth = true;
} else {
    $user = null;
开发者ID:maggiofrancesco,项目名称:phpMyFAQ,代码行数:31,代码来源:pdf.php

示例13: getLatestData

 /**
  * This function generates an array with a specified number of most recent
  * published records
  *
  * @param  integer $count    Number of recorsd
  * @param  string  $language Language
  * @return array
  */
 public function getLatestData($count = PMF_NUMBER_RECORDS_LATEST, $language = null)
 {
     global $sids;
     if ($this->groupSupport) {
         $permPart = sprintf("( fdg.group_id IN (%s)\n            OR\n                (fdu.user_id = %d AND fdg.group_id IN (%s)))", implode(', ', $this->groups), $this->user, implode(', ', $this->groups));
     } else {
         $permPart = sprintf("( fdu.user_id = %d OR fdu.user_id = -1 )", $this->user);
     }
     $now = date('YmdHis');
     $query = '            SELECT
             fd.id AS id,
             fd.lang AS lang,
             fcr.category_id AS category_id,
             fd.thema AS thema,
             fd.content AS content,
             fd.datum AS datum,
             fv.visits AS visits
         FROM
             ' . SQLPREFIX . 'faqvisits fv,
             ' . SQLPREFIX . 'faqdata fd
         LEFT JOIN
             ' . SQLPREFIX . 'faqcategoryrelations fcr
         ON
             fd.id = fcr.record_id
         AND
             fd.lang = fcr.record_lang
         LEFT JOIN
             ' . SQLPREFIX . 'faqdata_group AS fdg
         ON
             fd.id = fdg.record_id
         LEFT JOIN
             ' . SQLPREFIX . 'faqdata_user AS fdu
         ON
             fd.id = fdu.record_id
         WHERE
                 fd.date_start <= \'' . $now . '\'
             AND fd.date_end   >= \'' . $now . '\'
             AND fd.id = fv.id
             AND fd.lang = fv.lang
             AND fd.active = \'yes\'';
     if (isset($language) && PMF_Language::isASupportedLanguage($language)) {
         $query .= '
         AND
             fd.lang = \'' . $language . '\'';
     }
     $query .= '
         AND
             ' . $permPart . '
         ORDER BY
             fd.datum DESC';
     $result = $this->db->query($query);
     $latest = array();
     $data = array();
     $i = 0;
     $oldId = 0;
     while (($row = $this->db->fetch_object($result)) && $i < $count) {
         if ($oldId != $row->id) {
             $data['datum'] = $row->datum;
             $data['thema'] = $row->thema;
             $data['content'] = $row->content;
             $data['visits'] = $row->visits;
             $title = $row->thema;
             $url = sprintf('%saction=artikel&amp;cat=%d&amp;id=%d&amp;artlang=%s', $sids, $row->category_id, $row->id, $row->lang);
             $oLink = new PMF_Link(PMF_Link::getSystemRelativeUri() . '?' . $url);
             $oLink->itemTitle = $row->thema;
             $oLink->tooltip = $title;
             $data['url'] = $oLink->toString();
             $latest[] = $data;
             $i++;
         }
         $oldId = $row->id;
     }
     return $latest;
 }
开发者ID:noon,项目名称:phpMyFAQ,代码行数:82,代码来源:Faq.php

示例14: header

 * @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');
开发者ID:jr-ewing,项目名称:phpMyFAQ,代码行数:31,代码来源:translate.php

示例15: html_entity_decode

 if ($faqConfig->get('main.enableWysiwygEditorFrontend')) {
     $answer = PMF_Filter::filterInput(INPUT_POST, 'answer', FILTER_SANITIZE_SPECIAL_CHARS);
     $answer = html_entity_decode($answer);
 } else {
     $answer = PMF_Filter::filterInput(INPUT_POST, 'answer', FILTER_SANITIZE_STRIPPED);
     $answer = nl2br($answer);
 }
 $translation = PMF_Filter::filterInput(INPUT_POST, 'translated_answer', FILTER_SANITIZE_STRING);
 $contentlink = PMF_Filter::filterInput(INPUT_POST, 'contentlink', FILTER_VALIDATE_URL);
 $keywords = PMF_Filter::filterInput(INPUT_POST, 'keywords', FILTER_SANITIZE_STRIPPED);
 $categories = PMF_Filter::filterInputArray(INPUT_POST, array('rubrik' => array('filter' => FILTER_VALIDATE_INT, 'flags' => FILTER_REQUIRE_ARRAY)));
 // Check on translation
 if (empty($answer) && !is_null($translation)) {
     $answer = $translation;
 }
 if (!is_null($name) && !empty($name) && !is_null($email) && !empty($email) && !is_null($question) && !empty($question) && $stopwords->checkBannedWord(strip_tags($question)) && !is_null($answer) && !empty($answer) && $stopwords->checkBannedWord(strip_tags($answer)) && (is_null($faqid) && !is_null($categories['rubrik']) || !is_null($faqid) && !is_null($faqlanguage) && PMF_Language::isASupportedLanguage($faqlanguage))) {
     $isNew = true;
     if (!is_null($faqid)) {
         $isNew = false;
         try {
             $faqsession->userTracking('save_new_translation_entry', 0);
         } catch (PMF_Exception $e) {
             // @todo handle the exception
         }
     } else {
         try {
             $faqsession->userTracking('save_new_entry', 0);
         } catch (PMF_Exception $e) {
             // @todo handle the exception
         }
     }
开发者ID:ae120,项目名称:phpMyFAQ,代码行数:31,代码来源:ajaxservice.php


注:本文中的PMF_Language::isASupportedLanguage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。