Commits

Jean-Christian Denis committed 3e2e678

Fixes tabs links in media item popup, fixes #1283

Comments (0)

Files changed (1)

admin/media_item.php

 
 dcPage::check('media,media_admin');
 
+$tab = empty($_REQUEST['tab']) ? '' : $_REQUEST['tab'];
+
 $post_id = !empty($_GET['post_id']) ? (integer) $_GET['post_id'] : null;
 if ($post_id) {
 	$post = $core->blog->getPosts(array('post_id'=>$post_id));
 	
 	try {
 		$core->media->updateFile($file,$newFile);
-		http::redirect($page_url.'&id='.$id.'&fupd=1');
+		http::redirect($page_url.'&id='.$id.'&fupd=1&tab=media-details-tab');
 	} catch (Exception $e) {
 		$core->error->add($e->getMessage());
 	}
 	try {
 		$foo = null;
 		$core->media->mediaFireRecreateEvent($file);
-		http::redirect($page_url.'&id='.$id.'&thumbupd=1');
+		http::redirect($page_url.'&id='.$id.'&thumbupd=1&tab=media-details-tab');
 	} catch (Exception $e) {
 		$core->error->add($e->getMessage());
 	}
 call_user_func($open_f,__('Media manager'),
 	$starting_scripts.
 	dcPage::jsDatePicker().
-	dcPage::jsPageTabs()
+	dcPage::jsPageTabs($tab)
 );
 
 if ($file === null) {
 	{
 		$strong_link = ($s == $thumb_size) ? '<strong>%s</strong>' : '%s';
 		printf($strong_link,'<a href="'.html::escapeURL($page_url).
-		'&amp;id='.$id.'&amp;size='.$s.'">'.$core->media->thumb_sizes[$s][2].'</a> | ');
+		'&amp;id='.$id.'&amp;size='.$s.'&amp;tab=media-details-tab">'.$core->media->thumb_sizes[$s][2].'</a> | ');
 	}
-	echo '<a href="'.html::escapeURL($page_url).'&amp;id='.$id.'&amp;size=o">'.__('original').'</a>';
+	echo '<a href="'.html::escapeURL($page_url).'&amp;id='.$id.'&amp;size=o&amp;tab=media-details-tab">'.__('original').'</a>';
 	echo '</p>';
 	
 	if (isset($file->media_thumb[$thumb_size])) {
 if (empty($_GET['find_posts']))
 {
 	echo
-	'<p><strong><a href="'.html::escapeHTML($page_url).'&amp;id='.$id.'&amp;find_posts=1">'.
+	'<p><strong><a href="'.html::escapeHTML($page_url).'&amp;id='.$id.'&amp;find_posts=1&amp;tab=media-details-tab">'.
 	__('Show entries containing this media').'</a></strong></p>';
 }
 else