attributes['distance']).'" />'; $hint = 'Longueur du circuit en km' ; $fields[] = array($label, $input, $hint); //dénivelé $label = 'Dénivelé : '; $input = ''; $hint = 'Dénivelé du circuit en m'; $fields[] = array($label, $input, $hint); // le niveau de la sortie $label = 'Niveau : '; $input = ''; $hint = 'Indiquer : familial, modéré, sportif, athlétique'; $fields[] = array($label, $input, $hint); //le parcours $label = 'Parcours : '; $input = ''; $hint = 'Un point de passage par ligne en commençant chaque ligne par \'-\''; $fields[] = array($label, $input, $hint); // les variantes $label = 'Variantes : '; $input = ''; $hint = 'Indiquer les variantes éventuelles'; $fields[] = array($label, $input, $hint); 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': return ('Description du circuit :'); // help panel case 'help': if(($action == 'new') || ($action == 'edit')) return ('Merci de vous relire avant de publier'); return NULL; // page title case 'page_title': switch($action) { case 'edit': return 'Modifier un circuit'; case 'delete': return ('Supprimer un circuit'); case 'new': return ('Ajouter un circuit'); 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_view_text($host=NULL) { global $context; // text to return $text = ''; // distance $text .= '
'.sprintf(('Longueur du circuit en km : %s'), $this->attributes['distance'])."
\n"; // denivele $text .= ''.sprintf(('Dénivelé en m : %s'), $this->attributes['denivele'])."
\n"; // niveau $text .= ''.sprintf(('Niveau : %s'), $this->attributes['niveau'])."
\n"; // le parcours $text .= ''.sprintf(('Parcours : %s'), BR.$this->attributes['parcours'])."
\n"; // variantes $text .= ''.sprintf(('Les variantes éventuelles : %s'), BR.$this->attributes['variantes'])."
\n"; return Codes::beautify($text); } /** * 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['distance'] = isset($fields['distance']) ? $fields['distance'] : ''; $this->attributes['denivele'] = isset($fields['denivele']) ? $fields['denivele'] : ''; $this->attributes['niveau'] = isset($fields['niveau']) ? $fields['niveau'] : ''; $this->attributes['parcours'] = isset($fields['parcours']) ? $fields['parcours'] : ''; $this->attributes['variantes'] = isset($fields['variantes']) ? $fields['variantes'] : ''; return $this->attributes; } } ?>