You are here

function mobile_tools_roles_overview in Mobile Tools 6

Same name and namespace in other branches
  1. 5 mobile_tools.module \mobile_tools_roles_overview()
  2. 6.3 mobile_tools_roles.module \mobile_tools_roles_overview()
  3. 7.2 mobile_tools_roles/mobile_tools_roles.module \mobile_tools_roles_overview()
  4. 7.2 mobile_tools_roles/mobile_tools_roles.inc \mobile_tools_roles_overview()
1 call to mobile_tools_roles_overview()
mobile_tools_roles_configuration_form in ./mobile_tools_roles.inc
Configuration form for configuring the mobile context in the permission system

File

./mobile_tools_roles.inc, line 92
Contains the functionality to add mobile user roles

Code

function mobile_tools_roles_overview() {
  $output = '';
  $query = "SELECT * FROM {mobile_tools_roles_relations}";
  $result = db_query($query);
  $rows = array();
  while ($item = db_fetch_object($result)) {
    $query = "SELECT * FROM {role} WHERE rid = %d";
    $result1 = db_query($query, $item->rid);
    $result2 = db_query($query, $item->mrid);
    $rows[] = array(
      db_fetch_object($result1)->name,
      db_fetch_object($result2)->name,
    );
  }
  $headers = array(
    "original role",
    "mobile role",
  );
  if (count($rows) == 0) {
    $output .= '<div class="message">No Mobile roles were assigned</div>';
  }
  else {
    $output .= theme('table', $headers, $rows);
    $output .= '<br>' . t('Configure the !permissions', array(
      '!permissions' => l('permissions', 'admin/user/permissions'),
    )) . '<br />';
  }
  return $output;
}