'#warning' => 'When labelling buttons, make it clear what the button does, "Submit" is too generic.',
'#severity' => 'minor',
),
+ array(
+ '#type' => 'regex',
+ '#function' => '_nodeapi$',
+ '#source' => 'all',
+ '#value' => '(case\s+[\'"]submit[\'"]\s*:)|(==\s*[\'"]submit[\'"])',
+ '#warning_callback' => '_coder_6x_nodeapi_submit_warning',
+ ),
);
$review = array(
'#title' => t('Converting 5.x modules to 6.x'),
'#link' => 'http://drupal.org/node/114774#book_module',
);
}
+
+function _coder_6x_nodeapi_submit_warning() {
+ return array(
+ '#warning' => t('!hook_nodeapi(\'submit\') has been replaced by op=\'presave\'',
+ array(
+ '!hook_nodeapi' => theme('drupalapi', 'hook_nodeapi', '6')
+ )
+ ),
+ '#link' => 'http://drupal.org/node/114774#nodeapi_presave',
+ );
+}