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


PHP PMF_Category::getCategoryLanguagesTranslated方法代码示例

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


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

示例1: printf

 $indent = '';
 for ($i = 0; $i < $cat['indent']; $i++) {
     $indent .= '&nbsp;&nbsp;&nbsp;';
 }
 // category translated in this language?
 $cat['lang'] == $LANGCODE ? $catname = $cat['name'] : ($catname = $cat['name'] . ' (' . $languageCodes[strtoupper($cat['lang'])] . ')');
 // show category name in actual language
 print '<td>';
 if ($cat['lang'] != $LANGCODE) {
     // translate category
     printf('<a href="%s?action=translatecategory&amp;cat=%s&amp;trlang=%s" title="%s"><span title="%s" class="icon-share"></span></a></a>', $currentLink, $cat['id'], $LANGCODE, $PMF_LANG['ad_categ_translate'], $PMF_LANG['ad_categ_translate']);
 }
 printf("&nbsp;%s<strong>%s</strong>", $indent, $catname);
 print "</td>\n";
 // get languages in use for categories
 $id_languages = $category->getCategoryLanguagesTranslated($cat["id"]);
 foreach ($all_lang as $lang => $language) {
     if ($language == $currentLanguage) {
         continue;
     }
     if (array_key_exists($language, $id_languages)) {
         $spokenLanguage = PMF_String::preg_replace('/\\(.*\\)/', '', $id_languages[$language]);
         printf('<td title="%s: %s">', $PMF_LANG['ad_categ_titel'], $spokenLanguage);
         printf('<span title="%s: %s" class="label label-success"><i class="icon-check icon-white"></i></span></td>', $PMF_LANG['ad_categ_titel'], $spokenLanguage);
     } else {
         printf('<td><a href="%s?action=translatecategory&amp;cat=%s&amp;trlang=%s" title="%s">', $currentLink, $cat['id'], $lang, $PMF_LANG['ad_categ_translate']);
         printf('<span title="%s" class="label label-inverse"><i class="icon-share icon-white"></i></span></a>', $PMF_LANG['ad_categ_translate']);
     }
     print "</td>\n";
 }
 print "</tr>\n";
开发者ID:kapljr,项目名称:Jay-Kaplan-Farmingdale-BCS-Projects,代码行数:31,代码来源:category.showstructure.php

示例2: foreach

    print $user->getAllUserOptions($category->categoryName[$id]['user_id']);
    ?>
                </select>
            </p>

            <p>
                <input class="submit" type="submit" name="submit" value="<?php 
    print $PMF_LANG["ad_categ_translatecateg"];
    ?>
" />
            </p>

            <hr />
<?php 
    print '<p><strong>' . $PMF_LANG["ad_categ_transalready"] . '</strong><br />';
    foreach ($category->getCategoryLanguagesTranslated($id) as $language => $namedesc) {
        print "&nbsp;&nbsp;&nbsp;<strong style=\"vertical-align: top;\">&middot; " . $language . "</strong>: " . $namedesc . "\n<br />";
    }
    print '</p>';
    ?>
        </form>
<?php 
    if ($faqconfig->get('main.enableGoogleTranslation') === true) {
        ?>
        
    <script src="https://www.google.com/jsapi?key=<?php 
        echo $faqconfig->get('main.googleTranslationKey');
        ?>
" type="text/javascript"></script>
    <script type="text/javascript">
    /* <![CDATA[ */
开发者ID:atlcurling,项目名称:tkt,代码行数:31,代码来源:category.translate.php

示例3: header

 * @category  phpMyFAQ
 * @package   Administration
 * @author    Thorsten Rinne <thorsten@phpmyfaq.de>
 * @author    Rudi Ferrari <bookcrossers@gmx.de>
 * @copyright 2006-2014 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
 * @link      http://www.phpmyfaq.de
 * @since     2006-09-10
 */
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;
}
if ($user->perm->checkRight($user->getUserId(), 'editcateg')) {
    $category = new PMF_Category($faqConfig, [], false);
    $category->setUser($currentAdminUser);
    $category->setGroups($currentAdminGroups);
    $category->getMissingCategories();
    $id = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT);
    $user_permission = $category->getPermissions('user', array($id));
    $group_permission = $category->getPermissions('group', array($id));
    $selectedLanguage = PMF_Filter::filterInput(INPUT_GET, 'trlang', FILTER_SANITIZE_STRING, $LANGCODE);
    $twig->loadTemplate('category/translate.twig')->display(array('PMF_LANG' => $PMF_LANG, 'categoryName' => $category->categoryName[$id]['name'], 'csrfToken' => $user->getCsrfTokenFromSession(), 'languageOptions' => $category->getCategoryLanguagesToTranslate($id, $selectedLanguage), 'groupPermission' => $faqConfig->get('security.permLevel') !== 'basic' ? $group_permission[0] : -1, 'id' => $id, 'parentId' => $category->categoryName[$id]['parent_id'], 'showcat' => $selectedLanguage !== $LANGCODE, 'translations' => $category->getCategoryLanguagesTranslated($id), 'userOptions' => $user->getAllUserOptions($category->categoryName[$id]['user_id']), 'userPermission' => $user_permission[0]));
    unset($category, $id, $user_permission, $group_permission, $selectedLanguage);
} else {
    require 'noperm.php';
}
开发者ID:Ravikumarsreerama,项目名称:faq,代码行数:31,代码来源:category.translate.php


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