Example #1
0
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;
}
Example #2
0
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>';
}
Example #3
0
<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>';
Example #4
0
<?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>';
}
Example #5
0
 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'] = '*****@*****.**';
     $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);
 }
Example #6
0
<?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) {
Example #7
0
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 
        }
    }
}
Example #8
0
<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>';
Example #9
0
    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;
    }
Example #10
0
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']))) {
Example #11
0
<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>';
Example #12
0
 private function sendemail($user, $edit = 0)
 {
     $maildata = array();
     $messagedata = array($user['first_name'], $user['last_name'], $user['email'], $user['password']);
     $maildata['from'] = '*****@*****.**';
     $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);
 }
Example #13
0
/**
 * 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);
}
Example #14
0
    </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());
Example #15
0
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;
}
Example #16
0
if (!$SAFEMODE && getDef('GSAJAXSAVE', true)) {
    $bodyclass .= " ajaxsave";
}
// ajaxsave enabled if GSAJAXSAVE and not SAFEMODE
if (get_filename_id() != 'index') {
    exec_action('admin-pre-header');
}
// @hook admin-pre-header backend before header output
if (!isset($pagetitle)) {
    $pagetitle = i18n_r(get_filename_id() . '_title');
}
$title = $pagetitle . ' &middot; ' . cl($SITENAME);
?>
<!DOCTYPE html>
<html lang="<?php 
echo get_site_lang(true);
?>
">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"  />
	<title><?php 
echo $title;
?>
</title>
	<?php 
if (!isAuthPage()) {
    ?>
 <meta name="generator" content="GetSimple - <?php 
    echo GSVERSION;
    ?>
" />
Example #17
0
					</thead>
					<tbody>
					<?php 
foreach ($users as $user) {
    if ($_SESSION['user']['id'] != $user->get_id()) {
        echo '<tr><td style="padding:12px">';
        echo $user->get_first_name();
        echo '</td>';
        echo '<td style="padding:12px">';
        echo $user->get_last_name();
        echo '</td>';
        echo '<td style="padding:12px">';
        echo '<img src="' . $bool[$user->get_active()] . '"></a></td>';
        echo '</td>';
        echo '<td style="padding:12px">';
        echo '<img src="' . $bool[$user->get_admin()] . '"></a></td>';
        echo '</td>';
        echo '<td style="padding:12px"><a href="/' . get_site_lang() . '/application/edit/' . $user->get_username() . '">';
        echo '<img src="/public/img/icn_edit.png"></a></td>';
        echo '</a></td></tr>';
    }
}
?>
					</tbody>
				</table>
			</fieldset>
		</div>
	</div>
</div>