Projet

Général

Profil

Révision 1e39edcb

Ajouté par Assos Assos il y a plus de 7 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/ctools/bulk_export/bulk_export.info
6 6
version = CTOOLS_MODULE_VERSION
7 7

  
8 8

  
9
; Information added by Drupal.org packaging script on 2016-10-16
10
version = "7.x-1.11"
9
; Information added by Drupal.org packaging script on 2016-11-22
10
version = "7.x-1.12"
11 11
core = "7.x"
12 12
project = "ctools"
13
datestamp = "1476581654"
13
datestamp = "1479787162"
14 14

  
drupal7/sites/all/modules/ctools/css/button.css
19 19
.ctools-button-processed .ctools-content ul {
20 20
  list-style-image: none;
21 21
  list-style-type: none;
22
  margin-left: 0;
22 23
}
23 24

  
24 25
.ctools-button-processed li {
drupal7/sites/all/modules/ctools/ctools.api.php
199 199
 * or categories or to rename content on specific sites.
200 200
 */
201 201
function hook_ctools_content_subtype_alter($subtype, $plugin) {
202
  $subtype['render last'] = TRUE;
202
  // Force a particular subtype of a particular plugin to render last.
203
  if ($plugin['module'] == 'some_plugin_module' && $plugin['name'] == 'some_plugin_name' && $subtype['subtype_id'] == 'my_subtype_id') {
204
    $subtype['render last'] = TRUE;
205
  }
203 206
}
204 207

  
205 208
/**
drupal7/sites/all/modules/ctools/ctools.info
6 6
files[] = includes/css-cache.inc
7 7
files[] = includes/math-expr.inc
8 8
files[] = includes/stylizer.inc
9

  
10
; Tests.
11
files[] = tests/context.test
12
files[] = tests/css.test
9 13
files[] = tests/css_cache.test
14
files[] = tests/ctools.plugins.test
15
files[] = tests/math_expression.test
16
files[] = tests/math_expression_stack.test
17
files[] = tests/object_cache.test
10 18

  
11
; Information added by Drupal.org packaging script on 2016-10-16
12
version = "7.x-1.11"
19
; Information added by Drupal.org packaging script on 2016-11-22
20
version = "7.x-1.12"
13 21
core = "7.x"
14 22
project = "ctools"
15
datestamp = "1476581654"
23
datestamp = "1479787162"
16 24

  
drupal7/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info
5 5
version = CTOOLS_MODULE_VERSION
6 6
dependencies[] = ctools
7 7

  
8
; Information added by Drupal.org packaging script on 2016-10-16
9
version = "7.x-1.11"
8
; Information added by Drupal.org packaging script on 2016-11-22
9
version = "7.x-1.12"
10 10
core = "7.x"
11 11
project = "ctools"
12
datestamp = "1476581654"
12
datestamp = "1479787162"
13 13

  
drupal7/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info
5 5
dependencies[] = ctools
6 6
core = 7.x
7 7

  
8
; Information added by Drupal.org packaging script on 2016-10-16
9
version = "7.x-1.11"
8
; Information added by Drupal.org packaging script on 2016-11-22
9
version = "7.x-1.12"
10 10
core = "7.x"
11 11
project = "ctools"
12
datestamp = "1476581654"
12
datestamp = "1479787162"
13 13

  
drupal7/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info
5 5
version = CTOOLS_MODULE_VERSION
6 6
dependencies[] = ctools
7 7

  
8
; Information added by Drupal.org packaging script on 2016-10-16
9
version = "7.x-1.11"
8
; Information added by Drupal.org packaging script on 2016-11-22
9
version = "7.x-1.12"
10 10
core = "7.x"
11 11
project = "ctools"
12
datestamp = "1476581654"
12
datestamp = "1479787162"
13 13

  
drupal7/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info
8 8
dependencies[] = advanced_help
9 9
core = 7.x
10 10

  
11
; Information added by Drupal.org packaging script on 2016-10-16
12
version = "7.x-1.11"
11
; Information added by Drupal.org packaging script on 2016-11-22
12
version = "7.x-1.12"
13 13
core = "7.x"
14 14
project = "ctools"
15
datestamp = "1476581654"
15
datestamp = "1479787162"
16 16

  
drupal7/sites/all/modules/ctools/drush/ctools.drush.inc
64 64
      'machine names' => 'Space separated list of exportables you want to view.',
65 65
    ),
66 66
    'options' => array(
67
      'indent' => 'The string to use for indentation when dispalying the exportable export code. Defaults to \'\'.',
67
      'indent' => 'The string to use for indentation when displaying the exportable export code. Defaults to \'\'.',
68 68
      'no-colour' => 'Remove any colour formatting from export string output. Ideal if you are sending the output of this command to a file.',
69 69
      'module' => $module_text,
70 70
      'all' => $all_text,
drupal7/sites/all/modules/ctools/includes/content.inc
155 155
  // Walk through the subtypes and ensure minimal settings are
156 156
  // retained.
157 157
  foreach ($subtypes as $id => $subtype) {
158
    // Ensure that the 'subtype_id' value exists.
159
    if (!isset($subtype['subtype_id'])) {
160
      $subtype['subtype_id'] = $id;
161
    }
162

  
158 163
    // Use exact name since this is a modify by reference.
159 164
    ctools_content_prepare_subtype($subtypes[$id], $plugin);
160 165
  }
......
217 222
    }
218 223
  }
219 224

  
225
  // Trigger hook_ctools_content_subtype_alter().
220 226
  drupal_alter('ctools_content_subtype', $subtype, $plugin);
221 227
}
222 228

  
......
241 247
 *   Any incoming content, if this display is a wrapper.
242 248
 *
243 249
 * @return
244
 *   The content as rendered by the plugin. This content should be an array
245
 *   with the following possible keys:
250
 *   The content as rendered by the plugin, or NULL.
251
 *   This content should be an object with the following possible properties:
246 252
 *   - title: The safe to render title of the content.
247 253
 *   - title_heading: The title heading.
248 254
 *   - content: The safe to render HTML content.
drupal7/sites/all/modules/ctools/includes/context-access-admin.inc
367 367
    'contexts' => $contexts,
368 368
    'title' => t('Edit criteria'),
369 369
    'ajax' => TRUE,
370
    'ajax' => TRUE,
371 370
    'modal' => TRUE,
372 371
    'modal return' => TRUE,
373 372
  );
drupal7/sites/all/modules/ctools/includes/context.inc
676 676
        }
677 677
      }
678 678

  
679
      if (empty($context_keywords[$context]) || !empty($context_keywords[$context]->empty)) {
680
        $keywords['%' . $keyword] = '';
681
      }
682
      else if (!empty($converter)) {
683
        $keywords['%' . $keyword] = ctools_context_convert_context($context_keywords[$context], $converter, $converter_options);
679
      if (!isset($context_keywords[$context])) {
680
        $keywords['%' . $keyword] = '%' . $keyword;
684 681
      }
685 682
      else {
686
        $keywords['%' . $keyword] = $context_keywords[$keyword]->title;
683
        if (empty($context_keywords[$context]) || !empty($context_keywords[$context]->empty)) {
684
          $keywords['%' . $keyword] = '';
685
        }
686
        else if (!empty($converter)) {
687
          $keywords['%' . $keyword] = ctools_context_convert_context($context_keywords[$context], $converter, $converter_options);
688
        }
689
        else {
690
          $keywords['%' . $keyword] = $context_keywords[$keyword]->title;
691
        }
687 692
      }
688 693
    }
689 694
  }
drupal7/sites/all/modules/ctools/includes/plugins.inc
200 200
/**
201 201
 * Fetch a group of plugins by name.
202 202
 *
203
 * @param $module
204
 *   The name of the module that utilizes this plugin system. It will be
205
 *   used to call hook_ctools_plugin_$plugin() to get more data about the plugin.
206
 * @param $type
203
 * @param string $module
204
 *   The name of the module that utilizes this plugin system. It will be used to
205
 *   get more data about the plugin as defined on hook_ctools_plugin_type().
206
 * @param string $type
207 207
 *   The type identifier of the plugin.
208
 * @param $id
208
 * @param string $id
209 209
 *   If specified, return only information about plugin with this identifier.
210 210
 *   The system will do its utmost to load only plugins with this id.
211 211
 *
212
 * @return
213
 *   An array of information arrays about the plugins received. The contents
214
 *   of the array are specific to the plugin.
212
 * @return array
213
 *   An array of information arrays about the plugins received. The contents of
214
 *   the array are specific to the plugin.
215 215
 */
216 216
function ctools_get_plugins($module, $type, $id = NULL) {
217 217
  // Store local caches of plugins and plugin info so we don't have to do full
......
224 224

  
225 225
  $info = ctools_plugin_get_plugin_type_info();
226 226

  
227
  // Bail out noisily if an invalid module/type combination is requested.
228 227
  if (!isset($info[$module][$type])) {
229
    watchdog('ctools', 'Invalid plugin module/type combination requested: module @module and type @type', array('@module' => $module, '@type' => $type), WATCHDOG_ERROR);
230
    return array();
228
    // If we don't find the plugin we attempt a cache rebuild before bailing out
229
    $info = ctools_plugin_get_plugin_type_info(TRUE);
230
    // Bail out noisily if an invalid module/type combination is requested.
231
    if (!isset($info[$module][$type])) {
232
      watchdog('ctools', 'Invalid plugin module/type combination requested: module @module and type @type', array('@module' => $module, '@type' => $type), WATCHDOG_ERROR);
233
      return array();
234
    }
231 235
  }
232 236

  
233 237
  // Make sure our plugins array is populated.
......
235 239
    $plugins[$module][$type] = array();
236 240
  }
237 241

  
238
  // Attempt to shortcut this whole piece of code if we already have
239
  // the requested plugin:
242
  // Attempt to shortcut this whole piece of code if we already have the
243
  // requested plugin:
240 244
  if ($id && array_key_exists($id, $plugins[$module][$type])) {
241 245
    return $plugins[$module][$type][$id];
242 246
  }
......
271 275
    $plugins[$module][$type] = ctools_plugin_load_hooks($info[$module][$type]);
272 276
  }
273 277

  
274
  // Then see if we should load all files. We only do this if we
275
  // want a list of all plugins or there was a cache miss.
278
  // Then see if we should load all files. We only do this if we want a list of
279
  // all plugins or there was a cache miss.
276 280
  if (empty($setup[$module][$type]) && ($build_cache || !$id)) {
277 281
    $setup[$module][$type] = TRUE;
278 282
    $plugins[$module][$type] = array_merge($plugins[$module][$type], ctools_plugin_load_includes($info[$module][$type]));
......
296 300
  }
297 301

  
298 302

  
299
  // If we were told earlier that this is cacheable and the cache was
300
  // empty, give something back.
303
  // If we were told earlier that this is cacheable and the cache was empty,
304
  // give something back.
301 305
  if ($build_cache) {
302 306
    cache_set("plugins:$module:$type", $plugins[$module][$type], $info[$module][$type]['cache table']);
303 307
  }
drupal7/sites/all/modules/ctools/includes/uuid.inc
9 9
/**
10 10
 * Pattern for detecting a valid UUID.
11 11
 */
12
define('UUID_PATTERN', '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}');
12
if (!defined('UUID_PATTERN')) {
13
  define('UUID_PATTERN', '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}');
14
}
13 15

  
14 16
/**
15 17
 * Generates a UUID using the Windows internal GUID generator.
drupal7/sites/all/modules/ctools/page_manager/help/getting-started.html
4 4
This is a quick summary:
5 5

  
6 6
<ul>
7
<li>Visit administer >> site building >> pages to get to the primary page manager interface.</li>
7
<li>Visit administer >> structure >> pages to get to the primary page manager interface.</li>
8 8
<li>You can add custom pages for your basic landing pages, front pages, whatever you like for normal content display.</li>
9 9
<li>You can use the system pages to create finer control of how taxonomy vocabularies, nodes and user profiles are displayed.</li>
10 10
<li>When you add your first custom page, do not bother with the optional features. You will not need these until you get to more advanced tasks.</li>
drupal7/sites/all/modules/ctools/page_manager/page_manager.admin.inc
1688 1688

  
1689 1689
  page_manager_handler_add_to_page($form_state['page'], $handler, $form_state['values']['title']);
1690 1690

  
1691
  // Variant is cloned and added to the Page. Ensure the uuids are re-generated.
1692
  panels_panel_context_get_display($handler);
1693
  if (isset($handler->conf['display']) && method_exists($handler->conf['display'], 'clone_display')) {
1694
    $handler->conf['display'] = $handler->conf['display']->clone_display();
1695
  }
1696

  
1691 1697
  $plugin = page_manager_get_task_handler($handler->handler);
1692 1698
  // It has no forms at all. Add the variant and go to its first operation.
1693 1699
  $keys = array_keys($plugin['operations']);
drupal7/sites/all/modules/ctools/page_manager/page_manager.info
5 5
package = Chaos tool suite
6 6
version = CTOOLS_MODULE_VERSION
7 7

  
8
; Information added by Drupal.org packaging script on 2016-10-16
9
version = "7.x-1.11"
8
; Information added by Drupal.org packaging script on 2016-11-22
9
version = "7.x-1.12"
10 10
core = "7.x"
11 11
project = "ctools"
12
datestamp = "1476581654"
12
datestamp = "1479787162"
13 13

  
drupal7/sites/all/modules/ctools/page_manager/plugins/tasks/page.admin.inc
1462 1462
  $original->path = $form_state['values']['path'];
1463 1463

  
1464 1464
  $handlers = !empty($form_state['values']['handlers']) ? $form_state['page']->handlers : FALSE;
1465
  // Ensure the handler uuids are re-generated.
1466
  if ($handlers) {
1467
    foreach ($handlers as &$handler) {
1468
      if (isset($handler->conf['display']) && method_exists($handler->conf['display'], 'clone_display')) {
1469
        $handler->conf['display'] = $handler->conf['display']->clone_display();
1470
      }
1471
    }
1472
  }
1473

  
1465 1474
  // Export the handler, which is a fantastic way to clean database IDs out of it.
1466 1475
  $export = page_manager_page_export($original, $handlers);
1467 1476
  ob_start();
drupal7/sites/all/modules/ctools/plugins/arguments/terms.inc
65 65
    return;
66 66
  }
67 67

  
68
  $current = new stdClass();
68 69
  $current->tid = $context->tids[0];
69 70
  $breadcrumb = array();
70 71
  while ($parents = taxonomy_get_parents($current->tid)) {
drupal7/sites/all/modules/ctools/plugins/content_types/block/block.inc
372 372
}
373 373

  
374 374
function book_ctools_block_info($module, $delta, &$info) {
375
  // Hide the book navigation block which isn't as rich as what we can
376
  // do with context.
377
  $info = NULL;
375
  $info['title'] = t('Book navigation menu');
376
  $info['icon'] = 'icon_core_block_menu.png';
377
  $info['category'] = t('Node');
378 378
}
379 379

  
380 380
function blog_ctools_block_info($module, $delta, &$info) {
drupal7/sites/all/modules/ctools/plugins/content_types/node_context/node_book_menu.inc
1
<?php
2

  
3
if (module_exists('book')) {
4
  /**
5
   * Plugins are described by creating a $plugin array which will be used
6
   * by the system that includes this file.
7
   */
8
  $plugin = array(
9
    'single' => TRUE,
10
    'title' => t('Book navigation menu'),
11
    'icon' => '../block/icon_core_block_menu.png',
12
    'description' => t('The book menu belonging to the current book node.'),
13
    'required context' => new ctools_context_required(t('Node'), 'node'),
14
    'category' => t('Node'),
15
  );
16
}
17

  
18
function ctools_node_book_menu_content_type_render($subtype, $conf, $panel_args, $context) {
19
  $node = isset($context->data) ? clone($context->data) : NULL;
20
  $block = new stdClass();
21
  $block->module = 'book_menu';
22

  
23
  if ($conf['override_title']) {
24
    $block->title = t($conf['override_title_text']);
25
  }
26
  else {
27
    $block->title = t('Book navigation menu');
28
  }
29
  if ($node) {
30
    $block->delta = $node->nid;
31
    // TODO: the value is not available somehow?!?
32
    $book_block_mode = isset($conf['book_block_mode']) ? $conf['book_block_mode'] : 'book pages';
33

  
34
    // Code below is taken from function book_block_view().
35
    $current_bid = empty($node->book['bid']) ? 0 : $node->book['bid'];
36

  
37
    if ($book_block_mode === 'all pages') {
38
      $block->subject = t('Book navigation');
39
      $book_menus = array();
40
      $pseudo_tree = array(0 => array('below' => FALSE));
41
      foreach (book_get_books() as $book_id => $book) {
42
        if ($book['bid'] === $current_bid) {
43
          // If the current page is a node associated with a book, the menu
44
          // needs to be retrieved.
45
          $book_menus[$book_id] = menu_tree_output(menu_tree_all_data($node->book['menu_name'], $node->book));
46
        }
47
        else {
48
          // Since we know we will only display a link to the top node, there
49
          // is no reason to run an additional menu tree query for each book.
50
          $book['in_active_trail'] = FALSE;
51
          // Check whether user can access the book link.
52
          $book_node = node_load($book['nid']);
53
          $book['access'] = node_access('view', $book_node);
54
          $pseudo_tree[0]['link'] = $book;
55
          $book_menus[$book_id] = menu_tree_output($pseudo_tree);
56
        }
57
      }
58
      $book_menus['#theme'] = 'book_all_books_block';
59
      $block->content = $book_menus;
60
    }
61
    elseif ($current_bid) {
62
      // Only display this block when the user is browsing a book.
63
      $select = db_select('node', 'n')
64
          ->fields('n', array('title'))
65
          ->condition('n.nid', $node->book['bid'])
66
          ->addTag('node_access');
67
      $title = $select->execute()->fetchField();
68
      // Only show the block if the user has view access for the top-level node.
69
      if ($title) {
70
        $tree = menu_tree_all_data($node->book['menu_name'], $node->book);
71
        // There should only be one element at the top level.
72
        $data = array_shift($tree);
73
        // TODO: subject is not rendered
74
        $block->subject = theme('book_title_link', array('link' => $data['link']));
75
        $block->content = ($data['below']) ? menu_tree_output($data['below']) : '';
76
      }
77
    }
78
  }
79
  else {
80
    $block->content = t('Book navigation pager goes here.');
81
    $block->delta = 'unknown';
82
  }
83

  
84
  return $block;
85
}
86

  
87
function ctools_node_book_menu_content_type_admin_title($subtype, $conf, $context) {
88
  return t('"@s" book navigation pager', array('@s' => $context->identifier));
89
}
90

  
91
function ctools_node_book_menu_content_type_edit_form($form, &$form_state) {
92
  // Grab block form from the book module.
93
  $block_form = book_block_configure($delta = '');
94
  // TODO: this does not work yet.
95
  //       See TODO in: ctools_node_book_menu_content_type_render
96
  if (isset($form_state['input']['book_block_mode'])) {
97
    $block_form['book_block_mode']['#default_value'] = $form_state['input']['book_block_mode'];
98
  }
99
  $form += $block_form;
100
  return $form;
101
}
drupal7/sites/all/modules/ctools/plugins/content_types/node_context/node_book_nav.inc
7 7
   */
8 8
  $plugin = array(
9 9
    'single' => TRUE,
10
    'title' => t('Book navigation'),
11
    'icon' => 'icon_node.png',
12
    'description' => t('The navigation menu the book the node belongs to.'),
10
    'title' => t('Book navigation pager'),
11
    'icon' => '../block/icon_core_booknavigation.png',
12
    'description' => t('The navigational pager and sub pages of the current book node.'),
13 13
    'required context' => new ctools_context_required(t('Node'), 'node'),
14 14
    'category' => t('Node'),
15 15
  );
......
20 20
  $block = new stdClass();
21 21
  $block->module = 'book_nav';
22 22

  
23
  $block->title = t('Book navigation');
23
  $block->title = t('Book navigation pager');
24 24
  if ($node) {
25 25
    $block->content = isset($node->book) ? theme('book_navigation', array('book_link' => $node->book)) : '';
26 26
    $block->delta = $node->nid;
27 27
  }
28 28
  else {
29
    $block->content = t('Book navigation goes here.');
29
    $block->content = t('Book navigation pager goes here.');
30 30
    $block->delta = 'unknown';
31 31
  }
32 32

  
......
34 34
}
35 35

  
36 36
function ctools_node_book_nav_content_type_admin_title($subtype, $conf, $context) {
37
  return t('"@s" book navigation', array('@s' => $context->identifier));
37
  return t('"@s" book navigation pager', array('@s' => $context->identifier));
38 38
}
39 39

  
40 40
function ctools_node_book_nav_content_type_edit_form($form, &$form_state) {
drupal7/sites/all/modules/ctools/stylizer/stylizer.info
6 6
dependencies[] = ctools
7 7
dependencies[] = color
8 8

  
9
; Information added by Drupal.org packaging script on 2016-10-16
10
version = "7.x-1.11"
9
; Information added by Drupal.org packaging script on 2016-11-22
10
version = "7.x-1.12"
11 11
core = "7.x"
12 12
project = "ctools"
13
datestamp = "1476581654"
13
datestamp = "1479787162"
14 14

  
drupal7/sites/all/modules/ctools/term_depth/term_depth.info
5 5
package = Chaos tool suite
6 6
version = CTOOLS_MODULE_VERSION
7 7

  
8
; Information added by Drupal.org packaging script on 2016-10-16
9
version = "7.x-1.11"
8
; Information added by Drupal.org packaging script on 2016-11-22
9
version = "7.x-1.12"
10 10
core = "7.x"
11 11
project = "ctools"
12
datestamp = "1476581654"
12
datestamp = "1479787162"
13 13

  
drupal7/sites/all/modules/ctools/tests/context.test
5 5
    return array(
6 6
      'name' => 'Keywords substitution',
7 7
      'description' => 'Verify that keywords are properly replaced with data.',
8
      'group' => 'Chaos Tools Suite',
8
      'group' => 'ctools',
9 9
    );
10 10
  }
11 11

  
......
51 51
        "%{$node->title}",
52 52
        t('Keyword after escaped and unescaped percent sign has been replaced.'),
53 53
      ),
54
      '%%foo:bar' => array(
55
        "%foo:bar",
56
        t('Non-existant context ignored.'),
57
      ),
58
      'There was about 20%-30% difference in price.' => array(
59
        'There was about 20%-30% difference in price.',
60
        t('Non-keyword percent sign left untouched.'),
61
      ),
62
      'href="my%20file%2dname.pdf"' => array(
63
        'href="my%20file%2dname.pdf"',
64
        t('HTTP URL escape left untouched.'),
65
      ),
66
      'href="my%a0file%fdname.pdf"' => array(
67
        'href="my%a0file%fdname.pdf"',
68
        t('HTTP URL escape (high-chars) left untouched.'),
69
      ),
70
      '<a href="http://www.example.com/here%20is%20a%20pdf.pdf">Click here!</a>' => array(
71
        '<a href="http://www.example.com/here%20is%20a%20pdf.pdf">Click here!</a>',
72
        t('HTTP URL escape percent sign left untouched in HTML.'),
73
      ),
74
      'SELECT * FROM {table} WHERE field = "%s"' => array(
75
        'SELECT * FROM {table} WHERE field = "%s"',
76
        t('SQL percent sign left untouched.'),
77
      ),
54 78
    );
55 79
    foreach ($checks as $string => $expectations) {
56 80
      list($expected_result, $message) = $expectations;
drupal7/sites/all/modules/ctools/tests/css.test
12 12
    return array(
13 13
      'name' => 'CSS Tools tests',
14 14
      'description' => '...',
15
      'group' => 'Chaos Tools Suite',
15
      'group' => 'ctools',
16 16
    );
17 17
  }
18 18

  
drupal7/sites/all/modules/ctools/tests/css_cache.test
16 16
    return array(
17 17
      'name' => 'Ctools CSS cache',
18 18
      'description' => 'Tests the custom CSS cache handler.',
19
      'group' => 'Chaos Tools Suite',
19
      'group' => 'ctools',
20 20
    );
21 21
  }
22 22

  
drupal7/sites/all/modules/ctools/tests/ctools.plugins.test
12 12
    return array(
13 13
      'name' => 'Get plugin info',
14 14
      'description' => 'Verify that plugin type definitions can properly set and overide values.',
15
      'group' => 'Chaos Tools Suite',
15
      'group' => 'ctools',
16 16
    );
17 17
  }
18 18

  
drupal7/sites/all/modules/ctools/tests/ctools_export_test/ctools_export.test
14 14
    return array(
15 15
      'name' => 'CTools export CRUD tests',
16 16
      'description' => 'Test the CRUD functionality for the ctools export system.',
17
      'group' => 'Chaos Tools Suite',
17
      'group' => 'ctools',
18 18
    );
19 19
  }
20 20

  
drupal7/sites/all/modules/ctools/tests/ctools_export_test/ctools_export_test.info
8 8

  
9 9
files[] = ctools_export.test
10 10

  
11
; Information added by Drupal.org packaging script on 2016-10-16
12
version = "7.x-1.11"
11
; Information added by Drupal.org packaging script on 2016-11-22
12
version = "7.x-1.12"
13 13
core = "7.x"
14 14
project = "ctools"
15
datestamp = "1476581654"
15
datestamp = "1479787162"
16 16

  
drupal7/sites/all/modules/ctools/tests/ctools_plugin_test.info
12 12
files[] = math_expression_stack.test
13 13
hidden = TRUE
14 14

  
15
; Information added by Drupal.org packaging script on 2016-10-16
16
version = "7.x-1.11"
15
; Information added by Drupal.org packaging script on 2016-11-22
16
version = "7.x-1.12"
17 17
core = "7.x"
18 18
project = "ctools"
19
datestamp = "1476581654"
19
datestamp = "1479787162"
20 20

  
drupal7/sites/all/modules/ctools/tests/math_expression.test
13 13
    return array(
14 14
      'name' => 'CTools math expression tests',
15 15
      'description' => 'Test the math expression library of ctools.',
16
      'group' => 'Chaos Tools Suite',
16
      'group' => 'ctools',
17 17
    );
18 18
  }
19 19

  
drupal7/sites/all/modules/ctools/tests/math_expression_stack.test
13 13
    return array(
14 14
      'name' => 'CTools math expression stack tests',
15 15
      'description' => 'Test the stack class of the math expression library.',
16
      'group' => 'Chaos Tools Suite',
16
      'group' => 'ctools',
17 17
    );
18 18
  }
19 19

  
drupal7/sites/all/modules/ctools/tests/object_cache.test
12 12
    return array(
13 13
      'name' => 'Ctools object cache storage',
14 14
      'description' => 'Verify that objects are written, readable and lockable.',
15
      'group' => 'Chaos Tools Suite',
15
      'group' => 'ctools',
16 16
    );
17 17
  }
18 18

  
drupal7/sites/all/modules/ctools/views_content/views_content.info
10 10
files[] = plugins/views/views_content_plugin_display_panel_pane.inc
11 11
files[] = plugins/views/views_content_plugin_style_ctools_context.inc
12 12

  
13
; Information added by Drupal.org packaging script on 2016-10-16
14
version = "7.x-1.11"
13
; Information added by Drupal.org packaging script on 2016-11-22
14
version = "7.x-1.12"
15 15
core = "7.x"
16 16
project = "ctools"
17
datestamp = "1476581654"
17
datestamp = "1479787162"
18 18

  
drupal7/sites/all/modules/media/media.info
24 24
; We have to add a fake version so Git checkouts do not fail Media dependencies
25 25
version = 7.x-2.x-dev
26 26

  
27
; Information added by Drupal.org packaging script on 2016-11-15
28
version = "7.x-2.0-beta7"
27
; Information added by Drupal.org packaging script on 2016-11-20
28
version = "7.x-2.0-beta9"
29 29
core = "7.x"
30 30
project = "media"
31
datestamp = "1479212995"
31
datestamp = "1479647342"
32 32

  
drupal7/sites/all/modules/media/modules/media_bulk_upload/media_bulk_upload.info
13 13
files[] = includes/MediaBrowserBulkUpload.inc
14 14
files[] = tests/media_bulk_upload.test
15 15

  
16
; Information added by Drupal.org packaging script on 2016-11-15
17
version = "7.x-2.0-beta7"
16
; Information added by Drupal.org packaging script on 2016-11-20
17
version = "7.x-2.0-beta9"
18 18
core = "7.x"
19 19
project = "media"
20
datestamp = "1479212995"
20
datestamp = "1479647342"
21 21

  
drupal7/sites/all/modules/media/modules/media_internet/media_internet.info
12 12
files[] = includes/MediaInternetValidationException.inc
13 13
files[] = tests/media_internet.test
14 14

  
15
; Information added by Drupal.org packaging script on 2016-11-15
16
version = "7.x-2.0-beta7"
15
; Information added by Drupal.org packaging script on 2016-11-20
16
version = "7.x-2.0-beta9"
17 17
core = "7.x"
18 18
project = "media"
19
datestamp = "1479212995"
19
datestamp = "1479647342"
20 20

  
drupal7/sites/all/modules/media/modules/media_internet/tests/media_internet_test.info
7 7
files[] = includes/MediaInternetTestStreamWrapper.inc
8 8
files[] = includes/MediaInternetTestHandler.inc
9 9

  
10
; Information added by Drupal.org packaging script on 2016-11-15
11
version = "7.x-2.0-beta7"
10
; Information added by Drupal.org packaging script on 2016-11-20
11
version = "7.x-2.0-beta9"
12 12
core = "7.x"
13 13
project = "media"
14
datestamp = "1479212995"
14
datestamp = "1479647342"
15 15

  
drupal7/sites/all/modules/media/modules/media_migrate_file_types/media_migrate_file_types.info
8 8

  
9 9
configure = admin/structure/file-types/upgrade
10 10

  
11
; Information added by Drupal.org packaging script on 2016-11-15
12
version = "7.x-2.0-beta7"
11
; Information added by Drupal.org packaging script on 2016-11-20
12
version = "7.x-2.0-beta9"
13 13
core = "7.x"
14 14
project = "media"
15
datestamp = "1479212995"
15
datestamp = "1479647342"
16 16

  
drupal7/sites/all/modules/media/modules/media_wysiwyg/includes/media_wysiwyg.features.inc
1
<?php
2

  
3
/**
4
 * @file
5
 * Functions related to features integration.
6
 */
7

  
8
/**
9
 * Implements hook_features_api().
10
 */
11
function media_wysiwyg_features_api() {
12
  return array(
13
    'media_wysiwyg' => array(
14
      'name' => t('Media WYSIWYG'),
15
      'feature_source' => TRUE,
16
      'default_hook' => 'media_wysiwyg_defaults',
17
      'default_file' => FEATURES_DEFAULTS_INCLUDED,
18
    ),
19
  );
20
}
21

  
22
/**
23
 * Implements hook_features_export_options().
24
 *
25
 * Defines what shows up in the feature creation interface
26
 */
27
function media_wysiwyg_features_export_options() {
28
  $options = array();
29
  $entity_info = entity_get_info('file');
30
  foreach ($entity_info['bundles'] as $file_type => $file_type_info) {
31
    $file_type_label = check_plain($file_type_info['label']);
32
    $options[$file_type . '_wysiwyg_view_mode'] =
33
      t('@file_type WYSIWYG view mode', array('@file_type' => $file_type_label));
34

  
35
    $view_mode_settings = field_view_mode_settings('file', $file_type);
36
    foreach ($entity_info['view modes'] as $view_mode => $view_mode_info) {
37
      if (!empty($view_mode_settings[$view_mode]['custom_settings'])) {
38
        $options[$file_type . '_' . $view_mode . '_restrict_wysiwyg'] =
39
          t('@file_type view mode restriction: @view_mode',
40
          array('@file_type' => $file_type_label, '@view_mode' => $view_mode_info['label']));
41
      }
42
    }
43
    // Add default option.
44
    $options[$file_type . '_default_restrict_wysiwyg'] =
45
      t('@file_type view mode restriction: Default',  array(
46
        '@file_type' => $file_type_label,
47
      ));
48
  }
49
  return $options;
50
}
51

  
52
/**
53
 * Implements hook_features_export().
54
 */
55
function media_wysiwyg_features_export($data, &$export, $module_name = '') {
56
  $export['dependencies']['media_wysiwyg'] = 'media_wysiwyg';
57

  
58
  $entity_info = entity_get_info('file');
59
  foreach ($entity_info['bundles'] as $file_type => $file_type_info) {
60

  
61
    // Export the wysiwyg view mode setting for the file type.
62
    $mode_data_key = $file_type . '_wysiwyg_view_mode';
63
    if (in_array($mode_data_key, $data, TRUE)) {
64
      $view_mode = _media_wysiwyg_get_wysiwyg_mode($file_type);
65
      $export['features']['media_wysiwyg'][$mode_data_key] = $mode_data_key;
66
    }
67
    // Export the restricted view modes for the file type.
68
    $view_modes = array_keys($entity_info['view modes']);
69
    array_push($view_modes, 'default');
70
    foreach ($view_modes as $view_mode) {
71
      $restrict_data_key = $file_type . '_' . $view_mode . '_restrict_wysiwyg';
72
      if (in_array($restrict_data_key, $data, TRUE)) {
73
        $export['features']['media_wysiwyg'][$restrict_data_key] = $restrict_data_key;
74
      }
75
    }
76
  }
77
}
78

  
79
/**
80
 * Implements hook_features_export_render().
81
 */
82
function media_wysiwyg_features_export_render($module_name = '', $data, $export = NULL) {
83
  $code = array();
84
  $code[] = '  $media_wysiwyg = array();';
85
  $code[] = '';
86

  
87
  $entity_info = entity_get_info('file');
88
  foreach ($entity_info['bundles'] as $file_type => $file_type_info) {
89

  
90
    // Render the wysiwyg view mode setting for the file type.
91
    $mode_data_key = $file_type . '_wysiwyg_view_mode';
92
    if (array_key_exists($mode_data_key, $data) || in_array($mode_data_key, $data, TRUE)) {
93
      $view_mode = _media_wysiwyg_get_wysiwyg_mode($file_type);
94
      $view_mode_export =  (!empty($view_mode) ? features_var_export($view_mode) : "'none'");
95
      $code[] = "  // WYSIWYG view mode for $file_type files.";
96
      $code[] = "  \$media_wysiwyg['{$mode_data_key}'] = {$view_mode_export};";
97
      $code[] = "";
98
    }
99

  
100
    // Export the restricted view modes for the file type.
101
    $restriction_code = array();
102
    $restricted_view_modes = _media_wysiwyg_get_restricted_modes($file_type);
103
    $view_modes = array_keys($entity_info['view modes']);
104
    array_push($view_modes, 'default');
105
    foreach ($view_modes as $view_mode) {
106
      $restrict_data_key = $file_type . '_' . $view_mode . '_restrict_wysiwyg';
107
      if (array_key_exists($restrict_data_key, $data) || in_array($restrict_data_key, $data, TRUE)) {
108
        $displays_export = in_array($view_mode, $restricted_view_modes) ? 'TRUE' : 'FALSE';
109
        $restriction_code[] = "  \$media_wysiwyg['{$restrict_data_key}'] = {$displays_export};";
110
      }
111
    }
112
    if (!empty($restriction_code)) {
113
      array_unshift($restriction_code, "  // Restricted view modes for $file_type files.");
114
      $restriction_code[] = "";
115
      $code = array_merge($code, $restriction_code);
116
    }
117
  }
118

  
119
  $code[] = '  return $media_wysiwyg;';
120
  $code = implode("\n", $code);
121

  
122
  return array('media_wysiwyg_defaults' => $code);
123
}
124

  
125
/**
126
 * Implements hook_features_revert().
127
 */
128
function media_wysiwyg_features_revert($module) {
129
  if ($defaults = features_get_default('media_wysiwyg', $module)) {
130

  
131
    $entity_info = entity_get_info('file');
132
    foreach ($entity_info['bundles'] as $file_type => $file_type_info) {
133

  
134
      $mode_data_key = $file_type . '_wysiwyg_view_mode';
135
      if (isset($defaults[$mode_data_key])) {
136
        $view_mode = $defaults[$mode_data_key];
137
        db_delete('media_view_mode_wysiwyg')
138
          ->condition('type', $file_type)
139
          ->execute();
140
        if ($view_mode != 'none') {
141
          $record = array('type' => $file_type, 'view_mode' => $view_mode);
142
          drupal_write_record('media_view_mode_wysiwyg', $record);
143
        }
144
      }
145

  
146
      $view_modes = array_keys($entity_info['view modes']);
147
      array_push($view_modes, 'default');
148
      foreach ($view_modes as $view_mode) {
149
        $restrict_data_key = $file_type . '_' . $view_mode . '_restrict_wysiwyg';
150
        if (isset($defaults[$restrict_data_key])) {
151
          db_delete('media_restrict_wysiwyg')
152
            ->condition('type', $file_type)
153
            ->condition('display', $view_mode)
154
            ->execute();
155
          if ($defaults[$restrict_data_key]) {
156
            $record = array(
157
              'type' => $file_type,
158
              'display' => $view_mode);
159
            drupal_write_record('media_restrict_wysiwyg', $record);
160
          }
161
        }
162
      }
163
    }
164
  }
165
}
166

  
167
/**
168
 * Implements hook_features_rebuild().
169
 */
170
function media_wysiwyg_features_rebuild($module) {
171
  media_wysiwyg_features_revert($module);
172
}
173

  
174
/**
175
 * Implements hook_features_enable_feature().
176
 */
177
function media_wysiwyg_features_enable_feature($module) {
178
  media_wysiwyg_features_revert($module);
179
}
180

  
181
/**
182
 * Retrieve the WYSIWYG view mode for the specified file type.
183
 *
184
 * @param string $file_type
185
 *   The machine name of the file type.
186
 */
187
function _media_wysiwyg_get_wysiwyg_mode($file_type) {
188
  $view_mode = db_query(
189
    'SELECT view_mode FROM {media_view_mode_wysiwyg} WHERE type = :type',
190
    array(':type' => $file_type))
191
    ->fetchField();
192
  return $view_mode;
193
}
194

  
195
/**
196
 * Retrieve a list of view modes that should not be available in the WYSIWYG for
197
 * the specified file type.
198
 *
199
 * @param string $file_type
200
 *   The machine name of the file type.
201
 */
202
function _media_wysiwyg_get_restricted_modes($file_type) {
203
  $restricted_view_modes = db_query(
204
    'SELECT display FROM {media_restrict_wysiwyg} WHERE type = :type',
205
    array(':type' => $file_type))
206
    ->fetchCol();
207
  return $restricted_view_modes;
208
}
drupal7/sites/all/modules/media/modules/media_wysiwyg/includes/media_wysiwyg.filter.inc
5 5
 * Functions related to the WYSIWYG editor and the media input filter.
6 6
 */
7 7

  
8
define('MEDIA_WYSIWYG_TOKEN_REGEX', '/\[\[\{"fid".*?\]\]/s');
8
define('MEDIA_WYSIWYG_TOKEN_REGEX', '/\[\[.*?\]\]/s');
9 9

  
10 10
/**
11 11
 * Filter callback for media markup filter.
......
215 215

  
216 216
  if ($wysiwyg) {
217 217
    $settings['wysiwyg'] = $wysiwyg;
218

  
219
    // Render file in WYSIWYG using appropriate view mode.
220
    $view_mode = db_query('SELECT view_mode FROM {media_view_mode_wysiwyg} WHERE type = :type', array(
221
      ':type' => $file->type,
222
    ))
223
      ->fetchField();
224
    if (empty($view_mode)) {
225
      $view_mode = $tag_info['view_mode'];
226
    }
227

  
218 228
    // If sending markup to a WYSIWYG, we need to pass the file information so
219 229
    // that an inline macro can be generated when the WYSIWYG is detached.
220 230
    // The WYSIWYG plugin is expecting this information in the
221 231
    // Drupal.settings.mediaDataMap variable.
222
    $element = media_wysiwyg_get_file_without_label($file, $tag_info['view_mode'], $settings, $langcode);
232
    $element = media_wysiwyg_get_file_without_label($file, $view_mode, $settings, $langcode);
223 233
    $data = array(
224 234
      'type' => 'media',
225 235
      'fid'  => $file->fid,
......
257 267
    }
258 268
    if (count(element_children($element['content'])) > 1) {
259 269
      // Add surrounding divs to group them together.
260
      // We dont want divs when there are no additional fields to allow files
270
      // We don't want divs when there are no additional fields to allow files
261 271
      // to display inline with text, without breaking p tags.
262 272
      $element['content']['#type'] = 'container';
263 273
      $element['content']['#attributes']['class'] = array(
264 274
        'media',
265 275
        'media-element-container',
266
        'media-' . $element['content']['file']['#view_mode']
276
        'media-' . $element['content']['file']['#view_mode'],
267 277
      );
268 278
    }
269 279

  
......
351 361
  // between function calls. Since media_process_form is multiple times
352 362
  // with same form, this function is also called multiple times.
353 363
  static $tagmap = array();
354
  preg_match_all(MEDIA_WYSIWYG_TOKEN_REGEX, $text, $matches, PREG_SET_ORDER);
364
  preg_match_all("/\[\[.*?\]\]/s", $text, $matches, PREG_SET_ORDER);
355 365
  foreach ($matches as $match) {
356 366
    // We see if tagContent is already in $tagMap, if not we add it
357 367
    // to $tagmap.  If we return an empty array, we break embeddings of the same
......
415 425
  }
416 426

  
417 427
  $view_modes = $enabled_view_modes[$file->type];
428
  media_wysiwyg_wysiwyg_allowed_view_modes_restrict($view_modes, $file);
418 429
  drupal_alter('media_wysiwyg_allowed_view_modes', $view_modes, $file);
419 430
  // Invoke the deprecated/misspelled alter hook as well.
420 431
  drupal_alter('media_wysiwyg_wysiwyg_allowed_view_modes', $view_modes, $file);
421 432
  return $view_modes;
422 433
}
423

  
434
/**
435
 * Do not show restricted view modes.
436
 */
437
function media_wysiwyg_wysiwyg_allowed_view_modes_restrict(&$view_modes, &$file) {
438
  $restricted_view_modes = db_query('SELECT display FROM {media_restrict_wysiwyg} WHERE type = :type', array(':type' => $file->type))->fetchCol();
439
  foreach ($restricted_view_modes as $restricted_view_mode) {
440
    if (array_key_exists($restricted_view_mode, $view_modes)) {
441
      unset($view_modes[$restricted_view_mode]);
442
    }
443
  }
444
}
424 445
/**
425 446
 * #pre_render callback: Modify the element if the render cache is filtered.
426 447
 */
drupal7/sites/all/modules/media/modules/media_wysiwyg/includes/media_wysiwyg.pages.inc
97 97
    $form['options']['fields'][$field_name]['#access'] = $allow;
98 98
  }
99 99

  
100
  // Add view mode preview.
101
  media_wysiwyg_format_form_view_mode($form, $form_state, $file);
102

  
100 103
  // Similar to a form_alter, but we want this to run first so that
101 104
  // media.types.inc can add the fields specific to a given type (like alt tags
102 105
  // on media). If implemented as an alter, this might not happen, making other
......
110 113

  
111 114
  return $form;
112 115
}
116

  
117
/**
118
 * Add ajax preview when selecting view mode in wysiwyg editor.
119
 */
120
function media_wysiwyg_format_form_view_mode(&$form, $form_state, $file)  {
121
  // Check to see if a view mode ("format") has already been specified for
122
  //  this media item. First, check for a standard form-submitted value.
123
  if (!empty($form_state['values']['format'])) {
124
    $view_mode = $form_state['values']['format'];
125
  }
126
  // Second, check the request for a JSON-encoded value.
127
  elseif (isset($_GET['fields'])) {
128
    $query_fields = drupal_json_decode($_GET['fields']);
129
    if (isset($query_fields['format'])) {
130
      $view_mode = $query_fields['format'];
131
    }
132
  }
133
  // If we were unable to determine a view mode, or we found a view mode
134
  //  that does not exist in the list of format options presented on this
135
  //  form, use the default view mode.
136
  if (!isset($view_mode) || !array_key_exists($view_mode, $form['options']['format']['#options'])) {
137
    $view_mode = variable_get('media_wysiwyg_wysiwyg_default_view_mode', 'full');
138
  }
139

  
140
  $form['preview'] = array();
141
  $form['preview']['#prefix'] = '<div class="media-item"><div class="media-thumbnail">';
142
  $form['preview']['#suffix'] = '</div><div class="label-wrapper"><label class="media-filename">' . $file->filename . '</label></div></div>';
143
  $form['preview']['thumbnail'] = file_view_file($file, $view_mode);
144
  $form['preview']['thumbnail']['#prefix'] = '<div id="media-preview">';
145
  $form['preview']['thumbnail']['#suffix'] = '</div>';
146

  
147
  if (!isset($form['options']['format']['#default_value'])) {
148
    $form['options']['format']['#default_value'] = $view_mode;
149
  }
150
  $form['options']['format']['#ajax'] = array(
151
    'callback' => 'media_wysiwyg_format_form_preview',
152
    'wrapper' => 'media-preview',
153
  );
154

  
155
  $wysiwyg_view_mode = db_query('SELECT view_mode FROM {media_view_mode_wysiwyg} WHERE type = :type', array(':type' => $file->type))->fetchField();
156
  $view_modes = media_wysiwyg_get_wysiwyg_allowed_view_modes($file);
157
  $formats = $options = array();
158

  
159
  foreach ($view_modes as $view_mode => $view_mode_info) {
160
    $options[$view_mode] = $view_mode_info['label'];
161

  
162
    if (!empty($wysiwyg_view_mode)) {
163
      $element = media_wysiwyg_get_file_without_label($file, $wysiwyg_view_mode, array('wysiwyg' => TRUE));
164
    }
165
    else {
166
      $element = media_wysiwyg_get_file_without_label($file, $view_mode, array('wysiwyg' => TRUE));
167
    }
168

  
169
    $formats[$view_mode] = drupal_render($element);
170
  }
171

  
172
  $form['#formats'] = $formats;
173
  $form['options']['format']['#options'] = $options;
174
}
175

  
176
/**
177
 * AJAX callback to select the portion of the format form to be updated with a preview.
178
 *
179
 * @param array $form
180
 *   An associative array containing the structure of the form.
181
 * @param array $form_state
182
 *   An associative array containing the current state of the form.
183
 *
184
 * @return array
185
 *   The preview form item.
186
 */
187
function media_wysiwyg_format_form_preview($form, $form_state) {
188
  return $form['preview']['thumbnail'];
189
}
drupal7/sites/all/modules/media/modules/media_wysiwyg/media_wysiwyg.info
15 15

  
16 16
configure = admin/config/media/browser
17 17

  
18
; Information added by Drupal.org packaging script on 2016-11-15
19
version = "7.x-2.0-beta7"
18
; Information added by Drupal.org packaging script on 2016-11-20
19
version = "7.x-2.0-beta9"
20 20
core = "7.x"
21 21
project = "media"
22
datestamp = "1479212995"
22
datestamp = "1479647342"
23 23

  
drupal7/sites/all/modules/media/modules/media_wysiwyg/media_wysiwyg.install
5 5
 * Install, update and uninstall functions for the Media WYSIWYG module.
6 6
 */
7 7

  
8
 /**
9
 * Implements hook_schema().
10
 */
11
function media_wysiwyg_schema() {
12
  $schema['media_restrict_wysiwyg'] = array(
13
    'description' => 'Stores media displays restricted in wysiwyg.',
14
    'fields' => array(
15
      'type' => array(
16
        'description' => 'The machine name of the file type.',
17
        'type' => 'varchar',
18
        'length' => 255,
19
        'not null' => TRUE,
20
        'default' => '',
21
      ),
22
      'display' => array(
23
        'description' => 'The restricted display.',
24
        'type' => 'varchar',
25
        'length' => '255',
26
        'not null' => TRUE,
27
        'default' => '',
28
      ),
29
    ),
30
  );
31
  $schema['media_view_mode_wysiwyg'] = array(
32
    'description' => 'Maps WYSIWYG view modes to file types.',
33
    'fields' => array(
34
      'type' => array(
35
        'description' => 'The machine name of the file type.',
36
        'type' => 'varchar',
37
        'length' => 255,
38
        'not null' => TRUE,
39
        'default' => '',
40
      ),
41
      'view_mode' => array(
42
        'description' => 'WYSIWYG view mode mapped to this file type.',
43
        'type' => 'varchar',
44
        'length' => 255,
45
        'not null' => TRUE,
46
        'default' => '',
47
      ),
48

  
49
    ),
50
  );
51
  return $schema;
52
}
53

  
8 54
/**
9 55
 * Implements hook_install().
10 56
 */
......
106 152
    ));
107 153
  }
108 154
}
155

  
156
/**
157
 * Install {media_restrict_wysiwyg} and {media_view_mode_wysiwyg}.
158
 *
159
 * Remove variables media_wysiwyg_view_mode_%.
160
 *
161
 * Uninstall media_wysiwyg_view_mode module.
162
 */
163
function media_wysiwyg_update_7205() {
164
  $schema = media_wysiwyg_schema();
165

  
166
  if (!db_table_exists('media_restrict_wysiwyg')) {
167
    db_create_table('media_restrict_wysiwyg',  $schema['media_restrict_wysiwyg']);
168
    db_create_table('media_view_mode_wysiwyg', $schema['media_view_mode_wysiwyg']);
169
  }
170

  
171
  db_delete('variable')->condition('name', "media_wysiwyg_view_mode_%", "LIKE")->execute();
172

  
173
  // Disable and uninstall View Mode module.Since the view mode module is
174
  // deleted, this copies from  module_disable() and drupal_uninstall_modules().
175
  // Disable first.
176
  $module = 'media_wysiwyg_view_mode';
177
  db_update('system')
178
    ->fields(array('status' => 0))
179
    ->condition('type', 'module')
180
    ->condition('name', $module)
181
    ->execute();
182
  system_list_reset();
183
  module_list(TRUE);
184
  module_implements('', FALSE, TRUE);
185
  entity_info_cache_clear();
186
  // Invoke hook_modules_disabled before disabling modules,
187
  // so we can still call module hooks to get information.
188
  module_invoke_all('modules_disabled', array($module));
189
  // Update the registry to remove the newly-disabled module.
190
  registry_update();
191
  _system_update_bootstrap_status();
192
  // Update the theme registry to remove the newly-disabled module.
193
  drupal_theme_rebuild();
194

  
195
  // Now uninstall.
196
  drupal_uninstall_schema($module);
197
  drupal_set_installed_schema_version($module, SCHEMA_UNINSTALLED);
198

  
199
  module_invoke_all('modules_uninstalled', array($module));
200
}
drupal7/sites/all/modules/media/modules/media_wysiwyg/media_wysiwyg.module
14 14
// Functions for UUID support to embedded media.
15 15
require_once dirname(__FILE__) . '/includes/media_wysiwyg.uuid.inc';
16 16

  
17
// Functions for features integration.
18
require_once dirname(__FILE__) . '/includes/media_wysiwyg.features.inc';
19

  
17 20
/**
18 21
 * Implements hook_hook_info().
19 22
 */
......
362 365
    preg_match($pattern, $field_name, $matches);
363 366
    if (!empty($matches[2])) {
364 367
      $field_name = $matches[2];
365
      $langcode = field_language('file', $file, $field_name);
366
      if (isset($settings['fields'][$field_name][$langcode]['value'])) {
368
      $field_langcode = field_language('file', $file, $field_name);
369
      if (isset($settings['fields'][$field_name][$field_langcode]['value'])) {
367 370
        if (empty($settings['attributes'][$field_type])) {
368
          $settings['attributes'][$field_type] = $settings['fields'][$field_name][$langcode]['value'];
371
          $settings['attributes'][$field_type] = $settings['fields'][$field_name][$field_langcode]['value'];
369 372
        }
370 373
      }
371
      if (isset($settings['fields'][$field_name][$langcode][0]['value'])) {
374
      if (isset($settings['fields'][$field_name][$field_langcode][0]['value'])) {
372 375
        if (empty($settings['attributes'][$field_type])) {
373
          $settings['attributes'][$field_type] = $settings['fields'][$field_name][$langcode][0]['value'];
376
          $settings['attributes'][$field_type] = $settings['fields'][$field_name][$field_langcode][0]['value'];
374 377
        }
375 378
      }
376 379
    }
......
530 533
    }
531 534
  }
532 535
}
536

  
537
/**
538
 * Implements hook_entity_info_alter().
539
 *
540
 * Add a file type named 'WYSIWYG'.
541
 */
542
function media_wysiwyg_entity_info_alter(&$entity_info) {
543
  $entity_info['file']['view modes'] += array(
544
    'wysiwyg' => array(
545
      'label' => t('WYSIWYG'),
546
      'custom settings' => TRUE,
547
    ),
548
  );
549
}
550

  
551
/**
552
 * Implements hook_form_FORM_ID_alter().
553
 *
554
 * Add select when editing file types to set wysiwyg view mode.
555
 */
556
function media_wysiwyg_form_file_entity_file_type_form_alter(&$form, &$form_state) {
557
  $options = array();
558

  
559
  // Add an option allowing users not to use a view mode.
560
  $options['none'] = t('None');
561

  
562
  // Add the default view mode by default.
563
  $options['default'] = t('Default');
564

  
565
  $entity_info = entity_get_info('file');
566
  foreach ($entity_info['view modes'] as $view_mode => $view_mode_info) {
567
    $options[$view_mode] = check_plain($view_mode_info['label']);
568
  }
569

  
570
  $file_type = $form['#file_type']->type;
571
  $view_mode = db_query('SELECT view_mode FROM {media_view_mode_wysiwyg} WHERE type = :type', array(':type' => $file_type))->fetchField();
572
  $view_mode = empty($view_mode) ? 'none' : $view_mode;
573

  
574
  $form['file_wysiwyg_view_mode'] = array(
575
    '#type' => 'select',
576
    '#title' => t('WYSIWYG view mode'),
577
    '#options' => $options,
578
    '#default_value' => $view_mode,
579
    '#description' => t('View mode to be used when displaying files inside of the WYSIWYG editor.'),
580
  );
581

  
582
  // Move submit after our select box. There might be a better way to do this.
583
  $form['submit']['#weight'] = 1;
584

  
585
  array_unshift($form['#submit'], 'media_wysiwyg_form_file_entity_file_type_form_alter_submit');
586
}
587

  
588
/**
589
 * Custom submit handler.
590
 *
591
 * Save wysiwyg view mode.
592
 *
593
 * @see media_wysiwyg_form_file_entity_file_type_form_alter().
594
 */
595
function media_wysiwyg_form_file_entity_file_type_form_alter_submit(&$form, &$form_state) {
596
  $file_type = $form['#file_type']->type;
597
  $view_mode = $form_state['values']['file_wysiwyg_view_mode'];
598
  db_delete('media_view_mode_wysiwyg')->condition('type', $file_type)->execute();
... Ce différentiel a été tronqué car il excède la taille maximale pouvant être affichée.

Formats disponibles : Unified diff