web/polemicaltimeline.php
author Raphael Velt <raph.velt@gmail.com>
Fri, 11 May 2012 16:43:23 +0200
changeset 605 fa18327a3777
parent 598 d366aa22bd79
child 620 953c68b4da79
permissions -rwxr-xr-x
Added tag V01.76 for changeset 8c881ff9b527

<?php

/**
 * include some common code (like we did in the 90s)
 * People still do this? ;)
 */
$rep = $_REQUEST['rep'];
include_once dirname(__FILE__).'/'.$rep.'/config.php';
// configuration
include 'common.php';
 // objet actuel
$baseurl = URL_ROOT;

$div_height = 640;
if($translate->_('config__div_height') != 'config__div_height') {
	$div_height = $translate->_('config__div_height');
}
$tweet_explain_background = URL_ROOT.'images/tweetExplainBgd.gif';
if(file_exists(dirname(__FILE__)."/$rep/images/tweetExplainBgd.gif")) {
	$tweet_explain_background = URL_ROOT.$rep.'/images/tweetExplainBgd.gif';
}

$head_logo = URL_ROOT."$rep/images/head_logo.gif";
if($translate->_('config__head_logo') != 'config__head_logo' && $translate->_('config__head_logo') != null ) {
    $head_logo = URL_ROOT."$rep/".$translate->_('config__head_logo');
}

$url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="<?php echo($actual); ?>">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Polemic tweet - <?php echo($translate->_('config__title')); ?></title>
	<meta name="keywords" content="<?php echo($translate->_('config__keywords')); ?>"><!-- add timestampedmetadata -->
	<!--<meta name="description" content="PoelmicTweet.fr : debate mapping, opinion, conference, video">-->
	<meta name="description" content="<?php echo(strip_tags($translate->_('config__description'))); ?>">
	<meta name="robots" content="index, follow">
	
	<!-- ICI : <?php echo($_SERVER['DOCUMENT_ROOT']); ?> -->
	<!-- JAVASCRIPT -->
	<script type="text/javascript" src="<?php echo(registry_url('json-js','js'));?>"></script>
	<script type="text/javascript" src="<?php echo(registry_url('jquery','js'));?>"></script>
	<script type="text/javascript">
		$.noConflict();
	</script>
	<script type="text/javascript" src="<?php echo(registry_url('fancybox','js'));?>"></script>
	<script type="text/javascript" src="<?php echo(registry_url('jquery-url','js'));?>"></script>
	<script type="text/javascript" src="<?php echo(registry_url('metadataplayer','js'));?>"></script>
		
	<!-- Framework CSS -->
    <link rel="stylesheet" href="<?php echo(registry_url('tweetcast','css'));?>" type="text/css" media="screen, projection"/>
	<link rel="stylesheet" href="<?php echo(registry_url('fancybox','css'));?>" media="screen"/>
	
	<!-- FONT -->
	<link href='<?php echo(registry_url('PT-Sans_Narrow','font'));?>' rel='stylesheet' type='text/css'/>
	<link href='<?php echo(registry_url('PT-Sans','font'));?>' rel='stylesheet' type='text/css'/>
	
	
	<script type="text/javascript">
  		// Configuration Polemical Timeline
	if (typeof jQuery == "undefined") {
	    jQuery = IriSP.jQuery;
	}
	<?php
  		if(is_array($translate->_('config__metadata'))):
		reset($translate->_('config__metadata'));
	    $first_key = key($translate->_('config__metadata'));
	?>
	var metadatas = jQuery.parseJSON('<?php echo(json_encode($translate->_('config__metadata'))); ?>');
	var url = jQuery.url();
	var metadata_key = url.fparam('metadata');
	if(typeof metadata_key === "undefined" || metadata_key.length === 0) {
		metadata_key = "<?php echo($first_key);?>";
	}
	<?php else: ?>
	var metadatas = { metadata: {url: "<?php echo($translate->_('config__metadata'));?>"} };
	var metadata_key = "metadata";
	<?php endif;?>
  		
	
    IriSP.libFiles.defaultDir = "<?php echo(registry_url('libdir','js'));?>";
    IriSP.widgetsDir = "<?php echo(registry_url('ldtwidgets','js'));?>";
    IriSP.jwplayer_swf_path = "<?php echo(URL_ROOT); ?>res/mediaplayer/player.swf";
    IriSP.language = "<?php echo($actual) ?>";
    
    var _metadata = {
        url: metadatas[metadata_key].url + '?callback=?',
        format: 'ldt'
    };
    var _config = {            
        gui: {
            width: 600,
            height: 800,
            container: 'LdtPlayer',
            default_options: {
                metadata: _metadata
            },
            css:'<?php echo(registry_url('metadataplayer','css'));?>',
            widgets: [
                { type: "Polemic" },
                { type: "Slider" },
                {
                    type: "Controller",
                    disable_annotate_btn: true
                },
                { type: "Segments" },
                { type: "Arrow" },
                { type: "Annotation" },
                { type: "Tweet" },
                {
                    type: "Tagcloud",
                    container: "TagcloudContainer",
                    exclude_pattern: /^@/,
                    custom_stopwords: <?php echo json_encode(array($config['hashtag'])) ?>
                },
                {
                    type: "AnnotationsList",
                    //ajax_url : "http://ldt.iri.centrepompidou.fr/ldtplatform/api/ldt/segments/{{media}}/{{begin}}/{{end}}?callback=?", 
                    //foreign_url : "http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/{{media}}/{{project}}/{{annotationType}}#id={{annotation}}",
                    container: "AnnotationsListContainer"
                },
                { type: "Mediafragment"},
            ]
        },
        player:{
            type:'jwplayer', // player type
            live: true, 
            height: 360, 
            width: 600, 
            provider: "rtmp",
            autostart: true
        }
    };

		jQuery(document).ready(function() {
			
			jQuery("#mdselect_"+metadata_key).attr("selected","selected");
			jQuery("#mdselect").change(function() {
				var metadata_key = this.options[this.selectedIndex].value;
				window.location.hash = "#metadata="+metadata_key;
				window.location.href = window.location.href;
				window.location.reload(true);
				jQuery(".embedbutton").attr('href','<?php echo(URL_ROOT.$rep);?>/embed_form.php?metadata='+metadata_key);
			});
			if(metadata_key !== "metadata") {
				jQuery(".embedbutton").attr('href','<?php echo(URL_ROOT.$rep);?>/embed_form.php?metadata='+metadata_key);
			}
			jQuery(".embedbutton").fancybox({
				'width'				: 360,
				'height'			: 360,
				'autoDimensions'	: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
			jQuery(".acctitre").click(function() {
			    var _nx = jQuery(this).next();
			    if (_nx.is(":hidden")) {
    			    jQuery(".acctexte").slideUp();
    			    _nx.slideDown();
			    }
			})
			
		});
	</script>
	<script type="text/javascript">
		var _gaq = _gaq || [];
		_gaq.push(['_setAccount', 'UA-23581291-1']);
		_gaq.push(['_trackPageview', location.pathname + location.search + location.hash]);
		_gaq.push(['_setAllowAnchor', true]);
	  
		(function() {
		    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
		    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
		    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
		})();
	</script>
  </head>
  <body>
  <div id="sendUsFeedBack"><a href="<?php echo($C_feedback_form_url); ?>" target="_blank"><img src="<?php echo(URL_ROOT); ?>images/sendusfeedback.png"></a></div>

  <!-- tooltip -->
  </div>

    <div id="container">
        <div class="barre">
            <img id="headlogo" src="<?php echo($head_logo); ?>" width="171" height="63" />
            <div id="minilogo"></div>
            <ul class="menu">
                <li>
                    <a href="<?php echo(URL_ROOT); ?>" class="menuLink">
                        <?php print $translate->_("Accueil"); ?>
                    </a>
                </li>
                <li>
                    <a href="<?php echo($translate->_('config__link')); ?>" class="menuLink" target="_blank" id='Program'>
                        <?php print $translate->_("Programme"); ?>
                    </a>
                </li>
                <li>
                    <a href="../about.php" class="menuLink" >
                        <?php print $translate->_("A propos"); ?>
                    </a>
                </li>
            </ul>
            <ul class="menu">
                <li>
                    <a href="<?php URL_ROOT ?>client.php?lang=ja_JP" class="menuLink" >
                        <img src='<?php echo(URL_ROOT); ?>images/flag_jp.gif'<?php if($actual!="ja_JP"){echo("style='opacity: .5;'"); } ?> />
                        <?php print $translate->_("Japonais"); ?>
                    </a></li>
                <li>
                    <a href="<?php URL_ROOT ?>client.php?lang=fr" class="menuLink">
                        <img src='<?php echo(URL_ROOT); ?>images/flag_fr.gif' <?php if($actual!="fr"){echo("style='opacity: .5;'"); } ?> />
                        <?php print $translate->_("Français"); ?>
                    </a>
                </li>
                <li>
                    <a href="<?php URL_ROOT ?>client.php?lang=en" class="menuLink">
                        <img src='<?php echo(URL_ROOT); ?>images/flag_en.gif' <?php if($actual!="en"){echo("style='opacity: .5;'"); } ?> />
                        <?php print $translate->_("Anglais"); ?>
                    </a>
                </li>
            </ul>
                    
    <?php if(is_array($translate->_('config__metadata'))): ?>
    <ul id="content_select_ul" class="menu mdselect">
        <span><?php print $translate->_("changer de contenu"); ?></span><br/>
        <select id="mdselect">
            <?php foreach ($translate->_('config__metadata') as $key => $value):?>
            <option value="<?php echo($key); ?>" id="mdselect_<?php echo($key); ?>" ><?php echo($value['display']); ?></option>
            <?php endforeach;?>
        </select>
    </ul>
    <?php endif;?>
            <div class="embedbar">
                <a class="embedbutton" href="<?php echo(URL_ROOT.$rep)?>/embed_form.php">Intégrer</a>
                <!-- AddThis Button BEGIN -->
                <div class="addthis_toolbox addthis_default_style addthis_32x32_style">
                    <a class="addthis_button_facebook"></a>
                    <a class="addthis_button_twitter"></a>
                    <a class="addthis_button_email"></a>
                    <a class="addthis_button_compact"></a>
                </div>
                <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>
                <!-- AddThis Button END -->
            </div>
        </div>

	<!-- EXPLICATION  -->
	<div id="mdpgauche">
       <div id="out_fleche"></div>
        <ul id="accordeon">
            <li class="acctitre">
                <h3><?php echo($translate->_('config__title')); ?></h3>
            </li>
            <li class="acctexte">
                <p><?php echo($translate->_('config__description')); ?></p>
            </li>
            <li class="acctitre">
                <h3>Liste des Annotations</h3>
            </li>
            <li class="acctexte" style="display: none;">
                <div id="AnnotationsListContainer"></div>
            </li>
            <li class="acctitre">
                <h3>Mots-clés</h3>
            </li>
            <li class="acctexte" style="display: none;">
                <div id="TagcloudContainer"></div>
            </li>
        </ul>
		
	  </div>
	 
	  
	  <!-- INFOS SUR LA CONF
	  	<div class="tweetExplain"  >
		<h3 class="tweetWriterTitle"></h3><br/>
			
	  </div>
	  -->




	  <div id="mdpdroite" >
		<div id="LdtPlayer"></div>
	  </div>
<script type="text/javascript">
    var _myPlayer = new IriSP.Metadataplayer(_config, _metadata);
</script>
  </div>
 
      <div class="footer">
          
		<hr>
			<?php echo($translate->_('config__partenaires')); ?>
	  </div>
	
    </div>

  </body>
</html>