Easy, easy, easy, may be too much, but at least easier.
Your change should look something like this:
<?php
class Custom_Integrate
{
public static function register()
{
// $hook, $function, $file
return array(
array(
'integrate_menu_buttons',
'Custom_Integrate::menu_buttons',
),
);
}
public static function menu_buttons(&$buttons)
{
global $modSettings, $scripturl;
$buttons = elk_array_insert($buttons, 'pm', array(
// Eigener Button zu den Entwürfen.
'drafts1' => array(
'title' => 'Entwürfe',
'href' => $scripturl . '?action=profile;area=showdrafts',
'show' => !empty($modSettings['drafts_enabled']) && !empty($modSettings['drafts_post_enabled']),
)
),
'after',
false
);
}
}
And you would be able to enable/disable the "integration" directly from the admin panel.