Projet

Général

Profil

Révision c304a780

Ajouté par Assos Assos il y a environ 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/ctools/page_manager/plugins/tasks/page.inc
32 32
      'function' => 'page_manager_page_menu',
33 33
    ),
34 34
    'hook theme' => 'page_manager_page_theme',
35
    // page only items
35
    // Page only items.
36 36
    'task type' => 'page',
37 37
    'page operations' => array(
38 38
      array(
......
49 49
    ),
50 50
    'page type' => 'custom',
51 51

  
52
    // context only items
52
    // Context only items.
53 53
    'handler type' => 'context',
54 54
    'get arguments' => array(
55 55
      'file' => 'page.admin.inc',
......
112 112
    }
113 113
  }
114 114
  page_manager_page_recalculate_arguments($page);
115
  // Create a real object from the cache
115
  // Create a real object from the cache.
116 116
  page_manager_page_save($page);
117 117

  
118 118
  // Check to see if we should make this the site frontpage.
......
191 191
      'form' => 'page_manager_page_form_delete',
192 192
    );
193 193
  }
194
  else if ($page->export_type != EXPORT_IN_CODE) {
194
  elseif ($page->export_type != EXPORT_IN_CODE) {
195 195
    $operations['actions']['children']['delete'] = array(
196 196
      'title' => t('Delete'),
197 197
      'description' => t('Remove this page from your system completely.'),
......
216 216
    'row class' => empty($page->disabled) ? 'page-manager-enabled' : 'page-manager-disabled',
217 217
    'storage' => $page->type == t('Default') ? t('In code') : $page->type,
218 218
    'disabled' => !empty($page->disabled),
219
    // This works for both enable AND disable
219
    // This works for both enable AND disable.
220 220
    'enable callback' => 'page_manager_page_enable',
221 221
  );
222 222

  
223
  // default handlers may appear from a default subtask.
223
  // Default handlers may appear from a default subtask.
224 224
  if (isset($page->default_handlers)) {
225 225
    $subtask['default handlers'] = $page->default_handlers;
226 226
  }
......
247 247
}
248 248

  
249 249
// --------------------------------------------------------------------------
250
// Page execution functions
251

  
250
// Page execution functions.
252 251
/**
253 252
 * Execute a page task.
254 253
 *
......
274 273
      $contexts[$arg->id] = $arg;
275 274
      $args[] = $arg->original_argument;
276 275
    }
277
    else if ($count) {
276
    elseif ($count) {
278 277
      $args[] = $arg;
279 278
    }
280 279
  }
......
302 301
          $context = ctools_context_get_context_from_argument($argument, $value);
303 302
        }
304 303
        else {
305
          // make sure there is a placeholder context for missing optional contexts.
304
          // Make sure there is a placeholder context for missing optional contexts.
306 305
          $context = ctools_context_get_context_from_argument($argument, NULL, TRUE);
307
          // Force the title to blank for replacements
306
          // Force the title to blank for replacements.
308 307
        }
309 308
        if ($context) {
310 309
          $contexts[$context->id] = $context;
......
328 327
}
329 328

  
330 329
// --------------------------------------------------------------------------
331
// Context type callbacks
332

  
330
// Context type callbacks.
333 331
/**
334 332
 * Return a list of arguments used by this task.
335 333
 */
......
500 498
  $bits = explode('/', $path);
501 499
  foreach ($bits as $position => $bit) {
502 500
    if ($bit && ($bit[0] == '%' || $bit[0] == '!')) {
503
      // special handling for duplicate path items and substr to remove the %
501
      // Special handling for duplicate path items and substr to remove the %.
504 502
      $arguments[substr($bit, 1)] = isset($arguments[$bit]) ? -1 : $position;
505 503
    }
506 504
  }
......
547 545
  ctools_include('context');
548 546
  $context = ctools_context_get_context_from_argument($page->arguments[$keyword], $value);
549 547

  
550
  // convert false equivalents to false.
548
  // Convert false equivalents to false.
551 549
  return $context ? $context : FALSE;
552 550
}
553 551

  
......
583 581
    array('class' => array('page-summary-operation'), 'data' => $link),
584 582
  );
585 583

  
586

  
587 584
  $path = array();
588 585
  foreach (explode('/', $page->path) as $bit) {
589 586
    if ($bit[0] != '!') {
......
599 596
  if ($path == $front) {
600 597
    $message = t('This is your site home page.');
601 598
  }
602
  else if (!empty($page->make_frontpage)) {
599
  elseif (!empty($page->make_frontpage)) {
603 600
    $message = t('This page is set to become your site home page.');
604 601
  }
605 602

  
......
660 657
        case 'default tab':
661 658
          $menu .= ' ' . t('Parent title: %title.', array('%title' => $page->menu['parent']['title']));
662 659
          break;
660

  
663 661
        case 'normal':
664 662
          if (module_exists('menu')) {
665 663
            $menus = menu_get_menus();
......
750 748
  $cache->subtask = page_manager_page_build_subtask($cache->task, $page);
751 749

  
752 750
  if (isset($cache->handlers)) {
753
    foreach($cache->handlers as $id => $handler) {
751
    foreach ($cache->handlers as $id => $handler) {
754 752
      $cache->handler_info[$id]['changed'] = PAGE_MANAGER_CHANGED_DELETED;
755 753
    }
756 754
  }
......
778 776
 *   The subtask id
779 777
 * @param $contexts
780 778
 *   The contexts loaded for the task.
779
 *
781 780
 * @return
782 781
 *   TRUE if the current user can access the page.
783 782
 */

Formats disponibles : Unified diff