Browse Source

Core update (Yellow coffee remix)

markseu 10 năm trước cách đây
mục cha
commit
c43a07f22b

+ 5 - 7
README.md

@@ -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) 
 [![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.  
 1. [Download Yellow](https://github.com/markseu/yellowcms/archive/master.zip) and unzip it.  
 2. Copy all files to your web hosting.  
 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?
 How do I get started?
 ---------------------
 ---------------------
 You already have everything you need. Start by editing your website.  
 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). 
+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
 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 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.
 Yellow extensions are licensed under [GPLv2](http://opensource.org/licenses/GPL-2.0) unless stated otherwise.

BIN
media/downloads/yellow.pdf


+ 2 - 1
system/core/core-webinterface.php

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

+ 16 - 11
system/core/core.php

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

+ 4 - 1
system/themes/default.css

@@ -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; }
 html, body, div, form, pre, span, tr, th, td { margin:0; padding:0; border:0; vertical-align:baseline; }
 body { 
 body { 
@@ -28,6 +28,9 @@ a, img { border:none; text-decoration:none; }
 .content h1 a:hover { text-decoration:none; }
 .content h1 a:hover { text-decoration:none; }
 .content img { max-width:100%; height:auto; }
 .content img { max-width:100%; height:auto; }
 .content form { margin:1em 0; }
 .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 { position:relative; padding-bottom:56.25%; padding-top:30px; }
 .content .flexible iframe { position:absolute; top:0; left:0; width:100%; height:100%; }
 .content .flexible iframe { position:absolute; top:0; left:0; width:100%; height:100%; }
 .footer { margin-top:2em; }
 .footer { margin-top:2em; }