Révision 05237dd8
Ajouté par Assos Assos il y a presque 7 ans
drupal7/sites/all/modules/imce/imce.info | ||
---|---|---|
4 | 4 |
package = "Media" |
5 | 5 |
configure = "admin/config/media/imce" |
6 | 6 |
|
7 |
; Information added by Drupal.org packaging script on 2016-03-30
|
|
8 |
version = "7.x-1.10"
|
|
7 |
; Information added by Drupal.org packaging script on 2017-05-27
|
|
8 |
version = "7.x-1.11"
|
|
9 | 9 |
core = "7.x" |
10 | 10 |
project = "imce" |
11 |
datestamp = "1459346870"
|
|
11 |
datestamp = "1495890787"
|
|
12 | 12 |
|
drupal7/sites/all/modules/imce/imce.install | ||
---|---|---|
25 | 25 |
variable_del('imce_settings_replace'); |
26 | 26 |
variable_del('imce_settings_thumb_method'); |
27 | 27 |
variable_del('imce_settings_disable_private'); |
28 |
variable_del('imce_settings_admin_theme'); |
|
28 | 29 |
variable_del('imce_custom_content'); |
29 | 30 |
variable_del('imce_custom_process'); |
30 | 31 |
variable_del('imce_custom_init'); |
drupal7/sites/all/modules/imce/imce.module | ||
---|---|---|
46 | 46 |
return $items; |
47 | 47 |
} |
48 | 48 |
|
49 |
/** |
|
50 |
* Implements hook_admin_paths(). |
|
51 |
*/ |
|
52 |
function imce_admin_paths() { |
|
53 |
if (variable_get('imce_settings_admin_theme', FALSE)) { |
|
54 |
return array( |
|
55 |
'imce' => TRUE, |
|
56 |
'imce/*' => TRUE, |
|
57 |
'file/imce/*' => TRUE, |
|
58 |
'imce-filefield/*' => TRUE, |
|
59 |
); |
|
60 |
} |
|
61 |
} |
|
62 |
|
|
49 | 63 |
/** |
50 | 64 |
* Implements hook_permission(). |
51 | 65 |
*/ |
drupal7/sites/all/modules/imce/inc/imce.admin.inc | ||
---|---|---|
109 | 109 |
'#default_value' => variable_get('imce_settings_disable_private', 1), |
110 | 110 |
'#description' => t('IMCE serves all files under private files directory without applying any access restrictions. This allows anonymous access to any file(/system/files/filename) unless there is a module restricting access to the files. Here you can disable this feature.'), |
111 | 111 |
); |
112 |
$form['common']['admin_theme'] = array( |
|
113 |
'#type' => 'checkbox', |
|
114 |
'#title' => t('Use admin theme for IMCE paths'), |
|
115 |
'#default_value' => variable_get('imce_settings_admin_theme', FALSE), |
|
116 |
'#description' => t('If you have user interface issues with the active theme you may consider switching to admin theme.'), |
|
117 |
); |
|
112 | 118 |
|
113 | 119 |
$form['submit'] = array('#type' => 'submit', '#value' => t('Save configuration')); |
114 | 120 |
$form['#theme'] = 'imce_admin'; |
... | ... | |
183 | 189 |
variable_set('imce_settings_replace', $form_state['values']['replace']); |
184 | 190 |
variable_set('imce_settings_thumb_method', $form_state['values']['thumb_method']); |
185 | 191 |
variable_set('imce_settings_disable_private', $form_state['values']['disable_private']); |
192 |
variable_set('imce_settings_admin_theme', $form_state['values']['admin_theme']); |
|
186 | 193 |
drupal_set_message(t('Changes have been saved.')); |
187 | 194 |
} |
188 | 195 |
|
drupal7/sites/all/modules/imce/js/imce.js | ||
---|---|---|
801 | 801 |
if (furl.charAt(furl.length - 1) != '/') { |
802 | 802 |
furl = imce.conf.furl = furl + '/'; |
803 | 803 |
} |
804 |
imce.conf.modfix = imce.conf.clean && furl.indexOf(host + '/system/') > -1;
|
|
804 |
imce.conf.modfix = imce.conf.clean && furl.split('/')[3] === 'system';
|
|
805 | 805 |
if (absurls && !isabs) { |
806 | 806 |
imce.conf.furl = baseurl + furl; |
807 | 807 |
} |
808 | 808 |
else if (!absurls && isabs && furl.indexOf(baseurl) == 0) { |
809 |
imce.conf.furl = furl.substr(baseurl.length); |
|
809 |
furl = furl.substr(baseurl.length); |
|
810 |
// Server base url is defined with a port which is missing in current page url. |
|
811 |
if (furl.charAt(0) === ':') { |
|
812 |
furl = furl.replace(/^:\d*/, ''); |
|
813 |
} |
|
814 |
imce.conf.furl = furl; |
|
810 | 815 |
} |
811 | 816 |
//convert button elements to input elements. |
812 | 817 |
imce.convertButtons(imce.FW); |
drupal7/sites/all/modules/ldap/ldap_authentication/ldap_authentication.inc | ||
---|---|---|
81 | 81 |
$auth_conf = ldap_authentication_get_valid_conf(); |
82 | 82 |
if ($auth_conf && ldap_authentication_ldap_authenticated($form['#user'])) { |
83 | 83 |
if ($auth_conf->emailOption == LDAP_AUTHENTICATION_EMAIL_FIELD_REMOVE) { |
84 |
$form['account']['mail']['#type'] = 'hidden';
|
|
84 |
$form['account']['mail']['#access'] = FALSE;
|
|
85 | 85 |
} |
86 | 86 |
elseif ($auth_conf->emailOption == LDAP_AUTHENTICATION_EMAIL_FIELD_DISABLE) { |
87 | 87 |
$form['account']['mail']['#disabled'] = TRUE; |
drupal7/sites/all/modules/ldap/ldap_authentication/ldap_authentication.info | ||
---|---|---|
14 | 14 |
files[] = ldap_authentication.admin.inc |
15 | 15 |
files[] = tests/ldap_authentication.test |
16 | 16 |
|
17 |
; Information added by Drupal.org packaging script on 2017-05-21
|
|
18 |
version = "7.x-2.1"
|
|
17 |
; Information added by Drupal.org packaging script on 2017-05-30
|
|
18 |
version = "7.x-2.2"
|
|
19 | 19 |
core = "7.x" |
20 | 20 |
project = "ldap" |
21 |
datestamp = "1495392789"
|
|
21 |
datestamp = "1496167150"
|
|
22 | 22 |
|
drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization.info | ||
---|---|---|
17 | 17 |
files[] = tests/Og2Tests.test |
18 | 18 |
configure = admin/config/people/ldap/authorization |
19 | 19 |
|
20 |
; Information added by Drupal.org packaging script on 2017-05-21
|
|
21 |
version = "7.x-2.1"
|
|
20 |
; Information added by Drupal.org packaging script on 2017-05-30
|
|
21 |
version = "7.x-2.2"
|
|
22 | 22 |
core = "7.x" |
23 | 23 |
project = "ldap" |
24 |
datestamp = "1495392789"
|
|
24 |
datestamp = "1496167150"
|
|
25 | 25 |
|
drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization_drupal_role/ldap_authorization_drupal_role.info | ||
---|---|---|
9 | 9 |
files[] = ldap_authorization_drupal_role.module |
10 | 10 |
files[] = ldap_authorization_drupal_role.inc |
11 | 11 |
|
12 |
; Information added by Drupal.org packaging script on 2017-05-21
|
|
13 |
version = "7.x-2.1"
|
|
12 |
; Information added by Drupal.org packaging script on 2017-05-30
|
|
13 |
version = "7.x-2.2"
|
|
14 | 14 |
core = "7.x" |
15 | 15 |
project = "ldap" |
16 |
datestamp = "1495392789"
|
|
16 |
datestamp = "1496167150"
|
|
17 | 17 |
|
drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization_og/ldap_authorization_og.info | ||
---|---|---|
13 | 13 |
|
14 | 14 |
core = "7.x" |
15 | 15 |
|
16 |
; Information added by Drupal.org packaging script on 2017-05-21
|
|
17 |
version = "7.x-2.1"
|
|
16 |
; Information added by Drupal.org packaging script on 2017-05-30
|
|
17 |
version = "7.x-2.2"
|
|
18 | 18 |
core = "7.x" |
19 | 19 |
project = "ldap" |
20 |
datestamp = "1495392789"
|
|
20 |
datestamp = "1496167150"
|
|
21 | 21 |
|
drupal7/sites/all/modules/ldap/ldap_feeds/ldap_feeds.info | ||
---|---|---|
12 | 12 |
core = 7.x |
13 | 13 |
php = 5.2 |
14 | 14 |
|
15 |
; Information added by Drupal.org packaging script on 2017-05-21
|
|
16 |
version = "7.x-2.1"
|
|
15 |
; Information added by Drupal.org packaging script on 2017-05-30
|
|
16 |
version = "7.x-2.2"
|
|
17 | 17 |
core = "7.x" |
18 | 18 |
project = "ldap" |
19 |
datestamp = "1495392789"
|
|
19 |
datestamp = "1496167150"
|
|
20 | 20 |
|
drupal7/sites/all/modules/ldap/ldap_help/ldap_help.info | ||
---|---|---|
5 | 5 |
|
6 | 6 |
dependencies[] = ldap_servers |
7 | 7 |
dependencies[] = ldap_test |
8 |
; Information added by Drupal.org packaging script on 2017-05-21
|
|
9 |
version = "7.x-2.1"
|
|
8 |
; Information added by Drupal.org packaging script on 2017-05-30
|
|
9 |
version = "7.x-2.2"
|
|
10 | 10 |
core = "7.x" |
11 | 11 |
project = "ldap" |
12 |
datestamp = "1495392789"
|
|
12 |
datestamp = "1496167150"
|
|
13 | 13 |
|
drupal7/sites/all/modules/ldap/ldap_query/ldap_query.info | ||
---|---|---|
17 | 17 |
|
18 | 18 |
configure = admin/config/people/ldap/query |
19 | 19 |
|
20 |
; Information added by Drupal.org packaging script on 2017-05-21
|
|
21 |
version = "7.x-2.1"
|
|
20 |
; Information added by Drupal.org packaging script on 2017-05-30
|
|
21 |
version = "7.x-2.2"
|
|
22 | 22 |
core = "7.x" |
23 | 23 |
project = "ldap" |
24 |
datestamp = "1495392789"
|
|
24 |
datestamp = "1496167150"
|
|
25 | 25 |
|
drupal7/sites/all/modules/ldap/ldap_servers/ldap_servers.info | ||
---|---|---|
17 | 17 |
files[] = tests/ldap_servers.test |
18 | 18 |
configure = admin/config/people/ldap/servers |
19 | 19 |
|
20 |
; Information added by Drupal.org packaging script on 2017-05-21
|
|
21 |
version = "7.x-2.1"
|
|
20 |
; Information added by Drupal.org packaging script on 2017-05-30
|
|
21 |
version = "7.x-2.2"
|
|
22 | 22 |
core = "7.x" |
23 | 23 |
project = "ldap" |
24 |
datestamp = "1495392789"
|
|
24 |
datestamp = "1496167150"
|
|
25 | 25 |
|
drupal7/sites/all/modules/ldap/ldap_sso/ldap_sso.info | ||
---|---|---|
6 | 6 |
core = 7.x |
7 | 7 |
configure = admin/config/people/ldap/authentication |
8 | 8 |
|
9 |
; Information added by Drupal.org packaging script on 2017-05-21
|
|
10 |
version = "7.x-2.1"
|
|
9 |
; Information added by Drupal.org packaging script on 2017-05-30
|
|
10 |
version = "7.x-2.2"
|
|
11 | 11 |
core = "7.x" |
12 | 12 |
project = "ldap" |
13 |
datestamp = "1495392789"
|
|
13 |
datestamp = "1496167150"
|
|
14 | 14 |
|
drupal7/sites/all/modules/ldap/ldap_test/ldap_test.info | ||
---|---|---|
18 | 18 |
files[] = LdapTestFunctions.class.php |
19 | 19 |
files[] = LdapUserTestCase.class.php |
20 | 20 |
|
21 |
; Information added by Drupal.org packaging script on 2017-05-21
|
|
22 |
version = "7.x-2.1"
|
|
21 |
; Information added by Drupal.org packaging script on 2017-05-30
|
|
22 |
version = "7.x-2.2"
|
|
23 | 23 |
core = "7.x" |
24 | 24 |
project = "ldap" |
25 |
datestamp = "1495392789"
|
|
25 |
datestamp = "1496167150"
|
|
26 | 26 |
|
drupal7/sites/all/modules/ldap/ldap_user/ldap_user.info | ||
---|---|---|
23 | 23 |
stylesheets[all][] = ldap_user.css |
24 | 24 |
configure = admin/config/people/ldap/user |
25 | 25 |
|
26 |
; Information added by Drupal.org packaging script on 2017-05-21
|
|
27 |
version = "7.x-2.1"
|
|
26 |
; Information added by Drupal.org packaging script on 2017-05-30
|
|
27 |
version = "7.x-2.2"
|
|
28 | 28 |
core = "7.x" |
29 | 29 |
project = "ldap" |
30 |
datestamp = "1495392789"
|
|
30 |
datestamp = "1496167150"
|
|
31 | 31 |
|
drupal7/sites/all/modules/ldap/ldap_user/ldap_user.module | ||
---|---|---|
1089 | 1089 |
switch ($instance['widget']['type']) { |
1090 | 1090 |
case 'ldap_user_hidden': |
1091 | 1091 |
$element['value'] = $element + array( |
1092 |
'#type' => 'hidden',
|
|
1093 |
'#default_value' => isset($items[$delta]['value']) ? $items[$delta]['value'] : NULL,
|
|
1092 |
'#type' => 'value',
|
|
1093 |
'#value' => isset($items[$delta]['value']) ? $items[$delta]['value'] : NULL, |
|
1094 | 1094 |
); |
1095 | 1095 |
break; |
1096 | 1096 |
} |
drupal7/sites/all/modules/ldap/ldap_views/ldap_views.info | ||
---|---|---|
21 | 21 |
files[] = handlers/ldap_views_handler_filter_attribute.inc |
22 | 22 |
files[] = handlers/ldap_views_handler_sort.inc |
23 | 23 |
files[] = handlers/ldap_views_handler_sort_attribute.inc |
24 |
; Information added by Drupal.org packaging script on 2017-05-21
|
|
25 |
version = "7.x-2.1"
|
|
24 |
; Information added by Drupal.org packaging script on 2017-05-30
|
|
25 |
version = "7.x-2.2"
|
|
26 | 26 |
core = "7.x" |
27 | 27 |
project = "ldap" |
28 |
datestamp = "1495392789"
|
|
28 |
datestamp = "1496167150"
|
|
29 | 29 |
|
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 2017-05-17
|
|
28 |
version = "7.x-2.3"
|
|
27 |
; Information added by Drupal.org packaging script on 2017-05-25
|
|
28 |
version = "7.x-2.4"
|
|
29 | 29 |
core = "7.x" |
30 | 30 |
project = "media" |
31 |
datestamp = "1495030417"
|
|
31 |
datestamp = "1495749189"
|
|
32 | 32 |
|
drupal7/sites/all/modules/media/media.install | ||
---|---|---|
87 | 87 |
'rules' => 7205, |
88 | 88 |
); |
89 | 89 |
// Those updates require {file_type} table created. |
90 |
$dependencies['media'][7204] = array(
|
|
91 |
'file_entity' => 7201,
|
|
90 |
$dependencies['media'][7200] = array(
|
|
91 |
'file_entity' => 7207,
|
|
92 | 92 |
); |
93 | 93 |
// Require {file_type}.mimetypes column before updating them. |
94 | 94 |
$dependencies['media'][7208] = array( |
... | ... | |
965 | 965 |
$effect = array( |
966 | 966 |
'name' => 'image_scale_and_crop', |
967 | 967 |
'data' => array( |
968 |
'width' => 180,
|
|
969 |
'height' => 180,
|
|
968 |
'width' => 100,
|
|
969 |
'height' => 100,
|
|
970 | 970 |
'weight' => 0, |
971 | 971 |
), |
972 | 972 |
'isid' => $style['isid'], |
drupal7/sites/all/modules/media/media.views.inc | ||
---|---|---|
33 | 33 |
'help' => t('Display as a tab in the media browser.'), |
34 | 34 |
'handler' => 'media_views_plugin_display_media_browser', |
35 | 35 |
'theme' => 'views_view', |
36 |
'theme path' => drupal_get_path('module', 'views') . '/theme', |
|
36 | 37 |
'base' => $base, |
37 | 38 |
'use ajax' => TRUE, |
38 | 39 |
'use pager' => TRUE, |
drupal7/sites/all/modules/media/modules/media_bulk_upload/media_bulk_upload.info | ||
---|---|---|
15 | 15 |
files[] = includes/MediaBrowserBulkUpload.inc |
16 | 16 |
files[] = tests/media_bulk_upload.test |
17 | 17 |
|
18 |
; Information added by Drupal.org packaging script on 2017-05-17
|
|
19 |
version = "7.x-2.3"
|
|
18 |
; Information added by Drupal.org packaging script on 2017-05-25
|
|
19 |
version = "7.x-2.4"
|
|
20 | 20 |
core = "7.x" |
21 | 21 |
project = "media" |
22 |
datestamp = "1495030417"
|
|
22 |
datestamp = "1495749189"
|
|
23 | 23 |
|
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 2017-05-17
|
|
16 |
version = "7.x-2.3"
|
|
15 |
; Information added by Drupal.org packaging script on 2017-05-25
|
|
16 |
version = "7.x-2.4"
|
|
17 | 17 |
core = "7.x" |
18 | 18 |
project = "media" |
19 |
datestamp = "1495030417"
|
|
19 |
datestamp = "1495749189"
|
|
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 2017-05-17
|
|
11 |
version = "7.x-2.3"
|
|
10 |
; Information added by Drupal.org packaging script on 2017-05-25
|
|
11 |
version = "7.x-2.4"
|
|
12 | 12 |
core = "7.x" |
13 | 13 |
project = "media" |
14 |
datestamp = "1495030417"
|
|
14 |
datestamp = "1495749189"
|
|
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 2017-05-17
|
|
12 |
version = "7.x-2.3"
|
|
11 |
; Information added by Drupal.org packaging script on 2017-05-25
|
|
12 |
version = "7.x-2.4"
|
|
13 | 13 |
core = "7.x" |
14 | 14 |
project = "media" |
15 |
datestamp = "1495030417"
|
|
15 |
datestamp = "1495749189"
|
|
16 | 16 |
|
drupal7/sites/all/modules/media/modules/media_wysiwyg/css/media_wysiwyg.css | ||
---|---|---|
10 | 10 |
margin: 20px; |
11 | 11 |
} |
12 | 12 |
|
13 |
#media-wysiwyg-format-form .media-item {
|
|
13 |
#media-wysiwyg-format-form .media-preview-group {
|
|
14 | 14 |
float: left; |
15 | 15 |
margin-right: 10px; |
16 | 16 |
} |
17 | 17 |
|
18 |
#media-wysiwyg-format-form .media-preview-group .edit-file-link { |
|
19 |
text-align: center; |
|
20 |
} |
|
21 |
|
|
18 | 22 |
#media-wysiwyg-format-form .form-item-format label { |
19 | 23 |
display: inline; |
20 | 24 |
} |
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', '/\[\[.*?\]\]/s');
|
|
8 |
define('MEDIA_WYSIWYG_TOKEN_REGEX', '/\[\[.+?"type":"media".+?\]\]/s');
|
|
9 | 9 |
|
10 | 10 |
/** |
11 | 11 |
* Filter callback for media markup filter. |
... | ... | |
27 | 27 |
return $rendered_text; |
28 | 28 |
} |
29 | 29 |
|
30 |
/** |
|
31 |
* Filter callback to configure media_filter_paragraph_fix filter. |
|
32 |
*/ |
|
33 |
function _media_filter_paragraph_fix_settings($form, &$form_state, $filter, $format, $defaults) { |
|
34 |
$filter->settings += $defaults; |
|
35 |
$settings['replace'] = array( |
|
36 |
'#type' => 'checkbox', |
|
37 |
'#title' => t('Replace paragraph tags with DIV.media-p tags'), |
|
38 |
'#default_value' => $filter->settings['replace'], |
|
39 |
'#description' => t('Default behaviour is to strip out parent P tags of media elements rather than replacing these.'), |
|
40 |
); |
|
41 |
return $settings; |
|
42 |
} |
|
43 |
|
|
30 | 44 |
/** |
31 | 45 |
* Filter callback to remove paragraph tags surrounding embedded media. |
32 | 46 |
*/ |
33 |
function media_wysiwyg_filter_paragraph_fix($text) { |
|
47 |
function media_wysiwyg_filter_paragraph_fix($text, $filter) {
|
|
34 | 48 |
$html_dom = filter_dom_load($text); |
49 |
// Store Nodes to remove to avoid inferferring with the NodeList iteration. |
|
50 |
$dom_nodes_to_remove = array(); |
|
35 | 51 |
foreach ($html_dom->getElementsByTagName('p') as $paragraph) { |
36 | 52 |
if (preg_match(MEDIA_WYSIWYG_TOKEN_REGEX, $paragraph->nodeValue)) { |
37 |
$sibling = $paragraph->firstChild; |
|
38 |
do { |
|
39 |
$next = $sibling->nextSibling; |
|
40 |
$paragraph->parentNode->insertBefore($sibling, $paragraph); |
|
41 |
} while ($sibling = $next); |
|
42 |
$paragraph->parentNode->removeChild($paragraph); |
|
53 |
if (empty($filter->settings['replace'])) { |
|
54 |
$sibling = $paragraph->firstChild; |
|
55 |
do { |
|
56 |
$next = $sibling->nextSibling; |
|
57 |
$paragraph->parentNode->insertBefore($sibling, $paragraph); |
|
58 |
} while ($sibling = $next); |
|
59 |
$dom_nodes_to_remove[] = $paragraph; |
|
60 |
} |
|
61 |
else { |
|
62 |
// Clone the P node into a DIV node. |
|
63 |
$div = $html_dom->createElement('div'); |
|
64 |
$sibling = $paragraph->firstChild; |
|
65 |
do { |
|
66 |
$next = $sibling->nextSibling; |
|
67 |
$div->appendChild($sibling); |
|
68 |
} while ($sibling = $next); |
|
69 |
|
|
70 |
$classes = array('media-p'); |
|
71 |
if ($paragraph->hasAttributes()) { |
|
72 |
foreach ($paragraph->attributes as $attr) { |
|
73 |
$name = $attr->nodeName; |
|
74 |
$value = $attr->nodeValue; |
|
75 |
if (strtolower($name) == 'class') { |
|
76 |
$classes[] = $value; |
|
77 |
} |
|
78 |
else { |
|
79 |
// Supressing errors with ID attribute or duplicate properties. |
|
80 |
@$div->setAttribute($name, $value); |
|
81 |
} |
|
82 |
} |
|
83 |
} |
|
84 |
$div->setAttribute('class', implode(' ', $classes)); |
|
85 |
|
|
86 |
$paragraph->parentNode->insertBefore($div, $paragraph); |
|
87 |
$dom_nodes_to_remove[] = $paragraph; |
|
88 |
} |
|
43 | 89 |
} |
44 | 90 |
} |
91 |
foreach ($dom_nodes_to_remove as $paragraph) { |
|
92 |
$paragraph->parentNode->removeChild($paragraph); |
|
93 |
} |
|
45 | 94 |
$text = filter_dom_serialize($html_dom); |
46 | 95 |
return $text; |
47 | 96 |
} |
drupal7/sites/all/modules/media/modules/media_wysiwyg/includes/media_wysiwyg.pages.inc | ||
---|---|---|
164 | 164 |
} |
165 | 165 |
|
166 | 166 |
$form['preview'] = array(); |
167 |
$form['preview']['#prefix'] = '<div class="media-item"><div class="media-thumbnail">'; |
|
168 |
$form['preview']['#suffix'] = '</div><div class="label-wrapper"><label class="media-filename">' . check_plain($file->filename) . '</label></div></div>'; |
|
167 |
$form['preview']['#prefix'] = '<div class="media-preview-group"><div class="media-item"><div class="media-thumbnail">';
|
|
168 |
$form['preview']['#suffix'] = '</div><div class="label-wrapper"><label class="media-filename">' . check_plain($file->filename) . '</label></div></div><div class="edit-file-link">' . l(t('Edit file'), 'file/'.$file->fid.'/edit', array('attributes' => array('class' => 'button', 'title' => t('Use for replace file or edit file fields.')))) . '</div></div>';
|
|
169 | 169 |
$form['preview']['thumbnail'] = file_view_file($file, $view_mode); |
170 | 170 |
$form['preview']['thumbnail']['#prefix'] = '<div id="media-preview">'; |
171 | 171 |
$form['preview']['thumbnail']['#suffix'] = '</div>'; |
drupal7/sites/all/modules/media/modules/media_wysiwyg/js/media_wysiwyg.filter.js | ||
---|---|---|
175 | 175 |
Drupal.media.filter.ensure_tagmap(); |
176 | 176 |
|
177 | 177 |
// Locate and process all the media placeholders in the WYSIWYG content. |
178 |
var contentElements = $('<div/>').html(content); // TODO: once baseline jQuery is 1.8+, switch to using $.parseHTML(content) |
|
178 |
var contentElements = $('<div/>'); // TODO: once baseline jQuery is 1.8+, switch to using $.parseHTML(content) |
|
179 |
contentElements.get(0).innerHTML = content; |
|
179 | 180 |
var mediaElements = contentElements.find('.media-element'); |
180 | 181 |
if (mediaElements) { |
181 | 182 |
$(mediaElements).each(function (i) { |
drupal7/sites/all/modules/media/modules/media_wysiwyg/media_wysiwyg.info | ||
---|---|---|
12 | 12 |
files[] = media_wysiwyg.test |
13 | 13 |
files[] = tests/media_wysiwyg.file_usage.test |
14 | 14 |
files[] = tests/media_wysiwyg.macro.test |
15 |
files[] = tests/media_wysiwyg.paragraph_fix_filter.test |
|
15 | 16 |
|
16 | 17 |
configure = admin/config/media/browser |
17 | 18 |
|
18 |
; Information added by Drupal.org packaging script on 2017-05-17
|
|
19 |
version = "7.x-2.3"
|
|
19 |
; Information added by Drupal.org packaging script on 2017-05-25
|
|
20 |
version = "7.x-2.4"
|
|
20 | 21 |
core = "7.x" |
21 | 22 |
project = "media" |
22 |
datestamp = "1495030417"
|
|
23 |
datestamp = "1495749189"
|
|
23 | 24 |
|
drupal7/sites/all/modules/media/modules/media_wysiwyg/media_wysiwyg.module | ||
---|---|---|
342 | 342 |
|
343 | 343 |
$filters['media_filter_paragraph_fix'] = array( |
344 | 344 |
'title' => t('Ensure that embedded Media tags are not contained in paragraphs'), |
345 |
'description' => t('This filter will strip any paragraph tags surrounding embedded Media tags. This helps to avoid the chopped up markup that can result from unexpectedly closed paragraph tags. This filter should be positioned above (before) the "Convert Media tags to markup" filter.'),
|
|
345 |
'description' => t('This filter will fix any paragraph tags surrounding embedded Media tags. This helps to avoid the chopped up markup that can result from unexpectedly closed paragraph tags. This filter should be positioned above (before) the "Convert Media tags to markup" filter.'),
|
|
346 | 346 |
'process callback' => 'media_wysiwyg_filter_paragraph_fix', |
347 |
'settings callback' => '_media_filter_paragraph_fix_settings', |
|
348 |
'default settings' => array( |
|
349 |
'replace' => 0, |
|
350 |
), |
|
347 | 351 |
'weight' => 1, |
348 | 352 |
); |
349 | 353 |
|
... | ... | |
389 | 393 |
'data-delta', |
390 | 394 |
)); |
391 | 395 |
drupal_alter('media_wysiwyg_allowed_attributes', $allowed_attributes); |
392 |
return $allowed_attributes;
|
|
396 |
return $allowed_attributes; |
|
393 | 397 |
} |
394 | 398 |
|
395 | 399 |
/** |
... | ... | |
603 | 607 |
if (empty($form_state['build_info']['args'][0])) { |
604 | 608 |
return; |
605 | 609 |
} |
606 |
|
|
610 |
|
|
607 | 611 |
$options = array(); |
608 | 612 |
|
609 | 613 |
// Add an option allowing users not to use a view mode. |
drupal7/sites/all/modules/media/modules/media_wysiwyg/media_wysiwyg.test | ||
---|---|---|
58 | 58 |
); |
59 | 59 |
|
60 | 60 |
// Create the file usage markup. |
61 |
$markup .= '<p>Intro paragraph</p>'; |
|
61 | 62 |
for ($i = 1; $i <= $count; $i++) { |
62 | 63 |
$markup .= '<p>[[' . drupal_json_encode($data) . ']]</p>'; |
63 | 64 |
} |
65 |
$markup .= '<p>Finish paragraph</p>'; |
|
64 | 66 |
|
65 | 67 |
return $markup; |
66 | 68 |
} |
drupal7/sites/all/modules/media/modules/media_wysiwyg/tests/media_wysiwyg.paragraph_fix_filter.test | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
/** |
|
4 |
* @file |
|
5 |
* Tests for ensuring filters are working properly. |
|
6 |
*/ |
|
7 |
|
|
8 |
/** |
|
9 |
* Defines media macro test cases. |
|
10 |
*/ |
|
11 |
class MediaWYSIWYGParagraphFixFilterTest extends MediaWYSIWYGTestHelper { |
|
12 |
|
|
13 |
/** |
|
14 |
* Defines the regex to test for a media tag replacement. |
|
15 |
* |
|
16 |
* @var string |
|
17 |
*/ |
|
18 |
protected $regexpMediaTag = '/<div [^>]*media\-element\-container[^>]*>/i'; |
|
19 |
|
|
20 |
/** |
|
21 |
* Defines the regex to test for in the raw body field source. |
|
22 |
* |
|
23 |
* @var string |
|
24 |
*/ |
|
25 |
protected $regexpPWrapped = '/<p[^>]*><div [^>]*media\-element\-container[^>]*>/i'; |
|
26 |
|
|
27 |
/** |
|
28 |
* Defines the regex to test for the P replacement filter. |
|
29 |
* |
|
30 |
* @var string |
|
31 |
*/ |
|
32 |
protected $regexpReplaced = '/<div class\="media\-p"><div/i'; |
|
33 |
|
|
34 |
/** |
|
35 |
* Provide test information. |
|
36 |
*/ |
|
37 |
public static function getInfo() { |
|
38 |
return array( |
|
39 |
'name' => t('Media WYSIWYG Paragraph Filter Test'), |
|
40 |
'description' => t('Tests that this media filter is working.'), |
|
41 |
'group' => t('Media WYSIWYG'), |
|
42 |
'dependencies' => array('token'), |
|
43 |
); |
|
44 |
} |
|
45 |
|
|
46 |
/** |
|
47 |
* Set-up the system for testing without the filter enabled. |
|
48 |
*/ |
|
49 |
public function setUp() { |
|
50 |
parent::setUp('token'); |
|
51 |
|
|
52 |
// Create and log in a user. |
|
53 |
$account = $this->drupalCreateUser(array( |
|
54 |
'create article content', |
|
55 |
'administer filters', |
|
56 |
'use text format filtered_html', |
|
57 |
)); |
|
58 |
$this->drupalLogin($account); |
|
59 |
|
|
60 |
// Enable the media filter for full html. |
|
61 |
$edit = array( |
|
62 |
'filters[media_filter][status]' => TRUE, |
|
63 |
'filters[filter_autop][status]' => FALSE, |
|
64 |
'filters[filter_html][status]' => FALSE, |
|
65 |
'filters[filter_htmlcorrector][status]' => FALSE, |
|
66 |
); |
|
67 |
$this->drupalPost('admin/config/content/formats/filtered_html', $edit, t('Save configuration')); |
|
68 |
} |
|
69 |
|
|
70 |
/** |
|
71 |
* Test image media overrides. |
|
72 |
*/ |
|
73 |
public function testMediaFilterParagraphFixMultipleImages() { |
|
74 |
$files = $this->drupalGetTestFiles('image'); |
|
75 |
$file = file_save($files[0]); |
|
76 |
|
|
77 |
// Create a node to test with 3 images. |
|
78 |
$nid = $this->createNode($file->fid); |
|
79 |
$node = node_load($nid); |
|
80 |
$node->body[LANGUAGE_NONE][0]['value'] = $this->generateJsonTokenMarkup($file->fid, 3); |
|
81 |
node_save($node); |
|
82 |
|
|
83 |
// Check without the filter enabled. |
|
84 |
$html = $this->drupalGet('node/' . $nid); |
|
85 |
$count = preg_match_all($this->regexpMediaTag, $html); |
|
86 |
$this->assertEqual($count, 3, t('Three media tags found, found @count.', array('@count' => $count))); |
|
87 |
|
|
88 |
$count = preg_match_all($this->regexpPWrapped, $html); |
|
89 |
$this->assertEqual($count, 3, t('Three media tags with original wrapping HTML present, found @count.', array('@count' => $count))); |
|
90 |
|
|
91 |
$count = preg_match_all($this->regexpReplaced, $html); |
|
92 |
$this->assertEqual($count, 0, t('No media tags with P replaced present, found @count.', array('@count' => $count))); |
|
93 |
|
|
94 |
// Enable the default P fix filter. |
|
95 |
$edit = array( |
|
96 |
'filters[media_filter_paragraph_fix][status]' => TRUE, |
|
97 |
); |
|
98 |
$this->drupalPost('admin/config/content/formats/filtered_html', $edit, t('Save configuration')); |
|
99 |
$html = $this->drupalGet('node/' . $nid); |
|
100 |
|
|
101 |
$count = preg_match_all($this->regexpMediaTag, $html); |
|
102 |
$this->assertEqual($count, 3, t('Three media tags found, found @count.', array('@count' => $count))); |
|
103 |
|
|
104 |
$count = preg_match_all($this->regexpPWrapped, $html); |
|
105 |
$this->assertEqual($count, 0, t('No media tags with original wrapping HTML present, found @count.', array('@count' => $count))); |
|
106 |
|
|
107 |
$count = preg_match_all($this->regexpReplaced, $html); |
|
108 |
$this->assertEqual($count, 0, t('No media tags with P replaced present, found @count.', array('@count' => $count))); |
|
109 |
|
|
110 |
// Enable the replace P fix filter option. |
|
111 |
$edit = array( |
|
112 |
'filters[media_filter_paragraph_fix][settings][replace]' => TRUE, |
|
113 |
); |
|
114 |
$this->drupalPost('admin/config/content/formats/filtered_html', $edit, t('Save configuration')); |
|
115 |
$html = $this->drupalGet('node/' . $nid); |
|
116 |
|
|
117 |
$count = preg_match_all($this->regexpMediaTag, $html); |
|
118 |
$this->assertEqual($count, 3, t('Three media tags found, found @count.', array('@count' => $count))); |
|
119 |
|
|
120 |
$count = preg_match_all($this->regexpPWrapped, $html); |
|
121 |
$this->assertEqual($count, 0, t('No media tags with original wrapping HTML present, found @count.', array('@count' => $count))); |
|
122 |
|
|
123 |
$count = preg_match_all($this->regexpReplaced, $html); |
|
124 |
$this->assertEqual($count, 3, t('Three media tags with P replaced present, found @count.', array('@count' => $count))); |
|
125 |
} |
|
126 |
|
|
127 |
/** |
|
128 |
* Test image media overrides. |
|
129 |
*/ |
|
130 |
public function testMediaFilterParagraphFixDefault() { |
|
131 |
$files = $this->drupalGetTestFiles('image'); |
|
132 |
$file = file_save($files[0]); |
|
133 |
|
|
134 |
// Create a node to test with. |
|
135 |
$nid = $this->createNode($file->fid); |
|
136 |
|
|
137 |
// Check without the filter enabled. |
|
138 |
$this->drupalGet('node/' . $nid); |
|
139 |
$this->assertPattern($this->regexpPWrapped, t('Nested media DIV tags within paragraphs without filter.')); |
|
140 |
$this->assertNoPattern($this->regexpReplaced, t('No replacement DIV tag found without filter.')); |
|
141 |
|
|
142 |
// Enable the default P fix filter. |
|
143 |
$edit = array( |
|
144 |
'filters[media_filter_paragraph_fix][status]' => TRUE, |
|
145 |
); |
|
146 |
$this->drupalPost('admin/config/content/formats/filtered_html', $edit, t('Save configuration')); |
|
147 |
|
|
148 |
// Retest the content to check nested paragraphs are removed. |
|
149 |
$this->drupalGet('node/' . $nid); |
|
150 |
$this->assertNoPattern($this->regexpPWrapped, t('Nested media DIV tags within paragraphs with filter defaults.')); |
|
151 |
$this->assertNoPattern($this->regexpReplaced, t('No replacement DIV tag found with filter defaults.')); |
|
152 |
|
|
153 |
// Enable replacement option. |
|
154 |
$edit = array( |
|
155 |
'filters[media_filter_paragraph_fix][settings][replace]' => TRUE, |
|
156 |
); |
|
157 |
$this->drupalPost('admin/config/content/formats/filtered_html', $edit, t('Save configuration')); |
|
158 |
|
|
159 |
// Test that the replace text was found. |
|
160 |
$this->drupalGet('node/' . $nid); |
|
161 |
$this->assertNoPattern($this->regexpPWrapped, t('No nested media DIV tags within paragraphs with filter P replacement.')); |
|
162 |
$this->assertPattern($this->regexpReplaced, t('No replacement DIV tag found with filter P replacement.')); |
|
163 |
} |
|
164 |
|
|
165 |
} |
drupal7/sites/all/modules/media/modules/media_wysiwyg_view_mode/media_wysiwyg_view_mode.info | ||
---|---|---|
3 | 3 |
package = Media |
4 | 4 |
core = 7.x |
5 | 5 |
|
6 |
; Information added by Drupal.org packaging script on 2017-05-17
|
|
7 |
version = "7.x-2.3"
|
|
6 |
; Information added by Drupal.org packaging script on 2017-05-25
|
|
7 |
version = "7.x-2.4"
|
|
8 | 8 |
core = "7.x" |
9 | 9 |
project = "media" |
10 |
datestamp = "1495030417"
|
|
10 |
datestamp = "1495749189"
|
|
11 | 11 |
|
drupal7/sites/all/modules/media/modules/mediafield/mediafield.info | ||
---|---|---|
4 | 4 |
core = 7.x |
5 | 5 |
dependencies[] = media |
6 | 6 |
|
7 |
; Information added by Drupal.org packaging script on 2017-05-17
|
|
8 |
version = "7.x-2.3"
|
|
7 |
; Information added by Drupal.org packaging script on 2017-05-25
|
|
8 |
version = "7.x-2.4"
|
|
9 | 9 |
core = "7.x" |
10 | 10 |
project = "media" |
11 |
datestamp = "1495030417"
|
|
11 |
datestamp = "1495749189"
|
|
12 | 12 |
|
drupal7/sites/all/modules/media/tests/media_module_test.info | ||
---|---|---|
6 | 6 |
|
7 | 7 |
files[] = includes/MediaModuleTest.inc |
8 | 8 |
|
9 |
; Information added by Drupal.org packaging script on 2017-05-17
|
|
10 |
version = "7.x-2.3"
|
|
9 |
; Information added by Drupal.org packaging script on 2017-05-25
|
|
10 |
version = "7.x-2.4"
|
|
11 | 11 |
core = "7.x" |
12 | 12 |
project = "media" |
13 |
datestamp = "1495030417"
|
|
13 |
datestamp = "1495749189"
|
|
14 | 14 |
|
drupal7/sites/all/themes/bootstrap/bootstrap.info | ||
---|---|---|
208 | 208 |
multipliers[screen-lg-min][] = 1.5x |
209 | 209 |
multipliers[screen-lg-min][] = 2x |
210 | 210 |
|
211 |
; Information added by Drupal.org packaging script on 2017-04-10
|
|
212 |
version = "7.x-3.13"
|
|
211 |
; Information added by Drupal.org packaging script on 2017-05-25
|
|
212 |
version = "7.x-3.14"
|
|
213 | 213 |
core = "7.x" |
214 | 214 |
project = "bootstrap" |
215 |
datestamp = "1491858546"
|
|
215 |
datestamp = "1495748288"
|
|
216 | 216 |
|
drupal7/sites/all/themes/bootstrap/includes/alter.inc | ||
---|---|---|
199 | 199 |
return $info; |
200 | 200 |
} |
201 | 201 |
|
202 |
/** |
|
203 |
* Implements hook_field_widget_form_alter(). |
|
204 |
*/ |
|
205 |
function bootstrap_field_widget_form_alter(&$element, &$form_state, $context) { |
|
206 |
$widget_type = isset($context['instance']['widget']['type']) ? $context['instance']['widget']['type'] : NULL; |
|
207 |
if ($widget_type === 'image_image') { |
|
208 |
foreach (element_children($element) as $child) { |
|
209 |
$element[$child]['#process'][] = '_bootstrap_image_field_widget_process'; |
|
210 |
} |
|
211 |
} |
|
212 |
} |
|
213 |
|
|
214 |
/** |
|
215 |
* Implements above #process callback. |
|
216 |
*/ |
|
217 |
function _bootstrap_image_field_widget_process($element, &$form_state, $form) { |
|
218 |
// Core explicitly sets #theme_wrappers to an empty array for the upload |
|
219 |
// element (perhaps for styling reasons?). Thus, bootstrap_form_element() is |
|
220 |
// invoked, preventing any necessary logic from executing. To achieve the |
|
221 |
// same goal and keep backwards compatibility, reset the theme wrapper back |
|
222 |
// and indicating that the wrapper shouldn't be printed. |
|
223 |
$element['upload']['#theme_wrappers'][] = 'form_element__image_widget'; |
|
224 |
$element['upload']['#form_element_wrapper'] = FALSE; |
|
225 |
|
|
226 |
// Unfortunately, core also doesn't set #access on the appropriate elements |
|
227 |
// until way too late (ironically, because of #ajax). Instead of calling |
|
228 |
// file_managed_file_pre_render(), just mimic the same #access logic, but |
|
229 |
// using #default_value instead of #value since the ajax request populates |
|
230 |
// #value. |
|
231 |
$value = empty($element['#default_value']['fid']); |
|
232 |
if (!$value) { |
|
233 |
$element['upload']['#access'] = FALSE; |
|
234 |
$element['upload_button']['#access'] = FALSE; |
|
235 |
} |
|
236 |
// If we don't already have a file, there is nothing to remove. |
|
237 |
else { |
|
238 |
$element['remove_button']['#access'] = FALSE; |
|
239 |
} |
|
240 |
|
|
241 |
// Make the upload file element an input group with a button. |
|
242 |
$element['upload']['#input_group_button'] = $value; |
|
243 |
|
|
244 |
return $element; |
|
245 |
} |
|
246 |
|
|
202 | 247 |
/** |
203 | 248 |
* Implements hook_form_alter(). |
204 | 249 |
*/ |
drupal7/sites/all/themes/bootstrap/includes/process.inc | ||
---|---|---|
47 | 47 |
|
48 | 48 |
// Ignore buttons before we find the element in the form. |
49 | 49 |
$found_current_element = FALSE; |
50 |
foreach (element_children($parent) as $child) { |
|
50 |
foreach (element_children($parent, TRUE) as $child) {
|
|
51 | 51 |
if ($parent[$child] === $element) { |
52 | 52 |
$found_current_element = TRUE; |
53 | 53 |
continue; |
54 | 54 |
} |
55 | 55 |
|
56 |
if ($found_current_element && _bootstrap_is_button($parent[$child])) { |
|
57 |
_bootstrap_iconize_button($parent[$child]); |
|
56 |
if ($found_current_element && _bootstrap_is_button($parent[$child]) && (!isset($parent[$child]['#access']) || !!$parent[$child]['#access'])) { |
|
58 | 57 |
$element['#field_suffix'] = drupal_render($parent[$child]); |
59 | 58 |
break; |
60 | 59 |
} |
drupal7/sites/all/themes/bootstrap/js/bootstrap.js | ||
---|---|---|
76 | 76 |
*/ |
77 | 77 |
Drupal.behaviors.bootstrapPopovers = { |
78 | 78 |
attach: function (context, settings) { |
79 |
if (settings.bootstrap && settings.bootstrap.popoverEnabled) { |
|
80 |
var $currentPopover = $(); |
|
81 |
if (settings.bootstrap.popoverOptions.triggerAutoclose) { |
|
82 |
$(document).on('click', function (e) { |
|
83 |
if ($currentPopover.length && !$(e.target).is('[data-toggle=popover]') && $(e.target).parents('.popover.in').length === 0) { |
|
79 |
if (!settings.bootstrap || !settings.bootstrap.popoverEnabled) { |
|
80 |
return; |
|
81 |
} |
|
82 |
|
|
83 |
// Popover autoclose. |
|
84 |
if (settings.bootstrap.popoverOptions.triggerAutoclose) { |
|
85 |
var $currentPopover = null; |
|
86 |
$(document) |
|
87 |
.on('show.bs.popover', '[data-toggle=popover]', function () { |
|
88 |
var $trigger = $(this); |
|
89 |
var popover = $trigger.data('bs.popover'); |
|
90 |
|
|
91 |
// Only keep track of clicked triggers that we're manually handling. |
|
92 |
if (popover.options.originalTrigger === 'click') { |
|
93 |
if ($currentPopover && !$currentPopover.is($trigger)) { |
|
94 |
$currentPopover.popover('hide'); |
|
95 |
} |
|
96 |
$currentPopover = $trigger; |
|
97 |
} |
|
98 |
}) |
|
99 |
.on('click', function (e) { |
|
100 |
var $target = $(e.target); |
|
101 |
var popover = $target.is('[data-toggle=popover]') && $target.data('bs.popover'); |
|
102 |
if ($currentPopover && !$target.is('[data-toggle=popover]') && !$target.closest('.popover.in')[0]) { |
|
84 | 103 |
$currentPopover.popover('hide'); |
85 |
$currentPopover = $();
|
|
104 |
$currentPopover = null;
|
|
86 | 105 |
} |
87 |
}); |
|
106 |
}) |
|
107 |
; |
|
108 |
} |
|
109 |
|
|
110 |
var elements = $(context).find('[data-toggle=popover]').toArray(); |
|
111 |
for (var i = 0; i < elements.length; i++) { |
|
112 |
var $element = $(elements[i]); |
|
113 |
var options = $.extend({}, $.fn.popover.Constructor.DEFAULTS, settings.bootstrap.popoverOptions, $element.data()); |
|
114 |
|
|
115 |
// Store the original trigger. |
|
116 |
options.originalTrigger = options.trigger; |
|
117 |
|
|
118 |
// If the trigger is "click", then we'll handle it manually here. |
|
119 |
if (options.trigger === 'click') { |
|
120 |
options.trigger = 'manual'; |
|
88 | 121 |
} |
89 |
var elements = $(context).find('[data-toggle=popover]').toArray(); |
|
90 |
for (var i = 0; i < elements.length; i++) { |
|
91 |
var $element = $(elements[i]); |
|
92 |
var options = $.extend({}, settings.bootstrap.popoverOptions, $element.data()); |
|
93 |
if (!options.content) { |
|
94 |
options.content = function () { |
|
95 |
var target = $(this).data('target'); |
|
96 |
return target && $(target) && $(target).length && $(target).clone().removeClass('element-invisible').wrap('<div/>').parent()[$(this).data('bs.popover').options.html ? 'html' : 'text']() || ''; |
|
97 |
} |
|
98 |
} |
|
99 |
$element.popover(options).on('click', function (e) { |
|
100 |
e.preventDefault(); |
|
101 |
}); |
|
102 |
if (settings.bootstrap.popoverOptions.triggerAutoclose) { |
|
103 |
$element.on('show.bs.popover', function () { |
|
104 |
if ($currentPopover.length) { |
|
105 |
$currentPopover.popover('hide'); |
|
106 |
} |
|
107 |
$currentPopover = $(this); |
|
108 |
}); |
|
109 |
} |
|
122 |
|
|
123 |
// Retrieve content from a target element. |
|
124 |
var $target = $(options.target || $element.is('a[href^="#"]') && $element.attr('href')).clone(); |
|
125 |
if (!options.content && $target[0]) { |
|
126 |
$target.removeClass('element-invisible hidden').removeAttr('aria-hidden'); |
|
127 |
options.content = $target.wrap('<div/>').parent()[options.html ? 'html' : 'text']() || ''; |
|
128 |
} |
|
129 |
|
|
130 |
// Initialize the popover. |
|
131 |
$element.popover(options); |
|
132 |
|
|
133 |
// Handle clicks manually. |
|
134 |
if (options.originalTrigger === 'click') { |
|
135 |
// To ensure the element is bound multiple times, remove any |
|
136 |
// previously set event handler before adding another one. |
|
137 |
$element |
|
138 |
.off('click.drupal.bootstrap.popover') |
|
139 |
.on('click.drupal.bootstrap.popover', function (e) { |
|
140 |
$(this).popover('toggle'); |
|
141 |
e.preventDefault(); |
|
142 |
e.stopPropagation(); |
|
143 |
}) |
|
144 |
; |
|
110 | 145 |
} |
111 | 146 |
} |
147 |
}, |
|
148 |
detach: function (context) { |
|
149 |
// Destroy all popovers. |
|
150 |
$(context).find('[data-toggle="popover"]') |
|
151 |
.off('click.drupal.bootstrap.popover') |
|
152 |
.popover('destroy') |
|
153 |
; |
|
112 | 154 |
} |
113 | 155 |
}; |
114 | 156 |
|
drupal7/sites/all/themes/bootstrap/templates/image/image-widget.func.php | ||
---|---|---|
30 | 30 |
} |
31 | 31 |
|
32 | 32 |
$output .= '<div class="image-widget-data">'; |
33 |
if ($element['fid']['#value'] != 0) {
|
|
33 |
if (!empty($element['fid']['#value'])) {
|
|
34 | 34 |
$element['filename']['#markup'] = '<div class="form-group">' . $element['filename']['#markup'] . ' <span class="file-size badge">' . format_size($element['#file']->filesize) . '</span></div>'; |
35 | 35 |
} |
36 |
else { |
|
37 |
$element['upload']['#prefix'] = '<div class="input-group">'; |
|
38 |
$element['upload']['#suffix'] = '</div>'; |
|
39 |
$element['upload_button']['#prefix'] = '<span class="input-group-btn">'; |
|
40 |
$element['upload_button']['#suffix'] = '</span>'; |
|
41 |
} |
|
42 | 36 |
|
43 | 37 |
$output .= drupal_render_children($element); |
44 | 38 |
$output .= '</div>'; |
drupal7/sites/all/themes/bootstrap/templates/system/container.func.php | ||
---|---|---|
40 | 40 |
$element['#attributes']['class'][] = 'form-wrapper'; |
41 | 41 |
|
42 | 42 |
// Add Bootstrap "form-group" class. |
43 |
$element['#attributes']['class'][] = 'form-group'; |
|
43 |
if (!isset($element['#form_group']) || !!$element['#form_group']) { |
|
44 |
$element['#attributes']['class'][] = 'form-group'; |
|
45 |
} |
|
44 | 46 |
} |
45 | 47 |
|
46 | 48 |
return '<div' . drupal_attributes($element['#attributes']) . '>' . $element['#children'] . '</div>'; |
drupal7/sites/all/themes/bootstrap/templates/system/form-element.func.php | ||
---|---|---|
59 | 59 |
$element = &$variables['element']; |
60 | 60 |
$name = !empty($element['#name']) ? $element['#name'] : FALSE; |
61 | 61 |
$type = !empty($element['#type']) ? $element['#type'] : FALSE; |
62 |
$wrapper = isset($element['#form_element_wrapper']) ? !!$element['#form_element_wrapper'] : TRUE; |
|
63 |
$form_group = isset($element['#form_group']) ? !!$element['#form_group'] : $wrapper && $type && $type !== 'hidden'; |
|
62 | 64 |
$checkbox = $type && $type === 'checkbox'; |
63 | 65 |
$radio = $type && $type === 'radio'; |
64 | 66 |
|
... | ... | |
104 | 106 |
if ($checkbox || $radio) { |
105 | 107 |
$wrapper_attributes['class'][] = drupal_html_class($type); |
106 | 108 |
} |
107 |
elseif ($type && $type !== 'hidden') {
|
|
109 |
elseif ($form_group) {
|
|
108 | 110 |
$wrapper_attributes['class'][] = 'form-group'; |
109 | 111 |
} |
110 | 112 |
|
111 | 113 |
// Create a render array for the form element. |
112 | 114 |
$build = array( |
113 |
'#theme_wrappers' => array('container__form_element'),
|
|
115 |
'#form_group' => $form_group,
|
|
114 | 116 |
'#attributes' => $wrapper_attributes, |
115 | 117 |
); |
116 | 118 |
|
117 |
// Render the label for the form element. |
|
118 |
$build['label'] = array( |
|
119 |
'#markup' => theme('form_element_label', $variables), |
|
120 |
'#weight' => $element['#title_display'] === 'before' ? 0 : 2, |
|
121 |
); |
|
119 |
if ($wrapper) { |
|
120 |
$build['#theme_wrappers'] = array('container__form_element'); |
|
121 |
|
|
122 |
// Render the label for the form element. |
|
123 |
$build['label'] = array( |
|
124 |
'#markup' => theme('form_element_label', $variables), |
|
125 |
'#weight' => $element['#title_display'] === 'before' ? 0 : 2, |
|
126 |
); |
|
127 |
} |
|
122 | 128 |
|
123 | 129 |
// Checkboxes and radios render the input element inside the label. If the |
124 | 130 |
// element is neither of those, then the input element must be rendered here. |
Formats disponibles : Unified diff
Weekly update of contrib modules