first import

This commit is contained in:
Bachir Soussi Chiadmi
2015-04-08 11:40:19 +02:00
commit 1bc61b12ad
8435 changed files with 1582817 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
<?php
/**
* Expose active contexts as a context condition.
*/
class context_condition_context extends context_condition_path {
function execute() {
if ($this->condition_used()) {
$active_contexts = array_keys(context_active_contexts());
foreach ($this->get_contexts() as $context) {
if (!in_array($context->name, $active_contexts, TRUE) && $values = $this->fetch_from_context($context, 'values')) {
if ($this->match($active_contexts, $values)) {
$this->condition_met($context);
}
}
}
// If the list of active contexts has changed, we need to recurse.
if ($active_contexts != array_keys(context_active_contexts())) {
$this->execute();
}
}
}
}