You are here

function theme_asset_upload_permissions in Asset 6

Same name in this branch
  1. 6 asset_wizard.inc \theme_asset_upload_permissions()
  2. 6 inc/asset_wizard.themes.inc \theme_asset_upload_permissions()
Same name and namespace in other branches
  1. 5 asset_wizard.inc \theme_asset_upload_permissions()

Theme function for the permissions field.

2 theme calls to theme_asset_upload_permissions()
asset_wizard_default_fields in ./asset_wizard.inc
This is the base form for asset types.
asset_wizard_default_fields in inc/asset_wizard.inc
This is the base form for asset types.

File

inc/asset_wizard.themes.inc, line 89

Code

function theme_asset_upload_permissions($element) {
  $roles = db_query("SELECT rid, status FROM {asset_role} WHERE aid=%d", $element['status']['#post']['aid']);
  while ($role = db_fetch_object($roles)) {
    if ($role->status) {
      $element['roles'][$role->rid]['#value'] = $role->rid;
    }
  }
  $roles = drupal_render($element['roles']);
  $element['status'][ASSET_PRIVATE]['#suffix'] = '<div class="roles">' . $roles . '</div>';
  $element['status'][ASSET_PRIVATE]['#id'] = 'permissions-private';
  $element['status'][ASSET_PUBLIC]['#id'] = 'permissions-public';
  return drupal_render($element);
}