diff --git a/lib/PageCustomize.php b/lib/PageCustomize.php index 80fcd14a0..26faf5a71 100644 --- a/lib/PageCustomize.php +++ b/lib/PageCustomize.php @@ -29,6 +29,16 @@ private function isSelected ($key, $value) { return ""; } + private function getTemplateList () { + $result = array (); + foreach (glob ("templates/*") as $filename) { + if (preg_match ('/templates\/(.*)/', $filename, $m)) { + array_push ($result, $m [1]); + } + } + return $result; + } + private function getStyleList () { $result = array (); foreach (glob ("templates/" . getCurrentTemplate () . "/styles/style-*.css") as $filename) { @@ -52,9 +62,23 @@ public function InitializeContent () "language"); $content = ""; + if (!preg_match("/(Kobo|Kindle\/3.0|EBRD1101)/", $_SERVER['HTTP_USER_AGENT'])) { + $content .= "'; + } else { + foreach ($this-> getTemplateList () as $filename) { + $content .= "isChecked ("template", $filename) . " />"; + } + } array_push ($this->entryArray, new Entry ("Template", "", - "Click to switch to Bootstrap", "text", + $content, "text", array ())); + + $content = ""; if (!preg_match("/(Kobo|Kindle\/3.0|EBRD1101)/", $_SERVER['HTTP_USER_AGENT'])) { $content .= '