HELP!! drupal_get_form()

I have come up with a small module that helps me to customize the local menu tabs a bit. My objective is to redirect an anonymous user to the login page when the link is clicked. The registered users should be able to see the review add form.

Here are the steps.

1) The menu_alter was modified with following:

function remove_tab_menu_alter(&$items) {
 
  $items['node/%node_add_review/addreview']['page callback'] = 'remove_tab_addreview_load';
 
}

2) The callback function was added in the same module:

function remove_tab_addreview_load() {
  global $user;
  if (arg(0) == 'node' && is_numeric(arg(1))) {
     $node = node_load(arg(1));
   }
 
  if ($user->uid) {
     return drupal_get_form('nodereview_node_form');
  }
  else{
   return drupal_goto('user','destination=node/'.urlencode($node->nid) .'/addreview');
  }
 
  drupal_not_found();
}

3) Template.php with some add review form customization:


function analytic_nodereview_node_form($form) {
$form['teaser']['#title']='Описание';

$form['title']['#access'] = false;
$form['title']['#required'] = FALSE;

unset($form['teaser']['#description']);
unset($form['filter']);
unset($form['buttons']['preview']);

$form['buttons']['submit']['#prefix'] = '

';

Drupal as SaaS? any conflict with the GNU GPL?

Hi,

I've developped a web based portal using drupal with my own modules and I'm thinking of making a profit out of it... but I dont want to be in conflict with the GNU GPL... so this is my idea :
-hosting th web site myself (and keep the code for me) and giving access to users for a monthly fee for exemple...

Is that ok with the GPL? or do I have to give up all the source code to my "clients" ?

thanks !!!
++

how to create home page on my website?

how to create home page on my website?

thank very much...

Edited by WorldFallz - moved to appropriate forum.

Which addons? - Making site for freelancers (like oDesk)

Hello, I have an idea to make a web with adverts - as you can see on many freelancers sites.

Who can help me to find best addons and mods to create a portal like that?

Paying 20$, by PayPal.

Contact mail: rasquer@o2.pl

Stripping code will increase performance and save space - example

Hello everyone.

Here is a simple Linux script which must be run in your website root to remove a lot of unused junk in your Drupal installation.
This will make your site a bit faster and in my case it saved me 2MB of webspace. Don't forget to backup first!

Script:

D7 Export/import content type and content from/to head

Hi,

I'm trying content and content type from an older version of drupal 7 head (17/11/09) to the latest version.

Is there an easy way to do this?

Thank you.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x