updated context, metatag, imagestyleflush, browscap

This commit is contained in:
Bachir Soussi Chiadmi
2016-11-05 16:43:45 +01:00
parent 7aeabebddf
commit 3413d81bb8
187 changed files with 14704 additions and 1871 deletions

View File

@@ -8,7 +8,7 @@ class context_condition_bookroot extends context_condition_node {
if ($this->condition_used() && !empty($node->book['bid'])) {
$type = db_select('node')
->fields('node', array('type'))
->condition('nid', $node->book['nid'])
->condition('nid', $node->book['bid'])
->execute()
->fetchField();
$book = new stdClass();

View File

@@ -14,7 +14,7 @@ class context_condition_menu extends context_condition {
foreach ($menus as $key => $name) {
$id = explode(':', $key);
if ($id[1] == '0') {
$root_menus[$id[0]] = check_plain($name);
$root_menus[$id[0]] = $name;
}
else {
$link = menu_link_load($id[1]);

View File

@@ -45,24 +45,28 @@ class context_condition_node_taxonomy extends context_condition_node {
$check_fields = array();
foreach ($instance_fields as $key => $field_info) {
if ($fields[$key]['type'] == 'taxonomy_term_reference') {
$check_fields[] = $key;
$check_fields[$key] = 'tid';
}
else if ($fields[$key]['type'] == 'entityreference' &&
$fields[$key]['settings']['target_type'] == 'taxonomy_term') {
$check_fields[$key] = 'target_id';
}
}
if ($this->condition_used() && !empty($check_fields)) {
foreach ($check_fields as $field) {
foreach ($check_fields as $field => $term_id_key) {
if ($terms = field_get_items('node', $node, $field)) {
foreach ($terms as $term) {
foreach ($this->get_contexts($term['tid']) as $context) {
foreach ($this->get_contexts($term[$term_id_key]) as $context) {
// Check the node form option.
if ($op === 'form') {
$options = $this->fetch_from_context($context, 'options');
if (!empty($options['node_form'])) {
$this->condition_met($context, $term['tid']);
$this->condition_met($context, $term[$term_id_key]);
}
}
else {
$this->condition_met($context, $term['tid']);
$this->condition_met($context, $term[$term_id_key]);
}
}
}

View File

@@ -69,7 +69,7 @@ DrupalContextBlockForm = function(blockForm) {
// Hide enabled blocks from selector that are used
$('table.context-blockform-region tr').each(function() {
var bid = $(this).attr('id');
$('div.context-blockform-selector input[value='+bid+']').parents('div.form-item').eq(0).hide();
$('div.context-blockform-selector input[value="'+bid+'"]').parents('div.form-item').eq(0).hide();
});
// Show blocks in selector that are unused
$('div.context-blockform-selector input').each(function() {
@@ -159,7 +159,7 @@ DrupalContextBlockForm = function(blockForm) {
$(this).removeAttr('checked');
});
if (weight_warn) {
alert(Drupal.t('Desired block weight exceeds available weight options, please check weights for blocks before saving'));
alert(Drupal.t('Desired block weight exceeds available weight options, please check weights for blocks before saving.'));
}
}
return false;
@@ -426,9 +426,8 @@ DrupalContextBlockEditor.prototype = {
$('.editing-context-label').remove();
var label = $('#context-editable-trigger-'+context+' .label').text();
label = Drupal.t('Now Editing: ') + label;
editor.parent().parent()
.prepend('<div class="editing-context-label">'+ label + '</div>');
label = Drupal.t('Now editing: @label', {'@label': label});
editor.parent().parent().prepend('<div class="editing-context-label">' + label + '</div>');
// First pass, enable sortables on all regions.
$(this.regions).each(function() {

View File

@@ -8,6 +8,7 @@ class context_reaction_breadcrumb extends context_reaction_menu {
* Overrides set_active_trail_from_link to set the breadcrumb instead of the menu path.
*/
function set_active_trail_from_link($item) {
$breadcrumb = array(l(t('Home'), '<front>'));
$result = db_select('menu_links')
->fields('menu_links', array('p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'p7', 'p8'))
->condition('hidden', 0)

View File

@@ -22,19 +22,21 @@ class context_reaction_menu extends context_reaction {
$link = menu_link_load($mlid);
$identifier = $link['link_path'];
$root_menu = $menu_names[$menu_name];
while (isset($options[$root_menu][$identifier])) {
while (isset($options[$root_menu][$menu_name . ':' . $identifier])) {
$identifier .= "'";
}
$options[$root_menu][$menu_name . ':' . $identifier] = $title;
}
}
}
$menu_count = count($options, COUNT_RECURSIVE);
return array(
'#title' => $this->title,
'#description' => $this->description,
'#options' => $options,
'#type' => 'select',
'#multiple' => TRUE,
'#size' => $menu_count > 20 ? 20 : $menu_count,
'#default_value' => $this->fetch_from_context($context),
);
}

View File

@@ -14,7 +14,7 @@ class context_reaction_template_suggestions extends context_reaction {
return array(
'#title' => t('Template suggestions'),
'#type' => 'textarea',
'#description' => t('Enter template suggestions such as "page__front", one per line, in order of preference (using underscores instead of hyphens). For more information, please visit ') . l(t('Drupal 7 Template (Theme Hook) Suggestions'), 'http://drupal.org/node/1089656', array(array('target' => '_blank'), 'html' => TRUE,)) . '.',
'#description' => t('Enter template suggestions such as "page__front", one per line, in order of preference (using underscores instead of hyphens). For more information, please visit <a href="@template-suggestions">Drupal 7 Template (Theme Hook) Suggestions</a>.', array('@template-suggestions' => 'http://drupal.org/node/1089656')),
'#default_value' => is_string($default_value) ? $default_value : '',
);
}