Loading custom_pub.module +23 −0 Original line number Diff line number Diff line Loading @@ -691,3 +691,26 @@ function custom_pub_fasttoggle_available_links($type = NULL, $obj = NULL) { return $result; } /** * Allow devel_generate module to setup "Custom Publishing Options" randomly. * * Implements hook_node_presave(). * * @param $node */ function custom_pub_node_presave($node) { if (module_exists('devel_generate') && isset($node->devel_generate)) { $types = custom_pub_by_node_type($node); if (count($types)) { $types = array_keys($types); foreach ($types as $machine_name) { if (isset($node->{$machine_name})) { $node->{$machine_name} = mt_rand(0, 1); } } } } } Loading
custom_pub.module +23 −0 Original line number Diff line number Diff line Loading @@ -691,3 +691,26 @@ function custom_pub_fasttoggle_available_links($type = NULL, $obj = NULL) { return $result; } /** * Allow devel_generate module to setup "Custom Publishing Options" randomly. * * Implements hook_node_presave(). * * @param $node */ function custom_pub_node_presave($node) { if (module_exists('devel_generate') && isset($node->devel_generate)) { $types = custom_pub_by_node_type($node); if (count($types)) { $types = array_keys($types); foreach ($types as $machine_name) { if (isset($node->{$machine_name})) { $node->{$machine_name} = mt_rand(0, 1); } } } } }