changeset 108:f2996720e6d6

Embed some flags, support for overriding.
author Tom Fredrik "BFG" Klaussen <bfg@blenning.no>
date Mon, 07 Mar 2016 20:44:43 +0100
parents d5f3efba33e2
children 812b0cfa999f
files Flag.inc
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Flag.inc	Mon Mar 07 20:44:15 2016 +0100
+++ b/Flag.inc	Mon Mar 07 20:44:43 2016 +0100
@@ -45,10 +45,14 @@
 
 
     $this->lang = $lang;
-    $this->name = "../img/flag-${lang}";
-    if ($this->active)
-      $this->name .= "-active";
-    $this->name .= ".png";
+    foreach ( [ 'img', '../img' ] as $dir) {
+      $this->name = "${dir}/flag-${lang}";
+      if ($this->active)
+	$this->name .= "-active";
+      $this->name .= ".png";
+      if (file_exists($this->name))
+	break;
+    }
 
     $cache = new CacheTimeCheck($this->name);
     $cache->setMaxAge(86400);