web/common.php
changeset 119 4c86151704e9
parent 99 6cb4d10f0b8b
child 143 2a3599a4b0f7
equal deleted inserted replaced
118:93d9cbad255d 119:4c86151704e9
     8 set_include_path(
     8 set_include_path(
     9     'lib'
     9     'lib'
    10     . PATH_SEPARATOR . get_include_path()
    10     . PATH_SEPARATOR . get_include_path()
    11 );
    11 );
    12 
    12 
       
    13 
       
    14 include_once dirname(__FILE__).'/traduction.php';
       
    15 
       
    16 
    13 /**
    17 /**
    14  * Make sure Zend_Oauth's Consumer is loaded
    18  * Make sure Zend_Oauth's Consumer is loaded
    15  */
    19  */
    16 require_once 'lib/Zend/Oauth/Consumer.php';
    20 require_once dirname(__FILE__).'/lib/Zend/Oauth/Consumer.php';
       
    21 
       
    22 /** Zend_Locale */
       
    23 require_once dirname(__FILE__).'/lib/Zend/Locale.php';
       
    24  
       
    25 /** Zend_Translate_Adapter */
       
    26 require_once dirname(__FILE__).'/lib/Zend/Translate/Adapter.php';
    17 
    27 
    18 /**
    28 /**
    19  * Start up the ol' session engine
    29  * Start up the ol' session engine
    20  */
    30  */
    21 session_start();
    31 session_start();
    22 
    32 
    23 /**
    33 /**
    24  * Include the configuration data for our OAuth Client (array $configuration)
    34  * Include the configuration data for our OAuth Client (array $configuration)
    25  */
    35  */
    26 include_once './config.php';
    36 include_once dirname(__FILE__).'/config.php';
    27 
    37 
    28 /**
    38 /**
    29  * Setup an instance of the Consumer for use
    39  * Setup an instance of the Consumer for use
    30  */
    40  */
    31 $consumer = new Zend_Oauth_Consumer($configuration);
    41 $consumer = new Zend_Oauth_Consumer($configuration);
       
    42 
       
    43 /**
       
    44  * TRADUCTION
       
    45 **/
       
    46 
       
    47 
       
    48 Zend_Loader::loadClass('Zend_Translate'); 
       
    49 Zend_Loader::loadClass('Zend_Http_Cookie'); 
       
    50 
       
    51 
       
    52 $client = new Zend_Http_Client();
       
    53 $translate = new Zend_Translate('array', $init, 'fr');
       
    54 
       
    55 $translate->addTranslation($english, 'en');
       
    56 $translate->addTranslation($japan, 'ja_JP');
       
    57 $translate->addTranslation($french, 'fr');
       
    58 
       
    59 $actual = $translate->getLocale();
       
    60 
       
    61 //$translate->setLocale("en");
       
    62 // $acceptCookie = $this->_request->getCookie('acceptCookie',0);
       
    63 
       
    64 if(isset($_GET['lang'])==false and isset($_SESSION['lang'])==false){
       
    65 	
       
    66 	if($actual!='fr' and $actual!='en' and $actual!='ja_JP'){
       
    67 		$translate->setLocale("fr");
       
    68 		 $_SESSION['lang']="fr";
       
    69 	}
       
    70 	
       
    71 } else if (isset($_GET['lang'])==true){
       
    72 	$translate->setLocale($_GET['lang']);
       
    73     $_SESSION['lang'] = $_GET['lang'];
       
    74     $actual = $_SESSION['lang'];
       
    75 
       
    76 } else if (isset($_SESSION['lang'])==true){
       
    77 	$translate->setLocale( $_SESSION['lang']);
       
    78     $actual = $_SESSION['lang'];
       
    79 	
       
    80 }
       
    81 
       
    82 
       
    83