I'm gettings this request from a lot of clients. They all want the root folder to be selected when the wizards starts up instead of the My Assets directory.

It's very easy to implement with a simple setting:

  $form['asset_start_dir_is_user'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use %my_assets dir as start dir', array('%my_assets' => t('My Assets'))),
    '#description' => t('Check this option when you want the %my_assets dir to be selected when the Asset wizard is started.', array('%my_assets' => t('My Assets'))),
    '#default_value' => variable_get('asset_start_dir_is_user', 0),
  );

and

    elseif (variable_get('asset_start_dir_is_user', 0) && asset_check_directory($user->name, FILE_CREATE_DIRECTORY, NULL, array('parent' => '', 'title' => $user->name))) {
      $dir = $user->name;
    }

But maybe it's better to do the inverse, to give old users a nicer update path. What do you think?

In the future it would be even better to let people override this, but I think this is a bit too much for now.

Comments

HansBKK’s picture

davyvdb’s picture

Status: Active » Closed (duplicate)