diff --git a/iai-wrapper/index.html b/iai-wrapper/index.html index bc2a1c3c7136e5204b009f44f0af394866354716..c21a9835807f719a99760b40e0ef39893b85a94a 100644 Binary files a/iai-wrapper/index.html and b/iai-wrapper/index.html differ diff --git a/iai-wrapper/update.php b/iai-wrapper/update.php index d0eb98226bfc8215357f8a6dbb1d6cff33b28cfb..ae305f85d9dab1716a7f24d4d3d343bc87071227 100644 --- a/iai-wrapper/update.php +++ b/iai-wrapper/update.php @@ -2,16 +2,16 @@ { // Gdrive arrays IDs $data_sheets_IDS = array( - "Ressources" => "1xlI91FqGZ1XLltIcPe5_3IvASOVbSWKC5sdlGxrfWVk", - "Événements" => "1lFRQpuBVGoLg0Sj90nHjHsxKMFzmHv6oC7X0AT3AmmM", "Questionnements" => "1IkqZP0WwdttFcMYVEn53DzpnaTESKtZYFqhJ6hA46jw", + "Événements" => "1lFRQpuBVGoLg0Sj90nHjHsxKMFzmHv6oC7X0AT3AmmM", + "Ressources" => "1xlI91FqGZ1XLltIcPe5_3IvASOVbSWKC5sdlGxrfWVk", "Partenaires" => "1f18x3mIHlNXpFNRlMfJA6YGmPLbil5WxP8L71jlS2Fg", ); // Gdrive arrays displayed fields $data_sheets_fields = array( - "Ressources" => array("Titre", "URL", "URL2", "Auteur", "Éditeur", "Langue", "Objectif didactique ou pédagogique"), - "Événements" => array("Titre", "Type", "Cible", "Date", "Lieu", "Contact", "URL"), "Questionnements" => array("Catégorie", "Domaine", "Question"), + "Événements" => array("Titre", "Type", "Cible", "Date", "Lieu", "Contact", "URL"), + "Ressources" => array("Titre", "URL", "URL2", "Auteur", "Éditeur", "Langue", "Objectif didactique ou pédagogique"), "Partenaires" => array("Nom", "URL", "Contact"), ); // Returns the value the record of the given $index for the given $fieldName in the given $sheetName @@ -43,21 +43,23 @@ if ($data_csv_contents[$sheetName][0][$index] == $fieldName) $data_sheets_fields_index[$sheetName][$fieldName] = $index; } - //-print_r($data_csv_contents); } // Now displays all data as HTML file { - $html = "<html><head><meta charset='UTF-8;'></head><body>\n"; + $html = "<html><head><meta charset='UTF-8'/></head><body>\n"; foreach($data_sheets_fields as $sheetName => $fieldNames) { - $html .= "<h2> Table des <a target='_blank' href='https://docs.google.com/spreadsheets/d/".$data_sheets_IDS[$sheetName]."'>". $sheetName."</a></h2><table>\n <tr>"; + $html .= "<h2> Table des <a target='_blank' href='https://docs.google.com/spreadsheets/d/".$data_sheets_IDS[$sheetName]."'>". $sheetName."</a></h2><table style='max-width:1000px;border:1px'>\n <tr>"; foreach($fieldNames as $fieldName) $html .= "<th>".$fieldName."</th>"; $html .= "</tr>\n"; for($index = 0; $index < get_data_count($sheetName); $index++) { $html .= " <tr>"; foreach($fieldNames as $fieldName) - $html .= "<td>".get_data($sheetName, $fieldName, $index)."</td>"; + if (preg_match("/^URL/", $fieldName) && get_data($sheetName, $fieldName, $index) != "") + $html .= "<td><a target='_blank'' href='".get_data($sheetName, $fieldName, $index)."'>url</a></td>"; + else + $html .= "<td>".get_data($sheetName, $fieldName, $index)."</td>"; $html .= "</tr>\n"; } $html .= "</table>";