1)给某种类型的节点 定义一个表单 function upload_jiangyi_form(&$form_state, $node) { global $user; $node = (object)$node; $form['nid'] = array( '#type' => 'hidden', '#default_value' => $node->nid, ); // Set the id of the top-level form tag $form['#id'] = 'node-form';
// Basic node information. // These elements are just values so they are not even sent to the client.
// Changed must be sent to the client, for later overwrite error checking.
This is quite straightforward with user_roles() and array_search(). Below is a function which will return the role ID if there is a role matching the name and FALSE otherwise.