diff -r c9c502117eb6 -r ff4b567d51f2 web/common.php --- a/web/common.php Fri Feb 13 13:14:15 2015 +0100 +++ b/web/common.php Sun Feb 15 00:43:16 2015 +0100 @@ -18,7 +18,7 @@ $ldt_platform = 'http://ldt.iri.centrepompidou.fr/'; $project_url_base = 'ldtplatform/ldt/cljson/id/'; -$C_default_rep = 'museo-1415-04-reseaux-sociaux-hermeneutiques'; +$C_default_rep = 'edito-1415-03-politique-archive-formats'; $C_feedback_form_url = 'https://spreadsheets.google.com/spreadsheet/viewform?hl=en_US&formkey=dDZILVdXVHRzd0xhWGVZXzkweHN2RGc6MQ#gid=0'; $C_event_props = __DIR__ . "/event_props"; $C_event_users = array('polemictweet' => 'polemictweet'.date('Y/m/d')); @@ -90,7 +90,7 @@ /** Zend_Locale */ require_once dirname(__FILE__).'/lib/Zend/Locale.php'; - + /** Zend_Translate_Adapter */ require_once dirname(__FILE__).'/lib/Zend/Translate/Adapter.php'; @@ -103,7 +103,7 @@ * Include the configuration data for our OAuth Client (array $configuration) */ include_once dirname(__FILE__).'/config.php'; - + $configuration['callbackUrl'] = URL_ROOT."$req_rep/callback.php"; @@ -150,16 +150,16 @@ } function set_config_translations(&$config, &$translate) { - + $config_translations = get_config_translations($config); - + // save the locale because it gets changed when adding translations $locale = $translate->getLocale(); - + $translate->addTranslation($config_translations['en'], 'en'); $translate->addTranslation($config_translations['jp'], 'ja_JP'); $translate->addTranslation($config_translations['fr'], 'fr'); - + // set the locale back $translate->setLocale($locale); } @@ -178,28 +178,28 @@ $translate->addTranslation($traduction_fr, 'fr'); if(isset($config)) { - + set_config_translations($config, $translate); // $config_translations = get_config_translations($config); - - + + // $translate->addTranslation($config_translations['en'], 'en'); // $translate->addTranslation($config_translations['jp'], 'ja_JP'); // $translate->addTranslation($config_translations['fr'], 'fr'); } - + $actual = $translate->getLocale(); //$translate->setLocale("en"); // $acceptCookie = $this->_request->getCookie('acceptCookie',0); if(isset($_GET['lang'])==false and isset($_SESSION['lang'])==false){ - + if($actual!='fr' and $actual!='en' and $actual!='ja_JP'){ $translate->setLocale("fr"); $_SESSION['lang']="fr"; } - + } else if (isset($_GET['lang'])==true){ $translate->setLocale($_GET['lang']); $_SESSION['lang'] = $_GET['lang']; @@ -208,7 +208,7 @@ } else if (isset($_SESSION['lang'])==true){ $translate->setLocale( $_SESSION['lang']); $actual = $_SESSION['lang']; - + } $js_registry = array( @@ -334,17 +334,17 @@ function get_archive_box($rep, $metadata, $url_root, $basepath, &$translate) { include("$basepath$rep/config.php"); - + set_config_translations($config, $translate); /* $config_translations = get_config_translations($config); - + // save the locale because it gets changed when adding translations $locale = $translate->getLocale(); - + $translate->addTranslation($config_translations['en'], 'en'); $translate->addTranslation($config_translations['jp'], 'ja_JP'); $translate->addTranslation($config_translations['fr'], 'fr'); - + // set the locale back $translate->setLocale($locale); */ @@ -379,14 +379,14 @@ } function display_archives_list($archives_list, $box_class, $url_root, $basepath, &$translate) { - - + + for($i=0;$i\n"); } $archive_ref = $archives_list[$i]; - + $archive_name = $archive_ref; $metadata = null; if(is_array($archive_ref)) { @@ -425,8 +425,8 @@ function authenticate($users, $translate) { global $realm; - - + + if (empty($_SERVER['PHP_AUTH_DIGEST']) || !isset($_SESSION['http_digest_nonce'])) { $_SESSION['http_digest_nonce'] = uniqid(); header('HTTP/1.1 401 Unauthorized'); @@ -465,7 +465,7 @@ function logout() { global $realm; - + unset($_SESSION['auth']); unset($_SESSION['http_digest_nonce']); } @@ -549,6 +549,6 @@ { $f = iconv('utf-8', 'us-ascii//TRANSLIT', $f); } - + return strtolower($f); }