Révision c304a780
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/ctools/plugins/content_types/block/block.inc | ||
---|---|---|
51 | 51 |
if ($module_blocks) { |
52 | 52 |
foreach ($module_blocks as $delta => $block) { |
53 | 53 |
$info = _ctools_block_content_type_content_type($module, $delta, $block); |
54 |
// this check means modules can remove their blocks; particularly useful
|
|
54 |
// This check means modules can remove their blocks; particularly useful
|
|
55 | 55 |
// if they offer the block some other way (like we do for views) |
56 | 56 |
if ($info) { |
57 | 57 |
$types["$module-$delta"] = $info; |
... | ... | |
168 | 168 |
if ($module == 'block' && !empty($info) && isset($info->title)) { |
169 | 169 |
$block->title = $info->title; |
170 | 170 |
} |
171 |
else if (isset($block->subject)) {
|
|
171 |
elseif (isset($block->subject)) { |
|
172 | 172 |
$block->title = $block->subject; |
173 | 173 |
} |
174 | 174 |
else { |
... | ... | |
208 | 208 |
} |
209 | 209 |
} |
210 | 210 |
|
211 |
/** |
|
212 |
* Returns an edit form for a block. |
|
213 |
*/ |
|
214 |
//function ctools_block_content_type_edit_form($id, $parents, $conf) { |
|
215 |
// if (user_access('administer advanced pane settings')) { |
|
216 |
// $form['block_visibility'] = array( |
|
217 |
// '#type' => 'checkbox', |
|
218 |
// '#title' => t('Use block visibility settings (see block config)'), |
|
219 |
// '#default_value' => !empty($conf['block_visibility']), |
|
220 |
// '#description' => t('If checked, the block visibility settings for this block will apply to this block.'), |
|
221 |
// ); |
|
222 |
// // Module-specific block configurations. |
|
223 |
// if ($settings = module_invoke($module, 'block', 'configure', $delta)) { |
|
224 |
// // Specifically modify a couple of core block forms. |
|
225 |
// if ($module == 'block') { |
|
226 |
// unset($settings['submit']); |
|
227 |
// $settings['info']['#type'] = 'value'; |
|
228 |
// $settings['info']['#value'] = $settings['info']['#default_value']; |
|
229 |
// } |
|
230 |
// ctools_admin_fix_block_tree($settings); |
|
231 |
// $form['block_settings'] = array( |
|
232 |
// '#type' => 'fieldset', |
|
233 |
// '#title' => t('Block settings'), |
|
234 |
// '#description' => t('Settings in this section are global and are for all blocks of this type, anywhere in the system.'), |
|
235 |
// '#tree' => FALSE, |
|
236 |
// ); |
|
237 |
// |
|
238 |
// |
|
239 |
// $form['block_settings'] += $settings; |
|
240 |
// } |
|
241 |
// } |
|
242 |
// |
|
243 |
// return $form; |
|
244 |
//} |
|
245 |
|
|
246 |
//function ctools_admin_submit_block(&$form_values) { |
|
247 |
// if (!empty($form_values['block_settings'])) { |
|
248 |
// module_invoke($form_values['module'], 'block', 'save', $form_values['delta'], $form_values['block_settings']); |
|
249 |
// } |
|
250 |
//} |
|
251 |
// |
|
252 |
///** |
|
253 |
// * Because form api cannot collapse just part of a tree, and the block settings |
|
254 |
// * assume no tree, we have to collapse the tree ourselves. |
|
255 |
// */ |
|
256 |
//function ctools_admin_fix_block_tree(&$form, $key = NULL) { |
|
257 |
// if ($key) { |
|
258 |
// if (!empty($form['#parents'])) { |
|
259 |
// $form['#parents'] = array_merge(array('configuration', 'block_settings'), $form['#parents']); |
|
260 |
// } |
|
261 |
// else if (empty($form['#tree'])) { |
|
262 |
// $form['#parents'] = array('configuration', 'block_settings', $key); |
|
263 |
// } |
|
264 |
// } |
|
265 |
// |
|
266 |
// if (isset($form['#type']) && $form['#type'] == 'textarea' && !empty($form['#rows']) && $form['#rows'] > 10) { |
|
267 |
// $form['#rows'] = 10; |
|
268 |
// } |
|
269 |
// |
|
270 |
// foreach (element_children($form) as $key) { |
|
271 |
// ctools_admin_fix_block_tree($form[$key], $key); |
|
272 |
// } |
|
273 |
//} |
|
274 |
|
|
275 | 211 |
/** |
276 | 212 |
* Returns the administrative title for a type. |
277 | 213 |
*/ |
... | ... | |
338 | 274 |
} |
339 | 275 |
} |
340 | 276 |
|
341 |
// These are all on behalf of modules that don't implement ctools but that |
|
342 |
// we care about. |
|
277 |
/** |
|
278 |
* These are all on behalf of modules that don't implement ctools but that |
|
279 |
* we care about. |
|
280 |
*/ |
|
343 | 281 |
function menu_ctools_block_info($module, $delta, &$info) { |
344 | 282 |
$info['icon'] = 'icon_core_block_menu.png'; |
345 | 283 |
$info['category'] = t('Menus'); |
... | ... | |
360 | 298 |
break; |
361 | 299 |
|
362 | 300 |
default: |
363 |
// safety net
|
|
301 |
// Safety net.
|
|
364 | 302 |
ctools_default_block_info($module, $delta, $info); |
365 | 303 |
} |
366 | 304 |
} |
... | ... | |
455 | 393 |
break; |
456 | 394 |
|
457 | 395 |
default: |
458 |
// safety net
|
|
396 |
// Safety net.
|
|
459 | 397 |
ctools_default_block_info($module, $delta, $info); |
460 | 398 |
} |
461 | 399 |
} |
... | ... | |
508 | 446 |
return; |
509 | 447 |
} |
510 | 448 |
|
511 |
$info = new stdClass; |
|
449 |
$info = new stdClass();
|
|
512 | 450 |
$info->module = $module; |
513 | 451 |
$info->delta = $delta; |
514 | 452 |
|
... | ... | |
537 | 475 |
if ($module == 'block') { |
538 | 476 |
$block->title = $info->title; |
539 | 477 |
} |
540 |
else if (isset($block->subject)) {
|
|
478 |
elseif (isset($block->subject)) { |
|
541 | 479 |
$block->title = $block->subject; |
542 | 480 |
} |
543 | 481 |
else { |
Formats disponibles : Unified diff
Weekly update of contrib modules