function panels_context_node_edit_form_settings_form in Panels 6.2
Same name and namespace in other branches
- 5.2 contexts/node_edit_form.inc \panels_context_node_edit_form_settings_form()
1 string reference to 'panels_context_node_edit_form_settings_form'
- panels_node_edit_form_panels_contexts in contexts/
node_edit_form.inc - @file contexts/node_edit_form.inc
File
- contexts/
node_edit_form.inc, line 66 - contexts/node_edit_form.inc
Code
function panels_context_node_edit_form_settings_form($conf, $external = FALSE) {
if ($external) {
$form['external'] = array(
'#type' => 'checkbox',
'#default_value' => $conf['external'],
'#title' => t('Require this context from an external source (such as a containing panel page).'),
'#description' => t('If selected, node selection (below) will be ignored.'),
);
}
$form['node'] = array(
'#prefix' => '<div class="no-float">',
'#suffix' => '</div>',
'#title' => t('Enter the title or NID of a post'),
'#type' => 'textfield',
'#maxlength' => 512,
'#autocomplete_path' => 'panels/node/autocomplete',
'#weight' => -10,
);
if (!empty($conf['nid'])) {
$info = db_fetch_object(db_query("SELECT * FROM {node} WHERE nid = %d", $conf['nid']));
if ($info) {
$link = l(t("'%title' [node id %nid]", array(
'%title' => $info->title,
'%nid' => $info->nid,
)), "node/{$info->nid}", array(
'target' => '_blank',
'title' => t('Open in new window'),
));
$form['node']['#description'] = t('Currently set to !link', array(
'!link' => $link,
));
}
}
$form['nid'] = array(
'#type' => 'value',
'#value' => $conf['nid'],
);
$form['external'] = array(
'#type' => 'value',
'#value' => $external,
);
return $form;
}