web/common.php
author Riwad Salim <riwad.salim@yahoo.fr>
Tue, 27 Oct 2020 14:10:44 +0100
changeset 1532 6f6294d607cd
parent 1526 e4662bc99fec
child 1539 2eca6c367a75
permissions -rwxr-xr-x
Edit enmi20
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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;
0
4eba9c11703f first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff changeset
     7
233
10d6fd6ce9ab - put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 229
diff changeset
     8
/**
10d6fd6ce9ab - put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 229
diff changeset
     9
* Base configuration
10d6fd6ce9ab - put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 229
diff changeset
    10
*/
988
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
    11
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
    12
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
    13
$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
    14
1532
6f6294d607cd Edit enmi20
Riwad Salim <riwad.salim@yahoo.fr>
parents: 1526
diff changeset
    15
$C_default_rep = 'enmi20';
287
3efe34a87c37 correct feedback url
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 286
diff changeset
    16
$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
    17
$C_event_props = __DIR__ . "/event_props";
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
    18
$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
    19
994
053de9a4e738 adapt for 5.3.2
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 989
diff changeset
    20
$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
    21
294
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
    22
$archives_list = array(
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
    23
    "rsln", "rsln-opendata", "rsln-mercedes-bunz",
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
    24
    "enmi2011-technologie-confiance", "CPV", array("fens_FabLab_Design_Metadata","fablab"),
294
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
    25
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
    26
    "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
    27
    "iii-catastrophe", "edito-inaugurale", "enmi2011", "2011-2012-museo-structured-data",
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
    28
    "edito-webdoc","edito-intelligence", "2011-2012-museo-contribution",
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
    29
    "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
    30
    "edito-arts-numeriques",
659
44c5c0a2b6d4 Added FENS events
Raphael Velt <raph.velt@gmail.com>
parents: 656
diff changeset
    31
    'fens2012-gamestudies',
44c5c0a2b6d4 Added FENS events
Raphael Velt <raph.velt@gmail.com>
parents: 656
diff changeset
    32
    'fens2012-designmetadata',
44c5c0a2b6d4 Added FENS events
Raphael Velt <raph.velt@gmail.com>
parents: 656
diff changeset
    33
    'fens2012-museo-culture-opendata',
44c5c0a2b6d4 Added FENS events
Raphael Velt <raph.velt@gmail.com>
parents: 656
diff changeset
    34
    'fens2012-vinyl-numerique',
44c5c0a2b6d4 Added FENS events
Raphael Velt <raph.velt@gmail.com>
parents: 656
diff changeset
    35
    'fens2012-edito-datajournalisme',
770
25c156d00de6 Next event is BPI Doudou
Raphael Velt <raph.velt@gmail.com>
parents: 768
diff changeset
    36
    'fens2012-wiid',
938
db42d0bc2e19 Added video for Design Meta Data
Raphael Velt <raph.velt@gmail.com>
parents: 918
diff changeset
    37
    '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
    38
    '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
    39
    "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
    40
    'edito-1213-04-lire-ecrire', 'eduinov-2013',
db42d0bc2e19 Added video for Design Meta Data
Raphael Velt <raph.velt@gmail.com>
parents: 918
diff changeset
    41
    '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
    42
    '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
    43
    'fens2013-design-metadata',
1038
c1597d3fe210 add museo 2014-01
Thibaut Cavalié <thibaut.cavalie@iri.centrepompidou.fr>
parents: 1033
diff changeset
    44
    'fens2013-museo-cultural-data',
c1597d3fe210 add museo 2014-01
Thibaut Cavalié <thibaut.cavalie@iri.centrepompidou.fr>
parents: 1033
diff changeset
    45
    'fens2013-edito-verite-fiction',
c1597d3fe210 add museo 2014-01
Thibaut Cavalié <thibaut.cavalie@iri.centrepompidou.fr>
parents: 1033
diff changeset
    46
    'mediapartlive-comment-combattre-le-fn',
c1597d3fe210 add museo 2014-01
Thibaut Cavalié <thibaut.cavalie@iri.centrepompidou.fr>
parents: 1033
diff changeset
    47
    'attention-1314-01-notion-attention',
c1597d3fe210 add museo 2014-01
Thibaut Cavalié <thibaut.cavalie@iri.centrepompidou.fr>
parents: 1033
diff changeset
    48
    'attention-1314-02-syndrome-saturation-cognitive',
c1597d3fe210 add museo 2014-01
Thibaut Cavalié <thibaut.cavalie@iri.centrepompidou.fr>
parents: 1033
diff changeset
    49
    '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
    50
    'enmi13', 'museo-1314-03-cognition-apprentissage', 'attention-1314-03-nouvelle-valeur-economique',
1106
1f827e73cb58 edito #5 en archive
Nicolas Sauret <nicolas.sauret@iri.centrepompidou.fr>
parents: 1102
diff changeset
    51
    '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',
1135
e78bbfe90a57 publication fens and update /edito/
Nicolas Sauret <nicolas.sauret@iri.centrepompidou.fr>
parents: 1125
diff changeset
    52
    'fens2014-design-metadata','fens2014-museo','fens2014-transmediamix','fens2014-edito','fens2014-attention',
1162
d39d2d68d49f archive edito
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1160
diff changeset
    53
    '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
    54
    'museo-1415-01-inaugurale', 'museo-1415-02-controverses', 'attention-1415-01-attention-automatisee',
1304
10974bff4dae upgrade metadataplayer + publish enmi 14and 15
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1301
diff changeset
    55
    '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
    56
    '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
    57
    '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
    58
    '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
    59
    '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
    60
    '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
    61
    'edito-1516-07-architecture-savoir', 'edito-1516-08-desir-profilage', 'edito-1516-09-cloture', 'journee-omnsh-2016-10-patrimoine-numerique', 'enmi16',
1526
e4662bc99fec Archive enmi19
Riwad Salim <riwad.salim@yahoo.fr>
parents: 1514
diff changeset
    62
    'cnsad-ateliers-2017', 'crypto-party-camp-rouxteur-10-2017', 'cnsad-seminaire-telepresence-11-2017', 'enmi17', /*'enmi18-preparatoire',*/'marathon-serpentine-2018', 'enmi18', 'enmi19-preparatoire', 'enmi19',
294
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
    63
);
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
    64
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
    65
233
10d6fd6ce9ab - put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 229
diff changeset
    66
$req_rep = $C_default_rep;
10d6fd6ce9ab - put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 229
diff changeset
    67
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
    68
    $req_rep = $config['rep'];
233
10d6fd6ce9ab - put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 229
diff changeset
    69
}
119
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
    70
988
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
    71
foreach (glob(dirname(__FILE__).'/traductions/*.php') as $trad_filename)
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
    72
{
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
    73
    include_once $trad_filename;
988
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
    74
}
233
10d6fd6ce9ab - put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 229
diff changeset
    75
if(file_exists(dirname(__FILE__)."/$req_rep/traduction.php")) {
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 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
    77
}
119
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
    78
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
    79
0
4eba9c11703f first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff changeset
    80
/**
4eba9c11703f first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff changeset
    81
 * Start up the ol' session engine
4eba9c11703f first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff changeset
    82
 */
4eba9c11703f first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff changeset
    83
session_start();
4eba9c11703f first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff changeset
    84
4eba9c11703f first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff changeset
    85
/**
4eba9c11703f first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff changeset
    86
 * 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
    87
 */
119
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
    88
include_once dirname(__FILE__).'/config.php';
1198
ff4b567d51f2 upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1196
diff changeset
    89
233
10d6fd6ce9ab - put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 229
diff changeset
    90
1427
8b3d57a519eb remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents: 1425
diff changeset
    91
$get_twitter_request_token = function () use ($req_rep) {
233
10d6fd6ce9ab - put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 229
diff changeset
    92
1427
8b3d57a519eb remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents: 1425
diff changeset
    93
    $twitterClient = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
8b3d57a519eb remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents: 1425
diff changeset
    94
    $token = $twitterClient->oauth('oauth/request_token', array('oauth_callback' => URL_ROOT."callback.php?rep=$req_rep"));
8b3d57a519eb remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents: 1425
diff changeset
    95
8b3d57a519eb remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents: 1425
diff changeset
    96
    $_SESSION['TWITTER_REQUEST_TOKEN'] = serialize($token);
0
4eba9c11703f first import
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
diff changeset
    97
1427
8b3d57a519eb remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents: 1425
diff changeset
    98
    /**
8b3d57a519eb remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents: 1425
diff changeset
    99
     * Now redirect user to Twitter site so they can log in and
8b3d57a519eb remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents: 1425
diff changeset
   100
     * approve our access
8b3d57a519eb remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents: 1425
diff changeset
   101
     */
8b3d57a519eb remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents: 1425
diff changeset
   102
    $url = $twitterClient->url('oauth/authorize', array('oauth_token' => $token['oauth_token']));
8b3d57a519eb remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents: 1425
diff changeset
   103
    header("Location: ".$url);
8b3d57a519eb remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents: 1425
diff changeset
   104
    die();
8b3d57a519eb remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents: 1425
diff changeset
   105
};
119
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   106
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   107
/**
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   108
 * TRADUCTION
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   109
**/
294
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   110
function get_config_translations($config) {
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   111
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   112
    $fr = array();
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   113
    $en = array();
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   114
    $jp = array();
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   115
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   116
    $array_loop = array("fr"=>&$fr,"en"=>&$en,"jp"=>&$jp);
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   117
    /**
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   118
     * 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
   119
     * 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
   120
     */
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   121
    foreach ($config as $key => $value) {
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   122
        $translation_key = "config__$key";
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   123
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   124
        foreach ($array_loop as $lang => &$lang_array) {
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   125
            if(is_array($value) && count(array_intersect_key($value,$array_loop)) > 0 ) {
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   126
                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
   127
                    $lang_array[$translation_key] = $value[$lang];
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   128
                }
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   129
                elseif (array_key_exists('fr', $value)) {
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   130
                    $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
   131
                }
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   132
            }
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   133
            else {
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   134
                $lang_array[$translation_key] = $value;
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   135
            }
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   136
        }
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   137
    }
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   138
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   139
    return $array_loop;
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   140
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   141
}
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   142
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   143
function 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
   144
294
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   145
    $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
   146
294
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   147
    // 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
   148
    $locale = $translate->getLocale();
1198
ff4b567d51f2 upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1196
diff changeset
   149
294
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   150
    $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
   151
    $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
   152
    $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
   153
294
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   154
    // set the locale back
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   155
    $translate->setLocale($locale);
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   156
}
119
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   157
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   158
1427
8b3d57a519eb remove dependency to Zend 1. Use composer to reduce the number of dependencies
ymh <ymh.work@gmail.com>
parents: 1425
diff changeset
   159
// 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
   160
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
   161
$translate = new Translator();
119
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   162
291
db1e6bfaa54e add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 287
diff changeset
   163
988
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   164
$translate->addTranslation($traduction_en, 'en');
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   165
$translate->addTranslation($traduction_ja, 'ja_JP');
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   166
$translate->addTranslation($traduction_fr, 'fr');
119
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   167
291
db1e6bfaa54e add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 287
diff changeset
   168
if(isset($config)) {
294
106c4ec894aa new version for todai forum
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 291
diff changeset
   169
    set_config_translations($config, $translate);
291
db1e6bfaa54e add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 287
diff changeset
   170
}
1198
ff4b567d51f2 upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1196
diff changeset
   171
119
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   172
$actual = $translate->getLocale();
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   173
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   174
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   175
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
   176
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
   177
    if($actual!='fr' and $actual!='en' and $actual!='ja_JP'){
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
   178
        $translate->setLocale("fr");
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
   179
         $_SESSION['lang']="fr";
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
   180
    }
1198
ff4b567d51f2 upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1196
diff changeset
   181
119
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   182
} 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
   183
    $translate->setLocale($_GET['lang']);
119
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   184
    $_SESSION['lang'] = $_GET['lang'];
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   185
    $actual = $_SESSION['lang'];
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   186
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   187
} else if (isset($_SESSION['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
   188
    $translate->setLocale( $_SESSION['lang']);
119
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   189
    $actual = $_SESSION['lang'];
1198
ff4b567d51f2 upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1196
diff changeset
   190
119
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   191
}
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   192
229
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 227
diff changeset
   193
$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
   194
    'local' => 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
   195
        'libdir'        => URL_ROOT.'res/js/',
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
   196
        'jquery' 		=> URL_ROOT.'res/js/jquery-1.10.2.min.js',
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
   197
        'raphael' 		=> URL_ROOT.'res/js/raphael-min.js',
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
   198
        'jquery-ui' 	=> URL_ROOT.'res/js/jquery-ui.min.js',
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
   199
        'niceforms' 	=> URL_ROOT.'res/js/niceforms.js',
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
   200
        'jquery-url' 	=> URL_ROOT.'res/js/jquery.url.js',
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
   201
        'ldtplayer' 	=> URL_ROOT.'res/metadataplayer/src/js/LdtPlayer.js',
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
   202
        'fancybox' 		=> URL_ROOT.'res/js/fancybox/jquery.fancybox.pack.js',
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
   203
        'jquery-tools' 	=> URL_ROOT.'res/js/jquery.tools.min.js',
1514
5869151a1f2f Upgrade various js dependencies
ymh <ymh.work@gmail.com>
parents: 1509
diff changeset
   204
        'jquery-migrate' => URL_ROOT.'res/js/jquery-migrate-1.4.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
   205
        'tw-widget' 	=> URL_ROOT.'res/js/tw_widget.js',
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
   206
        'jquery-mousewheel' => URL_ROOT.'res/js/jquery.mousewheel.js',
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
   207
        'swfobject' 	=> URL_ROOT.'res/js/swfobject.js',
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
   208
        'json-js' 		=> URL_ROOT.'res/js/json2.js',
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
   209
        'underscore'    => URL_ROOT.'res/js/underscore-min.js' ,
1514
5869151a1f2f Upgrade various js dependencies
ymh <ymh.work@gmail.com>
parents: 1509
diff changeset
   210
        'jquery-scrollto'=>URL_ROOT.'res/js/jquery.scrollTo-2.1.2-min.js' ,
534
0a2505c3b547 New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents: 525
diff changeset
   211
        'twcx-main'     => URL_ROOT.'res/js/live-polemic.js' ,
0a2505c3b547 New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents: 525
diff changeset
   212
        'semanticboard' => URL_ROOT.'res/js/semanticboard.js' ,
598
d366aa22bd79 New Metadataplayer version
Raphael Velt <raph.velt@gmail.com>
parents: 597
diff changeset
   213
        'metadataplayer'=> URL_ROOT.'res/metadataplayer/LdtPlayer-core.js' ,
d366aa22bd79 New Metadataplayer version
Raphael Velt <raph.velt@gmail.com>
parents: 597
diff changeset
   214
        'ldtwidgets'    => URL_ROOT.'res/metadataplayer/' ,
656
635a86f25fe7 First tests for PT Protocol implementation
Raphael Velt <raph.velt@gmail.com>
parents: 633
diff changeset
   215
        'tracemanager'  => URL_ROOT.'res/js/tracemanager.js' ,
988
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   216
        'jwplayer-js'   => URL_ROOT.'res/js/jwplayer.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
   217
        'jquery-tinymce' => URL_ROOT.'res/js/tinymce/jquery.tinymce.min.js',
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
   218
        '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
   219
        'dashjs'         => URL_ROOT.'res/js/dashjs/dash.min.js',
0ae5202742bd change flash to dash
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1366
diff changeset
   220
        'videojs-dash'   => URL_ROOT.'res/js/dashjs/videojs-dash.min.js',
0ae5202742bd change flash to dash
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1366
diff changeset
   221
        'videojs'        => URL_ROOT.'res/js/videojs/video.min.js',
1499
641ced48fd5a Improve counter display in client by using twitter-text
ymh <ymh.work@gmail.com>
parents: 1494
diff changeset
   222
        '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
   223
    ),
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
   224
    'cdn' => array(
534
0a2505c3b547 New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents: 525
diff changeset
   225
        'libdir'        => URL_ROOT.'res/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
   226
        'jquery' 		=> 'http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js',
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
   227
        'raphael' 		=> URL_ROOT.'res/js/raphael-min.js',
1514
5869151a1f2f Upgrade various js dependencies
ymh <ymh.work@gmail.com>
parents: 1509
diff changeset
   228
        'jquery-ui' 	=> 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.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
   229
        'niceforms' 	=> URL_ROOT.'res/js/niceforms.js',
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
   230
        'jquery-url' 	=> URL_ROOT.'res/js/jquery.url.js',
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
   231
        'ldtplayer' 	=> URL_ROOT.'res/metadataplayer/src/js/LdtPlayer.js',
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
   232
        'fancybox' 		=> URL_ROOT.'res/js/fancybox/jquery.fancybox.pack.js',
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
   233
        'jquery-tools' 	=> 'http://cdn.jquerytools.org/1.2.7/all/jquery.tools.min.js',
1514
5869151a1f2f Upgrade various js dependencies
ymh <ymh.work@gmail.com>
parents: 1509
diff changeset
   234
        'jquery-migrate' => 'http://code.jquery.com/jquery-migrate-1.4.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
   235
        'tw-widget' 	=> 'http://widgets.twimg.com/j/2/widget.js',
988
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   236
        'jquery-mousewheel' => URL_ROOT.'res/js/jquery.mousewheel.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
   237
        'swfobject' 	=> 'http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js',
534
0a2505c3b547 New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents: 525
diff changeset
   238
        'json-js'       => URL_ROOT.'res/js/json2.js',
0a2505c3b547 New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents: 525
diff changeset
   239
        'underscore'    => URL_ROOT.'res/js/underscore-min.js' ,
1514
5869151a1f2f Upgrade various js dependencies
ymh <ymh.work@gmail.com>
parents: 1509
diff changeset
   240
        'jquery-scrollto'=>URL_ROOT.'res/js/jquery.scrollTo-2.1.2-min.js' ,
534
0a2505c3b547 New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents: 525
diff changeset
   241
        'twcx-main'     => URL_ROOT.'res/js/live-polemic.js' ,
0a2505c3b547 New metadata player and big directory reorganization
Raphael Velt <raph.velt@gmail.com>
parents: 525
diff changeset
   242
        'semanticboard' => URL_ROOT.'res/js/semanticboard.js' ,
598
d366aa22bd79 New Metadataplayer version
Raphael Velt <raph.velt@gmail.com>
parents: 597
diff changeset
   243
        'metadataplayer'=> URL_ROOT.'res/metadataplayer/LdtPlayer-core.js' ,
d366aa22bd79 New Metadataplayer version
Raphael Velt <raph.velt@gmail.com>
parents: 597
diff changeset
   244
        'ldtwidgets'    => URL_ROOT.'res/metadataplayer/' ,
656
635a86f25fe7 First tests for PT Protocol implementation
Raphael Velt <raph.velt@gmail.com>
parents: 633
diff changeset
   245
        'tracemanager'  => URL_ROOT.'res/js/tracemanager.js' ,
988
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   246
        'jwplayer-js'   => URL_ROOT.'res/js/jwplayer.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
   247
        'jquery-tinymce' => URL_ROOT.'res/js/tinymce/jquery.tinymce.min.js',
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
   248
        '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
   249
        '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
   250
        '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
   251
        'videojs'        => 'http://vjs.zencdn.net/5.12.6/video.js',
1499
641ced48fd5a Improve counter display in client by using twitter-text
ymh <ymh.work@gmail.com>
parents: 1494
diff changeset
   252
        '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
   253
    )
229
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 227
diff changeset
   254
);
143
2a3599a4b0f7 add #enmi page and some litlle corrections
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 119
diff changeset
   255
229
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 227
diff changeset
   256
$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
   257
    'local' => 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
   258
        'PT-Sans_Narrow' => URL_ROOT.'res/fonts/PTSansNarrow.css',
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
   259
        'PT-Sans' 		 => URL_ROOT.'res/fonts/PTSans.css'
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
   260
    ),
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
   261
    '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
   262
        'PT-Sans_Narrow' => 'http://fonts.googleapis.com/css?family=PT+Sans+Narrow&subset=latin',
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
   263
        'PT-Sans' 		 => 'http://fonts.googleapis.com/css?family=PT+Sans&subset=latin'
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
   264
    )
229
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 227
diff changeset
   265
);
216
d8c1b7e00533 sig chi paris 2011
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 207
diff changeset
   266
233
10d6fd6ce9ab - put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 229
diff changeset
   267
10d6fd6ce9ab - put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 229
diff changeset
   268
$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
   269
    'local' => 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
   270
       	'blueprint-screen' => URL_ROOT.'res/css/blueprint-screen.css',
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
        'blueprint-print' => URL_ROOT.'res/css/blueprint-print.css',
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
   272
        'blueprint-ie' => URL_ROOT.'res/css/blueprint-ie.css',
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
        'blueprint-plugins-fancy-type' => URL_ROOT.'res/css/blueprint-plugins/fancy-type/screen.css',
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
   274
        'custom' => URL_ROOT.'res/css/custom.css',
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
        'fancybox' => URL_ROOT.'res/js/fancybox/jquery.fancybox.css',
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
   276
        'jquery-ui' => URL_ROOT.'res/metadataplayer/res/css/jq-css/themes/base/jquery-ui.css',
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
   277
        'tabs-slideshow' => URL_ROOT.'res/css/tabs-slideshow.css',
469
99d105834315 Semantic board est maintenant dans les répertoires projets
Raphael Velt <raph.velt@gmail.com>
parents: 420
diff changeset
   278
        'tweetcast' => URL_ROOT.'res/css/tweetcast.css',
99d105834315 Semantic board est maintenant dans les répertoires projets
Raphael Velt <raph.velt@gmail.com>
parents: 420
diff changeset
   279
        'semanticboard' =>  URL_ROOT.'res/css/semanticboard.css',
495
34f92d5b2acf Added an archive embed for the IRI homepage
Raphael Velt <raph.velt@gmail.com>
parents: 491
diff changeset
   280
        'archives-iframe' => URL_ROOT.'res/css/archives-iframe.css',
598
d366aa22bd79 New Metadataplayer version
Raphael Velt <raph.velt@gmail.com>
parents: 597
diff changeset
   281
        'metadataplayer' => URL_ROOT.'res/metadataplayer/LdtPlayer-core.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
   282
        '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
   283
        'videojs' => URL_ROOT.'res/js/videojs/video-js.min.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
   284
    ),
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
   285
    '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
   286
        'blueprint-screen' => URL_ROOT.'res/css/blueprint-screen.css',
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
   287
        'blueprint-print' => URL_ROOT.'res/css/blueprint-print.css',
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
   288
        'blueprint-ie' => URL_ROOT.'res/css/blueprint-ie.css',
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
   289
        'blueprint-plugins-fancy-type' => URL_ROOT.'res/css/blueprint-plugins/fancy-type/screen.css',
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
   290
        'custom' => URL_ROOT.'res/css/custom.css',
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
   291
        'fancybox' => URL_ROOT.'res/js/fancybox/jquery.fancybox.css',
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
   292
        'jquery-ui' => "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/base/jquery-ui.css",
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
   293
        'tabs-slideshow' => URL_ROOT.'res/css/tabs-slideshow.css',
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
   294
        'tweetcast' => URL_ROOT.'res/css/tweetcast.css',
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
   295
        'semanticboard' =>  URL_ROOT.'res/css/semanticboard.css',
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
   296
        'archives-iframe' => URL_ROOT.'res/css/archives-iframe.css',
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
   297
        'metadataplayer' => URL_ROOT.'res/metadataplayer/LdtPlayer-core.css',
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
   298
        '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
   299
        '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
   300
    )
233
10d6fd6ce9ab - put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 229
diff changeset
   301
);
10d6fd6ce9ab - put all in a registry
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 229
diff changeset
   302
229
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 227
diff changeset
   303
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 227
diff changeset
   304
function registry_url($key, $type, $registry_def=null) {
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 227
diff changeset
   305
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
   306
    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
   307
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
   308
    if($registry_def != null) {
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
   309
        $registry = $registry_def;
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
   310
    }
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
   311
    elseif(isset($C_default_registry)) {
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
   312
        $registry = $C_default_registry;
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
    else {
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
   315
        $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
   316
    }
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
   317
    $registry_name = $type."_registry";
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
   318
    return ${
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
   319
        $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
   320
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 227
diff changeset
   321
}
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 227
diff changeset
   322
1295
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   323
function get_default_annotations_config($config, $translate) {
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   324
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   325
    $default_protocol_annotations = array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   326
        "1" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   327
            "default" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   328
                "colors" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   329
                    "h" => 0,
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   330
                    "s" => 0
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   331
                )
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   332
            ),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   333
            "positive" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   334
                "display_name" => "++ | Agree",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   335
                "keywords" => "\\+\\+",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   336
                "colors" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   337
                    "h" => .3,
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   338
                    "s" => .65
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   339
                ),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   340
                "colors_class" => "twbGreen",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   341
                "polemic_cat" => 'OK',
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   342
                "polemic_keywords" => array("++"),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   343
                "polemic_color" => "#1D973D"
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   344
            ),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   345
            "negative" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   346
                "display_name" => "-- | Disagree",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   347
                "keywords" => "\\-\\-",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   348
                "colors" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   349
                    "h" => 0,
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   350
                    "s" => .8
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   351
                ),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   352
                "colors_class" => "twbRed",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   353
                "polemic_cat" => 'KO',
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   354
                "polemic_keywords" => array("--"),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   355
                "polemic_color" => "#CE0A15"
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   356
            ),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   357
            "reference" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   358
                "display_name" => "== | Reference",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   359
                "keywords" => "\\=\\=",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   360
                "colors" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   361
                    "h" => .16,
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   362
                    "s" => .8
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   363
                ),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   364
                "colors_class" => "twbYellow",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   365
                "polemic_cat" => 'REF',
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   366
                "polemic_keywords" => array("==","http://"),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   367
                "polemic_color" => "#C5A62D"
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   368
            ),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   369
            "question" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   370
                "display_name" => "?? | Question",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   371
                "keywords" => "\\?\\?",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   372
                "colors" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   373
                    "h" => .6,
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   374
                    "s" => .8
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   375
                ),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   376
                "colors_class" => "twbBlue",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   377
                "polemic_cat" => 'Q',
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   378
                "polemic_keywords" => array("?","??"),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   379
                "polemic_color" => "#036AAE"
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   380
            )
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   381
        ),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   382
        "2" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   383
            "default" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   384
                "colors" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   385
                    "h" => 0,
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   386
                    "s" => 0
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   387
                )
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   388
            ),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   389
            "positive" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   390
                "display_name" => "++ | Remember",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   391
                "keywords" => "\\+\\+",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   392
                "colors" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   393
                    "h" => .3,
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   394
                    "s" => .65
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   395
                ),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   396
                "colors_class" => "twbGreen",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   397
                "polemic_cat" => 'OK',
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   398
                "polemic_keywords" => array("++"),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   399
                "polemic_color" => "#1D973D"
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   400
            ),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   401
            "negative" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   402
                "display_name" => "!! | Discuss",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   403
                "keywords" => "\\!\\!",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   404
                "colors" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   405
                    "h" => 0,
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   406
                    "s" => .8
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   407
                ),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   408
                "colors_class" => "twbRed",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   409
                "polemic_cat" => 'KO',
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   410
                "polemic_keywords" => array("!!"),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   411
                "polemic_color" => "#CE0A15"
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   412
            ),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   413
            "reference" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   414
                "display_name" => "== | Reference",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   415
                "keywords" => "\\=\\=",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   416
                "colors" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   417
                    "h" => .16,
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   418
                    "s" => .8
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   419
                ),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   420
                "colors_class" => "twbYellow",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   421
                "polemic_cat" => 'REF',
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   422
                "polemic_keywords" => array("==","http://"),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   423
                "polemic_color" => "#C5A62D"
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   424
            ),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   425
            "question" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   426
                "display_name" => "?? | Question",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   427
                "keywords" => "\\?\\?",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   428
                "colors" => array(
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   429
                    "h" => .6,
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   430
                    "s" => .8
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   431
                ),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   432
                "colors_class" => "twbBlue",
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   433
                "polemic_cat" => 'Q',
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   434
                "polemic_keywords" => array("?","??"),
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   435
                "polemic_color" => "#036AAE"
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   436
            )
1436
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   437
        ),
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   438
        "3" => array(
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   439
            "default" => array(
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   440
                "colors" => array(
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   441
                    "h" => 0,
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   442
                    "s" => 0
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   443
                )
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   444
            ),
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   445
            "important" => array( // blue
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   446
                "display_name" => "++ | Important",
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   447
                "keywords" => "\\+\\+",
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   448
                "colors" => array(
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   449
                    "h" => .6,
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   450
                    "s" => .8
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   451
                ),
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   452
                "polemic_cat" => 'OK',
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   453
                "polemic_keywords" => array("++"),
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   454
                "polemic_color" => "#196be6"
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   455
            ),
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   456
            "trouble" => array( // orange
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   457
                "display_name" => "?? | Trouble", 
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   458
                "keywords" => "\\?\\?",
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   459
                "colors" => array(
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   460
                    "h" => .13,
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   461
                    "s" => .8
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   462
                ),
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   463
                "polemic_cat" => 'KO',
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   464
                "polemic_keywords" => array("??"),
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   465
                "polemic_color" => "#e6b919"
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   466
            ),
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   467
            "index" => array( // violet
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   468
                "display_name" => "** | Index",
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   469
                "keywords" => "\\*\\*",
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   470
                "colors" => array(
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   471
                    "h" => .83,
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   472
                    "s" => .8
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   473
                ),
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   474
                "polemic_cat" => 'REF',
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   475
                "polemic_keywords" => array("**","http://"),
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   476
                "polemic_color" => "#e619e6"
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   477
            ),
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   478
            "comments" => array( // green
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   479
                "display_name" => "== | Comment",
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   480
                "keywords" => "\\=\\=",
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   481
                "colors" => array(
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   482
                    "h" => .3,
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   483
                    "s" => .65
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   484
                ),
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   485
                "polemic_cat" => 'Q',
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   486
                "polemic_keywords" => array("=="),
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   487
                "polemic_color" => "#42e619"
b3d23c1b791e Add hypothes.is protocol
ymh <ymh.work@gmail.com>
parents: 1435
diff changeset
   488
            )
1295
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
    );
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   491
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   492
    $annotation_protocol_version = isset($config['annotation_protocol_version'])?$config['annotation_protocol_version']:"1";
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   493
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   494
    $annotations_def = (isset($config['annotations']) && !empty($config['annotations']))?$config['annotations']:$default_protocol_annotations[$annotation_protocol_version];
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   495
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   496
    $annotations = array();
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   497
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   498
    foreach ($annotations_def as $annot_cat => $annot_def) {
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   499
        if(isset($annot_def['display_name'])) {
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   500
            $disp_parts = array_map('trim',explode("|",$annot_def['display_name']));
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   501
            if(count($disp_parts) > 1) {
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   502
                $disp_parts[1] = $translate->_($disp_parts[1]);
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   503
            }
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   504
            $annot_def['display_name'] = implode(" | ", $disp_parts);
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   505
        }
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   506
        $annotations[$annot_cat] = $annot_def;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   507
    }
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   508
    return $annotations;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   509
}
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   510
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   511
291
db1e6bfaa54e add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 287
diff changeset
   512
function get_archive_box($rep, $metadata, $url_root, $basepath, &$translate) {
229
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 227
diff changeset
   513
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
   514
    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
   515
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
   516
    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
   517
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
   518
    $id = "abox_$rep".(($metadata!=null)?"_$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
   519
    $hash = ($metadata!=null)?"#metadata=$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
   520
    $tail_img = $translate->_('config__archive_img');
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
   521
    if(is_array($tail_img)) {
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
   522
        $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
   523
    }
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
   524
    $archive_title = $translate->_('config__archive_title');
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
   525
    if(is_array($archive_title)) {
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
   526
        $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
   527
    }
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
   528
    $archive_description = $translate->_('config__archive_description');
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
   529
    if(is_array($archive_description)) {
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
   530
        $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
   531
    }
119
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   532
4c86151704e9 -TRADUCTION
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 99
diff changeset
   533
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
   534
    $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
   535
    $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
   536
    $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
   537
    $res .= "    </a>";
1412
8e51c6b8815f publish enmi17 sessions
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1408
diff changeset
   538
    $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
   539
    $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
   540
    $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
   541
    $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
   542
    $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
   543
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
   544
    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
   545
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 227
diff changeset
   546
}
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 227
diff changeset
   547
291
db1e6bfaa54e add translation for config data
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 287
diff changeset
   548
function display_archives_list($archives_list, $box_class, $url_root, $basepath, &$translate) {
1198
ff4b567d51f2 upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1196
diff changeset
   549
ff4b567d51f2 upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1196
diff changeset
   550
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
   551
    for($i=0;$i<count($archives_list);$i++) {
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
   552
        if(($i % 3)==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
   553
            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
   554
        }
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
   555
        $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
   556
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
   557
        $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
   558
        $metadata = null;
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
   559
        if(is_array($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
   560
            $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
   561
            $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
   562
        }
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
   563
        print(get_archive_box($archive_name,$metadata, $url_root, $basepath, $translate));
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
   564
        if(($i % 3)==2 || $i == (count($archives_list)-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
   565
            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
   566
        }
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
   567
    }
229
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 227
diff changeset
   568
}
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 227
diff changeset
   569
684
f59daf0830d2 less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents: 683
diff changeset
   570
function get_metadata_url($metadata) {
1244
87583b020202 put ldt platform url in config
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1242
diff changeset
   571
    global $project_url_base;
684
f59daf0830d2 less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents: 683
diff changeset
   572
    if (preg_match('/^https?:\/\//', $metadata)) {
f59daf0830d2 less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents: 683
diff changeset
   573
        return $metadata;
f59daf0830d2 less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents: 683
diff changeset
   574
    } else {
1244
87583b020202 put ldt platform url in config
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1242
diff changeset
   575
        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
   576
    }
f59daf0830d2 less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents: 683
diff changeset
   577
}
229
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 227
diff changeset
   578
684
f59daf0830d2 less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents: 683
diff changeset
   579
function get_metadata_json_url($metadata) {
f59daf0830d2 less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents: 683
diff changeset
   580
    if (is_array($metadata)) {
f59daf0830d2 less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents: 683
diff changeset
   581
        $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
   582
        return $metadata;
f59daf0830d2 less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents: 683
diff changeset
   583
    } else {
f59daf0830d2 less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents: 683
diff changeset
   584
        return get_metadata_url($metadata);
f59daf0830d2 less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents: 683
diff changeset
   585
    }
f59daf0830d2 less naive implementation of common LDT platform URL
Raphael Velt <raph.velt@gmail.com>
parents: 683
diff changeset
   586
}
988
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   587
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   588
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   589
$realm = 'Polemictweet restricted area';
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   590
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
   591
988
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   592
function authenticate($users, $translate) {
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   593
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
   594
    global $realm;
1198
ff4b567d51f2 upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1196
diff changeset
   595
1295
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   596
    $_SESSION['auth'] = 'polemictweet';
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   597
    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
   598
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
   599
    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
   600
        $_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
   601
        header('HTTP/1.1 401 Unauthorized');
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
   602
        header('WWW-Authenticate: Digest realm="'.$realm.
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
   603
        '",qop="auth",nonce="'.$_SESSION['http_digest_nonce'].'",opaque="'.md5($realm).'"');
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
        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
   605
    }
988
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   606
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   607
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
   608
    //analyze the PHP_AUTH_DIGEST variable
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
   609
    if (!($data = http_digest_parse($_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
   610
        !isset($users[$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
   611
        $_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
   612
        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
   613
        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
   614
        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
   615
    }
988
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   616
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   617
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
   618
    //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
   619
    $A1 = md5($data['username'] . ':' . $realm . ':' . $users[$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
   620
    $A2 = md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
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
    $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
   622
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
   623
    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
   624
        $_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
   625
        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
   626
        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
   627
        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
   628
    }
988
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   629
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
   630
    // 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
   631
    $_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
   632
    return $data;
988
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   633
}
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   634
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   635
function logout() {
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
   636
    global $realm;
1198
ff4b567d51f2 upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1196
diff changeset
   637
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
   638
    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
   639
    unset($_SESSION['http_digest_nonce']);
988
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   640
}
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   641
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   642
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   643
//function to parse the http auth header
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   644
function http_digest_parse($txt)
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   645
{
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
   646
    // protect against missing data
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
    $needed_parts = array('nonce'=>1, 'nc'=>1, 'cnonce'=>1, 'qop'=>1, 'username'=>1, 'uri'=>1, 'response'=>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
   648
    $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
   649
    $keys = implode('|', array_keys($needed_parts));
988
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   650
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
   651
    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
   652
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
   653
    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
   654
        $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
   655
        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
   656
    }
988
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   657
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
   658
    return $needed_parts ? false : $data;
988
954019f62866 update lib,
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 985
diff changeset
   659
}
1006
bb98a0de3bfd sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1003
diff changeset
   660
bb98a0de3bfd sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1003
diff changeset
   661
/**
bb98a0de3bfd sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1003
diff changeset
   662
 * 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
   663
 */
bb98a0de3bfd sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1003
diff changeset
   664
function slugify($text)
bb98a0de3bfd sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1003
diff changeset
   665
{
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
   666
    // replace non letter or digits by -
1423
a6ed32f6dbcf add 2018 preparatoire
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1414
diff changeset
   667
    $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
   668
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
   669
    // 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
   670
    $text = trim($text, '-');
1006
bb98a0de3bfd sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1003
diff changeset
   671
1423
a6ed32f6dbcf add 2018 preparatoire
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1414
diff changeset
   672
    $transliterator = Transliterator::create(
a6ed32f6dbcf add 2018 preparatoire
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1414
diff changeset
   673
        'NFD; [:Nonspacing Mark:] Remove; NFC;'
a6ed32f6dbcf add 2018 preparatoire
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1414
diff changeset
   674
    );
a6ed32f6dbcf add 2018 preparatoire
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1414
diff changeset
   675
    $text = $transliterator->transliterate($text);
1006
bb98a0de3bfd sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1003
diff changeset
   676
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
   677
    // 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
   678
    $text = strtolower($text);
1006
bb98a0de3bfd sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1003
diff changeset
   679
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
   680
    // 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
   681
    $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
   682
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
   683
    if (empty($text))
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
   684
    {
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
   685
        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
   686
    }
1006
bb98a0de3bfd sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1003
diff changeset
   687
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
   688
    return $text;
1006
bb98a0de3bfd sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1003
diff changeset
   689
}
bb98a0de3bfd sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1003
diff changeset
   690
bb98a0de3bfd sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1003
diff changeset
   691
bb98a0de3bfd sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1003
diff changeset
   692
// from http://www.house6.com/blog/?p=83
bb98a0de3bfd sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1003
diff changeset
   693
function sanitize_filename($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
   694
    // 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
   695
    // 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
   696
    // 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
   697
    // 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
   698
    // 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
   699
    $replace_chars = 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
   700
            'Š'=>'S', 'š'=>'s', 'Ð'=>'Dj','Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'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
   701
            'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I',
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
   702
            'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U',
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
   703
            'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss','à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'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
   704
            'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i',
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
   705
            'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u',
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
            'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b', 'ÿ'=>'y', 'ƒ'=>'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
   707
    );
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
    $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
   709
    // 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
   710
    $f = preg_replace(array('/[\&]/', '/[\@]/', '/[\#]/'), array('-and-', '-at-', '-number-'), $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
   711
    $f = preg_replace('/[^(\x20-\x7F)]*/','', $f); // removes any special chars we missed
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
   712
    $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
   713
    $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
   714
    $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
   715
    $f = preg_replace('/[\-]+/', '-', $f); // converts groups of hyphens into one
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
   716
    if (function_exists('iconv'))
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
   717
    {
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
        $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
   719
    }
1198
ff4b567d51f2 upgrade metadataplayer and add annotation creation
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1196
diff changeset
   720
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
   721
    return strtolower($f);
1006
bb98a0de3bfd sanitize filenames for hardheaded users
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1003
diff changeset
   722
}
1295
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   723
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   724
function rgb2hex($rgb) {
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   725
   $hex = "#";
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   726
   $hex .= str_pad(dechex($rgb[0]), 2, "0", STR_PAD_LEFT);
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   727
   $hex .= str_pad(dechex($rgb[1]), 2, "0", STR_PAD_LEFT);
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   728
   $hex .= str_pad(dechex($rgb[2]), 2, "0", STR_PAD_LEFT);
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   729
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   730
   return $hex; // returns the hex value including the number sign (#)
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   731
}
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   732
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   733
function hsl2Rgb( $h, $s, $l ){
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   734
    $r;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   735
    $g;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   736
    $b;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   737
	$c = ( 1 - abs( 2 * $l - 1 ) ) * $s;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   738
	$x = $c * ( 1 - abs( fmod( ( $h / 60 ), 2 ) - 1 ) );
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   739
	$m = $l - ( $c / 2 );
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   740
	if ( $h < 60 ) {
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   741
		$r = $c;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   742
		$g = $x;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   743
		$b = 0;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   744
	} else if ( $h < 120 ) {
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   745
		$r = $x;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   746
		$g = $c;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   747
		$b = 0;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   748
	} else if ( $h < 180 ) {
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   749
		$r = 0;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   750
		$g = $c;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   751
		$b = $x;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   752
	} else if ( $h < 240 ) {
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   753
		$r = 0;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   754
		$g = $x;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   755
		$b = $c;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   756
	} else if ( $h < 300 ) {
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   757
		$r = $x;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   758
		$g = 0;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   759
		$b = $c;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   760
	} else {
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   761
		$r = $c;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   762
		$g = 0;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   763
		$b = $x;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   764
	}
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   765
	$r = ( $r + $m ) * 255;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   766
	$g = ( $g + $m ) * 255;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   767
	$b = ( $b + $m  ) * 255;
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   768
    return array( floor( $r ), floor( $g ), floor( $b ) );
03d2aa7b4967 change default protocol
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 1293
diff changeset
   769
}