Commit c964a719 authored by Matthias Hutterer's avatar Matthias Hutterer
Browse files

added 'sortable' to db definitions, support for content permissions in

contact forms
parent cf887375
...@@ -29,7 +29,7 @@ function email_theme() { ...@@ -29,7 +29,7 @@ function email_theme() {
function email_field_info() { function email_field_info() {
return array( return array(
'email' => array( 'email' => array(
'label' => 'E-Mail', 'label' => 'Email',
'callbacks' => array( 'callbacks' => array(
'tables' => CONTENT_CALLBACK_DEFAULT, 'tables' => CONTENT_CALLBACK_DEFAULT,
'arguments' => CONTENT_CALLBACK_DEFAULT, 'arguments' => CONTENT_CALLBACK_DEFAULT,
...@@ -45,7 +45,7 @@ function email_field_info() { ...@@ -45,7 +45,7 @@ function email_field_info() {
function email_field_settings($op, $field) { function email_field_settings($op, $field) {
switch ($op) { switch ($op) {
case 'database columns': case 'database columns':
$columns['email'] = array('type' => 'varchar', 'length' => 255, 'not null' => FALSE); $columns['email'] = array('type' => 'varchar', 'length' => 255, 'not null' => FALSE, 'sortable' => TRUE);
return $columns; return $columns;
} }
} }
...@@ -224,6 +224,7 @@ function email_textfield_process($element, $edit, $form_state, $form) { ...@@ -224,6 +224,7 @@ function email_textfield_process($element, $edit, $form_state, $form) {
'#description' => t($field['widget']['description']), '#description' => t($field['widget']['description']),
'#required' => $element['#required'], '#required' => $element['#required'],
'#maxlength' => 255, '#maxlength' => 255,
'#size' => isset($field['widget']['size']) ? $field['widget']['size'] : 60,
'#default_value' => isset($element['#value'][$field_key]) ? $element['#value'][$field_key] : NULL, '#default_value' => isset($element['#value'][$field_key]) ? $element['#value'][$field_key] : NULL,
); );
return $element; return $element;
...@@ -260,6 +261,12 @@ function email_mail_page($nid, $field_name) { ...@@ -260,6 +261,12 @@ function email_mail_page($nid, $field_name) {
drupal_not_found(); drupal_not_found();
return; return;
} }
if (module_exists('content_permissions')) {
if (!user_access('view '. $field_name)) {
drupal_not_found();
return;
}
}
$node = node_load(intval($nid)); $node = node_load(intval($nid));
if (!$node) { if (!$node) {
drupal_not_found(); drupal_not_found();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment