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,9 +8,9 @@ configure = admin/structure/context
files[] = context.module
files[] = tests/context_ui.test
; Information added by Drupal.org packaging script on 2015-01-06
version = "7.x-3.6"
; Information added by Drupal.org packaging script on 2016-05-18
version = "7.x-3.7"
core = "7.x"
project = "context"
datestamp = "1420573188"
datestamp = "1463605446"

View File

@@ -12,11 +12,11 @@ function DrupalContextPlugins(form) {
$('.context-plugin-list > li', this.form).each(function() {
var plugin = $(this).attr('class').split('context-plugin-')[1].split(' ')[0];
if ($(this).is('.disabled')) {
$('.context-plugin-selector select option[value='+plugin+']', this.form).show();
$('.context-plugin-selector select option[value="'+plugin+'"]', this.form).show();
}
else {
state.push(plugin);
$('.context-plugin-selector select option[value='+plugin+']', this.form).hide();
$('.context-plugin-selector select option[value="'+plugin+'"]', this.form).hide();
}
});
// Set the hidden plugin list state.

View File

@@ -81,7 +81,7 @@ function context_ui_permission() {
'description' => 'Associate menus, views, blocks, etc. with different contexts to structure your site.'
);
$permissions['context ajax block access'] = array(
'title' => t('Access All Blocks'),
'title' => t('Access all blocks'),
'description' => t('Allows users to access all rendered blocks via an AJAX callback. If you have some blocks that should not be rendered for some users but need those users to be able to use context UI, then implement hook_context_allow_ajax_block_access with the necessary logic.'),
);
return $permissions;
@@ -143,7 +143,7 @@ function context_ui_editor($form, &$form_state, $contexts) {
$form['title'] = array(
'#prefix' => '<h2 class="context-editor-title">',
'#markup' => t('Select the Context/Layer to Edit'),
'#markup' => t('Select the context/layer to edit'),
'#suffix' => '</h2>',
'#weight' => -2,
);
@@ -151,10 +151,7 @@ function context_ui_editor($form, &$form_state, $contexts) {
//add some help text to the top of the form
$form['help'] = array (
'#prefix' => '<p class="context-help help">',
'#markup' => t('Select which context, or layer of blocks, to edit.
Each context is configured to appear on different sets of pages so read the description carefully.
When you are done editing click Done and save your changes.
You may use the Stop Editing Layout link to close the editor.'),
'#markup' => t('Select which context, or layer of blocks, to edit. Each context is configured to appear on different sets of pages so read the description carefully. When you are done editing click Done and save your changes. You may use the Stop Editing Layout link to close the editor.'),
'#suffix' => '</p>',
'#weight' => -1,
);
@@ -166,10 +163,9 @@ function context_ui_editor($form, &$form_state, $contexts) {
$edit = l(t('Edit'), $_GET['q'], array('fragment' => $context->name, 'attributes' => array('class' => array('edit'))));
$done = l(t('Done'), $_GET['q'], array('fragment' => $context->name, 'attributes' => array('class' => array('done'))));
$readable_name = ucwords(str_replace('_', ' ', $context->name));
$description = empty($context->description) ? '' :
"<br/><div class='label bottom'>".check_plain($context->description)."</div>";
$description = empty($context->description) ? '' : '<br/><div class="label bottom">' . check_plain($context->description) . '</div>';
$items[] = array(
'data' => "<div class='label top'>" . $readable_name. "</div><div class='links'>{$edit} {$done}</div>" . $description,
'data' => '<div class="label top">' . $readable_name. "</div><div class='links'>{$edit} {$done}</div>" . $description,
'class' => array('context-editable clearfix'),
'id' => "context-editable-trigger-{$context->name}",
);
@@ -306,9 +302,9 @@ function context_ui_settings($form, &$form_state) {
}
$form['context_ui_dialog_enabled'] = array(
'#type' => 'checkbox',
'#title' => t('Use Context Editor Dialog'),
'#title' => t('Use context editor dialog'),
'#default_value' => context_ui_dialog_is_enabled(),
'#description' => t('When enabled all contextual links will have a Edit Layout link that will refresh the page with the context editor in a dialog box.'),
'#description' => t('When enabled all contextual links will have a <em>Edit layout</em> link that will refresh the page with the context editor in a dialog box.'),
);
$form = system_settings_form($form);
$form['#submit'][] = 'context_ui_settings_submit';
@@ -374,7 +370,7 @@ function context_ui_menu_contextual_links_alter(&$links, $router_item, $root_pat
!context_isset('context_ui', 'context_ui_editor_present') && user_access('administer contexts')) {
$links['layout'] = array(
'href' => 'context-ui/activate',
'title' => t('Configure Layout'),
'title' => t('Configure layout'),
'localized_options' => array(
'query' => array('destination'=> $_GET['q']),
'options' => array('html' => FALSE, 'attributes' => array()),

View File

@@ -9,11 +9,11 @@
selector.detach();
$('#page').prepend(selector);
var labelOpen = Drupal.t('Select Context');
var labelOpen = Drupal.t('Select context');
var labelClose = Drupal.t('Hide');
// Create a tab to show/hide our edit area
var tab = $('<a href="javascript:" class="context-ui-dialog-open" title="Show Context Selector">'+labelClose+'</a>');
var tab = $('<a href="javascript:" class="context-ui-dialog-open" title="' + Drupal.t('Show context selector') + '">'+labelClose+'</a>');
selector.append(tab);
selector.toggled = false;

View File

@@ -22,7 +22,7 @@ class context_export_ui extends ctools_export_ui {
function list_render(&$form_state) {
$table = array(
'header' => $this->list_table_header(),
'rows' => $this->rows,
'rows' => $this->rows,
'attributes' => array(
'class' => array('context-admin'),
'id' => 'ctools-export-ui-list-items',
@@ -104,17 +104,17 @@ class context_export_ui extends ctools_export_ui {
* @param $form_state
* Form state array
*/
function context_ui_form(&$form, &$form_state) {
function context_ui_form(&$form, &$form_state) {
$conditions = array_keys(context_conditions());
sort($conditions);
$reactions = array_keys(context_reactions());
sort($reactions);
$context = $form_state['item'];
if (!empty($form_state['input'])) {
$context = _context_ui_rebuild_from_input($context, $form_state['input'], $conditions, $reactions);
}
$form['#base'] = 'context_ui_form';
$form['#theme'] = 'context_ui_form';
@@ -131,7 +131,7 @@ function context_ui_form(&$form, &$form_state) {
'#required' => FALSE,
'#maxlength' => 255,
'#default_value' => isset($context->tag) ? $context->tag : '',
'#description' => t('Example: <code>theme</code>') .'<br/>'. t('A tag to group this context with others.'),
'#description' => t('Example: <code>theme</code>') . '<br/>' . t('A tag to group this context with others.'),
);
$form['info']['description'] = array(
@@ -155,11 +155,11 @@ function context_ui_form(&$form, &$form_state) {
$form['conditions'] = array(
'#theme' => 'context_ui_plugins',
'#title' => t('Conditions'),
'#description' => t('Trigger the activation of this context'),
'#description' => t('Trigger the activation of this context.'),
'#tree' => TRUE,
'selector' => array(
'#type' => 'select',
'#options' => array(0 => '<'. t('Add a condition') .'>'),
'#options' => array(0 => '<' . t('Add a condition') . '>'),
'#default_value' => 0,
),
'state' => array(
@@ -185,11 +185,11 @@ function context_ui_form(&$form, &$form_state) {
$form['reactions'] = array(
'#theme' => 'context_ui_plugins',
'#title' => t('Reactions'),
'#description' => t('Actions to take when this context is active'),
'#description' => t('Actions to take when this context is active.'),
'#tree' => TRUE,
'selector' => array(
'#type' => 'select',
'#options' => array(0 => '<'. t('Add a reaction') .'>'),
'#options' => array(0 => '<' . t('Add a reaction') . '>'),
'#default_value' => 0,
),
'state' => array(
@@ -225,7 +225,7 @@ function context_ui_form(&$form, &$form_state) {
* A context object
*/
function _context_ui_rebuild_from_input($context, $input, $conditions, $reactions) {
$condition_defaults = array();
$condition_defaults = array();
foreach ($conditions as $condition) {
if ($plugin = context_get_plugin('condition', $condition)) {
$condition_defaults[$condition] = array(
@@ -235,7 +235,7 @@ function _context_ui_rebuild_from_input($context, $input, $conditions, $reaction
}
}
$input['conditions']['plugins'] = array_merge($condition_defaults, $input['conditions']['plugins']);
$reaction_defaults = array();
foreach ($reactions as $reaction) {
if ($plugin = context_get_plugin('reaction', $reaction)) {

View File

@@ -48,7 +48,7 @@ class ContextUiTestCase extends DrupalWebTestCase {
'description' => $context->description,
'tag' => $context->tag,
'conditions[plugins][node][values][blog]' => 'blog',
'reactions[plugins][menu]' => 'node/add/blog',
'reactions[plugins][menu][]' => 'navigation:node/add/blog',
);
$this->drupalPost('admin/structure/context/add', $edit, 'Save');
$this->assertText($context->name . ' has been created.', 'Context saved.');