Projet

Général

Profil

Révision 5a7e6170

Ajouté par Florent Torregrosa il y a environ 10 ans

Update :

  • panels : 7.x-3.3 -> 7.x-3.4
  • pdf_reader : 7.x-1.0-rc4 -> 7.x-1.0-rc5

Voir les différences:

drupal7/sites/all/modules/panels/panels_ipe/panels_ipe.module
73 73
  return $output;
74 74
}
75 75

  
76
function theme_panels_ipe_pane_wrapper($vars) {
77
  $output = $vars['output'];
76
function template_preprocess_panels_ipe_pane_wrapper(&$vars) {
78 77
  $pane = $vars['pane'];
79 78
  $display = $vars['display'];
80 79
  $renderer = $vars['renderer'];
81 80

  
82 81
  $content_type = ctools_get_content_type($pane->type);
83 82
  $subtype = ctools_content_get_subtype($content_type, $pane->subtype);
84
  $links = array();
83
  $vars['links'] = array();
85 84

  
86 85
  if (ctools_content_editable($content_type, $subtype, $pane->configuration)) {
87
    $links['edit'] = array(
86
    $vars['links']['edit'] = array(
88 87
      'title' => isset($content_type['edit text']) ? '<span>' . $content_type['edit text'] . '</span>' : '<span>' . t('Settings') . '</span>',
89 88
      'href' => $renderer->get_url('edit-pane', $pane->pid),
90 89
      'html' => TRUE,
......
98 97

  
99 98
  // Add option to configure style in IPE
100 99
  if (user_access('administer panels styles')) {
101
    $links['style'] = array(
100
    $vars['links']['style'] = array(
102 101
      'title' => '<span>' . t('Style') . '</span>',
103 102
      'href' => $renderer->get_url('style-type', 'pane', $pane->pid),
104 103
      'html' => TRUE,
......
111 110

  
112 111
  // Deleting is managed entirely in the js; this is just an attachment point
113 112
  // for it
114
  $links['delete'] = array(
113
  $vars['links']['delete'] = array(
115 114
    'title' => '<span>' . t('Delete') . '</span>',
116 115
    'href' => '#',
117 116
    'html' => TRUE,
......
122 121
    ),
123 122
  );
124 123

  
124
  $context = array(
125
    'pane' => $pane,
126
    'display' => $display,
127
    'renderer' => $renderer
128
  );
129
  drupal_alter('panels_ipe_pane_links', $vars['links'], $context);
130

  
131
}
132

  
133
function theme_panels_ipe_pane_wrapper($vars) {
134
  $output = $vars['output'];
135
  $pane = $vars['pane'];
136

  
125 137
  $attributes = array(
126 138
    'class' => 'panels-ipe-linkbar',
127 139
  );
128 140

  
129
  $links = theme('links', array('links' => $links, 'attributes' => $attributes));
141
  $links = theme('links', array('links' => $vars['links'], 'attributes' => $attributes));
142

  
130 143
  if (!empty($pane->locks['type']) && $pane->locks['type'] == 'immovable') {
131 144
    $links = '<div class="panels-ipe-dragbar panels-ipe-nodraghandle clearfix">' . $links . '</div>';
132 145
  }
......
135 148
  }
136 149

  
137 150
  $handlebar = '<div class="panels-ipe-handlebar-wrapper panels-ipe-on">' . $links . '</div>';
151

  
138 152
  return $handlebar . $output;
139 153
}
140 154

  
......
142 156
  return $vars['controls'] . $vars['output'];
143 157
}
144 158

  
145
function theme_panels_ipe_add_pane_button($vars) {
159
function template_preprocess_panels_ipe_add_pane_button(&$vars) {
146 160
  $region_id = $vars['region_id'];
147 161
  $display = $vars['display'];
148 162
  $renderer = $vars['renderer'];
149
  $link = '';
163
  $vars['links'] = '';
150 164

  
151 165
  // Add option to configure style in IPE
152 166
  if (user_access('administer panels styles')) {
153
    $link .= ' ' . l('<span>' . t('Region style') . '</span>', $renderer->get_url('style-type', 'region', $region_id), array(
167
    $vars['links']['style'] = array(
168
      'title' => '<span>' . t('Region style') . '</span>',
169
      'href' => $renderer->get_url('style-type', 'region', $region_id),
170
      'html' => TRUE,
154 171
      'attributes' => array(
155
        'class' => array('ctools-use-modal', 'style', 'panels-ipe-hide-bar'),
172
        'class' => array('ctools-use-modal', 'panels-ipe-hide-bar', 'style'),
156 173
        'title' => t('Region style'),
157 174
      ),
158
      'html' => TRUE,
159
    ));
175
    );
160 176
  }
161 177

  
162 178
  // Add option to add items in the IPE
163
  $link .= ' ' . l('<span>' . t('Add new pane') . '</span>', $renderer->get_url('select-content', $region_id), array(
164
      'attributes' => array(
165
        'class' => array('ctools-use-modal', 'add', 'panels-ipe-hide-bar'),
166
        'title' => t('Add new pane'),
167
      ),
168
      'html' => TRUE,
169
  ));
179
  $vars['links']['add-pane'] = array(
180
    'title' => '<span>' . t('Add new pane') . '</span>',
181
    'href' => $renderer->get_url('select-content', $region_id),
182
    'attributes' => array(
183
      'class' => array('ctools-use-modal', 'add', 'panels-ipe-hide-bar'),
184
      'title' => t('Add new pane'),
185
    ),
186
    'html' => TRUE,
187
  );
188

  
189
  $context = array(
190
    'region_id' => $region_id,
191
    'display' => $display,
192
    'renderer' => $renderer,
193
  );
194
  drupal_alter('panels_ipe_region_links', $vars['links'], $context);
195

  
196
}
197

  
198
function theme_panels_ipe_add_pane_button($vars) {
199
  $attributes = array(
200
    'class' => array('panels-ipe-linkbar', 'inline'),
201
  );
202

  
203
  $links = theme('links', array('links' => $vars['links'], 'attributes' => $attributes));
170 204

  
171
  return '<div class="panels-ipe-newblock panels-ipe-on">' . $link . '</div>';
205
  return '<div class="panels-ipe-newblock panels-ipe-on">' . $links . '</div>';
172 206
}
173 207

  
174 208
/**

Formats disponibles : Unified diff