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


PHP PMF_Utils::languageAvailable方法代码示例

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


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

示例1: substr

            $_title = $faq->getRecordTitle($_id, false);
            $_link = substr($_url, 9);
            // Move the link to XHTML
            if (strpos($_url, '&') === false) {
                $_link = str_replace('&', '&', $_link);
            }
            $oLink = new PMF_Link(PMF_Link::getSystemRelativeUri() . $_link);
            $oLink->itemTitle = $oLink->tooltip = $_title;
            $newFaqPath = $oLink->toString();
            $fixedContent = str_replace($_url, $newFaqPath, $fixedContent);
        }
    }
}
$content = $fixedContent;
// Check for the languages for a faq
$arrLanguage = PMF_Utils::languageAvailable($record_id);
$switchLanguage = '';
$check4Lang = '';
$num = count($arrLanguage);
if ($num > 1) {
    foreach ($arrLanguage as $language) {
        $check4Lang .= "<option value=\"" . $language . "\"";
        $check4Lang .= $lang == $language ? ' selected="selected"' : '';
        $check4Lang .= ">" . $languageCodes[strtoupper($language)] . "</option>\n";
    }
    $switchLanguage .= "<p>\n";
    $switchLanguage .= "<fieldset>\n";
    $switchLanguage .= "<legend>" . $PMF_LANG["msgLangaugeSubmit"] . "</legend>\n";
    $switchLanguage .= "<form action=\"" . $changeLanguagePath . "\" method=\"post\" style=\"display: inline;\">\n";
    $switchLanguage .= "<select name=\"language\" size=\"1\">\n";
    $switchLanguage .= $check4Lang;
开发者ID:nosch,项目名称:phpMyFAQ,代码行数:31,代码来源:artikel.php

示例2: array

 $showcat = PMF_Filter::filterInput(INPUT_POST, 'showcat', FILTER_SANITIZE_STRING);
 // translate an existing category
 if (!is_null($showcat) && $showcat == 'yes') {
     $categoryData = array('id' => PMF_Filter::filterInput(INPUT_POST, 'id', FILTER_VALIDATE_INT), 'lang' => PMF_Filter::filterInput(INPUT_POST, 'lang', FILTER_SANITIZE_STRING), 'parent_id' => PMF_Filter::filterInput(INPUT_POST, 'parent_id', FILTER_VALIDATE_INT), 'name' => PMF_Filter::filterInput(INPUT_POST, 'name', FILTER_SANITIZE_STRING), 'description' => PMF_Filter::filterInput(INPUT_POST, 'description', FILTER_SANITIZE_STRING), 'user_id' => PMF_Filter::filterInput(INPUT_POST, 'user_id', FILTER_VALIDATE_INT));
     // translate.category only returns non-existent languages to translate too
     if ($categoryNode->create($categoryData)) {
         printf('<p>%s</p>', $PMF_LANG['ad_categ_translated']);
     } else {
         printf('<p>%s</p>', $db->error());
     }
 }
 print "\n\n<table>\n";
 print "<tr>\n";
 print "    <th>" . $currentLanguage . "</th>\n";
 // get languages in use for all categories
 $allLanguages = PMF_Utils::languageAvailable(0, $table = 'faqcategories');
 asort($allLanguages);
 foreach ($allLanguages as $language) {
     if ($languageCodes[strtoupper($language)] != $currentLanguage) {
         print "    <th>" . $languageCodes[strtoupper($language)] . "</th>\n";
     }
 }
 $categoryDataProvider = new PMF_Category_Tree_DataProvider_SingleQuery();
 $categoryTreeHelper = new PMF_Category_Tree_Helper(new PMF_Category_Tree($categoryDataProvider));
 $categoryHelper = new PMF_Category_Helper();
 foreach ($categoryTreeHelper as $categoryId => $categoryName) {
     $indent = str_repeat('&nbsp;', $categoryTreeHelper->indent);
     $categoryLang = $categoryTreeHelper->getInnerIterator()->current()->getLanguage();
     if ($categoryLang == $LANGCODE) {
         print "</tr>\n";
         print "<tr>\n";
开发者ID:nosch,项目名称:phpMyFAQ,代码行数:31,代码来源:category.showstructure.php

示例3: substr

            $_title = $faq->getRecordTitle($_id, false);
            $_link = substr($_url, 9);
            // Move the link to XHTML
            if (strpos($_url, '&amp;') === false) {
                $_link = str_replace('&', '&amp;', $_link);
            }
            $oLink = new PMF_Link(PMF_Link::getSystemRelativeUri() . $_link);
            $oLink->itemTitle = $oLink->tooltip = $_title;
            $newFaqPath = $oLink->toString();
            $fixedContent = str_replace($_url, $newFaqPath, $fixedContent);
        }
    }
}
$content = $fixedContent;
// Check for the languages for a faq
$arrLanguage = PMF_Utils::languageAvailable($faq->faqRecord['id']);
$switchLanguage = '';
$check4Lang = '';
$num = count($arrLanguage);
if ($num > 1) {
    foreach ($arrLanguage as $language) {
        $check4Lang .= "<option value=\"" . $language . "\"";
        $check4Lang .= $lang == $language ? ' selected="selected"' : '';
        $check4Lang .= ">" . $languageCodes[strtoupper($language)] . "</option>\n";
    }
    $switchLanguage .= "<p>\n";
    $switchLanguage .= "<fieldset>\n";
    $switchLanguage .= "<legend>" . $PMF_LANG["msgLangaugeSubmit"] . "</legend>\n";
    $switchLanguage .= "<form action=\"" . $changeLanguagePath . "\" method=\"post\" style=\"display: inline;\">\n";
    $switchLanguage .= "<select name=\"artlang\" size=\"1\">\n";
    $switchLanguage .= $check4Lang;
开发者ID:rybal06,项目名称:phpMyFAQ,代码行数:31,代码来源:artikel.php

示例4: renderLanguages

 /**
  * Create all languagess which can be used for translation as <option>
  *
  * @param  integer $categoryId   Category id
  * @param  string  $selectedLanguage Selected language
  * @return string
  */
 public function renderLanguages($categoryId, $selectedLanguage)
 {
     $existingLanguages = PMF_Utils::languageAvailable($categoryId, 'faqcategories');
     $options = '';
     foreach (PMF_Language::getAvailableLanguages() as $lang => $langname) {
         if (!in_array(strtolower($lang), $existingLanguages)) {
             $options .= sprintf("\t<option value=\"%s\"%s>%s</option>\n", strtolower($lang), $lang == $selectedLanguage ? ' selected="selected"' : '', $langname);
         }
     }
     return $options;
 }
开发者ID:jr-ewing,项目名称:phpMyFAQ,代码行数:18,代码来源:Helper.php

示例5: getCategoryLanguagesToTranslate

 /**
  * Create all languagess which can be used for translation as <option>
  *
  * @param  integer $category_id   Category id
  * @param  string  $selected_lang Selected language
  * @return string
  */
 public function getCategoryLanguagesToTranslate($category_id, $selected_lang)
 {
     $output = "";
     $existcatlang = PMF_Utils::languageAvailable($category_id, 'faqcategories');
     foreach (PMF_Language::getAvailableLanguages() as $lang => $langname) {
         if (!in_array(strtolower($lang), $existcatlang)) {
             $output .= "\t<option value=\"" . strtolower($lang) . "\"";
             if ($lang == $selected_lang) {
                 $output .= " selected=\"selected\"";
             }
             $output .= ">" . $langname . "</option>\n";
         }
     }
     return $output;
 }
开发者ID:atlcurling,项目名称:tkt,代码行数:22,代码来源:Category.php


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