| author | Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com> |
| Wed, 19 Oct 2011 00:04:48 +0200 | |
| changeset 328 | 23ac0bfa2a16 |
| parent 317 | 49e86108ad25 |
| child 330 | 1a77b44dfa7d |
| permissions | -rwxr-xr-x |
|
0
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
1 |
<?php |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
2 |
|
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
3 |
/** |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
4 |
* If you haven't edited php.ini to add the Zend Framework and the |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
5 |
* Zend Framework Incubator to the PHP include_path, then do so here. |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
6 |
* Don't use mine! |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
7 |
*/ |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
8 |
set_include_path( |
|
99
6cb4d10f0b8b
NEW WEBSITE WITH : HOME / ABOUT / CLIENT.PHP
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
diff
changeset
|
9 |
'lib' |
|
0
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
10 |
. PATH_SEPARATOR . get_include_path() |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
11 |
); |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
12 |
|
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
13 |
/** |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
14 |
* Base configuration |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
15 |
*/ |
|
328
23ac0bfa2a16
Back to Todai Forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
317
diff
changeset
|
16 |
$C_default_rep = 'iii-catastrophe'; |
|
287
3efe34a87c37
correct feedback url
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
286
diff
changeset
|
17 |
$C_feedback_form_url = 'https://spreadsheets.google.com/spreadsheet/viewform?hl=en_US&formkey=dDZILVdXVHRzd0xhWGVZXzkweHN2RGc6MQ#gid=0'; |
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
18 |
|
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
19 |
$archives_list = array( |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
20 |
"rsln", "rsln-opendata", "rsln-mercedes-bunz", |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
21 |
"enmi2011-technologie-confiance", "CPV", array("fens_FabLab_Design_Metadata","fablab"), |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
22 |
array("fens_FabLab_Design_Metadata","designmd"), array("mashup","conference"), array("mashup","tableronde"), |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
23 |
"sig-chi-paris-2011", "rwd-meetup-patrimoine"/*, "JaneMcGonigal-gameDesign"*/, |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
24 |
); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
25 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
26 |
|
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
27 |
$configuration = array( |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
28 |
'siteUrl' => 'http://twitter.com/oauth', |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
29 |
'consumerKey' => '***REMOVED***', |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
30 |
'consumerSecret' => '***REMOVED***' |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
31 |
); |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
32 |
|
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
33 |
|
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
34 |
$req_rep = $C_default_rep; |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
35 |
if(isset($config) && isset($config['rep'])) { |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
36 |
$req_rep = $config['rep']; |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
37 |
} |
| 119 | 38 |
|
39 |
include_once dirname(__FILE__).'/traduction.php'; |
|
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
40 |
if(file_exists(dirname(__FILE__)."/$req_rep/traduction.php")) { |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
41 |
include_once dirname(__FILE__)."/$req_rep/traduction.php"; |
|
220
42aeb2bfc58e
publish chi07 and fens Fablab
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
219
diff
changeset
|
42 |
} |
| 119 | 43 |
|
44 |
||
|
0
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
45 |
/** |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
46 |
* Make sure Zend_Oauth's Consumer is loaded |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
47 |
*/ |
| 119 | 48 |
require_once dirname(__FILE__).'/lib/Zend/Oauth/Consumer.php'; |
49 |
||
50 |
/** Zend_Locale */ |
|
51 |
require_once dirname(__FILE__).'/lib/Zend/Locale.php'; |
|
52 |
||
53 |
/** Zend_Translate_Adapter */ |
|
54 |
require_once dirname(__FILE__).'/lib/Zend/Translate/Adapter.php'; |
|
|
0
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
55 |
|
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
56 |
/** |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
57 |
* Start up the ol' session engine |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
58 |
*/ |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
59 |
session_start(); |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
60 |
|
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
61 |
/** |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
62 |
* Include the configuration data for our OAuth Client (array $configuration) |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
63 |
*/ |
| 119 | 64 |
include_once dirname(__FILE__).'/config.php'; |
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
65 |
|
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
66 |
|
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
67 |
$configuration['callbackUrl'] = URL_ROOT."$req_rep/callback.php"; |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
68 |
|
|
0
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
69 |
|
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
70 |
/** |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
71 |
* Setup an instance of the Consumer for use |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
72 |
*/ |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
73 |
$consumer = new Zend_Oauth_Consumer($configuration); |
| 119 | 74 |
|
75 |
/** |
|
76 |
* TRADUCTION |
|
77 |
**/ |
|
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
78 |
function get_config_translations($config) { |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
79 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
80 |
$fr = array(); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
81 |
$en = array(); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
82 |
$jp = array(); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
83 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
84 |
$array_loop = array("fr"=>&$fr,"en"=>&$en,"jp"=>&$jp); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
85 |
/** |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
86 |
* add all config key as translation. |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
87 |
* translation key is "config__<config_key>" |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
88 |
*/ |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
89 |
foreach ($config as $key => $value) { |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
90 |
$translation_key = "config__$key"; |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
91 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
92 |
foreach ($array_loop as $lang => &$lang_array) { |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
93 |
if(is_array($value) && count(array_intersect_key($value,$array_loop)) > 0 ) { |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
94 |
if (array_key_exists($lang, $value)) { |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
95 |
$lang_array[$translation_key] = $value[$lang]; |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
96 |
} |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
97 |
elseif (array_key_exists('fr', $value)) { |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
98 |
$lang_array[$translation_key] = $value['fr']; |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
99 |
} |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
100 |
} |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
101 |
else { |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
102 |
$lang_array[$translation_key] = $value; |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
103 |
} |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
104 |
} |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
105 |
} |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
106 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
107 |
return $array_loop; |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
108 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
109 |
} |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
110 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
111 |
function set_config_translations(&$config, &$translate) { |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
112 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
113 |
$config_translations = get_config_translations($config); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
114 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
115 |
// save the locale because it gets changed when adding translations |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
116 |
$locale = $translate->getLocale(); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
117 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
118 |
$translate->addTranslation($config_translations['en'], 'en'); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
119 |
$translate->addTranslation($config_translations['jp'], 'ja_JP'); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
120 |
$translate->addTranslation($config_translations['fr'], 'fr'); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
121 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
122 |
// set the locale back |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
123 |
$translate->setLocale($locale); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
124 |
} |
| 119 | 125 |
|
126 |
||
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
127 |
Zend_Loader::loadClass('Zend_Translate'); |
|
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
128 |
Zend_Loader::loadClass('Zend_Http_Cookie'); |
| 119 | 129 |
|
130 |
||
131 |
$client = new Zend_Http_Client(); |
|
132 |
$translate = new Zend_Translate('array', $init, 'fr'); |
|
133 |
||
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
134 |
|
| 119 | 135 |
$translate->addTranslation($english, 'en'); |
136 |
$translate->addTranslation($japan, 'ja_JP'); |
|
137 |
$translate->addTranslation($french, 'fr'); |
|
138 |
||
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
139 |
if(isset($config)) { |
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
140 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
141 |
set_config_translations($config, $translate); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
142 |
// $config_translations = get_config_translations($config); |
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
143 |
|
|
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
144 |
|
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
145 |
// $translate->addTranslation($config_translations['en'], 'en'); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
146 |
// $translate->addTranslation($config_translations['jp'], 'ja_JP'); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
147 |
// $translate->addTranslation($config_translations['fr'], 'fr'); |
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
148 |
} |
|
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
149 |
|
| 119 | 150 |
$actual = $translate->getLocale(); |
151 |
||
152 |
//$translate->setLocale("en"); |
|
153 |
// $acceptCookie = $this->_request->getCookie('acceptCookie',0); |
|
154 |
||
155 |
if(isset($_GET['lang'])==false and isset($_SESSION['lang'])==false){ |
|
156 |
||
157 |
if($actual!='fr' and $actual!='en' and $actual!='ja_JP'){ |
|
158 |
$translate->setLocale("fr"); |
|
159 |
$_SESSION['lang']="fr"; |
|
160 |
} |
|
161 |
||
162 |
} else if (isset($_GET['lang'])==true){ |
|
163 |
$translate->setLocale($_GET['lang']); |
|
164 |
$_SESSION['lang'] = $_GET['lang']; |
|
165 |
$actual = $_SESSION['lang']; |
|
166 |
||
167 |
} else if (isset($_SESSION['lang'])==true){ |
|
168 |
$translate->setLocale( $_SESSION['lang']); |
|
169 |
$actual = $_SESSION['lang']; |
|
170 |
||
171 |
} |
|
172 |
||
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
173 |
$js_registry = array( |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
174 |
'local' => array( |
|
259
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
175 |
'jquery' => URL_ROOT.'res/js/jquery-1.4.3.min.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
176 |
'raphael' => URL_ROOT.'res/raphael/raphael-min.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
177 |
'jquery-ui' => URL_ROOT.'res/js/jquery-ui-1.8.13.min.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
178 |
'niceforms' => URL_ROOT.'res/niceforms/niceforms.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
179 |
'jquery-url' => URL_ROOT.'res/js/jquery.url.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
180 |
'ldtplayer' => URL_ROOT.'res/metadataplayer/src/js/LdtPlayer.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
181 |
'fancybox' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.fancybox-1.3.4.pack.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
182 |
'jquery-tools' => URL_ROOT.'res/metadataplayer/res/js/jquery.tools.min.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
183 |
'tw-widget' => URL_ROOT.'res/js/tw_widget.js', |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
184 |
'jquery-mousewheel' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.mousewheel-3.0.4.pack.js', |
|
259
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
185 |
'swfobject' => URL_ROOT.'res/metadataplayer/res/js/swfobject.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
186 |
'json-js' => URL_ROOT.'res/douglascrockford-JSON-js/json2.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
187 |
|
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
188 |
), |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
189 |
'cdn' => array( |
|
259
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
190 |
'jquery' => 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
191 |
'raphael' => URL_ROOT.'res/raphael/raphael-min.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
192 |
'jquery-ui' => 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
193 |
'niceforms' => URL_ROOT.'res/niceforms/niceforms.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
194 |
'jquery-url' => URL_ROOT.'res/js/jquery.url.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
195 |
'ldtplayer' => URL_ROOT.'res/metadataplayer/src/js/LdtPlayer.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
196 |
'fancybox' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.fancybox-1.3.4.pack.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
197 |
'jquery-tools' => 'http://cdn.jquerytools.org/1.2.4/all/jquery.tools.min.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
198 |
'tw-widget' => 'http://widgets.twimg.com/j/2/widget.js', |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
199 |
'jquery-mousewheel' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.mousewheel-3.0.4.pack.js', |
|
259
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
200 |
'swfobject' => 'http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
201 |
'json-js' => URL_ROOT.'res/douglascrockford-JSON-js/json2.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
202 |
|
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
203 |
) |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
204 |
); |
|
143
2a3599a4b0f7
add #enmi page and some litlle corrections
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
119
diff
changeset
|
205 |
|
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
206 |
$font_registry = array( |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
207 |
'local' => array( |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
208 |
'PT-Sans_Narrow' => URL_ROOT.'res/fonts/PT_Sans-Narrow-Web-Regular.css', |
|
259
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
209 |
'PT-Sans' => URL_ROOT.'res/fonts/PT_Sans-Web-Regular.css', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
210 |
'Geo' => URL_ROOT.'res/fonts/Geo-Regular.css' |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
211 |
), |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
212 |
'cdn' => array( |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
213 |
'PT-Sans_Narrow' => 'http://fonts.googleapis.com/css?family=PT+Sans+Narrow&subset=latin', |
|
259
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
214 |
'PT-Sans' => 'http://fonts.googleapis.com/css?family=PT+Sans&subset=latin', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
215 |
'Geo' => 'http://fonts.googleapis.com/css?family=Geo&subset=latin' |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
216 |
) |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
217 |
); |
|
216
d8c1b7e00533
sig chi paris 2011
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
207
diff
changeset
|
218 |
|
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
219 |
|
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
220 |
$css_registry = array( |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
221 |
'local' => array( |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
222 |
'blueprint-screen' => URL_ROOT.'res/blueprint/screen.css', |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
223 |
'blueprint-print' => URL_ROOT.'res/blueprint/print.css', |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
224 |
'blueprint-ie' => URL_ROOT.'res/blueprint/ie.css', |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
225 |
'blueprint-plugins-fancy-type' => URL_ROOT.'res/blueprint/plugins/fancy-type/screen.css', |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
226 |
'custom' => URL_ROOT.'res/css/custom.css', |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
227 |
'fancybox' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.fancybox-1.3.4.css', |
|
240
ee6305b4a7dc
correct registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
235
diff
changeset
|
228 |
'jquery-ui' => URL_ROOT.'res/metadataplayer/res/css/jq-css/themes/base/jquery-ui.css', |
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
229 |
'tabs-slideshow' => URL_ROOT.'res/css/tabs-slideshow.css', |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
230 |
), |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
231 |
'cdn' => array( |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
232 |
'blueprint-screen' => URL_ROOT.'res/blueprint/screen.css', |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
233 |
'blueprint-print' => URL_ROOT.'res/blueprint/print.css', |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
234 |
'blueprint-ie' => URL_ROOT.'res/blueprint/ie.css', |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
235 |
'blueprint-plugins-fancy-type' => URL_ROOT.'res/blueprint/plugins/fancy-type/screen.css', |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
236 |
'custom' => URL_ROOT.'res/css/custom.css', |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
237 |
'fancybox' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.fancybox-1.3.4.css', |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
238 |
'jquery-ui' => "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/base/jquery-ui.css", |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
239 |
'tabs-slideshow' => URL_ROOT.'res/css/tabs-slideshow.css', |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
240 |
) |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
241 |
); |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
242 |
|
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
243 |
|
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
244 |
function registry_url($key, $type, $registry_def=null) { |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
245 |
|
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
246 |
global $js_registry, $font_registry, $css_registry, $C_default_registry; |
|
143
2a3599a4b0f7
add #enmi page and some litlle corrections
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
119
diff
changeset
|
247 |
|
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
248 |
if($registry_def != null) { |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
249 |
$registry = $registry_def; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
250 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
251 |
elseif(isset($C_default_registry)) { |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
252 |
$registry = $C_default_registry; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
253 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
254 |
else { |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
255 |
$registry = 'local'; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
256 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
257 |
$registry_name = $type."_registry"; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
258 |
return ${ |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
259 |
$registry_name}[$registry][$key]; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
260 |
|
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
261 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
262 |
|
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
263 |
function get_archive_box($rep, $metadata, $url_root, $basepath, &$translate) { |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
264 |
|
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
265 |
include("$basepath$rep/config.php"); |
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
266 |
|
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
267 |
set_config_translations($config, $translate); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
268 |
/* $config_translations = get_config_translations($config); |
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
269 |
|
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
270 |
// save the locale because it gets changed when adding translations |
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
271 |
$locale = $translate->getLocale(); |
|
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
272 |
|
|
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
273 |
$translate->addTranslation($config_translations['en'], 'en'); |
|
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
274 |
$translate->addTranslation($config_translations['jp'], 'ja_JP'); |
|
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
275 |
$translate->addTranslation($config_translations['fr'], 'fr'); |
|
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
276 |
|
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
277 |
// set the locale back |
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
278 |
$translate->setLocale($locale); |
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
279 |
*/ |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
280 |
$id = "abox_$rep".(($metadata!=null)?"_$metadata":""); |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
281 |
$hash = ($metadata!=null)?"#metadata=$metadata":""; |
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
282 |
$tail_img = $translate->_('config__archive_img'); |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
283 |
if(is_array($tail_img)) { |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
284 |
$tail_img = $tail_img[$metadata]; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
285 |
} |
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
286 |
$archive_title = $translate->_('config__archive_title'); |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
287 |
if(is_array($archive_title)) { |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
288 |
$archive_title = $archive_title[$metadata]; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
289 |
} |
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
290 |
$archive_description = $translate->_('config__archive_description'); |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
291 |
if(is_array($archive_description)) { |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
292 |
$archive_description = $archive_description[$metadata]; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
293 |
} |
| 119 | 294 |
|
295 |
||
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
296 |
$res = "<div id=\"$id\" class=\"archivesVideoBox\">\n"; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
297 |
$res .= " <a href=\"$rep/polemicaltimeline.php$hash\">\n"; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
298 |
$res .= " <img src=\"$url_root$rep/$tail_img\" width=\"270\" height=\"150\"/>"; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
299 |
$res .= " </a>"; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
300 |
$res .= " <div class=\"AVBtitle\">$archive_title</div>\n"; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
301 |
$res .= " <div class=\"AVBtext\">\n"; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
302 |
$res .= " $archive_description\n"; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
303 |
$res .= " </div>\n"; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
304 |
$res .= "</div>\n"; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
305 |
|
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
306 |
return $res; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
307 |
|
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
308 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
309 |
|
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
310 |
function display_archives_list($archives_list, $box_class, $url_root, $basepath, &$translate) { |
|
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
311 |
|
|
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
312 |
|
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
313 |
for($i=0;$i<count($archives_list);$i++) { |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
314 |
if(($i % 3)==0) { |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
315 |
print(" <div class=\"$box_class\">\n"); |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
316 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
317 |
$archive_ref = $archives_list[$i]; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
318 |
|
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
319 |
$archive_name = $archive_ref; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
320 |
$metadata = null; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
321 |
if(is_array($archive_ref)) { |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
322 |
$archive_name = $archive_ref[0]; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
323 |
$metadata = $archive_ref[1]; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
324 |
} |
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
325 |
print(get_archive_box($archive_name,$metadata, $url_root, $basepath, $translate)); |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
326 |
if(($i % 3)==2 || $i == (count($archives_list)-1)) { |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
327 |
print(" </div>\n"); |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
328 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
329 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
330 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
331 |
|
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
332 |