You are here

class custompage_context_condition_alias in Custom Page 6

Same name and namespace in other branches
  1. 7 plugins/custompage_context_condition_alias.inc \custompage_context_condition_alias

Expose node views/node forms of specific node types as a context condition.

Hierarchy

Expanded class hierarchy of custompage_context_condition_alias

2 string references to 'custompage_context_condition_alias'
custompage_context_plugins in ./custompage.module
Make module compatible with context 3 Implement hook_context_plugins().
custompage_context_registry in ./custompage.module
Make module compatible with context 3 Implement hook_context_registry().

File

plugins/custompage_context_condition_alias.inc, line 6

View source
class custompage_context_condition_alias extends context_condition {
  function condition_values() {
    $values = _custompage_context_get_custompages();
    return $values;
  }
  function execute($path_key) {
    if (empty($path_key)) {
      return;
    }
    foreach (context_enabled_contexts() as $context) {
      if ($paths = $this
        ->fetch_from_context($context, 'values')) {
        if (in_array($path_key, $paths)) {
          $this
            ->condition_met($context, $path_key);
        }
      }
    }
  }

}

Members