Skip to content

Commit

Permalink
Issue #277: Add bee commands for theme_debug.
Browse files Browse the repository at this point in the history
  • Loading branch information
bugfolder committed Jul 30, 2024
1 parent 1c650ac commit 534c044
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions commands/theme.bee.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php
/**
* @file
* Command(s) for working with themes.
*/

/**
* Implements hook_bee_command().
*/
function theme_bee_command() {
return array(
'theme-enable-debug' => array(
'description' => bt('Enable theme debugging.'),
'callback' => 'theme_bee_enable_debug_callback',
'group' => 'themes',
'aliases' => array('ted'),
'bootstrap' => BEE_BOOTSTRAP_FULL,
'examples' => array(
'bee theme-enable-debug' => bt('Enable theme debugging.'),
),
),
'theme-disable-debug' => array(
'description' => bt('Disable theme debugging.'),
'callback' => 'theme_bee_disable_debug_callback',
'group' => 'themes',
'aliases' => array('tdd'),
'bootstrap' => BEE_BOOTSTRAP_FULL,
'examples' => array(
'bee theme-disable-debug' => bt('Disable theme debugging.'),
),
),
);
}

/**
* Command callback: Enable theme debugging.
*/
function theme_bee_enable_debug_callback($arguments, $options) {
config_set('system.core', 'theme_debug', 1);

bee_message(bt('Theme debugging has been turned on.'), 'success');
}

/**
* Command callback: Enable theme debugging.
*/
function theme_bee_disable_debug_callback($arguments, $options) {
config_set('system.core', 'theme_debug', 0);

bee_message(bt('Theme debugging has been turned off.'), 'success');
}

0 comments on commit 534c044

Please sign in to comment.