Seperti disebutkan dalam jawaban pertama,
environment_indicator adalah yang Anda cari.
Yah, kami juga menggunakan model pengembangan yang sama dan untuk kemudahan penggunaan jika modul fitur digunakan maka Anda dapat memiliki pengaturan yang ditulis dalam file. Ini membuat perubahan warna otomatis.
Ikuti kode di bawah ini, ini dapat diimpor melalui modul Fitur.
/**
* Implements hook_default_environment_indicator_environment().
*/
function mymodule_default_environment_indicator_environment() {
$export = array();
$environment = new stdClass();
$environment->disabled = FALSE; /* Edit this to true to make a default environment disabled initially */
$environment->api_version = 1;
$environment->machine = 'live';
$environment->name = 'Live';
$environment->regexurl = 'example.com';
$environment->settings = array(
'color' => '#bb0000',
'text_color' => '#ffffff',
'weight' => '',
'position' => 'top',
'fixed' => 0,
);
$export['live'] = $environment;
$environment = new stdClass();
$environment->disabled = FALSE; /* Edit this to true to make a default environment disabled initially */
$environment->api_version = 1;
$environment->machine = 'staging';
$environment->name = 'Staging';
$environment->regexurl = 'stage.example.com';
$environment->settings = array(
'color' => '#000099',
'text_color' => '#ffffff',
'weight' => '',
'position' => 'top',
'fixed' => 0,
);
$export['staging'] = $environment;
$environment = new stdClass();
$environment->disabled = FALSE; /* Edit this to true to make a default environment disabled initially */
$environment->api_version = 1;
$environment->machine = 'dev';
$environment->name = 'Dev';
$environment->regexurl = 'dev.example.com';
$environment->settings = array(
'color' => '#000066',
'text_color' => '#ffffff',
'weight' => '',
'position' => 'top',
'fixed' => 0,
);
$export['dev'] = $environment;
return $export;
}