Bibliographies
Problem has been recordedIssue description
Bonjour,
existe-til un type de section spécialisé pour encoder les références de livres et permettre (forum) aux utilisateurs de donner son avis.
Merci par avance
Chi
Comments
| Alf83 24 posts | L'overlay ferait à mon sens une excellente solution. Cela nécessitera d'en faire un sur mesure pour traiter des références de livre, en suivant les consignes indiquées ici : Les overlays |
LeChi![]() from Cosnes-et-Romain - Lorraine 47 posts | Merci, j'ai suivi ce lien et fait un overlay pour encoder des références informatiques.
Cependant, je l'ai écrit en français, les traductions ça me dépasse. De ce fait, j'ai dû retirer tous les accents, autrement ils étaient remplacés par des signes cabalistiques; alors que les termes - dans la même page créée par php - venant des "tradcutions" supportent bien les accents.
|
Moi-meme![]() from Entre chaise et clavier... 1434 posts | Ca vient de l'encodage charset de yacs. Si tu n'as pas énormément de texte dans ton overlay ou si les dimanches sont fréquemment pluvieux chez toi, remplace toute accentuation par son encodage html, par exemple en te référant à cette base de données multilingue. Ce serait intéressant que tu partages ton nouvel overlay, si tu le veux bien. ----- |
Agnès![]() from le Grésivaudan (grenoble-chambéry) Associate, 2107 posts |
LeChi : Tu pourrais t'appuyer sur l'overlay "book", que tu peux trouver dans la section des téléchargements (exactement ici). L'internationalisation est déjà présente, et il te "suffirait" d'adapter ce que tu mettras en plus (ou enlever ce dont tu ne te sert pas). Ensuite, comme le dis Moi-même, il est indispensable d'écrire les caractères accentués et autres subtilités linguistiques avec leur code html (par ex. pour le "é", il faut écrire " & e a c u t e ;" - sans les espaces). Le lien fourni ci-dessus est un aide mémoire pratique. Si tu as besoin d'autres codes, tu peux également consulter cette page, extrèmement complète.Enfin, n'hésite pas à partager ici ton travail, nous pourrons te donner un coup de main pour le finaliser. |
LeChi![]() from Cosnes-et-Romain - Lorraine 47 posts |
Bonjour, J'ai résoulu le problème d'accent comme le suggère Agnès. J'aimerais maintenant pouvoir intégrer un champ / liste déroulante fixe, afin de ne laisser le choix que sur certains termes prédéterminés (exemple : niveau de texte : vulgarisation, note de cours archi, article archi... Y a-t-il un overlay ayant utilisé les combo afin que je puisse m'y appuyer? Merci Chi |
LeChi![]() from Cosnes-et-Romain - Lorraine 47 posts |
Voici le résultat de mes cellules grises.
/ * décrit une référence de lecture * * @see overlays/overlay.php * * @author Christian Hinque christian.hinque@laposte.net * @author McNana * @author Bernard Paques bernard.paques@bigfoot.com * @license http://www.gnu.org/copyleft/lesser.txt GNU Lesser General Public License */ class Biblio extends Overlay { / * build the list of fields for one overlay * * @see overlays/overlay.php * * @param the hosting attributes * @return a list of ($label, $input, $hint) */ function get_fields($host) { global $context; // auteur $local['label_en'] = 'Author'; $local['label_fr'] = 'Auteur'; $label = i18n::l($local, 'label'); $input = '<input type="text" name="auteur" value ="'.encode_field(isset($this->attributes['auteur'])?$this->attributes['auteur']:'').'" size="45" maxlength="128" />'; $fields[] = array($label, $input); // maison édition $local['label_en'] = 'Edition'; $local['label_fr'] = 'Édition'; $label = i18n::l($local, 'label'); $input = '<textarea name="editeur" rows="2" cols="50">'.encode_field(isset($this->attributes['editeur'])?$this->attributes['editeur']:'').'</textarea>'; $fields[] = array($label, $input); // date de parution $local['label_en'] = 'Publication date'; $local['label_fr'] = 'Date de parution'; $label = i18n::l($local, 'label'); $input = '<input type="date" name="dateparu" value ="'.encode_field($this->attributes['dateparu']).'" />'; $local['hint_en'] = 'Publication date of the book or publlication month of the magazine'; $local['hint_fr'] = 'Date de parution du livre ou mois de parution de la revue'; $hint = i18n::l($local, 'hint'); $fields[] = array($label, $input, $hint); // numéro ISBN $local['label_en'] = 'Reference'; $local['label_fr'] = 'Référence'; $label = i18n::l($local, 'label'); $input = '<input type="text" name="isbn" value ="'.encode_field(isset($this->attributes['isbn'])?$this->attributes['isbn']:'').'" size="45" maxlength="128" />'; $local['hint_en'] = 'Usually, the ISBN identifier'; $local['hint_fr'] = 'L\'identifiant ISBN, le plus souvent'; $hint = i18n::l($local, 'hint'); $fields[] = array($label, $input, $hint); // niveau $local['label_en'] = 'Text level'; $local['label_fr'] = 'Niveau de texte'; $label = i18n::l($local, 'label'); $input = '<select name="niveau" > <option value="'.encode_field($this->attributes['niveau']).'" selected>'.encode_field($this->attributes['niveau']).'</option> <option value="Vulgarisation">Vulgarisation</option> <option value="Professionnel">Professionnel</option> <option value="Etudiant">Etudiant</option> </select>'; $fields[] = array($label, $input); // genre $local['label_en'] = 'Kind of subject'; $local['label_fr'] = 'Genre de sujet'; $label = i18n::l($local, 'label'); $input = '<select name="genre" > <option value="'.encode_field($this->attributes['genre']).'" selected>'.encode_field($this->attributes['genre']).'</option> <option value="Architecture">Architecture</option> <option value="Ingénierie">Ingénierie</option> <option value="Urbanisme">Urbanisme</option> </select>'; $fields[] = array($label, $input); // note $local = array(); $local['label_en'] = 'Note'; $local['label_fr'] = 'Note'; $label = i18n::l($local, 'label'); $input = '<select name="note"> <option value="'.encode_field($this->attributes['note']).'" selected>'.encode_field($this->attributes['note']).'</option> <option value="Nul">Nul</option> <option value="Passable">Passable</option> <option value="Bien">Bien</option> <option value="Excellent">Excellent</option> <option value="Génial">Génial</option> </select>'; $fields[] = array($label, $input); return $fields; } / * get an overlaid label * * Accepted action codes: * - 'edit' the modification of an existing object * - 'delete' the deleting form * - 'new' the creation of a new object * - 'view' a displayed object * * @see overlays/overlay.php * * @param string the target label * @param string the on-going action * @return the label to use */ function get_label($name, $action='view') { global $context; // the target label switch($name) { // description label case 'description': $local['label_en'] = 'My opinion'; $local['label_fr'] = 'Avis du référenceur'; return i18n::l($local, 'label'); // help panel case 'help': if(($action == 'new') || ($action == 'edit')) return '<p>'.i18n::s('Il faut être le plus précis possible dans les références.').'</p>'; return NULL; // page title case 'page_title': switch($action) { case 'edit': $local['label_en'] = 'Update one book review'; $local['label_fr'] = 'Modifiez une fiche de lecture'; return i18n::l($local, 'label'); case 'delete': $local['label_en'] = 'Delete a book review'; $local['label_fr'] = 'Supprimez une fiche'; return i18n::l($local, 'label'); case 'new': $local['label_en'] = 'Enter a new book review'; $local['label_fr'] = 'Publiez une nouvelle fiche de lecture'; return i18n::l($local, 'label'); case 'view': default: // use the article title as the page title return NULL; } } // no match return NULL; } / * display the content of one recipe * * Accepted variant codes: * - 'view' - embedded into the main viewing page * * @see overlays/overlay.php * * @param string the variant code * @param array the hosting record * @return some HTML to be inserted into the resulting page */ function get_text($variant='view', $host=NULL) { global $context; $local = array(); // add something to zooming views only if($variant != 'view') return ''; // text to return $rows = array(); // note $localnote['label_en'] = 'Note'; $localnote['label_fr'] = 'Note'; $rows[] = array(i18n::l($localnote, 'label'), $this->attributes['note']); // niveau de texte $localniv['label_en'] = 'Text level'; $localniv['label_fr'] = 'Niveau de texte'; $rows[] = array(i18n::l($localniv, 'label'), $this->attributes['niveau']); // Genre de texte $localgenre['label_en'] = 'Kind of subject'; $localgenre['label_fr'] = 'Genre de sujet'; $rows[] = array(i18n::l($localgenre, 'label'), $this->attributes['genre']); // author $local['label_en'] = 'Author'; $local['label_fr'] = 'Auteur'; $rows[] = array(i18n::l($local, 'label'), $this->attributes['auteur']); // maison édition $local['label_en'] = 'Edition'; $local['label_fr'] = 'Edition'; $rows[] = array(i18n::l($local, 'label'), $this->attributes['editeur']); // reference $local['label_en'] = 'Reference'; $local['label_fr'] = 'Référence'; $rows[] = array(i18n::l($local, 'label'), $this->attributes['isbn']); // date de parution $local['label_en'] = 'Publication date'; $local['label_fr'] = 'Date de parution'; $rows[] = array(i18n::l($local, 'label'), $this->attributes['dateparu']); if(count($rows)) return Codes::beautify(Skin::table(NULL, $rows)); else return ''; } /** * retrieve the content of one modified overlay * * @see overlays/overlay.php * * @param the fields as filled by the end user * @return the updated fields */ function parse_fields($fields) { $this->attributes['note'] = $fields['note']; $this->attributes['auteur'] = $fields['auteur']; $this->attributes['editeur'] = $fields['editeur']; $this->attributes['dateparu'] = $fields['dateparu']; $this->attributes['isbn'] = $fields['isbn']; $this->attributes['niveau'] = $fields['niveau']; $this->attributes['genre'] = $fields['genre']; return $this->attributes; } } ?> |
Rate this page
Posted by LeChi on May 24, edited by LeChi on June 10, (popular)



Plugin Firefox : Search