Changeset 1011:c8f32ed1ca5c for admin/media_item.php
- Timestamp:
- 11/14/12 19:27:33 (13 years ago)
- Branch:
- default
- Parents:
- 1004:1c1f8b410a12 (diff), 1009:867afbf9f1be (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/media_item.php
r950 r1011 293 293 echo 294 294 '<h3>'.__('Video size').'</h3>'. 295 '<p><label for="video_w" class="classic">'.__('Width:').' '.295 '<p><label for="video_w" class="classic">'.__('Width:').'</label> '. 296 296 form::field('video_w',3,4,400).' '. 297 '<label for="video_h" class="classic">'.__('Height:').' '.297 '<label for="video_h" class="classic">'.__('Height:').'</label> '. 298 298 form::field('video_h',3,4,300). 299 299 '</p>'; -
admin/media_item.php
r1009 r1011 15 15 dcPage::check('media,media_admin'); 16 16 17 $tab = empty($_REQUEST['tab']) ? '' : $_REQUEST['tab']; 18 17 19 $post_id = !empty($_GET['post_id']) ? (integer) $_GET['post_id'] : null; 18 20 if ($post_id) { … … 103 105 try { 104 106 $core->media->updateFile($file,$newFile); 105 http::redirect($page_url.'&id='.$id.'&fupd=1 ');107 http::redirect($page_url.'&id='.$id.'&fupd=1&tab=media-details-tab'); 106 108 } catch (Exception $e) { 107 109 $core->error->add($e->getMessage()); … … 115 117 $foo = null; 116 118 $core->media->mediaFireRecreateEvent($file); 117 http::redirect($page_url.'&id='.$id.'&thumbupd=1 ');119 http::redirect($page_url.'&id='.$id.'&thumbupd=1&tab=media-details-tab'); 118 120 } catch (Exception $e) { 119 121 $core->error->add($e->getMessage()); … … 157 159 /* DISPLAY Main page 158 160 -------------------------------------------------------- */ 159 $starting_scripts = dcPage::jsLoad('js/_media_item.js'); 161 $starting_scripts = 162 '<script type="text/javascript">'."\n". 163 "//<![CDATA["."\n". 164 dcPage::jsVar('dotclear.msg.confirm_delete_media',__('Are you sure to delete this media?'))."\n". 165 "//]]>". 166 "</script>". 167 dcPage::jsLoad('js/_media_item.js'); 160 168 if ($popup) { 161 169 $starting_scripts .= … … 165 173 $starting_scripts. 166 174 dcPage::jsDatePicker(). 167 dcPage::jsPageTabs( )175 dcPage::jsPageTabs($tab) 168 176 ); 169 177 … … 174 182 175 183 if (!empty($_GET['fupd']) || !empty($_GET['fupl'])) { 176 echo '<p class="message">'.__('File has been successfully updated.').'</p>';184 dcPage::message(__('File has been successfully updated.')); 177 185 } 178 186 if (!empty($_GET['thumbupd'])) { 179 echo '<p class="message">'.__('Thumbnails have been successfully updated.').'</p>';187 dcPage::message(__('Thumbnails have been successfully updated.')); 180 188 } 181 189 … … 193 201 '<form id="media-insert-form" action="" method="get">'; 194 202 203 $media_img_default_size = $core->blog->settings->system->media_img_default_size; 204 if ($media_img_default_size == '') { 205 $media_img_default_size = 'm'; 206 } 207 $media_img_default_alignment = $core->blog->settings->system->media_img_default_alignment; 208 if ($media_img_default_alignment == '') { 209 $media_img_default_alignment = 'none'; 210 } 211 $media_img_default_link = (boolean)$core->blog->settings->system->media_img_default_link; 212 195 213 if ($file->media_type == 'image') 196 214 { … … 200 218 $media_desc = ''; 201 219 } 202 220 203 221 echo 204 222 '<h3>'.__('Image size:').'</h3> '; … … 207 225 echo '<p>'; 208 226 foreach (array_reverse($file->media_thumb) as $s => $v) { 209 $s_checked = ($s == 'm');227 $s_checked = ($s == $media_img_default_size); 210 228 echo '<label class="classic">'. 211 229 form::radio(array('src'),html::escapeHTML($v),$s_checked).' '. 212 230 $core->media->thumb_sizes[$s][2].'</label><br /> '; 213 231 } 214 $s_checked = (!isset($file->media_thumb[ 'm']));232 $s_checked = (!isset($file->media_thumb[$media_img_default_size])); 215 233 echo '<label class="classic">'. 216 234 form::radio(array('src'),$file->file_url,$s_checked).' '.__('original').'</label><br /> '; … … 220 238 echo '<h3>'.__('Image alignment').'</h3>'; 221 239 $i_align = array( 222 'none' => array(__('None'), 1),223 'left' => array(__('Left'), 0),224 'right' => array(__('Right'), 0),225 'center' => array(__('Center'), 0)240 'none' => array(__('None'),($media_img_default_alignment == 'none' ? 1 : 0)), 241 'left' => array(__('Left'),($media_img_default_alignment == 'left' ? 1 : 0)), 242 'right' => array(__('Right'),($media_img_default_alignment == 'right' ? 1 : 0)), 243 'center' => array(__('Center'),($media_img_default_alignment == 'center' ? 1 : 0)) 226 244 ); 227 245 … … 236 254 '<h3>'.__('Image insertion').'</h3>'. 237 255 '<p>'. 238 '<label for="insert1" class="classic">'.form::radio(array('insertion','insert1'),'simple', true).256 '<label for="insert1" class="classic">'.form::radio(array('insertion','insert1'),'simple',!$media_img_default_link). 239 257 __('As a single image').'</label><br />'. 240 '<label for="insert2" class="classic">'.form::radio(array('insertion','insert2'),'link', false).258 '<label for="insert2" class="classic">'.form::radio(array('insertion','insert2'),'link',$media_img_default_link). 241 259 __('As a link to original image').'</label>'. 242 260 '</p>'; … … 246 264 $media_type = 'mp3'; 247 265 248 echo '<h3>'.__('MP3 disposition').'</h3>' .249 '<p class="message">'.__("Please note that you cannot insert mp3 files with visual editor.").'</p>';266 echo '<h3>'.__('MP3 disposition').'</h3>'; 267 dcPage::message(__("Please note that you cannot insert mp3 files with visual editor."),false); 250 268 251 269 $i_align = array( 252 'none' => array(__('None'), 0),253 'left' => array(__('Left'), 0),254 'right' => array(__('Right'), 0),255 'center' => array(__('Center'), 1)270 'none' => array(__('None'),($media_img_default_alignment == 'none' ? 1 : 0)), 271 'left' => array(__('Left'),($media_img_default_alignment == 'left' ? 1 : 0)), 272 'right' => array(__('Right'),($media_img_default_alignment == 'right' ? 1 : 0)), 273 'center' => array(__('Center'),($media_img_default_alignment == 'center' ? 1 : 0)) 256 274 ); 257 275 … … 271 289 $media_type = 'flv'; 272 290 273 echo 274 '<p class="message">'.__("Please note that you cannot insert video files with visual editor.").'</p>'; 291 dcPage::message(__("Please note that you cannot insert video files with visual editor."),false); 275 292 276 293 echo … … 285 302 286 303 $i_align = array( 287 'none' => array(__('None'), 0),288 'left' => array(__('Left'), 0),289 'right' => array(__('Right'), 0),290 'center' => array(__('Center'), 1)304 'none' => array(__('None'),($media_img_default_alignment == 'none' ? 1 : 0)), 305 'left' => array(__('Left'),($media_img_default_alignment == 'left' ? 1 : 0)), 306 'right' => array(__('Right'),($media_img_default_alignment == 'right' ? 1 : 0)), 307 'center' => array(__('Center'),($media_img_default_alignment == 'center' ? 1 : 0)) 291 308 ); 292 309 … … 340 357 $strong_link = ($s == $thumb_size) ? '<strong>%s</strong>' : '%s'; 341 358 printf($strong_link,'<a href="'.html::escapeURL($page_url). 342 '&id='.$id.'&size='.$s.' ">'.$core->media->thumb_sizes[$s][2].'</a> | ');343 } 344 echo '<a href="'.html::escapeURL($page_url).'&id='.$id.'&size=o ">'.__('original').'</a>';359 '&id='.$id.'&size='.$s.'&tab=media-details-tab">'.$core->media->thumb_sizes[$s][2].'</a> | '); 360 } 361 echo '<a href="'.html::escapeURL($page_url).'&id='.$id.'&size=o&tab=media-details-tab">'.__('original').'</a>'; 345 362 echo '</p>'; 346 363 … … 377 394 { 378 395 echo 379 '<p><strong><a href="'.html::escapeHTML($page_url).'&id='.$id.'&find_posts=1 ">'.396 '<p><strong><a href="'.html::escapeHTML($page_url).'&id='.$id.'&find_posts=1&tab=media-details-tab">'. 380 397 __('Show entries containing this media').'</a></strong></p>'; 381 398 } … … 418 435 echo '<ul>'; 419 436 while ($rs->fetch()) { 420 echo '<li><a href="'.$core->getPostAdminURL($rs->post_type,$rs->post_id).'">'. 421 $rs->post_title.'</a>'. 422 ($rs->post_type != 'post' ? ' ('.html::escapeHTML($rs->post_type).')' : ''). 423 ' - '.dt::dt2str(__('%Y-%m-%d %H:%M'),$rs->post_dt).'</li>'; 437 $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 438 switch ($rs->post_status) { 439 case 1: 440 $img_status = sprintf($img,__('published'),'check-on.png'); 441 break; 442 case 0: 443 $img_status = sprintf($img,__('unpublished'),'check-off.png'); 444 break; 445 case -1: 446 $img_status = sprintf($img,__('scheduled'),'scheduled.png'); 447 break; 448 case -2: 449 $img_status = sprintf($img,__('pending'),'check-wrn.png'); 450 break; 451 } 452 echo '<li>'.$img_status.' '.'<a href="'.$core->getPostAdminURL($rs->post_type,$rs->post_id).'">'. 453 $rs->post_title.'</a>'. 454 ($rs->post_type != 'post' ? ' ('.html::escapeHTML($rs->post_type).')' : ''). 455 ' - '.dt::dt2str(__('%Y-%m-%d %H:%M'),$rs->post_dt).'</li>'; 424 456 } 425 457 echo '</ul>'; … … 517 549 '</fieldset></form>'; 518 550 551 if ($file->del) { 552 echo 553 '<form id="delete-form" method="post" action="'.html::escapeURL($media_page_url). 554 '&d='.rawurlencode(dirname($file->relname)). 555 '&remove='.rawurlencode($file->basename).'">'. 556 '<p><input name="delete" type="submit" class="delete" value="'.__('Delete this media').'" />'. 557 form::hidden('remove',rawurlencode($file->basename)). 558 form::hidden('rmyes',1). 559 $core->formNonce().'</p>'. 560 '</form>'; 561 } 562 563 519 564 # --BEHAVIOR-- adminMediaItemForm 520 565 $core->callBehavior('adminMediaItemForm',$file);
Note: See TracChangeset
for help on using the changeset viewer.