Projet

Général

Profil

Révision 5d12d676

Ajouté par Assos Assos il y a environ 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/views/includes/plugins.inc
5 5
 * Built in plugins for Views output handling.
6 6
 */
7 7

  
8
// @todo: Remove this once update.php can use the registry
8
// @todo Remove this once update.php can use the registry.
9 9
views_include('base');
10 10

  
11 11
/**
......
101 101
        'title' => t('Empty display extender'),
102 102
        'help' => t('Default settings for this view.'),
103 103
        'handler' => 'views_plugin_display_extender',
104
        // You can force the plugin to be enabled
104
        // You can force the plugin to be enabled.
105 105
        'enabled' => FALSE,
106 106
        'no ui' => TRUE,
107 107
      ),
......
160 160
        'help' => t('Displays the default summary as a list.'),
161 161
        'handler' => 'views_plugin_style_summary',
162 162
        'theme' => 'views_view_summary',
163
        'type' => 'summary', // only shows up as a summary style
163
        'type' => 'summary',
164
  // only shows up as a summary style.
164 165
        'uses options' => TRUE,
165 166
        'help topic' => 'style-summary',
166 167
      ),
......
169 170
        'help' => t('Displays the summary unformatted, with option for one after another or inline.'),
170 171
        'handler' => 'views_plugin_style_summary_unformatted',
171 172
        'theme' => 'views_view_summary_unformatted',
172
        'type' => 'summary', // only shows up as a summary style
173
        'type' => 'summary',
174
  // only shows up as a summary style.
173 175
        'uses options' => TRUE,
174 176
        'help topic' => 'style-summary-unformatted',
175 177
      ),
......
266 268
      'views_query' => array(
267 269
        'title' => t('SQL Query'),
268 270
        'help' => t('Query will be generated and run using the Drupal database API.'),
269
        'handler' => 'views_plugin_query_default'
271
        'handler' => 'views_plugin_query_default',
270 272
      ),
271 273
    ),
272 274
    'cache' => array(
......
356 358
        'handler' => 'views_plugin_localization',
357 359
        'parent' => '',
358 360
      ),
359
     'none' => array(
361
      'none' => array(
360 362
        'title' => t('None'),
361 363
        'help' => t('Do not pass admin strings for translation.'),
362 364
        'handler' => 'views_plugin_localization_none',
......
381 383
      'help' => t('Puts all of the results into a select box and allows the user to go to a different page based upon the results.'),
382 384
      'handler' => 'views_plugin_style_summary_jump_menu',
383 385
      'theme' => 'views_view_summary_jump_menu',
384
      'type' => 'summary', // only shows up as a summary style
386
      'type' => 'summary',
387
    // only shows up as a summary style.
385 388
      'uses options' => TRUE,
386 389
      'help topic' => 'style-summary-jump-menu',
387 390
    );
......
417 420
    }
418 421

  
419 422
    $module_dir = isset($result['module']) ? $result['module'] : $module;
420
    // Setup automatic path/file finding for theme registration
423
    // Setup automatic path/file finding for theme registration.
421 424
    if ($module_dir == 'views') {
422 425
      $theme_path = drupal_get_path('module', $module_dir) . '/theme';
423 426
      $theme_file = 'theme.inc';
......
452 455
        // Set the internal name to be able to read it out later.
453 456
        $def['name'] = $plugin;
454 457

  
455
        // merge the new data in
458
        // merge the new data in.
456 459
        $cache[$type][$plugin] = $def;
457 460
      }
458 461
    }
......
467 470
 * Abstract base class to provide interface common to all plugins.
468 471
 */
469 472
class views_plugin extends views_object {
473

  
470 474
  /**
471 475
   * The top object of a view.
472 476
   *
473 477
   * @var view
474 478
   */
475
  var $view = NULL;
479
  public $view = NULL;
476 480

  
477 481
  /**
478 482
   * The current used views display.
479 483
   *
480 484
   * @var views_display
481 485
   */
482
  var $display = NULL;
486
  public $display = NULL;
483 487

  
484 488
  /**
485 489
   * The plugin type of this plugin, for example style or query.
486 490
   */
487
  var $plugin_type = NULL;
491
  public $plugin_type = NULL;
488 492

  
489 493
  /**
490 494
   * The plugin name of this plugin, for example table or full.
491 495
   */
492
  var $plugin_name = NULL;
496
  public $plugin_name = NULL;
493 497

  
494 498
  /**
495 499
   * Init will be called after construct, when the plugin is attached to a
......
499 503
  /**
500 504
   * Provide a form to edit options for this plugin.
501 505
   */
502
  function options_form(&$form, &$form_state) {
506
  public function options_form(&$form, &$form_state) {
503 507
    // Some form elements belong in a fieldset for presentation, but can't
504 508
    // be moved into one because of the form_state['values'] hierarchy. Those
505 509
    // elements can add a #fieldset => 'fieldset_name' property, and they'll
......
510 514
  /**
511 515
   * Validate the options form.
512 516
   */
513
  function options_validate(&$form, &$form_state) { }
517
  public function options_validate(&$form, &$form_state) {
518
  }
514 519

  
515 520
  /**
516 521
   * Handle any special handling on the validate form.
517 522
   */
518
  function options_submit(&$form, &$form_state) { }
523
  public function options_submit(&$form, &$form_state) {
524
  }
519 525

  
520 526
  /**
521 527
   * Add anything to the query that we might need to.
522 528
   */
523
  function query() { }
529
  public function query() {
530
  }
524 531

  
525 532
  /**
526 533
   * Provide a full list of possible theme templates used by this style.
527 534
   */
528
  function theme_functions() {
535
  public function theme_functions() {
529 536
    if (empty($this->definition['theme'])) {
530 537
      $this->definition['theme'] = 'views_view';
531 538
    }
......
533 540
  }
534 541

  
535 542
  /**
536
   * Provide a list of additional theme functions for the theme information page
543
   * Provide a list of additional theme functions for the theme info page.
537 544
   */
538
  function additional_theme_functions() {
545
  public function additional_theme_functions() {
539 546
    $funcs = array();
540 547
    if (!empty($this->definition['additional themes'])) {
541 548
      foreach ($this->definition['additional themes'] as $theme => $type) {
......
548 555
  /**
549 556
   * Validate that the plugin is correct and can be saved.
550 557
   *
551
   * @return
558
   * @return array
552 559
   *   An array of error strings to tell the user what is wrong with this
553 560
   *   plugin.
554 561
   */
555
  function validate() { return array(); }
562
  public function validate() {
563
    return array();
564
  }
556 565

  
557 566
  /**
558 567
   * Returns the summary of the settings in the display.
559 568
   */
560
  function summary_title() {
569
  public function summary_title() {
561 570
    return t('Settings');
562 571
  }
563 572
  /**
......
565 574
   *
566 575
   * This appears on the ui beside each plugin and beside the settings link.
567 576
   */
568
  function plugin_title() {
577
  public function plugin_title() {
569 578
    if (isset($this->definition['short title'])) {
570 579
      return check_plain($this->definition['short title']);
571 580
    }
572 581
    return check_plain($this->definition['title']);
573 582
  }
583

  
574 584
}
575 585

  
576 586
/**

Formats disponibles : Unified diff