Commit 21fdedac authored by Jon Pugh's avatar Jon Pugh

Adding ProvisionStyle::helpBlock() method for nice helpful blocks.

parent c4beb63a
......@@ -191,14 +191,7 @@ class SaveCommand extends Command
$this->context = new $class($input->getArgument('context_name'), $this->getProvision(), $options);
}
else {
$icon = ProvisionStyle::ICON_EDIT;
$this->getProvision()->io()->block(
" {$icon} Editing context {$this->context->name} ",
NULL,
'bg=black;fg=blue',
NULL,
TRUE
);
$this->getProvision()->io()->helpBlock("Editing context {$this->context->name}...", ProvisionStyle::ICON_EDIT);
// Save over existing contexts.
$this->newContext = FALSE;
......
......@@ -214,17 +214,9 @@ class ServicesCommand extends Command
}
if ($this->context->hasService($service)) {
$icon = ProvisionStyle::ICON_EDIT;
$this->getProvision()->io()->block(
"{$icon} Editing service {$service} provded by server '{$this->context->name}'...",
NULL,
'bg=black;fg=cyan',
' ',
TRUE
);
$this->getProvision()->io()->helpBlock("Editing service {$service} provded by server '{$this->context->name}'...", ProvisionStyle::ICON_EDIT);
}
// Then ask for all options.
$properties = $this->askForServiceProperties($service, $service_type);
......
......@@ -21,6 +21,7 @@ class ProvisionStyle extends DrupalStyle {
/**
* Icons
*/
const ICON_HELP = '�';
const ICON_EDIT = '✎';
const ICON_START = '▷';
const ICON_FINISH = '🏁';
......@@ -86,6 +87,12 @@ class ProvisionStyle extends DrupalStyle {
);
}
/**
* Use to display a directory $ command.
*
* @param $message
* @param string $directory
*/
public function commandBlock($message, $directory = '') {
$this->autoPrependBlock();
$this->customLite($message, $directory . ' <fg=yellow>' . self::ICON_COMMAND . '</>', '');
......@@ -101,6 +108,21 @@ class ProvisionStyle extends DrupalStyle {
);
}
/**
* Display a block of text in the "Help" style.
* @param $message
* @param string $icon
*/
function helpBlock($message, $icon = ProvisionStyle::ICON_HELP) {
$this->block(
" {$icon} {$message}",
NULL,
'bg=black;fg=cyan',
' ',
TRUE
);
}
/**
* Replacement for parent::autoPrependBlock(), allowing access and setting newLine to 1 - instead of 2 -.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment