mediatribe.net -- Drupal et développement web

Notice: this post was last updated Il y a 1 year 3 weeks so it might be outdated. Please be cautious before implementing any of suggestions herein.

Reply to comment

Creating actions for use with views bulk operations

You can combine Views bulk operations with your own code to make powerful actions which can be applied to several nodes at the time.

Here is some sample code to create an action:

  /* describe your action(s) */
function mymodule_action_info() {
  return array(
    'mymodule_action_callback' => array(
       'type' => 'node',
       'description' => t('My action description.'),
       'configurable' => FALSE,
      )
    );
}

function mymodule_action_callback(&$node, $context) {
 
  /* do something with your node here */

  node_save($node);
}

Reply

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h3>
  • Lines and paragraphs break automatically.
  • Vous pouvez publier du code en utilisant les balises <code>...</code> (generic) ou bien <?php ... ?> (PHP colorié).

More information about formatting options

Image CAPTCHA
Enter the characters shown in the image.