commit 8267fded7168dddbf6bc0707b918e99894b5413f
parent 00f6e45ed89902d7dc0fe67522220234453b6c8f
Author: markseu <mark2011@mayberg.se>
Date: Tue, 14 Oct 2014 16:42:36 +0200
Hello themes
Diffstat:
7 files changed, 76 insertions(+), 73 deletions(-)
diff --git a/.htaccess b/.htaccess
@@ -8,11 +8,14 @@ RewriteRule ^(content|system)/ error404 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^robots.txt$ system/config/robots.txt [L]
RewriteCond %{REQUEST_FILENAME} !-f
-RewriteCond %{REQUEST_URI} \.(css|js|png|woff)$
+RewriteCond %{REQUEST_URI} \.(css|js|jpg|png|woff)$
RewriteRule ^media/plugins/(core-.+) system/core/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
-RewriteCond %{REQUEST_URI} \.(css|js|png|woff)$
+RewriteCond %{REQUEST_URI} \.(css|js|jpg|png|woff)$
RewriteRule ^media/plugins/(.+) system/plugins/$1 [L]
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_URI} \.(css|js|jpg|png|woff)$
+RewriteRule ^media/themes/(.+) system/themes/$1 [L]
RewriteCond yellow.php -F
RewriteCond %{REQUEST_FILENAME} !-f
diff --git a/README.md b/README.md
@@ -1,4 +1,4 @@
-Yellow 0.4.4
+Yellow 0.4.5
============
Yellow is for people who make websites. [Visit website](http://datenstrom.se/yellow).
diff --git a/media/styles/default.css b/media/styles/default.css
@@ -1,56 +0,0 @@
-/* Yellow default style 0.3.11 */
-
-html, body, div, form, pre, span, tr, th, td { margin:0; padding:0; border:0; vertical-align:baseline; }
-body {
- margin:1em;
- background-color:#fff; color:#717171;
- font-family:Helvetica,sans-serif;
- font-size:0.95em;
- font-weight:200;
- line-height:1.5;
-}
-h1, h2, h3, h4, h5, h6 { color:#07d; font-weight:normal; }
-hr { height:1px; background:#ddd; border:0; }
-code { font-size:1.1em; }
-a { color:#07d; }
-a:hover { color:#07d; text-decoration:underline; }
-a, img { border:none; text-decoration:none; }
-.sitename h1 { margin-top:0.5em; margin-bottom:0em; font-size:2.5em; }
-.sitename a { color:#111; text-decoration:none; }
-.navigation { margin-bottom:1em; border-bottom:1px solid #ddd; line-height:2em; }
-.navigation a { color:#111; padding:0 0.3em; display:inline-block; }
-.navigation a:hover { color:#07d; }
-.navigation ul { margin:0 -0.3em; padding:0; list-style:none; }
-.navigation li a.active { color:#111; }
-.navigation li a.active:hover { color:#07d; }
-.navigation li { display:inline; }
-.pagination { margin:1em 0; }
-.content h1 a:hover { text-decoration:none; }
-.content img { max-width:100%; height:auto; }
-.content form { margin:1em 0; }
-.content .flexible { position:relative; padding-bottom:56.25%; padding-top:30px; }
-.content .flexible iframe { position:absolute; top:0; left:0; width:100%; height:100%; }
-.footer { margin-top:1em; padding:1em 0em; border-top:1px solid #ddd; }
-.footer a { color:#717171; }
-.footer a:hover { color:#07d; text-decoration:underline; }
-.left { float:left; margin:0 1em 0 0; }
-.center { display:block; margin:0 auto; }
-.right { float:right; margin:0 0 0 1em; }
-
-/* Responsive and print */
-
-.page { margin:0 auto; max-width:62em; }
-
-@media screen and (min-width:62em) {
- body { width:62em; margin:1em auto; }
-}
-@media screen and (max-width:30em) {
- body { margin:0.5em; font-size:0.9em; }
- .sitename h1, h1, h2 { font-size:1.3em; }
- .sitename h1, .sitename, .navigation, .footer, .page { margin:0; padding:0; border:0; }
-}
-@media print {
- body, h1, h2, h3, h4, h5, h6 { background-color:white; color:black; }
- .page { border:none !important; }
- .navigation, .footer { display:none !important; }
-}
-\ No newline at end of file
diff --git a/system/core/core-webinterface.php b/system/core/core-webinterface.php
@@ -97,7 +97,7 @@ class YellowWebinterface
if($this->isActive())
{
$location = $this->yellow->config->getHtml("serverBase").$this->yellow->config->getHtml("pluginLocation");
- $header .= "<link rel=\"styleSheet\" type=\"text/css\" media=\"all\" href=\"{$location}core-webinterface.css\" />\n";
+ $header .= "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"{$location}core-webinterface.css\" />\n";
$header .= "<script type=\"text/javascript\" src=\"{$location}core-webinterface.js\"></script>\n";
$header .= "<script type=\"text/javascript\">\n";
$header .= "// <![CDATA[\n";
diff --git a/system/core/core.php b/system/core/core.php
@@ -5,7 +5,7 @@
// Yellow main class
class Yellow
{
- const Version = "0.4.4";
+ const Version = "0.4.5";
var $page; //current page
var $pages; //pages from file system
var $config; //configuration
@@ -22,22 +22,22 @@ class Yellow
$this->plugins = new YellowPlugins();
$this->config->setDefault("sitename", "Yellow");
$this->config->setDefault("author", "Yellow");
- $this->config->setDefault("style", "default");
+ $this->config->setDefault("theme", "default");
$this->config->setDefault("template", "default");
$this->config->setDefault("language", "en");
$this->config->setDefault("serverScheme", $this->toolbox->getServerScheme());
$this->config->setDefault("serverName", $this->toolbox->getServerName());
$this->config->setDefault("serverBase", $this->toolbox->getServerBase());
- $this->config->setDefault("styleLocation", "/media/styles/");
$this->config->setDefault("imageLocation", "/media/images/");
$this->config->setDefault("pluginLocation", "/media/plugins/");
+ $this->config->setDefault("themeLocation", "/media/themes/");
$this->config->setDefault("systemDir", "system/");
$this->config->setDefault("configDir", "system/config/");
$this->config->setDefault("pluginDir", "system/plugins/");
$this->config->setDefault("snippetDir", "system/snippets/");
$this->config->setDefault("templateDir", "system/templates/");
+ $this->config->setDefault("themeDir", "system/themes/");
$this->config->setDefault("mediaDir", "media/");
- $this->config->setDefault("styleDir", "media/styles/");
$this->config->setDefault("imageDir", "media/images/");
$this->config->setDefault("contentDir", "content/");
$this->config->setDefault("contentRootDir", "default/");
@@ -168,10 +168,10 @@ class Yellow
function sendPage()
{
$this->template($this->page->get("template"));
- $fileNameStyle = $this->config->get("styleDir").$this->page->get("style").".css";
- if(!is_file($fileNameStyle))
+ $fileNameTheme = $this->config->get("themeDir").$this->page->get("theme").".css";
+ if(!is_file($fileNameTheme))
{
- $this->page->error(500, "Style '".$this->page->get("style")."' does not exist!");
+ $this->page->error(500, "Theme '".$this->page->get("theme")."' does not exist!");
}
if(!is_object($this->page->parser))
{
@@ -213,7 +213,7 @@ class Yellow
foreach($this->page->headerData as $key=>$value) echo "Yellow::sendPage $key: $value<br/>\n";
$fileNameTemplate = $this->config->get("templateDir").$this->page->get("template").".php";
$parserName = $this->page->get("parser");
- echo "Yellow::sendPage template:$fileNameTemplate style:$fileNameStyle parser:$parserName<br/>\n";
+ echo "Yellow::sendPage template:$fileNameTemplate theme:$fileNameTheme parser:$parserName<br/>\n";
}
return $statusCode;
}
@@ -413,8 +413,8 @@ class YellowPage
$this->set("title", $this->yellow->toolbox->createTextTitle($this->location));
$this->set("sitename", $this->yellow->config->get("sitename"));
$this->set("author", $this->yellow->config->get("author"));
- $this->set("style", $this->yellow->toolbox->findNameFromFile($this->fileName,
- $this->yellow->config->get("styleDir"), $this->yellow->config->get("style"), ".css"));
+ $this->set("theme", $this->yellow->toolbox->findNameFromFile($this->fileName,
+ $this->yellow->config->get("themeDir"), $this->yellow->config->get("theme"), ".css"));
$this->set("template", $this->yellow->toolbox->findNameFromFile($this->fileName,
$this->yellow->config->get("templateDir"), $this->yellow->config->get("template"), ".php"));
$this->set("language", $this->yellow->toolbox->findLanguageFromFile($this->fileName,
@@ -1773,7 +1773,7 @@ class YellowToolbox
return $fileNames;
}
- // Return file/style/template name from file path
+ // Return file/theme/template name from file path
function findNameFromFile($fileName, $pathBase, $nameDefault, $fileExtension, $includeFileName = false)
{
$name = "";
diff --git a/system/snippets/header.php b/system/snippets/header.php
@@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title><?php echo $yellow->page->getHtml("titleHeader") ?></title>
<link rel="shortcut icon" href="<?php echo $yellow->config->get("serverBase").$yellow->config->get("imageLocation")."icon.png" ?>" />
-<link rel="stylesheet" type="text/css" media="all" href="<?php echo $yellow->config->get("serverBase").$yellow->config->get("styleLocation").$yellow->page->get("style").".css" ?>" />
+<link rel="stylesheet" type="text/css" media="all" href="<?php echo $yellow->config->get("serverBase").$yellow->config->get("themeLocation").$yellow->page->get("theme").".css" ?>" />
<?php echo $yellow->page->getHeaderExtra() ?>
</head>
<body>
diff --git a/system/themes/default.css b/system/themes/default.css
@@ -0,0 +1,56 @@
+/* Yellow default theme 0.3.11 */
+
+html, body, div, form, pre, span, tr, th, td { margin:0; padding:0; border:0; vertical-align:baseline; }
+body {
+ margin:1em;
+ background-color:#fff; color:#717171;
+ font-family:Helvetica,sans-serif;
+ font-size:0.95em;
+ font-weight:200;
+ line-height:1.5;
+}
+h1, h2, h3, h4, h5, h6 { color:#07d; font-weight:normal; }
+hr { height:1px; background:#ddd; border:0; }
+code { font-size:1.1em; }
+a { color:#07d; }
+a:hover { color:#07d; text-decoration:underline; }
+a, img { border:none; text-decoration:none; }
+.sitename h1 { margin-top:0.5em; margin-bottom:0em; font-size:2.5em; }
+.sitename a { color:#111; text-decoration:none; }
+.navigation { margin-bottom:1em; border-bottom:1px solid #ddd; line-height:2em; }
+.navigation a { color:#111; padding:0 0.3em; display:inline-block; }
+.navigation a:hover { color:#07d; }
+.navigation ul { margin:0 -0.3em; padding:0; list-style:none; }
+.navigation li a.active { color:#111; }
+.navigation li a.active:hover { color:#07d; }
+.navigation li { display:inline; }
+.pagination { margin:1em 0; }
+.content h1 a:hover { text-decoration:none; }
+.content img { max-width:100%; height:auto; }
+.content form { margin:1em 0; }
+.content .flexible { position:relative; padding-bottom:56.25%; padding-top:30px; }
+.content .flexible iframe { position:absolute; top:0; left:0; width:100%; height:100%; }
+.footer { margin-top:1em; padding:1em 0em; border-top:1px solid #ddd; }
+.footer a { color:#717171; }
+.footer a:hover { color:#07d; text-decoration:underline; }
+.left { float:left; margin:0 1em 0 0; }
+.center { display:block; margin:0 auto; }
+.right { float:right; margin:0 0 0 1em; }
+
+/* Responsive and print */
+
+.page { margin:0 auto; max-width:62em; }
+
+@media screen and (min-width:62em) {
+ body { width:62em; margin:1em auto; }
+}
+@media screen and (max-width:30em) {
+ body { margin:0.5em; font-size:0.9em; }
+ .sitename h1, h1, h2 { font-size:1.3em; }
+ .sitename h1, .sitename, .navigation, .footer, .page { margin:0; padding:0; border:0; }
+}
+@media print {
+ body, h1, h2, h3, h4, h5, h6 { background-color:white; color:black; }
+ .page { border:none !important; }
+ .navigation, .footer { display:none !important; }
+}
+\ No newline at end of file