I have created a new module. The request comes against this module is 'newsite/menu/370'. I have also used OG modules. The new group is formed with this nid '370'. Now I am to give the 5 to 6 options to the user....
1, create blog
2, create story
etc.............
I want to show these option as collapsible links, the regarding form will be collapsed after clicking on each link. I want to create separate form functions for each link and then validation and submission.
But I am not getting understand how could I do this. The nid '370' will be used as reference for each link/form.
I have put the code for better understanding and ..........
$items[] = array(
'path' => 'newsite/menu',
'title' => t('My Menu'),
'callback' => 'drupal_get_form',
'callback arguments' => array('newsite_all'),
'access' => TRUE,
'type' => MENU_CALLBACK,
);
return $items;
//***********************************************************************//
function newsite_all($gid = NULL){
global $user;
$gids = $gid;
$blog_form = newsite_blog_form($gids);
return $blog_form;
}
//************************************************************************//
function newsite_blog_form($gid){
I'm just putting together a module that has a multiple select as part of the form.
Maybe I'm just being stupid today but I can't find anything that tells me what the format of the form default value should be, I've tried the obvious which doesn't seem to be working.
I want to call function say xyz() on click of primary link(which i have set in admin).
In admin i have set path to "/taxonomy/list-cat". am able to visible the links in header section but not able to invoke the function that i have written.
I have created a new module almost like the OG module. In this new module, I have put the code from OG module for 'Audience'. It is showing now fine in this new module but when I submit the form in this new module with blank value of the audience, it does not show me the 'Error Msg'.
I have taken this code from OG module and put it in the new module.
$required = variable_get('og_audience_required', 0) && !user_access('administer nodes');
drupal_set_message(t('It is the value of the REQUIRED.............'.$required));
if (user_access('administer nodes')) {
$options = og_all_groups_options();
}
else {
$subs = og_get_subscriptions($user->uid); //changed
foreach ($subs as $key => $val) {
$options[$key] = $val['title'];
}
}
$vis = variable_get('og_visibility', 0);
if (user_access('administer organic groups') && $vis < 2) {
$vis = $vis == OG_VISIBLE_GROUPONLY ? OG_VISIBLE_CHOOSE_PRIVATE : OG_VISIBLE_CHOOSE_PUBLIC;
}
elseif (!count($options)) {
// don't show checkbox if no subscriptions. must be public.
$vis = OG_VISIBLE_BOTH;
}
switch ($vis) {
case OG_VISIBLE_BOTH:
$form['newsite_blog']['og_public'] = array('#type' => 'value', '#value' => 1);
break;
case OG_VISIBLE_GROUPONLY:
Maybe this exists already? It seems to me that at least all of the pieces are there and, if I knew more about PHP and Drupal, I could put the pieces together in the right way. If anyone can help me out with this, that would be cool!