Projet

Général

Profil

Révision a8cee257

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

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/captcha/captcha.admin.inc
44 44
  // Use JavaScript for some added usability on admin form.
45 45
  drupal_add_js(drupal_get_path('module', 'captcha') . '/captcha.js');
46 46

  
47
  // Load languages for configurable texts.
48
  if (module_exists('locale')) {
49
    $langs = locale_language_list();
50
  }
51

  
47 52
  // Configuration of which forms to protect, with what challenge.
48 53
  $form['captcha_form_protection'] = array(
49 54
    '#type' => 'fieldset',
......
150 155
    '#submit' => array('captcha_clear_captcha_placement_cache_submit'),
151 156
  );
152 157

  
158
  // Textfield(s) for editing the error message.
159
  if (module_exists('locale')) {
160
    $form['captcha_error_messages'] = array(
161
      '#type' => 'fieldset',
162
      '#title' => t('Error message'),
163
      '#description' => t('Message displayed when the CAPTCHA has not been solved. An empty entry will reset the error message to default.'),
164
    );
165
    foreach ($langs as $lang_code => $lang_name) {
166
      $form['captcha_error_messages']['captcha_error_message_' . $lang_code] = array(
167
        '#type' => 'textfield',
168
        '#title' => t('For language %lang_name (code %lang_code)', array('%lang_name' => $lang_name, '%lang_code' => $lang_code)),
169
        '#default_value' => _captcha_get_error_message($lang_code),
170
        '#maxlength' => 256,
171
      );
172
    }
173
  }
174
  else {
175
    $form['captcha_error_message'] = array(
176
      '#type' => 'textfield',
177
      '#title' => t('Error message'),
178
      '#description' => t('Message displayed when the CAPTCHA has not been solved. An empty entry will reset the error message to default.'),
179
      '#default_value' => _captcha_get_error_message(),
180
      '#maxlength' => 256,
181
    );
182
  }
183

  
153 184
  // Configuration option for adding a CAPTCHA description.
154 185
  $form['captcha_add_captcha_description'] = array(
155 186
    '#type' => 'checkbox',
......
159 190
  );
160 191
  // Textfield(s) for the CAPTCHA description.
161 192
  if (module_exists('locale')) {
162
    $langs = locale_language_list();
163 193
    $form['captcha_descriptions'] = array(
164 194
      '#type' => 'fieldset',
165 195
      '#title' => t('CAPTCHA description'),
......
286 316
  variable_set('captcha_default_challenge', $form_state['values']['captcha_default_challenge']);
287 317
  variable_set('captcha_default_challenge_on_nonlisted_forms', $form_state['values']['captcha_default_challenge_on_nonlisted_forms']);
288 318

  
319
  // Load languages for configurable texts.
320
  if (module_exists('locale')) {
321
    $langs = locale_language_list();
322
  }
323

  
289 324
  // Process CAPTCHA points.
290 325
  if (isset($form_state['values']['captcha_form_id_overview']['captcha_captcha_points'])) {
291 326
    // Load existing data.
......
320 355
    drupal_set_message(t('Added CAPTCHA point.'), 'status');
321 356
  }
322 357

  
358
  // Error message.
359
  if (module_exists('locale')) {
360
    foreach ($langs as $lang_code => $lang_name) {
361
      $description = $form_state['values']['captcha_error_message_' . $lang_code];
362
      if ($description) {
363
        variable_set('captcha_error_message_' . $lang_code, $description);
364
      }
365
      else {
366
        variable_del('captcha_error_message_' . $lang_code);
367
        drupal_set_message(t('Reset of error message for language %language.', array('%language' => $lang_name)), 'status');
368
      }
369
    }
370
  }
371
  else {
372
    $description = $form_state['values']['captcha_error_message'];
373
    if ($description) {
374
      variable_set('captcha_error_message', $description);
375
    }
376
    else {
377
      variable_del('captcha_error_message');
378
      drupal_set_message(t('Reset of error message.'), 'status');
379
    }
380
  }
381

  
323 382
  // CAPTCHA description stuff.
324 383
  variable_set('captcha_add_captcha_description', $form_state['values']['captcha_add_captcha_description']);
325 384
  // Save (or reset) the CAPTCHA descriptions.
326 385
  if (module_exists('locale')) {
327
    $langs = locale_language_list();
328 386
    foreach ($langs as $lang_code => $lang_name) {
329 387
      $description = $form_state['values']["captcha_description_$lang_code"];
330 388
      if ($description) {
drupal7/sites/all/modules/captcha/captcha.inc
266 266
  return filter_xss_admin($description);
267 267
}
268 268

  
269
/**
270
 * Get the error message as configured on the general CAPTCHA settings page.
271
 *
272
 * If the locale module is enabled, the error message will be returned
273
 * for the current language the page is rendered for. This language
274
 * can optionally been overridden with the $lang_code argument.
275
 *
276
 * @param string|null $lang_code
277
 *   an optional language code to get the description for.
278
 *
279
 * @return string
280
 *   String with (localized) error message.
281
 */
282
function _captcha_get_error_message($lang_code = NULL) {
283
  // If no language code is given: use the language of the current page.
284
  global $language;
285
  $lang_code = isset($lang_code) ? $lang_code : $language->language;
286
  // The hardcoded but localizable default.
287
  $default = t('The answer you entered for the CAPTCHA was not correct.', array(), array('langcode' => $lang_code));
288
  // Look up the configured error message or fall back on the (localized) default.
289
  if (module_exists('locale')) {
290
    $message = variable_get('captcha_error_message_' . $lang_code, $default);
291
  }
292
  else {
293
    $message = variable_get('captcha_error_message', $default);
294
  }
295
  return filter_xss_admin($message);
296
}
297

  
269 298
/**
270 299
 * Parse or interpret the given captcha_type.
271 300
 *
......
340 369
      if (count($buttons)) {
341 370
        // Pick first button.
342 371
        // TODO: make this more sofisticated? Use cases needed.
343
        $placement = $buttons[0];
372
        $placement = (isset($buttons[count($buttons) - 1])) ? $buttons[count($buttons) - 1] : $buttons[0];
344 373
      }
345 374
      else {
346 375
        // Use NULL when no buttons were found.
drupal7/sites/all/modules/captcha/captcha.info
10 10
files[] = captcha.install
11 11
files[] = captcha.test
12 12

  
13
; Information added by Drupal.org packaging script on 2017-09-06
14
version = "7.x-1.5"
13
; Information added by Drupal.org packaging script on 2019-10-05
14
version = "7.x-1.6"
15 15
core = "7.x"
16 16
project = "captcha"
17
datestamp = "1504724060"
18

  
17
datestamp = "1570300087"
drupal7/sites/all/modules/captcha/captcha.module
184 184
  // Add JavaScript for general CAPTCHA functionality.
185 185
  drupal_add_js(drupal_get_path('module', 'captcha') . '/captcha.js');
186 186

  
187
  // Prevent caching of the page with CAPTCHA elements.
188
  // This needs to be done even if the CAPTCHA will be ommitted later:
189
  // other untrusted users should not get a cached page when
190
  // the current untrusted user can skip the current CAPTCHA.
191
  drupal_page_is_cacheable(FALSE);
192

  
193 187
  // Get the form ID of the form we are currently processing (which is not
194 188
  // necessary the same form that is submitted (if any).
195 189
  $this_form_id = $complete_form['form_id']['#value'];
......
296 290
    // Store the solution in the #captcha_info array.
297 291
    $element['#captcha_info']['solution'] = $captcha['solution'];
298 292

  
293
    // Store if this captcha type is cacheable:
294
    // A cacheable captcha must not depend on the sid or solution, but be
295
    // independent - like for example recaptcha.
296
    $element['#captcha_info']['cacheable'] = !empty($captcha['cacheable']);
297

  
298
    if (!empty($element['#captcha_info']['cacheable']) && drupal_page_is_cacheable()) {
299
      // This is only used to avoid the re-use message.
300
      $element['captcha_cacheable'] = array(
301
        '#type' => 'hidden',
302
        '#value' => TRUE,
303
      );
304
    }
305

  
299 306
    // Make sure we can use a top level form value $form_state['values']['captcha_response'], even if the form has #tree=true.
300 307
    $element['#tree'] = FALSE;
301 308

  
......
360 367
 */
361 368
function theme_captcha($variables) {
362 369
  $element = $variables['element'];
370

  
371
  if (empty($element['#description']) && !empty($element['#attributes']['title'])) {
372
    // Fix for Bootstrap-based themes.
373
    $element['#description'] = $element['#attributes']['title'];
374
  }
375

  
363 376
  if (!empty($element['#description']) && isset($element['captcha_widgets'])) {
364 377
    $fieldset = array(
365 378
      '#type' => 'fieldset',
......
383 396
 */
384 397
function captcha_form_alter(&$form, &$form_state, $form_id) {
385 398

  
399
  // If user has skip CAPTCHA permission, doesn't do anything.
386 400
  if (!user_access('skip CAPTCHA')) {
387 401
    // Visitor does not have permission to skip CAPTCHAs.
388 402
    module_load_include('inc', 'captcha');
......
406 420
      _captcha_insert_captcha_element($form, $captcha_placement, $captcha_element);
407 421
    }
408 422
  }
409
  elseif (
423

  
424
  // If user has access to administer CAPTCHA settings and
425
  // 'Add CAPTCHA administration links to forms' is enabled, display the
426
  // helper widget.
427
  if (
410 428
    variable_get('captcha_administration_mode', FALSE)
411 429
    && user_access('administer CAPTCHA settings')
412 430
    && (arg(0) != 'admin' || variable_get('captcha_allow_on_admin_pages', FALSE))
......
423 441
      '#collapsed' => TRUE,
424 442
      '#attributes' => array('class' => array('captcha-admin-links')),
425 443
    );
444

  
426 445
    if ($captcha_point !== NULL && $captcha_point->captcha_type) {
427 446
      $captcha_element['#title'] = t('CAPTCHA: challenge "@type" enabled', array('@type' => $captcha_point->captcha_type));
428 447
      $captcha_element['#description'] = t('Untrusted users will see a CAPTCHA here (<a href="@settings">general CAPTCHA settings</a>).',
......
438 457
          '@disable' => url("admin/config/people/captcha/captcha/captcha_point/$form_id/disable", array('query' => drupal_get_destination())),
439 458
        )),
440 459
      );
460

  
441 461
      // Add an example challenge with solution.
442 462
      // This does not work with the reCAPTCHA and Egglue challenges as
443 463
      // discussed in http://drupal.org/node/487032 and
......
464 484
      $captcha_element['add_captcha'] = array(
465 485
        '#markup' => l(t('Place a CAPTCHA here for untrusted users.'), "admin/config/people/captcha/captcha/captcha_point/$form_id", array('query' => drupal_get_destination()))
466 486
      );
467

  
468 487
    }
488

  
469 489
    // Get placement in form and insert in form.
470 490
    $captcha_placement = _captcha_get_captcha_placement($form_id, $form);
471 491
    _captcha_insert_captcha_element($form, $captcha_placement, $captcha_element);
472

  
473 492
  }
474 493

  
475 494
  // Add a warning about caching on the Perfomance settings page.
......
637 656
        )->fetchField();
638 657

  
639 658
        if ($expected_captcha_token !== $posted_captcha_token) {
640
          drupal_set_message(t('CAPTCHA session reuse attack detected.'), 'error');
659
          if (empty($form_state['input']['captcha_cacheable'])) {
660
            drupal_set_message(t('CAPTCHA session reuse attack detected.'), 'error');
661
          }
641 662
          // Invalidate the CAPTCHA session.
642 663
          $posted_captcha_sid = NULL;
643 664
        }
......
731 752
        ->expression('attempts', 'attempts + 1')
732 753
        ->execute();
733 754
      // Set form error.
734
      form_set_error('captcha_response', t('The answer you entered for the CAPTCHA was not correct.'));
755
      form_set_error('captcha_response', _captcha_get_error_message());
735 756
      // Update wrong response counter.
736 757
      if (variable_get('captcha_enable_stats', FALSE)) {
737 758
        variable_set('captcha_wrong_response_counter', variable_get('captcha_wrong_response_counter', 0) + 1);
......
777 798
  // when the challenge is solved correctely on preview, the form is still
778 799
  // not completely submitted, but the CAPTCHA can be skipped.
779 800
  if (_captcha_required_for_user($captcha_sid, $form_id) || $element['#captcha_admin_mode'] || $element['#captcha_always']) {
801
    // Prevent caching of the page with CAPTCHA elements.
802
    // This needs to be done only if the captcha is actually displayed.
803
    // The captcha display will be skipped only in 2 cases:
804
    //   - The captcha sid has a solution already.
805
    //   - The user has a SESSION.
806
    // For a page to be cacheable, the user MUST not have a SESSION.
807
    // For a SID to be solved already, it must be a POST request as else
808
    // a new unsolved SID is generated.
809
    // Therefore it is fine to disable the cache at this late stage here.
810
    if (empty($captcha_info['cacheable'])) {
811
      // The cache is only disabled if the captcha itself is not cacheable.
812
      drupal_page_is_cacheable(FALSE);
813
    }
814

  
780 815
    // Update captcha_sessions table: store the solution of the generated CAPTCHA.
781 816
    _captcha_update_captcha_session($captcha_sid, $captcha_info['solution']);
782 817

  
drupal7/sites/all/modules/captcha/captcha.test
417 417
  function testAdminAccess() {
418 418
    $this->drupalLogin($this->normal_user);
419 419
    $this->drupalGet(self::CAPTCHA_ADMIN_PATH);
420
    file_put_contents('tmp.simpletest.html', $this->drupalGetContent());
421 420
    $this->assertText(t('Access denied'), 'Normal users should not be able to access the CAPTCHA admin pages', 'CAPTCHA');
422 421

  
423 422
    $this->drupalLogin($this->admin_user);
drupal7/sites/all/modules/captcha/image_captcha/image_captcha.info
11 11
files[] = image_captcha.user.inc
12 12
files[] = image_captcha.test
13 13

  
14
; Information added by Drupal.org packaging script on 2017-09-06
15
version = "7.x-1.5"
14
; Information added by Drupal.org packaging script on 2019-10-05
15
version = "7.x-1.6"
16 16
core = "7.x"
17 17
project = "captcha"
18
datestamp = "1504724060"
19

  
18
datestamp = "1570300087"
drupal7/sites/all/modules/captcha/image_captcha/image_captcha.user.inc
31 31
  if ($code !== FALSE) {
32 32
    // Seed the random generators used for image CAPTCHA distortion based on session and code
33 33
    // to counter attacks that re-request the same challenge and pick the simplest image one or combine info.
34
    $seed = hexdec(substr(md5($captcha_sid . $code), 0, 8));
34
    $seed = (int) hexdec(substr(md5($captcha_sid . $code), 0, 8));
35 35
    srand($seed);
36 36
    mt_srand($seed);
37 37
    // Generate the image.
drupal7/sites/all/modules/dhtml_menu/LICENSE.txt
1
GNU GENERAL PUBLIC LICENSE
2

  
3
              Version 2, June 1991
4

  
5
Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave,
6
Cambridge, MA 02139, USA. Everyone is permitted to copy and distribute
7
verbatim copies of this license document, but changing it is not allowed.
8

  
9
                  Preamble
10

  
11
The licenses for most software are designed to take away your freedom to
12
share and change it. By contrast, the GNU General Public License is
13
intended to guarantee your freedom to share and change free software--to
14
make sure the software is free for all its users. This General Public License
15
applies to most of the Free Software Foundation's software and to any other
16
program whose authors commit to using it. (Some other Free Software
17
Foundation software is covered by the GNU Library General Public License
18
instead.) You can apply it to your programs, too.
19

  
20
When we speak of free software, we are referring to freedom, not price. Our
21
General Public Licenses are designed to make sure that you have the
22
freedom to distribute copies of free software (and charge for this service if
23
you wish), that you receive source code or can get it if you want it, that you
24
can change the software or use pieces of it in new free programs; and that
25
you know you can do these things.
26

  
27
To protect your rights, we need to make restrictions that forbid anyone to
28
deny you these rights or to ask you to surrender the rights. These restrictions
29
translate to certain responsibilities for you if you distribute copies of the
30
software, or if you modify it.
31

  
32
For example, if you distribute copies of such a program, whether gratis or for
33
a fee, you must give the recipients all the rights that you have. You must make
34
sure that they, too, receive or can get the source code. And you must show
35
them these terms so they know their rights.
36

  
37
We protect your rights with two steps: (1) copyright the software, and (2)
38
offer you this license which gives you legal permission to copy, distribute
39
and/or modify the software.
40

  
41
Also, for each author's protection and ours, we want to make certain that
42
everyone understands that there is no warranty for this free software. If the
43
software is modified by someone else and passed on, we want its recipients
44
to know that what they have is not the original, so that any problems
45
introduced by others will not reflect on the original authors' reputations.
46

  
47
Finally, any free program is threatened constantly by software patents. We
48
wish to avoid the danger that redistributors of a free program will individually
49
obtain patent licenses, in effect making the program proprietary. To prevent
50
this, we have made it clear that any patent must be licensed for everyone's
51
free use or not licensed at all.
52

  
53
The precise terms and conditions for copying, distribution and modification
54
follow.
55

  
56
           GNU GENERAL PUBLIC LICENSE
57
 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND
58
               MODIFICATION
59

  
60
0. This License applies to any program or other work which contains a notice
61
placed by the copyright holder saying it may be distributed under the terms
62
of this General Public License. The "Program", below, refers to any such
63
program or work, and a "work based on the Program" means either the
64
Program or any derivative work under copyright law: that is to say, a work
65
containing the Program or a portion of it, either verbatim or with
66
modifications and/or translated into another language. (Hereinafter, translation
67
is included without limitation in the term "modification".) Each licensee is
68
addressed as "you".
69

  
70
Activities other than copying, distribution and modification are not covered
71
by this License; they are outside its scope. The act of running the Program is
72
not restricted, and the output from the Program is covered only if its contents
73
constitute a work based on the Program (independent of having been made
74
by running the Program). Whether that is true depends on what the Program
75
does.
76

  
77
1. You may copy and distribute verbatim copies of the Program's source
78
code as you receive it, in any medium, provided that you conspicuously and
79
appropriately publish on each copy an appropriate copyright notice and
80
disclaimer of warranty; keep intact all the notices that refer to this License
81
and to the absence of any warranty; and give any other recipients of the
82
Program a copy of this License along with the Program.
83

  
84
You may charge a fee for the physical act of transferring a copy, and you
85
may at your option offer warranty protection in exchange for a fee.
86

  
87
2. You may modify your copy or copies of the Program or any portion of it,
88
thus forming a work based on the Program, and copy and distribute such
89
modifications or work under the terms of Section 1 above, provided that you
90
also meet all of these conditions:
91

  
92
a) You must cause the modified files to carry prominent notices stating that
93
you changed the files and the date of any change.
94

  
95
b) You must cause any work that you distribute or publish, that in whole or in
96
part contains or is derived from the Program or any part thereof, to be
97
licensed as a whole at no charge to all third parties under the terms of this
98
License.
99

  
100
c) If the modified program normally reads commands interactively when run,
101
you must cause it, when started running for such interactive use in the most
102
ordinary way, to print or display an announcement including an appropriate
103
copyright notice and a notice that there is no warranty (or else, saying that
104
you provide a warranty) and that users may redistribute the program under
105
these conditions, and telling the user how to view a copy of this License.
106
(Exception: if the Program itself is interactive but does not normally print such
107
an announcement, your work based on the Program is not required to print
108
an announcement.)
109

  
110
These requirements apply to the modified work as a whole. If identifiable
111
sections of that work are not derived from the Program, and can be
112
reasonably considered independent and separate works in themselves, then
113
this License, and its terms, do not apply to those sections when you distribute
114
them as separate works. But when you distribute the same sections as part
115
of a whole which is a work based on the Program, the distribution of the
116
whole must be on the terms of this License, whose permissions for other
117
licensees extend to the entire whole, and thus to each and every part
118
regardless of who wrote it.
119

  
120
Thus, it is not the intent of this section to claim rights or contest your rights to
121
work written entirely by you; rather, the intent is to exercise the right to
122
control the distribution of derivative or collective works based on the
123
Program.
1
                    GNU GENERAL PUBLIC LICENSE
2
                       Version 2, June 1991
3

  
4
 Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
 Everyone is permitted to copy and distribute verbatim copies
7
 of this license document, but changing it is not allowed.
8

  
9
                            Preamble
10

  
11
  The licenses for most software are designed to take away your
12
freedom to share and change it.  By contrast, the GNU General Public
13
License is intended to guarantee your freedom to share and change free
14
software--to make sure the software is free for all its users.  This
15
General Public License applies to most of the Free Software
16
Foundation's software and to any other program whose authors commit to
17
using it.  (Some other Free Software Foundation software is covered by
18
the GNU Lesser General Public License instead.)  You can apply it to
19
your programs, too.
20

  
21
  When we speak of free software, we are referring to freedom, not
22
price.  Our General Public Licenses are designed to make sure that you
23
have the freedom to distribute copies of free software (and charge for
24
this service if you wish), that you receive source code or can get it
25
if you want it, that you can change the software or use pieces of it
26
in new free programs; and that you know you can do these things.
27

  
28
  To protect your rights, we need to make restrictions that forbid
29
anyone to deny you these rights or to ask you to surrender the rights.
30
These restrictions translate to certain responsibilities for you if you
31
distribute copies of the software, or if you modify it.
32

  
33
  For example, if you distribute copies of such a program, whether
34
gratis or for a fee, you must give the recipients all the rights that
35
you have.  You must make sure that they, too, receive or can get the
36
source code.  And you must show them these terms so they know their
37
rights.
38

  
39
  We protect your rights with two steps: (1) copyright the software, and
40
(2) offer you this license which gives you legal permission to copy,
41
distribute and/or modify the software.
42

  
43
  Also, for each author's protection and ours, we want to make certain
44
that everyone understands that there is no warranty for this free
45
software.  If the software is modified by someone else and passed on, we
46
want its recipients to know that what they have is not the original, so
47
that any problems introduced by others will not reflect on the original
48
authors' reputations.
49

  
50
  Finally, any free program is threatened constantly by software
51
patents.  We wish to avoid the danger that redistributors of a free
52
program will individually obtain patent licenses, in effect making the
53
program proprietary.  To prevent this, we have made it clear that any
54
patent must be licensed for everyone's free use or not licensed at all.
55

  
56
  The precise terms and conditions for copying, distribution and
57
modification follow.
58

  
59
                    GNU GENERAL PUBLIC LICENSE
60
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61

  
62
  0. This License applies to any program or other work which contains
63
a notice placed by the copyright holder saying it may be distributed
64
under the terms of this General Public License.  The "Program", below,
65
refers to any such program or work, and a "work based on the Program"
66
means either the Program or any derivative work under copyright law:
67
that is to say, a work containing the Program or a portion of it,
68
either verbatim or with modifications and/or translated into another
69
language.  (Hereinafter, translation is included without limitation in
70
the term "modification".)  Each licensee is addressed as "you".
71

  
72
Activities other than copying, distribution and modification are not
73
covered by this License; they are outside its scope.  The act of
74
running the Program is not restricted, and the output from the Program
75
is covered only if its contents constitute a work based on the
76
Program (independent of having been made by running the Program).
77
Whether that is true depends on what the Program does.
78

  
79
  1. You may copy and distribute verbatim copies of the Program's
80
source code as you receive it, in any medium, provided that you
81
conspicuously and appropriately publish on each copy an appropriate
82
copyright notice and disclaimer of warranty; keep intact all the
83
notices that refer to this License and to the absence of any warranty;
84
and give any other recipients of the Program a copy of this License
85
along with the Program.
86

  
87
You may charge a fee for the physical act of transferring a copy, and
88
you may at your option offer warranty protection in exchange for a fee.
89

  
90
  2. You may modify your copy or copies of the Program or any portion
91
of it, thus forming a work based on the Program, and copy and
92
distribute such modifications or work under the terms of Section 1
93
above, provided that you also meet all of these conditions:
94

  
95
    a) You must cause the modified files to carry prominent notices
96
    stating that you changed the files and the date of any change.
97

  
98
    b) You must cause any work that you distribute or publish, that in
99
    whole or in part contains or is derived from the Program or any
100
    part thereof, to be licensed as a whole at no charge to all third
101
    parties under the terms of this License.
102

  
103
    c) If the modified program normally reads commands interactively
104
    when run, you must cause it, when started running for such
105
    interactive use in the most ordinary way, to print or display an
106
    announcement including an appropriate copyright notice and a
107
    notice that there is no warranty (or else, saying that you provide
108
    a warranty) and that users may redistribute the program under
109
    these conditions, and telling the user how to view a copy of this
110
    License.  (Exception: if the Program itself is interactive but
111
    does not normally print such an announcement, your work based on
112
    the Program is not required to print an announcement.)
113

  
114
These requirements apply to the modified work as a whole.  If
115
identifiable sections of that work are not derived from the Program,
116
and can be reasonably considered independent and separate works in
117
themselves, then this License, and its terms, do not apply to those
118
sections when you distribute them as separate works.  But when you
119
distribute the same sections as part of a whole which is a work based
120
on the Program, the distribution of the whole must be on the terms of
121
this License, whose permissions for other licensees extend to the
122
entire whole, and thus to each and every part regardless of who wrote it.
123

  
124
Thus, it is not the intent of this section to claim rights or contest
125
your rights to work written entirely by you; rather, the intent is to
126
exercise the right to control the distribution of derivative or
127
collective works based on the Program.
124 128

  
125 129
In addition, mere aggregation of another work not based on the Program
126
with the Program (or with a work based on the Program) on a volume of a
127
storage or distribution medium does not bring the other work under the scope
128
of this License.
129

  
130
3. You may copy and distribute the Program (or a work based on it, under
131
Section 2) in object code or executable form under the terms of Sections 1
132
and 2 above provided that you also do one of the following:
133

  
134
a) Accompany it with the complete corresponding machine-readable source
135
code, which must be distributed under the terms of Sections 1 and 2 above
136
on a medium customarily used for software interchange; or,
137

  
138
b) Accompany it with a written offer, valid for at least three years, to give
139
any third party, for a charge no more than your cost of physically performing
140
source distribution, a complete machine-readable copy of the corresponding
141
source code, to be distributed under the terms of Sections 1 and 2 above on
142
a medium customarily used for software interchange; or,
143

  
144
c) Accompany it with the information you received as to the offer to distribute
145
corresponding source code. (This alternative is allowed only for
146
noncommercial distribution and only if you received the program in object
147
code or executable form with such an offer, in accord with Subsection b
148
above.)
130
with the Program (or with a work based on the Program) on a volume of
131
a storage or distribution medium does not bring the other work under
132
the scope of this License.
133

  
134
  3. You may copy and distribute the Program (or a work based on it,
135
under Section 2) in object code or executable form under the terms of
136
Sections 1 and 2 above provided that you also do one of the following:
137

  
138
    a) Accompany it with the complete corresponding machine-readable
139
    source code, which must be distributed under the terms of Sections
140
    1 and 2 above on a medium customarily used for software interchange; or,
141

  
142
    b) Accompany it with a written offer, valid for at least three
143
    years, to give any third party, for a charge no more than your
144
    cost of physically performing source distribution, a complete
145
    machine-readable copy of the corresponding source code, to be
146
    distributed under the terms of Sections 1 and 2 above on a medium
147
    customarily used for software interchange; or,
148

  
149
    c) Accompany it with the information you received as to the offer
150
    to distribute corresponding source code.  (This alternative is
151
    allowed only for noncommercial distribution and only if you
152
    received the program in object code or executable form with such
153
    an offer, in accord with Subsection b above.)
149 154

  
150 155
The source code for a work means the preferred form of the work for
151
making modifications to it. For an executable work, complete source code
152
means all the source code for all modules it contains, plus any associated
153
interface definition files, plus the scripts used to control compilation and
154
installation of the executable. However, as a special exception, the source
155
code distributed need not include anything that is normally distributed (in
156
either source or binary form) with the major components (compiler, kernel,
157
and so on) of the operating system on which the executable runs, unless that
158
component itself accompanies the executable.
159

  
160
If distribution of executable or object code is made by offering access to
161
copy from a designated place, then offering equivalent access to copy the
162
source code from the same place counts as distribution of the source code,
163
even though third parties are not compelled to copy the source along with the
164
object code.
165

  
166
4. You may not copy, modify, sublicense, or distribute the Program except as
167
expressly provided under this License. Any attempt otherwise to copy,
168
modify, sublicense or distribute the Program is void, and will automatically
169
terminate your rights under this License. However, parties who have received
170
copies, or rights, from you under this License will not have their licenses
171
terminated so long as such parties remain in full compliance.
172

  
173
5. You are not required to accept this License, since you have not signed it.
174
However, nothing else grants you permission to modify or distribute the
175
Program or its derivative works. These actions are prohibited by law if you
176
do not accept this License. Therefore, by modifying or distributing the
177
Program (or any work based on the Program), you indicate your acceptance
178
of this License to do so, and all its terms and conditions for copying,
179
distributing or modifying the Program or works based on it.
180

  
181
6. Each time you redistribute the Program (or any work based on the
182
Program), the recipient automatically receives a license from the original
183
licensor to copy, distribute or modify the Program subject to these terms and
184
conditions. You may not impose any further restrictions on the recipients'
185
exercise of the rights granted herein. You are not responsible for enforcing
186
compliance by third parties to this License.
187

  
188
7. If, as a consequence of a court judgment or allegation of patent
189
infringement or for any other reason (not limited to patent issues), conditions
190
are imposed on you (whether by court order, agreement or otherwise) that
191
contradict the conditions of this License, they do not excuse you from the
192
conditions of this License. If you cannot distribute so as to satisfy
193
simultaneously your obligations under this License and any other pertinent
194
obligations, then as a consequence you may not distribute the Program at all.
195
For example, if a patent license would not permit royalty-free redistribution
196
of the Program by all those who receive copies directly or indirectly through
197
you, then the only way you could satisfy both it and this License would be to
156
making modifications to it.  For an executable work, complete source
157
code means all the source code for all modules it contains, plus any
158
associated interface definition files, plus the scripts used to
159
control compilation and installation of the executable.  However, as a
160
special exception, the source code distributed need not include
161
anything that is normally distributed (in either source or binary
162
form) with the major components (compiler, kernel, and so on) of the
163
operating system on which the executable runs, unless that component
164
itself accompanies the executable.
165

  
166
If distribution of executable or object code is made by offering
167
access to copy from a designated place, then offering equivalent
168
access to copy the source code from the same place counts as
169
distribution of the source code, even though third parties are not
170
compelled to copy the source along with the object code.
171

  
172
  4. You may not copy, modify, sublicense, or distribute the Program
173
except as expressly provided under this License.  Any attempt
174
otherwise to copy, modify, sublicense or distribute the Program is
175
void, and will automatically terminate your rights under this License.
176
However, parties who have received copies, or rights, from you under
177
this License will not have their licenses terminated so long as such
178
parties remain in full compliance.
179

  
180
  5. You are not required to accept this License, since you have not
181
signed it.  However, nothing else grants you permission to modify or
182
distribute the Program or its derivative works.  These actions are
183
prohibited by law if you do not accept this License.  Therefore, by
184
modifying or distributing the Program (or any work based on the
185
Program), you indicate your acceptance of this License to do so, and
186
all its terms and conditions for copying, distributing or modifying
187
the Program or works based on it.
188

  
189
  6. Each time you redistribute the Program (or any work based on the
190
Program), the recipient automatically receives a license from the
191
original licensor to copy, distribute or modify the Program subject to
192
these terms and conditions.  You may not impose any further
193
restrictions on the recipients' exercise of the rights granted herein.
194
You are not responsible for enforcing compliance by third parties to
195
this License.
196

  
197
  7. If, as a consequence of a court judgment or allegation of patent
198
infringement or for any other reason (not limited to patent issues),
199
conditions are imposed on you (whether by court order, agreement or
200
otherwise) that contradict the conditions of this License, they do not
201
excuse you from the conditions of this License.  If you cannot
202
distribute so as to satisfy simultaneously your obligations under this
203
License and any other pertinent obligations, then as a consequence you
204
may not distribute the Program at all.  For example, if a patent
205
license would not permit royalty-free redistribution of the Program by
206
all those who receive copies directly or indirectly through you, then
207
the only way you could satisfy both it and this License would be to
198 208
refrain entirely from distribution of the Program.
199 209

  
200
If any portion of this section is held invalid or unenforceable under any
201
particular circumstance, the balance of the section is intended to apply and
202
the section as a whole is intended to apply in other circumstances.
203

  
204
It is not the purpose of this section to induce you to infringe any patents or
205
other property right claims or to contest validity of any such claims; this
206
section has the sole purpose of protecting the integrity of the free software
207
distribution system, which is implemented by public license practices. Many
208
people have made generous contributions to the wide range of software
209
distributed through that system in reliance on consistent application of that
210
system; it is up to the author/donor to decide if he or she is willing to
211
distribute software through any other system and a licensee cannot impose
212
that choice.
213

  
214
This section is intended to make thoroughly clear what is believed to be a
215
consequence of the rest of this License.
216

  
217
8. If the distribution and/or use of the Program is restricted in certain
218
countries either by patents or by copyrighted interfaces, the original copyright
219
holder who places the Program under this License may add an explicit
220
geographical distribution limitation excluding those countries, so that
221
distribution is permitted only in or among countries not thus excluded. In such
222
case, this License incorporates the limitation as if written in the body of this
223
License.
224

  
225
9. The Free Software Foundation may publish revised and/or new versions
226
of the General Public License from time to time. Such new versions will be
227
similar in spirit to the present version, but may differ in detail to address new
228
problems or concerns.
229

  
230
Each version is given a distinguishing version number. If the Program specifies
231
a version number of this License which applies to it and "any later version",
232
you have the option of following the terms and conditions either of that
233
version or of any later version published by the Free Software Foundation. If
234
the Program does not specify a version number of this License, you may
235
choose any version ever published by the Free Software Foundation.
236

  
237
10. If you wish to incorporate parts of the Program into other free programs
238
whose distribution conditions are different, write to the author to ask for
239
permission. For software which is copyrighted by the Free Software
240
Foundation, write to the Free Software Foundation; we sometimes make
241
exceptions for this. Our decision will be guided by the two goals of
242
preserving the free status of all derivatives of our free software and of
243
promoting the sharing and reuse of software generally.
244

  
245
               NO WARRANTY
246

  
247
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE,
248
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT
249
PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
250
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
251
OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
252
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
253
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
254
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
255
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
256
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
257
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
258
NECESSARY SERVICING, REPAIR OR CORRECTION.
259

  
260
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR
261
AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR
262
ANY OTHER PARTY WHO MAY MODIFY AND/OR
263
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
264
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
265
SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
266
ARISING OUT OF THE USE OR INABILITY TO USE THE
267
PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
268
OR DATA BEING RENDERED INACCURATE OR LOSSES
269
SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
270
PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN
271
IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
272
THE POSSIBILITY OF SUCH DAMAGES.
273

  
274
          END OF TERMS AND CONDITIONS
210
If any portion of this section is held invalid or unenforceable under
211
any particular circumstance, the balance of the section is intended to
212
apply and the section as a whole is intended to apply in other
213
circumstances.
214

  
215
It is not the purpose of this section to induce you to infringe any
216
patents or other property right claims or to contest validity of any
217
such claims; this section has the sole purpose of protecting the
218
integrity of the free software distribution system, which is
219
implemented by public license practices.  Many people have made
220
generous contributions to the wide range of software distributed
221
through that system in reliance on consistent application of that
222
system; it is up to the author/donor to decide if he or she is willing
223
to distribute software through any other system and a licensee cannot
224
impose that choice.
225

  
226
This section is intended to make thoroughly clear what is believed to
227
be a consequence of the rest of this License.
228

  
229
  8. If the distribution and/or use of the Program is restricted in
230
certain countries either by patents or by copyrighted interfaces, the
231
original copyright holder who places the Program under this License
232
may add an explicit geographical distribution limitation excluding
233
those countries, so that distribution is permitted only in or among
234
countries not thus excluded.  In such case, this License incorporates
235
the limitation as if written in the body of this License.
236

  
237
  9. The Free Software Foundation may publish revised and/or new versions
238
of the General Public License from time to time.  Such new versions will
239
be similar in spirit to the present version, but may differ in detail to
240
address new problems or concerns.
241

  
242
Each version is given a distinguishing version number.  If the Program
243
specifies a version number of this License which applies to it and "any
244
later version", you have the option of following the terms and conditions
245
either of that version or of any later version published by the Free
246
Software Foundation.  If the Program does not specify a version number of
247
this License, you may choose any version ever published by the Free Software
248
Foundation.
249

  
250
  10. If you wish to incorporate parts of the Program into other free
251
programs whose distribution conditions are different, write to the author
252
to ask for permission.  For software which is copyrighted by the Free
253
Software Foundation, write to the Free Software Foundation; we sometimes
254
make exceptions for this.  Our decision will be guided by the two goals
255
of preserving the free status of all derivatives of our free software and
256
of promoting the sharing and reuse of software generally.
257

  
258
                            NO WARRANTY
259

  
260
  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
262
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
266
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
267
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
REPAIR OR CORRECTION.
269

  
270
  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
POSSIBILITY OF SUCH DAMAGES.
279

  
280
                     END OF TERMS AND CONDITIONS
281

  
282
            How to Apply These Terms to Your New Programs
283

  
284
  If you develop a new program, and you want it to be of the greatest
285
possible use to the public, the best way to achieve this is to make it
286
free software which everyone can redistribute and change under these terms.
287

  
288
  To do so, attach the following notices to the program.  It is safest
289
to attach them to the start of each source file to most effectively
290
convey the exclusion of warranty; and each file should have at least
291
the "copyright" line and a pointer to where the full notice is found.
292

  
293
    <one line to give the program's name and a brief idea of what it does.>
294
    Copyright (C) <year>  <name of author>
295

  
296
    This program is free software; you can redistribute it and/or modify
297
    it under the terms of the GNU General Public License as published by
298
    the Free Software Foundation; either version 2 of the License, or
299
    (at your option) any later version.
300

  
301
    This program is distributed in the hope that it will be useful,
302
    but WITHOUT ANY WARRANTY; without even the implied warranty of
303
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
304
    GNU General Public License for more details.
305

  
306
    You should have received a copy of the GNU General Public License along
307
    with this program; if not, write to the Free Software Foundation, Inc.,
308
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309

  
310
Also add information on how to contact you by electronic and paper mail.
311

  
312
If the program is interactive, make it output a short notice like this
313
when it starts in an interactive mode:
314

  
315
    Gnomovision version 69, Copyright (C) year name of author
316
    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
    This is free software, and you are welcome to redistribute it
318
    under certain conditions; type `show c' for details.
319

  
320
The hypothetical commands `show w' and `show c' should show the appropriate
321
parts of the General Public License.  Of course, the commands you use may
322
be called something other than `show w' and `show c'; they could even be
323
mouse-clicks or menu items--whatever suits your program.
324

  
325
You should also get your employer (if you work as a programmer) or your
326
school, if any, to sign a "copyright disclaimer" for the program, if
327
necessary.  Here is a sample; alter the names:
328

  
329
  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
  `Gnomovision' (which makes passes at compilers) written by James Hacker.
331

  
332
  <signature of Ty Coon>, 1 April 1989
333
  Ty Coon, President of Vice
334

  
335
This General Public License does not permit incorporating your program into
336
proprietary programs.  If your program is a subroutine library, you may
337
consider it more useful to permit linking proprietary applications with the
338
library.  If this is what you want to do, use the GNU Lesser General
339
Public License instead of this License.
drupal7/sites/all/modules/dhtml_menu/dhtml_menu.admin.inc
1 1
<?php
2
// $Id: dhtml_menu.admin.inc,v 1.22 2010/11/09 21:24:51 arancaytar Exp $
3 2

  
4 3

  
5 4
/**
......
94 93
    '#title' => t('When a new page is loaded'),
95 94
    '#options' => array(
96 95
      'remember' => t('Remember which items were expanded on the last page.'),
97
      0 => t('Expand only the currently active path.'),
96
      '' => t('Expand only the currently active path.'),
98 97
    ),
99 98
    '#default_value' => $settings['effects']['remember'],
100 99
  );
......
123 122
    '#default_value' => $settings['filter']['list'],
124 123
    '#description' => t('DHTML will be used for all menus by default, but can be switched off for specific menus.'),
125 124
  );
125
  
126
  if (module_exists('menu_block')) {
127
    $options['filter']['menu_block'] = array(
128
      '#type' => 'checkboxes',
129
      '#title' => t('Menu Blocks'),
130
      '#options' => _dhtml_menu_blocks(),
131
      '#default_value' => $settings['filter']['menu_block'],
132
      '#description' => t('You may enable/disable specific menu blocks here, as long as the corresponding menu is enabled.'),
133
    );
134
  }
126 135

  
127 136
  $options['#tree'] = TRUE;
128 137
  $form['dhtml_menu_settings'] = $options;
......
160 169
  return $menu_names;
161 170
}
162 171

  
172
/**
173
 * Build an option list for all menu blocks in the system.
174
 * Only applicable if the Menu Block module is installed.
175
 */
176
function _dhtml_menu_blocks() {
177
  if (function_exists('menu_block_block_info')) {
178
    $block_names = array();
179
    $blocks = menu_block_block_info();
180
    foreach ($blocks as $delta => $block) {
181
      $block_names['menu_block_' . $delta] = $block['info'];
182
    }
183
    
184
    return $block_names;
185
  }
186
  return NULL;
187
}
drupal7/sites/all/modules/dhtml_menu/dhtml_menu.css
1
/* $Id: dhtml_menu.css,v 1.9 2009/11/07 00:57:37 arancaytar Exp $ */
2 1

  
3 2
/**
4 3
 * @file dhtml_menu.css
......
44 43
/*
45 44
 * Provide large and visible folder icons for easy clicking.
46 45
 */
47
li.dhtml-folder.expanded {
48
  list-style-image: url("images/folder-open-white.png") !important;
46
li.dhtml-folder {
47
    list-style: none;
49 48
}
50
li.dhtml-folder.collapsed {
51
  list-style-image: url("images/folder-closed-white.png") !important;
49
li.dhtml-folder.expanded .dhtml-menu-icon {
50
    background-image: url("images/folder-open-white.png");
51
}
52
li.dhtml-folder.collapsed .dhtml-menu-icon {
53
    background-image: url("images/folder-closed-white.png");
52 54
}
53 55

  
drupal7/sites/all/modules/dhtml_menu/dhtml_menu.info
1
; $Id: dhtml_menu.info,v 1.10 2009/11/12 21:47:59 arancaytar Exp $
2 1
name = DHTML Menu
3 2
description = Opens menus dynamically to reduce page reloads.
4 3
core = 7.x
......
8 7
files[] = dhtml_menu.admin.inc
9 8
files[] = dhtml_menu.theme.inc
10 9

  
10
configure = admin/config/user-interface/dhtml_menu
11 11

  
12
; Information added by drupal.org packaging script on 2010-11-09
13
version = "7.x-1.0-beta1"
12
; Information added by drupal.org packaging script on 2013-09-30
13
version = "7.x-1.x-dev"
14 14
core = "7.x"
15 15
project = "dhtml_menu"
16
datestamp = "1289339443"
16
datestamp = "1380569449"
17 17

  
18

  
19
; Information added by Drupal.org packaging script on 2019-10-07
20
version = "7.x-1.0-beta2"
21
core = "7.x"
22
project = "dhtml_menu"
23
datestamp = "1570442588"
drupal7/sites/all/modules/dhtml_menu/dhtml_menu.install
1 1
<?php
2
// $Id: dhtml_menu.install,v 1.17 2010/08/16 10:39:57 arancaytar Exp $
3 2

  
4 3

  
5 4
/**
......
183 182
  variable_del('dhtml_menu_theme');
184 183
}
185 184

  
185
/**
186
 * #7105: Ensure that 'Filter type' is set.
187
 */
188
function dhtml_menu_update_7105() {
189
  $settings = variable_get('dhtml_menu_settings');
190
  if (!isset($settings['filter']['type'])) {
191
    $settings['filter']['type'] = 'blacklist';
192
    variable_set('dhtml_menu_settings', $settings);
193
  }
194
}
195

  
drupal7/sites/all/modules/dhtml_menu/dhtml_menu.js
1
// $Id: dhtml_menu.js,v 1.49 2009/11/12 21:47:59 arancaytar Exp $
2 1

  
3 2

  
4 3

  
......
16 15
 * Initialize the module's JS functions
17 16
 */
18 17
Drupal.behaviors.dhtmlMenu = {
19
  attach: function() {
18
  attach: function(context, settings) {
20 19
    var settings = Drupal.settings.dhtmlMenu;
21 20

  
22 21
    // Initialize the animation effects from the settings.
......
29 28
    }
30 29

  
31 30
    // Sanitize by removing "expanded" on menus already marked "collapsed".
32
    $('li.dhtml-menu.collapsed.expanded').removeClass('expanded');
31
    $('li.dhtml-menu.collapsed.expanded', context).removeClass('expanded');
33 32

  
34 33
    /* Relevant only on "open-only" menus:
35 34
     * The links of expanded items should be marked for emphasis.
36 35
     */
37 36
    if (settings.nav == 'open') {
38
      $('li.dhtml-menu.expanded').addClass('dhtml-menu-open');
37
      $('li.dhtml-menu.expanded', context).addClass('dhtml-menu-open');
39 38
    }
40 39

  
41 40
    /* Relevant only when hovering:
......
55 54
    else if (settings.nav == 'hover') {
56 55
      var freeze = false;
57 56
      $('ul.menu').mouseenter(function() {freeze = false});
57
      $('ul.menu').focus(function() {freeze = false});
58 58
      $('body').mouseleave(function() {freeze = true});
59
      $('body').blur(function() {freeze = true});
59 60
    }
60 61

  
61 62
    /* Relevant only on bullet-icon expansion:
......
63 64
     */
64 65
    else if (settings.nav == 'bullet') {
65 66
      var bullet = $('<a href="#" class="dhtml-menu-icon"></a>');
66
      var rtl = $('html').attr('dir') == 'rtl' ? Math.ceil($('.menu li').css('margin-right').replace('px', '')) + 1 : 0;
67
      var rtl = 0;
68
      if ($('html').attr('dir') === 'rtl') {
69
        if (typeof($('.menu li').css('margin-right')) !== 'undefined') {
70
          rtl = Math.ceil($('.menu li').css('margin-right').replace('px', '')) + 1;
71
        }
72
      }
67 73
    }
68 74

  
69 75
    /* Relevant only when adding cloned links:
......
75 81
    }
76 82

  
77 83
    /* Add jQuery effects and listeners to all menu items. */
78
    $('ul.menu li.dhtml-menu:not(.leaf)').each(function() {
84
    $('ul.menu li.dhtml-menu:not(.leaf,.dhtml-processed)', context).each(function() {
85
      $(this).addClass("dhtml-processed");
79 86
      var li = $(this);
80 87
      var link = $(this).find('a:first');
81 88
      var ul = $(this).find('ul:first');
......
105 112
         * - @TODO: Explore whether "float:right" in dhtml_menu-rtl.css could solve this.
106 113
         */
107 114
        else if (settings.nav == 'bullet') {
108
          li.addClass('dhtml-folder');
115
          li.addClass('dhtml-folder dhtml-menu-processed');
109 116
          var b = bullet.clone().prependTo(link).click(function(e) {
110 117
            Drupal.dhtmlMenu.toggleMenu(li, link, ul);
111 118
            if (settings.effects.remember) {
......
125 132
         * - Add mouse-hovering events.
126 133
         */
127 134
        else if (settings.nav == 'hover') {
135
          link.focus(function(e) {
136
            Drupal.dhtmlMenu.switchMenu(li, link, ul, true);
137
          });
128 138
          link.mouseenter(function(e) {
129 139
              Drupal.dhtmlMenu.switchMenu(li, link, ul, true);
130 140
          });
......
142 152
              }, 10);
143 153
            }
144 154
          });
155
          li.blur(function(e) {
156
            // Only collapse the menu if it was initially collapsed.
157
            if (li.hasClass('start-collapsed')) {
158
              /* As explained earlier, this event fires before the body event.
159
               * We need to wait to make sure that the user isn't browsing a
160
               * context menu right now, in which case the menu isn't collapsed.
161
               */
162
              setTimeout(function() {
163
                if (!freeze) {
164
                  Drupal.dhtmlMenu.switchMenu(li, link, ul, false);
165
                }
166
              }, 10);
167
            }
168
          });
145 169
        }
146 170

  
147 171
        /* When using menus that cannot collapse:
......
174 198
    });
175 199

  
176 200
    // When using LTR, all icons can be shifted as one, as the text width is not relevant.
177
    if (settings.nav == 'bullet' && !rtl) {
201
    if (settings.nav == 'bullet' && !rtl && $('.menu li.dhtml-folder').length) {
178 202
      // Shift overlay to the left by the width of the icon and the distance between icon and text.
179
      var shift = '-' + (Math.ceil(($('.menu li').css('margin-left').replace('px', ''))) + 16) + 'px';
180
      // Shift the overlay using a negative left-hand offset, and the text using a negative right-hand margin.
181
      $('.dhtml-menu-icon').css('left', shift).css('margin-right', shift);
203
      if ($('.menu li').hasClass('margin-left')) {
204
        // Saved for a later backport if needs.
205
        if (typeof($('.menu li').css('margin-right')) !== 'undefined') {
206
          var shift = '-' + (Math.ceil(($('.menu li').css('margin-left').replace('px', ''))) + 16) + 'px';
207
          // Shift the overlay using a negative left-hand offset, and the text using a negative right-hand margin.
208
          $('.dhtml-menu-icon').css('left', shift).css('margin-right', shift);
209
        }
210
      }
182 211
    }
183 212
  }
184 213
}
drupal7/sites/all/modules/dhtml_menu/dhtml_menu.module
1 1
<?php
2
// $Id: dhtml_menu.module,v 1.50 2010/08/16 10:39:57 arancaytar Exp $
3 2

  
4 3

  
5 4
/**
......
7 6
 * Initialization and various hook implementations.
8 7
 */
9 8

  
9
require_once 'dhtml_menu.theme.inc';
10

  
10 11
/**
11 12
 * Implementation of hook_help().
12 13
 */
......
24 25
 * Adds CSS, Javascript and settings to the page.
25 26
 */
26 27
function dhtml_menu_init() {
27
  module_load_include('inc', 'dhtml_menu', 'dhtml_menu.theme');
28 28
  drupal_add_css(drupal_get_path('module', 'dhtml_menu') . '/dhtml_menu.css');
29 29
  drupal_add_js(drupal_get_path('module', 'dhtml_menu') . '/dhtml_menu.js');
30 30
  drupal_add_js(array('dhtmlMenu' => variable_get('dhtml_menu_settings')), 'setting');
drupal7/sites/all/modules/dhtml_menu/dhtml_menu.theme.inc
1 1
<?php
2
// $Id: dhtml_menu.theme.inc,v 1.14 2009/11/12 21:47:59 arancaytar Exp $
3 2

  
4 3

  
5 4
/**
......
29 28
  $l = &$variables['element']['#original_link'];
30 29

  
31 30
  // Determine if the menu is blacklisted or not whitelisted.
32
  $disabled = ($settings['filter']['type'] == 'blacklist') == !empty($settings['filter']['list'][$l['menu_name']]);
33
  if (empty($l['menu_name']) || empty($l['mlid']) || $disabled) {
34
    return;
31
  // First check menu blocks.
32
  if (!empty($variables['element']['#bid']['module']) &&
33
      !empty($variables['element']['#bid']['delta']) &&
34
      $variables['element']['#bid']['module'] == 'menu_block') {
35
    $checked = !empty($settings['filter']['menu_block']['menu_block_' . $variables['element']['#bid']['delta']]);
36
    if ($checked == ($settings['filter']['type'] == 'blacklist')) {
37
      // This menu block is either blacklisted, or not whitelisted, hence it is disabled.
38
      return;
39
    }
40
  }
41
  // Then check menus.
42
  else {
43
    $disabled = ($settings['filter']['type'] == 'blacklist') == !empty($settings['filter']['list'][$l['menu_name']]);
44
    if (empty($l['menu_name']) || empty($l['mlid']) || $disabled) {
45
      return;
46
    }
35 47
  }
36 48

  
37 49
  // Add the ID and class attributes.
......
46 58

  
47 59
  // If the current item can expand, and is neither saved as open nor in the active trail, close it.
48 60
  if ($l['has_children'] && !$l['in_active_trail'] && !in_array($variables['element']['#attributes']['id'], $cookie)) {
49
    $variables['element']['#attributes']['class'][] = 'collapsed';
50
    $variables['element']['#attributes']['class'][] = 'start-collapsed';
61
    if (!in_array('collapsed', $variables['element']['#attributes']['class'])) {
62
      $variables['element']['#attributes']['class'][] = 'collapsed';
63
    }
64
    if (!in_array('start-collapsed', $variables['element']['#attributes']['class'])) {
65
      $variables['element']['#attributes']['class'][] = 'start-collapsed';
66
    }
51 67
  }
52 68
}
53 69

  
drupal7/sites/all/modules/field_permissions/field_permissions.info
5 5
files[] = field_permissions.test
6 6
configure = admin/reports/fields/permissions
7 7

  
8
; Information added by Drupal.org packaging script on 2016-10-16
9
version = "7.x-1.0"
8
; Information added by Drupal.org packaging script on 2019-10-03
9
version = "7.x-1.1"
10 10
core = "7.x"
11 11
project = "field_permissions"
12
datestamp = "1476649740"
13

  
12
datestamp = "1570136288"
drupal7/sites/all/modules/field_permissions/field_permissions.install
24 24
  // Collect all the field data that reference "field_permissions", within
25 25
  // the field_config table.
26 26
  //
27
  $records = db_query("SELECT * FROM field_config WHERE data LIKE '%field_permissions%'");
27
  $records = db_query("SELECT * FROM {field_config} WHERE data LIKE '%field_permissions%'");
28 28

  
29 29
  foreach ($records as $record) {
30 30
    $data = $record->data;
......
33 33
    $data = serialize($data);
34 34

  
35 35
    // Update the record.
36
    db_query("UPDATE field_config SET data = :data WHERE id = :id",
36
    db_query("UPDATE {field_config} SET data = :data WHERE id = :id",
37 37
      array(':data' => $data, ':id' => $record->id));
38 38
  }
39 39
}
drupal7/sites/all/modules/file_entity/file_entity.admin.inc
362 362
      $count_query = db_select('file_usage', 'fu')
363 363
        ->fields('fu', array('fid', 'count'))
364 364
        ->condition('fu.fid', $file_result->fid, '=');
365
      $count_query->addExpression('SUM(fu.count)', 'total_count');
365
      $count_query->addExpression('fu.count', 'total_count');
366 366
      $count_result = $count_query->execute()->fetchAll();
367 367

  
368 368
      if (!empty($count_result[0]->total_count)) {
drupal7/sites/all/modules/file_entity/file_entity.field.inc
59 59
        'remote_playback' => 'remote_playback',
60 60
      ),
61 61
      'autoplay' => FALSE,
62
      'playsinline' => FALSE,
62 63
      'loop' => FALSE,
63 64
      'muted' => FALSE,
64 65
      'width' => NULL,
......
194 195
      '#type' => 'checkbox',
195 196
      '#default_value' => $settings['autoplay'],
196 197
    );
198
    $element['playsinline'] = array(
199
      '#title' => t('Plays inline'),
200
      '#type' => 'checkbox',
201
      '#default_value' => $settings['playsinline'],
202
    );
197 203
    $element['loop'] = array(
198 204
      '#title' => t('Loop'),
199 205
      '#type' => 'checkbox',
......
304 310
    if (isset($settings['autoplay'])) {
305 311
      $summary[] = t('Autoplay: %autoplay', array('%autoplay' => $settings['autoplay'] ? t('yes') : t('no')));
306 312
    }
313
    if (isset($settings['playsinline'])) {
314
      $summary[] = t('Plays inline: %playsinline', array('%playsinline' => $settings['playsinline'] ? t('yes') : t('no')));
315
    }
307 316
    if (isset($settings['loop'])) {
308 317
      $summary[] = t('Loop: %loop', array('%loop' => $settings['loop'] ? t('yes') : t('no')));
309 318
    }
......
351 360
          if (variable_get('file_entity_protect_repeated_render', TRUE)) {
352 361
            // Protect ourselves from repeated rendering.
353 362
            static $repeated_render_depth = array();
354
            $repeated_render_id = $entity_type . $field['field_name'] . $item['fid'];
363
            list($entity_id) = entity_extract_ids($entity_type, $entity);
364
            $repeated_render_id = $entity_type . $entity_id . $field['field_name'] . $item['fid'];
355 365
            if (isset($repeated_render_depth[$repeated_render_id])) {
356 366
              $repeated_render_depth[$repeated_render_id]++;
357 367
            }
......
388 398
          $file->referencing_entity_type = $entity_type;
389 399
          $file->referencing_field = $field['field_name'];
390 400

  
401
          // Prevent recursion by checking if the referencing entity is itself
402
          // do not display it again (return an empty array).
403
          // This senario is created a few lines below when file_view is called
404
          // it returns an array containing a referncing entity that is itself.
405
          // This is likely treating the symptom and not the root cause which is
406
          // probably buried in some hook_file_view() setting the referencing
407
          // entity.
408
          if (!empty($entity->fid) && $entity->fid === $item['fid']) {
409
            return $element;
410
          }
391 411
          // Untranslatable fields are rendered with no language code, fall back
392 412
          // to the content language in that case.
393 413
          $element[$delta] = file_view($file, $settings['file_view_mode'], $langcode !== LANGUAGE_NONE ? $langcode : NULL);
......
488 508
          '#controls' => $settings['controls'],
489 509
          '#controls_list' => $settings['controls_list'],
490 510
          '#autoplay' => $settings['autoplay'],
511
          '#playsinline' => $settings['playsinline'],
491 512
          '#loop' => $settings['loop'],
492 513
          '#muted' => $settings['muted'],
493 514
          '#width' => $settings['width'],
drupal7/sites/all/modules/file_entity/file_entity.file_api.inc
77 77
function file_view_multiple($files, $view_mode = 'full', $weight = 0, $langcode = NULL) {
78 78
  $build = array();
79 79

  
80
  if (empty($files)) {
81
    return $build;
82
  }
83

  
80 84
  $entities_by_view_mode = entity_view_mode_prepare('file', $files, $view_mode, $langcode);
81 85
  foreach ($entities_by_view_mode as $entity_view_mode => $entities) {
82 86
    field_attach_prepare_view('file', $entities, $entity_view_mode, $langcode);
drupal7/sites/all/modules/file_entity/file_entity.file_default_displays.inc
153 153
      'remote_playback' => 'remote_playback',
154 154
    ),
155 155
    'autoplay' => 0,
156
    'playsinline' => 0,
156 157
    'loop' => 0,
157 158
    'width' => '',
158 159
    'height' => '',
......
181 182
      'remote_playback' => 'remote_playback',
182 183
    ),
183 184
    'autoplay' => 0,
185
    'playsinline' => 0,
184 186
    'loop' => 0,
185 187
    'width' => '',
186 188
    'height' => '',
drupal7/sites/all/modules/file_entity/file_entity.info
32 32
; We have to add a fake version so Git checkouts do not fail Media dependencies
33 33
version = 7.x-2.x-dev
34 34

  
35
; Information added by Drupal.org packaging script on 2018-11-09
36
version = "7.x-2.25"
35
; Information added by Drupal.org packaging script on 2019-09-29
36
version = "7.x-2.26"
37 37
core = "7.x"
38 38
project = "file_entity"
39
datestamp = "1541794687"
39
datestamp = "1569787388"
drupal7/sites/all/modules/file_entity/file_entity.module
914 914
          'remote_playback' => 'remote_playback',
915 915
        ),
916 916
        'autoplay' => FALSE,
917
        'playsinline' => FALSE,
917 918
        'loop' => FALSE,
... Ce différentiel a été tronqué car il excède la taille maximale pouvant être affichée.

Formats disponibles : Unified diff