Project

General

Profile

Revision 7d7b5830

Added by Assos Assos about 9 years ago

Weekly update of contrib modules

View differences:

drupal7/sites/all/modules/entity/entity.info
25 25
files[] = views/handlers/entity_views_handler_relationship_by_bundle.inc
26 26
files[] = views/handlers/entity_views_handler_relationship.inc
27 27
files[] = views/plugins/entity_views_plugin_row_entity_view.inc
28
; Information added by Drupal.org packaging script on 2014-04-08
29
version = "7.x-1.5"
28
; Information added by Drupal.org packaging script on 2015-02-25
29
version = "7.x-1.6"
30 30
core = "7.x"
31 31
project = "entity"
32
datestamp = "1396975454"
32
datestamp = "1424876582"
33 33

  
drupal7/sites/all/modules/entity/entity.info.inc
169 169
  switch ($type) {
170 170
    case 'int':
171 171
    case 'serial':
172
    case 'date':
172 173
      return 'integer';
173 174
    case 'float':
174 175
    case 'numeric':
drupal7/sites/all/modules/entity/entity_token.info
5 5
files[] = entity_token.module
6 6
dependencies[] = entity
7 7

  
8
; Information added by Drupal.org packaging script on 2014-04-08
9
version = "7.x-1.5"
8
; Information added by Drupal.org packaging script on 2015-02-25
9
version = "7.x-1.6"
10 10
core = "7.x"
11 11
project = "entity"
12
datestamp = "1396975454"
12
datestamp = "1424876582"
13 13

  
drupal7/sites/all/modules/entity/includes/entity.inc
31 31
  protected $entityInfo;
32 32
  protected $idKey, $nameKey, $statusKey;
33 33
  protected $defaultLabel = FALSE;
34
  protected $wrapper;
34 35

  
35 36
  /**
36 37
   * Creates a new entity.
......
111 112
    return !empty($this->entityInfo['entity keys']['bundle']) ? $this->{$this->entityInfo['entity keys']['bundle']} : $this->entityType;
112 113
  }
113 114

  
115
  /**
116
   * Returns the EntityMetadataWrapper of the entity.
117
   *
118
   * @return EntityDrupalWrapper
119
   *   An EntityMetadataWrapper containing the entity.
120
   */
121
  public function wrapper() {
122
    if (empty($this->wrapper)) {
123
      $this->wrapper = entity_metadata_wrapper($this->entityType, $this);
124
    }
125
    elseif ($this->wrapper->value() !== $this) {
126
      // Wrapper has been modified outside, so let's better create a new one.
127
      $this->wrapper = entity_metadata_wrapper($this->entityType, $this);
128
    }
129
    return $this->wrapper;
130
  }
131

  
114 132
  /**
115 133
   * Returns the label of the entity.
116 134
   *
drupal7/sites/all/modules/entity/includes/entity.wrapper.inc
504 504
      while (!($entity instanceof EntityDrupalWrapper) && isset($entity->info['parent'])) {
505 505
        $entity = $entity->info['parent'];
506 506
      }
507
      if ($entity instanceof EntityDrupalWrapper && !$entity->entityAccess('update', $account)) {
507
      if ($entity instanceof EntityDrupalWrapper && $entity->entityAccess('update', $account) === FALSE) {
508 508
        return FALSE;
509 509
      }
510 510
    }
......
515 515
    elseif ($op == 'edit' && isset($info['setter permission'])) {
516 516
      return user_access($info['setter permission'], $account);
517 517
    }
518
    // If access is unknown, we return TRUE.
518 519
    return TRUE;
519 520
  }
520 521

  
......
809 810
    if (!empty($this->info['parent'])) {
810 811
      // If this is a property, make sure the user is able to view the
811 812
      // currently referenced entity also.
812
      return $this->entityAccess('view', $account) && parent::access($op, $account);
813
      if ($this->entityAccess('view', $account) === FALSE) {
814
        return FALSE;
815
      }
816
      if (parent::access($op, $account) === FALSE) {
817
        return FALSE;
818
      }
819
      // If access is unknown, we return TRUE.
820
      return TRUE;
813 821
    }
814 822
    else {
815 823
      // This is not a property, so fallback on entity access.
drupal7/sites/all/modules/entity/modules/callbacks.inc
703 703
/**
704 704
 * Access callback for the user entity.
705 705
 */
706
function entity_metadata_user_access($op, $entity = NULL, $account = NULL, $entity_type) {
706
function entity_metadata_user_access($op, $entity = NULL, $account = NULL, $entity_type = NULL) {
707 707
  $account = isset($account) ? $account : $GLOBALS['user'];
708 708
  // Grant access to the users own user account and to the anonymous one.
709
  if (isset($entity) && $op != 'delete' && (($entity->uid == $account->uid && $entity->uid) || (!$entity->uid && $op == 'view'))) {
709
  if (isset($entity->uid) && $op != 'delete' && (($entity->uid == $account->uid && $entity->uid) || (!$entity->uid && $op == 'view'))) {
710 710
    return TRUE;
711 711
  }
712
  if (user_access('administer users', $account) || user_access('access user profiles', $account) && $op == 'view' && $entity->status) {
712
  if (user_access('administer users', $account)
713
    || user_access('access user profiles', $account) && $op == 'view' && (empty($entity) || !empty($entity->status))) {
713 714
    return TRUE;
714 715
  }
715 716
  return FALSE;
......
724 725
  }
725 726
  $account = isset($account) ? $account : $GLOBALS['user'];
726 727
  // Flag to indicate if this user entity is the own user account.
727
  $is_own_account = isset($entity) && $account->uid == $entity->uid;
728
  $is_own_account = isset($entity->uid) && $account->uid == $entity->uid;
728 729
  switch ($property) {
729 730
    case 'name':
730 731
      // Allow view access to anyone with access to the entity.
......
794 795
/**
795 796
 * Access callback for the taxonomy entities.
796 797
 */
797
function entity_metadata_taxonomy_access($op, $entity = NULL, $account = NULL, $entity_type) {
798
function entity_metadata_taxonomy_access($op, $entity = NULL, $account = NULL, $entity_type = NULL) {
798 799
  if ($entity_type == 'taxonomy_vocabulary') {
799 800
    return user_access('administer taxonomy', $account);
800 801
  }
drupal7/sites/all/modules/entity/modules/field.info.inc
51 51
    $property = &$info[$entity_type]['bundles'][$instance['bundle']]['properties'][$name];
52 52
    $instance += array('property info' => array());
53 53
    $property = $instance['property info'] + array(
54
      'label' => $instance['label'],
54
      // Since the label will be exposed via hook_token_info() and it is not
55
      // clearly defined if that should be sanitized already we prevent XSS
56
      // right here (field labels are user provided text).
57
      'label' => filter_xss_admin($instance['label']),
55 58
      'type' => $field_type['property_type'],
56 59
      'description' => t('Field "@name".', array('@name' => $name)),
57 60
      'getter callback' => 'entity_metadata_field_property_get',
......
164 167
  if (empty($instance['settings']['alt_field'])) {
165 168
    unset($property['property info']['alt']);
166 169
  }
167
  if (empty($field['settings']['title_field'])) {
170
  if (empty($instance['settings']['title_field'])) {
168 171
    unset($property['property info']['title']);
169 172
  }
170 173
}
drupal7/sites/all/modules/entity/tests/entity_feature.info
6 6
dependencies[] = entity_test
7 7
hidden = TRUE
8 8

  
9
; Information added by Drupal.org packaging script on 2014-04-08
10
version = "7.x-1.5"
9
; Information added by Drupal.org packaging script on 2015-02-25
10
version = "7.x-1.6"
11 11
core = "7.x"
12 12
project = "entity"
13
datestamp = "1396975454"
13
datestamp = "1424876582"
14 14

  
drupal7/sites/all/modules/entity/tests/entity_test.info
7 7
dependencies[] = entity
8 8
hidden = TRUE
9 9

  
10
; Information added by Drupal.org packaging script on 2014-04-08
11
version = "7.x-1.5"
10
; Information added by Drupal.org packaging script on 2015-02-25
11
version = "7.x-1.6"
12 12
core = "7.x"
13 13
project = "entity"
14
datestamp = "1396975454"
14
datestamp = "1424876582"
15 15

  
drupal7/sites/all/modules/entity/tests/entity_test.install
51 51
      'uid' => array('uid'),
52 52
    ),
53 53
    'foreign keys' => array(
54
      'uid' => array('users' => 'uid'),
55
      'name' => array('entity_test_types' => 'name'),
54
      'uid' => array(
55
        'table' => 'users',
56
        'columns' => array('uid' => 'uid')
57
      ),
58
      'name' => array(
59
        'table' => 'entity_test_types',
60
        'columns' => array('name' => 'name')
61
      ),
56 62
    ),
57 63
    'primary key' => array('pid'),
58 64
  );
drupal7/sites/all/modules/entity/tests/entity_test_i18n.info
5 5
package = Multilingual - Internationalization
6 6
core = 7.x
7 7
hidden = TRUE
8
; Information added by Drupal.org packaging script on 2014-04-08
9
version = "7.x-1.5"
8
; Information added by Drupal.org packaging script on 2015-02-25
9
version = "7.x-1.6"
10 10
core = "7.x"
11 11
project = "entity"
12
datestamp = "1396975454"
12
datestamp = "1424876582"
13 13

  
drupal7/sites/all/modules/entity/theme/entity.theme.inc
169 169
  $variables['title'] = check_plain(entity_label($entity_type, $entity));
170 170

  
171 171
  $uri = entity_uri($entity_type, $entity);
172
  $variables['url'] = $uri ? url($uri['path'], $uri['options']) : FALSE;
172
  $variables['url'] = $uri && !empty($uri['path']) ? url($uri['path'], $uri['options']) : FALSE;
173 173

  
174 174
  if (isset($variables['elements']['#page'])) {
175 175
    // If set by the caller, respect the page property.
......
177 177
  }
178 178
  else {
179 179
    // Else, try to automatically detect it.
180
    $variables['page'] = $uri && $uri['path'] == $_GET['q'];
180
    $variables['page'] = $uri && !empty($uri['path']) && $uri['path'] == $_GET['q'];
181 181
  }
182 182

  
183 183
  // Helpful $content variable for templates.
drupal7/sites/all/modules/entity/views/handlers/entity_views_handler_relationship_by_bundle.inc
93 93
      $def['extra'] = array(
94 94
        array(
95 95
          // The table and the IN operator are implicit.
96
          'field' => $entity_info['bundle keys']['bundle'],
96
          'field' => $entity_info['entity keys']['bundle'],
97 97
          'value' => $this->options['bundle_types'],
98 98
        ),
99 99
      );
drupal7/sites/all/modules/module_filter/CHANGELOG.txt
1
Module Filter 7.x-2.x, 2015-02-20
2
---------------------------------
3
Simplifying the table rows by hiding version and requirements until a
4
  particular description is clicked.
5

  
6

  
7
Module Filter 7.x-2.x, 2014-09-01
8
---------------------------------
9
#2235553 by greenSkin: Fixed latest jquery_update breaks module filter.
10
#2304687 by mpdonadio: Fixed Remove hardcoded operations.
11
#2293029 by topsitemakers: Fixed Take header offset into account when selecting
12
  a tab.
13
#2290213 by topsitemakers: Minor typo in description - "has no affect" -> "has
14
  no effect".
15

  
16

  
1 17
Module Filter 7.x-2.0-alpha2, 2013-12-06
2 18
----------------------------------------
3 19
#2141743, #2141743 by greenSkin: Fixed issues related to the new dynamically
drupal7/sites/all/modules/module_filter/css/modules.css
1
#system-modules table {
2
  table-layout: fixed;
3
}
4
#system-modules th.checkbox {
5
  width: 8%;
6
}
7
#system-modules th.name {
8
  width: 25%;
9
}
10
#system-modules th.links {
11
  width: 15%;
12
}
13
#system-modules td {
14
  vertical-align: top;
15
}
16
#system-modules .expand.inner {
17
  background: transparent url(/misc/menu-collapsed.png) left 0.6em no-repeat;
18
  margin-left: -12px;
19
  padding-left: 12px;
20
}
21
#system-modules .expanded.expand.inner {
22
  background: transparent url(/misc/menu-expanded.png) left 0.6em no-repeat;
23
}
24
#system-modules .description {
25
  cursor: pointer;
26
}
27
#system-modules .description .inner {
28
  overflow: hidden; /* truncates descriptions if too long */
29
  text-overflow: ellipsis;
30
  white-space: nowrap;
31
}
32
#system-modules .description .requirements,
33
#system-modules .description .links {
34
  display: none;
35
}
36
#system-modules .description .expanded.inner {
37
  overflow: visible;
38
  white-space: normal;
39
}
40
#system-modules .description .expanded .requirements,
41
#system-modules .description .expanded .links {
42
  display: block;
43
}
44
#system-modules .requirements {
45
  padding: 5px 0;
46
  max-width: 490px;
47
}
drupal7/sites/all/modules/module_filter/js/module_filter_tab.js
418 418
    Drupal.ModuleFilter.modulesTop = $('#module-filter-modules').offset().top;
419 419
  }
420 420
  else {
421
    // Calculate header offset; this is important in case the site is using
422
    // admin_menu module which has fixed positioning and is on top of everything
423
    // else.
424
    var headerOffset = Drupal.settings.tableHeaderOffset ? eval(Drupal.settings.tableHeaderOffset + '()') : 0;
421 425
    // Scroll back to top of #module-filter-modules.
422 426
    $('html, body').animate({
423
      scrollTop: Drupal.ModuleFilter.modulesTop
427
      scrollTop: Drupal.ModuleFilter.modulesTop - headerOffset
424 428
    }, 500);
425 429
    // $('html, body').scrollTop(Drupal.ModuleFilter.modulesTop);
426 430
  }
drupal7/sites/all/modules/module_filter/js/modules.js
2 2

  
3 3
Drupal.behaviors.moduleFilter = {
4 4
  attach: function(context) {
5
    $('#system-modules td.description').once('description', function() {
6
      $('.inner.expand', $(this)).click(function() {
7
        $(this).toggleClass('expanded');
8
      });
9
    });
10

  
5 11
    $('.module-filter-inputs-wrapper', context).once('module-filter', function() {
6 12
      var filterInput = $('input[name="module_filter[name]"]', context);
7 13
      var selector = '#system-modules table tbody tr';
drupal7/sites/all/modules/module_filter/module_filter.admin.inc
17 17
  $form['module_filter_set_focus'] = array(
18 18
    '#type' => 'checkbox',
19 19
    '#title' => t('Set focus to filter field on page load'),
20
    '#description' => t('Currently has no affect when using Overlay module.'),
20
    '#description' => t('Currently has no effect when using Overlay module.'),
21 21
    '#default_value' => variable_get('module_filter_set_focus', 1),
22 22
  );
23 23

  
drupal7/sites/all/modules/module_filter/module_filter.info
17 17

  
18 18
configure = admin/config/user-interface/modulefilter
19 19

  
20
; Information added by Drupal.org packaging script on 2013-12-06
21
version = "7.x-2.0-alpha2"
20
; Information added by Drupal.org packaging script on 2015-02-22
21
version = "7.x-2.0"
22 22
core = "7.x"
23 23
project = "module_filter"
24
datestamp = "1386356916"
24
datestamp = "1424631189"
25 25

  
drupal7/sites/all/modules/module_filter/module_filter.module
83 83

  
84 84
  if (variable_get('module_filter_tabs', 1)) {
85 85
    $form['module_filter']['#attached']['css'][] = drupal_get_path('module', 'module_filter') .'/css/module_filter_tab.css';
86
    $form['module_filter']['#attached']['js'][] = 'misc/jquery.ba-bbq.js';
86
    $form['module_filter']['#attached']['library'][] = array('system', 'jquery.bbq');
87 87
    $form['module_filter']['#attached']['js'][] = drupal_get_path('module', 'module_filter') .'/js/module_filter_tab.js';
88 88

  
89 89
    if (!module_exists('page_actions') && variable_get('module_filter_dynamic_save_position', 1)) {
......
91 91
      $form['module_filter']['#attached']['js'][] = drupal_get_path('module', 'module_filter') .'/js/dynamic_position.js';
92 92
    }
93 93

  
94
    $form['#attached']['css'][] = drupal_get_path('module', 'module_filter') . '/css/modules.css';
95

  
94 96
    $form['#theme'] = 'module_filter_system_modules_tabs';
95 97
  }
96 98

  
drupal7/sites/all/modules/module_filter/module_filter.theme.inc
32 32
  }
33 33

  
34 34
  $header = array(
35
    t('Enabled'),
36
    t('Name'),
37
    t('Version'),
38
    t('Description')
35
    array('data' => '', 'class' => array('checkbox')),
36
    array('data' => t('Name'), 'class' => array('name')),
37
    array('data' => t('Description'), 'class' => array('description')),
38
    array('data' => t('Links'), 'class' => array('links')),
39 39
  );
40 40
  $package_ids = array('all');
41 41
  $enabled['all'] = array();
......
79 79
      }
80 80

  
81 81
      $row = array();
82

  
83
      $version = !empty($module['version']['#markup']);
84
      $requires = !empty($module['#requires']);
85
      $required_by = !empty($module['#required_by']);
86

  
82 87
      $toggle_enable = '';
83 88
      if (isset($module['enable']['#type']) && $module['enable']['#type'] == 'checkbox') {
84 89
        unset($module['enable']['#title']);
......
89 94
        $toggle_enable = '<div class="js-hide toggle-enable ' . $class . '"><div>&nbsp;</div></div>';
90 95
      }
91 96
      $row[] = array('class' => array('checkbox'), 'data' => $toggle_enable . drupal_render($module['enable']));
97

  
92 98
      $label = '<label';
93 99
      if (isset($module['enable']['#id'])) {
94 100
        $label .= ' for="' . $module['enable']['#id'] . '"';
95 101
      }
96
      $row[] = array('class' => array('name'), 'data' => $label . '><strong>' . drupal_render($module['name']) . '</strong><br><span class="module-machine-name">(' . $key . ')</span></label>');
97
      $row[] = array('class' => array('version'), 'data' => drupal_render($module['version']));
98
      // Add the description, along with any modules it requires and any
99
      // operation links.
100
      $description = drupal_render($module['description']);
101
      if ($module['#requires']) {
102
        $description .= '<div class="admin-requirements">' . t('Requires: !module-list', array('!module-list' => implode(', ', $module['#requires']))) . '</div>';
103
      }
104
      if ($module['#required_by']) {
105
        $description .= '<div class="admin-requirements">' . t('Required by: !module-list', array('!module-list' => implode(', ', $module['#required_by']))) . '</div>';
102
      $row[] = array('class' => array('name'), 'data' => $label . '><strong>' . drupal_render($module['name']) . '</strong> <span class="module-machine-name">(' . $key . ')</span></label>');
103

  
104
      // Add the description, along with any modules it requires.
105
      $description = '<span class="details"><span class="text">' . drupal_render($module['description']) . '</span></span>';
106
      if ($version || $requires || $required_by) {
107
        $description .= '<div class="requirements">';
108
        if ($version) {
109
          $description .= '<div class="admin-requirements">' . t('Version: !module-version', array('!module-version' => drupal_render($module['version']))) . '</div>';
110
        }
111
        if ($requires) {
112
          $description .= '<div class="admin-requirements">' . t('Requires: !module-list', array('!module-list' => implode(', ', $module['#requires']))) . '</div>';
113
        }
114
        if ($required_by) {
115
          $description .= '<div class="admin-requirements">' . t('Required by: !module-list', array('!module-list' => implode(', ', $module['#required_by']))) . '</div>';
116
        }
117
        $description .= '</div>';
106 118
      }
119
      $row[] = array('data' => '<div class="inner expand" role="button">' . $description . '</div>', 'class' => array('description'));
120

  
107 121
      $operations = (module_exists('ctools')) ? theme('module_filter_operations', array('links' => $module['links'], 'dropbutton' => TRUE)) : theme('module_filter_operations', array('links' => $module['links']));
108
      if (!empty($operations)) {
109
        $description .= $operations;
110
      }
111
      $row[] = array('data' => $description, 'class' => array('description'));
122
      $row[] = array('data' => '<div class="links">' . $operations . '</div>', 'class' => array('links'));
112 123

  
113 124
      $class = array(module_filter_get_id($package) . '-tab', 'module', $stripe);
114 125
      if (isset($recent_modules[$key])) {
......
159 170
  $dropbutton = $vars['dropbutton'];
160 171

  
161 172
  $operations = array();
162
  foreach (array('configure', 'permissions', 'help') as $key) {
173
  foreach (element_children($links) as $key) {
163 174
    if ($dropbutton) {
164 175
      hide($links[$key]);
165 176
      if (!empty($links[$key]['#href'])) {

Also available in: Unified diff