web/common.php
changeset 248 ffb0a6d08000
parent 235 ca008aef675f
child 240 ee6305b4a7dc
--- a/web/common.php	Wed Jul 27 12:24:43 2011 +0200
+++ b/web/common.php	Wed Jul 27 12:25:45 2011 +0200
@@ -10,8 +10,27 @@
     . PATH_SEPARATOR . get_include_path()
 );
 
+/**
+* Base configuration
+*/
+$C_default_rep = 'sig-chi-paris-2011';
+
+$configuration = array(
+    'siteUrl'        => 'http://twitter.com/oauth',
+    'consumerKey' 	 => '***REMOVED***',
+    'consumerSecret' => '***REMOVED***'
+);
+
+
+$req_rep = $C_default_rep;
+if(isset($config) && isset($config['rep'])) {
+	$req_rep = $config['rep'];
+}
 
 include_once dirname(__FILE__).'/traduction.php';
+if(file_exists(dirname(__FILE__)."/$req_rep/traduction.php")) {
+	include_once dirname(__FILE__)."/$req_rep/traduction.php";
+}
 
 
 /**
@@ -34,6 +53,10 @@
  * Include the configuration data for our OAuth Client (array $configuration)
  */
 include_once dirname(__FILE__).'/config.php';
+ 
+
+$configuration['callbackUrl'] = URL_ROOT."$req_rep/callback.php";
+
 
 /**
  * Setup an instance of the Consumer for use
@@ -79,37 +102,149 @@
 	
 }
 
-/* NEXT CONFERENCE AND CLIENT PAGE INFORMATION
-*/
-/* CLIENT VAR LIVE */
+$js_registry = array(
+	'local' => array(
+	    'jquery' => URL_ROOT.'res/js/jquery-1.4.3.min.js',
+	    'raphael' => URL_ROOT.'res/raphael/raphael-min.js',
+	    'jquery-ui' => URL_ROOT.'res/js/jquery-ui-1.8.13.min.js',
+	    'niceforms' => URL_ROOT.'res/niceforms/niceforms.js',
+	    'jquery-url' => URL_ROOT.'res/js/jquery.url.js',
+	    'ldtplayer' => URL_ROOT.'res/metadataplayer/src/js/LdtPlayer.js',
+		'fancybox' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.fancybox-1.3.4.pack.js',
+		'jquery-tools' => URL_ROOT.'res/metadataplayer/res/js/jquery.tools.min.js',
+		'tw-widget' => URL_ROOT.'res/js/tw_widget.js',
+		'jquery-mousewheel' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.mousewheel-3.0.4.pack.js',
+		'swfobject' => 'http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js',
+	),
+	'cdn' => array(
+	    'jquery' => 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js',
+		'raphael' => URL_ROOT.'res/raphael/raphael-min.js',
+		'jquery-ui' => 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js',
+		'niceforms' => URL_ROOT.'res/niceforms/niceforms.js',
+		'jquery-url' => URL_ROOT.'res/js/jquery.url.js',
+		'ldtplayer' => URL_ROOT.'res/metadataplayer/src/js/LdtPlayer.js',
+		'fancybox' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.fancybox-1.3.4.pack.js',
+		'jquery-tools' => 'http://cdn.jquerytools.org/1.2.4/all/jquery.tools.min.js',
+		'tw-widget' => 'http://widgets.twimg.com/j/2/widget.js',
+		'jquery-mousewheel' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.mousewheel-3.0.4.pack.js',
+		'swfobject' => 'http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js',
+	)
+);
 
-$C_hashtag	= "#mashup";
-$C_link 	= "http://www.forumdesimages.fr/fdi/Festivals-et-evenements/mashup-Film-Festival/Mashup-remix-detournements-nouveaux-usages-des-images-sur-les-reseaux-sociaux";
-$C_title 	= "Mashup, remix, détournements : nouveaux usages des images sur les réseaux sociaux";
-$C_abstract = "Mashup, remix, détournements Conférence Laurence Allard
-25  Juin à 15h Salle Piazza 
-au Forum des Images";
-$C_REP   = "mashup/";
-$C_description  = "
-	Par le biais d'internet, les individus expriment,
-	 à leurs proches ou à des publics lointains,
-	 leurs opinions ou leurs goûts en faisant leurs  des contenus qu'ils apprécient ou qui les révoltent.
-	 Quelques uns vont  s'exprimer en partageant ou commentant ces contenus tandis que d'autres
-	 iront plus loin dans l'appropriation en transformant à des degrés divers
-	 des images sons ou textes à travers lesquels ils vont dire quelque chose
-	 d'eux-mêmes et de leurs relations au monde. Ce sont de telles pratiques  de remixes 
-	qui seront présentées pour comprendre ce qui se dit ainsi sur Internet.
-	 Détourner pour protester ou au contraire exprimer une passion  ;
-	 re-créer pour raconter autrement des événements ou les mashuper pour en montrer le non sens...
-	 Différents procédés et différents discours que cette conférence nourrie de nombreux exemples historiques et contemporains,
-	 issus d'artistes ou d'internautes ordinaires, se proposent de mettre en lumière. 
-<br/><br/>
-	Laurence Allard, sociologue et sémiologue est maître de conférences à  l'université de Lille III, UFR Arts et Culture.
-	 Elle s'intéresse particulièrement aux relations entre culture, politique et technique  (p2p, blogs, creative commons, artivisme...) en mobilisant les apports  des gender, cultural et post colonial studies.";
-
-$C_partenaires  = 	"<a href='http://www.iri.centrepompidou.fr/' class='footerLink' target='_blank'> IRI </a>
-		 |  <a href='http://www.forumdesimages.fr/' class='footerLink' target='_blank' > Forum des images  </a>
-		 |  <a href='http://www.inflammableproductions.com/' class='footerLink' target='_blank'> Inflammable  </a>";
-$C_islive = false;
+$font_registry = array(
+	'local' => array(
+		'PT-Sans_Narrow' => URL_ROOT.'res/fonts/PT_Sans-Narrow-Web-Regular.css',
+		'PT-Sans' => URL_ROOT.'res/fonts/PT_Sans-Web-Regular.css',
+		'Geo' => URL_ROOT.'res/fonts/Geo-Regular.css'
+	),
+	'cdn' => array(
+		'PT-Sans_Narrow' => 'http://fonts.googleapis.com/css?family=PT+Sans+Narrow&subset=latin',
+		'PT-Sans' => 'http://fonts.googleapis.com/css?family=PT+Sans&subset=latin',
+		'Geo' => 'http://fonts.googleapis.com/css?family=Geo&subset=latin'
+	)
+);
 
 
+$css_registry = array(
+	'local' => array(
+	   	'blueprint-screen' => URL_ROOT.'res/blueprint/screen.css',
+		'blueprint-print' => URL_ROOT.'res/blueprint/print.css',
+		'blueprint-ie' => URL_ROOT.'res/blueprint/ie.css',
+		'blueprint-plugins-fancy-type' => URL_ROOT.'res/blueprint/plugins/fancy-type/screen.css',
+		'custom' => URL_ROOT.'res/css/custom.css',
+		'fancybox' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.fancybox-1.3.4.css',
+		'jquery-ui' => "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/base/jquery-ui.css",
+		'tabs-slideshow' => URL_ROOT.'res/css/tabs-slideshow.css',
+	),
+	'cdn' => array(
+		'blueprint-screen' => URL_ROOT.'res/blueprint/screen.css',
+		'blueprint-print' => URL_ROOT.'res/blueprint/print.css',
+		'blueprint-ie' => URL_ROOT.'res/blueprint/ie.css',
+		'blueprint-plugins-fancy-type' => URL_ROOT.'res/blueprint/plugins/fancy-type/screen.css',
+		'custom' => URL_ROOT.'res/css/custom.css',
+		'fancybox' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.fancybox-1.3.4.css',
+		'jquery-ui' => "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/base/jquery-ui.css",
+		'tabs-slideshow' => URL_ROOT.'res/css/tabs-slideshow.css',
+	)
+);
+
+$archives_list = array(
+    "rsln", "rsln-opendata", "rsln-mercedes-bunz",
+	"enmi2011-technologie-confiance", "CPV", "fens_FabLab_Design_Metadata",
+	array("mashup","conference"), array("mashup","tableronde"), "sig-chi-paris-2011"
+);
+
+function registry_url($key, $type, $registry_def=null) {
+
+	global $js_registry, $font_registry, $css_registry, $C_default_registry;
+
+	if($registry_def != null) {
+		$registry = $registry_def;
+	}
+	elseif(isset($C_default_registry)) {
+		$registry = $C_default_registry;
+	}
+	else {
+		$registry = 'local';
+	}
+	$registry_name = $type."_registry";
+	return ${
+		$registry_name}[$registry][$key];
+
+}
+
+function get_archive_box($rep, $metadata, $url_root, $basepath) {
+
+	include("$basepath$rep/config.php");
+
+	$id = "abox_$rep".(($metadata!=null)?"_$metadata":"");
+	$hash = ($metadata!=null)?"#metadata=$metadata":"";
+	$tail_img = $config['archive_img'];
+	if(is_array($tail_img)) {
+		$tail_img = $tail_img[$metadata];
+	}
+	$archive_title = $config['archive_title'];
+	if(is_array($archive_title)) {
+		$archive_title = $archive_title[$metadata];
+	}
+	$archive_description = $config['archive_description'];
+	if(is_array($archive_description)) {
+		$archive_description = $archive_description[$metadata];
+	}
+
+
+	$res  = "<div id=\"$id\" class=\"archivesVideoBox\">\n";
+	$res .= "    <a href=\"$rep/polemicaltimeline.php$hash\">\n";
+	$res .= "        <img src=\"$url_root$rep/$tail_img\" width=\"270\" height=\"150\"/>";
+	$res .= "    </a>";
+	$res .= "    <div class=\"AVBtitle\">$archive_title</div>\n";
+	$res .= "    <div class=\"AVBtext\">\n";
+	$res .= "        $archive_description\n";
+	$res .= "    </div>\n";
+	$res .= "</div>\n";
+
+	return $res;
+
+}
+
+function display_archives_list($archives_list, $box_class, $url_root, $basepath) {
+	for($i=0;$i<count($archives_list);$i++) {
+		if(($i % 3)==0) {
+			print("			    <div class=\"$box_class\">\n");
+		}
+		$archive_ref = $archives_list[$i];
+	
+		$archive_name = $archive_ref;
+		$metadata = null;
+		if(is_array($archive_ref)) {
+			$archive_name = $archive_ref[0];
+			$metadata = $archive_ref[1];
+		}
+		print(get_archive_box($archive_name,$metadata, $url_root, $basepath));
+		if(($i % 3)==2 || $i == (count($archives_list)-1)) {
+			print("			    </div>\n");
+		}
+	}
+}
+
+