Projet

Général

Profil

Révision 13c3c9b4

Ajouté par Assos Assos il y a environ 9 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/advanced_forum/plugins/content_types/forum_topic_list.inc
1 1
<?php
2
/**
3
 * @file
4
 * Forum topic list.
5
 */
2 6

  
3 7
/**
4 8
 * Plugins are described by creating a $plugin array which will be used
......
17 21
/**
18 22
 * Render the content.
19 23
 */
20
function advanced_forum_forum_topic_list_content_type_render($subtype, $conf, $panel_args, $context) {
24
function advanced_forum_forum_topic_list_content_type_render(
25
  $subtype,
26
  $conf,
27
  $panel_args,
28
  $context
29
) {
21 30
  if (!empty($context) && empty($context->data)) {
22 31
    return;
23 32
  }
......
26 35
    return;
27 36
  }
28 37

  
29
  if (empty($context)) {
30
    $tid = 0;
31
  }
32
  else {
38
  $tid = 0;
39
  if (!empty($context)) {
33 40
    $tid = $context->data->tid;
34 41
  }
35 42

  
......
37 44
  $block->module = 'forum-secondary-links';
38 45
  $block->delta = $tid;
39 46

  
40
  $block->title = ''; // by default this has no title.
47
  // By default this has no title.
48
  $block->title = '';
41 49
  _advanced_forum_add_files();
42 50

  
43 51
  // TODO: We could make these settings, but they're ignored if it isusing
......
45 53
  $forum_per_page = variable_get('forum_per_page', 25);
46 54
  $sortby = variable_get('forum_order', 1);
47 55

  
48
  $block->content = advanced_forum_get_topics($tid, $sortby, $forum_per_page, !empty($conf['show_sort']));
56
  $block->content = advanced_forum_get_topics(
57
    $tid,
58
    $sortby,
59
    $forum_per_page,
60
    !empty($conf['show_sort'])
61
  );
49 62

  
50 63
  return $block;
51 64
}
......
53 66
/**
54 67
 * Returns an edit form for the custom type.
55 68
 */
56
function advanced_forum_forum_topic_list_content_type_edit_form($form, &$form_state) {
69
function advanced_forum_forum_topic_list_content_type_edit_form(
70
  $form,
71
  &$form_state
72
) {
57 73
  $conf = $form_state['conf'];
58 74
  $form['show_sort'] = array(
59 75
    '#type' => 'checkbox',
60 76
    '#title' => t('Show sort form'),
61
    '#description' => t('If checked the sort form will appear at the top of the table. Uncheck this if you wish it to appear in a separate pane.'),
77
    '#description' => t(
78
      'If checked the sort form will appear at the top of the table. Uncheck this if you wish it to appear in a separate pane.'
79
    ),
62 80
    '#default_value' => !empty($conf['show_sort']),
63 81
  );
64 82

  
65 83
  return $form;
66 84
}
67 85

  
68
function advanced_forum_forum_topic_list_content_type_edit_form_submit($form, &$form_state) {
86
/**
87
 * Submit callback.
88
 */
89
function advanced_forum_forum_topic_list_content_type_edit_form_submit(
90
  $form,
91
  &$form_state
92
) {
69 93
  // Copy everything from our defaults.
70 94
  foreach (array_keys($form_state['plugin']['defaults']) as $key) {
71 95
    $form_state['conf'][$key] = $form_state['values'][$key];
72 96
  }
73 97
}
74 98

  
75
function advanced_forum_forum_topic_list_content_type_admin_title($subtype, $conf, $context) {
99
/**
100
 * Callback for admin title.
101
 */
102
function advanced_forum_forum_topic_list_content_type_admin_title(
103
  $subtype,
104
  $conf,
105
  $context
106
) {
76 107
  return t('"@s" topic list', array('@s' => $context->identifier));
77 108
}

Formats disponibles : Unified diff