You are here

function imce_construct_profile in IMCE 7

Same name and namespace in other branches
  1. 6.2 inc/imce.core.profiles.inc \imce_construct_profile()
  2. 6 inc/core_profiles.inc \imce_construct_profile()

Construct a profile based on arguments.

2 calls to imce_construct_profile()
imce_sample_profile in inc/imce.core.profiles.inc
Default profile.
imce_user1_profile in inc/imce.core.profiles.inc
User1's profile.

File

inc/imce.core.profiles.inc, line 29
Creates the default configuration profiles.

Code

function imce_construct_profile($n, $u, $f, $q, $tq, $e, $d, $fn, $ds, $ts) {
  $profile = array(
    'name' => $n,
    'usertab' => $u,
    'filesize' => $f,
    'quota' => $q,
    'tuquota' => $tq,
    'extensions' => $e,
    'dimensions' => $d,
    'filenum' => $fn,
    'directories' => array(),
    'thumbnails' => array(),
  );
  foreach ($ds as $d) {
    $profile['directories'][] = array(
      'name' => $d[0],
      'subnav' => $d[1],
      'browse' => $d[2],
      'upload' => $d[3],
      'thumb' => $d[4],
      'delete' => $d[5],
      'resize' => $d[6],
    );
  }
  foreach ($ts as $t) {
    $profile['thumbnails'][] = array(
      'name' => $t[0],
      'dimensions' => $t[1],
      'prefix' => $t[2],
      'suffix' => $t[3],
    );
  }
  return $profile;
}