Dotclear


Ignore:
Timestamp:
09/22/13 18:51:08 (12 years ago)
Author:
Nicolas <nikrou77@…>
Branch:
default
Message:

Add select to easily choose date and time format for blog. close #1695

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/blog_pref.php

    r2014 r2019  
    6464# Status combo 
    6565$status_combo = dcAdminCombos::getBlogStatusescombo(); 
     66 
     67# Date format combo 
     68$now = time(); 
     69$date_formats = array('%G-%m-%d', '%m/%d/%G', '%d/%m/%G', '%G/%m/%d','%d.%m.%G', '%b %e %G', '%e %b %G', '%G %b %e', 
     70'%a, %G-%m-d', '%a, %m/%d/%G', '%a, %d/%m/%G', '%a, %G/%m/%d', '%B %e, %G', '%e %B, %G', '%G, %B %e', '%e. %B %G', 
     71'%A, %B %e, %G', '%A, %e %B, %G', '%A, %G, %B %e','%A, %G, %B %e', '%A, %e. %B %G'); 
     72$time_formats = array('%H:%M','%I:%M','%l:%M', '%Hh%M', '%Ih%M', '%lh%M'); 
     73$date_formats_combo = array('' => ''); 
     74foreach ($date_formats as $format) { 
     75    $date_formats_combo[dt::str($format, $now)] = $format; 
     76} 
     77$time_formats_combo = array('' => ''); 
     78foreach ($time_formats as $format) { 
     79    $time_formats_combo[dt::str($format, $now)] = $format; 
     80} 
     81 
    6682 
    6783# URL scan modes 
     
    479495     '<p><label for="date_format">'.__('Date format:').'</label>'. 
    480496     form::field('date_format',30,255,html::escapeHTML($blog_settings->system->date_format)). 
    481      '</p>'. 
    482       
     497     form::combo('date_format_select',$date_formats_combo). 
     498     '</p>'. 
     499     '<p class="chosen form-note">'.dt::str(html::escapeHTML($blog_settings->system->date_format)).'</p>'. 
     500 
    483501     '<p><label for="time_format">'.__('Time format:').'</label>'. 
    484502     form::field('time_format',30,255,html::escapeHTML($blog_settings->system->time_format)). 
    485      '</p>'. 
     503     form::combo('time_format_select',$time_formats_combo). 
     504     '</p>'. 
     505     '<p class="chosen form-note">'.dt::str(html::escapeHTML($blog_settings->system->time_format)).'</p>'. 
    486506      
    487507     '<p><label for="use_smilies" class="classic">'. 
Note: See TracChangeset for help on using the changeset viewer.

Sites map