Created
June 24, 2013 07:54
-
-
Save andeersg/5848422 to your computer and use it in GitHub Desktop.
Check if Drupal 7 module is enabled.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* param string $module | |
* Name of the module. | |
* | |
* return int | |
* 1 or 0 | |
*/ | |
function is_module_enabled($module) { | |
$result = db_query('SELECT s.status FROM system s WHERE s.name = :name AND s.type = :type', array(':name' => $module, ':type' => 'module')); | |
$record = $result->fetchObject(); | |
return $record->status; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment