Changeset 2093:55b6732e874c for admin
- Timestamp:
- 09/25/13 17:59:51 (12 years ago)
- Branch:
- default
- Location:
- admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/_media_item.js
r947 r2093 69 69 }); 70 70 71 // Get current insertion settings 72 $('#save_settings').submit(function() { 73 $('input[name="pref_src"]').val($('input[name="src"][type=radio]:checked').attr('value')); 74 $('input[name="pref_alignment"]').val($('input[name="alignment"][type=radio]:checked').attr('value')); 75 $('input[name="pref_insertion"]').val($('input[name="insertion"][type=radio]:checked').attr('value')); 76 }); 77 71 78 }); -
admin/media_item.php
r2003 r2093 130 130 $core->error->add($e->getMessage()); 131 131 } 132 } 133 134 # Save media insertion settings for the blog 135 if (!empty($_POST['save_blog_prefs'])) 136 { 137 if (!empty($_POST['pref_src'])) { 138 foreach (array_reverse($file->media_thumb) as $s => $v) { 139 if ($v == $_POST['pref_src']) { 140 $core->blog->settings->system->put('media_img_default_size',$s); 141 break; 142 } 143 } 144 } 145 if (!empty($_POST['pref_alignment'])) { 146 $core->blog->settings->system->put('media_img_default_alignment',$_POST['pref_alignment']); 147 } 148 if (!empty($_POST['pref_insertion'])) { 149 $core->blog->settings->system->put('media_img_default_link',($_POST['pref_insertion'] == 'link')); 150 } 151 http::redirect($page_url.'&id='.$id.'&blogprefupd=1'); 132 152 } 133 153 … … 195 215 dcPage::success(__('Thumbnails have been successfully updated.')); 196 216 } 217 if (!empty($_GET['blogprefupd'])) { 218 dcPage::success(__('Default media insertion settings have been successfully updated.')); 219 } 197 220 198 221 # Insertion popup … … 331 354 echo '<p>'.__('Media item will be inserted as a link.').'</p>'; 332 355 } 333 356 334 357 echo 335 358 '<p><a id="media-insert-cancel" class="button" href="#">'.__('Cancel').'</a> - '. … … 341 364 '</p>'; 342 365 343 echo '</form></div>'; 366 echo '</form>'; 367 368 if ($media_type != 'default') { 369 echo 370 '<form id="save_settings" action="'.html::escapeURL($page_url).'" method="post">'. 371 '<p><input type="submit" name="save_blog_prefs" value="'.__('Make current media insertion settings as default').'" />'. 372 form::hidden(array('pref_src'),''). 373 form::hidden(array('pref_alignment'),''). 374 form::hidden(array('pref_insertion'),''). 375 form::hidden(array('id'),$id). 376 $core->formNonce().'</p>'. 377 '</form>'; 378 } 379 380 echo '</div>'; 344 381 } 345 382
Note: See TracChangeset
for help on using the changeset viewer.