function sweaver_drush_list_styles in Sweaver 7
Same name and namespace in other branches
- 6 drush/sweaver.drush.inc \sweaver_drush_list_styles()
Get the styles available in the system.
1 call to sweaver_drush_list_styles()
- sweaver_drush_style in drush/
sweaver.drush.inc - Edit a style via drush.
File
- drush/
sweaver.drush.inc, line 257 - Sweaver Drush functions.
Code
function sweaver_drush_list_styles() {
$styles = array();
if (module_exists('sweaver')) {
$i = 1;
// Draft versions.
$results = db_query("SELECT * FROM {sweaver_style_draft}")
->fetchAll();
foreach ($results as $row) {
$styles[$i] = $row;
$i++;
}
// Live versions.
$results = db_query("SELECT * FROM {sweaver_style} where active = 1")
->fetchAll();
foreach ($results as $row) {
$styles[$i] = $row;
$i++;
}
}
else {
drush_set_context("DRUSH_EXECUTION_COMPLETED", TRUE);
drush_print('Sweaver is not installed.');
exit;
}
return $styles;
}