Dotclear

Changeset 3167:9b0e5988c0eb for admin


Ignore:
Timestamp:
02/11/16 15:35:39 (9 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Cope with sort of "un-attached" media → allows new features as "featured media" plugin. Video and Audio HTML5 element are now used (if possible) rather than Flash object for attachments.

Location:
admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • admin/media.php

    r3165 r3167  
    3131$dir = null; 
    3232 
     33// Attachement type if any 
     34$link_type = !empty($_REQUEST['link_type']) ? $_REQUEST['link_type'] : null; 
     35 
    3336$page = !empty($_GET['page']) ? max(1,(integer) $_GET['page']) : 1; 
    3437$nb_per_page = ((integer) $core->auth->user_prefs->interface->media_by_page ? (integer) $core->auth->user_prefs->interface->media_by_page : 30); 
     
    8588$select = !empty($_REQUEST['select']) ? (integer)$_REQUEST['select'] : 0;  // 0 : none, 1 : single media, >1 : multiple medias 
    8689 
    87 $page_url_params = new ArrayObject(array('popup' => $popup,'select' => $select,'post_id' => $post_id)); 
     90$page_url_params = new ArrayObject(array('popup' => $popup,'select' => $select,'post_id' => $post_id,'link_type' => $link_type)); 
    8891if ($d) { 
    8992     $page_url_params['d'] = $d; 
     
    774777function mediaItemLine($f,$i,$query,$table=false) 
    775778{ 
    776      global $core, $page_url, $popup, $select, $post_id, $plugin_id, $page_url_params; 
     779     global $core, $page_url, $popup, $select, $post_id, $plugin_id, $page_url_params, $link_type; 
    777780 
    778781     $fname = $f->basename; 
     
    830833                    $act .= 
    831834                    '<a class="attach-media" title="'.__('Attach this file to entry').'" href="'. 
    832                     $core->adminurl->get("admin.post.media", array('media_id' => $f->media_id, 'post_id' => $post_id,'attach' => 1)). 
     835                    $core->adminurl->get("admin.post.media", 
     836                         array('media_id' => $f->media_id, 'post_id' => $post_id,'attach' => 1,'link_type' => $link_type)). 
    833837                    '">'. 
    834838                    '<img src="images/plus.png" alt="'.__('Attach this file to entry').'"/>'. 
  • admin/media_item.php

    r3154 r3167  
    2727} 
    2828 
     29// Attachement type if any 
     30$link_type = !empty($_REQUEST['link_type']) ? $_REQUEST['link_type'] : null; 
     31 
    2932$file = null; 
    3033$popup = (integer) !empty($_REQUEST['popup']); 
     
    3235$plugin_id = isset($_REQUEST['plugin_id']) ? html::sanitizeURL($_REQUEST['plugin_id']) : ''; 
    3336$page_url_params = array('popup' => $popup,'select' => $select,'post_id' => $post_id); 
    34 $media_page_url_params = array('popup' => $popup,'select' => $select,'post_id' => $post_id); 
     37$media_page_url_params = array('popup' => $popup,'select' => $select,'post_id' => $post_id,'link_type' => $link_type); 
    3538 
    3639if ($plugin_id != '') { 
  • admin/post_media.php

    r2720 r3167  
    1717$post_id = !empty($_REQUEST['post_id']) ? (integer) $_REQUEST['post_id'] : null; 
    1818$media_id = !empty($_REQUEST['media_id']) ? (integer) $_REQUEST['media_id'] : null; 
     19$link_type = !empty($_REQUEST['link_type']) ? $_REQUEST['link_type'] : null; 
    1920 
    2021if (!$post_id) { 
     
    3031     { 
    3132          $core->media = new dcMedia($core); 
    32           $core->media->addPostMedia($post_id,$media_id); 
     33          $core->media->addPostMedia($post_id,$media_id,$link_type); 
    3334        if (!empty($_SERVER['HTTP_X_REQUESTED_WITH'])) { 
    3435            header('Content-type: application/json'); 
     
    4142 
    4243     $core->media = new dcMedia($core); 
    43      $f = $core->media->getPostMedia($post_id,$media_id); 
     44     $f = $core->media->getPostMedia($post_id,$media_id,$link_type); 
    4445     if (empty($f)) { 
    4546          $post_id = $media_id = null; 
     
    5657     if (!empty($_POST['remove'])) 
    5758     { 
    58           $core->media->removePostMedia($post_id,$media_id); 
     59          $core->media->removePostMedia($post_id,$media_id,$link_type); 
    5960 
    6061          dcPage::addSuccessNotice(__('Attachment has been successfully removed.')); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map