comparison Flag.inc @ 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 d98e315308cd
children 6f5939bf53c3
comparison
equal deleted inserted replaced
107:d5f3efba33e2 108:f2996720e6d6
43 } 43 }
44 } 44 }
45 45
46 46
47 $this->lang = $lang; 47 $this->lang = $lang;
48 $this->name = "../img/flag-${lang}"; 48 foreach ( [ 'img', '../img' ] as $dir) {
49 if ($this->active) 49 $this->name = "${dir}/flag-${lang}";
50 $this->name .= "-active"; 50 if ($this->active)
51 $this->name .= ".png"; 51 $this->name .= "-active";
52 $this->name .= ".png";
53 if (file_exists($this->name))
54 break;
55 }
52 56
53 $cache = new CacheTimeCheck($this->name); 57 $cache = new CacheTimeCheck($this->name);
54 $cache->setMaxAge(86400); 58 $cache->setMaxAge(86400);
55 $cache->addParent($masterCache); 59 $cache->addParent($masterCache);
56 $this->setCache($cache); 60 $this->setCache($cache);