summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThilo Wawrzik2007-10-21 19:19:06 (GMT)
committer Thilo Wawrzik2007-10-21 19:19:06 (GMT)
commit4320e7f90dc312863860827204ed9d283326ffc4 (patch)
tree5a336f51ff45c9d36ed7d82102b9bec0e95a8ba2
parent07c48657942a8254fa87cdd1b40cd0e66c7a4bc8 (diff)
- task: add back gallery_get_themes() function5.x-2.0-beta5
-rw-r--r--gallery_base.inc33
1 files changed, 33 insertions, 0 deletions
diff --git a/gallery_base.inc b/gallery_base.inc
index 05a902c..c3ac52c 100644
--- a/gallery_base.inc
+++ b/gallery_base.inc
@@ -174,6 +174,39 @@ function gallery_get_language($user) {
}
/**
+ * Function gallery_get_themes().
+ * (retrieve all (active) themes from Gallery2)
+ */
+function gallery_get_themes($all = FALSE) {
+ if (!_gallery_init()) {
+ return array();
+ }
+ // List of themes
+ list($ret, $g2_themes) = GalleryCoreApi::fetchPluginStatus('theme', TRUE);
+ if ($ret) {
+ gallery_error(t('Error retrieving theme list'), $ret);
+ return array();
+ }
+
+ $themes = array();
+ foreach (array_keys($g2_themes) as $themeid) {
+ // Only active themes
+ if (!empty($g2_themes[$themeid]['active']) || $all) {
+ // Get theme details
+ list($ret, $theme) = GalleryCoreApi::loadPlugin('theme', $themeid, TRUE);
+ if ($ret) {
+ gallery_error(t('Error getting theme (:themeid) details',
+ array(':themeid' => $themeid)), $ret);
+ return array();
+ }
+ $themes[$themeid] = $theme->getName();
+ }
+ }
+
+ return $themes;
+}
+
+/**
* Function gallery_get_image_frames().
* (retrieve all image frames from Gallery2)
*/