Révision 5a7e6170
Ajouté par Florent Torregrosa il y a environ 10 ans
drupal7/sites/all/modules/panels/panels_mini/panels_mini.module | ||
---|---|---|
130 | 130 |
*/ |
131 | 131 |
function panels_mini_block_configure($delta = 0) { |
132 | 132 |
return array( |
133 |
'admin-shortcut' => array(
|
|
134 |
'#value' => l(t('Manage this mini-panel'), 'admin/structure/mini-panels/' . $delta . '/edit')
|
|
133 |
'admin_shortcut' => array(
|
|
134 |
'#markup' => l(t('Manage this mini-panel'), 'admin/structure/mini-panels/list/' . $delta . '/edit')
|
|
135 | 135 |
), |
136 | 136 |
); |
137 | 137 |
} |
... | ... | |
178 | 178 |
} |
179 | 179 |
} |
180 | 180 |
|
181 |
/** |
|
182 |
* Implements hook_get_pane_links_alter(). |
|
183 |
*/ |
|
184 |
function panels_mini_get_pane_links_alter(&$links, $pane, $content_type) { |
|
185 |
if ($pane->type == 'panels_mini') { |
|
186 |
$links['top']['edit_panels_mini'] = array( |
|
187 |
'title' => t('Edit mini panel'), |
|
188 |
'href' => url('admin/structure/mini-panels/list/' . $pane->subtype . '/edit/content', array('absolute' => TRUE)), |
|
189 |
'attributes' => array('target' => array('_blank')), |
|
190 |
); |
|
191 |
} |
|
192 |
} |
|
193 |
|
|
194 |
/** |
|
195 |
* Implements hook_contextual_links_view_alter(). |
|
196 |
*/ |
|
197 |
function panels_mini_contextual_links_view_alter(&$element, $items) { |
|
198 |
|
|
199 |
// Add contextual links to all mini panel blocks. |
|
200 |
if (isset($element['#element']['#block']) && strpos((string) $element['#element']['#block']->bid, 'panels_mini') === 0) { |
|
201 |
|
|
202 |
$admin_pages = array( |
|
203 |
t('Configure mini panel settings') => 'basic', |
|
204 |
t('Configure mini panel context') => 'context', |
|
205 |
t('Configure mini panel layout') => 'layout', |
|
206 |
t('Configure mini panel content') => 'content', |
|
207 |
); |
|
208 |
|
|
209 |
foreach ($admin_pages as $title => $tail) { |
|
210 |
$element['#links']['mini-panels-' . $tail] = array( |
|
211 |
'title' => $title, |
|
212 |
'href' => 'admin/structure/mini-panels/list/' . $element['#element']['#block']->delta . '/edit/' . $tail, |
|
213 |
'query' => drupal_get_destination(), |
|
214 |
); |
|
215 |
} |
|
216 |
} |
|
217 |
} |
|
218 |
|
|
181 | 219 |
/** |
182 | 220 |
* Statically store all used IDs to ensure all mini panels get a unique id. |
183 | 221 |
*/ |
... | ... | |
285 | 323 |
} |
286 | 324 |
} |
287 | 325 |
|
288 |
return $cache; |
|
326 |
// Strip out NULL entries that may have been added by panels_mini_load(). |
|
327 |
return array_filter($cache); |
|
289 | 328 |
} |
290 | 329 |
|
291 | 330 |
/** |
Formats disponibles : Unified diff
Update :