Unset webform varible
Grimlock - November 14, 2008 - 01:22
Hello,
I've been trying to unset the webform variable so it won't be available unless a condition is met form my website.
I've successfully created a mini-module that will unset the value of the submit form but I can't unset the whole webform because each webform has the nodeid appened to it e.g. web webform_client_form_111.
Can you please help me use unset or whatever I need to do to remove the webform from rendering?
Here's the code I tried using webfrom alter in a mini-module
<?php
function webform_no_show_form_alter($form_id, &$form) {
global $user;
if (is_array($user->roles) && in_array('User Role', $user->roles)) {
{
unset($webform['$nid']); // I'm lost here!
}
}
}
?>Thanks for your help!
