You are here

function imagepicker_browse_order_form_submit in Image Picker 7

Same name and namespace in other branches
  1. 5.2 imagepicker.module \imagepicker_browse_order_form_submit()
  2. 5 imagepicker.module \imagepicker_browse_order_form_submit()
  3. 6.2 imagepicker.functions.inc \imagepicker_browse_order_form_submit()

Submit form

File

./imagepicker.functions.inc, line 1918
@author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function imagepicker_browse_order_form_submit($form, &$form_state) {
  $orderlist = array(
    1 => 'img_id DESC',
    2 => 'img_id ASC',
    3 => 'img_date DESC',
    4 => 'img_date ASC',
    5 => 'img_name',
  );
  $order = $orderlist[$form_state['values']['imagepicker_browser_order']];
  if (isset($form_state['values']['admin'])) {
    imagepicker_variable_set('imagepicker_browser_order', $order);
  }
  else {
    global $user;
    imagepicker_variable_set('imagepicker_browser_order', $order, $user->uid);
  }
}