Beispiel #1
0
 /**
  * @param $texte
  * @param $userLang
  * @return mixed
  */
 public static function gl($texte, $userLang)
 {
     $result = Traduction::where('fr', '=', $texte)->first();
     if ($result) {
         if ($result->{$userLang} == '') {
             return $texte;
         } else {
             return $result->{$userLang};
         }
     }
     $traduction = new Traduction();
     $traduction->fr = $texte;
     $traduction->save();
     return $texte;
 }
Beispiel #2
0
<?php

/**************************************************************************/
// AJAX Build List
// file called by the dataTables Jquery in list.php to load data
/**************************************************************************/
require_once $_SERVER['DOCUMENT_ROOT'] . '/include/config.php';
$objTrad = new Traduction();
$arrText = $objTrad->getForBack();
$objLang = new Language();
$arrLanguage = $objLang->get();
$module = $_GET['module'];
$objPage = new Page();
$output['aaData'] = array();
foreach ($arrText as $key => $data) {
    $row = array();
    // O => hidden ID
    $row[] = $data['traduction_id'];
    // 1 => Actions (view, update..)
    $action_view = '<a href="view.php?module=' . $module . '&id=' . $data['traduction_id'] . '"><img alt="view" title="View" src="theme/img/view.gif" /></a>';
    $action_update = '<a href="form.php?module=' . $module . '&id=' . $data['traduction_id'] . '"><img alt="update" title="Update" src="theme/img/update.gif" /></a>';
    $action_delete = '<a href="module/' . $module . '/ajax/delete.php?module=' . $module . '&id=' . $data['traduction_id'] . '" class="ajaxDeleteRow" title="delete-row"><img alt="delete" title="Delete" src="theme/img/delete.gif" /></a>';
    $row[] = '<span class="iconAction">' . $action_view . $action_update . $action_delete . '</span>';
    // 2 => Key
    $row[] = $data['traduction_key'];
    // 3 => Containt
    $row[] = strip_tags(substr($data['traduction_text'], 0, 100));
    $row_lang = '<span class="iconAction">';
    foreach ($arrLanguage as $key => $lang) {
        $traductionText = $objTrad->get(array("traduction_key" => $data['traduction_key'], "language_id" => $lang['language_id']), "traduction_text");
        if (empty($traductionText)) {
Beispiel #3
0
<?php

header("Content-Type: text/html; charset=utf-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
require_once '../config.php';
$objTrad = new Traduction();
//var dataString='name='+name+'&email='+email+'&msg='+msg;
$err = "";
if (strpos($_POST['email'], "@") === false) {
    $err = "err|" . $objTrad->getOne('email_incorrect');
} else {
    @(list($user, $domaine) = split("@", $_POST['email'], 2));
    if (!checkdnsrr($domaine, "MX")) {
        $err = "err|" . $objTrad->getOne('email_incorrect');
    } else {
        $to = 'Virginie FAURE <*****@*****.**>';
        $from = stripslashes($_POST['name']) . ' <' . $_POST['email'] . '>';
        $txt_sujet = $objTrad->getOne('sujet_email');
        //subject and the html message
        $headers = "MIME-Version: 1.0" . "\r\n";
        $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
        $headers .= 'From: ' . $from . "\r\n";
        $subject = 'Webfolio Virginie FAURE : Message de ' . stripslashes($_POST['name']);
        $message = '  
			<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"   
			"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
			<html xmlns="http://www.w3.org/1999/xhtml">  
Beispiel #4
0
    }
}
// LANGUAGE
$objLang = new Language();
$arrLang = $objLang->get();
/*if(empty($_SESSION['langue_ini'])){
		if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
			$lang = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
			$lang = strtolower(substr(chop($lang[0]),0,2)); 
			$_SESSION['langue_ini']=$lang;
		}else{
			//espagnol par defaut
			$_SESSION['langue_ini']='es';
		}
	}else{
		if(!empty($_POST['langue_ini'])){
			$_SESSION['langue_ini']=$_POST['langue_ini'];
		}
	}*/
if (empty($_SESSION['language_locale'])) {
    $_SESSION['language_locale'] = 'ES_ES';
    //by default
}
if (!empty($_POST['language_locale'])) {
    //change lang
    $_SESSION['language_locale'] = $_POST['language_locale'];
}
$_SESSION['language_id'] = $objLang->get(array("language_locale" => $_SESSION['language_locale']), "language_id");
// TRADUCTIONS JS
$objTrad = new Traduction();
$arrTextJS = $objTrad->get(array("page_id" => JAVASCRIPT, "language_id" => $_SESSION['language_id']));
Beispiel #5
0
/**
 * @param $texte
 * @return mixed
 */
function gl($texte)
{
    return Traduction::gl($texte, app::getLocale());
}
Beispiel #6
0
<?php

/*header("Content-Type: text/html; charset=utf-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");*/
require_once '../config.php';
$objTrad = new Traduction();
$objProj = new Project();
$arrProject = $objProj->getOne(array('project_id' => $_GET['project_id'], 'project_image_type_id' => IMAGE_TYPE_POPUP));
?>

<!--
<div class="fancyboxProject">
	<div class="fancyboxProjectLeft"><a href="<?php 
echo $arrProject['project_url'];
?>
" target="_blank"><img src="<?php 
echo SITE_URL . PROJECT_IMAGE_DIR . $arrProject['project_image_url'];
?>
" alt="<?php 
echo $arrProject['project_name'];
?>
" style="width:<?php 
echo $arrProject['project_image_width'];
?>
px;height:<?php 
echo $arrProject['project_image_height'];
?>