uppdated modules

This commit is contained in:
Bachir Soussi Chiadmi
2017-01-22 16:19:36 +01:00
parent 03be8f82aa
commit 8416e3eea1
748 changed files with 32317 additions and 20900 deletions
@@ -42,7 +42,7 @@ class ctools_context {
var $restrictions = array();
var $empty = FALSE;
function ctools_context($type = 'none', $data = NULL) {
function __construct($type = 'none', $data = NULL) {
$this->type = $type;
$this->data = $data;
$this->title = t('Unknown context');
@@ -119,7 +119,7 @@ class ctools_context_required {
* @param ...
* One or more keywords to use for matching which contexts are allowed.
*/
function ctools_context_required($title) {
function __construct($title) {
$args = func_get_args();
$this->title = array_shift($args);
@@ -204,10 +204,6 @@ class ctools_context_required {
*/
class ctools_context_optional extends ctools_context_required {
var $required = FALSE;
function ctools_context_optional() {
$args = func_get_args();
call_user_func_array(array($this, 'ctools_context_required'), $args);
}
/**
* Add the 'empty' context which is possible for optional
@@ -216,7 +212,7 @@ class ctools_context_optional extends ctools_context_required {
$context = new ctools_context('any');
$context->title = t('No context');
$context->identifier = t('No context');
$contexts = array_merge(array('empty' => $context), $contexts);
$contexts['empty'] = $context;
}
function filter($contexts) {
@@ -680,14 +676,19 @@ function ctools_context_keyword_substitute($string, $keywords, $contexts, $conve
}
}
if (empty($context_keywords[$context]) || !empty($context_keywords[$context]->empty)) {
$keywords['%' . $keyword] = '';
}
else if (!empty($converter)) {
$keywords['%' . $keyword] = ctools_context_convert_context($context_keywords[$context], $converter, $converter_options);
if (!isset($context_keywords[$context])) {
$keywords['%' . $keyword] = '%' . $keyword;
}
else {
$keywords['%' . $keyword] = $context_keywords[$keyword]->title;
if (empty($context_keywords[$context]) || !empty($context_keywords[$context]->empty)) {
$keywords['%' . $keyword] = '';
}
else if (!empty($converter)) {
$keywords['%' . $keyword] = ctools_context_convert_context($context_keywords[$context], $converter, $converter_options);
}
else {
$keywords['%' . $keyword] = $context_keywords[$keyword]->title;
}
}
}
}
@@ -1163,7 +1164,7 @@ function ctools_context_match_required_contexts($required, $contexts) {
}
foreach ($required as $r) {
$context = clone(array_shift($contexts));
$context = clone array_shift($contexts);
$context->identifier = $r['identifier'];
$context->page_title = isset($r['title']) ? $r['title'] : '';
$context->keyword = $r['keyword'];
@@ -1505,7 +1506,7 @@ function ctools_access($settings, $contexts = array()) {
return TRUE;
}
else if (!$pass && $settings['logic'] == 'and') {
// Fail if 'and' and htis rule failed.
// Fail if 'and' and this rule failed.
return FALSE;
}
}