Dotclear

Changeset 2719:116bb4bd1b88


Ignore:
Timestamp:
06/14/14 11:52:47 (11 years ago)
Author:
Nicolas <nikrou77@…>
Branch:
default
Message:

Do not store editor in meta. Addresses #1896

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/post.php

    r2711 r2719  
    103103          $post_dt = date('Y-m-d H:i',strtotime($post->post_dt)); 
    104104          $post_format = $post->post_format; 
    105         # try to retrieve editor from post meta 
    106         $meta_editor = $core->meta->getMetaStr($post->post_meta,'editor'); 
    107         if (!empty($meta_editor)) { 
    108             $post_editor = $meta_editor; 
    109         } 
    110105          $post_password = $post->post_password; 
    111106          $post_url = $post->post_url; 
     
    200195# Format excerpt and content 
    201196elseif (!empty($_POST) && $can_edit_post) { 
    202  
    203      if (strpos($_POST['post_format'], ':')!==false) { 
    204           list($post_editor, $post_format) = explode(':', $_POST['post_format']); 
    205      } else { 
    206           $post_format = $_POST['post_format']; 
    207           $post_editor = ''; 
    208      } 
    209  
     197    list(, $post_format) = explode(':', $_POST['post_format']); 
    210198     $post_excerpt = $_POST['post_excerpt']; 
    211199     $post_content = $_POST['post_content']; 
     
    295283     $cur->post_dt = $post_dt ? date('Y-m-d H:i:00',strtotime($post_dt)) : ''; 
    296284     $cur->post_format = $post_format; 
    297      $cur->post_meta = serialize(array('editor' => $post_editor)); 
    298285     $cur->post_password = $post_password; 
    299286     $cur->post_lang = $post_lang; 
     
    316303     if ($post_id) { 
    317304          try { 
    318             $meta = $core->meta; 
    319             $meta->delPostMeta($post_id,'editor'); 
    320             $meta->setPostMeta($post_id,'editor',$post_editor); 
    321  
    322305               # --BEHAVIOR-- adminBeforePostUpdate 
    323306               $core->callBehavior('adminBeforePostUpdate',$cur,$post_id); 
     
    343326 
    344327               $return_id = $core->blog->addPost($cur); 
    345  
    346             $meta = $core->meta; 
    347             $meta->delPostMeta($return_id,'editor'); 
    348             $meta->setPostMeta($return_id,'editor',$post_editor); 
    349328 
    350329               # --BEHAVIOR-- adminAfterPostCreate 
     
    483462if ($can_edit_post) { 
    484463     if (count($formaters_combo)>0 && ($core->auth->getOption('editor') && $core->auth->getOption('editor')!='')) { 
    485           // temporay removed until we can switch easily editor 
    486         // $post_format_field = form::combo('post_format',$formaters_combo,"$post_editor:$post_format",'maximal'); 
    487  
    488         $post_format_field = sprintf('%s (%s)', $post_format, $post_editor); 
    489           $post_format_field .= form::hidden('post_format',"$post_editor:$post_format"); 
     464        $post_format_field = form::combo('post_format',$formaters_combo,"$post_editor:$post_format",'maximal'); 
    490465     } else { 
    491466          $post_format_field = sprintf(__('Choose an active editor in %s.'),  
Note: See TracChangeset for help on using the changeset viewer.

Sites map