All pastes #124350 Raw Edit

Stuff

public text v1 · immutable
·published 2006-08-10 00:06 UTC
rendered paste body
 foreach ($categories as $key => $category) {
        if ($category['name'] == 'Resort Information') {
          if (in_array('Industry | Resort', $account->roles)) {
            $category_access = true;
          } else {
            $category_access = false;
          }
        } else if ($category['name'] == 'profile information') {
          if (!in_array('Industry | Resort', $account->roles)) {
            $category_access = true;
          } else {
            $category_access = false;
          }
        } else {
          $category_access = ($admin_access || $user->uid == arg(1));
        }

        $items[] = array(
        'path' => 'user/'. arg(1) .'/edit/'. $category['name'],
        'title' => $category['title'],
        'type' => $category['name'] == 'account' ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
        'weight' => $category['weight'],
        'access' => $category_access);
        unset($category_access);
      }