From d693f0b96e813b13ef9ce02baa8ee63fef55219c Mon Sep 17 00:00:00 2001 From: jeroenrnl Date: Wed, 3 Oct 2012 21:12:54 +0200 Subject: [PATCH] Configuration through webinterface Initial setup to move configuration from config.inc.php to a more userfriendly, web-based, setup. This changes creates the basic infrastructure and moves 4 settings (ZOPH_TITLE, CSS_SHEET, MAPS and CAMERA_TZ) to the new setup. #28 --- php/admin.inc.php | 3 +- php/classes/TimeZone.inc.php | 13 +- php/classes/conf.inc.php | 169 ++++++++++++++++++ php/classes/confGroup.inc.php | 99 ++++++++++ php/classes/confItem.inc.php | 117 ++++++++++++ php/classes/confItemSelect.inc.php | 60 +++++++ php/classes/confItemString.inc.php | 59 ++++++ php/classes/map.inc.php | 3 +- php/config.inc.php | 12 +- php/config.php | 42 +++++ php/css.php | 47 ++++- php/exception.inc.php | 5 + php/header.inc.php | 13 +- php/include.inc.php | 54 +++--- php/log.inc.php | 2 +- php/logon.php | 17 +- php/mail.php | 6 +- php/notify.php | 2 +- php/photo.inc.php | 8 +- php/photo.php | 2 +- php/photos.php | 2 +- php/place.php | 2 +- php/places.php | 2 +- php/point.inc.php | 1 + php/search.php | 2 +- php/slideshow.php | 2 +- php/template.inc.php | 3 +- .../default/blocks/confGroup.tpl.php | 36 ++++ .../default/blocks/confItemSelect.tpl.php | 41 +++++ .../default/blocks/confItemString.tpl.php | 34 ++++ php/templates/default/config.tpl.php | 36 ++++ php/zoph.php | 4 +- 32 files changed, 827 insertions(+), 71 deletions(-) create mode 100644 php/classes/conf.inc.php create mode 100644 php/classes/confGroup.inc.php create mode 100644 php/classes/confItem.inc.php create mode 100644 php/classes/confItemSelect.inc.php create mode 100644 php/classes/confItemString.inc.php create mode 100644 php/config.php create mode 100644 php/templates/default/blocks/confGroup.tpl.php create mode 100644 php/templates/default/blocks/confItemSelect.tpl.php create mode 100644 php/templates/default/blocks/confItemString.tpl.php create mode 100644 php/templates/default/config.tpl.php diff --git a/php/admin.inc.php b/php/admin.inc.php index ae6ba9b..e679526 100644 --- a/php/admin.inc.php +++ b/php/admin.inc.php @@ -65,7 +65,8 @@ private static function createArray() { new admin("groups", "create or modify user groups", "groups.php", "groups.png"), new admin("pages", "create or modify zoph pages", "pages.php", "pages.png"), new admin("pagesets", "create or modify pagesets", "pagesets.php", "pagesets.png"), - new admin("tracks", "create or modify GPS tracks", "tracks.php", "tracks.png") + new admin("tracks", "create or modify GPS tracks", "tracks.php", "tracks.png"), + new admin("config", "modify configuration items", "config.php", "config.png") ); } } diff --git a/php/classes/TimeZone.inc.php b/php/classes/TimeZone.inc.php index c037f4e..e3bd339 100644 --- a/php/classes/TimeZone.inc.php +++ b/php/classes/TimeZone.inc.php @@ -66,7 +66,18 @@ public static function getSelectArray() { array_unshift($zones, ""); return $zones; } - + + /** + * Get array of timezones with timezone names as key + * @return array zones with names as key + */ + public static function getTzArray() { + $zones=self::getSelectArray(); + $zones=array_values($zones); + $zones=array_combine($zones, $zones); + return $zones; + } + /** * Get Key from timezone name * @param string timezone diff --git a/php/classes/conf.inc.php b/php/classes/conf.inc.php new file mode 100644 index 0000000..6170db7 --- /dev/null +++ b/php/classes/conf.inc.php @@ -0,0 +1,169 @@ +setValue($value); + } + self::$loaded=true; + + } + + public static function loadFromRequestVars(array $vars) { + foreach($vars as $key=>$value) { + if(substr($key,0,1) == "_") { continue; } + $key=str_replace("_", ".", $key); + try { + $item=conf::getItemByName($key); + $item->setValue($value); + $item->update(); + } catch(ConfigurationException $e) { + log::msg("Configuration cannot be updated: " . $e->getMessage(), log::ERROR, log::CONFIG); + } + } + } + + public static function getItemByName($name) { + $name_arr=explode(".", $name); + $group=array_shift($name_arr); + if(isset(self::$groups[$group]) && isset(self::$groups[$group][$name])) { + return self::$groups[$group][$name]; + } else { + throw new ConfigurationException("Unknown configuration item " . $id); + } + } + + public static function get($key) { + $item=conf::getItemByName($key); + return $item->getValue(); + + } + + public static function getAll() { + return self::$groups; + } + + public static function addGroup($name, $desc = "") { + $group = new confGroup(); + + $group->setName($name); + $group->setDesc($desc); + + + self::$groups[$name]=$group; + return $group; + } + + private static function buildConfig() { + foreach(self::$groups as $group) { + foreach($group as $item) { + $name=$item->getName(); + $value=$item->getDefault(); + } + } + } + + private static function getDefault() { + $interface = self::addGroup("interface", "Zoph interface settings"); + + $int_title = new confItemString(); + $int_title->setName("interface.title"); + $int_title->setLabel("title"); + $int_title->setDesc("The title for the application. This is what appears on the home page and in the browser's title bar."); + $int_title->setDefault("Zoph"); + $int_title->setRegex("^[\x20-\x7E]+$"); + $int_title->setRegex("^.*$"); + $interface[]=$int_title; + + $int_css = new confItemString(); + $int_css->setName("interface.css"); + $int_css->setLabel("style sheet"); + $int_css->setDesc("The CSS file Zoph uses"); + $int_css->setDefault("css.php"); + $int_css->setRegex("^[A-Za-z0-9_\.]+$"); + $interface[]=$int_css; + + + $path = self::addGroup("path", "File and directory locations"); + + + $path_images = new confItemString(); + $path_images->setName("path.images"); + $path_images->setLabel("Images directory"); + $path_images->setDesc("Location of the images on the filesystem"); + $path_images->setDefault("/data/images"); + $path_images->setRegex("^\/[A-Za-z0-9_\.\/]+$"); + $path_images->setTitle("Alphanumeric characters (A-Z, a-z and 0-9), forward slash (/), dot (.), and underscore (_)."); + $path[]=$path_images; + + + $maps = self::addGroup("maps", "Mapping support"); + + $maps_provider = new confItemSelect(); + $maps_provider->setName("maps.provider"); + $maps_provider->setDesc("Enable or disable mapping support and choose the mapping provider"); + $maps_provider->setLabel("Mapping provider"); + $maps_provider->addOption("", "Disabled"); + $maps_provider->addOption("google", "Google Maps"); + $maps_provider->addOption("googlev3", "Google Maps v3"); + $maps_provider->addOption("yahoo", "Yahoo maps"); + $maps_provider->addOption("cloudmade", "Cloudmade (OpenStreetMap)"); + $maps_provider->setDefault(""); + + $maps[]=$maps_provider; + + $date = self::addGroup("date", "Date and time"); + + $date_tz = new confItemSelect(); + $date_tz->setName("date.tz"); + $date_tz->setLabel("Timezone"); + $date_tz->setDesc("This setting determines the timezone to which your camera is set. Leave empty if you do not want to use this feature and always set your camera to the local timezone"); + + $date_tz->addOptions(TimeZone::getTzArray()); + $date_tz->setDefault(""); + + $date[]=$date_tz; + } +} + diff --git a/php/classes/confGroup.inc.php b/php/classes/confGroup.inc.php new file mode 100644 index 0000000..dac8b1e --- /dev/null +++ b/php/classes/confGroup.inc.php @@ -0,0 +1,99 @@ +name=$name; + } + + public function setDesc($desc) { + $this->desc=$desc; + } + + public function getName() { + return $this->name; + } + + public function getDesc() { + return $this->desc; + } + + + public function offsetExists($off) { + return isset($this->items[$off]); + } + + public function offsetGet($off) { + return $this->items[$off]; + } + + public function offsetSet($off, $value) { + if(is_null($off)) { + if($value instanceof confItem) { + $off=$value->getName(); + } + } + if(!is_null($off)) { + $this->items[$off]=$value; + } else { + $this->items[]=$value; + } + } + + public function offsetUnset($off) { + unset($this->items[$off]); + } + + /** + * For IteratorAggregate interface + * allow us to do foreach() on this object + */ + public function getIterator() { + return new ArrayIterator($this->items); + } + + private function readFromDB() { + + } + + public function display() { + $tpl=new block("confGroup", array( + "title" => $this->getName(), + "desc" => $this->getDesc(), + "items" => $this->items + )); + return $tpl; + } + + +} diff --git a/php/classes/confItem.inc.php b/php/classes/confItem.inc.php new file mode 100644 index 0000000..50b6439 --- /dev/null +++ b/php/classes/confItem.inc.php @@ -0,0 +1,117 @@ +keepKeys=true; + if($id === 0 || preg_match("/^[a-zA-Z0-9]+\.[a-zA-Z0-9]+$/", $id)) { + parent::__construct("conf", array("conf_id"), array("")); + $this->set("conf_id", $id); + + } else { + log::msg("Illegal configuration id", log::FATAL, log::VARS); + } + + } + + final public function update() { + $sql="SELECT COUNT(conf_id) FROM " . DB_PREFIX . "conf WHERE conf_id="; + $sql.="\"" . escape_string($this->fields["conf_id"]) . "\""; + + if(self::getCountFromQuery($sql) > 0) { + parent::update(); + } else { + parent::insert(); + } + + } + + final public function getName() { + return $this->fields["conf_id"]; + } + + + final public function getLabel() { + return $this->label; + } + + final public function getDesc() { + return $this->desc; + } + + final public function getValue() { + if(!isset($this->fields["value"]) || $this->fields["value"]===null) { + return $this->getDefault(); + } else { + return $this->fields["value"]; + } + } + + public function setValue($value) { + if($this->checkValue($value)) { + $this->fields["value"]=$value; + } else { + throw new ConfigurationException("Configuration value for " . $this->getName() . " is illegal"); + } + } + + final public function getDefault() { + return $this->default; + } + + final public function getHint() { + return $this->hint; + } + + final public function setName($name) { + $this->fields["conf_id"]=$name; + } + + final public function setLabel($label) { + $this->label=$label; + } + + final public function setDesc($desc) { + $this->desc=$desc; + } + + final public function setHint($hint) { + $this->hint=$hint; + } + + final public function setDefault($default) { + $this->default=$default; + } + + abstract public function display(); + + abstract public function checkValue($value); + +} diff --git a/php/classes/confItemSelect.inc.php b/php/classes/confItemSelect.inc.php new file mode 100644 index 0000000..681ad66 --- /dev/null +++ b/php/classes/confItemSelect.inc.php @@ -0,0 +1,60 @@ +options[$key]=$desc; + } + + public function addOptions(array $options) { + foreach($options as $key=>$desc) { + $this->addOption($key, $desc); + } + } + + public function getOptions() { + return $this->options; + } + + public function checkValue($value) { + return array_key_exists($value, $this->options); + } + + public function display() { + $tpl=new block("confItemSelect", array( + "label" => $this->getLabel(), + "name" => $this->getName(), + "value" => $this->getValue(), + "desc" => $this->getDesc(), + "hint" => $this->getHint(), + "options" => $this->getOptions() + + )); + return $tpl; + } + + + +} diff --git a/php/classes/confItemString.inc.php b/php/classes/confItemString.inc.php new file mode 100644 index 0000000..cbc10c7 --- /dev/null +++ b/php/classes/confItemString.inc.php @@ -0,0 +1,59 @@ + e($this->getLabel()), + "name" => e($this->getName()), + "value" => e($this->getValue()), + "desc" => e($this->getDesc()), + "hint" => e($this->getHint()), + "regex" => e($this->regex), + "title" => e($this->title) + )); + return $tpl; + } + + public function setRegex($regex) { + $this->regex=$regex; + } + + public function setTitle($title) { + $this->title=$title; + } + + public function checkValue($value) { + if(isset($this->regex)) { + return preg_match("/" . $this->regex ."/", $value); + } else { + return true; + } + } + + +} diff --git a/php/classes/map.inc.php b/php/classes/map.inc.php index e148ab9..94ac7c6 100644 --- a/php/classes/map.inc.php +++ b/php/classes/map.inc.php @@ -26,7 +26,6 @@ */ class map extends block { - private $provider = MAPS; private $map = "map"; protected $clat; @@ -46,7 +45,7 @@ function __construct($template="map", $vars=null) { $vars["id"]=$this->map; } if(!array_key_exists("provider", $vars)) { - $vars["provider"]=$this->provider; + $vars["provider"]=conf::get("maps.provider"); } parent::__construct($template, $vars); diff --git a/php/config.inc.php b/php/config.inc.php index 5eea9e3..2e5dfbb 100644 --- a/php/config.inc.php +++ b/php/config.inc.php @@ -24,7 +24,8 @@ define('INI_FILE', "/etc/zoph.ini"); // Define how Zoph looks by choosing a stylesheet and iconset. - define('CSS_SHEET', 'css.php'); + // Deprecated: Modify through admin -> config in web interface. + //define('CSS_SHEET', 'css.php'); define('ICONSET', 'default'); define('IMAGE_DIR', "/data/images/"); @@ -40,7 +41,8 @@ define('FORCE_SSL_LOGIN', 0); define('FORCE_SSL', 0); - define('ZOPH_TITLE', "Zoph"); + // Deprecated: Modify through admin -> config in web interface. + //define('ZOPH_TITLE', "Zoph"); define('LANG_DIR', "lang"); // where language files are stored @@ -71,7 +73,8 @@ // Enable Mapping and determine hich mapping provider to use // currently supported: 'google', 'googlev3', 'yahoo', 'cloudmade' or '' to disable // This needs JAVASCRIPT to be on - define('MAPS', ''); + // Deprecated: Modify through admin -> config in web interface. + // define('MAPS', ''); // Enable geocoding and specify provider. Currently only supported is // 'geonames'. @@ -85,7 +88,8 @@ // The timezone your camera is set to // Leave empty if you always set your camera to local time - define('CAMERA_TZ',''); + // Deprecated: Modify through admin -> config in web interface. + // define('CAMERA_TZ',''); // Define how Zoph displays date and time // See http://www.php.net/manual/en/function.date.php for explanation. define('DATE_FORMAT', 'd-m-Y'); diff --git a/php/config.php b/php/config.php new file mode 100644 index 0000000..93c87a4 --- /dev/null +++ b/php/config.php @@ -0,0 +1,42 @@ +is_admin()) { + redirect(add_sid("zoph.php")); + } + + $_action=getvar("_action"); + if($_action == "setconfig") { + conf::loadFromRequestVars($request_vars); + } else { + conf::loadFromDB(); + } + + $tpl=new template("config", array( + "title" => $title, + )); + + foreach(conf::getAll() as $name=>$item) { + $tpl->addBlock($item->display()); + } + echo $tpl; + +?> diff --git a/php/css.php b/php/css.php index 8cf1520..989fffc 100644 --- a/php/css.php +++ b/php/css.php @@ -346,7 +346,12 @@ float: left; } - +/* + For form validation + */ +:invalid { + background: rgba(255,0,0,0.1); + } ul.autocompdropdown { position: relative; @@ -511,6 +516,46 @@ height: 300px; } +/* explanation of the config item on the config page */ +div.main#config .desc { + clear: both; + width: 50%; + color: ; + border: 1px solid ; + margin-left: 11.5em; + padding: 0.5em; + background: rgba(0,0,0,0.05); + border-radius: 4px; +} + +div.main#config div.confGroup > .desc { + color: ; + background: none; + margin-left: 0; + width: 100%; + border: none; +} + +div.main#config h2 { + position: relative; + left: -11px; + clear: both; + display: block; + padding: 5px 10px; + border: 1px solid ; + background: ; + color: ; + width: 100%; +} + +div.main#config input { + border: 1px solid ; + padding: 2px; + border-radius: 2px; + +} + + .olControlAttribution { bottom: 1em !important; display: block; diff --git a/php/exception.inc.php b/php/exception.inc.php index b70d61e..7072c7d 100644 --- a/php/exception.inc.php +++ b/php/exception.inc.php @@ -26,6 +26,9 @@ */ class ZophException extends Exception {} +class ConfigurationException extends ZophException {} + + class ImportException extends ZophException {} class ImportAutorotException extends ImportException {} class ImportFileNotInPathException extends ImportException {} @@ -49,4 +52,6 @@ class FileSymlinkProblemException extends FileException {} class PhotoException extends ZophException {} class PhotoThumbCreationFailedException extends PhotoException {} class PhotoNotFoundException extends PhotoException {} + + ?> diff --git a/php/header.inc.php b/php/header.inc.php index 95413ad..aebce1d 100644 --- a/php/header.inc.php +++ b/php/header.inc.php @@ -22,7 +22,7 @@ - + "> @@ -40,9 +40,9 @@ - + @@ -92,10 +92,9 @@ <?php echo $html_title ?> diff --git a/php/include.inc.php b/php/include.inc.php index 268462b..25e245a 100644 --- a/php/include.inc.php +++ b/php/include.inc.php @@ -31,6 +31,7 @@ function __autoload($class) { require_once("settings.inc.php"); require_once("requirements.inc.php"); require_once("util.inc.php"); + require_once("validator.inc.php"); require_once("translation.inc.php"); @@ -56,29 +57,32 @@ function __autoload($class) { require_once("group.inc.php"); require_once("database.inc.php"); - require_once("auth.inc.php"); - - require_once("album.inc.php"); - require_once("category.inc.php"); - require_once("code.inc.php"); - require_once("comment.inc.php"); - - require_once("page.inc.php"); - require_once("pageset.inc.php"); - - require_once("file.inc.php"); - require_once("template.inc.php"); - - require_once("photo.inc.php"); - require_once("saved_search.inc.php"); - require_once("photo_search.inc.php"); - - require_once("import.inc.php"); - if(defined("CLI")) { - require_once("cli/cli.inc.php"); - require_once("cli/arguments.inc.php"); - require_once("cli/cliimport.inc.php"); - } else { - require_once("webimport.inc.php"); + if(!defined("LOGON")) { + require_once("auth.inc.php"); + + require_once("album.inc.php"); + require_once("category.inc.php"); + require_once("code.inc.php"); + require_once("comment.inc.php"); + + require_once("page.inc.php"); + require_once("pageset.inc.php"); + + require_once("file.inc.php"); + require_once("template.inc.php"); + + require_once("photo.inc.php"); + require_once("saved_search.inc.php"); + require_once("photo_search.inc.php"); + + require_once("import.inc.php"); + if(defined("CLI")) { + require_once("cli/cli.inc.php"); + require_once("cli/arguments.inc.php"); + require_once("cli/cliimport.inc.php"); + } else { + require_once("webimport.inc.php"); + } } -?> + conf::init(); + ?> diff --git a/php/log.inc.php b/php/log.inc.php index dbe6907..cb7400b 100644 --- a/php/log.inc.php +++ b/php/log.inc.php @@ -51,7 +51,7 @@ class log { const REDIRECT = 8; const IMPORT = 16; const GEOTAG = 32; - /* 64 is free */ + const CONFIG = 64; const DB = 128; const SQL = 256; const XML = 512; diff --git a/php/logon.php b/php/logon.php index 183104c..602fc02 100644 --- a/php/logon.php +++ b/php/logon.php @@ -15,11 +15,8 @@ * along with Zoph; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - require_once("log.inc.php"); - require_once("config.inc.php"); - require_once("settings.inc.php"); - require_once("variables.inc.php"); - require_once("util.inc.php"); + define("LOGON", true); + require_once("include.inc.php"); if(isset($_GET["redirect"])) { $redirect = urlencode($_GET["redirect"]); @@ -31,10 +28,6 @@ redirect(ZOPH_SECURE_URL . "/logon.php?redirect=" . $redirect, "https required"); } } - require_once("classes/zophTable.inc.php"); - require_once("translation.inc.php"); - require_once("user.inc.php"); - $user = new user(); $lang=$user->load_language(); @@ -43,14 +36,14 @@ - -<?php echo ZOPH_TITLE . ' - ' . translate("logon",0) ?> +?logged_on=no"> +<?php echo conf::get("interface.title") . ' - ' . translate("logon",0) ?>

-

+


diff --git a/php/mail.php b/php/mail.php index 43e97cb..6640803 100644 --- a/php/mail.php +++ b/php/mail.php @@ -71,7 +71,7 @@ MID_PREFIX . "/"; } if($includeurl) { - $link = "\n" . sprintf(translate("See this photo in %s"), ZOPH_TITLE) . ": " . ZOPH_URL . "/photo.php?photo_id=" . $photo_id; + $link = "\n" . sprintf(translate("See this photo in %s"), conf::get("interface.title")) . ": " . ZOPH_URL . "/photo.php?photo_id=" . $photo_id; } if ($html) { @@ -79,7 +79,7 @@ $html .= "
\n"; $html .= str_replace("\n", "
\n", $message); if($includeurl) { - $html .= "" . sprintf(translate("See this photo in %s"), ZOPH_TITLE) . ""; + $html .= "" . sprintf(translate("See this photo in %s"), conf::get("interface.title")) . ""; } $html .= "\n"; @@ -142,7 +142,7 @@ if ($found && $_action == "compose") { - $subject = sprintf(translate("A Photo from %s"), ZOPH_TITLE) . ": " . $photo->get("name"); + $subject = sprintf(translate("A Photo from %s"), conf::get("interface.title")) . ": " . $photo->get("name"); $ea = $photo->get_email_array(); if ($ea) { diff --git a/php/notify.php b/php/notify.php index 2388c78..43f27af 100644 --- a/php/notify.php +++ b/php/notify.php @@ -146,7 +146,7 @@ $body .= e($from_name); if (!$subject) { - $subject = translate("New Albums on") . " " . ZOPH_TITLE; + $subject = translate("New Albums on") . " " . conf::get("interface.title"); } $message = $body; diff --git a/php/photo.inc.php b/php/photo.inc.php index cc2140a..c96af91 100644 --- a/php/photo.inc.php +++ b/php/photo.inc.php @@ -1133,8 +1133,8 @@ function get_time($timezone=null, $date_format=DATE_FORMAT, $time_format=TIME_FO $place_tz=new TimeZone($loc->get("timezone")); } } - if(TimeZone::validate(CAMERA_TZ)) { - $camera_tz=new TimeZone(CAMERA_TZ); + if(TimeZone::validate(conf::get("date.tz"))) { + $camera_tz=new TimeZone(conf::get("date.tz")); } if(!isset($place_tz) && isset($camera_tz)) { @@ -1174,8 +1174,8 @@ function get_time($timezone=null, $date_format=DATE_FORMAT, $time_format=TIME_FO function get_time_details() { $tz=null; - if(TimeZone::validate(CAMERA_TZ)) { - $tz=CAMERA_TZ; + if(TimeZone::validate(conf::get("date.tz"))) { + $tz=conf::get("date.tz"); } $this->lookup_location(); diff --git a/php/photo.php b/php/photo.php index 335a498..0a55c05 100644 --- a/php/photo.php +++ b/php/photo.php @@ -503,7 +503,7 @@ ?>
lookup(); diff --git a/php/place.php b/php/place.php index 667873c..2b4727d 100644 --- a/php/place.php +++ b/php/place.php @@ -63,7 +63,7 @@ ?> getMarker($user); $map->setCenterAndZoomFromObj($place); diff --git a/php/places.php b/php/places.php index 916625f..802312b 100644 --- a/php/places.php +++ b/php/places.php @@ -208,7 +208,7 @@ ?> setCenterAndZoomFromObj($place); $marker=$place->getMarker($user); diff --git a/php/point.inc.php b/php/point.inc.php index 7f1d37f..585bc57 100644 --- a/php/point.inc.php +++ b/php/point.inc.php @@ -108,6 +108,7 @@ public function getPrev() { * @param string sort order * * @return array of points + * @todo useless wrapper around getRecords, should be removed */ public static function getAll($constraints = null, $conj = "and", $ops = null, $order = "name") { diff --git a/php/search.php b/php/search.php index d7e6198..64c5c33 100644 --- a/php/search.php +++ b/php/search.php @@ -647,7 +647,7 @@ setEditable(); $map->setCenterAndZoom(0,0,2); diff --git a/php/slideshow.php b/php/slideshow.php index cda1a5c..d65ba95 100644 --- a/php/slideshow.php +++ b/php/slideshow.php @@ -63,7 +63,7 @@ - +"> \n"; diff --git a/php/template.inc.php b/php/template.inc.php index b6681e1..c103ea6 100644 --- a/php/template.inc.php +++ b/php/template.inc.php @@ -28,7 +28,7 @@ class template { public $js=array(); public $style=""; public $script=""; - public $css=array(CSS_SHEET); + public $css=array(); public $title="Zoph"; /** @var array contains actionlinks */ @@ -49,6 +49,7 @@ class template { * @return template */ public function __construct($template, $vars=null) { + $this->css[]=conf::get("interface.css"); $this->vars=$vars; if(!preg_match("/^[A-Za-z0-9_]+$/", $template)) { log::msg("Illegal characters in template", log::FATAL, log::GENERAL); diff --git a/php/templates/default/blocks/confGroup.tpl.php b/php/templates/default/blocks/confGroup.tpl.php new file mode 100644 index 0000000..3575f0d --- /dev/null +++ b/php/templates/default/blocks/confGroup.tpl.php @@ -0,0 +1,36 @@ + +
+

+ +

+
+ +
+ +
+ display() ?> +
+ +
diff --git a/php/templates/default/blocks/confItemSelect.tpl.php b/php/templates/default/blocks/confItemSelect.tpl.php new file mode 100644 index 0000000..a04d049 --- /dev/null +++ b/php/templates/default/blocks/confItemSelect.tpl.php @@ -0,0 +1,41 @@ + + + +
+ +
+
+ +
+ diff --git a/php/templates/default/blocks/confItemString.tpl.php b/php/templates/default/blocks/confItemString.tpl.php new file mode 100644 index 0000000..66922be --- /dev/null +++ b/php/templates/default/blocks/confItemString.tpl.php @@ -0,0 +1,34 @@ + +
+ + +
+ +
+
+ +
+
+ diff --git a/php/templates/default/config.tpl.php b/php/templates/default/config.tpl.php new file mode 100644 index 0000000..9839139 --- /dev/null +++ b/php/templates/default/config.tpl.php @@ -0,0 +1,36 @@ + +

+ +

+
+ + + displayBlocks() ?> + "> + +
+ + diff --git a/php/zoph.php b/php/zoph.php index d32faab..46c3f4c 100644 --- a/php/zoph.php +++ b/php/zoph.php @@ -29,7 +29,7 @@ $num_photos = get_photos($vars, 0, 1, $thumbnails, $user); ?> -

+

- person->getLink(), ZOPH_TITLE); + person->getLink(), conf::get("interface.title")); echo "\n"; ?>