Révision ef1afbb9
Ajouté par Assos Assos il y a plus de 6 ans
drupal7/sites/all/modules/views/README.txt | ||
---|---|---|
1 |
CONTENTS OF THIS FILE |
|
2 |
--------------------- |
|
3 |
|
|
4 |
* Introduction |
|
5 |
* Requirements |
|
6 |
* Installation |
|
7 |
* Configuration |
|
8 |
* Recommended |
|
9 |
|
|
10 |
|
|
11 |
INTRODUCTION |
|
12 |
------------ |
|
1 | 13 |
|
2 | 14 |
Welcome to Views 3. Please see the advanced help for more information. |
3 | 15 |
|
4 |
If you're having trouble installing this module, please ensure that your |
|
5 |
tar program is not flattening the directory tree, truncating filenames |
|
6 |
or losing files. |
|
16 |
If you're having trouble installing this module, please ensure that your tar |
|
17 |
program is not flattening the directory tree, truncating filenames or losing |
|
18 |
files. |
|
19 |
|
|
20 |
|
|
21 |
REQUIREMENTS |
|
22 |
------------ |
|
23 |
|
|
24 |
This module requires the following modules: |
|
25 |
|
|
26 |
* Chaos tool suite (ctools) (https://drupal.org/project/ctools) |
|
27 |
|
|
28 |
|
|
29 |
INSTALLATION |
|
30 |
------------ |
|
31 |
|
|
32 |
Install as you would normally install a contributed Drupal module. See: |
|
33 |
https://drupal.org/documentation/install/modules-themes/modules-7 for further |
|
34 |
information. |
|
35 |
|
|
36 |
Navigate to administer >> modules. Enable Views and Views UI. |
|
7 | 37 |
|
8 |
Installing Views: |
|
9 | 38 |
|
10 |
Place the entirety of this directory in sites/all/modules/views
|
|
11 |
You must also install the CTools module (http://www.drupal.org/project/ctools) to use Views.
|
|
39 |
RECOMMENDED
|
|
40 |
-----------
|
|
12 | 41 |
|
13 |
Navigate to administer >> build >> modules. Enable Views and Views UI. |
|
42 |
* SimpleViews (https://www.drupal.org/project/simpleviews): |
|
43 |
If you're new to Views, try the Simple Views which can create some often used |
|
44 |
Views for you, this might save you some time. |
|
14 | 45 |
|
15 |
If you're new to Views, try the Simple Views module which can create some
|
|
16 |
often used Views for you, this might save you some time.
|
|
46 |
* Advanced help (https://www.drupal.org/project/advanced_help):
|
|
47 |
If you enable the advanced help, Views will provide more and better help.
|
|
17 | 48 |
|
18 |
Here you can find many modules extending the functionality of Views: |
|
19 |
http://drupal.org/taxonomy/term/89 |
|
49 |
* Here you can find many modules extending the functionality of Views: |
|
50 |
http://drupal.org/taxonomy/term/89 |
drupal7/sites/all/modules/views/includes/handlers.inc | ||
---|---|---|
1544 | 1544 |
|
1545 | 1545 |
// Tack on the extra. |
1546 | 1546 |
if (isset($this->extra)) { |
1547 |
// If extra has been provided as string instead of an array, convert it |
|
1548 |
// to an array. |
|
1549 |
if (!is_array($this->extra)) { |
|
1550 |
$this->extra = array($this->extra); |
|
1551 |
} |
|
1552 |
|
|
1547 | 1553 |
$extras = array(); |
1548 | 1554 |
foreach ($this->extra as $info) { |
1549 | 1555 |
if (is_array($info)) { |
... | ... | |
1658 | 1664 |
// This is just copied verbatim from the parent class, which itself has a |
1659 | 1665 |
// bug: http://drupal.org/node/1118100 |
1660 | 1666 |
if (isset($this->extra)) { |
1667 |
// If extra has been provided as string instead of an array, convert it |
|
1668 |
// to an array. |
|
1669 |
if (!is_array($this->extra)) { |
|
1670 |
$this->extra = array($this->extra); |
|
1671 |
} |
|
1672 |
|
|
1661 | 1673 |
$extras = array(); |
1662 | 1674 |
foreach ($this->extra as $info) { |
1663 | 1675 |
if (is_array($info)) { |
drupal7/sites/all/modules/views/modules/node.views.inc | ||
---|---|---|
733 | 733 |
unset($vars['content']['links']); |
734 | 734 |
} |
735 | 735 |
|
736 |
if (module_exists('comments') && !empty($options['comments']) && user_access('access comments') && $node->comment) {
|
|
736 |
if (module_exists('comment') && !empty($options['comments']) && user_access('access comments') && $node->comment) { |
|
737 | 737 |
$vars['content']['comments'] = comment_node_page_additions($node); |
738 | 738 |
} |
739 | 739 |
} |
drupal7/sites/all/modules/views/modules/node/views_plugin_row_node_view.inc | ||
---|---|---|
61 | 61 |
'#type' => 'checkbox', |
62 | 62 |
'#title' => t('Display comments'), |
63 | 63 |
'#default_value' => $this->options['comments'], |
64 |
'#access' => module_exists('comments'),
|
|
64 |
'#access' => module_exists('comment'), |
|
65 | 65 |
); |
66 | 66 |
} |
67 | 67 |
|
drupal7/sites/all/modules/views/modules/search.views.inc | ||
---|---|---|
43 | 43 |
'left_table' => 'search_index', |
44 | 44 |
'left_field' => 'sid', |
45 | 45 |
'field' => 'sid', |
46 |
'extra' => 'search_index.type = search_dataset.type',
|
|
46 |
'extra' => array('search_index.type = search_dataset.type'),
|
|
47 | 47 |
'type' => 'INNER', |
48 | 48 |
), |
49 | 49 |
'users' => array( |
50 | 50 |
'left_table' => 'search_index', |
51 | 51 |
'left_field' => 'sid', |
52 | 52 |
'field' => 'sid', |
53 |
'extra' => 'search_index.type = search_dataset.type',
|
|
53 |
'extra' => array('search_index.type = search_dataset.type'),
|
|
54 | 54 |
'type' => 'INNER', |
55 | 55 |
), |
56 | 56 |
); |
drupal7/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid.inc | ||
---|---|---|
275 | 275 |
|
276 | 276 |
// We only validate if they've chosen the text field style. |
277 | 277 |
if ($this->options['type'] != 'textfield') { |
278 |
if ($form_state['values'][$identifier] != 'All') {
|
|
278 |
if (isset($form_state['values'][$identifier]) && $form_state['values'][$identifier] != 'All') {
|
|
279 | 279 |
$this->validated_exposed_input = (array) $form_state['values'][$identifier]; |
280 | 280 |
} |
281 | 281 |
return; |
drupal7/sites/all/modules/views/plugins/views_plugin_display.inc | ||
---|---|---|
365 | 365 |
return FALSE; |
366 | 366 |
} |
367 | 367 |
|
368 |
/** |
|
369 |
* Should the enabled display more link being opened in an new window? |
|
370 |
* |
|
371 |
* @codingStandardsIgnoreStart |
|
372 |
*/ |
|
373 |
function use_more_open_new_window() { |
|
374 |
// @codingStandardsIgnoreEnd |
|
375 |
if (!empty($this->definition['use more'])) { |
|
376 |
return $this->get_option('open_new_window'); |
|
377 |
} |
|
378 |
return FALSE; |
|
379 |
} |
|
380 |
|
|
368 | 381 |
/** |
369 | 382 |
* Does the display have custom link text? |
370 | 383 |
*/ |
... | ... | |
414 | 427 |
'hide_admin_links' => array('hide_admin_links'), |
415 | 428 |
'group_by' => array('group_by'), |
416 | 429 |
'query' => array('query'), |
417 |
'use_more' => array('use_more', 'use_more_always', 'use_more_text'), |
|
418 |
'use_more_always' => array('use_more', 'use_more_always', 'use_more_text'), |
|
419 |
'use_more_text' => array('use_more', 'use_more_always', 'use_more_text'), |
|
430 |
'use_more' => array('use_more', |
|
431 |
'use_more_always', |
|
432 |
'open_new_window', |
|
433 |
'use_more_text', |
|
434 |
), |
|
435 |
'use_more_always' => array( |
|
436 |
'use_more', |
|
437 |
'use_more_always', |
|
438 |
'open_new_window', |
|
439 |
'use_more_text', |
|
440 |
), |
|
441 |
'use_more_text' => array( |
|
442 |
'use_more', |
|
443 |
'use_more_always', |
|
444 |
'open_new_window', |
|
445 |
'use_more_text', |
|
446 |
), |
|
447 |
'open_new_window' => array( |
|
448 |
'use_more', |
|
449 |
'use_more_always', |
|
450 |
'open_new_window', |
|
451 |
'use_more_text', |
|
452 |
), |
|
420 | 453 |
'link_display' => array('link_display', 'link_url'), |
421 | 454 |
|
422 | 455 |
// Force these to cascade properly. |
... | ... | |
481 | 514 |
'pager_options' => TRUE, |
482 | 515 |
'use_more' => TRUE, |
483 | 516 |
'use_more_always' => TRUE, |
517 |
'open_new_window' => FALSE, |
|
484 | 518 |
'use_more_text' => TRUE, |
485 | 519 |
'exposed_form' => TRUE, |
486 | 520 |
'exposed_form_options' => TRUE, |
... | ... | |
1529 | 1563 |
'edit-use-more' => array(TRUE), |
1530 | 1564 |
), |
1531 | 1565 |
); |
1566 |
|
|
1567 |
$form['open_new_window'] = array( |
|
1568 |
'#type' => 'checkbox', |
|
1569 |
'#title' => t("Open 'more' link in new window (target='blank')"), |
|
1570 |
'#description' => t("Leave this unchecked to open the more link in the same window."), |
|
1571 |
'#default_value' => $this->get_option('open_new_window'), |
|
1572 |
'#dependency' => array( |
|
1573 |
'edit-use-more' => array(TRUE), |
|
1574 |
), |
|
1575 |
); |
|
1576 |
|
|
1532 | 1577 |
$form['use_more_text'] = array( |
1533 | 1578 |
'#type' => 'textfield', |
1534 | 1579 |
'#title' => t('More link text'), |
... | ... | |
2386 | 2431 |
case 'use_more': |
2387 | 2432 |
$this->set_option($section, intval($form_state['values'][$section])); |
2388 | 2433 |
$this->set_option('use_more_always', !intval($form_state['values']['use_more_always'])); |
2434 |
$this->set_option('open_new_window', $form_state['values']['open_new_window']) == '1'; |
|
2389 | 2435 |
$this->set_option('use_more_text', $form_state['values']['use_more_text']); |
2390 | 2436 |
case 'distinct': |
2391 | 2437 |
$this->set_option($section, $form_state['values'][$section]); |
... | ... | |
2599 | 2645 |
|
2600 | 2646 |
$path = check_url(url($path, $url_options)); |
2601 | 2647 |
|
2602 |
return theme($theme, array('more_url' => $path, 'link_text' => check_plain($this->use_more_text()), 'view' => $this->view)); |
|
2648 |
return theme($theme, array('more_url' => $path, 'new_window' => $this->use_more_open_new_window(), 'link_text' => check_plain($this->use_more_text()), 'view' => $this->view));
|
|
2603 | 2649 |
} |
2604 | 2650 |
} |
2605 | 2651 |
} |
drupal7/sites/all/modules/views/plugins/views_plugin_pager_full.inc | ||
---|---|---|
417 | 417 |
function exposed_form_validate(&$form, &$form_state) { |
418 | 418 |
if (!empty($form_state['values']['offset']) && trim($form_state['values']['offset'])) { |
419 | 419 |
if (!is_numeric($form_state['values']['offset']) || $form_state['values']['offset'] < 0) { |
420 |
form_set_error('offset', t('Offset must be an number greather or equal than 0.'));
|
|
420 |
form_set_error('offset', t('Offset must be an number greater or equal than 0.')); |
|
421 | 421 |
} |
422 | 422 |
} |
423 | 423 |
} |
drupal7/sites/all/modules/views/tests/views_ajax.test | ||
---|---|---|
73 | 73 |
$this->assertEqual($drupal_settings['views']['ajaxViews'][$view_entry]['view_name'], 'test_ajax_view', 'The view\'s ajaxViews array entry has the correct \'view_name\' key.'); |
74 | 74 |
$this->assertEqual($drupal_settings['views']['ajaxViews'][$view_entry]['view_display_id'], 'page_1', 'The view\'s ajaxViews array entry has the correct \'view_display_id\' key.'); |
75 | 75 |
|
76 |
$post = [
|
|
76 |
$post = array(
|
|
77 | 77 |
'view_name' => 'test_ajax_view', |
78 | 78 |
'view_display_id' => 'page_1', |
79 |
];
|
|
79 |
);
|
|
80 | 80 |
|
81 | 81 |
$response = $this->simpleAjaxPost('views/ajax', 'application/json', $post); |
82 | 82 |
$data = drupal_json_decode($response); |
... | ... | |
91 | 91 |
$result = $this->xpath('//div[contains(@class, "views-row")]'); |
92 | 92 |
$this->assertEqual(count($result), 2, 'Ensure that two items are rendered in the HTML.'); |
93 | 93 |
|
94 |
$post = [
|
|
94 |
$post = array(
|
|
95 | 95 |
'view_name' => 'test_noajax_view', |
96 | 96 |
'view_display_id' => 'default', |
97 |
];
|
|
97 |
);
|
|
98 | 98 |
|
99 | 99 |
$response = $this->simpleAjaxPost('views/ajax', 'application/json', $post); |
100 | 100 |
$data = drupal_json_decode($response); |
drupal7/sites/all/modules/views/tests/views_test.info | ||
---|---|---|
5 | 5 |
dependencies[] = views |
6 | 6 |
hidden = TRUE |
7 | 7 |
|
8 |
; Information added by Drupal.org packaging script on 2017-08-16
|
|
9 |
version = "7.x-3.17"
|
|
8 |
; Information added by Drupal.org packaging script on 2017-08-23
|
|
9 |
version = "7.x-3.18"
|
|
10 | 10 |
core = "7.x" |
11 | 11 |
project = "views" |
12 |
datestamp = "1502903349"
|
|
12 |
datestamp = "1503495103"
|
|
13 | 13 |
|
drupal7/sites/all/modules/views/tests/views_test.views_default.inc | ||
---|---|---|
1 |
|
|
2 | 1 |
<?php |
3 | 2 |
|
4 | 3 |
/** |
drupal7/sites/all/modules/views/tests/views_view.test | ||
---|---|---|
7 | 7 |
|
8 | 8 |
/** |
9 | 9 |
* Views class tests. |
10 |
* |
|
11 |
* @codingStandardsIgnoreStart |
|
10 | 12 |
*/ |
11 | 13 |
class ViewsViewTest extends ViewsSqlTest { |
14 |
// @codingStandardsIgnoreEnd |
|
12 | 15 |
public static function getInfo() { |
13 | 16 |
return array( |
14 | 17 |
'name' => 'Test the view class', |
... | ... | |
227 | 230 |
'default' => 'default', |
228 | 231 |
'page_1' => 'page_1', |
229 | 232 |
); |
233 |
|
|
234 |
// @codingStandardsIgnoreLine |
|
230 | 235 |
$translatables['test_destroy'] = array( |
231 | 236 |
t('Master'), |
232 | 237 |
t('more'), |
... | ... | |
272 | 277 |
$handler->display->display_options['pager']['type'] = 'full'; |
273 | 278 |
$handler->display->display_options['style_plugin'] = 'default'; |
274 | 279 |
$handler->display->display_options['row_plugin'] = 'fields'; |
280 |
|
|
281 |
// @codingStandardsIgnoreLine |
|
275 | 282 |
$translatables['test_view_delete'] = array( |
276 | 283 |
t('Defaults'), |
277 | 284 |
t('more'), |
drupal7/sites/all/modules/views/theme/views-more.tpl.php | ||
---|---|---|
7 | 7 |
* - $view: The view object. |
8 | 8 |
* - $more_url: the url for the more link. |
9 | 9 |
* - $link_text: the text for the more link. |
10 |
* - $new_window: The flag that indicates if link should be opened in a new |
|
11 |
* window. |
|
10 | 12 |
* |
11 | 13 |
* @ingroup views_templates |
12 | 14 |
*/ |
13 | 15 |
?> |
14 | 16 |
|
15 | 17 |
<div class="more-link"> |
16 |
<a href="<?php print $more_url ?>"> |
|
18 |
<a href="<?php print $more_url ?>"<?php if (!empty($new_window)) { ?> target="_blank"<?php |
|
19 |
} ?>> |
|
17 | 20 |
<?php print $link_text; ?> |
18 | 21 |
</a> |
19 | 22 |
</div> |
drupal7/sites/all/modules/views/views.info | ||
---|---|---|
328 | 328 |
files[] = tests/views_view.test |
329 | 329 |
files[] = tests/views_ui.test |
330 | 330 |
|
331 |
; Information added by Drupal.org packaging script on 2017-08-16
|
|
332 |
version = "7.x-3.17"
|
|
331 |
; Information added by Drupal.org packaging script on 2017-08-23
|
|
332 |
version = "7.x-3.18"
|
|
333 | 333 |
core = "7.x" |
334 | 334 |
project = "views" |
335 |
datestamp = "1502903349"
|
|
335 |
datestamp = "1503495103"
|
|
336 | 336 |
|
drupal7/sites/all/modules/views/views.install | ||
---|---|---|
252 | 252 |
), |
253 | 253 |
); |
254 | 254 |
|
255 |
// $schema['cache_views_data'] added in views_schema_6006() |
|
256 |
|
|
255 |
// $schema['cache_views_data'] added in views_schema_6006(). |
|
257 | 256 |
return $schema; |
258 | 257 |
} |
259 | 258 |
|
... | ... | |
295 | 294 |
update_sql("UPDATE {blocks} SET delta = CONCAT(delta, '-block_1') WHERE module = 'views'"); |
296 | 295 |
} |
297 | 296 |
|
298 |
// NOTE: Update 6002 removed because it did not always work. |
|
299 |
// Update 6004 implements the change correctly. |
|
297 |
/* |
|
298 |
* NOTE: Update 6002 removed because it did not always work. |
|
299 |
* Update 6004 implements the change correctly. |
|
300 |
*/ |
|
300 | 301 |
|
301 | 302 |
/** |
302 | 303 |
* Add missing unique key. |
... | ... | |
487 | 488 |
*/ |
488 | 489 |
function views_update_6012() { |
489 | 490 |
// There is only one simple query to run. |
490 |
$update = db_update('blocks')
|
|
491 |
db_update('blocks') |
|
491 | 492 |
->condition('module', 'views') |
492 | 493 |
->condition('delta', db_like('-exp-') . '%', 'LIKE') |
493 | 494 |
->fields(array('cache' => DRUPAL_NO_CACHE)); |
drupal7/sites/all/modules/views/views.module | ||
---|---|---|
9 | 9 |
* incoming page and block requests. |
10 | 10 |
*/ |
11 | 11 |
|
12 |
/** |
|
13 |
* Implements hook_help(). |
|
14 |
*/ |
|
15 |
function views_help($path, $arg) { |
|
16 |
switch ($path) { |
|
17 |
case 'admin/help#views': |
|
18 |
$output = ''; |
|
19 |
$output .= '<h3>' . t('About') . '</h3>'; |
|
20 |
$output .= '<p>' . t('The Views module provides a back end to fetch information from content, user accounts, taxonomy terms, and other entities from the database and present it to the user as a grid, HTML list, table, unformatted list, etc. The resulting displays are known generally as views.') . '</p>'; |
|
21 |
$output .= '<p>' . t('For more information, see the <a href="@views" target="blank">online documentation for the Views</a>.', array('@views' => 'https://www.drupal.org/documentation/modules/views')) . '</p>'; |
|
22 |
$output .= '<p>' . t('In order to create and modify your own views using the administration and configuration user interface, you will need to enable either the Views UI module in core or a contributed module that provides a user interface for Views. See the <a href="/admin/structure/views">Views UI module help page</a> for more information.') . '</p>'; |
|
23 |
|
|
24 |
$output .= '<h3>' . t('Uses') . '</h3>'; |
|
25 |
$output .= '<dl>'; |
|
26 |
$output .= '<dt>' . t('Adding functionality to administrative pages') . '</dt>'; |
|
27 |
$output .= '<dd>' . t('The Views module adds functionality to some core administration pages. For example, <em>admin/content</em> uses Views to filter and sort content. With Views uninstalled, <em>admin/content</em> is more limited.') . '</dd>'; |
|
28 |
|
|
29 |
$output .= '<dt>' . t('Expanding Views functionality') . '</dt>'; |
|
30 |
$output .= '<dd>' . t('Contributed projects that support the Views module can be found in the <a href="@views-related" target="blank">online documentation for Views-related contributed modules.</a>.', array('@views-related' => 'https://www.drupal.org/documentation/modules/views/add-ons')) . '</dd>'; |
|
31 |
|
|
32 |
$output .= '<dt>' . t('Improving table accessibility') . '</dt>'; |
|
33 |
$output .= '<dd>' . t('Views tables include semantic markup to improve accessibility. Data cells are automatically associated with header cells through id and header attributes. To improve the accessibility of your tables you can add descriptive elements within the Views table settings. The caption element can introduce context for a table, making it easier to understand. The summary element can provide an overview of how the data has been organized and how to navigate the table. Both the caption and summary are visible by default and also implemented according to HTML5 guidelines.') . '</dd>'; |
|
34 |
return $output; |
|
35 |
} |
|
36 |
} |
|
37 |
|
|
12 | 38 |
/** |
13 | 39 |
* Advertise the current views api version |
14 | 40 |
*/ |
drupal7/sites/all/modules/views/views.tokens.inc | ||
---|---|---|
48 | 48 |
$url_options['language'] = $options['language']; |
49 | 49 |
} |
50 | 50 |
$sanitize = !empty($options['sanitize']); |
51 |
$langcode = isset($options['language']) ? $options['language']->language : NULL; |
|
52 | 51 |
|
53 | 52 |
$replacements = array(); |
54 | 53 |
|
drupal7/sites/all/modules/views/views_ui.info | ||
---|---|---|
4 | 4 |
core = 7.x |
5 | 5 |
configure = admin/structure/views |
6 | 6 |
dependencies[] = views |
7 |
# @codingStandardsIgnoreLine |
|
7 | 8 |
files[] = views_ui.module |
8 | 9 |
files[] = plugins/views_wizard/views_ui_base_views_wizard.class.php |
9 | 10 |
|
10 |
; Information added by Drupal.org packaging script on 2017-08-16
|
|
11 |
version = "7.x-3.17"
|
|
11 |
; Information added by Drupal.org packaging script on 2017-08-23
|
|
12 |
version = "7.x-3.18"
|
|
12 | 13 |
core = "7.x" |
13 | 14 |
project = "views" |
14 |
datestamp = "1502903349"
|
|
15 |
datestamp = "1503495103"
|
|
15 | 16 |
|
drupal7/sites/all/modules/views/views_ui.module | ||
---|---|---|
5 | 5 |
* Provide structure for the administrative interface to Views. |
6 | 6 |
*/ |
7 | 7 |
|
8 |
/** |
|
9 |
* Implements hook_help(). |
|
10 |
*/ |
|
11 |
function views_ui_help($path, $arg) { |
|
12 |
switch ($path) { |
|
13 |
case 'admin/help#views_ui': |
|
14 |
$output = ''; |
|
15 |
$output .= '<h3>' . t('About') . '</h3>'; |
|
16 |
$output .= '<p>' . t('The Views UI module provides an interface for managing views for the Views module. For more information, see the <a href="@views" target="blank">online documentation for the Views UI module</a>.', array('@views' => 'https://www.drupal.org/documentation/modules/views')) . '</p>'; |
|
17 |
$output .= '<h3>' . t('Uses') . '</h3>'; |
|
18 |
$output .= '<dl>'; |
|
19 |
$output .= '<dt>' . t('Creating and managing views') . '</dt>'; |
|
20 |
$output .= '<dd>' . t('Views can be created from the <a href="/admin/structure/views">Views list page</a> by using the "Add view" action. Existing views can be managed from the <a href="/admin/structure/views">Views list page</a> by locating the view in the "Enabled" or "Disabled" list and selecting the desired operation action, for example "Edit".') . '</dd>'; |
|
21 |
|
|
22 |
$output .= '<dt>' . t('Enabling and disabling views') . '</dt>'; |
|
23 |
$output .= '<dd>' . t('Views can be enabled or disabled from the <a href="/admin/structure/views">Views list page</a>. To enable a view, find the view within the "Disabled" list and select the "Enable" operation. To disable a view find the view within the "Enabled" list and select the "Disable" operation.') . '</dd>'; |
|
24 |
|
|
25 |
$output .= '<dt>' . t('Exporting and importing views') . '</dt>'; |
|
26 |
$output .= '<dd>' . t('Views can be exported and imported as configuration files by using the Configuration Manager module.') . '</dd>'; |
|
27 |
return $output; |
|
28 |
} |
|
29 |
} |
|
30 |
|
|
8 | 31 |
/** |
9 | 32 |
* Implements hook_menu(). |
10 | 33 |
*/ |
... | ... | |
96 | 119 |
) + $base; |
97 | 120 |
|
98 | 121 |
// Additional pages for acting on a View. |
99 |
|
|
100 | 122 |
$items['admin/structure/views/view/%views_ui_cache/break-lock'] = array( |
101 | 123 |
'title' => 'Break lock', |
102 | 124 |
'page callback' => 'drupal_get_form', |
... | ... | |
143 | 165 |
'type' => MENU_CALLBACK, |
144 | 166 |
) + $base; |
145 | 167 |
|
146 |
// A page in the Reports section to show usage of fields in all views |
|
168 |
// A page in the Reports section to show usage of fields in all views.
|
|
147 | 169 |
$items['admin/reports/fields/list'] = array( |
148 | 170 |
'title' => 'List', |
149 | 171 |
'type' => MENU_DEFAULT_LOCAL_TASK, |
... | ... | |
175 | 197 |
require_once DRUPAL_ROOT . "/$path/includes/admin.inc"; |
176 | 198 |
|
177 | 199 |
return array( |
178 |
// edit a view
|
|
200 |
// Edit a view.
|
|
179 | 201 |
'views_ui_display_tab_setting' => array( |
180 |
'variables' => array('description' => '', 'link' => '', 'settings_links' => array(), 'overridden' => FALSE, 'defaulted' => FALSE, 'description_separator' => TRUE, 'class' => array()), |
|
202 |
'variables' => array( |
|
203 |
'description' => '', |
|
204 |
'link' => '', |
|
205 |
'settings_links' => array(), |
|
206 |
'overridden' => FALSE, |
|
207 |
'defaulted' => FALSE, |
|
208 |
'description_separator' => TRUE, |
|
209 |
'class' => array(), |
|
210 |
), |
|
181 | 211 |
'template' => 'views-ui-display-tab-setting', |
182 | 212 |
'path' => "$path/theme", |
183 | 213 |
), |
... | ... | |
198 | 228 |
'file' => 'includes/admin.inc', |
199 | 229 |
), |
200 | 230 |
|
201 |
// list views
|
|
231 |
// List views.
|
|
202 | 232 |
'views_ui_view_info' => array( |
203 | 233 |
'variables' => array('view' => NULL, 'base' => NULL), |
204 | 234 |
'file' => "includes/admin.inc", |
... | ... | |
210 | 240 |
'file' => 'includes/admin.inc', |
211 | 241 |
), |
212 | 242 |
|
213 |
// tab themes
|
|
243 |
// Tab themes.
|
|
214 | 244 |
'views_tabset' => array( |
215 | 245 |
'variables' => array('tabs' => NULL), |
216 | 246 |
), |
... | ... | |
222 | 252 |
'file' => 'includes/admin.inc', |
223 | 253 |
), |
224 | 254 |
|
225 |
|
|
226 |
// On behalf of a plugin |
|
255 |
// On behalf of a plugin. |
|
227 | 256 |
'views_ui_style_plugin_table' => array( |
228 | 257 |
'render element' => 'form', |
229 | 258 |
), |
230 | 259 |
|
231 | 260 |
// When previewing a view. |
232 | 261 |
'views_ui_view_preview_section' => array( |
233 |
'variables' => array('view' => NULL, 'section' => NULL, 'content' => NULL, 'links' => ''), |
|
262 |
'variables' => array( |
|
263 |
'view' => NULL, |
|
264 |
'section' => NULL, |
|
265 |
'content' => NULL, |
|
266 |
'links' => '', |
|
267 |
), |
|
234 | 268 |
), |
235 | 269 |
|
236 | 270 |
// Generic container wrapper, to use instead of theme_container when an id |
... | ... | |
274 | 308 |
/** |
275 | 309 |
* Specialized menu callback to load a view and check its locked status. |
276 | 310 |
* |
277 |
* @param $name |
|
311 |
* @param string $name
|
|
278 | 312 |
* The machine name of the view. |
279 | 313 |
* |
280 |
* @return |
|
314 |
* @return object
|
|
281 | 315 |
* The view object, with a "locked" property indicating whether or not |
282 | 316 |
* someone else is already editing the view. |
283 | 317 |
*/ |
... | ... | |
315 | 349 |
} |
316 | 350 |
|
317 | 351 |
/** |
352 |
* Cache set. |
|
353 |
* |
|
318 | 354 |
* Specialized cache function to add a flag to our view, include an appropriate |
319 | 355 |
* include, and cache more easily. |
320 | 356 |
*/ |
... | ... | |
324 | 360 |
return; |
325 | 361 |
} |
326 | 362 |
ctools_include('object-cache'); |
327 |
$view->changed = TRUE; // let any future object know that this view has changed. |
|
363 |
// Let any future object know that this view has changed. |
|
364 |
$view->changed = TRUE; |
|
328 | 365 |
|
329 | 366 |
if (isset($view->current_display)) { |
330 | 367 |
// Add the knowledge of the changed display, too. |
... | ... | |
332 | 369 |
unset($view->current_display); |
333 | 370 |
} |
334 | 371 |
|
335 |
// Unset handlers; we don't want to write these into the cache |
|
372 |
// Unset handlers; we don't want to write these into the cache.
|
|
336 | 373 |
unset($view->display_handler); |
337 | 374 |
unset($view->default_display); |
338 | 375 |
$view->query = NULL; |
... | ... | |
343 | 380 |
ctools_object_cache_set('view', $view->name, $view); |
344 | 381 |
} |
345 | 382 |
|
346 |
|
|
347 | 383 |
/** |
384 |
* Default Load. |
|
385 |
* |
|
348 | 386 |
* Specialized menu callback to load a view that is only a default |
349 | 387 |
* view. |
350 | 388 |
*/ |
... | ... | |
364 | 402 |
$view = $vars['view']; |
365 | 403 |
if (!empty($view->views_ui_context) && module_exists('contextual')) { |
366 | 404 |
$view->hide_admin_links = TRUE; |
367 |
foreach (array('title', 'header', 'exposed', 'rows', 'pager', 'more', 'footer', 'empty', 'attachment_after', 'attachment_before') as $section) { |
|
405 |
|
|
406 |
$sections = array( |
|
407 |
'title', |
|
408 |
'header', |
|
409 |
'exposed', |
|
410 |
'rows', |
|
411 |
'pager', |
|
412 |
'more', |
|
413 |
'footer', |
|
414 |
'empty', |
|
415 |
'attachment_after', |
|
416 |
'attachment_before', |
|
417 |
); |
|
418 |
|
|
419 |
foreach ($sections as $section) { |
|
368 | 420 |
if (!empty($vars[$section])) { |
369 | 421 |
$vars[$section] = array( |
370 | 422 |
'#theme' => 'views_ui_view_preview_section', |
... | ... | |
392 | 444 |
$vars['title'] = t('Title'); |
393 | 445 |
$links = views_ui_view_preview_section_display_category_links($vars['view'], 'title', $vars['title']); |
394 | 446 |
break; |
447 |
|
|
395 | 448 |
case 'header': |
396 | 449 |
$vars['title'] = t('Header'); |
397 | 450 |
$links = views_ui_view_preview_section_handler_links($vars['view'], $vars['section']); |
398 | 451 |
break; |
452 |
|
|
399 | 453 |
case 'empty': |
400 | 454 |
$vars['title'] = t('No results behavior'); |
401 | 455 |
$links = views_ui_view_preview_section_handler_links($vars['view'], $vars['section']); |
402 | 456 |
break; |
457 |
|
|
403 | 458 |
case 'exposed': |
404 | 459 |
// @todo Sorts can be exposed too, so we may need a better title. |
405 | 460 |
$vars['title'] = t('Exposed Filters'); |
406 | 461 |
$links = views_ui_view_preview_section_display_category_links($vars['view'], 'exposed_form_options', $vars['title']); |
407 | 462 |
break; |
463 |
|
|
408 | 464 |
case 'rows': |
409 | 465 |
// @todo The title needs to depend on what is being viewed. |
410 | 466 |
$vars['title'] = t('Content'); |
411 | 467 |
$links = views_ui_view_preview_section_rows_links($vars['view']); |
412 | 468 |
break; |
469 |
|
|
413 | 470 |
case 'pager': |
414 | 471 |
$vars['title'] = t('Pager'); |
415 | 472 |
$links = views_ui_view_preview_section_display_category_links($vars['view'], 'pager_options', $vars['title']); |
416 | 473 |
break; |
474 |
|
|
417 | 475 |
case 'more': |
418 | 476 |
$vars['title'] = t('More'); |
419 | 477 |
$links = views_ui_view_preview_section_display_category_links($vars['view'], 'use_more', $vars['title']); |
420 | 478 |
break; |
479 |
|
|
421 | 480 |
case 'footer': |
422 | 481 |
$vars['title'] = t('Footer'); |
423 | 482 |
$links = views_ui_view_preview_section_handler_links($vars['view'], $vars['section']); |
424 | 483 |
break; |
484 |
|
|
425 | 485 |
case 'attachment_before': |
426 | 486 |
// @todo: Add links to the attachment configuration page. |
427 | 487 |
$vars['title'] = t('Attachment before'); |
428 | 488 |
break; |
489 |
|
|
429 | 490 |
case 'attachment_after': |
430 | 491 |
// @todo: Add links to the attachment configuration page. |
431 | 492 |
$vars['title'] = t('Attachment after'); |
... | ... | |
454 | 515 |
function theme_views_ui_view_preview_section($vars) { |
455 | 516 |
return '<h1 class="section-title">' . $vars['title'] . '</h1>' |
456 | 517 |
. $vars['links'] |
457 |
. '<div class="preview-section">'. $vars['content'] . '</div>'; |
|
518 |
. '<div class="preview-section">' . $vars['content'] . '</div>';
|
|
458 | 519 |
} |
459 | 520 |
|
460 | 521 |
/** |
461 | 522 |
* Returns contextual links for each handler of a certain section. |
462 | 523 |
* |
524 |
* @param string $title |
|
525 |
* Add a bolded title of this section. |
|
526 |
* |
|
463 | 527 |
* @TODO |
464 | 528 |
* Bring in relationships |
465 | 529 |
* Refactor this function to use much stuff of views_ui_edit_form_get_bucket. |
466 |
* |
|
467 |
* @param $title |
|
468 |
* Add a bolded title of this section. |
|
469 | 530 |
*/ |
470 | 531 |
function views_ui_view_preview_section_handler_links($view, $type, $title = FALSE) { |
471 | 532 |
$display = $view->display_handler->display; |
... | ... | |
516 | 577 |
* Returns all contextual links for the main content part of the view. |
517 | 578 |
*/ |
518 | 579 |
function views_ui_view_preview_section_rows_links($view) { |
519 |
$display = $view->display_handler->display; |
|
580 |
|
|
520 | 581 |
$links = array(); |
582 |
|
|
521 | 583 |
$links = array_merge($links, views_ui_view_preview_section_handler_links($view, 'filter', TRUE)); |
522 | 584 |
$links = array_merge($links, views_ui_view_preview_section_handler_links($view, 'field', TRUE)); |
523 | 585 |
$links = array_merge($links, views_ui_view_preview_section_handler_links($view, 'sort', TRUE)); |
... | ... | |
527 | 589 |
return $links; |
528 | 590 |
} |
529 | 591 |
|
530 |
|
|
531 | 592 |
/** |
532 | 593 |
* Implments hook_ctools_plugin_directory(). |
533 | 594 |
* |
... | ... | |
542 | 603 |
/** |
543 | 604 |
* Fetch metadata on a specific views ui wizard plugin. |
544 | 605 |
* |
545 |
* @param $wizard_type |
|
606 |
* @param string $wizard_type
|
|
546 | 607 |
* Name of a wizard, or name of a base table. |
547 | 608 |
* |
548 |
* @return |
|
609 |
* @return array
|
|
549 | 610 |
* An array with information about the requested wizard type. |
550 | 611 |
*/ |
551 | 612 |
function views_ui_get_wizard($wizard_type) { |
... | ... | |
571 | 632 |
/** |
572 | 633 |
* Fetch metadata for all content_type plugins. |
573 | 634 |
* |
574 |
* @return |
|
635 |
* @return array
|
|
575 | 636 |
* An array of arrays with information about all available views wizards. |
576 | 637 |
*/ |
577 | 638 |
function views_ui_get_wizards() { |
578 | 639 |
ctools_include('plugins'); |
579 | 640 |
$wizard_plugins = ctools_get_plugins('views_ui', 'views_wizard'); |
580 | 641 |
$wizard_tables = array(); |
581 |
foreach ($wizard_plugins as $name => $info) {
|
|
642 |
foreach ($wizard_plugins as $info) { |
|
582 | 643 |
$wizard_tables[$info['base_table']] = TRUE; |
583 | 644 |
} |
584 | 645 |
$base_tables = views_fetch_base_tables(); |
... | ... | |
599 | 660 |
/** |
600 | 661 |
* Helper function to define the default values for a Views wizard plugin. |
601 | 662 |
* |
602 |
* @return |
|
663 |
* @return array
|
|
603 | 664 |
* An array of defaults for a views wizard. |
604 | 665 |
*/ |
605 | 666 |
function views_ui_views_wizard_defaults() { |
... | ... | |
607 | 668 |
// The children may, for example, be a different variant for each node type. |
608 | 669 |
'get children' => NULL, |
609 | 670 |
'get child' => NULL, |
610 |
// title and base table must be populated. They are empty here just
|
|
671 |
// Title and base table must be populated. They are empty here just
|
|
611 | 672 |
// so they are documented. |
612 | 673 |
'title' => '', |
613 | 674 |
'base_table' => NULL, |
... | ... | |
636 | 697 |
); |
637 | 698 |
} |
638 | 699 |
|
700 |
/** |
|
701 |
* Get form wizard instance. |
|
702 |
*/ |
|
639 | 703 |
function views_ui_get_form_wizard_instance($wizard) { |
640 | 704 |
if (isset($wizard['form_wizard_class']['class'])) { |
641 | 705 |
$class = $wizard['form_wizard_class']['class']; |
... | ... | |
705 | 769 |
* @see views_ui_contextual_links_suppress_pop() |
706 | 770 |
*/ |
707 | 771 |
function views_ui_contextual_links_suppress_push() { |
708 |
views_ui_contextual_links_suppress(((int) views_ui_contextual_links_suppress())+1);
|
|
772 |
views_ui_contextual_links_suppress(((int) views_ui_contextual_links_suppress()) + 1);
|
|
709 | 773 |
} |
710 | 774 |
|
711 | 775 |
/** |
... | ... | |
714 | 778 |
* @see views_ui_contextual_links_suppress_push() |
715 | 779 |
*/ |
716 | 780 |
function views_ui_contextual_links_suppress_pop() { |
717 |
views_ui_contextual_links_suppress(((int) views_ui_contextual_links_suppress())-1);
|
|
781 |
views_ui_contextual_links_suppress(((int) views_ui_contextual_links_suppress()) - 1);
|
|
718 | 782 |
} |
719 | 783 |
|
720 | 784 |
/** |
721 |
* Menu callback; handles AJAX form submissions similar to ajax_form_callback(), but can be used for uncached forms.
|
|
785 |
* Menu callback. |
|
722 | 786 |
* |
723 |
* ajax_form_callback(), the menu callback for the system/ajax path, requires |
|
787 |
* Handles AJAX form submissions similar to ajax_form_callback(), but can be |
|
788 |
* used for uncached forms. |
|
789 |
* |
|
790 |
* Ajax_form_callback(), the menu callback for the system/ajax path, requires |
|
724 | 791 |
* the form to be retrievable from the form cache, because it lacks a trusted |
725 | 792 |
* $form_id argument with which to call drupal_retrieve_form(). When AJAX is |
726 | 793 |
* wanted on a non-cacheable form, #ajax['path'] can be set to a path whose |
... | ... | |
760 | 827 |
return $callback($form, $form_state); |
761 | 828 |
} |
762 | 829 |
} |
763 |
// @todo move these when we can |
|
764 | 830 |
|
831 |
/** |
|
832 |
* @todo move these when we can |
|
833 |
*/ |
|
765 | 834 |
|
766 | 835 |
/** |
767 | 836 |
* Helper function to get a list of paths assigned to a view. |
768 | 837 |
* |
769 |
* @param $view |
|
838 |
* @param object $view
|
|
770 | 839 |
* The view. |
771 | 840 |
* |
772 |
* @return |
|
841 |
* @return array
|
|
773 | 842 |
* An array of links to this view's display paths. |
774 | 843 |
*/ |
775 | 844 |
function _views_ui_get_paths($view) { |
... | ... | |
778 | 847 |
$all_paths[] = t('Edit this view to add a display.'); |
779 | 848 |
} |
780 | 849 |
else { |
781 |
$view->init_display(); // Make sure all the handlers are set up |
|
850 |
// Make sure all the handlers are set up. |
|
851 |
$view->init_display(); |
|
782 | 852 |
foreach ($view->display as $display) { |
783 | 853 |
if (!empty($display->handler) && $display->handler->has_path()) { |
784 | 854 |
$one_path = $display->handler->get_option('path'); |
785 |
if (empty($path_sort)) { |
|
786 |
$path_sort = strtolower($one_path); |
|
787 |
} |
|
855 |
|
|
788 | 856 |
if (empty($view->disabled) && strpos($one_path, '%') === FALSE) { |
857 |
// @codingStandardsIgnoreLine |
|
789 | 858 |
$all_paths[] = l('/' . $one_path, $one_path); |
790 | 859 |
} |
791 | 860 |
else { |
... | ... | |
801 | 870 |
/** |
802 | 871 |
* Helper function to get a list of displays included in a view. |
803 | 872 |
* |
804 |
* @param $view |
|
873 |
* @param object $view
|
|
805 | 874 |
* The view. |
806 | 875 |
* |
807 |
* @return |
|
876 |
* @return array
|
|
808 | 877 |
* An array of display types that this view includes. |
809 | 878 |
*/ |
810 | 879 |
function _views_ui_get_displays_list($view) { |
... | ... | |
823 | 892 |
} |
824 | 893 |
|
825 | 894 |
/** |
826 |
* This is part of a patch to address a jQueryUI bug. The bug is responsible |
|
827 |
* for the inability to scroll a page when a modal dialog is active. If the content |
|
828 |
* of the dialog extends beyond the bottom of the viewport, the user is only able |
|
829 |
* to scroll with a mousewheel or up/down keyboard keys. |
|
895 |
* This is part of a patch to address a jQueryUI bug. |
|
896 |
* |
|
897 |
* The bug is responsible |
|
898 |
* for the inability to scroll a page when a modal dialog is active. If the |
|
899 |
* content of the dialog extends beyond the bottom of the viewport, the user is |
|
900 |
* only able to scroll with a mousewheel or up/down keyboard keys. |
|
830 | 901 |
* |
831 | 902 |
* @see http://bugs.jqueryui.com/ticket/4671 |
832 | 903 |
* @see https://bugs.webkit.org/show_bug.cgi?id=19033 |
833 | 904 |
* @see /js/jquery.ui.dialog.patch.js |
834 | 905 |
* @see /js/jquery.ui.dialog.min.js |
835 | 906 |
* |
836 |
* The javascript patch overwrites the $.ui.dialog.overlay.events object to remove
|
|
837 |
* the mousedown, mouseup and click events from the list of events that are bound
|
|
838 |
* in $.ui.dialog.overlay.create. |
|
907 |
* The javascript patch overwrites the $.ui.dialog.overlay.events object to |
|
908 |
* remove the mousedown, mouseup and click events from the list of events that
|
|
909 |
* are bound in $.ui.dialog.overlay.create.
|
|
839 | 910 |
*/ |
840 |
|
|
841 | 911 |
function views_ui_library_alter(&$libraries, $module) { |
842 | 912 |
if ($module == 'system' && isset($libraries['ui.dialog'])) { |
843 | 913 |
// Only apply the fix, if we don't have an up to date jQueryUI version. |
Formats disponibles : Unified diff
Weekly update of contrib modules