You are here

function supersized_context_condition::execute in Supersized 8

Same name and namespace in other branches
  1. 7 supersized_context/supersized_context_condition.inc \supersized_context_condition::execute()

Override execute().

File

supersized_context/supersized_context_condition.inc, line 29
Condition class of supersized.

Class

supersized_context_condition
@file Condition class of supersized.

Code

function execute() {
  foreach ($this
    ->get_contexts() as $context) {
    $node = NULL;

    // Get node by page.
    if (empty($node)) {
      if (arg(2) !== 'edit') {
        $node = menu_get_object();
      }
    }
    if ($node) {
      $field = supersized_get_supersized_field($node);
      $supersized = $field['items'];
      if (empty($supersized)) {
        $this
          ->condition_met($context);
      }
    }
    else {
      $this
        ->condition_met($context);
    }
  }
}