Field set and accessing return variable (newbie que)

Hi

I have a form in my module which includes the following segment:

 $form['evalform']= array(
   '#type' => 'fieldset',
   '#title' => t('Evaluation fields:'),
   '#tree' => TRUE,
   '#collapsible' => TRUE,
  );
  $form['evalform']['principles_rating'] = array(
    '#type' => 'radios',
    '#title' => t('Principles rating'),
    '#default_value' =>   $node->principles_rating,
    '#options' => $ratingbuttons,
    '#description' => t('Principles rating description'),
  );

when it comes time to insert I user var_dump($node) to check the values and things are fine except that
there is level issue which I just don't understand yet. What I mean is that 'principles_rating' cannot be accessed via $node->principles_rating because its inside an array called 'evalform'. The var_dump gives:

object(stdClass)(23) { ["nid"]=> int(20) ["vid"]=> int(20) ["uid"]=> string(1) "1" ["created"]=> int(1137046448) ["changed"]=> int(1137046448) ["type"]=> string(21) "fhsstadmin-evaluation" ["evalcontentdiv"]=> array(1) { ["pagecontent"]=> string(0) "" } ["evalform"]=> array(5) { ["principles_rating"]=> string(1) "2" ... ["validated"]=> bool(true) ["is_new"]=> bool(true) }

How do I actually access the value in my insert fucntion, i.e. what do I need to change in:


db_query("INSERT INTO {fhsstadmin}_mediation (nid,
uid,

Questions regarding acidfree and drupal 4.7 with apache2 and php5

Hi,

I think I must be retarded or something because i can't seem to figure this out. I have installed drupal 4.7 I am running apache2 and php5. I am trying to get acidfree to work but it is telling me that I dont have my image toolkit installed. I recompiled php to include gd2 there were no errors and it seems fine. What am I missing?

Thanks for any help

nodeapi_example in HEAD isn't 4.7 compatible is it?

Hi

I am trying to implement exactly this idea of extending an existing node:

http://drupaldocs.org/api/head/function/nodeapi_example_nodeapi

but on 4.7.0-beta3. For some reason (my lack of understand ;) I cannot get the values back to store in my database.
I post a question about my code in http://drupal.org/node/44352 before discovering the example above.

themeing user registration (NOT profile)

Hi,

I am trying to theme the user registration page (username, email, submit...www.mysite/user/register) and was hoping to create a thread on themeing the user reg page w/out re-writing the user.module hook for displaying the form.

Any ideas?

Adding a field to a node and storing its value

Hi

I am using 4.7.0-beta3 and I want to add another textfield to other nodes, say "page", then add to the edit form and save it into a table I created. I think it should be pretty simple but I've missed something and would really appreciate an expert looking over it quickly - should be obvious.

I use nodeapi and form_alter hooks as I understand it - the field I want is a syllabus field for a page so I have done the following:

function fhsstadmin_form_alter($form_id, &$form) {
if (isset($form['type'])) {
$node = $form['#node'];

if ($form['type']['#value'] .'_node_settings' == $form_id) {
$form['fhsstadmin'] = array('#type' => 'fieldset', '#title' => t('Syllabus'));
$form['fhsstadmin']['fhsstadmin_options_'. $form['type']['#value']] = array(
'#type' => 'radios',
'#title' => t('Syllabus'),
'#default_value' => variable_get('fhsstadmin_options_'. $form['type']['#value'], 1),
'#options' => array(t('Disabled'), t('Enabled')),
'#description' => t('Choose whether syllabus should be shown or not.')
);
}

if ($form['type']['#value'] .'_node_form' == $form_id && variable_get('fhsstadmin_options_'. $node->type, 1)) {
$form['fhsstadmin_syllabus'] = array(
'#type' => 'textarea',
'#title' => t('Syllabus'),
'#default_value' => $node->syllabus,
'#cols' => 60,

DATABASE URL..

I don't know what to put in this line _> $db_url = 'mysql://username:password@localhost/databasename';
what to change. do I need it to change? will I change the username and the password base on the username and password of my mysql?

Pages

Subscribe with RSS Subscribe to RSS - Drupal 4.7.x