You are here

function spaces_ui_context_define in Spaces 5.2

Same name and namespace in other branches
  1. 5 spaces_ui.module \spaces_ui_context_define()

Implementation of hook_context_define().

File

./spaces_ui.module, line 52

Code

function spaces_ui_context_define() {
  $items = array();
  $result = db_query('SELECT feature, value FROM {spaces_features_ui}');
  while ($row = db_fetch_object($result)) {
    $c = new StdClass();
    $c->namespace = 'spaces';
    $c->attribute = 'feature';
    $c->value = $row->feature;
    if ($c = context_ui_context('load', $c)) {
      $c->spaces = unserialize($row->value);

      // A small change in context_ui now allows modules to
      // set system/status explicitly -- not recommended except for
      // cases like this.
      $c->system = 0;
      $c->status = 1;
      $items[] = (array) $c;
    }
  }
  return $items;
}