| author | Nicolas Sauret <nicolas.sauret@iri.centrepompidou.fr> |
| Wed, 27 Nov 2013 13:03:08 +0100 | |
| changeset 1003 | 366c873e2e29 |
| parent 1001 | df016fc8bbdb |
| child 1006 | bb98a0de3bfd |
| 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 |
*/ |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
16 |
date_default_timezone_set('UTC'); |
|
683
cd315f8c70e8
Put Platform URL in common.php. This allows me to access projects on local computer.
Raphael Velt <raph.velt@gmail.com>
parents:
659
diff
changeset
|
17 |
|
|
cd315f8c70e8
Put Platform URL in common.php. This allows me to access projects on local computer.
Raphael Velt <raph.velt@gmail.com>
parents:
659
diff
changeset
|
18 |
$ldt_platform = 'http://ldt.iri.centrepompidou.fr/'; |
|
cd315f8c70e8
Put Platform URL in common.php. This allows me to access projects on local computer.
Raphael Velt <raph.velt@gmail.com>
parents:
659
diff
changeset
|
19 |
$project_url_base = 'ldtplatform/ldt/cljson/id/'; |
|
cd315f8c70e8
Put Platform URL in common.php. This allows me to access projects on local computer.
Raphael Velt <raph.velt@gmail.com>
parents:
659
diff
changeset
|
20 |
|
|
1003
366c873e2e29
create edito01 + put eco-attention in archive
Nicolas Sauret <nicolas.sauret@iri.centrepompidou.fr>
parents:
1001
diff
changeset
|
21 |
$C_default_rep = 'edito-1314-01-quest-ce-quun-support'; |
|
287
3efe34a87c37
correct feedback url
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
286
diff
changeset
|
22 |
$C_feedback_form_url = 'https://spreadsheets.google.com/spreadsheet/viewform?hl=en_US&formkey=dDZILVdXVHRzd0xhWGVZXzkweHN2RGc6MQ#gid=0'; |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
23 |
$C_event_props = __DIR__ . "/event_props"; |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
24 |
$C_event_users = array('polemictweet' => 'polemictweet'.date('Y/m/d')); |
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
25 |
|
|
994
053de9a4e738
adapt for 5.3.2
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
989
diff
changeset
|
26 |
$C_openssl_cipher_iv_length = 16; //openssl_cipher_iv_length('aes256') |
|
053de9a4e738
adapt for 5.3.2
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
989
diff
changeset
|
27 |
|
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
28 |
$archives_list = array( |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
29 |
"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
|
30 |
"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
|
31 |
array("fens_FabLab_Design_Metadata","designmd"), array("mashup","conference"), array("mashup","tableronde"), |
|
330
1a77b44dfa7d
publish todai and museo
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
328
diff
changeset
|
32 |
"sig-chi-paris-2011", "rwd-meetup-patrimoine", "2011-2012-museo-ouverture"/*, "JaneMcGonigal-gameDesign"*/, |
|
604
8b18368f5706
Added Museoweb 15/05/2012
Raphael Velt <raph.velt@gmail.com>
parents:
598
diff
changeset
|
33 |
"iii-catastrophe", "edito-inaugurale", "enmi2011", "2011-2012-museo-structured-data", |
|
597
07ab28bca482
Added metadata on enmi preparatoire 2012
Raphael Velt <raph.velt@gmail.com>
parents:
595
diff
changeset
|
34 |
"edito-webdoc","edito-intelligence", "2011-2012-museo-contribution", |
| 659 | 35 |
"2011-2012-museo-ingenierie", "edito-serious-games", "enmi2012-seminaire-1", "2011-2012-museo-audiovisuel", "edito-reseaux-sociaux", |
|
825
1e01a59b9566
video for edito-arts-numeriques online
Raphael Velt <raph.velt@gmail.com>
parents:
811
diff
changeset
|
36 |
"edito-arts-numeriques", |
| 659 | 37 |
'fens2012-gamestudies', |
38 |
'fens2012-designmetadata', |
|
39 |
'fens2012-museo-culture-opendata', |
|
40 |
'fens2012-vinyl-numerique', |
|
41 |
'fens2012-edito-datajournalisme', |
|
|
770
25c156d00de6
Next event is BPI Doudou
Raphael Velt <raph.velt@gmail.com>
parents:
768
diff
changeset
|
42 |
'fens2012-wiid', |
|
938
db42d0bc2e19
Added video for Design Meta Data
Raphael Velt <raph.velt@gmail.com>
parents:
918
diff
changeset
|
43 |
'museo-1213-01-inaugurale', 'edito-1213-01-contextes', |
|
db42d0bc2e19
Added video for Design Meta Data
Raphael Velt <raph.velt@gmail.com>
parents:
918
diff
changeset
|
44 |
'museo-1213-02-vecteurs-numerique', 'edito-1213-02-collectifs-auteurs', |
|
db42d0bc2e19
Added video for Design Meta Data
Raphael Velt <raph.velt@gmail.com>
parents:
918
diff
changeset
|
45 |
"enmi12", "bpidoudou", 'museo-1213-03-techniques-humanites', 'museo-1213-04-web-ingenierie-philosophie', |
|
db42d0bc2e19
Added video for Design Meta Data
Raphael Velt <raph.velt@gmail.com>
parents:
918
diff
changeset
|
46 |
'edito-1213-04-lire-ecrire', 'eduinov-2013', |
|
db42d0bc2e19
Added video for Design Meta Data
Raphael Velt <raph.velt@gmail.com>
parents:
918
diff
changeset
|
47 |
'edito-1213-05-supports-ecriture', 'edito-1213-06-modeles-economiques', |
|
db42d0bc2e19
Added video for Design Meta Data
Raphael Velt <raph.velt@gmail.com>
parents:
918
diff
changeset
|
48 |
'museo-1213-07-quels-outils-pour-apprendre', 'edito-1213-07-lecteur-auteur-droits', |
|
1003
366c873e2e29
create edito01 + put eco-attention in archive
Nicolas Sauret <nicolas.sauret@iri.centrepompidou.fr>
parents:
1001
diff
changeset
|
49 |
'fens2013-design-metadata', 'fens2013-museo-cultural-data', 'fens2013-edito-verite-fiction', 'mediapartlive-comment-combattre-le-fn','attention-1314-01-notion-attention', |
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
50 |
); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
51 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
52 |
|
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
53 |
$configuration = array( |
|
807
877f952ae2bd
update Zend and twitter oauth end point
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
804
diff
changeset
|
54 |
'siteUrl' => 'https://api.twitter.com/oauth', |
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
55 |
'consumerKey' => '***REMOVED***', |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
56 |
'consumerSecret' => '***REMOVED***' |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
57 |
); |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
58 |
|
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
59 |
|
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
60 |
$req_rep = $C_default_rep; |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
61 |
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
|
62 |
$req_rep = $config['rep']; |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
63 |
} |
| 119 | 64 |
|
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
65 |
foreach (glob(dirname(__FILE__).'/traductions/*.php') as $trad_filename) |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
66 |
{ |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
67 |
include_once $trad_filename; |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
68 |
} |
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
69 |
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
|
70 |
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
|
71 |
} |
| 119 | 72 |
|
73 |
||
|
0
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
74 |
/** |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
75 |
* Make sure Zend_Oauth's Consumer is loaded |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
76 |
*/ |
| 119 | 77 |
require_once dirname(__FILE__).'/lib/Zend/Oauth/Consumer.php'; |
78 |
||
79 |
/** Zend_Locale */ |
|
80 |
require_once dirname(__FILE__).'/lib/Zend/Locale.php'; |
|
81 |
||
82 |
/** Zend_Translate_Adapter */ |
|
83 |
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
|
84 |
|
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
85 |
/** |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
86 |
* Start up the ol' session engine |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
87 |
*/ |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
88 |
session_start(); |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
89 |
|
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
90 |
/** |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
91 |
* 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
|
92 |
*/ |
| 119 | 93 |
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
|
94 |
|
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
95 |
|
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
96 |
$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
|
97 |
|
|
0
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
98 |
|
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
99 |
/** |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
100 |
* Setup an instance of the Consumer for use |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
101 |
*/ |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
102 |
$consumer = new Zend_Oauth_Consumer($configuration); |
| 119 | 103 |
|
104 |
/** |
|
105 |
* TRADUCTION |
|
106 |
**/ |
|
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
107 |
function get_config_translations($config) { |
|
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 |
$fr = array(); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
110 |
$en = array(); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
111 |
$jp = array(); |
|
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 |
$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
|
114 |
/** |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
115 |
* 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
|
116 |
* 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
|
117 |
*/ |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
118 |
foreach ($config as $key => $value) { |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
119 |
$translation_key = "config__$key"; |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
120 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
121 |
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
|
122 |
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
|
123 |
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
|
124 |
$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
|
125 |
} |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
126 |
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
|
127 |
$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
|
128 |
} |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
129 |
} |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
130 |
else { |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
131 |
$lang_array[$translation_key] = $value; |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
132 |
} |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
133 |
} |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
134 |
} |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
135 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
136 |
return $array_loop; |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
137 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
138 |
} |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
139 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
140 |
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
|
141 |
|
|
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); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
143 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
144 |
// 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
|
145 |
$locale = $translate->getLocale(); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
146 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
147 |
$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
|
148 |
$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
|
149 |
$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
|
150 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
151 |
// set the locale back |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
152 |
$translate->setLocale($locale); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
153 |
} |
| 119 | 154 |
|
155 |
||
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
156 |
Zend_Loader::loadClass('Zend_Translate'); |
|
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
157 |
Zend_Loader::loadClass('Zend_Http_Cookie'); |
| 119 | 158 |
|
159 |
||
160 |
$client = new Zend_Http_Client(); |
|
161 |
$translate = new Zend_Translate('array', $init, 'fr'); |
|
162 |
||
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
163 |
|
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
164 |
$translate->addTranslation($traduction_en, 'en'); |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
165 |
$translate->addTranslation($traduction_ja, 'ja_JP'); |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
166 |
$translate->addTranslation($traduction_fr, 'fr'); |
| 119 | 167 |
|
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
168 |
if(isset($config)) { |
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
169 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
170 |
set_config_translations($config, $translate); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
171 |
// $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
|
172 |
|
|
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
173 |
|
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
174 |
// $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
|
175 |
// $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
|
176 |
// $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
|
177 |
} |
|
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
178 |
|
| 119 | 179 |
$actual = $translate->getLocale(); |
180 |
||
181 |
//$translate->setLocale("en"); |
|
182 |
// $acceptCookie = $this->_request->getCookie('acceptCookie',0); |
|
183 |
||
184 |
if(isset($_GET['lang'])==false and isset($_SESSION['lang'])==false){ |
|
185 |
||
186 |
if($actual!='fr' and $actual!='en' and $actual!='ja_JP'){ |
|
187 |
$translate->setLocale("fr"); |
|
188 |
$_SESSION['lang']="fr"; |
|
189 |
} |
|
190 |
||
191 |
} else if (isset($_GET['lang'])==true){ |
|
192 |
$translate->setLocale($_GET['lang']); |
|
193 |
$_SESSION['lang'] = $_GET['lang']; |
|
194 |
$actual = $_SESSION['lang']; |
|
195 |
||
196 |
} else if (isset($_SESSION['lang'])==true){ |
|
197 |
$translate->setLocale( $_SESSION['lang']); |
|
198 |
$actual = $_SESSION['lang']; |
|
199 |
||
200 |
} |
|
201 |
||
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
202 |
$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
|
203 |
'local' => array( |
|
534
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
204 |
'libdir' => URL_ROOT.'res/js/', |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
205 |
'jquery' => URL_ROOT.'res/js/jquery-1.10.2.min.js', |
|
598
d366aa22bd79
New Metadataplayer version
Raphael Velt <raph.velt@gmail.com>
parents:
597
diff
changeset
|
206 |
'raphael' => URL_ROOT.'res/js/raphael-min.js', |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
207 |
'jquery-ui' => URL_ROOT.'res/js/jquery-ui.min.js', |
|
534
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
208 |
'niceforms' => URL_ROOT.'res/js/niceforms.js', |
|
259
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
209 |
'jquery-url' => URL_ROOT.'res/js/jquery.url.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
210 |
'ldtplayer' => URL_ROOT.'res/metadataplayer/src/js/LdtPlayer.js', |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
211 |
'fancybox' => URL_ROOT.'res/js/fancybox/jquery.fancybox.pack.js', |
|
534
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
212 |
'jquery-tools' => URL_ROOT.'res/js/jquery.tools.min.js', |
|
989
e4e219f7b12c
add example link + upgrade jquery tools
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
988
diff
changeset
|
213 |
'jquery-migrate' => URL_ROOT.'res/js/jquery-migrate-1.2.1.min.js', |
|
259
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
214 |
'tw-widget' => URL_ROOT.'res/js/tw_widget.js', |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
215 |
'jquery-mousewheel' => URL_ROOT.'res/js/jquery.mousewheel.js', |
|
534
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
216 |
'swfobject' => URL_ROOT.'res/js/swfobject.js', |
|
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
217 |
'json-js' => URL_ROOT.'res/js/json2.js', |
|
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
218 |
'underscore' => URL_ROOT.'res/js/underscore-min.js' , |
|
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
219 |
'jquery-scrollto'=>URL_ROOT.'res/js/jquery.scrollTo-1.4.2-min.js' , |
|
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
220 |
'twcx-main' => URL_ROOT.'res/js/live-polemic.js' , |
|
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
221 |
'semanticboard' => URL_ROOT.'res/js/semanticboard.js' , |
|
598
d366aa22bd79
New Metadataplayer version
Raphael Velt <raph.velt@gmail.com>
parents:
597
diff
changeset
|
222 |
'metadataplayer'=> URL_ROOT.'res/metadataplayer/LdtPlayer-core.js' , |
|
d366aa22bd79
New Metadataplayer version
Raphael Velt <raph.velt@gmail.com>
parents:
597
diff
changeset
|
223 |
'ldtwidgets' => URL_ROOT.'res/metadataplayer/' , |
|
656
635a86f25fe7
First tests for PT Protocol implementation
Raphael Velt <raph.velt@gmail.com>
parents:
633
diff
changeset
|
224 |
'tracemanager' => URL_ROOT.'res/js/tracemanager.js' , |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
225 |
'jwplayer-js' => URL_ROOT.'res/js/jwplayer.js', |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
226 |
'jquery-te' => URL_ROOT.'res/js/jquery-te-1.4.0.min.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
|
227 |
), |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
228 |
'cdn' => array( |
|
534
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
229 |
'libdir' => URL_ROOT.'res/js/', |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
230 |
'jquery' => 'http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', |
|
598
d366aa22bd79
New Metadataplayer version
Raphael Velt <raph.velt@gmail.com>
parents:
597
diff
changeset
|
231 |
'raphael' => URL_ROOT.'res/js/raphael-min.js', |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
232 |
'jquery-ui' => 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js', |
|
534
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
233 |
'niceforms' => URL_ROOT.'res/js/niceforms.js', |
|
259
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
234 |
'jquery-url' => URL_ROOT.'res/js/jquery.url.js', |
|
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
235 |
'ldtplayer' => URL_ROOT.'res/metadataplayer/src/js/LdtPlayer.js', |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
236 |
'fancybox' => URL_ROOT.'res/js/fancybox/jquery.fancybox.pack.js', |
|
989
e4e219f7b12c
add example link + upgrade jquery tools
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
988
diff
changeset
|
237 |
'jquery-tools' => 'http://cdn.jquerytools.org/1.2.7/all/jquery.tools.min.js', |
|
e4e219f7b12c
add example link + upgrade jquery tools
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
988
diff
changeset
|
238 |
'jquery-migrate' => 'http://code.jquery.com/jquery-migrate-1.2.1.min.js', |
|
259
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
239 |
'tw-widget' => 'http://widgets.twimg.com/j/2/widget.js', |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
240 |
'jquery-mousewheel' => URL_ROOT.'res/js/jquery.mousewheel.js', |
|
259
bc17d1af15ab
stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
258
diff
changeset
|
241 |
'swfobject' => 'http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js', |
|
534
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
242 |
'json-js' => URL_ROOT.'res/js/json2.js', |
|
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
243 |
'underscore' => URL_ROOT.'res/js/underscore-min.js' , |
|
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
244 |
'jquery-scrollto'=>URL_ROOT.'res/js/jquery.scrollTo-1.4.2-min.js' , |
|
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
245 |
'twcx-main' => URL_ROOT.'res/js/live-polemic.js' , |
|
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
246 |
'semanticboard' => URL_ROOT.'res/js/semanticboard.js' , |
|
598
d366aa22bd79
New Metadataplayer version
Raphael Velt <raph.velt@gmail.com>
parents:
597
diff
changeset
|
247 |
'metadataplayer'=> URL_ROOT.'res/metadataplayer/LdtPlayer-core.js' , |
|
d366aa22bd79
New Metadataplayer version
Raphael Velt <raph.velt@gmail.com>
parents:
597
diff
changeset
|
248 |
'ldtwidgets' => URL_ROOT.'res/metadataplayer/' , |
|
656
635a86f25fe7
First tests for PT Protocol implementation
Raphael Velt <raph.velt@gmail.com>
parents:
633
diff
changeset
|
249 |
'tracemanager' => URL_ROOT.'res/js/tracemanager.js' , |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
250 |
'jwplayer-js' => URL_ROOT.'res/js/jwplayer.js', |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
251 |
'jquery-te' => URL_ROOT.'res/js/jquery-te-1.4.0.min.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
|
252 |
) |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
253 |
); |
|
143
2a3599a4b0f7
add #enmi page and some litlle corrections
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
119
diff
changeset
|
254 |
|
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
255 |
$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
|
256 |
'local' => array( |
| 713 | 257 |
'PT-Sans_Narrow' => URL_ROOT.'res/fonts/PTSansNarrow.css', |
258 |
'PT-Sans' => URL_ROOT.'res/fonts/PTSans.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
|
259 |
), |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
260 |
'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
|
261 |
'PT-Sans_Narrow' => 'http://fonts.googleapis.com/css?family=PT+Sans+Narrow&subset=latin', |
|
536
5dd170a735e9
new embed and share buttons
Raphael Velt <raph.velt@gmail.com>
parents:
534
diff
changeset
|
262 |
'PT-Sans' => 'http://fonts.googleapis.com/css?family=PT+Sans&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
|
263 |
) |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
264 |
); |
|
216
d8c1b7e00533
sig chi paris 2011
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
207
diff
changeset
|
265 |
|
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
266 |
|
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
267 |
$css_registry = array( |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
268 |
'local' => array( |
|
534
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
269 |
'blueprint-screen' => URL_ROOT.'res/css/blueprint-screen.css', |
|
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
270 |
'blueprint-print' => URL_ROOT.'res/css/blueprint-print.css', |
|
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
271 |
'blueprint-ie' => URL_ROOT.'res/css/blueprint-ie.css', |
|
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
272 |
'blueprint-plugins-fancy-type' => URL_ROOT.'res/css/blueprint-plugins/fancy-type/screen.css', |
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
273 |
'custom' => URL_ROOT.'res/css/custom.css', |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
274 |
'fancybox' => URL_ROOT.'res/js/fancybox/jquery.fancybox.css', |
|
240
ee6305b4a7dc
correct registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
235
diff
changeset
|
275 |
'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
|
276 |
'tabs-slideshow' => URL_ROOT.'res/css/tabs-slideshow.css', |
|
469
99d105834315
Semantic board est maintenant dans les répertoires projets
Raphael Velt <raph.velt@gmail.com>
parents:
420
diff
changeset
|
277 |
'tweetcast' => URL_ROOT.'res/css/tweetcast.css', |
|
99d105834315
Semantic board est maintenant dans les répertoires projets
Raphael Velt <raph.velt@gmail.com>
parents:
420
diff
changeset
|
278 |
'semanticboard' => URL_ROOT.'res/css/semanticboard.css', |
|
495
34f92d5b2acf
Added an archive embed for the IRI homepage
Raphael Velt <raph.velt@gmail.com>
parents:
491
diff
changeset
|
279 |
'archives-iframe' => URL_ROOT.'res/css/archives-iframe.css', |
|
598
d366aa22bd79
New Metadataplayer version
Raphael Velt <raph.velt@gmail.com>
parents:
597
diff
changeset
|
280 |
'metadataplayer' => URL_ROOT.'res/metadataplayer/LdtPlayer-core.css', |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
281 |
'jquery-te' => URL_ROOT.'res/css/jquery-te.css', |
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
282 |
), |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
283 |
'cdn' => array( |
|
534
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
284 |
'blueprint-screen' => URL_ROOT.'res/css/blueprint-screen.css', |
|
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
285 |
'blueprint-print' => URL_ROOT.'res/css/blueprint-print.css', |
|
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
286 |
'blueprint-ie' => URL_ROOT.'res/css/blueprint-ie.css', |
|
0a2505c3b547
New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents:
525
diff
changeset
|
287 |
'blueprint-plugins-fancy-type' => URL_ROOT.'res/css/blueprint-plugins/fancy-type/screen.css', |
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
288 |
'custom' => URL_ROOT.'res/css/custom.css', |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
289 |
'fancybox' => URL_ROOT.'res/js/fancybox/jquery.fancybox.css', |
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
290 |
'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
|
291 |
'tabs-slideshow' => URL_ROOT.'res/css/tabs-slideshow.css', |
|
469
99d105834315
Semantic board est maintenant dans les répertoires projets
Raphael Velt <raph.velt@gmail.com>
parents:
420
diff
changeset
|
292 |
'tweetcast' => URL_ROOT.'res/css/tweetcast.css', |
|
99d105834315
Semantic board est maintenant dans les répertoires projets
Raphael Velt <raph.velt@gmail.com>
parents:
420
diff
changeset
|
293 |
'semanticboard' => URL_ROOT.'res/css/semanticboard.css', |
|
495
34f92d5b2acf
Added an archive embed for the IRI homepage
Raphael Velt <raph.velt@gmail.com>
parents:
491
diff
changeset
|
294 |
'archives-iframe' => URL_ROOT.'res/css/archives-iframe.css', |
|
598
d366aa22bd79
New Metadataplayer version
Raphael Velt <raph.velt@gmail.com>
parents:
597
diff
changeset
|
295 |
'metadataplayer' => URL_ROOT.'res/metadataplayer/LdtPlayer-core.css', |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
296 |
'jquery-te' => URL_ROOT.'res/css/jquery-te.css', |
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
297 |
) |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
298 |
); |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
299 |
|
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
300 |
|
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
301 |
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
|
302 |
|
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
303 |
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
|
304 |
|
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
305 |
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
|
306 |
$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
|
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 |
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
|
309 |
$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
|
310 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
311 |
else { |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
312 |
$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
|
313 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
314 |
$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
|
315 |
return ${ |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
316 |
$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
|
317 |
|
|
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 |
|
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
320 |
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
|
321 |
|
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
322 |
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
|
323 |
|
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
324 |
set_config_translations($config, $translate); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
325 |
/* $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
|
326 |
|
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
327 |
// 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
|
328 |
$locale = $translate->getLocale(); |
|
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
329 |
|
|
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
330 |
$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
|
331 |
$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
|
332 |
$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
|
333 |
|
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
334 |
// set the locale back |
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
335 |
$translate->setLocale($locale); |
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
336 |
*/ |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
337 |
$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
|
338 |
$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
|
339 |
$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
|
340 |
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
|
341 |
$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
|
342 |
} |
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
343 |
$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
|
344 |
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
|
345 |
$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
|
346 |
} |
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
347 |
$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
|
348 |
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
|
349 |
$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
|
350 |
} |
| 119 | 351 |
|
352 |
||
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
353 |
$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
|
354 |
$res .= " <a href=\"$rep/polemicaltimeline.php$hash\">\n"; |
|
989
e4e219f7b12c
add example link + upgrade jquery tools
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
988
diff
changeset
|
355 |
$res .= " <img src=\"$url_root$rep/$tail_img\" width=\"270\" height=\"150\" class=\"AVBimg\" />"; |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
356 |
$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
|
357 |
$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
|
358 |
$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
|
359 |
$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
|
360 |
$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
|
361 |
$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
|
362 |
|
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
363 |
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
|
364 |
|
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
365 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
366 |
|
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
367 |
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
|
368 |
|
|
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
369 |
|
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
370 |
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
|
371 |
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
|
372 |
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
|
373 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
374 |
$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
|
375 |
|
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
376 |
$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
|
377 |
$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
|
378 |
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
|
379 |
$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
|
380 |
$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
|
381 |
} |
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
382 |
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
|
383 |
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
|
384 |
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
|
385 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
386 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
387 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
388 |
|
|
684
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
389 |
function get_metadata_url($metadata) { |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
390 |
global $ldt_platform, $project_url_base; |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
391 |
if (preg_match('/^https?:\/\//', $metadata)) { |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
392 |
return $metadata; |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
393 |
} else { |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
394 |
return $ldt_platform.$project_url_base.$metadata; |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
395 |
} |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
396 |
} |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
397 |
|
|
684
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
398 |
function get_metadata_json_url($metadata) { |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
399 |
if (is_array($metadata)) { |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
400 |
$metadata["url"] = get_metadata_url($metadata["url"]); |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
401 |
return $metadata; |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
402 |
} else { |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
403 |
return get_metadata_url($metadata); |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
404 |
} |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
405 |
} |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
406 |
|
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
407 |
|
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
408 |
$realm = 'Polemictweet restricted area'; |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
409 |
|
|
1001
df016fc8bbdb
correct authentication and put the login/password in the config template.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
994
diff
changeset
|
410 |
/*function authenticate($users, $translate) { |
|
df016fc8bbdb
correct authentication and put the login/password in the config template.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
994
diff
changeset
|
411 |
if (!isset($_SESSION['user_id'])) |
|
df016fc8bbdb
correct authentication and put the login/password in the config template.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
994
diff
changeset
|
412 |
{ |
|
df016fc8bbdb
correct authentication and put the login/password in the config template.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
994
diff
changeset
|
413 |
// Fetch current URL |
|
df016fc8bbdb
correct authentication and put the login/password in the config template.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
994
diff
changeset
|
414 |
$this_url = $_SERVER['REQUEST_URI']; |
|
df016fc8bbdb
correct authentication and put the login/password in the config template.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
994
diff
changeset
|
415 |
|
|
df016fc8bbdb
correct authentication and put the login/password in the config template.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
994
diff
changeset
|
416 |
// Redirect to login page passing current URL |
|
df016fc8bbdb
correct authentication and put the login/password in the config template.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
994
diff
changeset
|
417 |
header('Location: login.php?return_url=' . urlencode($this_url)); |
|
df016fc8bbdb
correct authentication and put the login/password in the config template.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
994
diff
changeset
|
418 |
exit; |
|
df016fc8bbdb
correct authentication and put the login/password in the config template.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
994
diff
changeset
|
419 |
} |
|
df016fc8bbdb
correct authentication and put the login/password in the config template.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
994
diff
changeset
|
420 |
}*/ |
|
df016fc8bbdb
correct authentication and put the login/password in the config template.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
994
diff
changeset
|
421 |
|
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
422 |
function authenticate($users, $translate) { |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
423 |
|
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
424 |
global $realm; |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
425 |
|
|
1001
df016fc8bbdb
correct authentication and put the login/password in the config template.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
994
diff
changeset
|
426 |
|
|
df016fc8bbdb
correct authentication and put the login/password in the config template.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
994
diff
changeset
|
427 |
if (empty($_SERVER['PHP_AUTH_DIGEST']) || !isset($_SESSION['http_digest_nonce'])) { |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
428 |
$_SESSION['http_digest_nonce'] = uniqid(); |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
429 |
header('HTTP/1.1 401 Unauthorized'); |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
430 |
header('WWW-Authenticate: Digest realm="'.$realm. |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
431 |
'",qop="auth",nonce="'.$_SESSION['http_digest_nonce'].'",opaque="'.md5($realm).'"'); |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
432 |
return array('error' => $translate->_('This area is restricted, please authenticate')); |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
433 |
} |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
434 |
|
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
435 |
|
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
436 |
//analyze the PHP_AUTH_DIGEST variable |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
437 |
if (!($data = http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) || |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
438 |
!isset($users[$data['username']])) { |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
439 |
$_SERVER['PHP_AUTH_DIGEST'] = ''; |
|
1001
df016fc8bbdb
correct authentication and put the login/password in the config template.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
994
diff
changeset
|
440 |
unset($_SESSION['auth']); |
|
df016fc8bbdb
correct authentication and put the login/password in the config template.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
994
diff
changeset
|
441 |
unset($_SESSION['http_digest_nonce']); |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
442 |
return array('error' => $translate->_('Wrong Credentials!')); |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
443 |
} |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
444 |
|
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
445 |
|
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
446 |
//generate the valid response |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
447 |
$A1 = md5($data['username'] . ':' . $realm . ':' . $users[$data['username']]); |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
448 |
$A2 = md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']); |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
449 |
$valid_response = md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2); |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
450 |
|
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
451 |
if ($data['response'] != $valid_response) { |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
452 |
$_SERVER['PHP_AUTH_DIGEST'] = ''; |
|
1001
df016fc8bbdb
correct authentication and put the login/password in the config template.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
994
diff
changeset
|
453 |
unset($_SESSION['http_digest_nonce']); |
|
df016fc8bbdb
correct authentication and put the login/password in the config template.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
994
diff
changeset
|
454 |
unset($_SESSION['auth']); |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
455 |
return array('error' => $translate->_('Wrong Credentials!')); |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
456 |
} |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
457 |
|
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
458 |
// ok, valid username & password |
|
1001
df016fc8bbdb
correct authentication and put the login/password in the config template.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
994
diff
changeset
|
459 |
$_SESSION['auth'] = $data['username']; |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
460 |
return $data; |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
461 |
} |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
462 |
|
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
463 |
function logout() { |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
464 |
global $realm; |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
465 |
|
|
1001
df016fc8bbdb
correct authentication and put the login/password in the config template.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
994
diff
changeset
|
466 |
unset($_SESSION['auth']); |
|
df016fc8bbdb
correct authentication and put the login/password in the config template.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
994
diff
changeset
|
467 |
unset($_SESSION['http_digest_nonce']); |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
468 |
} |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
469 |
|
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
470 |
|
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
471 |
//function to parse the http auth header |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
472 |
function http_digest_parse($txt) |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
473 |
{ |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
474 |
// protect against missing data |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
475 |
$needed_parts = array('nonce'=>1, 'nc'=>1, 'cnonce'=>1, 'qop'=>1, 'username'=>1, 'uri'=>1, 'response'=>1); |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
476 |
$data = array(); |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
477 |
$keys = implode('|', array_keys($needed_parts)); |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
478 |
|
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
479 |
preg_match_all('@(' . $keys . ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@', $txt, $matches, PREG_SET_ORDER); |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
480 |
|
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
481 |
foreach ($matches as $m) { |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
482 |
$data[$m[1]] = $m[3] ? $m[3] : $m[4]; |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
483 |
unset($needed_parts[$m[1]]); |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
484 |
} |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
485 |
|
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
486 |
return $needed_parts ? false : $data; |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
487 |
} |