How to change my custom module to print an array in the given format on submitting the data in my custom form in Drupal 6?
['Authentic user']=array(
['edit']=>true;
['read']=>false;
}
My custom module code is:
<?php
/**
* @file
* Role user add
*
* This is acustom module to add users from roles
*/
/*
* Implementation of hook_form_alter()
*/
function roleuseradd_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'user_admin_new_role' || $form_id == 'user_admin_account'||$form_id == 'user_profile_form') {
$form['#submit'][] = 'roleuseradd_rid_submit';
}
}
function roleuseradd_rid_submit($form, &$form_state){
//print_r($form_state['values']['name']);exit();
$role_name = $form_state['values']['name'];
db_set_active('mediawiki');
$sql="INSERT into wiki_user_groups(ug_group) VALUES ('$role_name')";
db_query($sql);
//Switch back to the default connection when finished.
db_set_active('default');
drupal_set_message(t('The queries have been made.'));
}
/**Implements hook_menu to create a form for adding wiki permissions
*/
function roleuseradd_menu() {
$items = array();
$items['admin/wikisetting'] = array(
'title' => 'Drupal wiki form',
'page callback' => 'drupal_get_form',
'page arguments' => array('roleuseradd_form'),
'access arguments' => array('access content'),