From bf3c09bec66ef05c06b6e8f3a17c2387b09bd90e Mon Sep 17 00:00:00 2001
From: Geoff Munn The website server has not been able to respond to your request. The website server has not been able to respond to your request. FATAL ERROR: $errstr
* Authenticator::register_authenticator('OpenIDAuthenticator');
*
- *
- * @package sapphire
- * @subpackage core
*/
+
+
/**
* Add pear parser to include path
*/
diff --git a/api/RSSFeed.php b/api/RSSFeed.php
index ecf05c942..8470e7304 100755
--- a/api/RSSFeed.php
+++ b/api/RSSFeed.php
@@ -1,26 +1,10 @@
"Varchar",
- "Description" => "Varchar",
- );
/**
* Holds the feed entries
@@ -65,7 +49,7 @@ class RSSFeed extends ViewableData {
protected $descriptionField;
/**
- * Name of the author field of feed entries
+ Name of the author field of feed entries
*
* @var string
*/
@@ -201,10 +185,9 @@ class RSSFeed extends ViewableData {
* This class is used for entries of an RSS feed.
*
* @see RSSFeed
- * @package sapphire
- * @subpackage integration
*/
class RSSFeed_Entry extends ViewableData {
+
/**
* The object that represents the item, it contains all the data.
*
@@ -227,7 +210,7 @@ class RSSFeed_Entry extends ViewableData {
protected $descriptionField;
/**
- * Name of the author field of feed entries
+ Name of the author field of feed entries
*
* @var string
*/
diff --git a/api/RestfulService.php b/api/RestfulService.php
index c74308735..31d730fae 100644
--- a/api/RestfulService.php
+++ b/api/RestfulService.php
@@ -1,16 +1,8 @@
baseURL = $base;
$this->cache_expire = $expiry;
@@ -32,7 +19,7 @@ class RestfulService extends ViewableData {
/**
* Sets the Query string parameters to send a request.
- * @param array $params An array passed with necessary parameters.
+ * @param params An array passed with necessary parameters.
*/
function setQueryString($params=NULL){
$this->queryString = http_build_query($params,'','&');
@@ -44,66 +31,59 @@ class RestfulService extends ViewableData {
/**
* Connects to the RESTful service and gets its response.
- * @todo implement authentication via cURL for
+ * TODO implement authentication via cURL for
*/
function connect(){
- $url = $this->constructURL(); //url for the request
+ $url = $this->constructURL(); // url for the request
- //check for file exists in cache
- //set the cache directory
- $cachedir=TEMP_FOLDER; //default silverstrip-cache
+ // check for file exists in cache
+ // set the cache directory
+ $cachedir = TEMP_FOLDER; // default silverstripe-cache
- $cache_file = md5($url); //encoded name of cache file
- $cache_path = $cachedir."/$cache_file";
+ $cache_file = md5($url); // encoded name of cache file
+ $cache_path = $cachedir . "/$cache_file";
- if(( @file_exists("$cache_path") && ((@filemtime($cache_path) + $this->cache_expire) > ( time() )))){
+ if((@file_exists("$cache_path") && ((@filemtime($cache_path) + $this->cache_expire) > (time())))){
$this->rawXML = file_get_contents($cache_path);
- }
- else {//not available in cache fetch from server
-
+ } else {
+ // not available in cache fetch from server
$ch = curl_init();
$timeout = 5;
- $useragent = "SilverStripe/2.2";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$this->rawXML = curl_exec($ch);
curl_close($ch);
-
+ // save the response in cache
+ $fp = @fopen($cache_path,"w+");
+ @fwrite($fp,$this->rawXML);
+ @fclose($fp);
}
- //Try using file_get_contents if cURL is not installed in your system.
- //$this->rawXML = file_get_contents($url);
+ // Try using file_get_contents if cURL is not installed in your system.
+ // $this->rawXML = file_get_contents($url);
- //results returned - from cache / live
+ // results returned - from cache / live
if($this->rawXML != ""){
- //save the response in cache
- $fp = @fopen($cache_path,"w+");
- @fwrite($fp,$this->rawXML);
- @fclose($fp);
-
if($this->checkErrors == true) {
return $this->errorCatch($this->rawXML);
- }
- else {
+ } else {
return $this->rawXML;
}
- }
- else {
+ } else {
user_error("Invalid Response (maybe your calling to wrong URL or server unavailable)", E_USER_ERROR);
- }
}
+ }
/**
* Gets attributes as an array, of a particular type of element.
+ * @params xml - the source xml to parse, this could be the original response received.
+ * @params collection - parent node which wraps the elements, if available
+ * @params element - element we need to extract the attributes.
* Example :
- * $parser = new Spyc;
- * $array = $parser->load($file);
- *
- * @package sapphire
- * @subpackage misc
- */
-class Spyc {
-
- /**
- * Load YAML into a PHP array statically
- *
- * The load method, when supplied with a YAML stream (string or file),
- * will do its best to convert YAML in a file into a PHP array. Pretty
- * simple.
- * Usage:
- *
- * $array = Spyc::YAMLLoad('lucky.yaml');
- * print_r($array);
- *
- * @access public
- * @return array
- * @param string $input Path of YAML file or string containing YAML
- */
- public static function YAMLLoad($input) {
- $spyc = new Spyc;
- return $spyc->load($input);
+ /**
+ * The constructor assigns the node a unique ID.
+ * @access public
+ * @return void
+ */
+ public function YAMLNode($nodeId) {
+ $this->id = $nodeId;
+ }
}
/**
- * Dump YAML from PHP array statically
+ * The Simple PHP YAML Class.
*
- * The dump method, when supplied with an array, will do its best
- * to convert the array into friendly YAML. Pretty simple. Feel free to
- * save the returned string as nothing.yaml and pass it around.
+ * This class can be used to read a YAML file and convert its contents
+ * into a PHP array. It currently supports a very limited subsection of
+ * the YAML spec.
*
- * Oh, and you can decide how big the indent is and what the wordwrap
- * for folding is. Pretty cool -- just pass in 'false' for either if
- * you want to use the default.
- *
- * Indent's default is 2 spaces, wordwrap's default is 40 characters. And
- * you can turn off wordwrap by passing in 0.
- *
- * @access public
- * @return string
- * @param array $array PHP array
- * @param int $indent Pass in false to use the default, which is 2
- * @param int $wordwrap Pass in 0 for no wordwrap, false for default (40)
- */
- public static function YAMLDump($array,$indent = false,$wordwrap = false) {
- $spyc = new Spyc;
- return $spyc->dump($array,$indent,$wordwrap);
- }
-
- /**
- * Load YAML into a PHP array from an instantiated object
- *
- * The load method, when supplied with a YAML stream (string or file path),
- * will do its best to convert the YAML into a PHP array. Pretty simple.
- * Usage:
- *
+ * Usage:
+ *
+ * @package Spyc
*/
- public function load($input) {
- // See what type of input we're talking about
- // If it's not a file, assume it's a string
- if (!empty($input) && (strpos($input, "\n") === false)
- && file_exists($input)) {
- $yaml = file($input);
- } else {
- $yaml = explode("\n",$input);
+ class Spyc {
+
+ /**
+ * Load YAML into a PHP array statically
+ *
+ * The load method, when supplied with a YAML stream (string or file),
+ * will do its best to convert YAML in a file into a PHP array. Pretty
+ * simple.
+ * Usage:
+ *
* $parser = new Spyc;
- * $array = $parser->load('lucky.yaml');
- * print_r($array);
- *
- * @access public
- * @return array
- * @param string $input Path of YAML file or string containing YAML
+ * $array = $parser->load($file);
+ *
+ * $array = Spyc::YAMLLoad('lucky.yaml');
+ * print_r($array);
+ *
+ * @access public
+ * @return array
+ * @param string $input Path of YAML file or string containing YAML
+ */
+ public static function YAMLLoad($input) {
+ $spyc = new Spyc;
+ return $spyc->load($input);
}
- // Initiate some objects and values
- $base = new YAMLNode (1);
- $base->indent = 0;
- $this->_lastIndent = 0;
- $this->_lastNode = $base->id;
- $this->_inBlock = false;
- $this->_isInline = false;
- $this->_nodeId = 2;
- foreach ($yaml as $linenum => $line) {
- $ifchk = trim($line);
+ /**
+ * Dump YAML from PHP array statically
+ *
+ * The dump method, when supplied with an array, will do its best
+ * to convert the array into friendly YAML. Pretty simple. Feel free to
+ * save the returned string as nothing.yaml and pass it around.
+ *
+ * Oh, and you can decide how big the indent is and what the wordwrap
+ * for folding is. Pretty cool -- just pass in 'false' for either if
+ * you want to use the default.
+ *
+ * Indent's default is 2 spaces, wordwrap's default is 40 characters. And
+ * you can turn off wordwrap by passing in 0.
+ *
+ * @access public
+ * @return string
+ * @param array $array PHP array
+ * @param int $indent Pass in false to use the default, which is 2
+ * @param int $wordwrap Pass in 0 for no wordwrap, false for default (40)
+ */
+ public static function YAMLDump($array,$indent = false,$wordwrap = false) {
+ $spyc = new Spyc;
+ return $spyc->dump($array,$indent,$wordwrap);
+ }
- // If the line starts with a tab (instead of a space), throw a fit.
- if (preg_match('/^(\t)+(\w+)/', $line)) {
- $err = 'ERROR: Line '. ($linenum + 1) .' in your input YAML begins'.
- ' with a tab. YAML only recognizes spaces. Please reformat.';
- die($err);
+ /**
+ * Load YAML into a PHP array from an instantiated object
+ *
+ * The load method, when supplied with a YAML stream (string or file path),
+ * will do its best to convert the YAML into a PHP array. Pretty simple.
+ * Usage:
+ *
+ * $parser = new Spyc;
+ * $array = $parser->load('lucky.yaml');
+ * print_r($array);
+ *
+ * @access public
+ * @return array
+ * @param string $input Path of YAML file or string containing YAML
+ */
+ public function load($input) {
+ // See what type of input we're talking about
+ // If it's not a file, assume it's a string
+ if (!empty($input) && (strpos($input, "\n") === false)
+ && file_exists($input)) {
+ $yaml = file($input);
+ } else {
+ $yaml = explode("\n",$input);
}
+ // Initiate some objects and values
+ $base = new YAMLNode (1);
+ $base->indent = 0;
+ $this->_lastIndent = 0;
+ $this->_lastNode = $base->id;
+ $this->_inBlock = false;
+ $this->_isInline = false;
+ $this->_nodeId = 2;
- if ($this->_inBlock === false && empty($ifchk)) {
- continue;
- } elseif ($this->_inBlock == true && empty($ifchk)) {
- $last =& $this->_allNodes[$this->_lastNode];
- $last->data[key($last->data)] .= "\n";
- } elseif ($ifchk{0} != '#' && substr($ifchk,0,3) != '---') {
- // Create a new node and get its indent
- $node = new YAMLNode ($this->_nodeId);
- $this->_nodeId++;
- $node->indent = $this->_getIndent($line);
+ foreach ($yaml as $linenum => $line) {
+ $ifchk = trim($line);
- // Check where the node lies in the hierarchy
- if ($this->_lastIndent == $node->indent) {
- // If we're in a block, add the text to the parent's data
- if ($this->_inBlock === true) {
- $parent =& $this->_allNodes[$this->_lastNode];
- $parent->data[key($parent->data)] .= trim($line).$this->_blockEnd;
- } else {
- // The current node's parent is the same as the previous node's
- if (isset($this->_allNodes[$this->_lastNode])) {
- $node->parent = $this->_allNodes[$this->_lastNode]->parent;
+ // If the line starts with a tab (instead of a space), throw a fit.
+ if (preg_match('/^(\t)+(\w+)/', $line)) {
+ $err = 'ERROR: Line '. ($linenum + 1) .' in your input YAML begins'.
+ ' with a tab. YAML only recognizes spaces. Please reformat.';
+ die($err);
+ }
+
+ if ($this->_inBlock === false && empty($ifchk)) {
+ continue;
+ } elseif ($this->_inBlock == true && empty($ifchk)) {
+ $last =& $this->_allNodes[$this->_lastNode];
+ $last->data[key($last->data)] .= "\n";
+ } elseif ($ifchk{0} != '#' && substr($ifchk,0,3) != '---') {
+ // Create a new node and get its indent
+ $node = new YAMLNode ($this->_nodeId);
+ $this->_nodeId++;
+ $node->indent = $this->_getIndent($line);
+
+ // Check where the node lies in the hierarchy
+ if ($this->_lastIndent == $node->indent) {
+ // If we're in a block, add the text to the parent's data
+ if ($this->_inBlock === true) {
+ $parent =& $this->_allNodes[$this->_lastNode];
+ $parent->data[key($parent->data)] .= trim($line).$this->_blockEnd;
+ } else {
+ // The current node's parent is the same as the previous node's
+ if (isset($this->_allNodes[$this->_lastNode])) {
+ $node->parent = $this->_allNodes[$this->_lastNode]->parent;
+ }
}
- }
- } elseif ($this->_lastIndent < $node->indent) {
- if ($this->_inBlock === true) {
- $parent =& $this->_allNodes[$this->_lastNode];
- $parent->data[key($parent->data)] .= trim($line).$this->_blockEnd;
- } elseif ($this->_inBlock === false) {
- // The current node's parent is the previous node
- $node->parent = $this->_lastNode;
+ } elseif ($this->_lastIndent < $node->indent) {
+ if ($this->_inBlock === true) {
+ $parent =& $this->_allNodes[$this->_lastNode];
+ $parent->data[key($parent->data)] .= trim($line).$this->_blockEnd;
+ } elseif ($this->_inBlock === false) {
+ // The current node's parent is the previous node
+ $node->parent = $this->_lastNode;
- // If the value of the last node's data was > or | we need to
- // start blocking i.e. taking in all lines as a text value until
- // we drop our indent.
- $parent =& $this->_allNodes[$node->parent];
- $this->_allNodes[$node->parent]->children = true;
- if (is_array($parent->data)) {
- // if (isset ($parent->data[key($parent->data)]))
- $chk = $parent->data[key($parent->data)];
- if ($chk === '>') {
- $this->_inBlock = true;
- $this->_blockEnd = ' ';
- $parent->data[key($parent->data)] =
- str_replace('>','',$parent->data[key($parent->data)]);
- $parent->data[key($parent->data)] .= trim($line).' ';
- $this->_allNodes[$node->parent]->children = false;
- $this->_lastIndent = $node->indent;
- } elseif ($chk === '|') {
- $this->_inBlock = true;
- $this->_blockEnd = "\n";
- $parent->data[key($parent->data)] =
- str_replace('|','',$parent->data[key($parent->data)]);
- $parent->data[key($parent->data)] .= trim($line)."\n";
- $this->_allNodes[$node->parent]->children = false;
- $this->_lastIndent = $node->indent;
+ // If the value of the last node's data was > or | we need to
+ // start blocking i.e. taking in all lines as a text value until
+ // we drop our indent.
+ $parent =& $this->_allNodes[$node->parent];
+ $this->_allNodes[$node->parent]->children = true;
+ if (is_array($parent->data)) {
+ // if (isset ($parent->data[key($parent->data)]))
+ $chk = $parent->data[key($parent->data)];
+ if ($chk === '>') {
+ $this->_inBlock = true;
+ $this->_blockEnd = ' ';
+ $parent->data[key($parent->data)] =
+ str_replace('>','',$parent->data[key($parent->data)]);
+ $parent->data[key($parent->data)] .= trim($line).' ';
+ $this->_allNodes[$node->parent]->children = false;
+ $this->_lastIndent = $node->indent;
+ } elseif ($chk === '|') {
+ $this->_inBlock = true;
+ $this->_blockEnd = "\n";
+ $parent->data[key($parent->data)] =
+ str_replace('|','',$parent->data[key($parent->data)]);
+ $parent->data[key($parent->data)] .= trim($line)."\n";
+ $this->_allNodes[$node->parent]->children = false;
+ $this->_lastIndent = $node->indent;
+ }
+ }
+ }
+ } elseif ($this->_lastIndent > $node->indent) {
+ // Any block we had going is dead now
+ if ($this->_inBlock === true) {
+ $this->_inBlock = false;
+ if ($this->_blockEnd = "\n") {
+ $last =& $this->_allNodes[$this->_lastNode];
+ $last->data[key($last->data)] =
+ trim($last->data[key($last->data)]);
+ }
+ }
+
+ // We don't know the parent of the node so we have to find it
+ // foreach ($this->_allNodes as $n) {
+ foreach ($this->_indentSort[$node->indent] as $n) {
+ if ($n->indent == $node->indent) {
+ $node->parent = $n->parent;
}
}
}
- } elseif ($this->_lastIndent > $node->indent) {
- // Any block we had going is dead now
- if ($this->_inBlock === true) {
- $this->_inBlock = false;
- if ($this->_blockEnd = "\n") {
- $last =& $this->_allNodes[$this->_lastNode];
- $last->data[key($last->data)] =
- trim($last->data[key($last->data)]);
- }
- }
- // We don't know the parent of the node so we have to find it
- // foreach ($this->_allNodes as $n) {
- foreach ($this->_indentSort[$node->indent] as $n) {
- if ($n->indent == $node->indent) {
- $node->parent = $n->parent;
- }
- }
- }
-
- if ($this->_inBlock === false) {
- // Set these properties with information from our current node
- $this->_lastIndent = $node->indent;
- // Set the last node
- $this->_lastNode = $node->id;
- // Parse the YAML line and return its data
- $node->data = $this->_parseLine($line);
- // Add the node to the master list
- $this->_allNodes[$node->id] = $node;
- // Add a reference to the parent list
- $this->_allParent[intval($node->parent)][] = $node->id;
- // Add a reference to the node in an indent array
- $this->_indentSort[$node->indent][] =& $this->_allNodes[$node->id];
- // Add a reference to the node in a References array if this node
- // has a YAML reference in it.
- if (
- ( (is_array($node->data)) &&
- isset($node->data[key($node->data)]) &&
- (!is_array($node->data[key($node->data)])) )
- &&
- ( (preg_match('/^&([^ ]+)/',$node->data[key($node->data)]))
- ||
- (preg_match('/^\*([^ ]+)/',$node->data[key($node->data)])) )
- ) {
- $this->_haveRefs[] =& $this->_allNodes[$node->id];
- } elseif (
- ( (is_array($node->data)) &&
- isset($node->data[key($node->data)]) &&
- (is_array($node->data[key($node->data)])) )
- ) {
- // Incomplete reference making code. Ugly, needs cleaned up.
- foreach ($node->data[key($node->data)] as $d) {
- if ( !is_array($d) &&
- ( (preg_match('/^&([^ ]+)/',$d))
- ||
- (preg_match('/^\*([^ ]+)/',$d)) )
- ) {
- $this->_haveRefs[] =& $this->_allNodes[$node->id];
+ if ($this->_inBlock === false) {
+ // Set these properties with information from our current node
+ $this->_lastIndent = $node->indent;
+ // Set the last node
+ $this->_lastNode = $node->id;
+ // Parse the YAML line and return its data
+ $node->data = $this->_parseLine($line);
+ // Add the node to the master list
+ $this->_allNodes[$node->id] = $node;
+ // Add a reference to the parent list
+ $this->_allParent[intval($node->parent)][] = $node->id;
+ // Add a reference to the node in an indent array
+ $this->_indentSort[$node->indent][] =& $this->_allNodes[$node->id];
+ // Add a reference to the node in a References array if this node
+ // has a YAML reference in it.
+ if (
+ ( (is_array($node->data)) &&
+ isset($node->data[key($node->data)]) &&
+ (!is_array($node->data[key($node->data)])) )
+ &&
+ ( (preg_match('/^&([^ ]+)/',$node->data[key($node->data)]))
+ ||
+ (preg_match('/^\*([^ ]+)/',$node->data[key($node->data)])) )
+ ) {
+ $this->_haveRefs[] =& $this->_allNodes[$node->id];
+ } elseif (
+ ( (is_array($node->data)) &&
+ isset($node->data[key($node->data)]) &&
+ (is_array($node->data[key($node->data)])) )
+ ) {
+ // Incomplete reference making code. Ugly, needs cleaned up.
+ foreach ($node->data[key($node->data)] as $d) {
+ if ( !is_array($d) &&
+ ( (preg_match('/^&([^ ]+)/',$d))
+ ||
+ (preg_match('/^\*([^ ]+)/',$d)) )
+ ) {
+ $this->_haveRefs[] =& $this->_allNodes[$node->id];
+ }
}
}
}
}
}
- }
- unset($node);
+ unset($node);
- // Here we travel through node-space and pick out references (& and *)
- $this->_linkReferences();
+ // Here we travel through node-space and pick out references (& and *)
+ $this->_linkReferences();
- // Build the PHP array out of node-space
- $trunk = $this->_buildArray();
- return $trunk;
- }
-
- /**
- * Dump PHP array to YAML
- *
- * The dump method, when supplied with an array, will do its best
- * to convert the array into friendly YAML. Pretty simple. Feel free to
- * save the returned string as tasteful.yaml and pass it around.
- *
- * Oh, and you can decide how big the indent is and what the wordwrap
- * for folding is. Pretty cool -- just pass in 'false' for either if
- * you want to use the default.
- *
- * Indent's default is 2 spaces, wordwrap's default is 40 characters. And
- * you can turn off wordwrap by passing in 0.
- *
- * @access public
- * @return string
- * @param array $array PHP array
- * @param int $indent Pass in false to use the default, which is 2
- * @param int $wordwrap Pass in 0 for no wordwrap, false for default (40)
- */
- public function dump($array,$indent = false,$wordwrap = false) {
- // Dumps to some very clean YAML. We'll have to add some more features
- // and options soon. And better support for folding.
-
- // New features and options.
- if ($indent === false or !is_numeric($indent)) {
- $this->_dumpIndent = 2;
- } else {
- $this->_dumpIndent = $indent;
- }
-
- if ($wordwrap === false or !is_numeric($wordwrap)) {
- $this->_dumpWordWrap = 40;
- } else {
- $this->_dumpWordWrap = $wordwrap;
- }
-
- // New YAML document
- $string = "---\n";
-
- // Start at the base of the array and move through it.
- foreach ($array as $key => $value) {
- $string .= $this->_yamlize($key,$value,0);
- }
- return $string;
- }
-
- /**** Private Properties ****/
-
- /**#@+
- * @access private
- * @var mixed
- */
- private $_haveRefs;
- private $_allNodes;
- private $_allParent;
- private $_lastIndent;
- private $_lastNode;
- private $_inBlock;
- private $_isInline;
- private $_dumpIndent;
- private $_dumpWordWrap;
- /**#@-*/
-
- /**** Public Properties ****/
-
- /**#@+
- * @access public
- * @var mixed
- */
- public $_nodeId;
- /**#@-*/
-
- /**** Private Methods ****/
-
- /**
- * Attempts to convert a key / value array item to YAML
- * @access private
- * @return string
- * @param $key The name of the key
- * @param $value The value of the item
- * @param $indent The indent of the current node
- */
- private function _yamlize($key,$value,$indent) {
- if (is_array($value)) {
- // It has children. What to do?
- // Make it the right kind of item
- $string = $this->_dumpNode($key,NULL,$indent);
- // Add the indent
- $indent += $this->_dumpIndent;
- // Yamlize the array
- $string .= $this->_yamlizeArray($value,$indent);
- } elseif (!is_array($value)) {
- // It doesn't have children. Yip.
- $string = $this->_dumpNode($key,$value,$indent);
- }
- return $string;
- }
-
- /**
- * Attempts to convert an array to YAML
- * @access private
- * @return string
- * @param $array The array you want to convert
- * @param $indent The indent of the current level
- */
- private function _yamlizeArray($array,$indent) {
- if (is_array($array)) {
- $string = '';
- foreach ($array as $key => $value) {
- $string .= $this->_yamlize($key,$value,$indent);
- }
- return $string;
- } else {
- return false;
- }
- }
-
- /**
- * Returns YAML from a key and a value
- * @access private
- * @return string
- * @param $key The name of the key
- * @param $value The value of the item
- * @param $indent The indent of the current node
- */
- private function _dumpNode($key,$value,$indent) {
- // do some folding here, for blocks
- if (strpos($value,"\n") !== false || strpos($value,": ") !== false || strpos($value,"- ") !== false) {
- $value = $this->_doLiteralBlock($value,$indent);
- } else {
- $value = $this->_doFolding($value,$indent);
- }
-
- if (is_bool($value)) {
- $value = ($value) ? "true" : "false";
- }
-
- $spaces = str_repeat(' ',$indent);
-
- if (is_int($key)) {
- // It's a sequence
- $string = $spaces.'- '.$value."\n";
- } else {
- // It's mapped
- $string = $spaces.$key.': '.$value."\n";
- }
- return $string;
- }
-
- /**
- * Creates a literal block for dumping
- * @access private
- * @return string
- * @param $value
- * @param $indent int The value of the indent
- */
- private function _doLiteralBlock($value,$indent) {
- $exploded = explode("\n",$value);
- $newValue = '|';
- $indent += $this->_dumpIndent;
- $spaces = str_repeat(' ',$indent);
- foreach ($exploded as $line) {
- $newValue .= "\n" . $spaces . trim($line);
- }
- return $newValue;
- }
-
- /**
- * Folds a string of text, if necessary
- * @access private
- * @return string
- * @param $value The string you wish to fold
- */
- private function _doFolding($value,$indent) {
- // Don't do anything if wordwrap is set to 0
- if ($this->_dumpWordWrap === 0) {
- return $value;
- }
-
- if (strlen($value) > $this->_dumpWordWrap) {
- $indent += $this->_dumpIndent;
- $indent = str_repeat(' ',$indent);
- $wrapped = wordwrap($value,$this->_dumpWordWrap,"\n$indent");
- $value = ">\n".$indent.$wrapped;
- }
- return $value;
- }
-
- /* Methods used in loading */
-
- /**
- * Finds and returns the indentation of a YAML line
- * @access private
- * @return int
- * @param string $line A line from the YAML file
- */
- private function _getIndent($line) {
- preg_match('/^\s{1,}/',$line,$match);
- if (!empty($match[0])) {
- $indent = substr_count($match[0],' ');
- } else {
- $indent = 0;
- }
- return $indent;
- }
-
- /**
- * Parses YAML code and returns an array for a node
- * @access private
- * @return array
- * @param string $line A line from the YAML file
- */
- private function _parseLine($line) {
- $line = trim($line);
-
- $array = array();
-
- if (preg_match('/^-(.*):$/',$line)) {
- // It's a mapped sequence
- $key = trim(substr(substr($line,1),0,-1));
- $array[$key] = '';
- } elseif ($line[0] == '-' && substr($line,0,3) != '---') {
- // It's a list item but not a new stream
- if (strlen($line) > 1) {
- $value = trim(substr($line,1));
- // Set the type of the value. Int, string, etc
- $value = $this->_toType($value);
- $array[] = $value;
- } else {
- $array[] = array();
- }
- } elseif (preg_match('/^(.+):/',$line,$key)) {
- // It's a key/value pair most likely
- // If the key is in double quotes pull it out
- if (preg_match('/^(["\'](.*)["\'](\s)*:)/',$line,$matches)) {
- $value = trim(str_replace($matches[1],'',$line));
- $key = $matches[2];
- } else {
- // Do some guesswork as to the key and the value
- $explode = explode(':',$line);
- $key = trim($explode[0]);
- array_shift($explode);
- $value = trim(implode(':',$explode));
- }
-
- // Set the type of the value. Int, string, etc
- $value = $this->_toType($value);
- if (empty($key)) {
- $array[] = $value;
- } else {
- $array[$key] = $value;
- }
- }
- return $array;
- }
-
- /**
- * Finds the type of the passed value, returns the value as the new type.
- * @access private
- * @param string $value
- * @return mixed
- */
- private function _toType($value) {
- if (preg_match('/^("(.*)"|\'(.*)\')/',$value,$matches)) {
- $value = (string)preg_replace('/(\'\'|\\\\\')/',"'",end($matches));
- $value = preg_replace('/\\\\"/','"',$value);
- } elseif (preg_match('/^\\[(.+)\\]$/',$value,$matches)) {
- // Inline Sequence
-
- // Take out strings sequences and mappings
- $explode = $this->_inlineEscape($matches[1]);
-
- // Propogate value array
- $value = array();
- foreach ($explode as $v) {
- $value[] = $this->_toType($v);
- }
- } elseif (strpos($value,': ')!==false && !preg_match('/^{(.+)/',$value)) {
- // It's a map
- $array = explode(': ',$value);
- $key = trim($array[0]);
- array_shift($array);
- $value = trim(implode(': ',$array));
- $value = $this->_toType($value);
- $value = array($key => $value);
- } elseif (preg_match("/{(.+)}$/",$value,$matches)) {
- // Inline Mapping
-
- // Take out strings sequences and mappings
- $explode = $this->_inlineEscape($matches[1]);
-
- // Propogate value array
- $array = array();
- foreach ($explode as $v) {
- $array = $array + $this->_toType($v);
- }
- $value = $array;
- } elseif (strtolower($value) == 'null' or $value == '' or $value == '~') {
- $value = NULL;
- } elseif (preg_match ('/^[0-9]+$/', $value)) {
- $value = (int)$value;
- } elseif (in_array(strtolower($value),
- array('true', 'on', '+', 'yes', 'y'))) {
- $value = TRUE;
- } elseif (in_array(strtolower($value),
- array('false', 'off', '-', 'no', 'n'))) {
- $value = FALSE;
- } elseif (is_numeric($value)) {
- $value = (float)$value;
- } else {
- // Just a normal string, right?
- $value = trim(preg_replace('/#(.+)$/','',$value));
- }
-
- return $value;
- }
-
- /**
- * Used in inlines to check for more inlines or quoted strings
- * @access private
- * @return array
- */
- private function _inlineEscape($inline) {
- // There's gotta be a cleaner way to do this...
- // While pure sequences seem to be nesting just fine,
- // pure mappings and mappings with sequences inside can't go very
- // deep. This needs to be fixed.
-
- $saved_strings = array();
-
- // Check for strings
- $regex = '/(?:(")|(?:\'))((?(1)[^"]+|[^\']+))(?(1)"|\')/';
- if (preg_match_all($regex,$inline,$strings)) {
- $saved_strings = $strings[0];
- $inline = preg_replace($regex,'YAMLString',$inline);
- }
- unset($regex);
-
- // Check for sequences
- if (preg_match_all('/\[(.+)\]/U',$inline,$seqs)) {
- $inline = preg_replace('/\[(.+)\]/U','YAMLSeq',$inline);
- $seqs = $seqs[0];
- }
-
- // Check for mappings
- if (preg_match_all('/{(.+)}/U',$inline,$maps)) {
- $inline = preg_replace('/{(.+)}/U','YAMLMap',$inline);
- $maps = $maps[0];
- }
-
- $explode = explode(', ',$inline);
-
-
- // Re-add the sequences
- if (!empty($seqs)) {
- $i = 0;
- foreach ($explode as $key => $value) {
- if (strpos($value,'YAMLSeq') !== false) {
- $explode[$key] = str_replace('YAMLSeq',$seqs[$i],$value);
- ++$i;
- }
- }
- }
-
- // Re-add the mappings
- if (!empty($maps)) {
- $i = 0;
- foreach ($explode as $key => $value) {
- if (strpos($value,'YAMLMap') !== false) {
- $explode[$key] = str_replace('YAMLMap',$maps[$i],$value);
- ++$i;
- }
- }
- }
-
-
- // Re-add the strings
- if (!empty($saved_strings)) {
- $i = 0;
- foreach ($explode as $key => $value) {
- while (strpos($value,'YAMLString') !== false) {
- $explode[$key] = preg_replace('/YAMLString/',$saved_strings[$i],$value, 1);
- ++$i;
- $value = $explode[$key];
- }
- }
- }
-
- return $explode;
- }
-
- /**
- * Builds the PHP array from all the YAML nodes we've gathered
- * @access private
- * @return array
- */
- private function _buildArray() {
- $trunk = array();
-
- if (!isset($this->_indentSort[0])) {
+ // Build the PHP array out of node-space
+ $trunk = $this->_buildArray();
return $trunk;
}
- foreach ($this->_indentSort[0] as $n) {
- if (empty($n->parent)) {
- $this->_nodeArrayizeData($n);
- // Check for references and copy the needed data to complete them.
- $this->_makeReferences($n);
- // Merge our data with the big array we're building
- $trunk = $this->_array_kmerge($trunk,$n->data);
+ /**
+ * Dump PHP array to YAML
+ *
+ * The dump method, when supplied with an array, will do its best
+ * to convert the array into friendly YAML. Pretty simple. Feel free to
+ * save the returned string as tasteful.yaml and pass it around.
+ *
+ * Oh, and you can decide how big the indent is and what the wordwrap
+ * for folding is. Pretty cool -- just pass in 'false' for either if
+ * you want to use the default.
+ *
+ * Indent's default is 2 spaces, wordwrap's default is 40 characters. And
+ * you can turn off wordwrap by passing in 0.
+ *
+ * @access public
+ * @return string
+ * @param array $array PHP array
+ * @param int $indent Pass in false to use the default, which is 2
+ * @param int $wordwrap Pass in 0 for no wordwrap, false for default (40)
+ */
+ public function dump($array,$indent = false,$wordwrap = false) {
+ // Dumps to some very clean YAML. We'll have to add some more features
+ // and options soon. And better support for folding.
+
+ // New features and options.
+ if ($indent === false or !is_numeric($indent)) {
+ $this->_dumpIndent = 2;
+ } else {
+ $this->_dumpIndent = $indent;
+ }
+
+ if ($wordwrap === false or !is_numeric($wordwrap)) {
+ $this->_dumpWordWrap = 40;
+ } else {
+ $this->_dumpWordWrap = $wordwrap;
+ }
+
+ // New YAML document
+ $string = "---\n";
+
+ // Start at the base of the array and move through it.
+ foreach ($array as $key => $value) {
+ $string .= $this->_yamlize($key,$value,0);
+ }
+ return $string;
+ }
+
+ /**** Private Properties ****/
+
+ /**#@+
+ * @access private
+ * @var mixed
+ */
+ private $_haveRefs;
+ private $_allNodes;
+ private $_allParent;
+ private $_lastIndent;
+ private $_lastNode;
+ private $_inBlock;
+ private $_isInline;
+ private $_dumpIndent;
+ private $_dumpWordWrap;
+ /**#@+*/
+
+ /**** Public Properties ****/
+
+ /**#@+
+ * @access public
+ * @var mixed
+ */
+ public $_nodeId;
+ /**#@+*/
+
+ /**** Private Methods ****/
+
+ /**
+ * Attempts to convert a key / value array item to YAML
+ * @access private
+ * @return string
+ * @param $key The name of the key
+ * @param $value The value of the item
+ * @param $indent The indent of the current node
+ */
+ private function _yamlize($key,$value,$indent) {
+ if (is_array($value)) {
+ // It has children. What to do?
+ // Make it the right kind of item
+ $string = $this->_dumpNode($key,NULL,$indent);
+ // Add the indent
+ $indent += $this->_dumpIndent;
+ // Yamlize the array
+ $string .= $this->_yamlizeArray($value,$indent);
+ } elseif (!is_array($value)) {
+ // It doesn't have children. Yip.
+ $string = $this->_dumpNode($key,$value,$indent);
+ }
+ return $string;
+ }
+
+ /**
+ * Attempts to convert an array to YAML
+ * @access private
+ * @return string
+ * @param $array The array you want to convert
+ * @param $indent The indent of the current level
+ */
+ private function _yamlizeArray($array,$indent) {
+ if (is_array($array)) {
+ $string = '';
+ foreach ($array as $key => $value) {
+ $string .= $this->_yamlize($key,$value,$indent);
+ }
+ return $string;
+ } else {
+ return false;
}
}
- return $trunk;
- }
+ /**
+ * Returns YAML from a key and a value
+ * @access private
+ * @return string
+ * @param $key The name of the key
+ * @param $value The value of the item
+ * @param $indent The indent of the current node
+ */
+ private function _dumpNode($key,$value,$indent) {
+ // do some folding here, for blocks
+ if (strpos($value,"\n") !== false || strpos($value,": ") !== false || strpos($value,"- ") !== false) {
+ $value = $this->_doLiteralBlock($value,$indent);
+ } else {
+ $value = $this->_doFolding($value,$indent);
+ }
- /**
- * Traverses node-space and sets references (& and *) accordingly
- * @access private
- * @return bool
- */
- private function _linkReferences() {
- if (is_array($this->_haveRefs)) {
- foreach ($this->_haveRefs as $node) {
- if (!empty($node->data)) {
- $key = key($node->data);
- // If it's an array, don't check.
- if (is_array($node->data[$key])) {
- foreach ($node->data[$key] as $k => $v) {
- $this->_linkRef($node,$key,$k,$v);
- }
- } else {
- $this->_linkRef($node,$key);
+ if (is_bool($value)) {
+ $value = ($value) ? "true" : "false";
+ }
+
+ $spaces = str_repeat(' ',$indent);
+
+ if (is_int($key)) {
+ // It's a sequence
+ $string = $spaces.'- '.$value."\n";
+ } else {
+ // It's mapped
+ $string = $spaces.$key.': '.$value."\n";
+ }
+ return $string;
+ }
+
+ /**
+ * Creates a literal block for dumping
+ * @access private
+ * @return string
+ * @param $value
+ * @param $indent int The value of the indent
+ */
+ private function _doLiteralBlock($value,$indent) {
+ $exploded = explode("\n",$value);
+ $newValue = '|';
+ $indent += $this->_dumpIndent;
+ $spaces = str_repeat(' ',$indent);
+ foreach ($exploded as $line) {
+ $newValue .= "\n" . $spaces . trim($line);
+ }
+ return $newValue;
+ }
+
+ /**
+ * Folds a string of text, if necessary
+ * @access private
+ * @return string
+ * @param $value The string you wish to fold
+ */
+ private function _doFolding($value,$indent) {
+ // Don't do anything if wordwrap is set to 0
+ if ($this->_dumpWordWrap === 0) {
+ return $value;
+ }
+
+ if (strlen($value) > $this->_dumpWordWrap) {
+ $indent += $this->_dumpIndent;
+ $indent = str_repeat(' ',$indent);
+ $wrapped = wordwrap($value,$this->_dumpWordWrap,"\n$indent");
+ $value = ">\n".$indent.$wrapped;
+ }
+ return $value;
+ }
+
+ /* Methods used in loading */
+
+ /**
+ * Finds and returns the indentation of a YAML line
+ * @access private
+ * @return int
+ * @param string $line A line from the YAML file
+ */
+ private function _getIndent($line) {
+ preg_match('/^\s{1,}/',$line,$match);
+ if (!empty($match[0])) {
+ $indent = substr_count($match[0],' ');
+ } else {
+ $indent = 0;
+ }
+ return $indent;
+ }
+
+ /**
+ * Parses YAML code and returns an array for a node
+ * @access private
+ * @return array
+ * @param string $line A line from the YAML file
+ */
+ private function _parseLine($line) {
+ $line = trim($line);
+
+ $array = array();
+
+ if (preg_match('/^-(.*):$/',$line)) {
+ // It's a mapped sequence
+ $key = trim(substr(substr($line,1),0,-1));
+ $array[$key] = '';
+ } elseif ($line[0] == '-' && substr($line,0,3) != '---') {
+ // It's a list item but not a new stream
+ if (strlen($line) > 1) {
+ $value = trim(substr($line,1));
+ // Set the type of the value. Int, string, etc
+ $value = $this->_toType($value);
+ $array[] = $value;
+ } else {
+ $array[] = array();
+ }
+ } elseif (preg_match('/^(.+):/',$line,$key)) {
+ // It's a key/value pair most likely
+ // If the key is in double quotes pull it out
+ if (preg_match('/^(["\'](.*)["\'](\s)*:)/',$line,$matches)) {
+ $value = trim(str_replace($matches[1],'',$line));
+ $key = $matches[2];
+ } else {
+ // Do some guesswork as to the key and the value
+ $explode = explode(':',$line);
+ $key = trim($explode[0]);
+ array_shift($explode);
+ $value = trim(implode(':',$explode));
+ }
+
+ // Set the type of the value. Int, string, etc
+ $value = $this->_toType($value);
+ if (empty($key)) {
+ $array[] = $value;
+ } else {
+ $array[$key] = $value;
+ }
+ }
+ return $array;
+ }
+
+ /**
+ * Finds the type of the passed value, returns the value as the new type.
+ * @access private
+ * @param string $value
+ * @return mixed
+ */
+ private function _toType($value) {
+ if (preg_match('/^("(.*)"|\'(.*)\')/',$value,$matches)) {
+ $value = (string)preg_replace('/(\'\'|\\\\\')/',"'",end($matches));
+ $value = preg_replace('/\\\\"/','"',$value);
+ } elseif (preg_match('/^\\[(.+)\\]$/',$value,$matches)) {
+ // Inline Sequence
+
+ // Take out strings sequences and mappings
+ $explode = $this->_inlineEscape($matches[1]);
+
+ // Propogate value array
+ $value = array();
+ foreach ($explode as $v) {
+ $value[] = $this->_toType($v);
+ }
+ } elseif (strpos($value,': ')!==false && !preg_match('/^{(.+)/',$value)) {
+ // It's a map
+ $array = explode(': ',$value);
+ $key = trim($array[0]);
+ array_shift($array);
+ $value = trim(implode(': ',$array));
+ $value = $this->_toType($value);
+ $value = array($key => $value);
+ } elseif (preg_match("/{(.+)}$/",$value,$matches)) {
+ // Inline Mapping
+
+ // Take out strings sequences and mappings
+ $explode = $this->_inlineEscape($matches[1]);
+
+ // Propogate value array
+ $array = array();
+ foreach ($explode as $v) {
+ $array = $array + $this->_toType($v);
+ }
+ $value = $array;
+ } elseif (strtolower($value) == 'null' or $value == '' or $value == '~') {
+ $value = NULL;
+ } elseif (preg_match ('/^[0-9]+$/', $value)) {
+ $value = (int)$value;
+ } elseif (in_array(strtolower($value),
+ array('true', 'on', '+', 'yes', 'y'))) {
+ $value = TRUE;
+ } elseif (in_array(strtolower($value),
+ array('false', 'off', '-', 'no', 'n'))) {
+ $value = FALSE;
+ } elseif (is_numeric($value)) {
+ $value = (float)$value;
+ } else {
+ // Just a normal string, right?
+ $value = trim(preg_replace('/#(.+)$/','',$value));
+ }
+
+ return $value;
+ }
+
+ /**
+ * Used in inlines to check for more inlines or quoted strings
+ * @access private
+ * @return array
+ */
+ private function _inlineEscape($inline) {
+ // There's gotta be a cleaner way to do this...
+ // While pure sequences seem to be nesting just fine,
+ // pure mappings and mappings with sequences inside can't go very
+ // deep. This needs to be fixed.
+
+ $saved_strings = array();
+
+ // Check for strings
+ $regex = '/(?:(")|(?:\'))((?(1)[^"]+|[^\']+))(?(1)"|\')/';
+ if (preg_match_all($regex,$inline,$strings)) {
+ $saved_strings = $strings[0];
+ $inline = preg_replace($regex,'YAMLString',$inline);
+ }
+ unset($regex);
+
+ // Check for sequences
+ if (preg_match_all('/\[(.+)\]/U',$inline,$seqs)) {
+ $inline = preg_replace('/\[(.+)\]/U','YAMLSeq',$inline);
+ $seqs = $seqs[0];
+ }
+
+ // Check for mappings
+ if (preg_match_all('/{(.+)}/U',$inline,$maps)) {
+ $inline = preg_replace('/{(.+)}/U','YAMLMap',$inline);
+ $maps = $maps[0];
+ }
+
+ $explode = explode(', ',$inline);
+
+
+ // Re-add the sequences
+ if (!empty($seqs)) {
+ $i = 0;
+ foreach ($explode as $key => $value) {
+ if (strpos($value,'YAMLSeq') !== false) {
+ $explode[$key] = str_replace('YAMLSeq',$seqs[$i],$value);
+ ++$i;
}
}
}
- }
- return true;
- }
- function _linkRef(&$n,$key,$k = NULL,$v = NULL) {
- if (empty($k) && empty($v)) {
- // Look for &refs
- if (preg_match('/^&([^ ]+)/',$n->data[$key],$matches)) {
- // Flag the node so we know it's a reference
- $this->_allNodes[$n->id]->ref = substr($matches[0],1);
- $this->_allNodes[$n->id]->data[$key] =
- substr($n->data[$key],strlen($matches[0])+1);
- // Look for *refs
- } elseif (preg_match('/^\*([^ ]+)/',$n->data[$key],$matches)) {
- $ref = substr($matches[0],1);
- // Flag the node as having a reference
- $this->_allNodes[$n->id]->refKey = $ref;
- }
- } elseif (!empty($k) && !empty($v)) {
- if (preg_match('/^&([^ ]+)/',$v,$matches)) {
- // Flag the node so we know it's a reference
- $this->_allNodes[$n->id]->ref = substr($matches[0],1);
- $this->_allNodes[$n->id]->data[$key][$k] =
- substr($v,strlen($matches[0])+1);
- // Look for *refs
- } elseif (preg_match('/^\*([^ ]+)/',$v,$matches)) {
- $ref = substr($matches[0],1);
- // Flag the node as having a reference
- $this->_allNodes[$n->id]->refKey = $ref;
- }
- }
- }
-
- /**
- * Finds the children of a node and aids in the building of the PHP array
- * @access private
- * @param int $nid The id of the node whose children we're gathering
- * @return array
- */
- private function _gatherChildren($nid) {
- $return = array();
- $node =& $this->_allNodes[$nid];
- if (is_array ($this->_allParent[$node->id])) {
- foreach ($this->_allParent[$node->id] as $nodeZ) {
- $z =& $this->_allNodes[$nodeZ];
- // We found a child
- $this->_nodeArrayizeData($z);
- // Check for references
- $this->_makeReferences($z);
- // Merge with the big array we're returning
- // The big array being all the data of the children of our parent node
- $return = $this->_array_kmerge($return,$z->data);
- }
- }
- return $return;
- }
-
- /**
- * Turns a node's data and its children's data into a PHP array
- *
- * @access private
- * @param array $node The node which you want to arrayize
- * @return boolean
- */
- private function _nodeArrayizeData(&$node) {
- if (is_array($node->data) && $node->children == true) {
- // This node has children, so we need to find them
- $childs = $this->_gatherChildren($node->id);
- // We've gathered all our children's data and are ready to use it
- $key = key($node->data);
- $key = empty($key) ? 0 : $key;
- // If it's an array, add to it of course
- if (isset ($node->data[$key])) {
- if (is_array($node->data[$key])) {
- $node->data[$key] = $this->_array_kmerge($node->data[$key],$childs);
- } else {
- $node->data[$key] = $childs;
+ // Re-add the mappings
+ if (!empty($maps)) {
+ $i = 0;
+ foreach ($explode as $key => $value) {
+ if (strpos($value,'YAMLMap') !== false) {
+ $explode[$key] = str_replace('YAMLMap',$maps[$i],$value);
+ ++$i;
}
- } else {
- $node->data[$key] = $childs;
+ }
}
- } elseif (!is_array($node->data) && $node->children == true) {
- // Same as above, find the children of this node
- $childs = $this->_gatherChildren($node->id);
- $node->data = array();
- $node->data[] = $childs;
+
+
+ // Re-add the strings
+ if (!empty($saved_strings)) {
+ $i = 0;
+ foreach ($explode as $key => $value) {
+ while (strpos($value,'YAMLString') !== false) {
+ $explode[$key] = preg_replace('/YAMLString/',$saved_strings[$i],$value, 1);
+ ++$i;
+ $value = $explode[$key];
+ }
+ }
+ }
+
+ return $explode;
}
- // We edited $node by reference, so just return true
- return true;
- }
+ /**
+ * Builds the PHP array from all the YAML nodes we've gathered
+ * @access private
+ * @return array
+ */
+ private function _buildArray() {
+ $trunk = array();
- /**
- * Traverses node-space and copies references to / from this object.
- * @access private
- * @param object $z A node whose references we wish to make real
- * @return bool
- */
- private function _makeReferences(&$z) {
- // It is a reference
- if (isset($z->ref)) {
- $key = key($z->data);
- // Copy the data to this object for easy retrieval later
- $this->ref[$z->ref] =& $z->data[$key];
- // It has a reference
- } elseif (isset($z->refKey)) {
- if (isset($this->ref[$z->refKey])) {
- $key = key($z->data);
- // Copy the data from this object to make the node a real reference
- $z->data[$key] =& $this->ref[$z->refKey];
+ if (!isset($this->_indentSort[0])) {
+ return $trunk;
+ }
+
+ foreach ($this->_indentSort[0] as $n) {
+ if (empty($n->parent)) {
+ $this->_nodeArrayizeData($n);
+ // Check for references and copy the needed data to complete them.
+ $this->_makeReferences($n);
+ // Merge our data with the big array we're building
+ $trunk = $this->_array_kmerge($trunk,$n->data);
+ }
+ }
+
+ return $trunk;
+ }
+
+ /**
+ * Traverses node-space and sets references (& and *) accordingly
+ * @access private
+ * @return bool
+ */
+ private function _linkReferences() {
+ if (is_array($this->_haveRefs)) {
+ foreach ($this->_haveRefs as $node) {
+ if (!empty($node->data)) {
+ $key = key($node->data);
+ // If it's an array, don't check.
+ if (is_array($node->data[$key])) {
+ foreach ($node->data[$key] as $k => $v) {
+ $this->_linkRef($node,$key,$k,$v);
+ }
+ } else {
+ $this->_linkRef($node,$key);
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+ function _linkRef(&$n,$key,$k = NULL,$v = NULL) {
+ if (empty($k) && empty($v)) {
+ // Look for &refs
+ if (preg_match('/^&([^ ]+)/',$n->data[$key],$matches)) {
+ // Flag the node so we know it's a reference
+ $this->_allNodes[$n->id]->ref = substr($matches[0],1);
+ $this->_allNodes[$n->id]->data[$key] =
+ substr($n->data[$key],strlen($matches[0])+1);
+ // Look for *refs
+ } elseif (preg_match('/^\*([^ ]+)/',$n->data[$key],$matches)) {
+ $ref = substr($matches[0],1);
+ // Flag the node as having a reference
+ $this->_allNodes[$n->id]->refKey = $ref;
+ }
+ } elseif (!empty($k) && !empty($v)) {
+ if (preg_match('/^&([^ ]+)/',$v,$matches)) {
+ // Flag the node so we know it's a reference
+ $this->_allNodes[$n->id]->ref = substr($matches[0],1);
+ $this->_allNodes[$n->id]->data[$key][$k] =
+ substr($v,strlen($matches[0])+1);
+ // Look for *refs
+ } elseif (preg_match('/^\*([^ ]+)/',$v,$matches)) {
+ $ref = substr($matches[0],1);
+ // Flag the node as having a reference
+ $this->_allNodes[$n->id]->refKey = $ref;
+ }
}
}
- return true;
- }
-
- /**
- * Merges arrays and maintains numeric keys.
- *
- * An ever-so-slightly modified version of the array_kmerge() function posted
- * to php.net by mail at nospam dot iaindooley dot com on 2004-04-08.
- *
- * http://us3.php.net/manual/en/function.array-merge.php
- *
- * @access private
- * @param array $arr1
- * @param array $arr2
- * @return array
- */
- private function _array_kmerge($arr1,$arr2) {
- if(!is_array($arr1)) $arr1 = array();
- if(!is_array($arr2)) $arr2 = array();
-
- $keys = array_merge(array_keys($arr1),array_keys($arr2));
- $vals = array_merge(array_values($arr1),array_values($arr2));
- $ret = array();
- foreach($keys as $key) {
- list($unused,$val) = each($vals);
- if (isset($ret[$key]) and is_int($key)) $ret[] = $val; else $ret[$key] = $val;
+ /**
+ * Finds the children of a node and aids in the building of the PHP array
+ * @access private
+ * @param int $nid The id of the node whose children we're gathering
+ * @return array
+ */
+ private function _gatherChildren($nid) {
+ $return = array();
+ $node =& $this->_allNodes[$nid];
+ if (is_array ($this->_allParent[$node->id])) {
+ foreach ($this->_allParent[$node->id] as $nodeZ) {
+ $z =& $this->_allNodes[$nodeZ];
+ // We found a child
+ $this->_nodeArrayizeData($z);
+ // Check for references
+ $this->_makeReferences($z);
+ // Merge with the big array we're returning
+ // The big array being all the data of the children of our parent node
+ $return = $this->_array_kmerge($return,$z->data);
+ }
+ }
+ return $return;
+ }
+
+ /**
+ * Turns a node's data and its children's data into a PHP array
+ *
+ * @access private
+ * @param array $node The node which you want to arrayize
+ * @return boolean
+ */
+ private function _nodeArrayizeData(&$node) {
+ if (is_array($node->data) && $node->children == true) {
+ // This node has children, so we need to find them
+ $childs = $this->_gatherChildren($node->id);
+ // We've gathered all our children's data and are ready to use it
+ $key = key($node->data);
+ $key = empty($key) ? 0 : $key;
+ // If it's an array, add to it of course
+ if (isset ($node->data[$key])) {
+ if (is_array($node->data[$key])) {
+ $node->data[$key] = $this->_array_kmerge($node->data[$key],$childs);
+ } else {
+ $node->data[$key] = $childs;
+ }
+ } else {
+ $node->data[$key] = $childs;
+ }
+ } elseif (!is_array($node->data) && $node->children == true) {
+ // Same as above, find the children of this node
+ $childs = $this->_gatherChildren($node->id);
+ $node->data = array();
+ $node->data[] = $childs;
+ }
+
+ // We edited $node by reference, so just return true
+ return true;
+ }
+
+ /**
+ * Traverses node-space and copies references to / from this object.
+ * @access private
+ * @param object $z A node whose references we wish to make real
+ * @return bool
+ */
+ private function _makeReferences(&$z) {
+ // It is a reference
+ if (isset($z->ref)) {
+ $key = key($z->data);
+ // Copy the data to this object for easy retrieval later
+ $this->ref[$z->ref] =& $z->data[$key];
+ // It has a reference
+ } elseif (isset($z->refKey)) {
+ if (isset($this->ref[$z->refKey])) {
+ $key = key($z->data);
+ // Copy the data from this object to make the node a real reference
+ $z->data[$key] =& $this->ref[$z->refKey];
+ }
+ }
+ return true;
+ }
+
+
+ /**
+ * Merges arrays and maintains numeric keys.
+ *
+ * An ever-so-slightly modified version of the array_kmerge() function posted
+ * to php.net by mail at nospam dot iaindooley dot com on 2004-04-08.
+ *
+ * http://us3.php.net/manual/en/function.array-merge.php#41394
+ *
+ * @access private
+ * @param array $arr1
+ * @param array $arr2
+ * @return array
+ */
+ private function _array_kmerge($arr1,$arr2) {
+ if(!is_array($arr1)) $arr1 = array();
+ if(!is_array($arr2)) $arr2 = array();
+
+ $keys = array_merge(array_keys($arr1),array_keys($arr2));
+ $vals = array_merge(array_values($arr1),array_values($arr2));
+ $ret = array();
+ foreach($keys as $key) {
+ list($unused,$val) = each($vals);
+ if (isset($ret[$key]) and is_int($key)) $ret[] = $val; else $ret[$key] = $val;
+ }
+ return $ret;
}
- return $ret;
}
-}
?>
diff --git a/cli-script.php b/cli-script.php
index bf00e3fed..10e2a807a 100755
--- a/cli-script.php
+++ b/cli-script.php
@@ -1,24 +1,13 @@
#!/usr/bin/php5
disableBasicAuth();
diff --git a/cli/DailyTask.php b/cli/DailyTask.php
index 92e00dbee..9a6c8ae0f 100755
--- a/cli/DailyTask.php
+++ b/cli/DailyTask.php
@@ -1,14 +1,7 @@
+ * Usage:
* new ArrayData(array(
* "ClassName" => "Page",
* "AddAction" => "Add a new Page page",
* ));
- *
- *
- * @package sapphire
- * @subpackage view
*/
class ArrayData extends ViewableData {
protected $array;
- /**
- * @param object|array $array Either an object with simple properties or an associative array.
- * Converts object-properties to indices of an associative array.
- */
public function __construct($array) {
- if(is_object($array)) {
- $this->array = self::object_to_array($array);
- } elseif(is_array($array) && ArrayLib::is_associative($array)) {
- $this->array = $array;
- } else {
- $this->array = $array;
- user_error(
- "ArrayData::__construct: Parameter needs to be an object or associative array",
- E_USER_WARNING
- );
- }
+ $this->array = $array;
}
public function getField($f) {
@@ -52,24 +31,6 @@ class ArrayData extends ViewableData {
return isset($this->array[$f]);
}
- /**
- * Converts an object with simple properties to
- * an associative array.
- *
- * @todo Allow for recursive creation of DataObjectSets when property value is an object/array
- *
- * @param obj $obj
- * @return array
- */
- static function object_to_array($obj) {
- $arr = array();
- foreach($obj as $k=>$v) {
- $arr[$k] = $v;
- }
-
- return $arr;
- }
-
}
?>
\ No newline at end of file
diff --git a/core/ArrayLib.php b/core/ArrayLib.php
index 985fd3ecf..1b3171f38 100755
--- a/core/ArrayLib.php
+++ b/core/ArrayLib.php
@@ -1,15 +1,5 @@
\ No newline at end of file
diff --git a/core/ClassInfo.php b/core/ClassInfo.php
index 4f95c5d66..c72f370c3 100755
--- a/core/ClassInfo.php
+++ b/core/ClassInfo.php
@@ -1,17 +1,8 @@
implementsInterface($interfaceName)) {
+ $matchingClasses[$potentialClass] = $potentialClass;
+ }
+ }
+ }
+
+ self::$implementors_of[$interfaceName] = $matchingClasses;
+
+ return $matchingClasses;
}
}
?>
\ No newline at end of file
diff --git a/core/Convert.php b/core/Convert.php
index 1dd5bf107..7530cbd53 100755
--- a/core/Convert.php
+++ b/core/Convert.php
@@ -1,10 +1,5 @@
hasMethod('debug');
- } else {
- $hasDebugMethod = method_exists($val, 'debug');
- }
-
- if($hasDebugMethod) {
- return $val->debug();
- }
- }
-
- if(is_array($val)) {
- $result = "\n";
- foreach($val as $k => $v) {
- $result .= "
\n";
-
- } else if (is_object($val)) {
- $val = var_export($val, true);
+ if(is_object($val) && $val->hasMethod('debug')) {
+ return $val->debug();
} else {
- if(true || !Director::is_ajax()) {
- $val = "" . htmlentities($val) . "
\n";
- }
- }
+ if(is_array($val)) {
+ $result = "\n";
+ foreach($val as $k => $v) {
+ $result .= "
\n";
- return $val;
+ } else if (is_object($val)) {
+ $val = var_export($val, true);
+ } else {
+ if(true || !Director::is_ajax()) {
+ $val = "" . htmlentities($val) . "
\n";
+ }
+ }
+
+ return $val;
+ }
}
/**
@@ -112,27 +85,23 @@ class Debug {
/**
* Load an error handler
- *
- * @todo why does this delegate to loadFatalErrorHandler?
*/
static function loadErrorHandlers() {
Debug::loadFatalErrorHandler();
}
- /**
- * @todo can this be moved into loadErrorHandlers?
- */
static function loadFatalErrorHandler() {
- set_error_handler('errorHandler', (E_ALL ^ E_NOTICE) ^ E_USER_NOTICE);
- set_exception_handler('exceptionHandler');
+ set_error_handler('errorHandler', E_ALL & ~E_NOTICE);
}
static function warningHandler($errno, $errstr, $errfile, $errline, $errcontext) {
- if(error_reporting() == 0) return;
if(self::$send_warnings_to) self::emailError(self::$send_warnings_to, $errno, $errstr, $errfile, $errline, $errcontext, "Warning");
if(Director::isDev()) {
- self::showError($errno, $errstr, $errfile, $errline, $errcontext);
+ if(error_reporting() != 0) { // otherwise the error was suppressed with @
+ self::showError($errno, $errstr, $errfile, $errline, $errcontext);
+ die();
+ }
}
}
@@ -151,13 +120,14 @@ class Debug {
header("HTTP/1.0 500 Internal server error");
if(Director::is_ajax()) {
- echo "There has been an error";
+ echo "ERROR:There has been an error";
} else {
if(file_exists('../assets/error-500.html')) {
+ echo "ERROR:";
include('../assets/error-500.html');
} else {
- echo "Error
Error
\n At line $errline in $errfile
\n
\nContext
\n";
Debug::show($errcontext);
@@ -200,10 +169,7 @@ class Debug {
if(self::$custom_smtp_server) {
ini_set("SMTP", self::$custom_smtp_server);
}
-
- $relfile = Director::makeRelative($errfile);
- if($relfile[0] == '/') $relfile = substr($relfile,1);
- mail($emailAddress, "$errorType at $relfile line $errline (http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI])", $data, "Content-type: text/html\nFrom: errors@silverstripe.com");
+ mail($emailAddress, "$errorType on $_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]", $data, "Content-type: text/html\nFrom: errors@silverstripe.com");
}
/**
@@ -248,10 +214,9 @@ class Debug {
/**
* Deprecated. Send live errors and warnings to the given address.
- * @deprecated Use send_errors_to() instead.
+ * Use send_errors_to() instead.
*/
static function sendLiveErrorsTo($emailAddress) {
- user_error('Debug::sendLiveErrorsTo() is deprecated. Use Debug::send_errors_to() instead.', E_USER_NOTICE);
if(!Director::isDev()) self::send_errors_to($emailAddress, true);
}
@@ -270,11 +235,11 @@ class Debug {
$bt = debug_backtrace();
// Ingore functions that are plumbing of the error handler
- $ignoredFunctions = array('Debug::emailError','Debug::warningHandler','Debug::fatalHandler','errorHandler','Debug::showError','Debug::backtrace', 'exceptionHandler');
+ $ignoredFunctions = array('Debug::emailError','Debug::warningHandler','Debug::fatalHandler','errorHandler','Debug::showError','Debug::backtrace');
while( $bt && in_array(self::full_func_name($bt[0]), $ignoredFunctions) ) {
array_shift($bt);
}
-
+
$result = "";
foreach($bt as $item) {
if(Director::is_ajax() && !$ignoreAjax) {
@@ -287,12 +252,9 @@ class Debug {
$result .= "
Sorry, it seems you were trying to access a page that doesn\'t exist.
Please check the spelling of the URL you were trying to access and try again.
'); + $errorpage->Content = "Sorry, it seems you were trying to access a page that doesn't exist.
Please check the spelling of the URL you were trying to access and try again.
"; $errorpage->Status = "New page"; $errorpage->write(); // Don't publish, as the manifest may not be built yet @@ -50,29 +50,8 @@ class ErrorPage extends Page { "ErrorCode", _t('ErrorPage.CODE', "Error code"), array( - 400 => _t('ErrorPage.400', '400 - Bad Request'), - 401 => _t('ErrorPage.401', '401 - Unauthorized'), - 403 => _t('ErrorPage.403', '403 - Forbidden'), - 404 => _t('ErrorPage.404', '404 - Not Found'), - 405 => _t('ErrorPage.405', '405 - Method Not Allowed'), - 406 => _t('ErrorPage.406', '406 - Not Acceptable'), - 407 => _t('ErrorPage.407', '407 - Proxy Authentication Required'), - 408 => _t('ErrorPage.408', '408 - Request Timeout'), - 409 => _t('ErrorPage.409', '409 - Conflict'), - 410 => _t('ErrorPage.410', '410 - Gone'), - 411 => _t('ErrorPage.411', '411 - Length Required'), - 412 => _t('ErrorPage.412', '412 - Precondition Failed'), - 413 => _t('ErrorPage.413', '413 - Request Entity Too Large'), - 414 => _t('ErrorPage.414', '414 - Request-URI Too Long'), - 415 => _t('ErrorPage.415', '415 - Unsupported Media Type'), - 416 => _t('ErrorPage.416', '416 - Request Range Not Satisfiable'), - 417 => _t('ErrorPage.417', '417 - Expectation Failed'), - 500 => _t('ErrorPage.500', '500 - Internal Server Error'), - 501 => _t('ErrorPage.501', '501 - Not Implemented'), - 502 => _t('ErrorPage.502', '502 - Bad Gateway'), - 503 => _t('ErrorPage.503', '503 - Service Unavailable'), - 504 => _t('ErrorPage.504', '504 - Gateway Timeout'), - 505 => _t('ErrorPage.505', '505 - HTTP Version Not Supported'), + 404 => "404 - Page not found", + 500 => "500 - Server error" ) ), "Content" @@ -125,7 +104,6 @@ class ErrorPage extends Page { /** * Controller for ErrorPages. - * @package cms */ class ErrorPage_Controller extends Page_Controller { public function init() { diff --git a/core/model/GhostPage.php b/core/model/GhostPage.php index f9f74b307..801ee3660 100755 --- a/core/model/GhostPage.php +++ b/core/model/GhostPage.php @@ -1,13 +1,13 @@ . */ public function partialTreeAsUL($minCount = 50) { $children = $this->owner->AllChildren(); @@ -335,7 +333,7 @@ class Hierarchy extends DataObjectDecorator { continue; } $idList[] = $child->ID; - $child->extInstance('Hierarchy')->loadDescendantIDListInto($idList); + $child->loadDescendantIDListInto($idList); } } } @@ -524,7 +522,7 @@ class Hierarchy extends DataObjectDecorator { * Get the next node in the tree of the type. If there is no instance of the className descended from this node, * then search the parents. * - * @todo Write! + * TODO Write! */ public function naturalPrev( $className, $afterNode = null ) { return null; diff --git a/core/model/Image.php b/core/model/Image.php index de190de05..a426b5555 100755 --- a/core/model/Image.php +++ b/core/model/Image.php @@ -2,13 +2,11 @@ /** * @package sapphire - * @subpackage filesystem + * @subpackage core */ /** * Represents an image attached to a page. - * @package sapphire - * @subpackage filesystem */ class Image extends File { /** @@ -264,9 +262,9 @@ class Image extends File { * Generate an image on the specified format. It will save the image * at the location specified by cacheFilename(). The image will be generated * using the specific 'generate' method for the specified format. - * @param string $format Name of the format to generate. - * @param string $arg1 Argument to pass to the generate method. - * @param string $arg2 A second argument to pass to the generate method. + * @var string $format Name of the format to generate. + * @var string $arg1 Argument to pass to the generate method. + * @var string $arg2 A second argument to pass to the generate method. */ function generateFormattedImage($format, $arg1 = null, $arg2 = null) { $cacheFile = $this->cacheFilename($format, $arg1, $arg2); @@ -367,11 +365,7 @@ class Image extends File { } /** - * A resized / processed {@link Image} object. - * When Image object are processed or resized, a suitable Image_Cached object is returned, pointing to the - * cached copy of the processed image. - * @package sapphire - * @subpackage filesystem + * Image not stored in the database, that is just a cached resampled image */ class Image_Cached extends Image { /** @@ -399,12 +393,6 @@ class Image_Cached extends Image { } } -/** - * A db field type designed to help save images. - * @deprecated Use a has_one relationship pointing to the file table instead. - * @package sapphire - * @subpackage filesystem - */ class Image_Saver extends DBField { function saveInto($record) { $image = $record->getComponent($this->name); @@ -424,17 +412,14 @@ class Image_Saver extends DBField { } /** - * Uploader support for the uploading anything which is a File or subclass of File, eg Image. - * @package sapphire - * @subpackage filesystem + * Uploader support for the uploading anything which is a File or subclass of + * File, eg Image. */ class Image_Uploader extends Controller { /** * Ensures the css is loaded for the iframe. */ function iframe() { - if(!Permission::check('ADMIN')) Security::permissionFailure($this); - Requirements::css("cms/css/Image_iframe.css"); return array(); } @@ -605,25 +590,34 @@ class Image_Uploader extends Controller { _t('ImageUploader.DELETE', 'Delete %s', PR_MEDIUM, 'Delete file/image'), $type ); - $form = new Form( + return new Form( $this, 'DeleteImageForm', new FieldSet( new HiddenField("Class", null, $this->urlParams['Class']), new HiddenField("ID", null, $this->urlParams['ID']), - new HiddenField("Field", null, $this->urlParams['Field']) + new HiddenField("Field", null, $this->urlParams['Field']), + new HeaderField($title), + new LabelField( + sprintf( + _t( + 'ImageUploader.CLICKREMOVE', + "Click the button below to remove this %s.", + PR_MEDIUM, + '... this image/file' + ), + $type + ) + ) ), new FieldSet( - $deleteAction = new ConfirmedFormAction( + new ConfirmedFormAction( "delete", $title, sprintf(_t('ImageUploader.REALLYDELETE', "Do you really want to remove this %s?"), $type) ) ) ); - $deleteAction->addExtraClass('delete'); - - return $form; } } @@ -638,7 +632,7 @@ class Image_Uploader extends Controller { } $owner = DataObject::get_by_id($data['Class'], $data['ID']); $fieldName = $data['Field'] . 'ID'; - + if($data['ImageSource'] == 'existing') { if(!$data['ExistingFile']) { // No image has been selected @@ -651,14 +645,6 @@ class Image_Uploader extends Controller { // Edit the class name, if applicable $existingFile = DataObject::get_by_id("File", $data['ExistingFile']); $desiredClass = $owner->has_one($data['Field']); - - // Unless specifically asked, we don't want the user to be able - // to select a folder - if(is_a($existingFile, 'Folder') && $desiredClass != 'Folder') { - Director::redirectBack(); - return; - } - if(!is_a($existingFile, $desiredClass)) { $existingFile->ClassName = $desiredClass; $existingFile->write(); @@ -704,8 +690,6 @@ class Image_Uploader extends Controller { * Flush all of the generated images. */ function flush() { - if(!Permission::check('ADMIN')) Security::permissionFailure($this); - $images = DataObject::get("Image",""); $numItems = 0; $num = 0; @@ -726,8 +710,6 @@ class Image_Uploader extends Controller { * @deprecated This function is only used to migrate content from old databases. */ function transferlegacycontent() { - if(!Permission::check('ADMIN')) Security::permissionFailure($this); - $images = DB::query("SELECT * FROM _obsolete_Image"); echo "'; + print_r($parameters); + echo ''; + $type=$parameters['pdo_type']; + /*switch ($parameters['pdo_type']) { case "mysql": $port = '3306'; $type = 'mysql'; @@ -98,12 +102,25 @@ class PDODatabase extends Database { break; default: $this->databaseError("This database server is not available"); - } + }*/ + /* if (isset($parameters['port']) && is_numeric($parameters['port'])) { $port = $parameters['port']; + } else { + //assumes that a port is required for a database connection + $this->databaseError("This database server is not available"); } $connect = $type . ':host=' . $parameters['server'] . $instance . ';port=' . $port; return $connect; + }*/ + public function getConnect(){ + Debug::backtrace(); + user_error("PDODatabase subclasses need to implement getConnect", E_USER_ERROR); + //echo 'getting getConnect with these parameters:
'; + //print_r($parameters); + //echo ''; + //return $this->getConnect($parameters); + } /** @@ -231,9 +248,11 @@ class PDODatabase extends Database { * @param string $password Database Password * @param string $database Database to which to create * @return boolean Returns true if successful - * @todo This shouldn't take any arguments; it should take the information given in the constructor instead. */ - public function createDatabase($connect, $username, $password, $database) { + public function createDatabase($connect, $username, $password, $database) { + echo 'connect:
'; + print_r($connect); + echo ''; try { $dbh = new PDO($connect, $username, $password); $stmt = $dbh->prepare("CREATE DATABASE $database"); @@ -290,7 +309,7 @@ class PDODatabase extends Database { if ($fields) { foreach($fields as $k => $v) $fieldSchemas .= "`$k` $v,\n"; } - + echo 'boo!'; switch (self::getDatabaseServer()) { case "mysql": $stmt = $this->dbConn->prepare("CREATE TABLE $tableName (ID INT(11) NOT NULL AUTO_INCREMENT, $fieldSchemas PRIMARY KEY (ID)) TYPE=MyISAM"); @@ -313,11 +332,11 @@ class PDODatabase extends Database { /** * Alter fields and indexes in existing table. - * @param string $tableName The name of the table. - * @param string $newFields Fields to add. - * @param string $newIndexes Indexes to add. - * @param string $alteredFields Fields to change. - * @param string $alteredIndexes Indexes to change. + * @var string $tableName The name of the table. + * @var string $newFields Fields to add. + * @var string $newIndexes Indexes to add. + * @var string $alteredFields Fields to change. + * @var string $alteredIndexes Indexes to change. * @return void. */ public function alterTable($table, $newFields = null, $newIndexes = null, $alteredFields = null, $alteredIndexes = null) { @@ -353,8 +372,8 @@ class PDODatabase extends Database { /** * Rename an existing table, the TO is necessary for PostgreSQL and MS SQL. - * @param string $oldTableName The name of the existing table. - * @param string $newTableName How the table should be named from now on. + * @var string $oldTableName The name of the existing table. + * @var string $newTableName How the table should be named from now on. * @return void. */ public function renameTable($oldTableName, $newTableName) { @@ -368,7 +387,7 @@ class PDODatabase extends Database { * @return boolean Return true if the table has integrity after the method is complete. */ public function checkAndRepairTable($tableName) { - if ($parameters['type'] == "mysql") { + if ($parameters['pdo_type'] == "mysql") { if (!$this->runTableCheckCommand("CHECK TABLE `$tableName`")) { if(!Database::$supressOutput) { echo "
'; + //Debug::show($parameters); + echo ''; + + //if (isset ( $parameters ['port'] ) && is_numeric ( $parameters ['port'] )) + if(isset($this->port) && is_numeric($this->port)) + $port = ';port=' . $parameters ['port']; else + $port = ''; + + $connect = $this->pdo_type . ':host=' . $this->server . $this->instance . $port . '; user=' . $this->username . '; password=' . $this->password; + echo 'returning ' . $connect . '
Welcome to SilverStripe! This is the default homepage. You can edit this page by opening the CMS. You can now access the developer documentation, or begin the tutorials.
'); + $homepage->Title = "Home"; + $homepage->Content = "Welcome to SilverStripe! This is the default homepage. You can edit this page by opening the CMS. You can now access the developer documentation, or begin the tutorials.
"; $homepage->URLSegment = "home"; $homepage->Status = "Published"; $homepage->write(); @@ -723,8 +711,8 @@ class SiteTree extends DataObject { if(DB::query("SELECT COUNT(*) FROM SiteTree")->value() == 1) { $aboutus = new Page(); - $aboutus->Title = _t('SiteTree.DEFAULTABOUTTITLE', 'About Us'); - $aboutus->Content = _t('SiteTree.DEFAULTABOUTCONTENT', 'You can fill this page out with your own content, or delete it and create your own pages.
You can fill this page out with your own content, or delete it and create your own pages.
You can fill this page out with your own content, or delete it and create your own pages.
You can fill this page out with your own content, or delete it and create your own pages.
You can use this to keep track of work that needs to be done to the content of your site. To see all your pages with to do information, open the 'Site Reports' window on the left and select 'To Do'
")), - new TextareaField("ToDo", "") - ), $tabReports = new TabSet('Reports', $tabBacklinks =new Tab('Backlinks', new LiteralField("Backlinks", $backlinks) @@ -1227,30 +1211,14 @@ class SiteTree extends DataObject { $instance = singleton($class); if((($instance instanceof HiddenClass) || !$instance->canCreate()) && ($class != $this->class)) continue; - /* $addAction = $instance->uninherited('add_action', true); - if(!$addAction) { - $addAction = $instance->singular_name(); - } - */ - $addAction = $instance->i18n_singular_name(); + if(!$addAction) $addAction = "a $class"; - if($class == $this->class) { - $currentClass = $class; - $currentAddAction = $addAction; - } else { - $result[$class] = ($class == $this->class) - ? _t('SiteTree.CURRENTLY', 'Currently').' '.$addAction - : _t('SiteTree.CHANGETO', 'Change to').' '.$addAction; - } + $result[$class] = ($class == $this->class) + ? "Currently $addAction" + : "Change to $addAction"; } - - // sort alphabetically, and put current on top - asort($result); - $result = array_reverse($result); - $result[$currentClass] = $currentAddAction.' ('._t('SiteTree.CURRENT','current').')'; - $result = array_reverse($result); - + return $result; } @@ -1374,26 +1342,13 @@ class SiteTree extends DataObject { "span title=\"" . _t('SiteTree.MODIFIEDONDRAFT', 'Modified on draft site') . "\" class=\"modified\"" : ""))); if($tag) { - return "<$tag>" . $this->MenuTitle . "" . strtok($tag,' ') . ">"; + return "<$tag>" . $this->Title . "" . strtok($tag,' ') . ">"; } else { - return $this->MenuTitle; + return $this->Title; } } - /** - * Returns the page in the current page stack of the given level. - * Level(1) will return the main menu item that we're currently inside, etc. - */ - public function Level($level) { - $parent = $this; - $stack = array($parent); - while($parent = $parent->Parent) { - array_unshift($stack, $parent); - } - return isset($stack[$level-1]) ? $stack[$level-1] : null; - } - /** * Return the CSS classes to apply to this node in the CMS tree * @@ -1415,9 +1370,6 @@ class SiteTree extends DataObject { if($controller->isCurrentPage($this)) $classes .= " current"; - if(!$this->canEdit() && !$this->canAddChildren()) - $classes .= " disabled"; - $classes .= $this->markingClasses(); return $classes; diff --git a/core/model/Staged.php b/core/model/Staged.php new file mode 100755 index 000000000..703ecfc28 --- /dev/null +++ b/core/model/Staged.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/core/model/Translatable.php b/core/model/Translatable.php index b7d9cd1b9..3958ad405 100755 --- a/core/model/Translatable.php +++ b/core/model/Translatable.php @@ -1,10 +1,5 @@ - * @package sapphire - * @subpackage misc + * */ class Translatable extends DataObjectDecorator { @@ -149,7 +143,7 @@ class Translatable extends DataObjectDecorator { /** * Set default language. * - * @param $lang String + * @paran $lang String */ static function set_default_lang($lang) { self::$default_lang = $lang; @@ -610,17 +604,17 @@ class Translatable extends DataObjectDecorator { } $fields->addFieldsToTab( 'Root', - new Tab(_t('Translatable.TRANSLATIONS', 'Translations'), - new HeaderField(_t('Translatable.CREATE', 'Create new translation'), 2), - $langDropdown = new LanguageDropdownField("NewTransLang", _t('Translatable.NEWLANGUAGE', 'New language'), $alreadyTranslatedLangs), - $createButton = new InlineFormAction('createtranslation',_t('Translatable.CREATEBUTTON', 'Create')) + new Tab("Translations", + new HeaderField("Create new translation", 2), + $langDropdown = new LanguageDropdownField("NewTransLang", "New language", $alreadyTranslatedLangs), + $createButton = new InlineFormAction('createtranslation',"Create") ) ); if (count($alreadyTranslatedLangs)) { $fields->addFieldsToTab( 'Root.Translations', new FieldSet( - new HeaderField(_t('Translatable.EXISTING', 'Existing translations:'), 3), + new HeaderField("Existing translations:", 3), new LiteralField('existingtrans',implode(', ',$alreadyTranslatedLangs)) ) ); diff --git a/core/model/Versioned.php b/core/model/Versioned.php index ace049780..edfe012e4 100755 --- a/core/model/Versioned.php +++ b/core/model/Versioned.php @@ -1,15 +1,8 @@ owner->parentClass() == "DataObject") { $rootTable = true; } - if ($suffix && ($ext = $this->owner->extInstance($allSuffixes[$suffix]))) { + if ($suffix && ($ext = $this->owner->getExtension($allSuffixes[$suffix]))) { if (!$ext->isVersionedTable($table)) continue; $fields = $ext->fieldsInExtraTables($suffix); $indexes = $fields['indexes']; @@ -345,7 +338,7 @@ class Versioned extends DataObjectDecorator { function extendWithSuffix($table) { foreach (Versioned::$versionableExtensions as $versionableExtension => $suffixes) { if ($this->owner->hasExtension($versionableExtension)) { - $table = $this->owner->extInstance($versionableExtension)->extendWithSuffix($table); + $table = $this->owner->getExtension($versionableExtension)->extendWithSuffix($table); } } return $table; @@ -473,7 +466,7 @@ class Versioned extends DataObjectDecorator { $fields = array_keys($fromRecord->getAllFields()); foreach($fields as $field) { - if(in_array($field, array("ID","Version","RecordID","AuthorID", "ParentID"))) continue; + if(in_array($field, array("ID","Version","RecordID","AuthorID"))) continue; $fromRecord->$field = Diff::compareHTML($fromRecord->$field, $toRecord->$field); } @@ -630,9 +623,6 @@ class Versioned extends DataObjectDecorator { * Return the latest version of the given page */ static function get_latest_version($class, $id) { - $oldStage = Versioned::$reading_stage; - Versioned::$reading_stage = null; - $baseTable = ClassInfo::baseDataClass($class); $query = singleton($class)->buildVersionSQL("`{$baseTable}`.RecordID = $id", "`{$baseTable}`.Version DESC"); $query->limit = 1; @@ -643,16 +633,10 @@ class Versioned extends DataObjectDecorator { Debug::show($record); user_error("Versioned::get_version: Couldn't get $class.$id, version $version", E_USER_ERROR); } - - Versioned::$reading_stage = $oldStage; - return new $className($record); } static function get_version($class, $id, $version) { - $oldStage = Versioned::$reading_stage; - Versioned::$reading_stage = null; - $baseTable = ClassInfo::baseDataClass($class); $query = singleton($class)->buildVersionSQL("`{$baseTable}`.RecordID = $id AND `{$baseTable}`.Version = $version"); $record = $query->execute()->record(); @@ -662,9 +646,6 @@ class Versioned extends DataObjectDecorator { Debug::show($record); user_error("Versioned::get_version: Couldn't get $class.$id, version $version", E_USER_ERROR); } - - Versioned::$reading_stage = $oldStage; - return new $className($record); } @@ -694,9 +675,6 @@ class Versioned extends DataObjectDecorator { /** * Represents a single version of a record. - * @package sapphire - * @subpackage model - * @see Versioned */ class Versioned_Version extends ViewableData { protected $record; diff --git a/core/model/VirtualPage.php b/core/model/VirtualPage.php index e8c79b52c..fff9db75b 100755 --- a/core/model/VirtualPage.php +++ b/core/model/VirtualPage.php @@ -1,17 +1,11 @@ name = $name; @@ -46,15 +29,12 @@ abstract class DBField extends ViewableData { function setVal($value) { return $this->setValue($value); } - function setValue($value) { $this->value = $value; } - function setTable($tableName) { $this->tableName = $tableName; } - function forTemplate() { return $this->value; } @@ -65,19 +45,15 @@ abstract class DBField extends ViewableData { function ATT() { return Convert::raw2att($this->value); } - function RAW() { return $this->value; } - function JS() { return Convert::raw2js($this->value); } - function HTML(){ return Convert::raw2xml($this->value); } - function XML(){ return Convert::raw2xml($this->value); } @@ -117,4 +93,5 @@ abstract class DBField extends ViewableData { DBG; } } + ?> \ No newline at end of file diff --git a/core/model/fieldtypes/Date.php b/core/model/fieldtypes/Date.php index 444388eae..6328dcf72 100644 --- a/core/model/fieldtypes/Date.php +++ b/core/model/fieldtypes/Date.php @@ -1,15 +1,5 @@ value)) $agoWord = _t("Date.AWAY", " away"); else $agoWord = _t("Date.AGO", " ago"); - return $this->TimeDiff() . ' ' . $agoWord; + return $this->TimeDiff() . $agoWord; } } @@ -139,46 +129,6 @@ class Date extends DBField { } } } - - /** - * Gets the time difference, but always returns it in a certain format - * @param string $format The format, could be one of these: - * 'seconds', 'minutes', 'hours', 'days', 'months', 'years'. - * - * @return string - */ - function TimeDiffIn($format) { - if($this->value) { - $ago = abs(time() - strtotime($this->value)); - - switch($format) { - case "seconds": - $span = $ago; - return ($span != 1) ? "{$span} seconds" : "{$span} second"; - break; - case "minutes": - $span = round($ago/60); - return ($span != 1) ? "{$span} minutes" : "{$span} minute"; - break; - case "hours": - $span = round($ago/3600); - return ($span != 1) ? "{$span} hours" : "{$span} hour"; - break; - case "days": - $span = round($ago/86400); - return ($span != 1) ? "{$span} days" : "{$span} day"; - break; - case "months": - $span = round($ago/86400/30); - return ($span != 1) ? "{$span} months" : "{$span} month"; - break; - case "years": - $span = round($ago/86400/365); - return ($span != 1) ? "{$span} years" : "{$span} year"; - break; - } - } - } function requireField() { DB::requireField($this->tableName, $this->name, "date"); diff --git a/core/model/fieldtypes/Datetime.php b/core/model/fieldtypes/Datetime.php index 2d4a58d12..dd3f97db5 100644 --- a/core/model/fieldtypes/Datetime.php +++ b/core/model/fieldtypes/Datetime.php @@ -1,21 +1,7 @@ value = date('Y-m-d H:i:s', strtotime($value)); diff --git a/core/model/fieldtypes/Decimal.php b/core/model/fieldtypes/Decimal.php index b8d5ea301..b7554a581 100644 --- a/core/model/fieldtypes/Decimal.php +++ b/core/model/fieldtypes/Decimal.php @@ -1,14 +1,6 @@ tableName, $this->name, "decimal($this->wholeSize,$this->decimalSize)"); - } - - function saveInto($dataObject) { - $fieldName = $this->name; - if($fieldName) { - $dataObject->$fieldName = (float)preg_replace('/[^0-9.]/', '', $this->value); - } else { - user_error("DBField::saveInto() Called on a nameless '" . get_class($this) . "' object", E_USER_ERROR); - } } } diff --git a/core/model/fieldtypes/Enum.php b/core/model/fieldtypes/Enum.php index ff398b009..eac34740d 100755 --- a/core/model/fieldtypes/Enum.php +++ b/core/model/fieldtypes/Enum.php @@ -1,15 +1,5 @@ 0) { - if(!in_array($tagName[1], $noClose)) { - $summary .= "{$tagName[1]}>"; - } - } + if(sizeof($tagName) > 0) + $summary .= "{$tagName[1]}>"; } return $summary; diff --git a/core/model/fieldtypes/HTMLVarchar.php b/core/model/fieldtypes/HTMLVarchar.php index dc8dd7503..97aae9efa 100755 --- a/core/model/fieldtypes/HTMLVarchar.php +++ b/core/model/fieldtypes/HTMLVarchar.php @@ -1,16 +1,8 @@ value ); } - - - } -?> +?> \ No newline at end of file diff --git a/core/model/fieldtypes/Percentage.php b/core/model/fieldtypes/Percentage.php index 65194aaa6..88c88df1f 100644 --- a/core/model/fieldtypes/Percentage.php +++ b/core/model/fieldtypes/Percentage.php @@ -1,15 +1,5 @@ value = date('Y-m-d H:i:s', strtotime($value)); diff --git a/core/model/fieldtypes/Text.php b/core/model/fieldtypes/Text.php index f4c1135f9..2e0ee8903 100644 --- a/core/model/fieldtypes/Text.php +++ b/core/model/fieldtypes/Text.php @@ -1,15 +1,5 @@ "HTMLText", @@ -67,34 +57,6 @@ class Text extends DBField { return $ret; } - - /** - * Limit sentences, can be controlled by passing an integer. - * @param int $sentCount The amount of sentences you want. - */ - function LimitSentences($sentCount = 2) { - $data = Convert::xml2raw($this->value); - $sentences = explode('.', $data); - if(count($sentences) == 1) { - return $sentences[0] . '.'; - } elseif(count($sentences) > 1) { - if(is_numeric($sentCount) && $sentCount != 0) { - if($sentCount == 1) { - $output = $sentences[0] . '. '; - } else { - for($i = 1; $i <= $sentCount-1; $i++) { - if($sentences[0]) { - $output .= $sentences[0] . '. '; - } - if($sentences[$i]) { - $output .= $sentences[$i] . '. '; - } - } - } - return $output; - } - } - } /** * Caution: Not XML/HTML-safe - does not respect closing tags. @@ -222,39 +184,6 @@ class Text extends DBField { } } - function ContextSummary($characters = 500, $string = false, $striphtml = true, $highlight = true) { - if(!$string) { - // If no string is supplied, use the string from a SearchForm - $string = $_REQUEST['Search']; - } - - // Remove HTML tags so we don't have to deal with matching tags - $text = $striphtml ? $this->NoHTML() : $this->value; - - // Find the search string - $position = (int) stripos($text, $string); - - // We want to search string to be in the middle of our block to give it some context - $position = max(0, $position - ($characters / 2)); - - - if($position > 0) { - // We don't want to start mid-word - $position = max((int) strrpos(substr($text, 0, $position), ' '), (int) strrpos(substr($text, 0, $position), "\n")); - } - - $summary = substr($text, $position, $characters); - - if($highlight) { - // Add a span around all occurences of the search term - $summary = str_ireplace($string, "$string", $summary); - } - - // trim it, because if we counted back and found a space then there will be an extra - // space at the front - return trim($summary); - } - /** * Allows a sub-class of TextParser to be rendered. @see TextParser for implementation details. */ diff --git a/core/model/fieldtypes/Time.php b/core/model/fieldtypes/Time.php index e859503e6..f6d9dc040 100755 --- a/core/model/fieldtypes/Time.php +++ b/core/model/fieldtypes/Time.php @@ -1,15 +1,8 @@ class; - $parentFolder = Folder::findOrMake($folderName); + $parentFolder = Folder::findOrMake("Uploads"); // Create a folder for uploading. if(!file_exists("$base/assets")){ mkdir("$base/assets", Filesystem::$folder_create_mask); } - if(!file_exists("$base/assets/$folderName")){ - mkdir("$base/assets/$folderName", Filesystem::$folder_create_mask); + if(!file_exists("$base/assets/Uploads")){ + mkdir("$base/assets/Uploads", Filesystem::$folder_create_mask); } // Generate default filename @@ -181,7 +173,7 @@ class File extends DataObject { $file = ereg_replace('-+', '-',$file); $file = basename($file); - $file = "assets/$folderName/$file"; + $file = "assets/Uploads/$file"; while(file_exists("$base/$file")) { $i = isset($i) ? ($i+1) : 2; @@ -240,41 +232,38 @@ class File extends DataObject { function loadallcontent() { ini_set("max_execution_time", 50000); - $allFiles = DataObject::get("File"); + // get all file objects(not folders) + $start = (int)$_GET[start]; + $allFiles = DataObject::get("File", "ClassName = 'File' AND Filename LIKE '%.pdf'", "", "", "$start, 5"); $total = $allFiles->TotalItems(); - $i = 0; + $i = $start; foreach($allFiles as $file) { $i++; $tmp = TEMP_FOLDER; `echo "$i / $total" > $tmp/progress`; - $file->write(); + $file->loadContent(); } + Director::redirect(HTTP::setGetVar("start", $start + 5)); + + // run loadcontent on each one } /** * Gets the content of this file and puts it in the field Content */ function loadContent() { - $filename = escapeshellarg($this->getFullPath()); + switch(strtolower($this->getExtension())){ case 'pdf': - $content = `pdftotext $filename -`; + $filename = escapeshellarg($this->getFullPath()); + + $content = `pstotext $filename`; //echo("Content for $this->Filename:\n$content"); $this->Content = $content; + $this->write(); break; - case 'doc': - $content = `catdoc $filename`; - $this->Content = $content; - break; - case 'ppt': - $content = `catppt $filename`; - $this->Content = $content; - break; - case 'txt'; - $content = file_get_contents($this->FileName); - $this->Content = $content; } } @@ -287,8 +276,7 @@ class File extends DataObject { } function TreeTitle() { - if($this->hasMethod('alternateTreeTitle')) return $this->alternateTreeTitle(); - else return $this->Title; + return $this->Title; } /** @@ -335,8 +323,6 @@ class File extends DataObject { $brokenPage->write(); } } - - $this->loadContent(); } /** @@ -523,7 +509,7 @@ class File extends DataObject { * legacy code. */ function getExtension() { - return strtolower(substr($this->getField('Filename'),strrpos($this->getField('Filename'),'.')+1)); + return strtolower(substr($this->getField('Name'),strrpos($this->getField('Name'),'.')+1)); } function getFileType() { $types = array( @@ -595,13 +581,6 @@ class File extends DataObject { echo "
Done!"; } - - /** - * Select clause for DataObject::get('File') operations/ - * Stores an array, suitable for a {@link SQLQuery} object. - */ - private static $dataobject_select; - /** * We've overridden the DataObject::get function for File so that the very large content field * is excluded! @@ -615,23 +594,8 @@ class File extends DataObject { $query = $this->extendedSQL($filter, $sort, $limit, $join, $having); $baseTable = reset($query->from); - - // Work out which columns we're actually going to select - // In short, we select everything except File.Content - if(!self::$dataobject_select) { - self::$dataobject_select = array(); - foreach($query->select as $item) { - if($item == "`File`.*") { - $fileColumns = DB::query("SHOW FIELDS IN `File`")->column(); - $columnsToAdd = array_diff($fileColumns, array('Content')); - foreach($columnsToAdd as $otherItem) self::$dataobject_select[] = '`File`.' . $otherItem; - } else { - self::$dataobject_select[] = $item; - } - } - } - - $query->select = self::$dataobject_select; + + $query->select = array("$baseTable.ID","$baseTable.ClassName","$baseTable.Created","$baseTable.LastEdited","$baseTable.Name","$baseTable.Title","$baseTable.Content","$baseTable.ParentID","$baseTable.Filename","if($baseTable.ClassName,$baseTable.ClassName,'File') AS RecordClassName"); $records = $query->execute(); $ret = $this->buildDataObjectSet($records, $containerClass); diff --git a/filesystem/Filesystem.php b/filesystem/Filesystem.php index b875dc7f9..8af1f42e8 100755 --- a/filesystem/Filesystem.php +++ b/filesystem/Filesystem.php @@ -1,15 +1,5 @@ Name] = $dbChild; } + $unwantedDbChildren = $hasDbChild; } - $unwantedDbChildren = $hasDbChild; // Iterate through the actual children, correcting the database as necessary @@ -338,92 +325,6 @@ class Folder extends File { function cmsCleanup_parentChanged(){ } - - /** - * Return the FieldSet used to edit this folder in the CMS. - * You can modify this fieldset by subclassing folder, or by creating a {@link DataObjectDecorator} - * and implemeting updateCMSFields(FieldSet $fields) on that decorator. - */ - function getCMSFields() { - $nameField = ($this->ID > 0) ? new TextField("Name") : new HiddenField("Name"); - - $fileList = new AssetTableField( - $this, - "Files", - "File", - array("Title" => _t('AssetAdmin.TITLE', "Title"), "LinkedURL" => _t('AssetAdmin.FILENAME', "Filename")), - "" - ); - $fileList->setFolder($this); - $fileList->setPopupCaption(_t('AssetAdmin.VIEWEDITASSET', "View/Edit Asset")); - - $nameField = ($this->ID && $this->ID != "root") ? new TextField("Name", "Folder Name") : new HiddenField("Name"); - if( $this->userCanEdit() ) { - $deleteButton = new InlineFormAction('deletemarked',_t('AssetAdmin.DELSELECTED','Delete selected files'), 'delete'); - $deleteButton->includeDefaultJS(false); - } else { - $deleteButton = new HiddenField('deletemarked'); - } - - $fields = new FieldSet( - new HiddenField("Title"), - new TabSet("Root", - new Tab(_t('AssetAdmin.FILESTAB', "Files"), - $nameField, - $fileList, - $deleteButton, - new HiddenField("FileIDs"), - new HiddenField("DestFolderID") - ), - new Tab(_t('AssetAdmin.DETAILSTAB', "Details"), - new ReadonlyField("URL", _t('AssetAdmin.URL', 'URL')), - new ReadonlyField("ClassName", _t('AssetAdmin.TYPE','Type')), - new ReadonlyField("Created", _t('AssetAdmin.CREATED','First Uploaded')), - new ReadonlyField("LastEdited", _t('AssetAdmin.LASTEDITED','Last Updated')) - ), - new Tab(_t('AssetAdmin.UPLOADTAB', "Upload"), - new LiteralField("UploadIframe", - $this->getUploadIframe() - ) - )/* This has been disabled for now because of it's mass memory consumption - , - new Tab(_t('AssetAdmin.UNUSEDFILESTAB', "Unused files"), - new LiteralField("UnusedAssets", - "
Make sure you enter your normalized OpenID/i-name credentials - here, i.e. with protocol and trailing slash for OpenID (e.g. http://openid.silverstripe.com/).
'; - -$lang['en_US']['TableListField']['CSVEXPORT'] = 'Export to CSV'; -$lang['en_US']['TableListField']['PRINT'] = 'Print'; - -$lang['en_US']['Permission']['FULLADMINRIGHTS'] = 'Full administrative rights'; - -$lang['en_US']['Page']['CLASSNAME'] = 'Page'; - -$lang['en_US']['Statistics']['TRENDS'] = 'Trends'; -$lang['en_US']['Statistics']['LEGEND'] = 'Legend'; -$lang['en_US']['Statistics']['BROWSERS'] = 'Browsers'; -$lang['en_US']['Statistics']['ID'] = 'ID'; -$lang['en_US']['Statistics']['EMAIL'] = 'Email'; -$lang['en_US']['Statistics']['JOINED'] = 'Joined'; -$lang['en_US']['Statistics']['REGISTEREDUSERS'] = 'Registered Users'; -$lang['en_US']['Statistics']['CSVEXPORT'] = 'Export as CSV'; - -$lang['en_US']['Statistics']['RECENTPAGEVIEWS'] = 'Recent Page Views'; -$lang['en_US']['Statistics']['TIME'] = 'Time'; -$lang['en_US']['Statistics']['BROWSER'] = 'Browser'; -$lang['en_US']['Statistics']['OSABREV'] = 'OS'; -$lang['en_US']['Statistics']['USER'] = 'User'; -$lang['en_US']['Statistics']['PAGE'] = 'Page'; -$lang['en_US']['Statistics']['PAGEVIEWS'] = 'Page Views'; -$lang['en_US']['Statistics']['OS'] = 'Operating Systems'; -$lang['en_US']['Statistics']['USERACTIVITY'] = 'User Activity'; - - ?> \ No newline at end of file diff --git a/lang/es_ES.php b/lang/es_ES.php index 9ee576e32..6300cbb4d 100644 --- a/lang/es_ES.php +++ b/lang/es_ES.php @@ -4,11 +4,7 @@ i18n::include_locale_file('sapphire', 'en_US'); global $lang; -if(array_key_exists('es_ES', $lang) && is_array($lang['es_ES'])) { - $lang['es_ES'] = array_merge($lang['en_US'], $lang['es_ES']); -} else { - $lang['es_ES'] = $lang['en_US']; -} +$lang['es_ES'] = $lang['en_US']; $lang['es_ES']['BasicAuth']['ENTERINFO'] = 'Por favor introduzca su nombre de usuario y contraseña.'; $lang['es_ES']['BasicAuth']['ERRORNOTADMIN'] = 'Ese usuario no es un administrador.'; diff --git a/lang/fr_FR.php b/lang/fr_FR.php index 8e294f527..ee5478230 100644 --- a/lang/fr_FR.php +++ b/lang/fr_FR.php @@ -4,11 +4,7 @@ i18n::include_locale_file('sapphire', 'en_US'); global $lang; -if(array_key_exists('fr_FR', $lang) && is_array($lang['fr_FR'])) { - $lang['fr_FR'] = array_merge($lang['en_US'], $lang['fr_FR']); -} else { - $lang['fr_FR'] = $lang['en_US']; -} +$lang['fr_FR'] = $lang['en_US']; $lang['fr_FR']['BasicAuth']['ENTERINFO'] = 'Entrer un identifiant et un mot de passe s\'il vous plaît.'; $lang['fr_FR']['BasicAuth']['ERRORNOTADMIN'] = 'Cet utilisateur n\'est pas un administrateur.'; @@ -26,7 +22,6 @@ $lang['fr_FR']['ComplexTableField.ss']['SORTASC'] = 'Tri croissant'; $lang['fr_FR']['ComplexTableField.ss']['SORTDESC'] = 'Tri décroissant'; $lang['fr_FR']['ComplexTableField_popup.ss']['NEXT'] = 'Suivant'; $lang['fr_FR']['ComplexTableField_popup.ss']['PREVIOUS'] = 'Précédent'; -$lang['fr_FR']['ContentController']['DRAFT_SITE_ACCESS_RESTRICTION'] = 'Vous devez vous authentifier avec votre mot de passe CMS afin de pouvoir consulter le contenu brouillon ou archivé. Cliquer ici pour revenir au site publié.'; $lang['fr_FR']['Controller']['FILE'] = 'Fichier'; $lang['fr_FR']['Controller']['IMAGE'] = 'Image'; $lang['fr_FR']['Date']['AGO'] = 'auparavant'; @@ -244,7 +239,6 @@ $lang['fr_FR']['SiteTree']['PAGETITLE'] = 'Nom de la page'; $lang['fr_FR']['SiteTree']['PAGETYPE'] = 'Type de page'; $lang['fr_FR']['SiteTree']['PRIORITYLEASTIMPORTANT'] = 'Moins importante'; $lang['fr_FR']['SiteTree']['PRIORITYMOSTIMPORTANT'] = 'Plus importante'; -$lang['fr_FR']['SiteTree']['PRIORITYNOTINDEXED'] = 'Non indexé'; $lang['fr_FR']['SiteTree']['REMOVEDFROMDRAFT'] = 'Supprimé du site brouillon'; $lang['fr_FR']['SiteTree']['SHOWINMENUS'] = 'Afficher dans les menus ?'; $lang['fr_FR']['SiteTree']['SHOWINSEARCH'] = 'Afficher dans les recherches ?'; diff --git a/lang/hr_HR.php b/lang/hr_HR.php index 332a06c34..fa9fb2f49 100644 --- a/lang/hr_HR.php +++ b/lang/hr_HR.php @@ -4,11 +4,7 @@ i18n::include_locale_file('sapphire', 'en_US'); global $lang; -if(array_key_exists('hr_HR', $lang) && is_array($lang['hr_HR'])) { - $lang['hr_HR'] = array_merge($lang['en_US'], $lang['hr_HR']); -} else { - $lang['hr_HR'] = $lang['en_US']; -} +$lang['hr_HR'] = $lang['en_US']; $lang['hr_HR']['BasicAuth']['ENTERINFO'] = 'Unesite korisniÄko ime i lozinu'; $lang['hr_HR']['BasicAuth']['ERRORNOTADMIN'] = 'Korisnik nije administrator'; @@ -26,7 +22,6 @@ $lang['hr_HR']['ComplexTableField.ss']['SORTASC'] = 'Sortiraj (ascending)'; $lang['hr_HR']['ComplexTableField.ss']['SORTDESC'] = 'Sortiraj (descending)'; $lang['hr_HR']['ComplexTableField_popup.ss']['NEXT'] = 'Slijedeći'; $lang['hr_HR']['ComplexTableField_popup.ss']['PREVIOUS'] = 'Prethodni'; -$lang['hr_HR']['ContentController']['DRAFT_SITE_ACCESS_RESTRICTION'] = 'Morate biti prijavljeni sa vaÅ¡om CMS zaporkom kako bi ste mogli vidjeti privremeni ili arhivirani sadržaj. Kliknite kako bi ste se vratili na objavljen dio stranice'; $lang['hr_HR']['Controller']['FILE'] = 'Datoteka'; $lang['hr_HR']['Controller']['IMAGE'] = 'Slika'; $lang['hr_HR']['Date']['AGO'] = 'prije'; @@ -75,9 +70,6 @@ $lang['hr_HR']['HtmlEditorField']['BUTTONALIGNLEFT'] = 'Lijevo poravnanje'; $lang['hr_HR']['HtmlEditorField']['BUTTONALIGNRIGHT'] = 'Desno poravnanje'; $lang['hr_HR']['HtmlEditorField']['BUTTONBOLD'] = 'Bold (Ctrl+B)'; $lang['hr_HR']['HtmlEditorField']['BUTTONCANCEL'] = 'Otkaži'; -$lang['hr_HR']['HtmlEditorField']['BUTTONEDITIMAGE'] = 'Uredi sliku'; -$lang['hr_HR']['HtmlEditorField']['BUTTONINSERTFLASH'] = 'Umetni Flash'; -$lang['hr_HR']['HtmlEditorField']['BUTTONINSERTIMAGE'] = 'Umetni sliku'; $lang['hr_HR']['HtmlEditorField']['BUTTONINSERTLINK'] = 'Ubaci vezu'; $lang['hr_HR']['HtmlEditorField']['BUTTONITALIC'] = 'Italic (Ctrl+I)'; $lang['hr_HR']['HtmlEditorField']['BUTTONREMOVELINK'] = 'ObriÅ¡i vezu'; @@ -85,7 +77,6 @@ $lang['hr_HR']['HtmlEditorField']['BUTTONSTRIKE'] = 'strikethrough'; $lang['hr_HR']['HtmlEditorField']['BUTTONUNDERLINE'] = 'Underline (Ctrl+U)'; $lang['hr_HR']['HtmlEditorField']['CHARMAP'] = 'Ubaci simbol'; $lang['hr_HR']['HtmlEditorField']['COPY'] = 'Copy (Ctrl+C)'; -$lang['hr_HR']['HtmlEditorField']['CREATEFOLDER'] = 'izradite mapu ( direktorij )'; $lang['hr_HR']['HtmlEditorField']['CSSCLASS'] = 'Poravnanje / Stil'; $lang['hr_HR']['HtmlEditorField']['CSSCLASSCENTER'] = 'Centralno'; $lang['hr_HR']['HtmlEditorField']['CSSCLASSLEFT'] = 'Lijevo, sa okruženjem teksta.'; @@ -98,7 +89,6 @@ $lang['hr_HR']['HtmlEditorField']['EMAIL'] = 'Email adresa'; $lang['hr_HR']['HtmlEditorField']['FILE'] = 'Datoteka'; $lang['hr_HR']['HtmlEditorField']['FLASH'] = 'Ubaci flash'; $lang['hr_HR']['HtmlEditorField']['FOLDER'] = 'Direktorij'; -$lang['hr_HR']['HtmlEditorField']['FOLDERCANCEL'] = 'prekini'; $lang['hr_HR']['HtmlEditorField']['FORMATADDR'] = 'Adresa'; $lang['hr_HR']['HtmlEditorField']['FORMATH1'] = 'Naslov 1 (h1)'; $lang['hr_HR']['HtmlEditorField']['FORMATH2'] = 'Naslov 2 (h2)'; @@ -126,7 +116,6 @@ $lang['hr_HR']['HtmlEditorField']['LINKFILE'] = 'Downlad datoteke'; $lang['hr_HR']['HtmlEditorField']['LINKINTERNAL'] = 'Stranicu na ovom webu'; $lang['hr_HR']['HtmlEditorField']['LINKOPENNEWWIN'] = 'Otvori vezu (link) u novom prozoru?'; $lang['hr_HR']['HtmlEditorField']['LINKTO'] = 'Poveži na'; -$lang['hr_HR']['HtmlEditorField']['OK'] = 'uredu'; $lang['hr_HR']['HtmlEditorField']['OL'] = 'Numbered list (OL)'; $lang['hr_HR']['HtmlEditorField']['OUTDENT'] = 'Smanji uvlaÄenje'; $lang['hr_HR']['HtmlEditorField']['PAGE'] = 'Stranica'; @@ -134,7 +123,6 @@ $lang['hr_HR']['HtmlEditorField']['PASTE'] = 'Paste (Ctrl+V)'; $lang['hr_HR']['HtmlEditorField']['REDO'] = 'Redo (Ctrl+Y)'; $lang['hr_HR']['HtmlEditorField']['UNDO'] = 'Undo (Ctrl+Z)'; $lang['hr_HR']['HtmlEditorField']['UNLINK'] = 'ObriÅ¡i link'; -$lang['hr_HR']['HtmlEditorField']['UPLOAD'] = 'postavi'; $lang['hr_HR']['HtmlEditorField']['URL'] = 'URL'; $lang['hr_HR']['HtmlEditorField']['VISUALAID'] = 'Pokaži/Sakrij vodilice'; $lang['hr_HR']['ImageField']['NOTEADDIMAGES'] = 'Slike možete dodavati nakon Å¡to spremite prvi put.'; @@ -242,9 +230,6 @@ $lang['hr_HR']['SiteTree']['NOTEUSEASHOMEPAGE'] = 'Koristi ovu stranicu kao poÄ $lang['hr_HR']['SiteTree']['PAGESLINKING'] = 'Slijedeće stranice su vezane na ovu:'; $lang['hr_HR']['SiteTree']['PAGETITLE'] = 'Ime stranice'; $lang['hr_HR']['SiteTree']['PAGETYPE'] = 'Vrsta stranice'; -$lang['hr_HR']['SiteTree']['PRIORITYLEASTIMPORTANT'] = 'Nebitno'; -$lang['hr_HR']['SiteTree']['PRIORITYMOSTIMPORTANT'] = 'Najvažnije'; -$lang['hr_HR']['SiteTree']['PRIORITYNOTINDEXED'] = 'Nije zapisano ( Indeksirano )'; $lang['hr_HR']['SiteTree']['REMOVEDFROMDRAFT'] = 'Obrisano sa privremene stranice'; $lang['hr_HR']['SiteTree']['SHOWINMENUS'] = 'Pokaži u izbornicima?'; $lang['hr_HR']['SiteTree']['SHOWINSEARCH'] = 'Pokaži u tražilici?'; diff --git a/lang/hu_HU.php b/lang/hu_HU.php index e3ff4f3f4..b9ea5fdfd 100644 --- a/lang/hu_HU.php +++ b/lang/hu_HU.php @@ -4,11 +4,7 @@ i18n::include_locale_file('sapphire', 'en_US'); global $lang; -if(array_key_exists('hu_HU', $lang) && is_array($lang['hu_HU'])) { - $lang['hu_HU'] = array_merge($lang['en_US'], $lang['hu_HU']); -} else { - $lang['hu_HU'] = $lang['en_US']; -} +$lang['hu_HU'] = $lang['en_US']; $lang['hu_HU']['BasicAuth']['ENTERINFO'] = 'Kérünk, ajd meg egy felhasználónevet és jelszót.'; $lang['hu_HU']['BasicAuth']['ERRORNOTADMIN'] = 'Ez a felhasználó nem adminisztrátor. '; diff --git a/lang/it_IT.php b/lang/it_IT.php index 499947386..e96e47aa8 100644 --- a/lang/it_IT.php +++ b/lang/it_IT.php @@ -4,11 +4,7 @@ i18n::include_locale_file('sapphire', 'en_US'); global $lang; -if(array_key_exists('it_IT', $lang) && is_array($lang['it_IT'])) { - $lang['it_IT'] = array_merge($lang['en_US'], $lang['it_IT']); -} else { - $lang['it_IT'] = $lang['en_US']; -} +$lang['it_IT'] = $lang['en_US']; $lang['it_IT']['BasicAuth']['ENTERINFO'] = 'Per favore inserisci un nome utente e la password.'; $lang['it_IT']['BasicAuth']['ERRORNOTADMIN'] = 'Questo utente non è amministratore.'; diff --git a/lang/nl_NL.php b/lang/nl_NL.php index ac0dfc791..e37a61f03 100644 --- a/lang/nl_NL.php +++ b/lang/nl_NL.php @@ -4,11 +4,7 @@ i18n::include_locale_file('sapphire', 'en_US'); global $lang; -if(array_key_exists('nl_NL', $lang) && is_array($lang['nl_NL'])) { - $lang['nl_NL'] = array_merge($lang['en_US'], $lang['nl_NL']); -} else { - $lang['nl_NL'] = $lang['en_US']; -} +$lang['nl_NL'] = $lang['en_US']; $lang['nl_NL']['BasicAuth']['ENTERINFO'] = 'Voer een gebruikers naam en wachtwoord in.'; $lang['nl_NL']['BasicAuth']['ERRORNOTADMIN'] = 'Die gebruiker is geen beheerder.'; diff --git a/lang/pl_PL.php b/lang/pl_PL.php index a811aeea1..66c9ea08a 100644 --- a/lang/pl_PL.php +++ b/lang/pl_PL.php @@ -4,11 +4,7 @@ i18n::include_locale_file('sapphire', 'en_US'); global $lang; -if(array_key_exists('pl_PL', $lang) && is_array($lang['pl_PL'])) { - $lang['pl_PL'] = array_merge($lang['en_US'], $lang['pl_PL']); -} else { - $lang['pl_PL'] = $lang['en_US']; -} +$lang['pl_PL'] = $lang['en_US']; $lang['pl_PL']['BasicAuth']['ENTERINFO'] = 'Wprowadź username i hasÅ‚o'; $lang['pl_PL']['BasicAuth']['ERRORNOTADMIN'] = 'Ten użytkownik nie jest administratorem'; @@ -26,7 +22,6 @@ $lang['pl_PL']['ComplexTableField.ss']['SORTASC'] = 'Sortuj rosnÄ…co'; $lang['pl_PL']['ComplexTableField.ss']['SORTDESC'] = 'Sortuj malejÄ…co'; $lang['pl_PL']['ComplexTableField_popup.ss']['NEXT'] = 'NastÄ™pny'; $lang['pl_PL']['ComplexTableField_popup.ss']['PREVIOUS'] = 'Poprzedni'; -$lang['pl_PL']['ContentController']['DRAFT_SITE_ACCESS_RESTRICTION'] = 'Musisz zalogować siÄ™ za pomocÄ… swojego hasÅ‚a do CMSa, aby obejrzeć brudnopis i zarchiwizowanÄ… treść. Kliknij tutaj aby powrócić do opublikowanej strony.'; $lang['pl_PL']['Controller']['FILE'] = 'Plik'; $lang['pl_PL']['Controller']['IMAGE'] = 'Obraz'; $lang['pl_PL']['Date']['AGO'] = 'temu'; @@ -35,7 +30,7 @@ $lang['pl_PL']['Date']['DAY'] = 'dzieÅ„'; $lang['pl_PL']['Date']['DAYS'] = 'dni'; $lang['pl_PL']['Date']['HOUR'] = 'godzina'; $lang['pl_PL']['Date']['HOURS'] = 'godziny'; -$lang['pl_PL']['Date']['MIN'] = 'min'; +$lang['pl_PL']['Date']['MIN'] = 'minuta'; $lang['pl_PL']['Date']['MINS'] = 'minuty'; $lang['pl_PL']['Date']['MONTH'] = 'miesiÄ…c'; $lang['pl_PL']['Date']['MONTHS'] = 'miesiÄ…ce'; @@ -46,7 +41,7 @@ $lang['pl_PL']['Date']['YEARS'] = 'lata'; $lang['pl_PL']['DateField']['VALIDDATEFORMAT'] = 'ProszÄ™ podać prawidÅ‚owy format daty (DD/MM/RRRR).'; $lang['pl_PL']['DropdownField']['CHOOSE'] = '(wybierz)'; $lang['pl_PL']['EmailField']['VALIDATION'] = 'Wprowadź adres e-mail'; -$lang['pl_PL']['ErrorPage']['CODE'] = 'Kod bÅ‚Ä™du'; +$lang['pl_PL']['ErrorPage']['CODE'] = 'BÅ‚Ä…d kodu'; $lang['pl_PL']['FileIframeField']['NOTEADDFILES'] = 'Możesz dodać tylko jeden plik za pierwszym razem'; $lang['pl_PL']['ForgotPasswordEmail.ss']['HELLO'] = 'Cześć'; $lang['pl_PL']['Form']['DATENOTSET'] = '(brak ustawionej daty)'; @@ -55,7 +50,6 @@ $lang['pl_PL']['Form']['LANGAOTHER'] = 'Inny jÄ™zyk'; $lang['pl_PL']['Form']['LANGAVAIL'] = 'DostÄ™pne jÄ™zyki'; $lang['pl_PL']['Form']['NOTSET'] = '(nie ustawiono)'; $lang['pl_PL']['Form']['SAVECHANGES'] = 'Zachowaj zmiany'; -$lang['pl_PL']['Form']['VALIDATIONALLDATEVALUES'] = 'ProszÄ™ siÄ™ upewnić, czy wartoÅ›ci wszystkich dat zostaÅ‚y ustawione'; $lang['pl_PL']['Form']['VALIDATIONBANKACC'] = 'ProszÄ™ podać prawidÅ‚owy numer bankowy'; $lang['pl_PL']['Form']['VALIDATIONCREDITNUMBER'] = 'Upewnij siÄ™, że wprowadzono prawidÅ‚owy numer karty kredytowej %s'; $lang['pl_PL']['Form']['VALIDATIONFAILED'] = 'Walidacja nie powiodÅ‚a siÄ™'; @@ -63,8 +57,6 @@ $lang['pl_PL']['Form']['VALIDATIONNOTUNIQUE'] = 'Wprowadzona wartość nie jest $lang['pl_PL']['Form']['VALIDATIONPASSWORDSDONTMATCH'] = 'HasÅ‚a nie sÄ… takie same'; $lang['pl_PL']['Form']['VALIDATIONPASSWORDSNOTEMPTY'] = 'HasÅ‚o nie może być puste'; $lang['pl_PL']['Form']['VALIDATIONSTRONGPASSWORD'] = 'HasÅ‚o musi posiadać jeden unikalny znak'; -$lang['pl_PL']['Form']['VALIDCURRENCY'] = 'ProszÄ™ wpisać prawidÅ‚owÄ… walutÄ™.'; -$lang['pl_PL']['GhostPage']['NOLINKED'] = 'Ta wirtualna witryna nie jest poÅ‚Ä…czona z żadnÄ… stronÄ….'; $lang['pl_PL']['GSTNumberField']['VALIDATION'] = 'ProszÄ™ wprowadzić poprawny numer GST'; $lang['pl_PL']['HtmlEditorField']['ALTTEXT'] = 'Opis'; $lang['pl_PL']['HtmlEditorField']['ANCHOR'] = 'Wstaw/edytuj kotwicÄ™'; @@ -81,13 +73,12 @@ $lang['pl_PL']['HtmlEditorField']['BUTTONINSERTIMAGE'] = 'Wstaw obraz'; $lang['pl_PL']['HtmlEditorField']['BUTTONINSERTLINK'] = 'Wstaw link'; $lang['pl_PL']['HtmlEditorField']['BUTTONITALIC'] = 'Kursywa (Ctrl+I)'; $lang['pl_PL']['HtmlEditorField']['BUTTONREMOVELINK'] = 'ZmieÅ„ link'; -$lang['pl_PL']['HtmlEditorField']['BUTTONSTRIKE'] = 'przekreÅ›lenie'; +$lang['pl_PL']['HtmlEditorField']['BUTTONSTRIKE'] = 'przez uderzenie'; $lang['pl_PL']['HtmlEditorField']['BUTTONUNDERLINE'] = 'PodkreÅ›lenie (Ctrl+U)'; $lang['pl_PL']['HtmlEditorField']['CHARMAP'] = 'Wstaw symbol'; $lang['pl_PL']['HtmlEditorField']['COPY'] = 'Kopiuj (Ctrl+C)'; $lang['pl_PL']['HtmlEditorField']['CREATEFOLDER'] = 'utwórz folder'; $lang['pl_PL']['HtmlEditorField']['CSSCLASS'] = 'Wyrównanie/styl'; -$lang['pl_PL']['HtmlEditorField']['CSSCLASSCENTER'] = 'WyÅ›rodkowane'; $lang['pl_PL']['HtmlEditorField']['CSSCLASSLEFT'] = 'Tekst po lewej'; $lang['pl_PL']['HtmlEditorField']['CSSCLASSRIGHT'] = 'Tekst po prawej'; $lang['pl_PL']['HtmlEditorField']['CUT'] = 'Wytnij (Ctrl+X)'; @@ -112,7 +103,6 @@ $lang['pl_PL']['HtmlEditorField']['IMAGE'] = 'Wstaw obraz'; $lang['pl_PL']['HtmlEditorField']['IMAGEDIMENSIONS'] = 'Rozmiar'; $lang['pl_PL']['HtmlEditorField']['IMAGEHEIGHTPX'] = 'Wysokość (px)'; $lang['pl_PL']['HtmlEditorField']['IMAGEWIDTHPX'] = 'Szerokość (px)'; -$lang['pl_PL']['HtmlEditorField']['INDENT'] = 'ZwiÄ™ksz wciÄ™cie'; $lang['pl_PL']['HtmlEditorField']['INSERTCOLAFTER'] = 'Wstaw kolumnÄ™ później'; $lang['pl_PL']['HtmlEditorField']['INSERTCOLBEF'] = 'Wstaw kolumnÄ™ wczeÅ›niej'; $lang['pl_PL']['HtmlEditorField']['INSERTROWAFTER'] = 'Wstaw rzÄ…d później'; @@ -123,21 +113,20 @@ $lang['pl_PL']['HtmlEditorField']['LINKDESCR'] = 'Opis linku'; $lang['pl_PL']['HtmlEditorField']['LINKEMAIL'] = 'Adres e-mail'; $lang['pl_PL']['HtmlEditorField']['LINKEXTERNAL'] = 'Inna strona'; $lang['pl_PL']['HtmlEditorField']['LINKFILE'] = 'Pobierz plik'; -$lang['pl_PL']['HtmlEditorField']['LINKINTERNAL'] = 'Strona na tej witrynie'; +$lang['pl_PL']['HtmlEditorField']['LINKINTERNAL'] = 'Strona na Twojej stronie www'; $lang['pl_PL']['HtmlEditorField']['LINKOPENNEWWIN'] = 'Otworzyć link w nowym oknie?'; $lang['pl_PL']['HtmlEditorField']['LINKTO'] = 'Linkuj do'; $lang['pl_PL']['HtmlEditorField']['OK'] = 'ok'; -$lang['pl_PL']['HtmlEditorField']['OL'] = 'Lista numerowana'; -$lang['pl_PL']['HtmlEditorField']['OUTDENT'] = 'Zmniejsz odstÄ™p'; +$lang['pl_PL']['HtmlEditorField']['OL'] = 'Numeracja'; $lang['pl_PL']['HtmlEditorField']['PAGE'] = 'Strona'; $lang['pl_PL']['HtmlEditorField']['PASTE'] = 'Wklej (Ctrl+V)'; $lang['pl_PL']['HtmlEditorField']['REDO'] = 'Przywróć (Ctrl+Y)'; -$lang['pl_PL']['HtmlEditorField']['UNDO'] = 'Cofnij (Ctrl+Z)'; +$lang['pl_PL']['HtmlEditorField']['UNDO'] = 'CofniÄ™cie (Ctrl+Z)'; $lang['pl_PL']['HtmlEditorField']['UNLINK'] = 'ZmieÅ„ link'; $lang['pl_PL']['HtmlEditorField']['UPLOAD'] = 'wgraj'; $lang['pl_PL']['HtmlEditorField']['URL'] = 'URL'; $lang['pl_PL']['HtmlEditorField']['VISUALAID'] = 'Pokaż/schowaj wytyczne'; -$lang['pl_PL']['ImageField']['NOTEADDIMAGES'] = 'Po pierwszym zapisie można dodawać zdjÄ™cia.'; +$lang['pl_PL']['ImageField']['NOTEADDIMAGES'] = 'Możesz dodać jedno zdjÄ™cie zachowane za pierwszym razem'; $lang['pl_PL']['ImageUplaoder']['ONEFROMFILESTORE'] = 'W jednym z folderów strony'; $lang['pl_PL']['ImageUploader']['ATTACH'] = 'ZaÅ‚Ä…cz %s'; $lang['pl_PL']['ImageUploader']['DELETE'] = 'UsuÅ„ %s'; @@ -146,7 +135,6 @@ $lang['pl_PL']['ImageUploader']['FROMFILESTORE'] = 'Ze schowka plików'; $lang['pl_PL']['ImageUploader']['ONEFROMCOMPUTER'] = 'na jednym z twoich komputerów'; $lang['pl_PL']['ImageUploader']['REALLYDELETE'] = 'NaprawdÄ™ chcesz usunąć ten %s?'; $lang['pl_PL']['ImageUploader']['REPLACE'] = 'ZastÄ…p %s'; -$lang['pl_PL']['Image_iframe.ss']['TITLE'] = 'Åadowanie Zdjęć (Iframe)'; $lang['pl_PL']['Member']['ADDRESS'] = 'Adres'; $lang['pl_PL']['Member']['BUTTONCHANGEPASSWORD'] = 'ZmieÅ„ hasÅ‚o'; $lang['pl_PL']['Member']['BUTTONLOGIN'] = 'Zalogowany'; @@ -156,7 +144,7 @@ $lang['pl_PL']['Member']['CONFIRMNEWPASSWORD'] = 'Potwierdź nowe hasÅ‚o'; $lang['pl_PL']['Member']['CONFIRMPASSWORD'] = 'Potwierdź hasÅ‚o'; $lang['pl_PL']['Member']['CONTACTINFO'] = 'Informacja kontaktowa'; $lang['pl_PL']['Member']['EMAIL'] = 'E-mail'; -$lang['pl_PL']['Member']['EMAILPASSWORDAPPENDIX'] = 'Twoje hasÅ‚o zostaÅ‚o zmienione. Zatrzymaj tego maila do przyszÅ‚ych potwierdzeÅ„'; +$lang['pl_PL']['Member']['EMAILPASSWORDAPPENDIX'] = 'Twoje hasÅ‚o zostaÅ‚o zmienione. Zatrzyaj tego maila do przyszÅ‚ych potwierdzeÅ„'; $lang['pl_PL']['Member']['EMAILPASSWORDINTRO'] = 'Oto Twoje nowe hasÅ‚o'; $lang['pl_PL']['Member']['EMAILSIGNUPINTRO1'] = 'DziÄ™kujemy za rejestracjÄ™ jako nowy użytkownik, szczegóły możesz zobaczyć poniżej w celu przyszÅ‚ego potwierdzenia'; $lang['pl_PL']['Member']['EMAILSIGNUPINTRO2'] = 'Możesz sie zalogować na tÄ™ stronÄ™ używajÄ…c danych z listy poniżej'; @@ -186,7 +174,6 @@ $lang['pl_PL']['Member']['YOUROLDPASSWORD'] = 'Twoje stare hasÅ‚o'; $lang['pl_PL']['MemberAuthenticator']['TITLE'] = 'E-mail i HasÅ‚o'; $lang['pl_PL']['NumericField']['VALIDATION'] = '\'%s\' nie jest liczbÄ…, tylko liczby sÄ… akceptowane przez to pole'; $lang['pl_PL']['PhoneNumberField']['VALIDATION'] = 'Wprowadź poprawny numer telefonu'; -$lang['pl_PL']['RedirectorPage']['HASBEENSETUP'] = 'Strona przekierowujÄ…ca zostaÅ‚a ustawiona bez celu, do którego ma przekierowywać.'; $lang['pl_PL']['RedirectorPage']['HEADER'] = 'Ta strona przeniesie użytkowników na innÄ… stronÄ™'; $lang['pl_PL']['RedirectorPage']['OTHERURL'] = 'Inny adres URL strony'; $lang['pl_PL']['RedirectorPage']['REDIRECTTO'] = 'PrzenieÅ› do'; @@ -212,7 +199,6 @@ $lang['pl_PL']['SiteTree']['ACCESSLOGGEDIN'] = 'Tylko zarejestrowani użytkownic $lang['pl_PL']['SiteTree']['ACCESSONLYTHESE'] = 'Tylko Ci ludzie (wybierz z listy)'; $lang['pl_PL']['SiteTree']['ADDEDTODRAFT'] = 'Dodano do roboczej strony'; $lang['pl_PL']['SiteTree']['ALLOWCOMMENTS'] = 'Zezwolić na komentarze na stronie?'; -$lang['pl_PL']['SiteTree']['APPEARSVIRTUALPAGES'] = 'Ta zawartość pojawia sie także na wirtualnych stronach w sekcjach %s.'; $lang['pl_PL']['SiteTree']['BUTTONCANCELDRAFT'] = 'Anuluj wprowadzone zmiany'; $lang['pl_PL']['SiteTree']['BUTTONCANCELDRAFTDESC'] = 'UsuÅ„ zmiany i wróć do istniejÄ…cej wersji opublikowanej strony'; $lang['pl_PL']['SiteTree']['BUTTONSAVEPUBLISH'] = 'Zapisz i opublikuj'; @@ -230,14 +216,14 @@ $lang['pl_PL']['SiteTree']['LINKSCHANGEDTO'] = 'zmieniono %s na %s'; $lang['pl_PL']['SiteTree']['MENUTITLE'] = 'Sekcja nawigacji'; $lang['pl_PL']['SiteTree']['METAADVANCEDHEADER'] = 'Zaawansowane opcje ...'; $lang['pl_PL']['SiteTree']['METADESC'] = 'Opis'; -$lang['pl_PL']['SiteTree']['METAEXTRA'] = 'WÅ‚asne Meta Tagi'; -$lang['pl_PL']['SiteTree']['METAHEADER'] = 'Meta-tagi wyszukiwarki'; +$lang['pl_PL']['SiteTree']['METAEXTRA'] = 'StaÅ‚e Meta Tagi'; +$lang['pl_PL']['SiteTree']['METAHEADER'] = 'Mechanizm wyszukiwania meta-tagów'; $lang['pl_PL']['SiteTree']['METAKEYWORDS'] = 'SÅ‚owa kluczowe'; $lang['pl_PL']['SiteTree']['METANOTEPRIORITY'] = 'RÄ™czne wprowadzenie specyfikacji dla Google SiteMaps ważnoÅ›ci dla tej strony. To jest przewodnik dla Google, jak ważna jest strona: (wprowadź wartość od 0 do 1 gdzie 0 wprowadza stronÄ™ do indexu).'; $lang['pl_PL']['SiteTree']['METAPAGEPRIO'] = 'Priorytet Strony'; $lang['pl_PL']['SiteTree']['METATITLE'] = 'TytuÅ‚'; $lang['pl_PL']['SiteTree']['MODIFIEDONDRAFT'] = 'Zmodyfikowano na roboczej stronie'; -$lang['pl_PL']['SiteTree']['NOBACKLINKS'] = 'Do tej strony nie prowadzÄ… żadne odnoÅ›niki z innych stron.'; +$lang['pl_PL']['SiteTree']['NOBACKLINKS'] = 'Strona nie zostaÅ‚a zlinkowana do żadnej stron'; $lang['pl_PL']['SiteTree']['NOTEUSEASHOMEPAGE'] = 'Użyj tej strony jako \'strony startowej\' dla nastÄ™pujÄ…cych domen: (oddziel domeny cudzysÅ‚owem)'; $lang['pl_PL']['SiteTree']['PAGESLINKING'] = 'NastÄ™pujÄ…ce strony majÄ… adres:'; $lang['pl_PL']['SiteTree']['PAGETITLE'] = 'Nazwa strony'; @@ -246,8 +232,8 @@ $lang['pl_PL']['SiteTree']['PRIORITYLEASTIMPORTANT'] = 'Najmniej ważny'; $lang['pl_PL']['SiteTree']['PRIORITYMOSTIMPORTANT'] = 'Najważniejszy'; $lang['pl_PL']['SiteTree']['PRIORITYNOTINDEXED'] = 'Nie zindexowany'; $lang['pl_PL']['SiteTree']['REMOVEDFROMDRAFT'] = 'UsuniÄ™to z roboczej strony'; -$lang['pl_PL']['SiteTree']['SHOWINMENUS'] = 'Pokazuj w menu?'; -$lang['pl_PL']['SiteTree']['SHOWINSEARCH'] = 'Pokazuj w wyszukiwarce?'; +$lang['pl_PL']['SiteTree']['SHOWINMENUS'] = 'Pokazać w menu?'; +$lang['pl_PL']['SiteTree']['SHOWINSEARCH'] = 'Pokazać w wyszukiwarce?'; $lang['pl_PL']['SiteTree']['TABACCESS'] = 'DostÄ™p'; $lang['pl_PL']['SiteTree']['TABBACKLINKS'] = 'Linki zwrotne'; $lang['pl_PL']['SiteTree']['TABBEHAVIOUR'] = 'Zachowanie'; @@ -258,7 +244,6 @@ $lang['pl_PL']['SiteTree']['TABREPORTS'] = 'Raporty'; $lang['pl_PL']['SiteTree']['TOPLEVEL'] = 'Zawartość strony (Główny Poziom)'; $lang['pl_PL']['SiteTree']['URL'] = 'URL'; $lang['pl_PL']['SiteTree']['VALIDATIONURLSEGMENT1'] = 'Inna strona używa tego adresu URL. Adres URL musi być unikalny dla każdej strony.'; -$lang['pl_PL']['SiteTree']['VALIDATIONURLSEGMENT2'] = 'Adresy URL mogÄ… skÅ‚adać siÄ™ jedynie z liczb, cyfr oraz znaków \'-\'.'; $lang['pl_PL']['TableField']['ISREQUIRED'] = 'W %s \'%s\' jest wymagane'; $lang['pl_PL']['TableField.ss']['CSVEXPORT'] = 'Eksportuj do CSV'; $lang['pl_PL']['ToggleCompositeField.ss']['HIDE'] = 'Ukryj'; diff --git a/lang/pt_BR.php b/lang/pt_BR.php index 294c72f02..a71bedaa3 100644 --- a/lang/pt_BR.php +++ b/lang/pt_BR.php @@ -4,11 +4,7 @@ i18n::include_locale_file('sapphire', 'en_US'); global $lang; -if(array_key_exists('pt_BR', $lang) && is_array($lang['pt_BR'])) { - $lang['pt_BR'] = array_merge($lang['en_US'], $lang['pt_BR']); -} else { - $lang['pt_BR'] = $lang['en_US']; -} +$lang['pt_BR'] = $lang['en_US']; $lang['pt_BR']['BasicAuth']['ENTERINFO'] = 'Por favor entre nome de usuário e senha.'; $lang['pt_BR']['BasicAuth']['ERRORNOTADMIN'] = 'Este usuário não é um administrador'; diff --git a/lang/pt_PT.php b/lang/pt_PT.php index 661a86614..20365ca57 100644 --- a/lang/pt_PT.php +++ b/lang/pt_PT.php @@ -4,11 +4,7 @@ i18n::include_locale_file('sapphire', 'en_US'); global $lang; -if(array_key_exists('pt_PT', $lang) && is_array($lang['pt_PT'])) { - $lang['pt_PT'] = array_merge($lang['en_US'], $lang['pt_PT']); -} else { - $lang['pt_PT'] = $lang['en_US']; -} +$lang['pt_PT'] = $lang['en_US']; $lang['pt_PT']['BasicAuth']['ENTERINFO'] = 'Por favor insira um nome de utilizador e password.'; $lang['pt_PT']['BasicAuth']['ERRORNOTADMIN'] = 'Esse utilizador não é um administrador.'; @@ -271,391 +267,4 @@ $lang['pt_PT']['VirtualPage']['CHOOSE'] = 'Escolha uma página para onde redirec $lang['pt_PT']['VirtualPage']['EDITCONTENT'] = 'clique aqui para editar o conteúdo'; $lang['pt_PT']['VirtualPage']['HEADER'] = 'Esta é uma página virtual'; -// --- New New New - -// SiteTree.php -$lang['pt_PT']['SiteTree']['CHANGETO'] = 'Mudar para'; -$lang['pt_PT']['SiteTree']['CURRENTLY'] = 'Actualmente'; -$lang['pt_PT']['SiteTree']['CURRENT'] = 'Actual'; - -$lang['pt_PT']['Page']['SINGULARNAME'] = 'Página'; -$lang['pt_PT']['Page']['PLURALNAME'] = 'Páginas'; -$lang['pt_PT']['ErrorPage']['SINGULARNAME'] = 'Página de Erro'; -$lang['pt_PT']['ErrorPage']['PLURALNAME'] = 'Páginas de Erro'; -$lang['pt_PT']['UserDefinedForm']['SINGULARNAME'] = 'Formulário Definido pelo Utilizador'; -$lang['pt_PT']['UserDefinedForm']['PLURALNAME'] = 'Formulários Definidos pelo Utilizador'; -$lang['pt_PT']['RedirectorPage']['SINGULARNAME'] = 'Página de Redireccionamento'; -$lang['pt_PT']['RedirectorPage']['PLURALNAME'] = 'Páginas de Redireccionamento'; -$lang['pt_PT']['VirtualPage']['SINGULARNAME'] = 'Página Virtual'; -$lang['pt_PT']['VirtualPage']['PLURALNAME'] = 'Páginas Virtuais'; -$lang['pt_PT']['SubscribeForm']['SINGULARNAME'] = 'Página de Subscrição'; -$lang['pt_PT']['SubscribeForm']['PLURALNAME'] = 'Páginas de Subscrição'; - -// --- New New New New - -// forms/TreeSelectorField.php -$lang['pt_PT']['TreeSelectorField']['SAVE'] = 'gravar'; -$lang['pt_PT']['TreeSelectorField']['CANCEL'] = 'cancelar'; - -// forms/NumericField.php -$lang['pt_PT']['NumericField']['VALIDATIONJS'] = 'não é um número. Apenas números podem ser inseridos neste campo'; - -// forms/HtmlEditorField.php -$lang['pt_PT']['HtmlEditorField']['CLOSE'] = 'fechar'; -$lang['pt_PT']['HtmlEditorField']['LINK'] = 'Link'; -$lang['pt_PT']['HtmlEditorField']['IMAGE'] = 'Imagem'; -$lang['pt_PT']['HtmlEditorField']['FLASH'] = 'Flash'; - -// forms/GSTNumberField.php -$lang['pt_PT']['GSTNumberField']['VALIDATIONJS'] = 'Por favor insira um número GST válido'; - -// forms/Form.php -$lang['pt_PT']['Form']['VALIDATOR'] = 'Validador'; - -// forms/FormField.php -$lang['pt_PT']['FormField']['NONE'] = 'nenhum'; - -// forms/EmailField.php -$lang['pt_PT']['EmailField']['VALIDATIONJS'] = 'Por favor insira um endereço de email.'; - -// forms/EditableTextField.php -$lang['pt_PT']['EditableTextField']['TEXTBOXLENGTH'] = 'Tamanho da caixa de texto'; -$lang['pt_PT']['EditableTextField']['TEXTLENGTH'] = 'Comprimento do texto'; -$lang['pt_PT']['EditableTextField']['NUMBERROWS'] = 'Número de linhas'; -$lang['pt_PT']['EditableTextField']['DEFAULTTEXT'] = 'Texto pré-definido'; - -// forms/EditableFormField.php -$lang['pt_PT']['EditableFormField']['ENTERQUESTION'] = 'Insira a questão'; -$lang['pt_PT']['EditableFormField']['REQUIRED'] = 'Obrigatório?'; - -// forms/EditableEmailField.php -$lang['pt_PT']['EditableEmailField']['SENDCOPY'] = 'Enviar uma cópia do formulário para este email'; - -// forms/EditableCheckbox.php -$lang['pt_PT']['EditableCheckbox']['ANY'] = 'Qualquer um'; -$lang['pt_PT']['EditableCheckbox']['SELECTED'] = 'Seleccionado'; -$lang['pt_PT']['EditableCheckbox']['NOTSELECTED'] = 'Não Seleccionado'; - -// forms/DateField.php -$lang['pt_PT']['DateField']['VALIDATIONJS'] = 'Por favor insira uma data válida (DD/MM/AAAA).'; -$lang['pt_PT']['DateField']['NODATESET'] = 'Nenhuma data definida'; -$lang['pt_PT']['DateField']['TODAY'] = 'Hoje'; -$lang['pt_PT']['DateField']['NOTSET'] = 'Não definido'; - -// forms/DataReport.php -$lang['pt_PT']['DataReport']['EXPORTCSV'] = 'Exportar para CSV'; - -// forms/CurrencyField.php -$lang['pt_PT']['CurrencyField']['VALIDATIONJS'] = 'Por favor insira um valor monetário correcto.'; -$lang['pt_PT']['CurrencyField']['CURRENCYSYMBOL'] = '€'; - -// forms/CreditCardField.php -$lang['pt_PT']['CreditCardField']['VALIDATIONJS1'] = 'Por favor certifique-se que inseriu o'; -$lang['pt_PT']['CreditCardField']['VALIDATIONJS2'] = 'número correctamente'; -$lang['pt_PT']['CreditCardField']['FIRST'] = 'primeiro'; -$lang['pt_PT']['CreditCardField']['SECOND'] = 'segundo'; -$lang['pt_PT']['CreditCardField']['THIRD'] = 'terceiro'; -$lang['pt_PT']['CreditCardField']['FOURTH'] = 'quarto'; - -// forms/ConfirmedPasswordField.php -$lang['pt_PT']['ConfirmedPasswordField']['HAVETOMATCH'] = 'As passwords teem de coincidir.'; -$lang['pt_PT']['ConfirmedPasswordField']['NOEMPTY'] = 'A password não pode estar vazia.'; -$lang['pt_PT']['ConfirmedPasswordField']['BETWEEN'] = 'As passwords devem ter entre %s e %s caracteres'; -$lang['pt_PT']['ConfirmedPasswordField']['ATLEAST'] = 'As passwords devem ter no mÃnimo %s caracteres'; -$lang['pt_PT']['ConfirmedPasswordField']['MAXIMUM'] = 'As passwords podem ter no máximo %s caracteres'; -$lang['pt_PT']['ConfirmedPasswordField']['LEASTONE'] = 'As passwords devem conter pelo menos um numero e um caracter alfanumérico'; - -// forms/CompositeDateField.php -$lang['pt_PT']['CompositeDateField']['DAY'] = 'Dia'; -$lang['pt_PT']['CompositeDateField']['MONTH'] = 'Mês'; -$lang['pt_PT']['CompositeDateField']['VALIDATIONJS1'] = 'Por favor certifique-se que tem o'; -$lang['pt_PT']['CompositeDateField']['VALIDATIONJS2'] = 'correcto'; -$lang['pt_PT']['CompositeDateField']['DAYJS'] = 'dia'; -$lang['pt_PT']['CompositeDateField']['MONTHJS'] = 'mês'; -$lang['pt_PT']['CompositeDateField']['YEARJS'] = 'ano'; - -// forms/BankAccountField.php -$lang['pt_PT']['BankAccountField']['VALIDATIONJS'] = 'Por favor, insira um número bancário correcto'; - -// forms/editor/FieldEditor.php -$lang['pt_PT']['FieldEditor']['EMAILSUBMISSION'] = 'Enviar os dados para o email:'; -$lang['pt_PT']['FieldEditor']['EMAILONSUBMIT'] = 'Enviar email após submissão dos dados:'; - -// parsers/BBCodeParser.php -$lang['pt_PT']['BBCodeParser']['BOLD'] = 'Texto Negrito'; -$lang['pt_PT']['BBCodeParser']['BOLDEXAMPLE'] = 'Negrito'; -$lang['pt_PT']['BBCodeParser']['ITALIC'] = 'Texto Itálico'; -$lang['pt_PT']['BBCodeParser']['ITALICEXAMPLE'] = 'Itálico'; -$lang['pt_PT']['BBCodeParser']['UNDERLINE'] = 'Texto Sublinhado'; -$lang['pt_PT']['BBCodeParser']['UNDERLINEEXAMPLE'] = 'Sublinhado'; -$lang['pt_PT']['BBCodeParser']['STRUCK'] = 'Texto Rasurado'; -$lang['pt_PT']['BBCodeParser']['STRUCKEXAMPLE'] = 'Rasurado'; -$lang['pt_PT']['BBCodeParser']['COLORED'] = 'Texto Colorido'; -$lang['pt_PT']['BBCodeParser']['COLOREDEXAMPLE'] = 'texto azul'; -$lang['pt_PT']['BBCodeParser']['ALIGNEMENT'] = 'Alinhamento'; -$lang['pt_PT']['BBCodeParser']['ALIGNEMENTEXAMPLE'] = 'alinhado à direita'; -$lang['pt_PT']['BBCodeParser']['LINK'] = 'Link'; -$lang['pt_PT']['BBCodeParser']['LINKDESCRIPTION'] = 'Link para outro site'; -$lang['pt_PT']['BBCodeParser']['EMAILLINK'] = 'Link de Email'; -$lang['pt_PT']['BBCodeParser']['EMAILLINKDESCRIPTION'] = 'Criar um link para um endereço de email'; -$lang['pt_PT']['BBCodeParser']['IMAGE'] = 'Imagem'; -$lang['pt_PT']['BBCodeParser']['IMAGEDESCRIPTION'] = 'Mostrar uma imagem'; -$lang['pt_PT']['BBCodeParser']['CODE'] = 'Código'; -$lang['pt_PT']['BBCodeParser']['CODEDESCRIPTION'] = 'Bloco de texto não formatado'; -$lang['pt_PT']['BBCodeParser']['CODEEXAMPLE'] = 'Bloco de código'; -$lang['pt_PT']['BBCodeParser']['UNORDERED'] = 'Lista sem ordenação'; -$lang['pt_PT']['BBCodeParser']['UNORDEREDDESCRIPTION'] = 'Lista sem ordenação'; -$lang['pt_PT']['BBCodeParser']['UNORDEREDEXAMPLE1'] = 'item sem ordenação 1'; -$lang['pt_PT']['BBCodeParser']['UNORDEREDEXAMPLE2'] = 'item sem ordenação 2'; - -// search/AdvancedSearchForm.php -$lang['pt_PT']['AdvancedSearchForm']['SEARCHBY'] = 'PROCURAR POR'; -$lang['pt_PT']['AdvancedSearchForm']['ALLWORDS'] = 'Todas as palavras'; -$lang['pt_PT']['AdvancedSearchForm']['EXACT'] = 'Frase exacta'; -$lang['pt_PT']['AdvancedSearchForm']['ATLEAST'] = 'Pelo menos uma das palavras'; -$lang['pt_PT']['AdvancedSearchForm']['WITHOUT'] = 'Sem as palavras'; -$lang['pt_PT']['AdvancedSearchForm']['SORTBY'] = 'ORDENAR POR'; -$lang['pt_PT']['AdvancedSearchForm']['RELEVANCE'] = 'Relevância'; -$lang['pt_PT']['AdvancedSearchForm']['LASTUPDATED'] = 'Última actualização'; -$lang['pt_PT']['AdvancedSearchForm']['PAGETITLE'] = 'TÃtulo da Página'; -$lang['pt_PT']['AdvancedSearchForm']['LASTUPDATEDHEADER'] = 'ÚLTIMA ACTUALIZAÇÂO'; -$lang['pt_PT']['AdvancedSearchForm']['FROM'] = 'De'; -$lang['pt_PT']['AdvancedSearchForm']['TO'] = 'Até'; -$lang['pt_PT']['AdvancedSearchForm']['GO'] = 'Ir'; - -// search/SearchForm.php -$lang['pt_PT']['SearchForm']['SEARCH'] = 'Procurar'; -$lang['pt_PT']['SearchForm']['GO'] = 'Ir'; - -// security/Security.php -$lang['pt_PT']['Security']['LOGIN'] = 'Autenticação'; -$lang['pt_PT']['Security']['PERMFAILURE'] = 'Esta página requer autenticação e previlégios de administrador. -Insira as sua credenciais abaixo para continuar.'; -$lang['pt_PT']['Security']['ENCDISABLED1'] = 'Encriptação de passwords desligada!'; -$lang['pt_PT']['Security']['ENCDISABLED2'] = 'Para encriptas as passwords, insira a seguinte linha'; -$lang['pt_PT']['Security']['ENCDISABLED3'] = 'em mysite/_config.php'; -$lang['pt_PT']['Security']['NOTHINGTOENCRYPT1'] = 'Sem passwords para encriptar'; -$lang['pt_PT']['Security']['NOTHINGTOENCRYPT2'] = 'Todos os membros teem as passwords encriptadas!'; -$lang['pt_PT']['Security']['ENCRYPT'] = 'Encriptar todas as passwords'; -$lang['pt_PT']['Security']['ENCRYPTWITH'] = 'As passwords serão encriptadas com o algoritmo "%s"'; -$lang['pt_PT']['Security']['ENCRYPTWITHSALT'] = 'com uma chave para aumentar a segurança'; -$lang['pt_PT']['Security']['ENCRYPTWITHOUTSALT'] = 'sem chave para aumentar a segurança'; -$lang['pt_PT']['Security']['ENCRYPTEDMEMBERS'] = 'Password encriptada para o membro'; -$lang['pt_PT']['Security']['EMAIL'] = 'Email:'; -$lang['pt_PT']['Security']['ID'] = 'ID:'; - -// security/Permission.php -$lang['pt_PT']['Permission']['FULLADMINRIGHTS'] = 'Previlégios de Administrador'; -$lang['pt_PT']['Permission']['PERMSDEFINED'] = 'Estão definidas as seguintes permissões'; - -// core/model/Translatable.php -$lang['pt_PT']['Translatable']['TRANSLATIONS'] = 'Traduções'; -$lang['pt_PT']['Translatable']['CREATE'] = 'Criar nova tradução'; -$lang['pt_PT']['Translatable']['NEWLANGUAGE'] = 'Nova LÃngua'; -$lang['pt_PT']['Translatable']['CREATEBUTTON'] = 'Criar'; -$lang['pt_PT']['Translatable']['EXISTING'] = 'Traduções existentes'; - -// core/model/SiteTree.php -$lang['pt_PT']['SiteTree']['DEFAULTHOMETITLE'] = 'InÃcio'; -$lang['pt_PT']['SiteTree']['DEFAULTHOMECONTENT'] = 'Bem-vindo ao Silverstripe! Esta é a página inicial pré-definida. Pode editar esta página no CMS. Pode vêr a documentação de desenvolvimento, ou os tutoriais.
'; -$lang['pt_PT']['SiteTree']['DEFAULTABOUTTITLE'] = 'Sobre'; -$lang['pt_PT']['SiteTree']['DEFAULTABOUTCONTENT'] = 'Pode inserir o seu conteúdo nesta página ou apaga-la e criar novas.
'; -$lang['pt_PT']['SiteTree']['DEFAULTCONTACTTITLE'] = 'Contacte-nos'; -$lang['pt_PT']['SiteTree']['DEFAULTCONTACTCONTENT'] = 'Pode inserir o seu conteúdo nesta página ou apaga-la e criar novas.
'; - -// core/model/ErrorPage.php -$lang['pt_PT']['ErrorPage']['DEFAULTERRORPAGETITLE'] = 'Página de Erro'; -$lang['pt_PT']['ErrorPage']['DEFAULTERRORPAGECONTENT'] = 'Pedimos desculpa, mas aparentemente tentou aceder a uma página que não existe.
Verifique o URL que utilizou e tente novamente.
'; -$lang['pt_PT']['ErrorPage']['404'] = '404 - Página não encontrada'; -$lang['pt_PT']['ErrorPage']['500'] = '500 - Erro do servidor'; - -// SubmittedFormReportField.ss -$lang['pt_PT']['SubmittedFormReportField.ss']['SUBMITTED'] = 'Inserido em'; - -// RelationComplexTableField.ss -$lang['pt_PT']['RelationComplexTableField.ss']['ADD'] = 'Adicionar'; -$lang['pt_PT']['RelationComplexTableField.ss']['SHOW'] = 'Mostrar'; -$lang['pt_PT']['RelationComplexTableField.ss']['EDIT'] = 'Editar'; -$lang['pt_PT']['RelationComplexTableField.ss']['DELETE'] = 'Apagar'; -$lang['pt_PT']['RelationComplexTableField.ss']['NOTFOUND'] = 'Nenhum item encontrado'; - -// FieldEditor.ss -$lang['pt_PT']['FieldEditor.ss']['ADD'] = 'Adicionar'; -$lang['pt_PT']['FieldEditor.ss']['TEXTTITLE'] = 'Adicionar campo de texto'; -$lang['pt_PT']['FieldEditor.ss']['TEXT'] = 'Texto'; -$lang['pt_PT']['FieldEditor.ss']['CHECKBOXTITLE'] = 'Adicionar caixa de tick'; -$lang['pt_PT']['FieldEditor.ss']['CHECKBOX'] = 'Caixa de Tick'; -$lang['pt_PT']['FieldEditor.ss']['DROPDOWNTITLE'] = 'Adicionar caixa de selecção'; -$lang['pt_PT']['FieldEditor.ss']['DROPDOWN'] = 'Caixa de selecção'; -$lang['pt_PT']['FieldEditor.ss']['RADIOSETTITLE'] = 'Adicionar conjunto de botões de rádio'; -$lang['pt_PT']['FieldEditor.ss']['RADIOSET'] = 'Conjunto de Botões de Rádio'; -$lang['pt_PT']['FieldEditor.ss']['EMAILTITLE'] = 'Adicionar campo de email'; -$lang['pt_PT']['FieldEditor.ss']['EMAIL'] = 'Campo de email'; -$lang['pt_PT']['FieldEditor.ss']['FORMHEADINGTITLE'] = 'Adicionar cabeçalho'; -$lang['pt_PT']['FieldEditor.ss']['FORMHEADING'] = 'Cabeçalho'; -$lang['pt_PT']['FieldEditor.ss']['DATETITLE'] = 'Adicionar Campo de Data'; -$lang['pt_PT']['FieldEditor.ss']['DATE'] = 'Data'; -$lang['pt_PT']['FieldEditor.ss']['FILETITLE'] = 'Adicionar Campo de envio de ficheiro'; -$lang['pt_PT']['FieldEditor.ss']['FILE'] = 'Ficheiro'; -$lang['pt_PT']['FieldEditor.ss']['CHECKBOXGROUPTITLE'] = 'Adicionar Grupo de caixas de tick'; -$lang['pt_PT']['FieldEditor.ss']['CHECKBOXGROUP'] = 'Grupo de Caixas de tick'; -$lang['pt_PT']['FieldEditor.ss']['MEMBERTITLE'] = 'Adicionar Selecção de Membros'; -$lang['pt_PT']['FieldEditor.ss']['MEMBER'] = 'Selecção de Membros'; - -// EditableTextField.ss -$lang['pt_PT']['EditableTextField.ss']['DRAG'] = 'Arraste para reordenar os campos'; -$lang['pt_PT']['EditableTextField.ss']['TEXTFIELD'] = 'Campo de texto'; -$lang['pt_PT']['EditableTextField.ss']['MORE'] = 'Mais opções'; -$lang['pt_PT']['EditableTextField.ss']['DELETE'] = 'Apagar este campo'; - -// EditableRadioOption.ss -$lang['pt_PT']['EditableRadioOption.ss']['DRAG'] = 'Arraste para reordenar os campos'; -$lang['pt_PT']['EditableRadioOption.ss']['DELETE'] = 'Remover esta opção'; -$lang['pt_PT']['EditableRadioOption.ss']['LOCKED'] = 'Estes campos não podem ser alterados'; - -// EditableRadioField.ss -$lang['pt_PT']['EditableRadioField.ss']['DRAG'] = 'Arraste para reordenar os campos'; -$lang['pt_PT']['EditableRadioField.ss']['LOCKED'] = 'Estes campos não podem ser alterados'; -$lang['pt_PT']['EditableRadioField.ss']['SET'] = 'Conjunto de botões de rádio'; -$lang['pt_PT']['EditableRadioField.ss']['MORE'] = 'Mais opções'; -$lang['pt_PT']['EditableRadioField.ss']['DELETE'] = 'Remover esta opção'; -$lang['pt_PT']['EditableRadioField.ss']['REQUIRED'] = 'Este campo é obrigatório para este formulário e não pode ser apagado.'; -$lang['pt_PT']['EditableRadioField.ss']['ADD'] = 'Adicionar opção'; - -// EditableFormHeading.ss -$lang['pt_PT']['EditableFormHeading.ss']['DRAG'] = 'Arraste para reordenar os campos'; -$lang['pt_PT']['EditableFormHeading.ss']['DELETE'] = 'Remover esta opção'; -$lang['pt_PT']['EditableFormHeading.ss']['MORE'] = 'Mais opções'; -$lang['pt_PT']['EditableFormHeading.ss']['HEADING'] = 'Cabeçalho'; - -// EditableFormField.ss -$lang['pt_PT']['EditableFormField.ss']['DRAG'] = 'Arraste para reordenar os campos'; -$lang['pt_PT']['EditableFormField.ss']['LOCKED'] = 'Estes campos não podem ser alterados'; -$lang['pt_PT']['EditableFormField.ss']['MORE'] = 'Mais opções'; -$lang['pt_PT']['EditableFormField.ss']['DELETE'] = 'Remover esta opção'; -$lang['pt_PT']['EditableFormField.ss']['REQUIRED'] = 'Este campo é obrigatório para este formulário e não pode ser apagado.'; - -// EditableRadioOption.ss -$lang['pt_PT']['EditableFormFieldOption.ss']['DRAG'] = 'Arraste para reordenar os campos'; -$lang['pt_PT']['EditableFormFieldOption.ss']['DELETE'] = 'Remover esta opção'; -$lang['pt_PT']['EditableFormFieldOption.ss']['LOCKED'] = 'Estes campos não podem ser alterados'; - -// EditableFileField.ss -$lang['pt_PT']['EditableFileField.ss']['DRAG'] = 'Arraste para reordenar os campos'; - -// EditableFileField.ss -$lang['pt_PT']['EditableFileField.ss']['DRAG'] = 'Arraste para reordenar os campos'; -$lang['pt_PT']['EditableFileField.ss']['FILE'] = 'Campo de envio de ficheiro'; -$lang['pt_PT']['EditableFileField.ss']['MORE'] = 'Mais opções'; -$lang['pt_PT']['EditableFileField.ss']['DELETE'] = 'Remover esta opção'; - -// EditableEmailField.ss -$lang['pt_PT']['EditableEmailField.ss']['DRAG'] = 'Arraste para reordenar os campos'; -$lang['pt_PT']['EditableEmailField.ss']['EMAIL'] = 'Campo de email'; -$lang['pt_PT']['EditableEmailField.ss']['MORE'] = 'Mais opções'; -$lang['pt_PT']['EditableEmailField.ss']['DELETE'] = 'Remover esta opção'; -$lang['pt_PT']['EditableEmailField.ss']['REQUIRED'] = 'Este campo é obrigatório para este formulário e não pode ser apagado.'; - -// EditableDropdown.ss -$lang['pt_PT']['EditableDropdown.ss']['LOCKED'] = 'Estes campos não podem ser alterados'; -$lang['pt_PT']['EditableDropdown.ss']['DRAG'] = 'Arraste para reordenar os campos'; -$lang['pt_PT']['EditableDropdown.ss']['DROPDOWN'] = 'Lista de Selecção'; -$lang['pt_PT']['EditableDropdown.ss']['MORE'] = 'Mais opções'; -$lang['pt_PT']['EditableDropdown.ss']['DELETE'] = 'Remover esta opção'; -$lang['pt_PT']['EditableDropdown.ss']['REQUIRED'] = 'Este campo é obrigatório para este formulário e não pode ser apagado.'; - -// EditableDropdownOption.ss -$lang['pt_PT']['EditableDropdownOption.ss']['DRAG'] = 'Arraste para reordenar os campos'; -$lang['pt_PT']['EditableDropdownOption.ss']['LOCKED'] = 'Estes campos não podem ser alterados'; -$lang['pt_PT']['EditableDropdownOption.ss']['DELETE'] = 'Remover esta opção'; - -// EditableDateField.ss -$lang['pt_PT']['EditableDateField.ss']['DRAG'] = 'Arraste para reordenar os campos'; -$lang['pt_PT']['EditableDateField.ss']['MORE'] = 'Mais opções'; -$lang['pt_PT']['EditableDateField.ss']['DELETE'] = 'Remover esta opção'; -$lang['pt_PT']['EditableDateField.ss']['DATE'] = 'Campo de Data'; - -// EditableCheckbox.ss -$lang['pt_PT']['EditableCheckbox.ss']['LOCKED'] = 'Estes campos não podem ser alterados'; -$lang['pt_PT']['EditableCheckbox.ss']['DRAG'] = 'Arraste para reordenar os campos'; -$lang['pt_PT']['EditableCheckbox.ss']['CHECKBOX'] = 'Caixa de tick'; -$lang['pt_PT']['EditableCheckbox.ss']['MORE'] = 'Mais opções'; -$lang['pt_PT']['EditableCheckbox.ss']['DELETE'] = 'Remover esta opção'; - -// EditableCheckboxOption.ss -$lang['pt_PT']['EditableCheckboxOption.ss']['DRAG'] = 'Arraste para reordenar os campos'; -$lang['pt_PT']['EditableCheckboxOption.ss']['LOCKED'] = 'Estes campos não podem ser alterados'; -$lang['pt_PT']['EditableCheckboxOption.ss']['DELETE'] = 'Remover esta opção'; - -// EditableCheckboxGroupField.ss -$lang['pt_PT']['EditableCheckboxGroupField.ss']['DRAG'] = 'Arraste para reordenar os campos'; -$lang['pt_PT']['EditableCheckboxGroupField.ss']['MORE'] = 'Mais opções'; -$lang['pt_PT']['EditableCheckboxGroupField.ss']['DELETE'] = 'Remover esta opção'; -$lang['pt_PT']['EditableCheckboxGroupField.ss']['DATE'] = 'Campo de Data'; - -// EditableCheckboxGroupField.ss -$lang['pt_PT']['EditableCheckboxGroupField.ss']['LOCKED'] = 'Estes campos não podem ser alterados'; -$lang['pt_PT']['EditableCheckboxGroupField.ss']['DRAG'] = 'Arraste para reordenar os campos'; -$lang['pt_PT']['EditableCheckboxGroupField.ss']['CHECKBOXGROUP'] = 'Grupo de Caixas de tick'; -$lang['pt_PT']['EditableCheckboxGroupField.ss']['MORE'] = 'Mais opções'; -$lang['pt_PT']['EditableCheckboxGroupField.ss']['DELETE'] = 'Remover esta opção'; -$lang['pt_PT']['EditableCheckboxGroupField.ss']['REQUIRED'] = 'Este campo é obrigatório para este formulário e não pode ser apagado.'; -$lang['pt_PT']['EditableCheckboxGroupField.ss']['ADD'] = 'Adicionar opção'; - -// ForgotPasswordEmail.ss -$lang['pt_PT']['ForgotPasswordEmail.ss']['TEXT1'] = 'Aqui está o seu'; -$lang['pt_PT']['ForgotPasswordEmail.ss']['TEXT2'] = 'link de reset da password'; -$lang['pt_PT']['ForgotPasswordEmail.ss']['TEXT3'] = 'para'; - -// TableListField_PageControls.ss -$lang['pt_PT']['TableListField_PageControls.ss']['VIEWLAST'] = 'Ver último'; -$lang['pt_PT']['TableListField_PageControls.ss']['VIEWFIRST'] = 'Ver primeiro'; -$lang['pt_PT']['TableListField_PageControls.ss']['VIEWPREVIOUS'] = 'Ver anterior'; -$lang['pt_PT']['TableListField_PageControls.ss']['VIEWNEXT'] = 'Ver próximo'; -$lang['pt_PT']['TableListField_PageControls.ss']['DISPLAYING'] = 'A Mostrar'; -$lang['pt_PT']['TableListField_PageControls.ss']['TO'] = 'até'; -$lang['pt_PT']['TableListField_PageControls.ss']['OF'] = 'de'; - -// New2 - -$lang['pt_PT']['TableField.ss']['ADD'] = 'Adicionar nova linha'; -$lang['pt_PT']['TableField.ss']['ADDITEM'] = 'Adicionar'; -$lang['pt_PT']['TableField.ss']['DELETEROW'] = 'Apagar esta linha'; -$lang['pt_PT']['TableField.ss']['DELETE'] = 'apagar'; - -$lang['pt_PT']['Security']['OPENIDHEADER'] = 'Credenciais OpenID/i-name'; -$lang['pt_PT']['Security']['MEMBERALREADYEXISTS'] = 'Já existe um utilizador com esta identidade'; -$lang['pt_PT']['Security']['OPENIDURL'] = 'OpenID URL/i-name'; -$lang['pt_PT']['Security']['OPENIDDESC'] = 'Certifique-se que inseriu aqui as suas credenciais OpenID/i-name normalizadas - , p.ex. com protocolo e barra para a direita para o OpenID (ex. http://openid.silverstripe.com/).
'; -$lang['pt_PT']['Security']['EDITOPENIDURL'] = 'OpenID URL/i-name (ex. http://openid.silverstripe.com/)'; -$lang['pt_PT']['Security']['OPENIDURLNORMALIZATION'] = 'Certifique-se que inseriu aqui as suas credenciais OpenID/i-name normalizadas - , p.ex. com protocolo e barra para a direita para o OpenID (ex. http://openid.silverstripe.com/).
'; - -$lang['pt_PT']['TableListField']['CSVEXPORT'] = 'Exportar para CSV'; -$lang['pt_PT']['TableListField']['PRINT'] = 'Imprimir'; - -$lang['pt_PT']['Permission']['FULLADMINRIGHTS'] = 'Permissões de administração total'; - -$lang['pt_PT']['Page']['CLASSNAME'] = 'Página'; - -$lang['pt_PT']['Statistics']['TRENDS'] = 'Tendências'; -$lang['pt_PT']['Statistics']['LEGEND'] = 'Legenda'; -$lang['pt_PT']['Statistics']['BROWSERS'] = 'Browsers'; -$lang['pt_PT']['Statistics']['ID'] = 'ID'; -$lang['pt_PT']['Statistics']['EMAIL'] = 'Email'; -$lang['pt_PT']['Statistics']['JOINED'] = 'Creado em'; -$lang['pt_PT']['Statistics']['REGISTEREDUSERS'] = 'Utilizadores Registados'; -$lang['pt_PT']['Statistics']['CSVEXPORT'] = 'Exportar como CSV'; -$lang['pt_PT']['Statistics']['RECENTPAGEVIEWS'] = 'Visualização Recente de Páginas'; -$lang['pt_PT']['Statistics']['TIME'] = 'Data/Hora'; -$lang['pt_PT']['Statistics']['BROWSER'] = 'Browser'; -$lang['pt_PT']['Statistics']['OSABREV'] = 'SO'; -$lang['pt_PT']['Statistics']['USER'] = 'Utilizador'; -$lang['pt_PT']['Statistics']['PAGE'] = 'Página'; -$lang['pt_PT']['Statistics']['PAGEVIEWS'] = 'Visualizações'; -$lang['pt_PT']['Statistics']['OS'] = 'Sistemas Operativos'; -$lang['pt_PT']['Statistics']['USERACTIVITY'] = 'Actividade dos Utilizadores'; - - ?> \ No newline at end of file diff --git a/lang/ru_RU.php b/lang/ru_RU.php index 7d84623d7..ccc9fe114 100644 --- a/lang/ru_RU.php +++ b/lang/ru_RU.php @@ -4,11 +4,7 @@ i18n::include_locale_file('sapphire', 'en_US'); global $lang; -if(array_key_exists('ru_RU', $lang) && is_array($lang['ru_RU'])) { - $lang['ru_RU'] = array_merge($lang['en_US'], $lang['ru_RU']); -} else { - $lang['ru_RU'] = $lang['en_US']; -} +$lang['ru_RU'] = $lang['en_US']; $lang['ru_RU']['BasicAuth']['ENTERINFO'] = 'ПожалуйÑта, введите Ð¸Ð¼Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ Ð¸ пароль.'; $lang['ru_RU']['BasicAuth']['ERRORNOTADMIN'] = 'Такой пользователь не ÑвлÑетÑÑ Ð°Ð´Ð¼Ð¸Ð½Ð¸Ñтратором.'; diff --git a/lang/sk_SK.php b/lang/sk_SK.php index e94e4c75a..a7dc41158 100644 --- a/lang/sk_SK.php +++ b/lang/sk_SK.php @@ -4,11 +4,7 @@ i18n::include_locale_file('sapphire', 'en_US'); global $lang; -if(array_key_exists('sk_SK', $lang) && is_array($lang['sk_SK'])) { - $lang['sk_SK'] = array_merge($lang['en_US'], $lang['sk_SK']); -} else { - $lang['sk_SK'] = $lang['en_US']; -} +$lang['sk_SK'] = $lang['en_US']; $lang['sk_SK']['BasicAuth']['ENTERINFO'] = 'ProsÃm zadajte použÃvateľské meno a heslo.'; $lang['sk_SK']['BasicAuth']['ERRORNOTADMIN'] = 'Tento použÃvateľ nie je administrátor.'; diff --git a/lang/sv_SE.php b/lang/sv_SE.php index cf1b81574..e57077290 100644 --- a/lang/sv_SE.php +++ b/lang/sv_SE.php @@ -4,11 +4,7 @@ i18n::include_locale_file('sapphire', 'en_US'); global $lang; -if(array_key_exists('sv_SE', $lang) && is_array($lang['sv_SE'])) { - $lang['sv_SE'] = array_merge($lang['en_US'], $lang['sv_SE']); -} else { - $lang['sv_SE'] = $lang['en_US']; -} +$lang['sv_SE'] = $lang['en_US']; $lang['sv_SE']['BasicAuth']['ENTERINFO'] = 'Var god ange användarnamn och lösenord'; $lang['sv_SE']['BasicAuth']['ERRORNOTADMIN'] = 'Den användaren är ingen administratör'; @@ -128,7 +124,6 @@ $lang['sv_SE']['HtmlEditorField']['LINKOPENNEWWIN'] = 'Öppna länk i nytt föns $lang['sv_SE']['HtmlEditorField']['LINKTO'] = 'Länka till'; $lang['sv_SE']['HtmlEditorField']['OK'] = 'ok'; $lang['sv_SE']['HtmlEditorField']['OL'] = 'Numrerad lista'; -$lang['sv_SE']['HtmlEditorField']['OUTDENT'] = 'Minska indrag'; $lang['sv_SE']['HtmlEditorField']['PAGE'] = 'Sida'; $lang['sv_SE']['HtmlEditorField']['PASTE'] = 'Klistra in'; $lang['sv_SE']['HtmlEditorField']['REDO'] = 'Gör om'; @@ -215,7 +210,6 @@ $lang['sv_SE']['SiteTree']['APPEARSVIRTUALPAGES'] = 'Det här innehÃ¥llet finns $lang['sv_SE']['SiteTree']['BUTTONCANCELDRAFT'] = 'Upphäv utkast-ändringar'; $lang['sv_SE']['SiteTree']['BUTTONCANCELDRAFTDESC'] = 'Radera ditt utkast och Ã¥tergÃ¥ till den publicerade sidan'; $lang['sv_SE']['SiteTree']['BUTTONSAVEPUBLISH'] = 'Spara & publicera'; -$lang['sv_SE']['SiteTree']['BUTTONUNPUBLISH'] = 'Avpublicera'; $lang['sv_SE']['SiteTree']['BUTTONUNPUBLISHDESC'] = 'Ta bort den här sidan frÃ¥n den publicerade sajten'; $lang['sv_SE']['SiteTree']['EDITANYONE'] = 'Alla som kan logga in'; $lang['sv_SE']['SiteTree']['EDITHEADER'] = 'Vem kan redigera den här sidan frÃ¥n CMS:et'; @@ -232,7 +226,6 @@ $lang['sv_SE']['SiteTree']['METADESC'] = 'Beskrivning'; $lang['sv_SE']['SiteTree']['METAEXTRA'] = 'Egna meta-taggar'; $lang['sv_SE']['SiteTree']['METAHEADER'] = 'Meta-taggar för sökmotorer'; $lang['sv_SE']['SiteTree']['METAKEYWORDS'] = 'Nyckelord'; -$lang['sv_SE']['SiteTree']['METAPAGEPRIO'] = 'Sidprioritet'; $lang['sv_SE']['SiteTree']['METATITLE'] = 'Titel'; $lang['sv_SE']['SiteTree']['MODIFIEDONDRAFT'] = 'Modifierad pÃ¥ utkast-sajten'; $lang['sv_SE']['SiteTree']['NOBACKLINKS'] = 'Den här sidan har inte blivit länkad frÃ¥n nÃ¥gon annan sida.'; diff --git a/lang/tr_TR.php b/lang/tr_TR.php index 26891fd81..5f86eb2aa 100644 --- a/lang/tr_TR.php +++ b/lang/tr_TR.php @@ -4,11 +4,7 @@ i18n::include_locale_file('sapphire', 'en_US'); global $lang; -if(array_key_exists('tr_TR', $lang) && is_array($lang['tr_TR'])) { - $lang['tr_TR'] = array_merge($lang['en_US'], $lang['tr_TR']); -} else { - $lang['tr_TR'] = $lang['en_US']; -} +$lang['tr_TR'] = $lang['en_US']; $lang['tr_TR']['BasicAuth']['ENTERINFO'] = 'Lütfen kullanıcı adı ve ÅŸifrenizi giriniz.'; $lang['tr_TR']['BasicAuth']['ERRORNOTADMIN'] = 'O kullanıcı, yönetici deÄŸildir'; diff --git a/lang/zh_CN.php b/lang/zh_CN.php index bbae345bc..f921c9d08 100644 --- a/lang/zh_CN.php +++ b/lang/zh_CN.php @@ -4,11 +4,7 @@ i18n::include_locale_file('sapphire', 'en_US'); global $lang; -if(array_key_exists('zh_CN', $lang) && is_array($lang['zh_CN'])) { - $lang['zh_CN'] = array_merge($lang['en_US'], $lang['zh_CN']); -} else { - $lang['zh_CN'] = $lang['en_US']; -} +$lang['zh_CN'] = $lang['en_US']; $lang['zh_CN']['BasicAuth']['ENTERINFO'] = '请输入用户å和密ç '; $lang['zh_CN']['BasicAuth']['ERRORNOTADMIN'] = 'æ¤ç”¨æˆ·æ²¡æœ‰ç®¡ç†å‘˜æƒé™ã€‚'; diff --git a/lang/zh_TW.php b/lang/zh_TW.php index 185bc97f2..52bf81cd1 100644 --- a/lang/zh_TW.php +++ b/lang/zh_TW.php @@ -4,11 +4,7 @@ i18n::include_locale_file('sapphire', 'en_US'); global $lang; -if(array_key_exists('zh_TW', $lang) && is_array($lang['zh_TW'])) { - $lang['zh_TW'] = array_merge($lang['en_US'], $lang['zh_TW']); -} else { - $lang['zh_TW'] = $lang['en_US']; -} +$lang['zh_TW'] = $lang['en_US']; $lang['zh_TW']['BasicAuth']['ENTERINFO'] = '請輸入帳號密碼。'; $lang['zh_TW']['BasicAuth']['ERRORNOTADMIN'] = '那個使用者ä¸æ˜¯ç®¡ç†å“¡ã€‚'; diff --git a/main.php b/main.php index a7eeaafc8..a0ba8615e 100644 --- a/main.php +++ b/main.php @@ -2,50 +2,9 @@ /** * Main file that handles every page request. - * - * The main.php does a number of set-up activities for the request. - * - * - Includes the first one of the following files that it finds: (root)/_ss_environment.php, (root)/../_ss_environment.php, or (root)/../../_ss_environment.php - * - Gets an up-to-date manifest from {@link ManifestBuilder} - * - Sets up error handlers with {@link Debug::loadErrorHandlers()} - * - Calls {@link DB::connect()}, passing it the global variable $databaseConfig that should be defined in an _config.php - * - Sets up the default director rules using {@link Director::addRules()} - * - * After that, it calls {@link Director::direct()}, which is responsible for doing most of the real work. - * - * Finally, main.php will use {@link Profiler} to show a profile if the querystring variable "debug_profile" is set. - * - * CONFIGURING THE WEBSERVER - * - * To use Sapphire, every request that doesn't point directly to a file should be rewritten to sapphire/main.php?url=(url). - * For example, http://www.example.com/about-us/rss would be rewritten to http://www.example.com/sapphire/main.php?url=about-us/rss - * - * It's important that requests that point directly to a file aren't rewritten; otherwise, visitors won't be able to download - * any CSS, JS, image files, or other downloads. - * - * On Apache, RewriteEngine can be used to do this. - * - * @package sapphire - * @subpackage core - * @see Director::direct() */ -/** - * Include _ss_environment.php file - */ -$envFiles = array('../_ss_environment.php', '../../_ss_environment.php', '../../../_ss_environment.php'); -foreach($envFiles as $envFile) { - if(@file_exists($envFile)) { - include($envFile); - break; - } -} - -/** - * Include Sapphire's core code - */ require_once("core/Core.php"); - header("Content-type: text/html; charset=\"utf-8\""); if(function_exists('mb_http_output')) { mb_http_output('UTF-8'); @@ -61,27 +20,6 @@ if(isset($_REQUEST['trace'])) { apd_set_pprof_trace(); } -// Ensure we have enough memory -$memString = ini_get("memory_limit"); -switch(strtolower(substr($memString,-1))) { - case "k": - $memory = round(substr($memString,0,-1)*1024); - break; - case "m": - $memory = round(substr($memString,0,-1)*1024*1024); - break; - case "g": - $memory = round(substr($memString,0,-1)*1024*1024*1024); - break; - default: - $memory = round($memString); -} -// Check we have at least 32M -if($memory < (32 * 1024 * 1024)) { - // Increase memory limit - ini_set('memory_limit', '32M'); -} - require_once("core/ManifestBuilder.php"); require_once("core/ClassInfo.php"); @@ -97,6 +35,14 @@ if(Director::isDev()) { Session::start(); +$envFiles = array('../_ss_environment.php', '../../_ss_environment.php', '../../../_ss_environment.php'); +foreach($envFiles as $envFile) { + if(@file_exists($envFile)) { + include($envFile); + break; + } +} + if(isset($_GET['url'])) { $url = $_GET['url']; @@ -141,6 +87,7 @@ Debug::loadErrorHandlers(); require_once("core/model/DB.php"); if(isset($_GET['debug_profile'])) Profiler::mark('DB::connect'); +Debug::show($databaseConfig); DB::connect($databaseConfig); if(isset($_GET['debug_profile'])) Profiler::unmark('DB::connect'); diff --git a/main.php5 b/main.php5 index ba13e4946..028277385 100644 --- a/main.php5 +++ b/main.php5 @@ -1,10 +1,3 @@ \ No newline at end of file diff --git a/misc/Browscap.php b/misc/Browscap.php index f07279b32..e41a4a1e0 100644 --- a/misc/Browscap.php +++ b/misc/Browscap.php @@ -1,10 +1,5 @@ * @copyright Copyright (c) 2006 Jonathan Stoppani * @version 0.7 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License * @link http://garetjax.info/projects/browscap/ - * @package sapphire - * @subpackage misc */ class Browscap { @@ -95,7 +89,7 @@ class Browscap * $updateMethod: The method to use to update the file, has to be a value of * an UPDATE_* constant, null or false. */ - public $remoteIniUrl = 'http://browsers.garykeith.com/stream.asp?Lite_BrowsCapINI'; + public $remoteIniUrl = 'http://browsers.garykeith.com/stream.asp?BrowsCapINI'; public $remoteVerUrl = 'http://browsers.garykeith.com/version-date.asp'; public $timeout = 5; public $updateInterval = 432000; // 5 days @@ -273,7 +267,7 @@ class Browscap $browser = $value = $browser + $this->_browsers[$key]; - while (array_key_exists(3, $value) && $value[3] != null && $value[3] != '') { + while (array_key_exists(3, $value)) { $value = $this->_browsers[$value[3]]; $browser += $value; } @@ -662,12 +656,11 @@ class Browscap /** * Browscap.ini parsing class exception * + * @package Browscap * @author Jonathan Stoppani