web/client.php
changeset 1571 4a1e6952afe5
parent 1560 d441b50586ba
child 1573 43dc356e3ff8
--- a/web/client.php	Tue Oct 22 10:01:37 2024 +0200
+++ b/web/client.php	Thu Nov 07 22:38:14 2024 +0100
@@ -11,11 +11,11 @@
 
 include_once 'common.php';
 
-
 /**
  * Do we already have a valid Access Token or need to go get one?
  */
-if (!isset($_SESSION['SOCIAL_ACCESS_TOKEN']) && isset($_GET['CONNECT']) ) {
+if ((!isset($_SESSION['SOCIAL_ACCESS_TOKEN'])) && isset($_GET['CONNECT']) ) {
+    
     // /**
     //  * Guess we need to go get one!
     //  */
@@ -135,8 +135,11 @@
     </style>
 
     <script type="text/javascript">
+        var social_login_domain = "<?php echo($_SESSION['SOCIAL_LOGIN_DOMAIN']); ?>";
+        var social_access_token = "<?php echo(unserialize($_SESSION['SOCIAL_ACCESS_TOKEN'])); ?>";
+        var social_network = '<?php echo($config['social_network']); ?>' || 'Twitter';
+        var social_group = "<?php echo($config['group']); ?>";
         <?php
-        echo "var social_network = '".$config['social_network']."';";
         if (isset($config['tracking_keywords']) && count($config['tracking_keywords'])) {
             echo "var tracking_keywords = ".json_encode($config['tracking_keywords']).';';
         } elseif (isset($config['hashtag'])) {
@@ -156,9 +159,8 @@
         }
     </script>
     <?php if (isset($_SESSION['SOCIAL_ACCESS_TOKEN'])) { ?>
-    <script type="text/javascript" src="<?php echo(URL_ROOT); ?>res/js/live-polemic.js"></script>
+    <script type="text/javascript" src="<?php echo(URL_ROOT); ?>res/js/live-polemic.js" ></script>
     <?php } ?>
-
     <script type="text/javascript">
 
     function add_grammar(value) {
@@ -268,7 +270,6 @@
                 return false;
             });
 
-
         });
 
         // hightlight
@@ -282,6 +283,7 @@
             $("<?php echo $_REQUEST['highlight'];?>").delay(1000).effect("<?php echo $effect; ?>", {}, 5000);
         });
         <?php } ?>
+
         //<!-- LIMIT TEXTAREA:
         // End -->
 
@@ -303,30 +305,6 @@
                     ?>
                     <!-- cf. https://sharingbuttons.io/ -->
                     <div class="share_toolbox">
-                        <!-- Sharingbutton Twitter -->
-                        <a class="resp-sharing-button__link" href="https://twitter.com/intent/tweet/?text=<?php echo urlencode("$share_title - $share_url"); ?>&amp;url=<?php echo rawurlencode($share_url); ?>" target="_blank" rel="noopener" aria-label="">
-                          <div class="resp-sharing-button resp-sharing-button--twitter resp-sharing-button--small"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
-                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M23.44 4.83c-.8.37-1.5.38-2.22.02.93-.56.98-.96 1.32-2.02-.88.52-1.86.9-2.9 1.1-.82-.88-2-1.43-3.3-1.43-2.5 0-4.55 2.04-4.55 4.54 0 .36.03.7.1 1.04-3.77-.2-7.12-2-9.36-4.75-.4.67-.6 1.45-.6 2.3 0 1.56.8 2.95 2 3.77-.74-.03-1.44-.23-2.05-.57v.06c0 2.2 1.56 4.03 3.64 4.44-.67.2-1.37.2-2.06.08.58 1.8 2.26 3.12 4.25 3.16C5.78 18.1 3.37 18.74 1 18.46c2 1.3 4.4 2.04 6.97 2.04 8.35 0 12.92-6.92 12.92-12.93 0-.2 0-.4-.02-.6.9-.63 1.96-1.22 2.56-2.14z"/></svg>
-                            </div>
-                          </div>
-                        </a>
-
-                        <!-- Sharingbutton Facebook -->
-                        <a class="resp-sharing-button__link" href="https://facebook.com/sharer/sharer.php?t=<?php echo rawurlencode($share_title); ?>&amp;u=<?php echo rawurlencode($share_url); ?>" target="_blank" rel="noopener" aria-label="">
-                          <div class="resp-sharing-button resp-sharing-button--facebook resp-sharing-button--small"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
-                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.77 7.46H14.5v-1.9c0-.9.6-1.1 1-1.1h3V.5h-4.33C10.24.5 9.5 3.44 9.5 5.32v2.15h-3v4h3v12h5v-12h3.85l.42-4z"/></svg>
-                            </div>
-                          </div>
-                        </a>
-
-                        <!-- Sharingbutton Telegram -->
-                        <a class="resp-sharing-button__link" href="https://telegram.me/share/url?text=<?php echo rawurlencode("$share_description"); ?>&amp;url=<?php echo rawurlencode($share_url); ?>" target="_blank" rel="noopener" aria-label="">
-                          <div class="resp-sharing-button resp-sharing-button--telegram resp-sharing-button--small"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
-                              <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M.707 8.475C.275 8.64 0 9.508 0 9.508s.284.867.718 1.03l5.09 1.897 1.986 6.38a1.102 1.102 0 0 0 1.75.527l2.96-2.41a.405.405 0 0 1 .494-.013l5.34 3.87a1.1 1.1 0 0 0 1.046.135 1.1 1.1 0 0 0 .682-.803l3.91-18.795A1.102 1.102 0 0 0 22.5.075L.706 8.475z"/></svg>
-                            </div>
-                          </div>
-                        </a>
-
                         <!-- Sharingbutton E-Mail -->
                         <a class="resp-sharing-button__link" href="mailto:?subject=<?php echo rawurlencode($share_title); ?>&amp;body=<?php echo rawurlencode("$share_description - $share_url"); ?>" target="_self" rel="noopener" aria-label="">
                           <div class="resp-sharing-button resp-sharing-button--email resp-sharing-button--small"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
@@ -393,7 +371,7 @@
                         <h3><?php echo($translate->_('config__title')); ?></h3>
                     </li>
                     <li class="acctexte acclimited" id="event-description">
-                        <p><?php echo($translate->_('config__description')); ?></p>
+                        <?php echo($translate->_('config__description')); ?>
                     </li>
                     <li class="acctitre">
                         <h3><?php echo($translate->_('keywords')); ?></h3>
@@ -424,7 +402,7 @@
                     </li>
                 </ul>
                 <p id="iri_logo" style="text-align:right;">
-                    Powered by <a href="http://www.iri.centrepompidou.fr" target="_blank"><img src="<?php echo(URL_ROOT); ?>images/logo_iri_bleu_transparent_petit.png" alt="logo IRI"/></a
+                    Powered by <a href="http://www.iri.centrepompidou.fr" target="_blank"><img src="<?php echo(URL_ROOT); ?>images/logo_iri_bleu_transparent_petit.png" alt="logo IRI"/></a>
                 </p>
             </div>
             <div id="colgauche">
@@ -451,7 +429,7 @@
                     <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;'"); } ?> />
+                                <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>
@@ -481,11 +459,14 @@
                                 if($socialNetwork === 'Twitter') {
                                     $loginform .= "<a href='".URL_ROOT."$rep/client.php?CONNECT=true' target='_top' class='loginlink'>".$translate->_("Vous n'êtes pas connecté.")."</a>";
                                 } else {
-                                    $loginform .= "<form action='".URL_ROOT."$rep/client.php' method='GET' target='_top'>";
+                                    $loginform .= "<ul>";
+                                    $loginform .= "<li><form action='".URL_ROOT."$rep/client.php' method='GET' target='_top'>";
                                     $loginform .= "<div class='loginlink'>".$translate->_("Vous n'êtes pas connecté.")."</div>";
                                     $loginform .= "<input type='text' id='social_domain' name='CONNECT' value='mastodon.svc.iri-research.org'/>";
                                     $loginform .= "<input type='submit' value='Connect'/>";
-                                    $loginform .= "</form>";    
+                                    $loginform .= "</form></li>";
+                                    $loginform .= "<li>Suive l'utlisateur <code>".$config['group']."</code></li>";
+
                                 }
                                 $loginform .= "</div>";
                                 echo($loginform);
@@ -551,7 +532,7 @@
 
             <?php } else {?>
 
-                <p class="connect-message"><a href="<?php echo URL_ROOT.$rep; ?>/client.php?CONNECT=mastodon.svc.iri-research.org"><?php echo $translate->_('You must be connected with your Twitter account to read the conversation'); ?></a></p>
+                <p class="connect-message"><a href="<?php echo URL_ROOT.$rep; ?>/client.php?CONNECT=mastodon.svc.iri-research.org"><?php echo $translate->_('You must be connected with your account to read the conversation'); ?></a></p>
 
             <?php } ?>