Projet

Général

Profil

Révision 136a805a

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

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/panelizer/panelizer.module
162 162
  return $items;
163 163
}
164 164

  
165
/**
166
 * Implements hook_panels_ipe_access().
167
 */
168
function panelizer_panels_ipe_access($display) {
169
  // We only care about Panels displays from panelizer.
170
  if (isset($display->context['panelizer'])) {
171
    // The type array contains 3 elements, where the first is the full context
172
    // type (ie. 'entity:ENTITY_TYPE'), and the remaining two are the parts
173
    // seperated by ':', so 'entity' and the entity type name.
174
    $entity_type = $display->context['panelizer']->type[2];
175
    if ($handler = panelizer_entity_plugin_get_handler($entity_type)) {
176
      // Only allow access to use the IPE if the user has 'update' access to
177
      // the underlying entity.
178
      $entity = $display->context['panelizer']->data;
179
      return $handler->entity_access('update', $entity);
180
    }
181
  }
182
}
183

  
165 184
/**
166 185
 * Implements hook_form_FORM_ID_alter().
167 186
 *
......
445 464
  if (in_array($module, array('panelizer', 'ctools', 'page_manager'))) {
446 465
    return 'plugins/' . $plugin;
447 466
  }
467
  if ($module == 'panels' && $plugin == 'panels_storage') {
468
    return 'plugins/' . $plugin;
469
  }
448 470
}
449 471

  
450 472
/**
......
1063 1085
 */
1064 1086
function panelizer_export_save_callback(&$object) {
1065 1087
  if (!empty($object->display)) {
1088
    $object->display->storage_id = $object->name;
1066 1089
    // First write the display.
1067 1090
    panels_save_display($object->display);
1068 1091

  
......
1260 1283
    if (!empty($get_default)) {
1261 1284
      $panelizer = $handler->get_default_panelizer_object($bundle, $name);
1262 1285
      $cache->display->context = $handler->get_contexts($panelizer);
1286

  
1287
      // Set the storage_type and storage_id if either is empty.
1288
      if (empty($cache->display->storage_type)) {
1289
        $cache->display->storage_type = 'panelizer_default';
1290
      }
1291
      if (empty($cache->display->storage_id)) {
1292
        $cache->display->storage_id = $panelizer->name;
1293
      }
1263 1294
    }
1264 1295
    else {
1265 1296
      $conditions = (isset($vid) ? array('vid' => $vid) : array());
......
1280 1311
    $panelizer = $handler->get_default_panelizer_object($bundle, $name);
1281 1312
    $cache->display = $panelizer->display;
1282 1313
    $cache->display->context = $handler->get_contexts($panelizer);
1314
    
1315
    // Set the storage_type and storage_id if either is empty.
1316
     if (empty($cache->display->storage_type)) {
1317
       $cache->display->storage_type = 'panelizer_default';
1318
     }
1319
     if (empty($cache->display->storage_id)) {
1320
       $cache->display->storage_id = $panelizer->name;
1321
     }
1283 1322
  }
1284 1323
  else {
1285 1324
    $conditions = (isset($vid) ? array('vid' => $vid) : array());

Formats disponibles : Unified diff