Dotclear


Ignore:
Timestamp:
03/02/18 15:55:06 (7 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Use specialized input fields (color, email, url, number, …) where is relevant

Location:
plugins/pages
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • plugins/pages/class.listpage.php

    r3707 r3725  
    118118        $cols = array( 
    119119            'position'   => '<td class="nowrap handle minimal">' . 
    120             form::field(array('order[' . $this->rs->post_id . ']'), 2, 3, $count + 1, 'position', '', false, 'title="' . sprintf(__('position of %s'), html::escapeHTML($this->rs->post_title)) . '"') . '</td>', 
     120            form::number(array('order[' . $this->rs->post_id . ']'), array( 
     121                'min'        => 1, 
     122                'default'    => $count + 1, 
     123                'class'      => 'position', 
     124                'extra_html' => 'title="' . sprintf(__('position of %s'), html::escapeHTML($this->rs->post_title)) . '"' 
     125            )) . 
     126            '</td>', 
    121127            'check'      => '<td class="nowrap">' . 
    122128            form::checkbox(array('entries[]'), $this->rs->post_id, 
  • plugins/pages/page.php

    r3710 r3725  
    398398                '<p><label for="post_dt">' . __('Publication date and hour') . '</label>' . 
    399399                form::field('post_dt', 16, 16, $post_dt, ($bad_dt ? 'invalid' : '')) . 
     400                /* 
     401                Previous line will be replaced by this one as soon as every browser will support datetime-local input type 
     402                Dont forget to remove call to datepicker in post.js 
     403 
     404                form::datetime('post_dt', array( 
     405                'default' => html::escapeHTML(dt::str('%Y-%m-%dT%H:%M', strtotime($post_dt))), 
     406                'class' => ($bad_dt ? 'invalid' : '') 
     407                )) . 
     408                 */ 
    400409                '</p>', 
    401410                'post_lang'   => 
     
    416425                'post_position' => 
    417426                '<p><label for="post_position" class="classic">' . __('Page position') . '</label> ' . 
    418                 form::field('post_position', 3, 3, (string) $post_position) . 
     427                form::number('post_position', array( 
     428                    'default' => $post_position 
     429                )) . 
    419430                '</p>')), 
    420431        'options-box' => array( 
     
    465476        '<p class="col">' . 
    466477        '<label class="required no-margin bold" for="post_title"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Title:') . '</label>' . 
    467         form::field('post_title', 20, 255, html::escapeHTML($post_title), 'maximal', '', false, 'required placeholder="' . __('Title') . '"') . 
     478        form::field('post_title', 20, 255, array( 
     479            'default'    => html::escapeHTML($post_title), 
     480            'class'      => 'maximal', 
     481            'extra_html' => 'required placeholder="' . __('Title') . '"' 
     482        )) . 
    468483        '</p>', 
    469484 
     
    640655    '<div class="constrained">' . 
    641656    '<p><label for="comment_author" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Name:') . '</label>' . 
    642     form::field('comment_author', 30, 255, html::escapeHTML($core->auth->getInfo('user_cn')), '', '', false, 'required placeholder="' . __('Author') . '"') . 
     657    form::field('comment_author', 30, 255, array( 
     658        'default'    => html::escapeHTML($core->auth->getInfo('user_cn')), 
     659        'extra_html' => 'required placeholder="' . __('Author') . '"' 
     660    )) . 
    643661    '</p>' . 
    644662 
    645663    '<p><label for="comment_email">' . __('Email:') . '</label>' . 
    646     form::field('comment_email', 30, 255, html::escapeHTML($core->auth->getInfo('user_email'))) . 
     664    form::email('comment_email', array( 
     665        'size'         => 30, 
     666        'default'      => html::escapeHTML($core->auth->getInfo('user_email')), 
     667        'autocomplete' => 'email' 
     668    )) . 
    647669    '</p>' . 
    648670 
    649671    '<p><label for="comment_site">' . __('Web site:') . '</label>' . 
    650     form::field('comment_site', 30, 255, html::escapeHTML($core->auth->getInfo('user_url'))) . 
     672    form::url('comment_site', array( 
     673        'size'         => 30, 
     674        'default'      => html::escapeHTML($core->auth->getInfo('user_url')), 
     675        'autocomplete' => 'url' 
     676    )) . 
    651677    '</p>' . 
    652678 
Note: See TracChangeset for help on using the changeset viewer.

Sites map