Core update (Yellow coffee remix)

This commit is contained in:
markseu 2015-01-09 14:23:41 +01:00
parent 92ae2e51a6
commit c43a07f22b
5 changed files with 27 additions and 20 deletions

View file

@ -1,4 +1,4 @@
Yellow 0.4.18
Yellow 0.4.19
=============
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/markseu/yellowcms)
@ -8,18 +8,16 @@ How do I install this?
----------------------
1. [Download Yellow](https://github.com/markseu/yellowcms/archive/master.zip) and unzip it.
2. Copy all files to your web hosting.
3. Open your website in a browser.
Installation requirements are Apache, mod_rewrite, PHP 5.3+.
Yellow doesn't come with a lot of stuff. There are [Yellow extensions](https://github.com/markseu/yellowcms-extensions).
3. Open your website in a browser. That's it.
How do I get started?
---------------------
You already have everything you need. Start by editing your website.
Yellow is a flat-file CMS. For more information see [Yellow documentation](https://github.com/markseu/yellowcms/wiki).
There's not much to learn. For more features download [Yellow extensions](https://github.com/markseu/yellowcms-extensions).
License
-------
Everything is open source, made by the people who use Yellow. [Thank you](https://github.com/markseu/yellowcms/wiki/Yellow-contributors).
Yellow is free and open source, made by the people who use Yellow. [Thank you](https://github.com/markseu/yellowcms/wiki/Yellow-contributors).
Yellow core by Mark Seuffert and David Fehrmann is licensed under [GPLv2](http://opensource.org/licenses/GPL-2.0).
Yellow extensions are licensed under [GPLv2](http://opensource.org/licenses/GPL-2.0) unless stated otherwise.

BIN
media/downloads/yellow.pdf Normal file

Binary file not shown.

View file

@ -5,7 +5,7 @@
// Web interface core plugin
class YellowWebinterface
{
const Version = "0.4.6";
const Version = "0.4.7";
var $yellow; //access to API
var $active; //web interface is active? (boolean)
var $userLoginFailed; //web interface login failed? (boolean)
@ -111,6 +111,7 @@ class YellowWebinterface
}
$header .= "yellow.config = ".json_encode($this->getDataConfig()).";\n";
$language = $this->isUser() ? $this->users->getLanguage() : $page->get("language");
if(!$this->yellow->text->isLanguage($language)) $language = $this->yellow->config->get("language");
$header .= "yellow.text = ".json_encode($this->yellow->text->getData("webinterface", $language)).";\n";
if(defined("DEBUG")) $header .= "yellow.debug = ".json_encode(DEBUG).";\n";
$header .= "// ]]>\n";

View file

@ -5,7 +5,7 @@
// Yellow main class
class Yellow
{
const Version = "0.4.18";
const Version = "0.4.19";
var $page; //current page
var $pages; //pages from file system
var $config; //configuration
@ -168,6 +168,10 @@ class Yellow
{
$this->page->error(500, "Theme '".$this->page->get("theme")."' does not exist!");
}
if(!$this->text->isLanguage($this->page->get("language")))
{
$this->page->error(500, "Language '".$this->page->get("language")."' does not exist!");
}
if(!is_object($this->page->parser))
{
$this->page->error(500, "Parser '".$this->page->get("parser")."' does not exist!");
@ -1238,7 +1242,7 @@ class YellowText
// Return text string for specific language
function getText($key, $language)
{
return ($this->isText($key, $language)) ? $this->text[$language][$key] : "[$key]";
return $this->isExisting($key, $language) ? $this->text[$language][$key] : "[$key]";
}
// Return text string for specific language, HTML encoded
@ -1250,13 +1254,13 @@ class YellowText
// Return text string
function get($key)
{
return $this->isExisting($key) ? $this->text[$this->language][$key] : "[$key]";
return $this->getText($key, $this->language);
}
// Return text string, HTML encoded
function getHtml($key)
{
return htmlspecialchars($this->get($key));
return htmlspecialchars($this->getText($key, $this->language));
}
// Return text strings
@ -1264,7 +1268,7 @@ class YellowText
{
$text = array();
if(empty($language)) $language = $this->language;
if(!is_null($this->text[$language]))
if($this->isLanguage($language))
{
if(empty($filterStart))
{
@ -1286,16 +1290,17 @@ class YellowText
return $httpFormat ? $this->yellow->toolbox->getHttpTimeFormatted($this->modified) : $this->modified;
}
// Check if text string for specific language exists
function isText($key, $language)
// Check if language exists
function isLanguage($language)
{
return !is_null($this->text[$language]) && !is_null($this->text[$language][$key]);
return !is_null($this->text[$language]);
}
// Check if text string exists
function isExisting($key)
function isExisting($key, $language = "")
{
return !is_null($this->text[$this->language]) && !is_null($this->text[$this->language][$key]);
if(empty($language)) $language = $this->language;
return !is_null($this->text[$language]) && !is_null($this->text[$language][$key]);
}
}

View file

@ -1,4 +1,4 @@
/* Yellow default theme 0.4.2 */
/* Yellow default theme 0.4.3 */
html, body, div, form, pre, span, tr, th, td { margin:0; padding:0; border:0; vertical-align:baseline; }
body {
@ -28,6 +28,9 @@ a, img { border:none; text-decoration:none; }
.content h1 a:hover { text-decoration:none; }
.content img { max-width:100%; height:auto; }
.content form { margin:1em 0; }
.content table { border-spacing:0; border-collapse:collapse; }
.content th { text-align:left; padding:0.3em; border-bottom: 1px solid #ddd;}
.content td { text-align:left; padding:0.3em; border-top: 1px solid #ddd;}
.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:2em; }