Where to get a name of the current theme?

Serge D
Serge D's picture

Joined: 2009-06-11
Posts: 2466
Posted: Wed, 2009-07-01 04:16

Where to get a name of the current theme?

$theme class does not have name property
There is a list of themes used in the admin module, but it seems to be not present in regular mode

 
Okat
Okat's picture

Joined: 2009-04-05
Posts: 78
Posted: Sat, 2009-07-11 06:20

You can name a theme in the theme.info file, if that's what you mean.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sun, 2009-07-12 16:44

Hm. I don't think thats available. Where do you want to use it? I can work something up for you.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!

 
Serge D
Serge D's picture

Joined: 2009-06-11
Posts: 2466
Posted: Mon, 2009-07-13 03:05

As an example, I want to incorporate name of the theme in the footer
I could hardcode it, or which would be more conveniently, read it programmatically

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2009-07-13 04:26

Ok, well in the short term here's a way to do it:

<?
  $theme_id = module::get_var("gallery", "active_site_theme");
  $ini = parse_ini_file(THEMEPATH . "$theme_id/theme.info");
  print $ini["name"];
?>

---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!

 
Serge D
Serge D's picture

Joined: 2009-06-11
Posts: 2466
Posted: Mon, 2009-07-13 15:51

That works. thanks.
Probably would be nice to expose all theme related info as part of $theme declaration

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2009-07-13 19:47

I agree. Would you please file a ticket for that? Thanks!
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!

 
Serge D
Serge D's picture

Joined: 2009-06-11
Posts: 2466
Posted: Tue, 2009-07-14 04:27