當前位置: 首頁>>代碼示例>>PHP>>正文


PHP l10n::getISOCodes方法代碼示例

本文整理匯總了PHP中l10n::getISOCodes方法的典型用法代碼示例。如果您正苦於以下問題:PHP l10n::getISOCodes方法的具體用法?PHP l10n::getISOCodes怎麽用?PHP l10n::getISOCodes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在l10n的用法示例。


在下文中一共展示了l10n::getISOCodes方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Copyright

<?php

# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of Dotclear 2.
#
# Copyright (c) 2003-2009 Olivier Meunier and contributors
# Licensed under the GPL version 2.0 license.
# See LICENSE file or
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
require dirname(__FILE__) . '/../inc/admin/prepend.php';
dcPage::checkSuper();
$is_writable = is_dir(DC_L10N_ROOT) && is_writable(DC_L10N_ROOT);
$iso_codes = l10n::getISOCodes();
# Get languages list on Dotclear.net
$dc_langs = false;
$feed_reader = new feedReader();
$feed_reader->setCacheDir(DC_TPL_CACHE);
$feed_reader->setTimeout(5);
$feed_reader->setUserAgent('Dotclear - http://www.dotclear.org/');
try {
    $dc_langs = $feed_reader->parse(sprintf(DC_L10N_UPDATE_URL, DC_VERSION));
    if ($dc_langs !== false) {
        $dc_langs = $dc_langs->items;
    }
} catch (Exception $e) {
}
# Delete a language pack
if ($is_writable && !empty($_POST['delete']) && !empty($_POST['locale_id'])) {
開發者ID:HackerMajor,項目名稱:root,代碼行數:31,代碼來源:langs.php

示例2: displayBreadcrumb

 public static function displayBreadcrumb($separator)
 {
     global $core, $_ctx;
     $ret = '';
     # Check if breadcrumb enabled for the current blog
     $core->blog->settings->addNameSpace('breadcrumb');
     if (!$core->blog->settings->breadcrumb->breadcrumb_enabled) {
         return $ret;
     }
     if ($separator == '') {
         $separator = ' &rsaquo; ';
     }
     // Get current page if set
     $page = isset($GLOBALS['_page_number']) ? (int) $GLOBALS['_page_number'] : 0;
     switch ($core->url->type) {
         case 'default':
             // Home (first page only)
             $ret = '<span id="bc-home">' . __('Home') . '</span>';
             break;
         case 'default-page':
             // Home`(page 2 to n)
             $ret = '<a id="bc-home" href="' . $core->blog->url . '">' . __('Home') . '</a>';
             $ret .= $separator . sprintf(__('page %d'), $page);
             break;
         case 'category':
             // Category
             $ret = '<a id="bc-home" href="' . $core->blog->url . '">' . __('Home') . '</a>';
             $categories = $core->blog->getCategoryParents($_ctx->categories->cat_id);
             while ($categories->fetch()) {
                 $ret .= $separator . '<a href="' . $core->blog->url . $core->url->getBase('category') . "/" . $categories->cat_url . '">' . $categories->cat_title . '</a>';
             }
             if ($page == 0) {
                 $ret .= $separator . $_ctx->categories->cat_title;
             } else {
                 $ret .= $separator . '<a href="' . $core->blog->url . $core->url->getBase('category') . "/" . $_ctx->categories->cat_url . '">' . $_ctx->categories->cat_title . '</a>';
                 $ret .= $separator . sprintf(__('page %d'), $page);
             }
             break;
         case 'post':
             // Post
             $ret = '<a id="bc-home" href="' . $core->blog->url . '">' . __('Home') . '</a>';
             if ($_ctx->posts->cat_id) {
                 // Parents cats of post's cat
                 $categories = $core->blog->getCategoryParents($_ctx->posts->cat_id);
                 while ($categories->fetch()) {
                     $ret .= $separator . '<a href="' . $core->blog->url . $core->url->getBase('category') . "/" . $categories->cat_url . '">' . $categories->cat_title . '</a>';
                 }
                 // Post's cat
                 $categories = $core->blog->getCategory($_ctx->posts->cat_id);
                 $ret .= $separator . '<a href="' . $core->blog->url . $core->url->getBase('category') . "/" . $categories->cat_url . '">' . $categories->cat_title . '</a>';
             }
             $ret .= $separator . $_ctx->posts->post_title;
             break;
         case 'lang':
             // Lang
             $ret = '<a id="bc-home" href="' . $core->blog->url . '">' . __('Home') . '</a>';
             $langs = l10n::getISOCodes();
             $ret .= $separator . (isset($langs[$_ctx->cur_lang]) ? $langs[$_ctx->cur_lang] : $_ctx->cur_lang);
             break;
         case 'archive':
             // Archives
             $ret = '<a id="bc-home" href="' . $core->blog->url . '">' . __('Home') . '</a>';
             if (!$_ctx->archives) {
                 // Global archives
                 $ret .= $separator . __('Archives');
             } else {
                 // Month archive
                 $ret .= $separator . '<a href="' . $core->blog->url . $core->url->getBase("archive") . '">' . __('Archives') . '</a>';
                 $ret .= $separator . dt::dt2str('%B %Y', $_ctx->archives->dt);
             }
             break;
         case 'pages':
             // Page
             $ret = '<a id="bc-home" href="' . $core->blog->url . '">' . __('Home') . '</a>';
             $ret .= $separator . $_ctx->posts->post_title;
             break;
         case 'tags':
             // All tags
             $ret = '<a id="bc-home" href="' . $core->blog->url . '">' . __('Home') . '</a>';
             $ret .= $separator . __('All tags');
             break;
         case 'tag':
             // Tag
             $ret = '<a id="bc-home" href="' . $core->blog->url . '">' . __('Home') . '</a>';
             $ret .= $separator . '<a href="' . $core->blog->url . $core->url->getBase("tags") . '">' . __('All tags') . '</a>';
             if ($page == 0) {
                 $ret .= $separator . $_ctx->meta->meta_id;
             } else {
                 $ret .= $separator . '<a href="' . $core->blog->url . $core->url->getBase("tag") . '/' . rawurlencode($_ctx->meta->meta_id) . '">' . $_ctx->meta->meta_id . '</a>';
                 $ret .= $separator . sprintf(__('page %d'), $page);
             }
             break;
         case 'search':
             // Search
             $ret = '<a id="bc-home" href="' . $core->blog->url . '">' . __('Home') . '</a>';
             if ($page == 0) {
                 $ret .= $separator . __('Search:') . ' ' . $GLOBALS['_search'];
             } else {
                 $ret .= $separator . '<a href="' . $core->blog->url . '?q=' . rawurlencode($GLOBALS['_search']) . '">' . __('Search:') . ' ' . $GLOBALS['_search'] . '</a>';
                 $ret .= $separator . sprintf(__('page %d'), $page);
//.........這裏部分代碼省略.........
開發者ID:nikrou,項目名稱:dotclear,代碼行數:101,代碼來源:_public.php


注:本文中的l10n::getISOCodes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。