forked from Unallocated/UASDrupal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Unallocated#246 from nhepner1/245-services
245 services
- Loading branch information
Showing
249 changed files
with
33,241 additions
and
3,526 deletions.
There are no files selected for viewing
Empty file modified
0
docroot/profiles/unallocated/modules/contrib/context/LICENSE.txt
100755 → 100644
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
docroot/profiles/unallocated/modules/contrib/context/plugins/context_condition_default.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
/** | ||
* Simple condition that sets context active if no other non-default and non | ||
* sitewide context is active. | ||
*/ | ||
class context_condition_default extends context_condition { | ||
function condition_values() { | ||
return array('context_condition_default' => t('Default context')); | ||
} | ||
|
||
function editor_form($context = NULL) { | ||
$form = parent::editor_form($context); | ||
$form[1]['#title'] = t('Default context'); | ||
$form['#weight'] = -10; | ||
return $form; | ||
} | ||
|
||
function execute() { | ||
if ($this->condition_used()) { | ||
$active_contexts = context_active_contexts(); | ||
|
||
foreach ($active_contexts as $name => $context) { | ||
foreach (array_keys($context->conditions) as $cond) { | ||
if (!in_array($cond, array('default', 'sitewide'))) { | ||
return; | ||
} | ||
} | ||
} | ||
foreach ($this->get_contexts('context_condition_default') as $context) { | ||
$this->condition_met($context, 'context_condition_default'); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.