Changeset 3167:9b0e5988c0eb for admin
- Timestamp:
- 02/11/16 15:35:39 (9 years ago)
- Branch:
- default
- Location:
- admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/media.php
r3165 r3167 31 31 $dir = null; 32 32 33 // Attachement type if any 34 $link_type = !empty($_REQUEST['link_type']) ? $_REQUEST['link_type'] : null; 35 33 36 $page = !empty($_GET['page']) ? max(1,(integer) $_GET['page']) : 1; 34 37 $nb_per_page = ((integer) $core->auth->user_prefs->interface->media_by_page ? (integer) $core->auth->user_prefs->interface->media_by_page : 30); … … 85 88 $select = !empty($_REQUEST['select']) ? (integer)$_REQUEST['select'] : 0; // 0 : none, 1 : single media, >1 : multiple medias 86 89 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)); 88 91 if ($d) { 89 92 $page_url_params['d'] = $d; … … 774 777 function mediaItemLine($f,$i,$query,$table=false) 775 778 { 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; 777 780 778 781 $fname = $f->basename; … … 830 833 $act .= 831 834 '<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)). 833 837 '">'. 834 838 '<img src="images/plus.png" alt="'.__('Attach this file to entry').'"/>'. -
admin/media_item.php
r3154 r3167 27 27 } 28 28 29 // Attachement type if any 30 $link_type = !empty($_REQUEST['link_type']) ? $_REQUEST['link_type'] : null; 31 29 32 $file = null; 30 33 $popup = (integer) !empty($_REQUEST['popup']); … … 32 35 $plugin_id = isset($_REQUEST['plugin_id']) ? html::sanitizeURL($_REQUEST['plugin_id']) : ''; 33 36 $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); 35 38 36 39 if ($plugin_id != '') { -
admin/post_media.php
r2720 r3167 17 17 $post_id = !empty($_REQUEST['post_id']) ? (integer) $_REQUEST['post_id'] : null; 18 18 $media_id = !empty($_REQUEST['media_id']) ? (integer) $_REQUEST['media_id'] : null; 19 $link_type = !empty($_REQUEST['link_type']) ? $_REQUEST['link_type'] : null; 19 20 20 21 if (!$post_id) { … … 30 31 { 31 32 $core->media = new dcMedia($core); 32 $core->media->addPostMedia($post_id,$media_id );33 $core->media->addPostMedia($post_id,$media_id,$link_type); 33 34 if (!empty($_SERVER['HTTP_X_REQUESTED_WITH'])) { 34 35 header('Content-type: application/json'); … … 41 42 42 43 $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); 44 45 if (empty($f)) { 45 46 $post_id = $media_id = null; … … 56 57 if (!empty($_POST['remove'])) 57 58 { 58 $core->media->removePostMedia($post_id,$media_id );59 $core->media->removePostMedia($post_id,$media_id,$link_type); 59 60 60 61 dcPage::addSuccessNotice(__('Attachment has been successfully removed.'));
Note: See TracChangeset
for help on using the changeset viewer.