You are here

function imagepicker_user_page in Image Picker 7

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

@file @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

my imagepicker in my account

1 string reference to 'imagepicker_user_page'
imagepicker_menu in ./imagepicker.module
Implement hook_menu().

File

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

Code

function imagepicker_user_page($uid, $path = "", $func = "", $id = 0) {
  drupal_add_css(IMAGEPICKER_PATH . '/imagepicker.css');
  $imagepicker_jspaths = imagepicker_jspaths_get();
  drupal_add_js($imagepicker_jspaths['imagepicker_jspath']);
  $content = '';

  // path/func/id
  if ($path == 'images') {
    if (($func == 'browse' || $func == 'browseadmin') && is_numeric($id) && $id > 0) {
      $content .= imagepicker_userview($id);
    }
    elseif ($func == 'edit' && is_numeric($id) && $id > 0) {
      module_load_include('inc', 'imagepicker', 'imagepicker.edit');
      $content .= imagepicker_user_image_edit($id);
    }
    elseif ($func == 'browse') {
      $content .= imagepicker_user_browse();
    }
    elseif ($func == 'browse_public') {
      if (is_numeric($id) && $id > 0) {
        $content .= imagepicker_user_view_public($id);
      }
      else {
        $content .= imagepicker_user_browse_public();
      }
    }
    elseif ($func == 'browseadmin') {
      $content .= imagepicker_user_browse_admin();
    }
    elseif ($func == 'delete' && is_numeric($id) && $id > 0) {
      imagepicker_image_delete($id, FALSE, 'account');
    }
  }
  elseif (imagepicker_variable_get('imagepicker_groups_enabled', 1) && $path == 'groups') {
    module_load_include('inc', 'imagepicker', 'imagepicker.group');
    if ($func == 'edit' && is_numeric($id) && $id > 0) {
      $content .= imagepicker_user_groups($func, $id);
    }
    elseif ($func == 'browse' && is_numeric($id) && $id > 0) {
      imagepicker_set_user_group_state(1, $id);
      $content .= imagepicker_user_browse();
    }
    elseif ($func == 'browse') {
      $content .= imagepicker_user_groups();
    }
    elseif ($func == 'delete') {
      $form = drupal_get_form('imagepicker_group_delete_form', $id);
      $content .= render($form);
    }
  }
  elseif ($path == 'stats') {
    $content .= imagepicker_group_stats(-1);
  }
  elseif ($path == 'config') {
    $content .= imagepicker_user_config_admin();
  }
  else {
    module_load_include('inc', 'imagepicker', 'imagepicker.upload');
    $content .= imagepicker_user_upload();
  }
  return $content;
}