Projet

Général

Profil

Révision b433176d

Ajouté par Assos Assos il y a environ 4 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/colorbox/views/colorbox_handler_field_colorbox.inc
9 9
 * A handler to provide a field that is completely custom by the administrator.
10 10
 *
11 11
 * @ingroup views_field_handlers
12
 * @codingStandardsIgnoreStart
12 13
 */
13 14
class colorbox_handler_field_colorbox extends views_handler_field {
14
  function query() {
15
    // Do nothing, as this handler does not need to do anything to the query itself.
15

  
16
  /**
17
   * Query.
18
   *
19
   * @codingStandardsIgnoreEnd
20
   */
21
  public function query() {
22
    // Do nothing, as this handler does not need to do anything to the query
23
    // itself.
16 24
  }
17 25

  
18
  function option_definition() {
26
  /**
27
   * Option definition.
28
   *
29
   * @codingStandardsIgnoreStart
30
   */
31
  public function option_definition() {
32
    // @codingStandardsIgnoreEnd
19 33
    $options = parent::option_definition();
20 34

  
21 35
    $options['trigger_field'] = array('default' => '');
......
29 43
    return $options;
30 44
  }
31 45

  
32
  function options_form(&$form, &$form_state) {
46
  /**
47
   * Options for form.
48
   *
49
   * @codingStandardsIgnoreStart
50
   */
51
  public function options_form(&$form, &$form_state) {
52
    // @codingStandardsIgnoreEnd
33 53
    parent::options_form($form, $form_state);
34 54

  
35
    // Get a list of the available fields and arguments for trigger field and token replacement.
55
    // Get a list of the available fields and arguments for trigger field and
56
    // token replacement.
36 57
    $options = array();
37 58
    $fields = array('trigger_field' => t('- None -'));
38 59
    foreach ($this->view->display_handler->get_handlers('field') as $field => $handler) {
......
44 65

  
45 66
      $fields[$field] = $handler->definition['title'];
46 67
    }
47
    $count = 0; // This lets us prepare the key as we want it printed.
48
    foreach ($this->view->display_handler->get_handlers('argument') as $arg => $handler) {
68
    // This lets us prepare the key as we want it printed.
69
    $count = 0;
70
    foreach ($this->view->display_handler->get_handlers('argument') as $handler) {
49 71
      $options[t('Arguments')]['%' . ++$count] = t('@argument title', array('@argument' => $handler->ui_name()));
50 72
      $options[t('Arguments')]['!' . $count] = t('@argument input', array('@argument' => $handler->ui_name()));
51 73
    }
......
142 164
  /**
143 165
   * Render the trigger field and its linked popup information.
144 166
   */
145
  function render($values) {
167
  public function render($values) {
146 168
    // Load the necessary js file for Colorbox activation.
147 169
    if (_colorbox_active() && !variable_get('colorbox_inline', 0)) {
148 170
      drupal_add_js(drupal_get_path('module', 'colorbox') . '/js/colorbox_inline.js');
......
188 210
      'attributes' => array(
189 211
        'class' => array('colorbox-inline'),
190 212
        'rel' => $gallery_id,
191
      )
213
      ),
192 214
    );
193 215
    // Remove any parameters that aren't set.
194 216
    $link_options['query'] = array_filter($link_options['query']);
......
198 220
    $link_target = isset($values->nid) ? 'node/' . $values->nid : '';
199 221
    $link_tag = l($link_text, $link_target, $link_options);
200 222

  
201
    // The outside div is there to hide all of the divs because if the specific Colorbox
202
    // div is hidden it won't show up as a Colorbox.
223
    // The outside div is there to hide all of the divs because if the specific
224
    // Colorbox div is hidden it won't show up as a Colorbox.
203 225
    return $link_tag . '<div style="display: none;"><div id="colorbox-inline-' . $i . '">' . $popup . '</div></div>';
204 226
  }
227

  
205 228
}

Formats disponibles : Unified diff