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


PHP get_site_lang函数代码示例

本文整理汇总了PHP中get_site_lang函数的典型用法代码示例。如果您正苦于以下问题:PHP get_site_lang函数的具体用法?PHP get_site_lang怎么用?PHP get_site_lang使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: redirect

function redirect($uri = '', $method = 'location', $http_response_code = 302)
{
    if (!preg_match('#^https?://#i', $uri)) {
        header("Location: /" . get_site_lang() . "/" . trim($uri, '/'), TRUE, 302);
    } else {
        header("Location: " . $uri, TRUE, 302);
    }
    exit;
}
开发者ID:jabouzi,项目名称:usermanager,代码行数:9,代码来源:helper.php

示例2: display_languages

function display_languages()
{
    echo '<select id="user_langs" name="user_langs" class="select_footer">';
    foreach (get_site_langs() as $lang) {
        $selected = '';
        if (get_site_lang() == $lang) {
            $selected = 'selected';
        }
        echo '<option value="' . $lang . '" ' . $selected . '>' . $lang . '</option>';
    }
    echo '</select>';
}
开发者ID:jabouzi,项目名称:usermanager,代码行数:12,代码来源:functions.php

示例3: display_message

<div class="row"><?php 
display_message();
?>
</div>
<h1><?php 
echo lang('title.accounts');
?>
</h1>
<div id="browsecontacts">
<?php 
foreach ($users as $user) {
    echo '<a href="/' . get_site_lang() . '/application/edit/' . $user->get_user_name() . '">';
    echo $user->get_user_first_name() . " " . $user->get_user_last_name();
    echo '</a>';
}
echo '</div>';
开发者ID:jabouzi,项目名称:projet,代码行数:16,代码来源:userslist.php

示例4: array

<?php

if (islogged()) {
    echo '<div id="left-container">
	<ul class="left-menu">';
    if (isadmin()) {
        $links = array('/' . get_site_lang() => lang('title.accounts'), '/' . get_site_lang() . '/application/add' => lang('title.add.account'), '/' . get_site_lang() . '/application/import' => lang('title.import.accounts'));
    }
    $links['/' . get_site_lang() . '/application/profile'] = lang('title.profile');
    $links['/' . get_site_lang() . '/login/logout'] = lang('login.logout');
    foreach ($links as $link => $title) {
        echo '<li><a href="' . $link . '">' . $title . '</a></li>';
    }
    echo '</ul>
	</div>';
}
开发者ID:jabouzi,项目名称:usermanager,代码行数:16,代码来源:menu.php

示例5: sendemail

 private function sendemail($user, $edit = 0)
 {
     $maildata = array();
     if ($edit) {
         $messagedata = array($user['first_name'], $user['last_name'], $user['email'], $user['password']);
     } else {
         $messagedata = array($user['first_name'], $user['last_name'], 'http://' . $_SERVER['HTTP_HOST'], $user['email'], $user['password']);
     }
     $maildata['from'] = 'admin@tonikgroupimage.com';
     $maildata['name'] = 'TGI';
     $maildata['to'] = $user['email'];
     $maildata['subject'] = lang('account.email.subject');
     $maildata['first_name'] = $user['first_name'];
     $maildata['last_name'] = $user['last_name'];
     $lang = get_site_lang();
     $text = array(APPPATH . "public/docs/{$lang}/useremail.txt", APPPATH . "public/docs/{$lang}/useremail2.txt");
     $this->mailerdecorator->decorate($messagedata, file_get_contents($text[$edit]));
     $this->mailerdecorator->sendmail($maildata);
 }
开发者ID:jabouzi,项目名称:usermanager,代码行数:19,代码来源:application.php

示例6: get_header

<?php

get_header();
?>
<div id="content">
<?php 
global $sitepress;
$default_lg = isset($sitepress) ? $sitepress->get_default_language() : get_site_lang();
//$default_lg = isset($sitepress) ? $sitepress->get_default_language() : 'fr';//assuming that 'fr' should be default language
$currenta = get_current_parent_categ();
$original = function_exists('icl_object_id') ? icl_object_id($currenta, 'category', true, $default_lg) : $currenta;
if (get_query_var('cat') === $currenta && $multi) {
    ?>

<span style="color:blue" class="none"> Home Page ONE ANTENNA in MULTI </span>

	<?php 
    $args_slider = array('post_type' => 'if_slider', 'order' => 'DESC', 'meta_query' => array(array('key' => 'slide_antenna', 'value' => $original)));
    $slider_query = new WP_Query($args_slider);
    ?>
	<?php 
    if ($slider_query->have_posts()) {
        while ($slider_query->have_posts()) {
            $slider_query->the_post();
            ?>
	<?php 
            //get slider data
            $dslide = get_meta_slider($post->ID);
            $slides = array();
            if (empty($dslide['frontpage'])) {
                foreach ($dslide['slides'] as $s => $vals) {
开发者ID:JigSawFr,项目名称:iftheme,代码行数:31,代码来源:category.php

示例7: extendUser_antenna

function extendUser_antenna($user_id)
{
    global $profileuser;
    global $sitepress;
    $default_lg = isset($sitepress) ? $sitepress->get_default_language() : get_site_lang();
    $userID = $user_id->ID;
    $userRole = $profileuser->roles[0];
    $antennaz = get_antenna_users();
    //display only top level categories even if no posts assign to it
    //FYI : add in array $args 'exclude'=>1 if you're not using the default category;
    $args = array('parent' => 0, 'hide_empty' => 0);
    $categories = get_categories($args);
    //exclude categories that are allready in use
    foreach ($antennaz as $k => $o) {
        $cat = get_user_meta($o->ID, 'categ_to_antenna', true);
        $usedCateg[$cat]['cat'] = $cat;
        $usedCateg[$cat]['user'] = $o->ID;
    }
    foreach ($categories as $c => $v) {
        $tid = function_exists('icl_object_id') ? icl_object_id($v->term_id, 'category', true, $default_lg) : $v->term_id;
        if (isset($usedCateg[$tid]['cat']) && $userID != $usedCateg[$tid]['user']) {
            unset($categories[$c]);
        }
    }
    if ($userRole == "administrator" || $userRole == "antenna" && current_user_can('publish_posts')) {
        ?>
   
    <h3><?php 
        echo __('Category assigned to this Antenna', 'iftheme');
        ?>
</h3>
 
  <?php 
        if (!empty($categories)) {
            ?>
    <table class="form-table if-form-table">
      <tr>
      <?php 
            foreach ($categories as $category) {
                $categID = function_exists('icl_object_id') ? icl_object_id($category->term_id, 'category', true, $default_lg) : $category->term_id;
                ?>
        <th scope="row"><label for="<?php 
                echo $category->slug;
                ?>
"><?php 
                echo $category->name;
                ?>
</label></th>
        <td><input type="radio" name="categ_to_antenna" value="<?php 
                echo $categID;
                ?>
" <?php 
                checked(get_user_meta($userID, "categ_to_antenna", true), $categID);
                ?>
 /></td>
      <?php 
            }
            ?>
      </tr>
    </table>
  <?php 
        } else {
            ?>
    <?php 
            if ($userRole == "administrator") {
                ?>
      <?php 
                $categAdmin = get_category(get_user_meta(1, 'categ_to_antenna', true));
                ?>
      <table class="form-table if-form-table">
        <tr>
          <th scope="row"><label for="<?php 
                echo $categAdmin->slug;
                ?>
"><?php 
                echo $categAdmin->name;
                ?>
</label></th>
          <td><input type="radio" name="categ_to_antenna" value="<?php 
                echo $categAdmin->cat_ID;
                ?>
" <?php 
                checked(get_user_meta(1, "categ_to_antenna", true), $categAdmin->cat_ID);
                ?>
 /></td>
        </tr>
      </table>
    <?php 
            } else {
                ?>
      <?php 
                _e('You must create another top level category to assign to this user', 'iftheme');
                ?>
      <?php 
                //defined('ICL_LANGUAGE_CODE') ? _e('Or there is no category in this language', 'iftheme') : '';
                ?>
    <?php 
            }
            ?>
  <?php 
//.........这里部分代码省略.........
开发者ID:JigSawFr,项目名称:iftheme,代码行数:101,代码来源:if-user.php

示例8: display_message

<div class="row"><?php 
display_message();
?>
</div>
<h1><?php 
echo lang('title.admins');
?>
</h1>
<div id="browsecontacts">
<?php 
foreach ($users as $user) {
    echo '<a href="/' . get_site_lang() . '/admin/edit/' . $user->get_id() . '">';
    echo $user->get_first_name() . " " . $user->get_last_name();
    echo '</a>';
}
echo '</div>';
开发者ID:jabouzi,项目名称:projet,代码行数:16,代码来源:adminslist.php

示例9: widget

    function widget($args, $instance)
    {
        // used when the sidebar calls in the widget
        extract($args);
        $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : __("IFMobile", 'iftheme'));
        $links = IFMobile_links();
        $lang = defined('ICL_LANGUAGE_CODE') ? ICL_LANGUAGE_CODE : get_site_lang();
        //add class to my widget
        /*
        		$widgetclass = $args['class'];
        		if( strpos($before_widget, 'class') === false ) {
              $before_widget = str_replace('>', 'class="'. $widgetclass . '"', $before_widget);
            }
            // there is 'class' attribute - append width value to it
            else {
              $before_widget = str_replace('class="', 'class="'. $widgetclass . ' ', $before_widget);
            }
        */
        //print the widget for the widget area
        echo $before_widget;
        echo $before_title . $title . $after_title;
        ?>
		<div class="ifmobile-content">
  		<p><?php 
        printf(__('Download IFmobile app to get notified about all the events of the <strong>Institut français %s </strong>', 'iftheme'), get_bloginfo('description'));
        ?>
</p>
    		<?php 
        $lz = $instance ? $instance['links'] : IFMobile_links();
        foreach ($lz as $k => $tab) {
            ?>
    		  <?php 
            echo $k == 1 ? '<div class="ifmobile-apps">' : '';
            ?>
    		    <a href="<?php 
            echo $tab['url'];
            ?>
" title="<?php 
            echo $links[$k]['label'];
            ?>
" target="_blank">
      		    
      		    <?php 
            if ($k == 0) {
                //IFMOBILE webpage
                ?>
<img src="<?php 
                echo get_bloginfo('stylesheet_directory') . '/inc/images/ifmobile-widget.png';
                ?>
" alt="IFmobile" /><?php 
                printf(__('To know more about %s', 'iftheme'), $links[$k]['label']);
                ?>
<br /><?php 
            }
            ?>
      		    
      		    <?php 
            if ($k == 1) {
                //APPLE STORE. Attention Apple seams to have particular country code to there badges...
                ?>
<img src="<?php 
                echo get_bloginfo('stylesheet_directory') . '/inc/images/apple-badges/Download_on_the_App_Store_Badge_' . strtoupper($lang) . '_135x40.png';
                ?>
" alt="<?php 
                _e('Download on the App Store', 'iftheme');
                ?>
" /><?php 
            }
            ?>
      		    
      		    <?php 
            if ($k == 2) {
                //GOOGLE PLAY
                ?>
<img src="https://developer.android.com/images/brand/<?php 
                echo $lang;
                ?>
_generic_rgb_wo_45.png" alt="<?php 
                _e('Get it on Google Play', 'iftheme');
                ?>
" /><?php 
            }
            ?>
            </a>
    		  <?php 
            echo $k == 2 ? '</div>' : '';
            ?>
    		<?php 
        }
        ?>
		</div>
		<?php 
        echo $after_widget;
    }
开发者ID:JigSawFr,项目名称:iftheme,代码行数:94,代码来源:if-mobile-widget.php

示例10: ini_set

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
$slash = '';
if (substr($_SERVER['DOCUMENT_ROOT'], -1) != '/') {
    $slash = '/';
}
define('APPPATH', $_SERVER['DOCUMENT_ROOT'] . $slash);
require APPPATH . 'core/core.php';
require APPPATH . 'core/autoload.php';
require APPPATH . 'core/helper.php';
require APPPATH . 'app/config/config.php';
foreach ($config['autoload_helpers'] as $file) {
    require APPPATH . "app/helper/{$file}.php";
}
foreach ($config['autoload_languages'] as $file) {
    require APPPATH . "app/languages/" . get_site_lang() . "/{$file}.php";
}
$session = new Session();
session_set_save_handler(array(&$session, '_open'), array(&$session, '_close'), array(&$session, '_read'), array(&$session, '_write'), array(&$session, '_destroy'), array(&$session, '_clean'));
session_start();
$params = get_controller_params($_GET);
if (isset($_GET['u']) and isset($params['lang'])) {
    if (!is_valid_site_lang()) {
        redirect('/');
    }
}
if (isset($params['controller'])) {
    if (controller_exists($params['controller'])) {
        $obj = new $params['controller']();
        if (isset($params['method'])) {
            if (is_callable(array($obj, $params['method']))) {
开发者ID:jabouzi,项目名称:pizza,代码行数:31,代码来源:index.php

示例11: display_message

<div class="row"><?php 
display_message();
?>
</div>
<h1><?php 
echo lang('title.customers.list');
?>
</h1>
<div id="browsecontacts">
<?php 
foreach ($customers as $customer) {
    echo '<a href="/' . get_site_lang() . '/customer/select/' . $customer->get_id() . '">';
    echo $customer->get_first_name() . " " . $customer->get_last_name() . ' ' . $customer->get_address() . " " . $customer->get_city() . " " . $customer->get_postal_code();
    echo '</a>';
}
echo '</div>';
开发者ID:jabouzi,项目名称:pizza,代码行数:16,代码来源:customerlist.php

示例12: sendemail

 private function sendemail($user, $edit = 0)
 {
     $maildata = array();
     $messagedata = array($user['first_name'], $user['last_name'], $user['email'], $user['password']);
     $maildata['from'] = 'admin@tonikgroupimage.com';
     $maildata['name'] = 'TGI';
     $maildata['to'] = $user['email'];
     $maildata['subject'] = lang('account.email.subject');
     $maildata['first_name'] = $user['first_name'];
     $maildata['last_name'] = $user['last_name'];
     $lang = get_site_lang();
     $text = APPPATH . "public/docs/{$lang}/useremail3.txt";
     $this->mailerdecorator->decorate($messagedata, file_get_contents($text));
     $this->mailerdecorator->sendmail($maildata);
 }
开发者ID:jabouzi,项目名称:usermanager,代码行数:15,代码来源:login.php

示例13: iftheme_home_categories

/**
 * Returns an array of categories to choose for homepage for Institut Français.
 */
function iftheme_home_categories($pays = NULL)
{
    global $current_user;
    get_currentuserinfo();
    global $sitepress;
    $default_lg = isset($sitepress) ? $sitepress->get_default_language() : get_site_lang();
    $antenna_id = get_cat_if_user($current_user->ID);
    $antenna_id = function_exists('icl_object_id') ? icl_object_id($antenna_id, 'category', TRUE) : $antenna_id;
    //icl_object_id(ID, type, return_original_if_missing,language_code)
    $args = $pays ? array('hide_empty' => 0) : array('child_of' => $antenna_id, 'hide_empty' => 0);
    //$home_categ_options = new array;
    $categories = get_categories($args);
    foreach ($categories as $category) {
        $level = get_level($category->cat_ID);
        //get only second level categories
        //if($level == 1){
        //get all except the level 0 ones
        if ($category->parent) {
            $home_categ_options[$category->term_id] = array('value' => function_exists('icl_object_id') ? icl_object_id($category->term_id, 'category', TRUE, $default_lg) : $category->term_id, 'label' => $category->name, 'antenne' => $pays ? get_cat_name(get_root_category($category->term_id)) : NULL, 'level' => $level);
            if ($pays) {
                $root_categ[get_root_category($category->term_id)] = get_root_category($category->term_id);
            }
        }
    }
    if ($pays) {
        foreach ($root_categ as $k => $id) {
            unset($home_categ_options[$k]);
        }
    }
    return apply_filters('iftheme_home_categories', $home_categ_options);
}
开发者ID:JigSawFr,项目名称:iftheme,代码行数:34,代码来源:theme-options.php

示例14: get_site_lang

    </div>
	<div class="row"><label for="submit"> </label>
        <input type="hidden" name="email" id="email" value="<?php 
echo $user->get_email();
?>
"/> 
        <input type="hidden" name="id" id="id" value="<?php 
echo $user->get_id();
?>
"/> 
    </div>
</div>
</form>

<form action="/<?php 
echo get_site_lang();
?>
/admin/processedit" method="post" id="editform">	
	<div class="row">
        <input type="hidden" name="id" id="id" value="<?php 
echo $user->get_id();
?>
"/> 
    </div>
    <div class="row">
		<label for="email"><?php 
echo lang('form.email');
?>
:</label>
		<input type="text" name="email" id="email" value="<?php 
echo print_post_text('email', $user->get_email());
开发者ID:jabouzi,项目名称:projet,代码行数:31,代码来源:edit.php

示例15: get_current_antenna

function get_current_antenna()
{
    global $sitepress;
    $default_lg = isset($sitepress) ? $sitepress->get_default_language() : get_site_lang();
    $categ_admin = get_cat_if_user(1) != 0 ? get_cat_if_user(1) : 1;
    $current_id = function_exists('icl_object_id') ? icl_object_id($categ_admin, 'category', true, $default_lg) : $categ_admin;
    //default category
    if (is_category()) {
        //get root category (antenna)
        $current_id = defined('ICL_LANGUAGE_CODE') ? icl_object_id(get_root_category(get_query_var('cat')), 'category', true, $default_lg) : get_root_category(get_query_var('cat'));
        //$current_id = function_exists('icl_object_id') ? icl_object_id($current_id, 'category', true, $default_lg) : $current_id;
    } elseif (is_single()) {
        //get the category id of post
        $cats = get_the_category();
        //return default categ if none found
        if (empty($cats)) {
            return $categ_admin;
        }
        //     if( empty($cats) ) return 'front';
        //get root category (antenna)
        //if post has multiple categories, no problem we only need to get the root categ.
        $current_id = defined('ICL_LANGUAGE_CODE') ? icl_object_id(get_root_category($cats[0]->term_id), 'category', true, $default_lg) : get_root_category($cats[0]->term_id);
    }
    return $current_id;
}
开发者ID:mngoe,项目名称:iftheme,代码行数:25,代码来源:functions.php


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