| author | ymh <ymh.work@gmail.com> |
| Thu, 07 Nov 2024 22:38:14 +0100 | |
| changeset 1571 | 4a1e6952afe5 |
| parent 1558 | 761ba7426984 |
| child 1575 | ce1d5b0d1479 |
| 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 |
|
|
1427
8b3d57a519eb
remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents:
1425
diff
changeset
|
3 |
// composer autoload files |
|
8b3d57a519eb
remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents:
1425
diff
changeset
|
4 |
require __DIR__ . '/vendor/autoload.php'; |
|
8b3d57a519eb
remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents:
1425
diff
changeset
|
5 |
|
|
8b3d57a519eb
remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents:
1425
diff
changeset
|
6 |
use Abraham\TwitterOAuth\TwitterOAuth; |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
7 |
use GuzzleHttp\Client; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
8 |
use GuzzleHttp\Psr7\URI; |
|
0
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
9 |
|
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
10 |
/** |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
11 |
* Base configuration |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
12 |
*/ |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
13 |
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
|
14 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
15 |
$MASTODON_DEFAULT_GROUP_DOMAIN = 'a.gup.pe'; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
16 |
|
|
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 |
$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
|
18 |
|
| 1571 | 19 |
$C_default_rep = 'enmi24'; |
|
287
3efe34a87c37
correct feedback url
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
286
diff
changeset
|
20 |
$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
|
21 |
$C_event_props = __DIR__ . "/event_props"; |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
22 |
$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
|
23 |
|
|
994
053de9a4e738
adapt for 5.3.2
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
989
diff
changeset
|
24 |
$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
|
25 |
|
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
26 |
$archives_list = array( |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
27 |
"rsln", "rsln-opendata", "rsln-mercedes-bunz", |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
28 |
"enmi2011-technologie-confiance", "CPV", array("fens_FabLab_Design_Metadata", "fablab"), |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
29 |
array("fens_FabLab_Design_Metadata", "designmd"), array("mashup", "conference"), array("mashup", "tableronde"), |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
30 |
"sig-chi-paris-2011", "rwd-meetup-patrimoine", "2011-2012-museo-ouverture"/*, "JaneMcGonigal-gameDesign"*/, |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
31 |
"iii-catastrophe", "edito-inaugurale", "enmi2011", "2011-2012-museo-structured-data", |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
32 |
"edito-webdoc", "edito-intelligence", "2011-2012-museo-contribution", |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
33 |
"2011-2012-museo-ingenierie", "edito-serious-games", "enmi2012-seminaire-1", "2011-2012-museo-audiovisuel", "edito-reseaux-sociaux", |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
34 |
"edito-arts-numeriques", |
| 659 | 35 |
'fens2012-gamestudies', |
36 |
'fens2012-designmetadata', |
|
37 |
'fens2012-museo-culture-opendata', |
|
38 |
'fens2012-vinyl-numerique', |
|
39 |
'fens2012-edito-datajournalisme', |
|
|
770
25c156d00de6
Next event is BPI Doudou
Raphael Velt <raph.velt@gmail.com>
parents:
768
diff
changeset
|
40 |
'fens2012-wiid', |
|
938
db42d0bc2e19
Added video for Design Meta Data
Raphael Velt <raph.velt@gmail.com>
parents:
918
diff
changeset
|
41 |
'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
|
42 |
'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
|
43 |
"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
|
44 |
'edito-1213-04-lire-ecrire', 'eduinov-2013', |
|
db42d0bc2e19
Added video for Design Meta Data
Raphael Velt <raph.velt@gmail.com>
parents:
918
diff
changeset
|
45 |
'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
|
46 |
'museo-1213-07-quels-outils-pour-apprendre', 'edito-1213-07-lecteur-auteur-droits', |
|
1055
e5e01f4dfb3f
add body-image-media event
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1053
diff
changeset
|
47 |
'fens2013-design-metadata', |
|
1038
c1597d3fe210
add museo 2014-01
Thibaut Cavalié <thibaut.cavalie@iri.centrepompidou.fr>
parents:
1033
diff
changeset
|
48 |
'fens2013-museo-cultural-data', |
|
c1597d3fe210
add museo 2014-01
Thibaut Cavalié <thibaut.cavalie@iri.centrepompidou.fr>
parents:
1033
diff
changeset
|
49 |
'fens2013-edito-verite-fiction', |
|
c1597d3fe210
add museo 2014-01
Thibaut Cavalié <thibaut.cavalie@iri.centrepompidou.fr>
parents:
1033
diff
changeset
|
50 |
'mediapartlive-comment-combattre-le-fn', |
|
c1597d3fe210
add museo 2014-01
Thibaut Cavalié <thibaut.cavalie@iri.centrepompidou.fr>
parents:
1033
diff
changeset
|
51 |
'attention-1314-01-notion-attention', |
|
c1597d3fe210
add museo 2014-01
Thibaut Cavalié <thibaut.cavalie@iri.centrepompidou.fr>
parents:
1033
diff
changeset
|
52 |
'attention-1314-02-syndrome-saturation-cognitive', |
|
c1597d3fe210
add museo 2014-01
Thibaut Cavalié <thibaut.cavalie@iri.centrepompidou.fr>
parents:
1033
diff
changeset
|
53 |
'edito-1314-01-quest-ce-quun-support', |
|
1057
c1a821eb190d
Attention#3 & Edito#2 in archive
Nicolas Sauret <nicolas.sauret@iri.centrepompidou.fr>
parents:
1055
diff
changeset
|
54 |
'enmi13', 'museo-1314-03-cognition-apprentissage', 'attention-1314-03-nouvelle-valeur-economique', |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
55 |
'edito-1314-02-lannotation-le-savoir-dans-la-marge', 'museo-1314-04-lecture-active', 'edito-1314-03-traduction', 'attention-1314-04-pathologies-attention-memoire', 'edito-1314-04-environnement-support', 'attention-1314-05-marche-attention-avenement-publicite', 'museo-1314-05-nouvelles-editions', 'edito-1314-05-algorithme', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
56 |
'fens2014-design-metadata', 'fens2014-museo', 'fens2014-transmediamix', 'fens2014-edito', 'fens2014-attention', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
57 |
'pour-la-transition-une-conomie-du-partage-de-la-connaissance-et-des-biens-communs', 'spel-01-gout-archivage', 'edito-1415-01-hybridation-pratiques-recherche', |
|
1184
308968a48dc8
add design attention to archive
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1182
diff
changeset
|
58 |
'museo-1415-01-inaugurale', 'museo-1415-02-controverses', 'attention-1415-01-attention-automatisee', |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
59 |
'museo-1415-03-pedagogies', 'museo-1415-04-reseaux-sociaux-hermeneutiques', 'edito-1415-02-ressources-documentation-recherche', 'enmi14', |
|
1211
b9f98dab8386
update libs + unpublish museo
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1209
diff
changeset
|
60 |
'attention-1415-02-recherche-algo-attention-hermeneutique', 'edito-1415-04-elargissement-communautes-scientifiques', /*'museo-1415-05-interfaces-design',*/ |
|
1272
82fe5cb3b55a
publish edito + attention
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1270
diff
changeset
|
61 |
'museo-1415-06-multilinguisme', 'museo-1415-07-traduction', 'attention-1415-05-reseaux-sociaux-valorisation', |
|
1288
1763d0a21003
museo 06/16 + attention 06/17 publications
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1285
diff
changeset
|
62 |
'attention-1415-06-game-design', 'edito-1415-05-faire-oeuvre-epoque-numerique', 'museo-1415-08-histoire-critique', |
|
1319
b92490ef8f9c
continuation pub edito 15/16 4
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1315
diff
changeset
|
63 |
'attention-1415-07-design-pluralisation', 'edito-1516-01-profil-collectif', 'edito-1516-02-corps-profil', 'enmi15', 'edito-1516-03-editorialisation-universitaire', |
|
1341
97038e1a13a3
publish edito 15/16 7
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1339
diff
changeset
|
64 |
'edito-1516-04-detournements-creation', 'edito-1516-05-production-reel', 'edito-1516-06-confession-confiscation-de-soi', |
|
1390
03e71226531e
add cnsad to archive
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1382
diff
changeset
|
65 |
'edito-1516-07-architecture-savoir', 'edito-1516-08-desir-profilage', 'edito-1516-09-cloture', 'journee-omnsh-2016-10-patrimoine-numerique', 'enmi16', |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
66 |
'cnsad-ateliers-2017', 'crypto-party-camp-rouxteur-10-2017', 'cnsad-seminaire-telepresence-11-2017', 'enmi17', /*'enmi18-preparatoire',*/ 'marathon-serpentine-2018', 'enmi18', 'enmi19-preparatoire', 'enmi19', |
| 1555 | 67 |
'enmi20', 'enmi21', |
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
68 |
); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
69 |
|
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
70 |
$req_rep = $C_default_rep; |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
71 |
if (isset($config) && isset($config['rep'])) { |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
72 |
$req_rep = $config['rep']; |
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
73 |
} |
| 119 | 74 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
75 |
foreach (glob(dirname(__FILE__) . '/traductions/*.php') as $trad_filename) { |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
76 |
include_once $trad_filename; |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
77 |
} |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
78 |
if (file_exists(dirname(__FILE__) . "/$req_rep/traduction.php")) { |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
79 |
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
|
80 |
} |
| 119 | 81 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
82 |
$appCacheHandle = new SQLite3(dirname(__FILE__) . "/data/app_cache.db"); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
83 |
$appCacheHandle->query("CREATE TABLE IF NOT EXISTS apps (id INTEGER PRIMARY KEY, domain TEXT NOT NULL, event TEXT NOT NULL, client_id TEXT UNIQUE NOT NULL, client_secret TEXT NOT NULL, UNIQUE(domain, event))"); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
84 |
|
| 1557 | 85 |
|
86 |
||
| 119 | 87 |
|
|
0
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
88 |
/** |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
89 |
* Start up the ol' session engine |
|
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 |
session_start(); |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
92 |
|
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
93 |
/** |
|
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
94 |
* 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
|
95 |
*/ |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
96 |
include_once dirname(__FILE__) . '/config.php'; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
97 |
|
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
98 |
function get_cached_app_ids($login_domain, $req_rep, $appCacheHandle) { |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
99 |
|
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
100 |
$statement = $appCacheHandle->prepare('SELECT * FROM apps WHERE domain = :domain and event = :event;'); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
101 |
$statement->bindValue(':domain', $login_domain); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
102 |
$statement->bindValue(':event', $req_rep); |
|
1198
ff4b567d51f2
upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1196
diff
changeset
|
103 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
104 |
$result = $statement->execute(); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
105 |
$client_id = false; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
106 |
$client_secret = false; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
107 |
if ($row = $result->fetchArray()) { |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
108 |
$client_id = $row["client_id"]; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
109 |
$client_secret = $row["client_secret"]; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
110 |
} |
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
111 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
112 |
return [ "client_id" => $client_id, "client_secret" => $client_secret]; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
113 |
} |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
114 |
|
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
115 |
$get_social_request_token = function ($login_domain, $config) use ($req_rep, $appCacheHandle) { |
| 1557 | 116 |
|
117 |
$socialNetwork = $config['social_network']; |
|
118 |
||
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
119 |
if ($socialNetwork == "Twitter") { |
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
120 |
|
| 1557 | 121 |
$twitterClient = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET); |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
122 |
$token = $twitterClient->oauth('oauth/request_token', array('oauth_callback' => URL_ROOT . "callback.php?rep=$req_rep")); |
| 1557 | 123 |
|
124 |
$_SESSION['TWITTER_REQUEST_TOKEN'] = serialize($token); |
|
|
1427
8b3d57a519eb
remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents:
1425
diff
changeset
|
125 |
|
| 1557 | 126 |
/** |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
127 |
* Now redirect user to Twitter site so they can log in and |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
128 |
* approve our access |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
129 |
*/ |
|
0
4eba9c11703f
first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff
changeset
|
130 |
|
| 1557 | 131 |
$url = $twitterClient->url('oauth/authorize', array('oauth_token' => $token['oauth_token'])); |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
132 |
} else if ($socialNetwork == "Mastodon") { |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
133 |
|
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
134 |
$_SESSION['SOCIAL_LOGIN_DOMAIN'] = $login_domain; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
135 |
|
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
136 |
$base_uri = "https://$login_domain"; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
137 |
$client = new Client([ |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
138 |
'base_uri' => $base_uri, |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
139 |
'timeout' => 2.0, |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
140 |
]); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
141 |
|
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
142 |
$client_ids = get_cached_app_ids($login_domain, $req_rep, $appCacheHandle); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
143 |
$client_id = $client_ids["client_id"]; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
144 |
$client_secret = $client_ids["client_secret"]; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
145 |
|
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
146 |
if(!$client_id || !$client_secret) { |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
147 |
// Create app |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
148 |
$resp = $client->post('/api/v1/apps', ['form_params' => [ |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
149 |
"client_name" => "PolemicToot-$req_rep", |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
150 |
"redirect_uris" => URL_ROOT . "callback.php?rep=$req_rep", |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
151 |
"scopes" => 'read write push' |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
152 |
]]); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
153 |
$appsDef = json_decode($resp->getBody()); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
154 |
//var_dump($appsDef); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
155 |
$client_id = $appsDef->client_id; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
156 |
$client_secret = $appsDef->client_secret; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
157 |
$appCacheHandle->exec("INSERT INTO apps (domain, event, client_id, client_secret) VALUES ('$login_domain', '$req_rep', '$client_id', '$client_secret')"); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
158 |
} |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
159 |
|
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
160 |
$state = bin2hex(random_bytes(12)); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
161 |
|
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
162 |
$_SESSION['SOCIAL_AUTH_STATE'] = $state; |
| 1557 | 163 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
164 |
$uri = URI::withQueryValues(URI::fromParts([ |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
165 |
'scheme' => 'https', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
166 |
'host' => $login_domain, |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
167 |
'path' => '/oauth/authorize' |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
168 |
]), [ |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
169 |
"response_type" => "code", |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
170 |
"client_id" => "$client_id", |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
171 |
"redirect_uri" => URL_ROOT . "callback.php?rep=$req_rep", |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
172 |
"scope" => 'read write push', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
173 |
"state" => $state |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
174 |
]); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
175 |
|
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
176 |
$url = (string)$uri; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
177 |
} |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
178 |
header("Location: " . $url); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
179 |
die(); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
180 |
}; |
| 1557 | 181 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
182 |
function setGroupMastodon($config, $default_domain) { |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
183 |
if(strtolower(($config['social_network'] ?? 'Twitter')) === "twitter" ) { |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
184 |
return $config; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
185 |
} |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
186 |
$group = '@'. ltrim($config['group'] ?? $config['hashtag'], '@'); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
187 |
|
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
188 |
if(!preg_match("/.+@.+$/", $group)) { |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
189 |
$group = $group . "@" . $default_domain; |
| 1557 | 190 |
} |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
191 |
|
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
192 |
$res = $config; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
193 |
$res['group'] = $group; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
194 |
|
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
195 |
return $res; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
196 |
} |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
197 |
|
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
198 |
|
| 119 | 199 |
|
200 |
/** |
|
201 |
* TRADUCTION |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
202 |
**/ |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
203 |
function get_config_translations($config) |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
204 |
{ |
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
205 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
206 |
$fr = array(); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
207 |
$en = array(); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
208 |
$jp = array(); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
209 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
210 |
$array_loop = array("fr" => &$fr, "en" => &$en, "jp" => &$jp); |
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
211 |
/** |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
212 |
* 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
|
213 |
* 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
|
214 |
*/ |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
215 |
foreach ($config as $key => $value) { |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
216 |
$translation_key = "config__$key"; |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
217 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
218 |
foreach ($array_loop as $lang => &$lang_array) { |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
219 |
if (is_array($value) && count(array_intersect_key($value, $array_loop)) > 0) { |
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
220 |
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
|
221 |
$lang_array[$translation_key] = $value[$lang]; |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
222 |
} elseif (array_key_exists('fr', $value)) { |
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
223 |
$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
|
224 |
} |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
225 |
} else { |
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
226 |
$lang_array[$translation_key] = $value; |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
227 |
} |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
228 |
} |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
229 |
} |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
230 |
|
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
231 |
return $array_loop; |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
232 |
} |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
233 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
234 |
function set_config_translations(&$config, &$translate) |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
235 |
{ |
|
1198
ff4b567d51f2
upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1196
diff
changeset
|
236 |
|
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
237 |
$config_translations = get_config_translations($config); |
|
1198
ff4b567d51f2
upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1196
diff
changeset
|
238 |
|
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
239 |
// 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
|
240 |
$locale = $translate->getLocale(); |
|
1198
ff4b567d51f2
upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1196
diff
changeset
|
241 |
|
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
242 |
$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
|
243 |
$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
|
244 |
$translate->addTranslation($config_translations['fr'], 'fr'); |
|
1198
ff4b567d51f2
upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1196
diff
changeset
|
245 |
|
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
246 |
// set the locale back |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
247 |
$translate->setLocale($locale); |
|
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
248 |
} |
| 119 | 249 |
|
250 |
||
|
1427
8b3d57a519eb
remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents:
1425
diff
changeset
|
251 |
// use Translator; |
|
8b3d57a519eb
remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents:
1425
diff
changeset
|
252 |
include './Translator.php'; |
|
8b3d57a519eb
remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents:
1425
diff
changeset
|
253 |
$translate = new Translator(); |
| 119 | 254 |
|
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
255 |
|
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
256 |
$translate->addTranslation($traduction_en, 'en'); |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
257 |
$translate->addTranslation($traduction_ja, 'ja_JP'); |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
258 |
$translate->addTranslation($traduction_fr, 'fr'); |
| 119 | 259 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
260 |
if (isset($config)) { |
|
294
106c4ec894aa
new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
291
diff
changeset
|
261 |
set_config_translations($config, $translate); |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
262 |
$config = setGroupMastodon($config, $MASTODON_DEFAULT_GROUP_DOMAIN); |
|
291
db1e6bfaa54e
add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
287
diff
changeset
|
263 |
} |
|
1198
ff4b567d51f2
upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1196
diff
changeset
|
264 |
|
| 119 | 265 |
$actual = $translate->getLocale(); |
266 |
||
267 |
||
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
268 |
if (isset($_GET['lang']) == false and isset($_SESSION['lang']) == false) { |
|
1198
ff4b567d51f2
upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1196
diff
changeset
|
269 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
270 |
if ($actual != 'fr' and $actual != 'en' and $actual != 'ja_JP') { |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
271 |
$translate->setLocale("fr"); |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
272 |
$_SESSION['lang'] = "fr"; |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
273 |
} |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
274 |
} else if (isset($_GET['lang']) == true) { |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
275 |
$translate->setLocale($_GET['lang']); |
| 119 | 276 |
$_SESSION['lang'] = $_GET['lang']; |
277 |
$actual = $_SESSION['lang']; |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
278 |
} else if (isset($_SESSION['lang']) == true) { |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
279 |
$translate->setLocale($_SESSION['lang']); |
| 119 | 280 |
$actual = $_SESSION['lang']; |
281 |
} |
|
282 |
||
|
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 |
$js_registry = array( |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
284 |
'local' => array( |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
285 |
'libdir' => URL_ROOT . 'res/js/', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
286 |
'jquery' => URL_ROOT . 'res/js/jquery.min.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
287 |
'raphael' => URL_ROOT . 'res/js/raphael-min.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
288 |
'jquery-ui' => URL_ROOT . 'res/js/jquery-ui.min.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
289 |
'niceforms' => URL_ROOT . 'res/js/niceforms.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
290 |
'jquery-url' => URL_ROOT . 'res/js/jquery.url.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
291 |
'ldtplayer' => URL_ROOT . 'res/metadataplayer/src/js/LdtPlayer.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
292 |
'fancybox' => URL_ROOT . 'res/js/fancybox/jquery.fancybox.pack.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
293 |
'jquery-tools' => URL_ROOT . 'res/js/jquery.tools.min.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
294 |
'jquery-migrate' => URL_ROOT . 'res/js/jquery-migrate-1.4.1.min.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
295 |
'tw-widget' => URL_ROOT . 'res/js/tw_widget.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
296 |
'jquery-mousewheel' => URL_ROOT . 'res/js/jquery.mousewheel.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
297 |
'swfobject' => URL_ROOT . 'res/js/swfobject.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
298 |
'json-js' => URL_ROOT . 'res/js/json2.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
299 |
'underscore' => URL_ROOT . 'res/js/underscore-min.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
300 |
'jquery-scrollto' => URL_ROOT . 'res/js/jquery.scrollTo-2.1.2-min.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
301 |
'twcx-main' => URL_ROOT . 'res/js/live-polemic.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
302 |
'semanticboard' => URL_ROOT . 'res/js/semanticboard.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
303 |
'metadataplayer' => URL_ROOT . 'res/metadataplayer/LdtPlayer-core.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
304 |
'ldtwidgets' => URL_ROOT . 'res/metadataplayer/', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
305 |
'tracemanager' => URL_ROOT . 'res/js/tracemanager.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
306 |
'jwplayer-js' => URL_ROOT . 'res/js/jwplayer.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
307 |
'jquery-tinymce' => URL_ROOT . 'res/js/tinymce/jquery.tinymce.min.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
308 |
'tinymce' => URL_ROOT . 'res/js/tinymce/tinymce.min.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
309 |
'dashjs' => URL_ROOT . 'res/js/dashjs/dash.min.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
310 |
'videojs-dash' => URL_ROOT . 'res/js/dashjs/videojs-dash.min.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
311 |
'videojs' => URL_ROOT . 'res/js/videojs/video.min.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
312 |
'twitter-text' => URL_ROOT . 'res/js/twitter-text-3.0.1.min.js', |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
313 |
), |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
314 |
'cdn' => array( |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
315 |
'libdir' => URL_ROOT . 'res/js/', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
316 |
'jquery' => 'http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
317 |
'raphael' => URL_ROOT . 'res/js/raphael-min.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
318 |
'jquery-ui' => 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
319 |
'niceforms' => URL_ROOT . 'res/js/niceforms.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
320 |
'jquery-url' => URL_ROOT . 'res/js/jquery.url.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
321 |
'ldtplayer' => URL_ROOT . 'res/metadataplayer/src/js/LdtPlayer.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
322 |
'fancybox' => URL_ROOT . 'res/js/fancybox/jquery.fancybox.pack.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
323 |
'jquery-tools' => 'http://cdn.jquerytools.org/1.2.7/all/jquery.tools.min.js', |
| 1514 | 324 |
'jquery-migrate' => 'http://code.jquery.com/jquery-migrate-1.4.1.min.js', |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
325 |
'tw-widget' => 'http://widgets.twimg.com/j/2/widget.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
326 |
'jquery-mousewheel' => URL_ROOT . 'res/js/jquery.mousewheel.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
327 |
'swfobject' => 'http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
328 |
'json-js' => URL_ROOT . 'res/js/json2.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
329 |
'underscore' => URL_ROOT . 'res/js/underscore-min.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
330 |
'jquery-scrollto' => URL_ROOT . 'res/js/jquery.scrollTo-2.1.2-min.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
331 |
'twcx-main' => URL_ROOT . 'res/js/live-polemic.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
332 |
'semanticboard' => URL_ROOT . 'res/js/semanticboard.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
333 |
'metadataplayer' => URL_ROOT . 'res/metadataplayer/LdtPlayer-core.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
334 |
'ldtwidgets' => URL_ROOT . 'res/metadataplayer/', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
335 |
'tracemanager' => URL_ROOT . 'res/js/tracemanager.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
336 |
'jwplayer-js' => URL_ROOT . 'res/js/jwplayer.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
337 |
'jquery-tinymce' => URL_ROOT . 'res/js/tinymce/jquery.tinymce.min.js', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
338 |
'tinymce' => URL_ROOT . 'res/js/tinymce/tinymce.min.js', |
|
1368
0ae5202742bd
change flash to dash
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1366
diff
changeset
|
339 |
'dashjs' => "http://cdn.dashjs.org/latest/dash.all.min.js", |
|
0ae5202742bd
change flash to dash
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1366
diff
changeset
|
340 |
'videojs-dash' => 'https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-dash/2.5.2/videojs-dash.min.js', |
|
0ae5202742bd
change flash to dash
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1366
diff
changeset
|
341 |
'videojs' => 'http://vjs.zencdn.net/5.12.6/video.js', |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
342 |
'twitter-text' => URL_ROOT . 'res/js/twitter-text-3.0.1.min.js', |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
343 |
) |
|
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 |
); |
|
143
2a3599a4b0f7
add #enmi page and some litlle corrections
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
119
diff
changeset
|
345 |
|
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
346 |
$font_registry = array( |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
347 |
'local' => array( |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
348 |
'PT-Sans_Narrow' => URL_ROOT . 'res/fonts/PTSansNarrow.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
349 |
'PT-Sans' => URL_ROOT . 'res/fonts/PTSans.css' |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
350 |
), |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
351 |
'cdn' => array( |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
352 |
'PT-Sans_Narrow' => 'http://fonts.googleapis.com/css?family=PT+Sans+Narrow&subset=latin', |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
353 |
'PT-Sans' => 'http://fonts.googleapis.com/css?family=PT+Sans&subset=latin' |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
354 |
) |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
355 |
); |
|
216
d8c1b7e00533
sig chi paris 2011
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
207
diff
changeset
|
356 |
|
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
357 |
|
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
358 |
$css_registry = array( |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
359 |
'local' => array( |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
360 |
'blueprint-screen' => URL_ROOT . 'res/css/blueprint-screen.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
361 |
'blueprint-print' => URL_ROOT . 'res/css/blueprint-print.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
362 |
'blueprint-ie' => URL_ROOT . 'res/css/blueprint-ie.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
363 |
'blueprint-plugins-fancy-type' => URL_ROOT . 'res/css/blueprint-plugins/fancy-type/screen.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
364 |
'custom' => URL_ROOT . 'res/css/custom.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
365 |
'fancybox' => URL_ROOT . 'res/js/fancybox/jquery.fancybox.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
366 |
'jquery-ui' => URL_ROOT . 'res/metadataplayer/res/css/jq-css/themes/base/jquery-ui.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
367 |
'tabs-slideshow' => URL_ROOT . 'res/css/tabs-slideshow.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
368 |
'tweetcast' => URL_ROOT . 'res/css/tweetcast.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
369 |
'semanticboard' => URL_ROOT . 'res/css/semanticboard.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
370 |
'archives-iframe' => URL_ROOT . 'res/css/archives-iframe.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
371 |
'metadataplayer' => URL_ROOT . 'res/metadataplayer/LdtPlayer-core.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
372 |
'jquery-te' => URL_ROOT . 'res/css/jquery-te.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
373 |
'videojs' => URL_ROOT . 'res/js/videojs/video-js.min.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
374 |
'ldtplayer' => URL_ROOT . 'res/metadataplayer/src/js/LdtPlayer.css', |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
375 |
), |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
376 |
'cdn' => array( |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
377 |
'blueprint-screen' => URL_ROOT . 'res/css/blueprint-screen.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
378 |
'blueprint-print' => URL_ROOT . 'res/css/blueprint-print.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
379 |
'blueprint-ie' => URL_ROOT . 'res/css/blueprint-ie.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
380 |
'blueprint-plugins-fancy-type' => URL_ROOT . 'res/css/blueprint-plugins/fancy-type/screen.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
381 |
'custom' => URL_ROOT . 'res/css/custom.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
382 |
'fancybox' => URL_ROOT . 'res/js/fancybox/jquery.fancybox.css', |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
383 |
'jquery-ui' => "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/base/jquery-ui.css", |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
384 |
'tabs-slideshow' => URL_ROOT . 'res/css/tabs-slideshow.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
385 |
'tweetcast' => URL_ROOT . 'res/css/tweetcast.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
386 |
'semanticboard' => URL_ROOT . 'res/css/semanticboard.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
387 |
'archives-iframe' => URL_ROOT . 'res/css/archives-iframe.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
388 |
'metadataplayer' => URL_ROOT . 'res/metadataplayer/LdtPlayer-core.css', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
389 |
'jquery-te' => URL_ROOT . 'res/css/jquery-te.css', |
|
1368
0ae5202742bd
change flash to dash
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1366
diff
changeset
|
390 |
'videojs' => "http://vjs.zencdn.net/5.12.6/video-js.css" |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
391 |
) |
|
233
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
392 |
); |
|
10d6fd6ce9ab
- put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
229
diff
changeset
|
393 |
|
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
394 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
395 |
function registry_url($key, $type, $registry_def = null) |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
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 |
|
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
398 |
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
|
399 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
400 |
if ($registry_def != null) { |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
401 |
$registry = $registry_def; |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
402 |
} elseif (isset($C_default_registry)) { |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
403 |
$registry = $C_default_registry; |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
404 |
} else { |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
405 |
$registry = 'local'; |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
406 |
} |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
407 |
$registry_name = $type . "_registry"; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
408 |
return ${$registry_name}[$registry][$key]; |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
409 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
410 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
411 |
function get_default_annotations_config($config, $translate) |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
412 |
{ |
|
1295
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
413 |
|
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
414 |
$default_protocol_annotations = array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
415 |
"1" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
416 |
"default" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
417 |
"colors" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
418 |
"h" => 0, |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
419 |
"s" => 0 |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
420 |
) |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
421 |
), |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
422 |
"positive" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
423 |
"display_name" => "++ | Agree", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
424 |
"keywords" => "\\+\\+", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
425 |
"colors" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
426 |
"h" => .3, |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
427 |
"s" => .65 |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
428 |
), |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
429 |
"colors_class" => "twbGreen", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
430 |
"polemic_cat" => 'OK', |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
431 |
"polemic_keywords" => array("++"), |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
432 |
"polemic_color" => "#1D973D" |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
433 |
), |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
434 |
"negative" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
435 |
"display_name" => "-- | Disagree", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
436 |
"keywords" => "\\-\\-", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
437 |
"colors" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
438 |
"h" => 0, |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
439 |
"s" => .8 |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
440 |
), |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
441 |
"colors_class" => "twbRed", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
442 |
"polemic_cat" => 'KO', |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
443 |
"polemic_keywords" => array("--"), |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
444 |
"polemic_color" => "#CE0A15" |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
445 |
), |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
446 |
"reference" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
447 |
"display_name" => "== | Reference", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
448 |
"keywords" => "\\=\\=", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
449 |
"colors" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
450 |
"h" => .16, |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
451 |
"s" => .8 |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
452 |
), |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
453 |
"colors_class" => "twbYellow", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
454 |
"polemic_cat" => 'REF', |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
455 |
"polemic_keywords" => array("==", "http://"), |
|
1295
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
456 |
"polemic_color" => "#C5A62D" |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
457 |
), |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
458 |
"question" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
459 |
"display_name" => "?? | Question", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
460 |
"keywords" => "\\?\\?", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
461 |
"colors" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
462 |
"h" => .6, |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
463 |
"s" => .8 |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
464 |
), |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
465 |
"colors_class" => "twbBlue", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
466 |
"polemic_cat" => 'Q', |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
467 |
"polemic_keywords" => array("?", "??"), |
|
1295
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
468 |
"polemic_color" => "#036AAE" |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
469 |
) |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
470 |
), |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
471 |
"2" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
472 |
"default" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
473 |
"colors" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
474 |
"h" => 0, |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
475 |
"s" => 0 |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
476 |
) |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
477 |
), |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
478 |
"positive" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
479 |
"display_name" => "++ | Remember", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
480 |
"keywords" => "\\+\\+", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
481 |
"colors" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
482 |
"h" => .3, |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
483 |
"s" => .65 |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
484 |
), |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
485 |
"colors_class" => "twbGreen", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
486 |
"polemic_cat" => 'OK', |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
487 |
"polemic_keywords" => array("++"), |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
488 |
"polemic_color" => "#1D973D" |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
489 |
), |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
490 |
"negative" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
491 |
"display_name" => "!! | Discuss", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
492 |
"keywords" => "\\!\\!", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
493 |
"colors" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
494 |
"h" => 0, |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
495 |
"s" => .8 |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
496 |
), |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
497 |
"colors_class" => "twbRed", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
498 |
"polemic_cat" => 'KO', |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
499 |
"polemic_keywords" => array("!!"), |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
500 |
"polemic_color" => "#CE0A15" |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
501 |
), |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
502 |
"reference" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
503 |
"display_name" => "== | Reference", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
504 |
"keywords" => "\\=\\=", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
505 |
"colors" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
506 |
"h" => .16, |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
507 |
"s" => .8 |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
508 |
), |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
509 |
"colors_class" => "twbYellow", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
510 |
"polemic_cat" => 'REF', |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
511 |
"polemic_keywords" => array("==", "http://"), |
|
1295
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
512 |
"polemic_color" => "#C5A62D" |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
513 |
), |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
514 |
"question" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
515 |
"display_name" => "?? | Question", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
516 |
"keywords" => "\\?\\?", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
517 |
"colors" => array( |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
518 |
"h" => .6, |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
519 |
"s" => .8 |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
520 |
), |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
521 |
"colors_class" => "twbBlue", |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
522 |
"polemic_cat" => 'Q', |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
523 |
"polemic_keywords" => array("?", "??"), |
|
1295
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
524 |
"polemic_color" => "#036AAE" |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
525 |
) |
| 1436 | 526 |
), |
527 |
"3" => array( |
|
528 |
"default" => array( |
|
529 |
"colors" => array( |
|
530 |
"h" => 0, |
|
531 |
"s" => 0 |
|
532 |
) |
|
533 |
), |
|
534 |
"important" => array( // blue |
|
535 |
"display_name" => "++ | Important", |
|
536 |
"keywords" => "\\+\\+", |
|
537 |
"colors" => array( |
|
538 |
"h" => .6, |
|
539 |
"s" => .8 |
|
540 |
), |
|
541 |
"polemic_cat" => 'OK', |
|
542 |
"polemic_keywords" => array("++"), |
|
543 |
"polemic_color" => "#196be6" |
|
544 |
), |
|
545 |
"trouble" => array( // orange |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
546 |
"display_name" => "?? | Trouble", |
| 1436 | 547 |
"keywords" => "\\?\\?", |
548 |
"colors" => array( |
|
549 |
"h" => .13, |
|
550 |
"s" => .8 |
|
551 |
), |
|
552 |
"polemic_cat" => 'KO', |
|
553 |
"polemic_keywords" => array("??"), |
|
554 |
"polemic_color" => "#e6b919" |
|
555 |
), |
|
556 |
"index" => array( // violet |
|
557 |
"display_name" => "** | Index", |
|
558 |
"keywords" => "\\*\\*", |
|
559 |
"colors" => array( |
|
560 |
"h" => .83, |
|
561 |
"s" => .8 |
|
562 |
), |
|
563 |
"polemic_cat" => 'REF', |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
564 |
"polemic_keywords" => array("**", "http://"), |
| 1436 | 565 |
"polemic_color" => "#e619e6" |
566 |
), |
|
567 |
"comments" => array( // green |
|
568 |
"display_name" => "== | Comment", |
|
569 |
"keywords" => "\\=\\=", |
|
570 |
"colors" => array( |
|
571 |
"h" => .3, |
|
572 |
"s" => .65 |
|
573 |
), |
|
574 |
"polemic_cat" => 'Q', |
|
575 |
"polemic_keywords" => array("=="), |
|
576 |
"polemic_color" => "#42e619" |
|
577 |
) |
|
|
1295
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
578 |
) |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
579 |
); |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
580 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
581 |
$annotation_protocol_version = isset($config['annotation_protocol_version']) ? $config['annotation_protocol_version'] : "1"; |
|
1295
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
582 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
583 |
$annotations_def = (isset($config['annotations']) && !empty($config['annotations'])) ? $config['annotations'] : $default_protocol_annotations[$annotation_protocol_version]; |
|
1295
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
584 |
|
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
585 |
$annotations = array(); |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
586 |
|
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
587 |
foreach ($annotations_def as $annot_cat => $annot_def) { |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
588 |
if (isset($annot_def['display_name'])) { |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
589 |
$disp_parts = array_map('trim', explode("|", $annot_def['display_name'])); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
590 |
if (count($disp_parts) > 1) { |
|
1295
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
591 |
$disp_parts[1] = $translate->_($disp_parts[1]); |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
592 |
} |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
593 |
$annot_def['display_name'] = implode(" | ", $disp_parts); |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
594 |
} |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
595 |
$annotations[$annot_cat] = $annot_def; |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
596 |
} |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
597 |
return $annotations; |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
598 |
} |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
599 |
|
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
600 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
601 |
function get_archive_box($rep, $metadata, $url_root, $basepath, &$translate) |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
602 |
{ |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
603 |
|
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
604 |
include("$basepath$rep/config.php"); |
|
1198
ff4b567d51f2
upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1196
diff
changeset
|
605 |
|
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
606 |
set_config_translations($config, $translate); |
|
1198
ff4b567d51f2
upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1196
diff
changeset
|
607 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
608 |
$id = "abox_$rep" . (($metadata != null) ? "_$metadata" : ""); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
609 |
$hash = ($metadata != null) ? "#metadata=$metadata" : ""; |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
610 |
$tail_img = $translate->_('config__archive_img'); |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
611 |
if (is_array($tail_img)) { |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
612 |
$tail_img = $tail_img[$metadata]; |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
613 |
} |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
614 |
$archive_title = $translate->_('config__archive_title'); |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
615 |
if (is_array($archive_title)) { |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
616 |
$archive_title = $archive_title[$metadata]; |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
617 |
} |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
618 |
$archive_description = $translate->_('config__archive_description'); |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
619 |
if (is_array($archive_description)) { |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
620 |
$archive_description = $archive_description[$metadata]; |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
621 |
} |
| 119 | 622 |
|
623 |
||
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
624 |
$res = "<div id=\"$id\" class=\"archivesVideoBox\">\n"; |
|
1412
8e51c6b8815f
publish enmi17 sessions
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1408
diff
changeset
|
625 |
$res .= " <a href=\"$rep/polemicaltimeline.php$hash\" title=\"$archive_title\">\n"; |
|
8e51c6b8815f
publish enmi17 sessions
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1408
diff
changeset
|
626 |
$res .= " <img src=\"$url_root$rep/$tail_img\" width=\"270\" height=\"150\" class=\"AVBimg\" title=\"$archive_title\" />"; |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
627 |
$res .= " </a>"; |
|
1412
8e51c6b8815f
publish enmi17 sessions
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1408
diff
changeset
|
628 |
$res .= " <div class=\"AVBtitle\" title=\"$archive_title\">$archive_title</div>\n"; |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
629 |
$res .= " <div class=\"AVBtext\">\n"; |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
630 |
$res .= " $archive_description\n"; |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
631 |
$res .= " </div>\n"; |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
632 |
$res .= "</div>\n"; |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
633 |
|
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
634 |
return $res; |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
635 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
636 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
637 |
function display_archives_list($archives_list, $box_class, $url_root, $basepath, &$translate) |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
638 |
{ |
|
1198
ff4b567d51f2
upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1196
diff
changeset
|
639 |
|
|
ff4b567d51f2
upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1196
diff
changeset
|
640 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
641 |
for ($i = 0; $i < count($archives_list); $i++) { |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
642 |
if (($i % 3) == 0) { |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
643 |
print(" <div class=\"$box_class\">\n"); |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
644 |
} |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
645 |
$archive_ref = $archives_list[$i]; |
|
1198
ff4b567d51f2
upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1196
diff
changeset
|
646 |
|
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
647 |
$archive_name = $archive_ref; |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
648 |
$metadata = null; |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
649 |
if (is_array($archive_ref)) { |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
650 |
$archive_name = $archive_ref[0]; |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
651 |
$metadata = $archive_ref[1]; |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
652 |
} |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
653 |
print(get_archive_box($archive_name, $metadata, $url_root, $basepath, $translate)); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
654 |
if (($i % 3) == 2 || $i == (count($archives_list) - 1)) { |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
655 |
print(" </div>\n"); |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
656 |
} |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
657 |
} |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
658 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
659 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
660 |
function get_metadata_url($metadata) |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
661 |
{ |
|
1244
87583b020202
put ldt platform url in config
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1242
diff
changeset
|
662 |
global $project_url_base; |
|
684
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
663 |
if (preg_match('/^https?:\/\//', $metadata)) { |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
664 |
return $metadata; |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
665 |
} else { |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
666 |
return LDT_PLATFORM . $project_url_base . $metadata; |
|
684
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
667 |
} |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
668 |
} |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
227
diff
changeset
|
669 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
670 |
function get_metadata_json_url($metadata) |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
671 |
{ |
|
684
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
672 |
if (is_array($metadata)) { |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
673 |
$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
|
674 |
return $metadata; |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
675 |
} else { |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
676 |
return get_metadata_url($metadata); |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
677 |
} |
|
f59daf0830d2
less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents:
683
diff
changeset
|
678 |
} |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
679 |
|
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
680 |
|
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
681 |
$realm = 'Polemictweet restricted area'; |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
682 |
|
|
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
|
683 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
684 |
function authenticate($users, $translate) |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
685 |
{ |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
686 |
|
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
687 |
global $realm; |
|
1198
ff4b567d51f2
upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1196
diff
changeset
|
688 |
|
|
1295
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
689 |
$_SESSION['auth'] = 'polemictweet'; |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
690 |
return array('username' => 'polemictweet'); |
|
1198
ff4b567d51f2
upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1196
diff
changeset
|
691 |
|
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
692 |
if (empty($_SERVER['PHP_AUTH_DIGEST']) || !isset($_SESSION['http_digest_nonce'])) { |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
693 |
$_SESSION['http_digest_nonce'] = uniqid(); |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
694 |
header('HTTP/1.1 401 Unauthorized'); |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
695 |
header('WWW-Authenticate: Digest realm="' . $realm . |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
696 |
'",qop="auth",nonce="' . $_SESSION['http_digest_nonce'] . '",opaque="' . md5($realm) . '"'); |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
697 |
return array('error' => $translate->_('This area is restricted, please authenticate')); |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
698 |
} |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
699 |
|
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
700 |
|
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
701 |
//analyze the PHP_AUTH_DIGEST variable |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
702 |
if ( |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
703 |
!($data = http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) || |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
704 |
!isset($users[$data['username']]) |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
705 |
) { |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
706 |
$_SERVER['PHP_AUTH_DIGEST'] = ''; |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
707 |
unset($_SESSION['auth']); |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
708 |
unset($_SESSION['http_digest_nonce']); |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
709 |
return array('error' => $translate->_('Wrong Credentials!')); |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
710 |
} |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
711 |
|
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
712 |
|
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
713 |
//generate the valid response |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
714 |
$A1 = md5($data['username'] . ':' . $realm . ':' . $users[$data['username']]); |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
715 |
$A2 = md5($_SERVER['REQUEST_METHOD'] . ':' . $data['uri']); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
716 |
$valid_response = md5($A1 . ':' . $data['nonce'] . ':' . $data['nc'] . ':' . $data['cnonce'] . ':' . $data['qop'] . ':' . $A2); |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
717 |
|
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
718 |
if ($data['response'] != $valid_response) { |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
719 |
$_SERVER['PHP_AUTH_DIGEST'] = ''; |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
720 |
unset($_SESSION['http_digest_nonce']); |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
721 |
unset($_SESSION['auth']); |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
722 |
return array('error' => $translate->_('Wrong Credentials!')); |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
723 |
} |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
724 |
|
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
725 |
// ok, valid username & password |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
726 |
$_SESSION['auth'] = $data['username']; |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
727 |
return $data; |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
728 |
} |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
729 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
730 |
function logout() |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
731 |
{ |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
732 |
global $_SESSION; |
|
1198
ff4b567d51f2
upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1196
diff
changeset
|
733 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
734 |
$_SESSION = []; |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
735 |
} |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
736 |
|
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
737 |
|
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
738 |
//function to parse the http auth header |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
739 |
function http_digest_parse($txt) |
|
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
740 |
{ |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
741 |
// protect against missing data |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
742 |
$needed_parts = array('nonce' => 1, 'nc' => 1, 'cnonce' => 1, 'qop' => 1, 'username' => 1, 'uri' => 1, 'response' => 1); |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
743 |
$data = array(); |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
744 |
$keys = implode('|', array_keys($needed_parts)); |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
745 |
|
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
746 |
preg_match_all('@(' . $keys . ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@', $txt, $matches, PREG_SET_ORDER); |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
747 |
|
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
748 |
foreach ($matches as $m) { |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
749 |
$data[$m[1]] = $m[3] ? $m[3] : $m[4]; |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
750 |
unset($needed_parts[$m[1]]); |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
751 |
} |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
752 |
|
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
753 |
return $needed_parts ? false : $data; |
|
988
954019f62866
update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
985
diff
changeset
|
754 |
} |
|
1006
bb98a0de3bfd
sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1003
diff
changeset
|
755 |
|
|
bb98a0de3bfd
sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1003
diff
changeset
|
756 |
/** |
|
bb98a0de3bfd
sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1003
diff
changeset
|
757 |
* Modifies a string to remove all non ASCII characters and spaces. |
|
bb98a0de3bfd
sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1003
diff
changeset
|
758 |
*/ |
|
bb98a0de3bfd
sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1003
diff
changeset
|
759 |
function slugify($text) |
|
bb98a0de3bfd
sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1003
diff
changeset
|
760 |
{ |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
761 |
// replace non letter or digits by - |
|
1423
a6ed32f6dbcf
add 2018 preparatoire
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1414
diff
changeset
|
762 |
$text = preg_replace('~[^\pL\d]+~u', '-', $text); |
|
1006
bb98a0de3bfd
sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1003
diff
changeset
|
763 |
|
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
764 |
// trim |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
765 |
$text = trim($text, '-'); |
|
1006
bb98a0de3bfd
sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1003
diff
changeset
|
766 |
|
|
1423
a6ed32f6dbcf
add 2018 preparatoire
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1414
diff
changeset
|
767 |
$transliterator = Transliterator::create( |
|
a6ed32f6dbcf
add 2018 preparatoire
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1414
diff
changeset
|
768 |
'NFD; [:Nonspacing Mark:] Remove; NFC;' |
|
a6ed32f6dbcf
add 2018 preparatoire
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1414
diff
changeset
|
769 |
); |
|
a6ed32f6dbcf
add 2018 preparatoire
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1414
diff
changeset
|
770 |
$text = $transliterator->transliterate($text); |
|
1006
bb98a0de3bfd
sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1003
diff
changeset
|
771 |
|
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
772 |
// lowercase |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
773 |
$text = strtolower($text); |
|
1006
bb98a0de3bfd
sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1003
diff
changeset
|
774 |
|
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
775 |
// remove unwanted characters |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
776 |
$text = preg_replace('~[^-\w]+~', '', $text); |
|
1006
bb98a0de3bfd
sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1003
diff
changeset
|
777 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
778 |
if (empty($text)) { |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
779 |
return 'n-a'; |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
780 |
} |
|
1006
bb98a0de3bfd
sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1003
diff
changeset
|
781 |
|
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
782 |
return $text; |
|
1006
bb98a0de3bfd
sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1003
diff
changeset
|
783 |
} |
|
bb98a0de3bfd
sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1003
diff
changeset
|
784 |
|
|
bb98a0de3bfd
sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1003
diff
changeset
|
785 |
|
|
bb98a0de3bfd
sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1003
diff
changeset
|
786 |
// from http://www.house6.com/blog/?p=83 |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
787 |
function sanitize_filename($f) |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
788 |
{ |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
789 |
// a combination of various methods |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
790 |
// we don't want to convert html entities, or do any url encoding |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
791 |
// we want to retain the "essence" of the original file name, if possible |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
792 |
// char replace table found at: |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
793 |
// http://www.php.net/manual/en/function.strtr.php#98669 |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
794 |
$replace_chars = array( |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
795 |
'Š' => 'S', 'š' => 's', 'Ð' => 'Dj', 'Ž' => 'Z', 'ž' => 'z', 'À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä' => 'A', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
796 |
'Å' => 'A', 'Æ' => 'A', 'Ç' => 'C', 'È' => 'E', 'É' => 'E', 'Ê' => 'E', 'Ë' => 'E', 'Ì' => 'I', 'Í' => 'I', 'Î' => 'I', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
797 |
'Ï' => 'I', 'Ñ' => 'N', 'Ò' => 'O', 'Ó' => 'O', 'Ô' => 'O', 'Õ' => 'O', 'Ö' => 'O', 'Ø' => 'O', 'Ù' => 'U', 'Ú' => 'U', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
798 |
'Û' => 'U', 'Ü' => 'U', 'Ý' => 'Y', 'Þ' => 'B', 'ß' => 'Ss', 'à' => 'a', 'á' => 'a', 'â' => 'a', 'ã' => 'a', 'ä' => 'a', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
799 |
'å' => 'a', 'æ' => 'a', 'ç' => 'c', 'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ë' => 'e', 'ì' => 'i', 'í' => 'i', 'î' => 'i', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
800 |
'ï' => 'i', 'ð' => 'o', 'ñ' => 'n', 'ò' => 'o', 'ó' => 'o', 'ô' => 'o', 'õ' => 'o', 'ö' => 'o', 'ø' => 'o', 'ù' => 'u', |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
801 |
'ú' => 'u', 'û' => 'u', 'ý' => 'y', 'ý' => 'y', 'þ' => 'b', 'ÿ' => 'y', 'ƒ' => 'f' |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
802 |
); |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
803 |
$f = strtr($f, $replace_chars); |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
804 |
// convert & to "and", @ to "at", and # to "number" |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
805 |
$f = preg_replace(array('/[\&]/', '/[\@]/', '/[\#]/'), array('-and-', '-at-', '-number-'), $f); |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
806 |
$f = preg_replace('/[^(\x20-\x7F)]*/', '', $f); // removes any special chars we missed |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
807 |
$f = str_replace(' ', '-', $f); // convert space to hyphen |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
808 |
$f = str_replace('\'', '', $f); // removes apostrophes |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
809 |
$f = preg_replace('/[^\w\-\.]+/', '', $f); // remove non-word chars (leaving hyphens and periods) |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
810 |
$f = preg_replace('/[\-]+/', '-', $f); // converts groups of hyphens into one |
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
811 |
if (function_exists('iconv')) { |
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
812 |
$f = iconv('utf-8', 'us-ascii//TRANSLIT', $f); |
|
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
813 |
} |
|
1198
ff4b567d51f2
upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1196
diff
changeset
|
814 |
|
|
1012
5064d9d287a0
replace jquery text editor by jquery for a better control on text clean up.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1006
diff
changeset
|
815 |
return strtolower($f); |
|
1006
bb98a0de3bfd
sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1003
diff
changeset
|
816 |
} |
|
1295
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
817 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
818 |
function rgb2hex($rgb) |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
819 |
{ |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
820 |
$hex = "#"; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
821 |
$hex .= str_pad(dechex($rgb[0]), 2, "0", STR_PAD_LEFT); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
822 |
$hex .= str_pad(dechex($rgb[1]), 2, "0", STR_PAD_LEFT); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
823 |
$hex .= str_pad(dechex($rgb[2]), 2, "0", STR_PAD_LEFT); |
|
1295
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
824 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
825 |
return $hex; // returns the hex value including the number sign (#) |
|
1295
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
826 |
} |
|
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
827 |
|
|
1558
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
828 |
function hsl2Rgb($h, $s, $l) |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
829 |
{ |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
830 |
$r = -1; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
831 |
$g = -1; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
832 |
$b = -1; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
833 |
$c = (1 - abs(2 * $l - 1)) * $s; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
834 |
$x = $c * (1 - abs(fmod(($h / 60), 2) - 1)); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
835 |
$m = $l - ($c / 2); |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
836 |
if ($h < 60) { |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
837 |
$r = $c; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
838 |
$g = $x; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
839 |
$b = 0; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
840 |
} else if ($h < 120) { |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
841 |
$r = $x; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
842 |
$g = $c; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
843 |
$b = 0; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
844 |
} else if ($h < 180) { |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
845 |
$r = 0; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
846 |
$g = $c; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
847 |
$b = $x; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
848 |
} else if ($h < 240) { |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
849 |
$r = 0; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
850 |
$g = $x; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
851 |
$b = $c; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
852 |
} else if ($h < 300) { |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
853 |
$r = $x; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
854 |
$g = 0; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
855 |
$b = $c; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
856 |
} else { |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
857 |
$r = $c; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
858 |
$g = 0; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
859 |
$b = $x; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
860 |
} |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
861 |
$r = ($r + $m) * 255; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
862 |
$g = ($g + $m) * 255; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
863 |
$b = ($b + $m) * 255; |
|
761ba7426984
upgrade metadataplayer and add a sitemap
ymh <ymh.work@gmail.com>
parents:
1557
diff
changeset
|
864 |
return array(floor($r), floor($g), floor($b)); |
|
1295
03d2aa7b4967
change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
1293
diff
changeset
|
865 |
} |