1 |
85ad3d82
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* Plugins are described by creating a $plugin array which will be used
|
5 |
|
|
* by the system that includes this file.
|
6 |
|
|
*/
|
7 |
|
|
$plugin = array(
|
8 |
|
|
'single' => TRUE,
|
9 |
|
|
'icon' => 'icon_panelizer_form.png',
|
10 |
|
|
'title' => t('Panelizer form default settings'),
|
11 |
|
|
'description' => t('Panelizer default options on the Node form.'),
|
12 |
|
|
'required context' => new ctools_context_required(t('Form'), 'node_form'),
|
13 |
|
|
'category' => t('Form'),
|
14 |
|
|
);
|
15 |
|
|
|
16 |
|
|
|
17 |
|
|
function panelizer_panelizer_form_default_content_type_render($subtype, $conf, $panel_args, &$context) {
|
18 |
|
|
$block = new stdClass();
|
19 |
|
|
$block->module = t('node_form');
|
20 |
|
|
|
21 |
|
|
$block->title = t('Panelizer defaults');
|
22 |
|
|
$block->delta = 'panelizer-default';
|
23 |
|
|
|
24 |
|
|
if (isset($context->form)) {
|
25 |
|
|
if (isset($context->form['panelizer'])) {
|
26 |
|
|
$block->content['panelizer'] = $context->form['panelizer'];
|
27 |
|
|
unset($block->content['panelizer']['#pre_render']);
|
28 |
|
|
unset($block->content['panelizer']['#theme_wrappers']);
|
29 |
|
|
$block->content['panelizer']['#type'] = '';
|
30 |
|
|
if (isset($block->content['panelizer']['path']['#size'])) {
|
31 |
|
|
$block->content['panelizer']['path']['#size'] /= 2;
|
32 |
|
|
}
|
33 |
|
|
|
34 |
|
|
// Set access to false on the original rather than removing so that
|
35 |
|
|
// vertical tabs doesn't clone it. I think this is due to references.
|
36 |
|
|
$context->form['panelizer']['#access'] = FALSE;
|
37 |
|
|
}
|
38 |
|
|
}
|
39 |
|
|
else {
|
40 |
|
|
$block->content = t('Panelizer default options.');
|
41 |
|
|
}
|
42 |
|
|
return $block;
|
43 |
|
|
}
|
44 |
|
|
|
45 |
|
|
function ctools_panelizer_form_default_content_type_admin_title($subtype, $conf, $context) {
|
46 |
|
|
return t('"@s" Panelizer form default options', array('@s' => $context->identifier));
|
47 |
|
|
}
|
48 |
|
|
|
49 |
|
|
function ctools_panelizer_form_default_content_type_edit_form($form, &$form_state) {
|
50 |
|
|
// provide a blank form so we have a place to have context setting.
|
51 |
|
|
return $form;
|
52 |
|
|
} |