You are here

custompage_context_condition_alias.inc in Custom Page 6

Same filename and directory in other branches
  1. 7 plugins/custompage_context_condition_alias.inc

File

plugins/custompage_context_condition_alias.inc
View source
<?php

/**
 * Expose node views/node forms of specific node types as a context condition.
 */
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);
        }
      }
    }
  }

}

Classes

Namesort descending Description
custompage_context_condition_alias Expose node views/node forms of specific node types as a context condition.