mercoledì 27 luglio 2011

temizzare add comment

1) Per modificare gli input type ad esempio di subject e del bodye togliere l'autore che compare.

 aggiungere su template.php:

function tema_form_alter(&$form, &$form_state, $form_id) {
  switch ($form_id) {
    case 'comment_node_nodetype_form':

$form['subject'] = array(
'#type' => 'textfield',
'#title' => t('Titolo'),);

$form['comment_body'] = array(
'#type' => 'textarea',
'#title' => t('Commento'),);

unset($form['author']);
break;
 }


2) Per togliere la scelta dei filtri e le info. Aggiungere su template.php

 function tema_filter_tips($tips, $long = FALSE, $extra = '') {
  return '';
}
function tema_filter_tips_more_info () {
  return '';
}

3) Per aggiungere la form in un punto del sito:

print drupal_render(drupal_get_form("comment_node_nodetype_form", (object) array('nid' => $nodo)));

dove $nodo è il nid del nodo a cui si vuole aggiungere il commento.

Nessun commento: