Dotclear


Ignore:
Timestamp:
06/23/11 13:00:59 (14 years ago)
Author:
Dsls <dsls@…>
Branch:
default
Message:
  • Re-enabled blank post_type required by media.php in class dcBlog
  • Attachments are now handled by a plugins/attachments/_admin.php
  • Added core dcPostMedia multi-purpose class, and 'link_type' in post_media table
  • Added new behavior : tplIfConditions, to enable to add new attributes to tpl:XXXIf tags
  • Moved tpl:SysIf has_tag attribute to Tags plugin
File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/post.php

    r322 r407  
    3232$post_open_comment = $core->blog->settings->system->allow_comments; 
    3333$post_open_tb = $core->blog->settings->system->allow_trackbacks; 
    34  
    35 $post_media = array(); 
    3634 
    3735$page_title = __('New entry'); 
     
    146144          try { 
    147145               $core->media = new dcMedia($core); 
    148                $post_media = $core->media->getPostMedia($post_id); 
    149146          } catch (Exception $e) {} 
    150147     } 
     
    408405     '</div>'; 
    409406      
    410      if ($post_id) 
    411      { 
    412           echo 
    413           '<h3 class="clear">'.__('Attachments').'</h3>'; 
    414           foreach ($post_media as $f) 
    415           { 
    416                $ftitle = $f->media_title; 
    417                if (strlen($ftitle) > 18) { 
    418                     $ftitle = substr($ftitle,0,16).'...'; 
    419                } 
    420                echo 
    421                '<div class="media-item">'. 
    422                '<a class="media-icon" href="media_item.php?id='.$f->media_id.'">'. 
    423                '<img src="'.$f->media_icon.'" alt="" title="'.$f->basename.'" /></a>'. 
    424                '<ul>'. 
    425                '<li><a class="media-link" href="media_item.php?id='.$f->media_id.'"'. 
    426                'title="'.$f->basename.'">'.$ftitle.'</a></li>'. 
    427                '<li>'.$f->media_dtstr.'</li>'. 
    428                '<li>'.files::size($f->size).' - '. 
    429                '<a href="'.$f->file_url.'">'.__('open').'</a>'.'</li>'. 
    430                 
    431                '<li class="media-action"><a class="attachment-remove" id="attachment-'.$f->media_id.'" '. 
    432                'href="post_media.php?post_id='.$post_id.'&amp;media_id='.$f->media_id.'&amp;remove=1">'. 
    433                '<img src="images/check-off.png" alt="'.__('remove').'" /></a>'. 
    434                '</li>'. 
    435                 
    436                '</ul>'. 
    437                '</div>'; 
    438           } 
    439           unset($f); 
    440            
    441           if (empty($post_media)) { 
    442                echo '<p>'.__('No attachment.').'</p>'; 
    443           } 
    444           echo '<p><a class="button" href="media.php?post_id='.$post_id.'">'.__('Add files to this entry').'</a></p>'; 
    445      } 
    446       
    447407     # --BEHAVIOR-- adminPostFormSidebar 
    448408     $core->callBehavior('adminPostFormSidebar',isset($post) ? $post : null); 
     
    491451     } 
    492452      
    493      if ($post_id && !empty($post_media)) 
    494      { 
    495           echo 
    496           '<form action="post_media.php" id="attachment-remove-hide" method="post">'. 
    497           '<div>'.form::hidden(array('post_id'),$post_id). 
    498           form::hidden(array('media_id'),''). 
    499           form::hidden(array('remove'),1). 
    500           $core->formNonce().'</div></form>'; 
    501      } 
    502453} 
    503454 
Note: See TracChangeset for help on using the changeset viewer.

Sites map