# HG changeset patch # User Dan # Date 1198647446 18000 # Node ID c72b545f1304ef5b64de6809b6c83b68334d38f6 # Parent 32429702305e09914cbd2ed3713185f622c94be8 More localization work. Resolved major issue with JSON parser not parsing files over ~50KB. Switched JSON parser to the one from the Zend Framework (BSD licensed). Forced to split enano.json into five different files. diff -r 32429702305e -r c72b545f1304 ajax.php --- a/ajax.php Fri Dec 21 19:08:27 2007 -0500 +++ b/ajax.php Wed Dec 26 00:37:26 2007 -0500 @@ -47,7 +47,6 @@ $db->connect(); // result is sent using JSON - $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); $return = Array( 'mode' => 'success', 'users_real' => Array() @@ -61,7 +60,7 @@ 'mode' => 'error', 'error' => 'Invalid URI' ); - die( $json->encode($return) ); + die( enano_json_encode($return) ); } $allowanon = ( isset($_GET['allowanon']) && $_GET['allowanon'] == '1' ) ? '' : ' AND user_id > 1'; $q = $db->sql_query('SELECT username FROM '.table_prefix.'users WHERE ' . ENANO_SQLFUNC_LOWERCASE . '(username) LIKE ' . ENANO_SQLFUNC_LOWERCASE . '(\'%'.$name.'%\')' . $allowanon . ' ORDER BY username ASC;'); @@ -80,7 +79,7 @@ // all done! :-) $db->close(); - echo $json->encode( $return ); + echo enano_json_encode( $return ); exit; } @@ -285,7 +284,6 @@ die('GOOD'); break; case 'get_tags': - $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); $ret = array('tags' => array(), 'user_level' => $session->user_level, 'can_add' => $session->get_permissions('tag_create')); $q = $db->sql_query('SELECT t.tag_id, t.tag_name, pg.pg_target IS NOT NULL AS used_in_acl, t.user_id FROM '.table_prefix.'tags AS t @@ -321,11 +319,10 @@ ); } - echo $json->encode($ret); + echo enano_json_encode($ret); break; case 'addtag': - $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); $resp = array( 'success' => false, 'error' => 'No error', @@ -337,7 +334,7 @@ if ( !$session->get_permissions('tag_create') ) { $resp['error'] = 'You are not permitted to tag pages.'; - die($json->encode($resp)); + die(enano_json_encode($resp)); } // sanitize the tag name @@ -347,7 +344,7 @@ if ( strlen($tag) < 2 ) { $resp['error'] = 'Tags must consist of at least 2 alphanumeric characters.'; - die($json->encode($resp)); + die(enano_json_encode($resp)); } // check if tag is already on page @@ -357,7 +354,7 @@ if ( $db->numrows() > 0 ) { $resp['error'] = 'This page already has this tag.'; - die($json->encode($resp)); + die(enano_json_encode($resp)); } $db->free_result(); @@ -369,7 +366,7 @@ if ( $db->numrows() > 0 && !$can_edit_acl ) { $resp['error'] = 'This tag is used in an ACL page group, and thus can\'t be added to a page by people without administrator privileges.'; - die($json->encode($resp)); + die(enano_json_encode($resp)); } $resp['in_acl'] = ( $db->numrows() > 0 ); $db->free_result(); @@ -383,7 +380,7 @@ $resp['tag'] = $tag; $resp['tag_id'] = $db->insert_id(); - echo $json->encode($resp); + echo enano_json_encode($resp); break; case 'deltag': diff -r 32429702305e -r c72b545f1304 images/pm_ajax.gif Binary file images/pm_ajax.gif has changed diff -r 32429702305e -r c72b545f1304 images/pm_star_off.png Binary file images/pm_star_off.png has changed diff -r 32429702305e -r c72b545f1304 images/pm_star_on.png Binary file images/pm_star_on.png has changed diff -r 32429702305e -r c72b545f1304 includes/clientside/css/enano-shared.css --- a/includes/clientside/css/enano-shared.css Fri Dec 21 19:08:27 2007 -0500 +++ b/includes/clientside/css/enano-shared.css Wed Dec 26 00:37:26 2007 -0500 @@ -193,6 +193,7 @@ div.search-result span.search-result-info { color: #7777CC; } div.search-result span.search-result-url { color: green; } div.search-result span.search-term, div.search-result span.title-search-term { background-color: #FFFFC0; font-weight: bold; } +div.search-result span.url-search-term { font-weight: bold; } div.search-result span.search-result-annotation { font-size: 8pt; } div.search-hibar { border-top: 1px solid #3366CC; margin-top: 10px; color: #000; background-color: #D5DFF3; padding: 3px; vertical-align: middle; } div.search-lobar { background-color: #E5EFFF; margin: 0; padding: 5px; } @@ -526,3 +527,121 @@ font-size: 0.7em; } +/* Default private message AJAX interface styles (colors and style based on those of Gmail) */ + +div#privmsgs { + /* Neal prefers this border but I personally consider it distasteful because it detracts from the Gmail-ey look. + border: 1px solid #c0c0c0; */ + background-color: white; + color: black; +} + +span.pm_link { + color: #0000ff; + cursor: pointer; + text-decoration: underline; +} + +span.pm_link_folder { + display: block; + text-decoration: none; + padding: 3px; +} + +span.pm_link_selected { + background-color: #c3d9ff; + font-weight: bold; + text-decoration: underline; +} + +span.pm_link_selected_trash { + background-color: #d9d9db; +} + +div.pm_break { + height: 10px; +} + +div.pm_main { + background-color: #c3d9ff; + padding: 5px 5px 3px 5px; + margin-left: 12em; + min-height: 16em; +} + +div.pm_main_trash { + background-color: #d9d9db; +} + +div.pm_status { + display: table; + background-color: #cc0000; + padding: 3px; + margin: 0 auto; + color: white; +} + +div.pm_teaser { + background-color: white; + color: black; + text-align: center; + padding: 8em 1em 8em 1em; +} + +div.pm_mlist_message { + background-color: #e8eef7; + color: black; + border-bottom: 1px solid #d8d8d8; + cursor: pointer; +} + +div.pm_mlist_message span.pm_subject { + font-weight: normal; + display: inline-block; + clip: rect(0px, auto, auto, 0px); + overflow: hidden; + margin: 0 3px 0 0; +} + +div.pm_mlist_message span.pm_sender { + display: inline-block; + width: 30%; + margin: 0 10px 0% 4px; + font-weight: normal; + clip: rect(0px, auto, auto, 0px); + overflow: hidden; +} + +div.pm_mlist_message span.pm_miniclip { + color: #909090; + display: inline-block; + clip: rect(0px, auto, auto, 0px); + overflow: hidden; +} + +div.pm_messagelist_inner { + min-height: 12em; + background-color: white; +} + +div.pm_mlist_message_unread { + background-color: white; +} + +div.pm_mlist_message_unread span.pm_subject { + font-weight: bold; +} + +div.pm_mlist_message_unread span.pm_sender { + font-weight: bold; +} + +div.pm_mlist_message_selected { + background-color: #ffffcc; +} + +span.pm_toolbar_label { + color: black; + font-weight: bold; +} + diff -r 32429702305e -r c72b545f1304 includes/clientside/static/l10n.js --- a/includes/clientside/static/l10n.js Fri Dec 21 19:08:27 2007 -0500 +++ b/includes/clientside/static/l10n.js Wed Dec 26 00:37:26 2007 -0500 @@ -18,7 +18,7 @@ return string_id; if ( typeof(this.strings[catname][string_name]) != 'string' ) return string_id; - return '[LJS] ' + this.perform_subst(this.strings[catname][string_name], subst); + return this.perform_subst(this.strings[catname][string_name], subst) + '**'; } this.perform_subst = function(str, subst) diff -r 32429702305e -r c72b545f1304 includes/clientside/static/misc.js --- a/includes/clientside/static/misc.js Fri Dec 21 19:08:27 2007 -0500 +++ b/includes/clientside/static/misc.js Wed Dec 26 00:37:26 2007 -0500 @@ -792,3 +792,13 @@ return ( email.match(/^(?:[\w\d_-]+\.?)+@((?:(?:[\w\d_-]\-?)+\.)+\w{2,4}|localhost)$/) ) ? true : false; } +/** + * Equivalent of PHP's time() + * @return int + */ + +function unix_time() +{ + return parseInt((new Date()).getTime()/1000); +} + diff -r 32429702305e -r c72b545f1304 includes/comment.php --- a/includes/comment.php Fri Dec 21 19:08:27 2007 -0500 +++ b/includes/comment.php Wed Dec 26 00:37:26 2007 -0500 @@ -80,19 +80,18 @@ function process_json($json) { global $db, $session, $paths, $template, $plugins; // Common objects - $parser = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); - $data = $parser->decode($json); + $data = enano_json_decode($json); $data = decode_unicode_array($data); if ( !isset($data['mode']) ) { $ret = Array('mode'=>'error','error'=>'No mode defined!'); - echo $parser->encode($ret); + echo enano_json_encode($ret); return $ret; } if ( getConfig('enable_comments') == '0' ) { $ret = Array('mode'=>'error','error'=>'Comments are not enabled on this site.'); - echo $parser->encode($ret); + echo enano_json_encode($ret); return $ret; } $ret = Array(); @@ -346,7 +345,7 @@ 'mode' => 'error', 'error' => 'You are not authorized to moderate comments.' ); - echo $parser->encode($ret); + echo enano_json_encode($ret); return $ret; } @@ -383,7 +382,7 @@ ); break; } - echo $parser->encode($ret); + echo enano_json_encode($ret); return $ret; } diff -r 32429702305e -r c72b545f1304 includes/common.php --- a/includes/common.php Fri Dec 21 19:08:27 2007 -0500 +++ b/includes/common.php Wed Dec 26 00:37:26 2007 -0500 @@ -120,6 +120,7 @@ require_once(ENANO_ROOT.'/includes/email.php'); require_once(ENANO_ROOT.'/includes/search.php'); require_once(ENANO_ROOT.'/includes/json.php'); +require_once(ENANO_ROOT.'/includes/json2.php'); require_once(ENANO_ROOT.'/includes/wikiengine/Tables.php'); require_once(ENANO_ROOT.'/includes/pageprocess.php'); require_once(ENANO_ROOT.'/includes/tagcloud.php'); @@ -348,6 +349,14 @@ // All checks passed! Start the main components up. $session->start(); + + // This is where plugins will want to add pages from 1.1.x on out. You can still add pages at base_classes_initted but the titles won't be localized. + $code = $plugins->setHook('session_started'); + foreach ( $code as $cmd ) + { + eval($cmd); + } + $paths->init(); // We're ready for whatever life throws us now. @@ -385,7 +394,7 @@ // A better name for this hook would be common_post. At this point // all of Enano is fully initialized and running and you're ready // to do whatever you want. - $code = $plugins->setHook('session_started'); + $code = $plugins->setHook('common_post'); foreach ( $code as $cmd ) { eval($cmd); diff -r 32429702305e -r c72b545f1304 includes/constants.php --- a/includes/constants.php Fri Dec 21 19:08:27 2007 -0500 +++ b/includes/constants.php Wed Dec 26 00:37:26 2007 -0500 @@ -68,6 +68,15 @@ define('GROUP_HIDDEN', 3); define('GROUP_OPEN', 4); +// Private message flags +define('PM_UNREAD', 1); +define('PM_STARRED', 2); +define('PM_SENT', 4); +define('PM_DRAFT', 8); +define('PM_ARCHIVE', 16); +define('PM_TRASH', 32); +define('PM_DELIVERED', 64); + // Other stuff define('MAX_PMS_PER_BATCH', 7); // The maximum number of users that users can send PMs to in one go; restriction does not apply to users with mod_misc rights diff -r 32429702305e -r c72b545f1304 includes/functions.php --- a/includes/functions.php Fri Dec 21 19:08:27 2007 -0500 +++ b/includes/functions.php Wed Dec 26 00:37:26 2007 -0500 @@ -3806,6 +3806,58 @@ return false; } +/** + * Generates a JSON encoder/decoder singleton. + * @return object + */ + +function enano_json_singleton() +{ + static $json_obj; + if ( !is_object($json_obj) ) + $json_obj = new Services_JSON(SERVICES_JSON_LOOSE_TYPE | SERVICES_JSON_SUPPRESS_ERRORS); + + return $json_obj; +} + +/** + * Wrapper for JSON encoding. + * @param mixed Variable to encode + * @return string JSON-encoded string + */ + +function enano_json_encode($data) +{ + /* + if ( function_exists('json_encode') ) + { + // using PHP5 with JSON support + return json_encode($data); + } + */ + + return Zend_Json::encode($data, true); +} + +/** + * Wrapper for JSON decoding. + * @param string JSON-encoded string + * @return mixed Decoded value + */ + +function enano_json_decode($data) +{ + /* + if ( function_exists('json_decode') ) + { + // using PHP5 with JSON support + return json_decode($data); + } + */ + + return Zend_Json::decode($data, Zend_Json::TYPE_ARRAY); +} + //die('
Original:  01010101010100101010100101010101011010'."\nProcessed: ".uncompress_bitfield(compress_bitfield('01010101010100101010100101010101011010')).'
'); ?> diff -r 32429702305e -r c72b545f1304 includes/json2.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/includes/json2.php Wed Dec 26 00:37:26 2007 -0500 @@ -0,0 +1,1015 @@ +_cycleCheck = $cycleCheck; + } + + /** + * Use the JSON encoding scheme for the value specified + * + * @param mixed $value The value to be encoded + * @param boolean $cycleCheck Whether or not to check for possible object recursion when encoding + * @return string The encoded value + */ + public static function encode($value, $cycleCheck = false) + { + $encoder = new Zend_Json_Encoder(($cycleCheck) ? true : false); + + return $encoder->_encodeValue($value); + } + + /** + * Recursive driver which determines the type of value to be encoded + * and then dispatches to the appropriate method. $values are either + * - objects (returns from {@link _encodeObject()}) + * - arrays (returns from {@link _encodeArray()}) + * - basic datums (e.g. numbers or strings) (returns from {@link _encodeDatum()}) + * + * @param $value mixed The value to be encoded + * @return string Encoded value + */ + protected function _encodeValue(&$value) + { + if (is_object($value)) { + return $this->_encodeObject($value); + } else if (is_array($value)) { + return $this->_encodeArray($value); + } + + return $this->_encodeDatum($value); + } + + + + /** + * Encode an object to JSON by encoding each of the public properties + * + * A special property is added to the JSON object called '__className' + * that contains the name of the class of $value. This is used to decode + * the object on the client into a specific class. + * + * @param $value object + * @return string + * @throws Zend_Json_Exception If recursive checks are enabled and the object has been serialized previously + */ + protected function _encodeObject(&$value) + { + if ($this->_cycleCheck) { + if ($this->_wasVisited($value)) { + throw new Zend_Json_Exception( + 'Cycles not supported in JSON encoding, cycle introduced by ' + . 'class "' . get_class($value) . '"' + ); + } + + $this->_visited[] = $value; + } + + $props = ''; + foreach (get_object_vars($value) as $name => $propValue) { + if (isset($propValue)) { + $props .= ',' + . $this->_encodeValue($name) + . ':' + . $this->_encodeValue($propValue); + } + } + + return '{"__className":"' . get_class($value) . '"' + . $props . '}'; + } + + + /** + * Determine if an object has been serialized already + * + * @param mixed $value + * @return boolean + */ + protected function _wasVisited(&$value) + { + if (in_array($value, $this->_visited, true)) { + return true; + } + + return false; + } + + + /** + * JSON encode an array value + * + * Recursively encodes each value of an array and returns a JSON encoded + * array string. + * + * Arrays are defined as integer-indexed arrays starting at index 0, where + * the last index is (count($array) -1); any deviation from that is + * considered an associative array, and will be encoded as such. + * + * @param $array array + * @return string + */ + protected function _encodeArray(&$array) + { + $tmpArray = array(); + + // Check for associative array + if (!empty($array) && (array_keys($array) !== range(0, count($array) - 1))) { + // Associative array + $result = '{'; + foreach ($array as $key => $value) { + $key = (string) $key; + $tmpArray[] = $this->_encodeString($key) + . ':' + . $this->_encodeValue($value); + } + $result .= implode(',', $tmpArray); + $result .= '}'; + } else { + // Indexed array + $result = '['; + $length = count($array); + for ($i = 0; $i < $length; $i++) { + $tmpArray[] = $this->_encodeValue($array[$i]); + } + $result .= implode(',', $tmpArray); + $result .= ']'; + } + + return $result; + } + + + /** + * JSON encode a basic data type (string, number, boolean, null) + * + * If value type is not a string, number, boolean, or null, the string + * 'null' is returned. + * + * @param $value mixed + * @return string + */ + protected function _encodeDatum(&$value) + { + $result = 'null'; + + if (is_int($value) || is_float($value)) { + $result = (string)$value; + } elseif (is_string($value)) { + $result = $this->_encodeString($value); + } elseif (is_bool($value)) { + $result = $value ? 'true' : 'false'; + } + + return $result; + } + + + /** + * JSON encode a string value by escaping characters as necessary + * + * @param $value string + * @return string + */ + protected function _encodeString(&$string) + { + // Escape these characters with a backslash: + // " \ / \n \r \t \b \f + $search = array('\\', "\n", "\t", "\r", "\b", "\f", '"'); + $replace = array('\\\\', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'); + $string = str_replace($search, $replace, $string); + + // Escape certain ASCII characters: + // 0x08 => \b + // 0x0c => \f + $string = str_replace(array(chr(0x08), chr(0x0C)), array('\b', '\f'), $string); + + return '"' . $string . '"'; + } + + + /** + * Encode the constants associated with the ReflectionClass + * parameter. The encoding format is based on the class2 format + * + * @param $cls ReflectionClass + * @return string Encoded constant block in class2 format + */ + private static function _encodeConstants(ReflectionClass $cls) + { + $result = "constants : {"; + $constants = $cls->getConstants(); + + $tmpArray = array(); + if (!empty($constants)) { + foreach ($constants as $key => $value) { + $tmpArray[] = "$key: " . self::encode($value); + } + + $result .= implode(', ', $tmpArray); + } + + return $result . "}"; + } + + + /** + * Encode the public methods of the ReflectionClass in the + * class2 format + * + * @param $cls ReflectionClass + * @return string Encoded method fragment + * + */ + private static function _encodeMethods(ReflectionClass $cls) + { + $methods = $cls->getMethods(); + $result = 'methods:{'; + + $started = false; + foreach ($methods as $method) { + if (! $method->isPublic() || !$method->isUserDefined()) { + continue; + } + + if ($started) { + $result .= ','; + } + $started = true; + + $result .= '' . $method->getName(). ':function('; + + if ('__construct' != $method->getName()) { + $parameters = $method->getParameters(); + $paramCount = count($parameters); + $argsStarted = false; + + $argNames = "var argNames=["; + foreach ($parameters as $param) { + if ($argsStarted) { + $result .= ','; + } + + $result .= $param->getName(); + + if ($argsStarted) { + $argNames .= ','; + } + + $argNames .= '"' . $param->getName() . '"'; + + $argsStarted = true; + } + $argNames .= "];"; + + $result .= "){" + . $argNames + . 'var result = ZAjaxEngine.invokeRemoteMethod(' + . "this, '" . $method->getName() + . "',argNames,arguments);" + . 'return(result);}'; + } else { + $result .= "){}"; + } + } + + return $result . "}"; + } + + + /** + * Encode the public properties of the ReflectionClass in the class2 + * format. + * + * @param $cls ReflectionClass + * @return string Encode properties list + * + */ + private static function _encodeVariables(ReflectionClass $cls) + { + $properties = $cls->getProperties(); + $propValues = get_class_vars($cls->getName()); + $result = "variables:{"; + $cnt = 0; + + $tmpArray = array(); + foreach ($properties as $prop) { + if (! $prop->isPublic()) { + continue; + } + + $tmpArray[] = $prop->getName() + . ':' + . self::encode($propValues[$prop->getName()]); + } + $result .= implode(',', $tmpArray); + + return $result . "}"; + } + + /** + * Encodes the given $className into the class2 model of encoding PHP + * classes into JavaScript class2 classes. + * NOTE: Currently only public methods and variables are proxied onto + * the client machine + * + * @param $className string The name of the class, the class must be + * instantiable using a null constructor + * @param $package string Optional package name appended to JavaScript + * proxy class name + * @return string The class2 (JavaScript) encoding of the class + * @throws Zend_Json_Exception + */ + public static function encodeClass($className, $package = '') + { + $cls = new ReflectionClass($className); + if (! $cls->isInstantiable()) { + throw new Zend_Json_Exception("$className must be instantiable"); + } + + return "Class.create('$package$className',{" + . self::_encodeConstants($cls) ."," + . self::_encodeMethods($cls) ."," + . self::_encodeVariables($cls) .'});'; + } + + + /** + * Encode several classes at once + * + * Returns JSON encoded classes, using {@link encodeClass()}. + * + * @param array $classNames + * @param string $package + * @return string + */ + public static function encodeClasses(array $classNames, $package = '') + { + $result = ''; + foreach ($classNames as $className) { + $result .= self::encodeClass($className, $package); + } + + return $result; + } + +} + +/** + * Decode JSON encoded string to PHP variable constructs + * + * @category Zend + * @package Zend_Json + * @copyright Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Json_Decoder +{ + /** + * Parse tokens used to decode the JSON object. These are not + * for public consumption, they are just used internally to the + * class. + */ + const EOF = 0; + const DATUM = 1; + const LBRACE = 2; + const LBRACKET = 3; + const RBRACE = 4; + const RBRACKET = 5; + const COMMA = 6; + const COLON = 7; + + /** + * Use to maintain a "pointer" to the source being decoded + * + * @var string + */ + protected $_source; + + /** + * Caches the source length + * + * @var int + */ + protected $_sourceLength; + + /** + * The offset within the souce being decoded + * + * @var int + * + */ + protected $_offset; + + /** + * The current token being considered in the parser cycle + * + * @var int + */ + protected $_token; + + /** + * Flag indicating how objects should be decoded + * + * @var int + * @access protected + */ + protected $_decodeType; + + /** + * Constructor + * + * @param string $source String source to decode + * @param int $decodeType How objects should be decoded -- see + * {@link Zend_Json::TYPE_ARRAY} and {@link Zend_Json::TYPE_OBJECT} for + * valid values + * @return void + */ + protected function __construct($source, $decodeType) + { + + // eliminate comments + $source = preg_replace(array( + + // eliminate single line comments in '// ...' form + '#^\s*//(.+)$#m', + + // eliminate multi-line comments in '/* ... */' form, at start of string + '#^\s*/\*(.+)\*/#Us', + + // eliminate multi-line comments in '/* ... */' form, at end of string + '#/\*(.+)\*/\s*$#Us' + + ), '', $source); + + // Set defaults + $this->_source = $source; + $this->_sourceLength = strlen($source); + $this->_token = self::EOF; + $this->_offset = 0; + + // Normalize and set $decodeType + if (!in_array($decodeType, array(Zend_Json::TYPE_ARRAY, Zend_Json::TYPE_OBJECT))) + { + $decodeType = Zend_Json::TYPE_ARRAY; + } + $this->_decodeType = $decodeType; + + // Set pointer at first token + $this->_getNextToken(); + } + + /** + * Decode a JSON source string + * + * Decodes a JSON encoded string. The value returned will be one of the + * following: + * - integer + * - float + * - boolean + * - null + * - StdClass + * - array + * - array of one or more of the above types + * + * By default, decoded objects will be returned as associative arrays; to + * return a StdClass object instead, pass {@link Zend_Json::TYPE_OBJECT} to + * the $objectDecodeType parameter. + * + * Throws a Zend_Json_Exception if the source string is null. + * + * @static + * @access public + * @param string $source String to be decoded + * @param int $objectDecodeType How objects should be decoded; should be + * either or {@link Zend_Json::TYPE_ARRAY} or + * {@link Zend_Json::TYPE_OBJECT}; defaults to TYPE_ARRAY + * @return mixed + * @throws Zend_Json_Exception + */ + public static function decode($source = null, $objectDecodeType = Zend_Json::TYPE_ARRAY) + { + if (null === $source) { + throw new Zend_Json_Exception('Must specify JSON encoded source for decoding'); + } elseif (!is_string($source)) { + throw new Zend_Json_Exception('Can only decode JSON encoded strings'); + } + + $decoder = new self($source, $objectDecodeType); + + return $decoder->_decodeValue(); + } + + + /** + * Recursive driving rountine for supported toplevel tops + * + * @return mixed + */ + protected function _decodeValue() + { + switch ($this->_token) { + case self::DATUM: + $result = $this->_tokenValue; + $this->_getNextToken(); + return($result); + break; + case self::LBRACE: + return($this->_decodeObject()); + break; + case self::LBRACKET: + return($this->_decodeArray()); + break; + default: + return null; + break; + } + } + + /** + * Decodes an object of the form: + * { "attribute: value, "attribute2" : value,...} + * + * If ZJsonEnoder or ZJAjax was used to encode the original object + * then a special attribute called __className which specifies a class + * name that should wrap the data contained within the encoded source. + * + * Decodes to either an array or StdClass object, based on the value of + * {@link $_decodeType}. If invalid $_decodeType present, returns as an + * array. + * + * @return array|StdClass + */ + protected function _decodeObject() + { + $members = array(); + $tok = $this->_getNextToken(); + + while ($tok && $tok != self::RBRACE) { + if ($tok != self::DATUM || ! is_string($this->_tokenValue)) { + throw new Zend_Json_Exception('Missing key in object encoding: ' . $this->_source); + } + + $key = $this->_tokenValue; + $tok = $this->_getNextToken(); + + if ($tok != self::COLON) { + throw new Zend_Json_Exception('Missing ":" in object encoding: ' . $this->_source); + } + + $tok = $this->_getNextToken(); + $members[$key] = $this->_decodeValue(); + $tok = $this->_token; + + if ($tok == self::RBRACE) { + break; + } + + if ($tok != self::COMMA) { + throw new Zend_Json_Exception('Missing "," in object encoding: ' . $this->_source); + } + + $tok = $this->_getNextToken(); + } + + switch ($this->_decodeType) { + case Zend_Json::TYPE_OBJECT: + // Create new StdClass and populate with $members + $result = new StdClass(); + foreach ($members as $key => $value) { + $result->$key = $value; + } + break; + case Zend_Json::TYPE_ARRAY: + default: + $result = $members; + break; + } + + $this->_getNextToken(); + return $result; + } + + /** + * Decodes a JSON array format: + * [element, element2,...,elementN] + * + * @return array + */ + protected function _decodeArray() + { + $result = array(); + $starttok = $tok = $this->_getNextToken(); // Move past the '[' + $index = 0; + + while ($tok && $tok != self::RBRACKET) { + $result[$index++] = $this->_decodeValue(); + + $tok = $this->_token; + + if ($tok == self::RBRACKET || !$tok) { + break; + } + + if ($tok != self::COMMA) { + throw new Zend_Json_Exception('Missing "," in array encoding: ' . $this->_source); + } + + $tok = $this->_getNextToken(); + } + + $this->_getNextToken(); + return($result); + } + + + /** + * Removes whitepsace characters from the source input + */ + protected function _eatWhitespace() + { + if (preg_match( + '/([\t\b\f\n\r ])*/s', + $this->_source, + $matches, + PREG_OFFSET_CAPTURE, + $this->_offset) + && $matches[0][1] == $this->_offset) + { + $this->_offset += strlen($matches[0][0]); + } + } + + + /** + * Retrieves the next token from the source stream + * + * @return int Token constant value specified in class definition + */ + protected function _getNextToken() + { + $this->_token = self::EOF; + $this->_tokenValue = null; + $this->_eatWhitespace(); + + if ($this->_offset >= $this->_sourceLength) { + return(self::EOF); + } + + $str = $this->_source; + $str_length = $this->_sourceLength; + $i = $this->_offset; + $start = $i; + + switch ($str{$i}) { + case '{': + $this->_token = self::LBRACE; + break; + case '}': + $this->_token = self::RBRACE; + break; + case '[': + $this->_token = self::LBRACKET; + break; + case ']': + $this->_token = self::RBRACKET; + break; + case ',': + $this->_token = self::COMMA; + break; + case ':': + $this->_token = self::COLON; + break; + case '"': + $result = ''; + do { + $i++; + if ($i >= $str_length) { + break; + } + + $chr = $str{$i}; + if ($chr == '\\') { + $i++; + if ($i >= $str_length) { + break; + } + $chr = $str{$i}; + switch ($chr) { + case '"' : + $result .= '"'; + break; + case '\\': + $result .= '\\'; + break; + case '/' : + $result .= '/'; + break; + case 'b' : + $result .= chr(8); + break; + case 'f' : + $result .= chr(12); + break; + case 'n' : + $result .= chr(10); + break; + case 'r' : + $result .= chr(13); + break; + case 't' : + $result .= chr(9); + break; + case '\'' : + $result .= '\''; + break; + default: + throw new Zend_Json_Exception("Illegal escape " + . "sequence '" . $chr . "'"); + } + } elseif ($chr == '"') { + break; + } else { + $result .= $chr; + } + } while ($i < $str_length); + + $this->_token = self::DATUM; + //$this->_tokenValue = substr($str, $start + 1, $i - $start - 1); + $this->_tokenValue = $result; + break; + case "'": + $result = ''; + do { + $i++; + if ($i >= $str_length) { + break; + } + + $chr = $str{$i}; + if ($chr == '\\') { + $i++; + if ($i >= $str_length) { + break; + } + $chr = $str{$i}; + switch ($chr) { + case "'" : + $result .= "'"; + break; + case '\\': + $result .= '\\'; + break; + case '/' : + $result .= '/'; + break; + case 'b' : + $result .= chr(8); + break; + case 'f' : + $result .= chr(12); + break; + case 'n' : + $result .= chr(10); + break; + case 'r' : + $result .= chr(13); + break; + case 't' : + $result .= chr(9); + break; + case '"' : + $result .= '"'; + break; + default: + throw new Zend_Json_Exception("Illegal escape " + . "sequence '" . $chr . "'"); + } + } elseif ($chr == "'") { + break; + } else { + $result .= $chr; + } + } while ($i < $str_length); + + $this->_token = self::DATUM; + //$this->_tokenValue = substr($str, $start + 1, $i - $start - 1); + $this->_tokenValue = $result; + break; + case 't': + if (($i+ 3) < $str_length && substr($str, $start, 4) == "true") { + $this->_token = self::DATUM; + } + $this->_tokenValue = true; + $i += 3; + break; + case 'f': + if (($i+ 4) < $str_length && substr($str, $start, 5) == "false") { + $this->_token = self::DATUM; + } + $this->_tokenValue = false; + $i += 4; + break; + case 'n': + if (($i+ 3) < $str_length && substr($str, $start, 4) == "null") { + $this->_token = self::DATUM; + } + $this->_tokenValue = NULL; + $i += 3; + break; + case ' ': + break; + } + + if ($this->_token != self::EOF) { + $this->_offset = $i + 1; // Consume the last token character + return($this->_token); + } + + $chr = $str{$i}; + if ($chr == '-' || $chr == '.' || ($chr >= '0' && $chr <= '9')) { + if (preg_match('/-?([0-9])*(\.[0-9]*)?((e|E)((-|\+)?)[0-9]+)?/s', + $str, $matches, PREG_OFFSET_CAPTURE, $start) && $matches[0][1] == $start) { + + $datum = $matches[0][0]; + + if (is_numeric($datum)) { + if (preg_match('/^0\d+$/', $datum)) { + throw new Zend_Json_Exception("Octal notation not supported by JSON (value: $datum)"); + } else { + $val = intval($datum); + $fVal = floatval($datum); + $this->_tokenValue = ($val == $fVal ? $val : $fVal); + } + } else { + throw new Zend_Json_Exception("Illegal number format: $datum"); + } + + $this->_token = self::DATUM; + $this->_offset = $start + strlen($datum); + } + } else { + throw new Zend_Json_Exception("Illegal Token at pos $i: $chr\nContext:\n--------------------------------------------------" . substr($str, $i) . "\n--------------------------------------------------"); + } + + return($this->_token); + } +} + +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Json + * @copyright Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + + +/** + * @category Zend + * @package Zend_Json + * @copyright Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Json_Exception extends Zend_Exception +{} + +/** + * @category Zend + * @package Zend + * @copyright Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Exception extends Exception +{} + +/** + * Class for encoding to and decoding from JSON. + * + * @category Zend + * @package Zend_Json + * @copyright Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Json +{ + /** + * How objects should be encoded -- arrays or as StdClass. TYPE_ARRAY is 1 + * so that it is a boolean true value, allowing it to be used with + * ext/json's functions. + */ + const TYPE_ARRAY = 1; + const TYPE_OBJECT = 0; + + /** + * @var bool + */ + public static $useBuiltinEncoderDecoder = true; + + /** + * Decodes the given $encodedValue string which is + * encoded in the JSON format + * + * Uses ext/json's json_decode if available. + * + * @param string $encodedValue Encoded in JSON format + * @param int $objectDecodeType Optional; flag indicating how to decode + * objects. See {@link ZJsonDecoder::decode()} for details. + * @return mixed + */ + public static function decode($encodedValue, $objectDecodeType = Zend_Json::TYPE_ARRAY) + { + if (function_exists('json_decode') && self::$useBuiltinEncoderDecoder !== true) { + return json_decode($encodedValue, $objectDecodeType); + } + + return Zend_Json_Decoder::decode($encodedValue, $objectDecodeType); + } + + + /** + * Encode the mixed $valueToEncode into the JSON format + * + * Encodes using ext/json's json_encode() if available. + * + * NOTE: Object should not contain cycles; the JSON format + * does not allow object reference. + * + * NOTE: Only public variables will be encoded + * + * @param mixed $valueToEncode + * @param boolean $cycleCheck Optional; whether or not to check for object recursion; off by default + * @return string JSON encoded object + */ + public static function encode($valueToEncode, $cycleCheck = false) + { + if (function_exists('json_encode') && self::$useBuiltinEncoderDecoder !== true) { + return json_encode($valueToEncode); + } + + return Zend_Json_Encoder::encode($valueToEncode, $cycleCheck); + } +} + +?> diff -r 32429702305e -r c72b545f1304 includes/lang.php --- a/includes/lang.php Fri Dec 21 19:08:27 2007 -0500 +++ b/includes/lang.php Wed Dec 26 00:37:26 2007 -0500 @@ -216,8 +216,7 @@ } else { - $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); - $langdata = $json->decode($contents); + $langdata = enano_json_decode($contents); if ( !is_array($langdata) ) $db->_die('lang.php - invalid language file'); @@ -299,11 +298,34 @@ $contents = preg_replace('/^([^{]+)\{/', '{', $contents); $contents = preg_replace('/\}([^}]+)$/', '}', $contents); - $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); - $langdata = $json->decode($contents); + // Correct syntax to be nice to the json parser + + // eliminate comments + $contents = preg_replace(array( + // eliminate single line comments in '// ...' form + '#^\s*//(.+)$#m', + // eliminate multi-line comments in '/* ... */' form, at start of string + '#^\s*/\*(.+)\*/#Us', + // eliminate multi-line comments in '/* ... */' form, at end of string + '#/\*(.+)\*/\s*$#Us' + ), '', $contents); + + $contents = preg_replace('/([,\{\[])([\s]*?)([a-z0-9_]+)([\s]*?):/', '\\1\\2"\\3" :', $contents); + + try + { + $langdata = enano_json_decode($contents); + } + catch(Zend_Json_Exception $e) + { + $db->_die('lang.php - Exception caught by JSON parser'); + exit; + } if ( !is_array($langdata) ) - $db->_die('lang.php - invalid language file'); + { + $db->_die('lang.php - invalid or non-well-formed language file'); + } if ( !isset($langdata['categories']) || !isset($langdata['strings']) ) $db->_die('lang.php - language file does not contain the proper items'); diff -r 32429702305e -r c72b545f1304 includes/pageutils.php --- a/includes/pageutils.php Fri Dec 21 19:08:27 2007 -0500 +++ b/includes/pageutils.php Wed Dec 26 00:37:26 2007 -0500 @@ -1608,10 +1608,9 @@ function getstyles() { - $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); if ( !preg_match('/^([a-z0-9_-]+)$/', $_GET['id']) ) - return $json->encode(false); + return enano_json_encode(false); $dir = './themes/' . $_GET['id'] . '/css/'; $list = Array(); @@ -1631,10 +1630,10 @@ } else { - return($json->encode(Array('mode' => 'error', 'error' => $dir.' is not a dir'))); + return(enano_json_encode(Array('mode' => 'error', 'error' => $dir.' is not a dir'))); } - return $json->encode($list); + return enano_json_encode($list); } /** @@ -2188,10 +2187,9 @@ function acl_json($parms = '{ }') { global $db, $session, $paths, $template, $plugins; // Common objects - $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); - $parms = $json->decode($parms); + $parms = enano_json_decode($parms); $ret = PageUtils::acl_editor($parms); - $ret = $json->encode($ret); + $ret = enano_json_encode($ret); return $ret; } diff -r 32429702305e -r c72b545f1304 includes/paths.php --- a/includes/paths.php Fri Dec 21 19:08:27 2007 -0500 +++ b/includes/paths.php Wed Dec 26 00:37:26 2007 -0500 @@ -418,8 +418,16 @@ function add_page($flags) { + global $lang; $flags['urlname_nons'] = $flags['urlname']; $flags['urlname'] = $this->nslist[$flags['namespace']] . $flags['urlname']; // Applies the User:/File:/etc prefixes to the URL names + + if ( is_object($lang) ) + { + if ( preg_match('/^[a-z0-9]+_[a-z0-9_]+$/', $flags['name']) ) + $flags['name'] = $lang->get($flags['name']); + } + $pages_len = sizeof($this->pages)/2; $this->pages[$pages_len] = $flags; $this->pages[$flags['urlname']] =& $this->pages[$pages_len]; diff -r 32429702305e -r c72b545f1304 includes/search.php --- a/includes/search.php Fri Dec 21 19:08:27 2007 -0500 +++ b/includes/search.php Wed Dec 26 00:37:26 2007 -0500 @@ -112,10 +112,11 @@ * @param string Search query * @param string Will be filled with any warnings encountered whilst parsing the query * @param bool Case sensitivity - defaults to false + * @param array|reference Will be filled with the parsed list of words. * @return array */ -function perform_search($query, &$warnings, $case_sensitive = false) +function perform_search($query, &$warnings, $case_sensitive = false, &$word_list) { global $db, $session, $paths, $template, $plugins; // Common objects $warnings = array(); @@ -522,7 +523,7 @@ if ( isset($scores[$idstring]) ) { $page_data[$idstring] = array( - 'page_name' => $page['name'], + 'page_name' => highlight_search_result($page['name'], $word_list, $case_sensitive), 'page_text' => '', 'page_id' => $page['urlname_nons'], 'namespace' => $page['namespace'], @@ -592,6 +593,11 @@ // if ( $score > $divisor ) // $score = $divisor; $datum['score'] = round($score / $divisor, 2) * 100; + + // Highlight the URL + $datum['url_highlight'] = makeUrlComplete($datum['namespace'], $datum['page_id']); + $datum['url_highlight'] = preg_replace('/\?.+$/', '', $datum['url_highlight']); + $datum['url_highlight'] = highlight_search_result($datum['url_highlight'], $word_list, $case_sensitive); // Store it in our until-now-unused results array $results[] = $datum; @@ -613,6 +619,8 @@ function parse_search_query($query, &$warnings) { + global $lang; + $stopwords = get_stopwords(); $ret = array( 'any' => array(), @@ -663,7 +671,7 @@ if ( $ticker == 20 ) { - $warnings[] = 'Some of your search terms were excluded because searches are limited to 20 terms to prevent excessive server load.'; + $warnings[] = $lang->get('search_err_query_too_many_terms'); break; } @@ -672,13 +680,13 @@ $word = substr ( $atom, 2, ( strlen( $atom ) - 3 ) ); if ( strlen ( $word ) < 2 || in_array($word, $stopwords) ) { - $warnings[] = 'One or more of your search terms was excluded because either it was less than 2 characters in length or is a common word (a stopword) that is typically found on a large number of pages. Examples of stopwords include "the", "this", "which", "with", etc.'; + $warnings[] = $lang->get('search_err_query_has_stopwords'); $ticker--; continue; } if(in_array($word, $ret['req'])) { - $warnings[] = 'One or more of your search terms was excluded because duplicate terms were encountered.'; + $warnings[] = $lang->get('search_err_query_dup_terms'); $ticker--; continue; } @@ -689,13 +697,13 @@ $word = substr ( $atom, 2, ( strlen( $atom ) - 3 ) ); if ( strlen ( $word ) < 4 ) { - $warnings[] = 'One or more of your search terms was excluded because terms must be at least 4 characters in length.'; + $warnings[] = $lang->get('search_err_query_term_too_short'); $ticker--; continue; } if(in_array($word, $ret['not'])) { - $warnings[] = 'One or more of your search terms was excluded because duplicate terms were encountered.'; + $warnings[] = $lang->get('search_err_query_dup_terms'); $ticker--; continue; } @@ -706,13 +714,13 @@ $word = substr ( $atom, 1 ); if ( strlen ( $word ) < 2 || in_array($word, $stopwords) ) { - $warnings[] = 'One or more of your search terms was excluded because either it was less than 2 characters in length or is a common word (a stopword) that is typically found on a large number of pages. Examples of stopwords include "the", "this", "which", "with", etc.'; + $warnings[] = $lang->get('search_err_query_has_stopwords'); $ticker--; continue; } if(in_array($word, $ret['req'])) { - $warnings[] = 'One or more of your search terms was excluded because duplicate terms were encountered.'; + $warnings[] = $lang->get('search_err_query_dup_terms'); $ticker--; continue; } @@ -723,13 +731,13 @@ $word = substr ( $atom, 1 ); if ( strlen ( $word ) < 2 || in_array($word, $stopwords) ) { - $warnings[] = 'One or more of your search terms was excluded because either it was less than 2 characters in length or is a common word (a stopword) that is typically found on a large number of pages. Examples of stopwords include "the", "this", "which", "with", etc.'; + $warnings[] = $lang->get('search_err_query_has_stopwords'); $ticker--; continue; } if(in_array($word, $ret['not'])) { - $warnings[] = 'One or more of your search terms was excluded because duplicate terms were encountered.'; + $warnings[] = $lang->get('search_err_query_dup_terms'); $ticker--; continue; } @@ -740,13 +748,13 @@ $word = substr ( $atom, 1, ( strlen ( $atom ) - 2 ) ); if ( strlen ( $word ) < 2 || in_array($word, $stopwords) ) { - $warnings[] = 'One or more of your search terms was excluded because either it was less than 2 characters in length or is a common word (a stopword) that is typically found on a large number of pages. Examples of stopwords include "the", "this", "which", "with", etc.'; + $warnings[] = $lang->get('search_err_query_has_stopwords'); $ticker--; continue; } if(in_array($word, $ret['any'])) { - $warnings[] = 'One or more of your search terms was excluded because duplicate terms were encountered.'; + $warnings[] = $lang->get('search_err_query_dup_terms'); $ticker--; continue; } @@ -757,13 +765,13 @@ $word = $atom; if ( strlen ( $word ) < 2 || in_array($word, $stopwords) ) { - $warnings[] = 'One or more of your search terms was excluded because either it was less than 2 characters in length or is a common word (a stopword) that is typically found on a large number of pages. Examples of stopwords include "the", "this", "which", "with", etc.'; + $warnings[] = $lang->get('search_err_query_has_stopwords'); $ticker--; continue; } if(in_array($word, $ret['any'])) { - $warnings[] = 'One or more of your search terms was excluded because duplicate terms were encountered.'; + $warnings[] = $lang->get('search_err_query_dup_terms'); $ticker--; continue; } diff -r 32429702305e -r c72b545f1304 index.php --- a/index.php Fri Dec 21 19:08:27 2007 -0500 +++ b/index.php Wed Dec 26 00:37:26 2007 -0500 @@ -20,10 +20,10 @@ // Set up gzip encoding before any output is sent - $aggressive_optimize_html = false; + $aggressive_optimize_html = true; global $do_gzip; - $do_gzip = false; + $do_gzip = true; if(isset($_SERVER['PATH_INFO'])) $v = $_SERVER['PATH_INFO']; elseif(isset($_GET['title'])) $v = $_GET['title']; diff -r 32429702305e -r c72b545f1304 install.php --- a/install.php Fri Dec 21 19:08:27 2007 -0500 +++ b/install.php Wed Dec 26 00:37:26 2007 -0500 @@ -1071,8 +1071,7 @@ break; case 'langjs': header('Content-type: text/javascript'); - $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); - $lang_js = $json->encode($lang->strings); + $lang_js = enano_json_encode($lang->strings); // use EEOF here because jEdit misinterprets "typ'eof'" echo <<re-authenticate to continue.', + }, + acl: { + err_access_denied: 'You are not authorized to view or edit access control lists.', + err_missing_template: 'It seems that (a) the file acledit.tpl is missing from this theme, and (b) the JSON response is working.', + err_user_not_found: 'The username you entered was not found.', + err_bad_group_id: 'The group ID you submitted is not valid.', + err_demo: 'Editing access control lists is disabled in the administration demo.', + err_zero_list: 'Supplied rule list has a length of zero', + err_pleaseselect_targettype: 'Please select a target type.', + err_pleaseselect_username: 'Please enter a username.', + + radio_usergroup: 'A usergroup', + radio_user: 'A specific user', + radio_scope_thispage: 'Only this page', + radio_scope_wholesite: 'The entire website', + radio_scope_pagegroup: 'A group of pages', + + lbl_scope: 'What should this access rule control?', + lbl_welcome_title: 'Manage page access', + lbl_welcome_body: 'Please select who should be affected by this access rule.', + lbl_editwin_title_create: 'Create access rule', + lbl_editwin_title_edit: 'Editing permissions', + lbl_editwin_body: 'This panel allows you to edit what the %target_type% "%target%" can do on %scope_type%. Unless you set a permission to "Deny", these permissions may be overridden by other rules.', + lbl_deleterule: 'Delete this rule', + lbl_save_success_title: 'Permissions updated', + lbl_save_success_body: 'The permissions for %target_name% on this page have been updated successfully. If you changed permissions that affect your user account, you may not see changes until you reload the page.', + lbl_delete_success_title: 'Rule deleted', + lbl_delete_success_body: 'The access rules for %target_name% on this page have been deleted.', + lbl_field_deny: 'Deny', + lbl_field_disallow: 'Disallow', + lbl_field_wikimode: 'Wiki mode', + lbl_field_allow: 'Allow', + lbl_help: '

Permission types:

', + + scope_type_wholesite: 'this entire site', + scope_type_thispage: 'this page', + scope_type_pagegroup: 'this group of pages', + + target_type_user: 'user', + target_type_group: 'group', + + msg_guest_howto: 'To edit permissions for guests, select "a specific user", and enter Anonymous as the username.', + msg_deleterule_confirm: 'Do you really want to delete this rule?', + msg_closeacl_confirm: 'Do you really want to close the ACL manager?', + + btn_success_dismiss: 'dismiss', + btn_success_close: 'close manager', + btn_deleterule: 'Delete rule', + btn_createrule: 'Create rule', + btn_returnto_editor: 'Return to ACL editor', + btn_returnto_userscope: 'Return to user/scope selection', + }, + adminusers: { + avatar_heading: 'Avatar settings', + avatar_image_none: 'This user does not currently have an avatar.', + avatar_lbl_change: 'Change avatar:', + avatar_lbl_keep: 'Keep current setting', + avatar_lbl_remove: 'Delete this user\'s avatar', + avatar_lbl_set_http: 'Replace avatar using a new image from a URL', + avatar_lbl_set_file: 'Replace avatar using a new image from my computer', + } + } +}; + +// All done! :-) + diff -r 32429702305e -r c72b545f1304 language/english/core.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/language/english/core.json Wed Dec 26 00:37:26 2007 -0500 @@ -0,0 +1,411 @@ +/* + * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between + * Version 1.1.1 + * Copyright (C) 2006-2007 Dan Fuhry + * + * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. + */ + +// This is the main language file for Enano. Feel free to use it as a base for your own translations. +// All text in this file before the first left curly brace and all text after the last curly brace will +// be trimmed. So you can use a limited amount of Javascript in this so that the language can be imported +// via Javascript as well. + +var enano_lang = { + categories: [ + 'page', 'comment', 'onpage', 'etc', 'editor', 'history', 'catedit', 'tags', 'delvote', 'ajax', 'sidebar', 'perm' + ], + strings: { + meta: { + page: 'Page creation and control', + comment: 'Comment display', + onpage: 'On-page buttons and controls', + etc: 'Miscellaneous strings', + editor: 'Page editor interface', + history: 'Page history and log viewer', + catedit: 'Categorization box and editor', + tags: 'Page tagging interface', + delvote: 'Page deletion vote interface', + ajax: 'On-page AJAX applets', + sidebar: 'Default sidebar blocks and buttons', + perm: 'Page actions (for ACLs)', + plural: 's', + enano_about_poweredby: '

This website is powered by Enano, the lightweight and open source CMS that everyone can use. Enano is copyright © 2006-2007 Dan Fuhry. For legal information, along with a list of libraries that Enano uses, please see Legal Information.

The developers and maintainers of Enano strongly believe that software should not only be free to use, but free to be modified, distributed, and used to create derivative works. For more information about Free Software, check out the Wikipedia page or the Free Software Foundation\'s homepage.

', + enano_about_gpl: '

This program is Free Software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.

You should have received a copy of the GNU General Public License along with this program; if not, write to:

Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor
Boston, MA 02110-1301, USA

Alternatively, you can read it online.

', + enano_about_lbl_enanoversion: 'Enano version:', + enano_about_lbl_webserver: 'Web server:', + enano_about_lbl_serverplatform: 'Server platform:', + enano_about_lbl_phpversion: 'PHP version:', + enano_about_lbl_mysqlversion: 'MySQL version:', + }, + page: { + protect_lbl_success_title: 'Page protected', + protect_lbl_success_body: 'The protection setting has been applied. Return to the page.', + protect_err_need_reason: 'Error: you must enter a reason for protecting this page.', + protect_lbl_reason: 'Reason for protecting the page:', + protect_lbl_level: 'Protecion level to be applied:', + protect_lbl_level_none: 'No protection', + protect_lbl_level_semi: 'Semi-protection', + protect_lbl_level_full: 'Full protection', + protect_btn_submit: 'Protect page', + + rename_err_need_name: 'Error: you must enter a new name for this page.', + rename_lbl: 'Please enter a new name for this page:', + rename_btn_submit: 'Rename page', + rename_success_title: 'Page renamed', + + flushlogs_warning_stern: '

You are about to destroy all logged edits and actions on this page.

Unlike deleting or editing this page, this action is not reversible! You should only do this if you are desparate for database space.

Do you really want to continue?

', + flushlogs_btn_submit: 'Flush logs', + + delvote_warning_stern: '

Your vote counts.

If you think that this page is not relavent to the content on this site, or if it looks like this page was only created in an attempt to spam the site, you can request that this page be deleted by an administrator.

After you vote, you should leave a comment explaining the reason for your vote, especially if you are the first person to vote against this page.

', + + delvote_count_zero: 'So far, no one has voted for the deletion of this page.', + delvote_count_one: 'So far, one person has voted to delete this page.', + delvote_count_plural: 'So far, %delvotes% people have voted to delete this page.', + delvote_btn_submit: 'Vote to delete this page', + delvote_reset_btn_submit: 'Reset votes', + + delete_warning_stern: '

You are about to destroy this page.

While the deletion of the page itself is completely reversible, it is impossible to recover any comments or category information on this page. If this is a file page, the file along with all older revisions of it will be permanently deleted. Also, any custom information that this page is tagged with, such as a custom name, protection status, or additional settings such as whether to allow comments, will be permanently lost.

Are you absolutely sure that you want to continue?
You will not be asked again.

', + delete_btn_submit: 'Delete this page', + delete_lbl_reason: 'Reason for deleting:', + + wikimode_success_redirect: 'Wiki mode for this page has been set. Redirecting you to the page...', + wikimode_level_on: 'Wiki features will be enabled.', + wikimode_level_off: 'Wiki features will be disabled.', + wikimode_level_global: 'Wiki features will be synchronized to the global setting.', + wikimode_heading: 'You are changing wiki mode for this page.', + wikimode_warning: 'If you want to continue, please click the button below.', + wikimode_blurb_disable: 'Because this will disable the wiki behavior on this page, several features, most notably the ability for users to vote to have this page deleted, will be disabled as they are not relevant to non-wiki pages. In addition, users will not be able to edit this page unless an ACL rule specifically permits them.', + wikimode_blurb_enable: 'Because this will enable the wiki behavior on this page, users will gain the ability to freely edit this page unless an ACL rule specifically denies them. If your site is public and gets good traffic, you should be aware of the possiblity of vandalism, and you need to be ready to revert malicious edits to this page.', + wikimode_btn_submit: 'Set wiki mode', + + detag_err_page_exists: 'The detag action is only valid for pages that have been deleted in the past.', + detag_success_title: 'Page detagged', + detag_success_body: 'All stale tags have been removed from this page.', + + err_custompage_function_missing_title: 'Page backend not found', + err_custompage_function_missing_body: 'The administration page you are looking for was properly registered using the page API, but the backend function (%function_name%) was not found. If this is a plugin page, then this is almost certainly a bug with the plugin.', + err_redirects_exceeded: 'The maximum number of internal redirects has been exceeded.', + err_redirect_to_nonexistent: 'This page redirects to another page that doesn\'t exist.', + err_redirect_infinite_loop: 'This page infinitely redirects with another page (or another series of pages), and the infinite redirect was trapped.', + err_redirect_to_special: 'This page redirects to a Special or Administration page, which is not allowed.', + err_access_denied_title: 'You don\'t have permission to view this page.', + err_access_denied_body: '

Your user account doesn\'t have the necessary permission to view this page. There are a number of possible reasons for this:

+ +

If you would like to inquire further about this message, you may contact the %site_administration%.

', + err_access_denied_siteadmin: 'site administrator', + msg_this_is_a_redirector: 'This page is a redirector.
+ This means that this page will not show its own content by default. Instead it will display the contents of the page it redirects to.

+ To create a redirect page, make the first characters in the page content #redirect [[Page_ID]]. For more information, see the + Enano Wiki formatting guide.

+ This page redirects to %redirect_target%.' + }, + comment: { + lbl_subject: 'Subject', + lbl_mod_options: 'Moderator options:', + heading: 'Article comments', + btn_send_privmsg: 'Send private message', + btn_add_buddy: 'Add to buddy list', + btn_edit: 'edit', + btn_delete: 'delete', + btn_mod_approve: 'Approve', + btn_mod_unapprove: 'Unapprove', + btn_mod_delete: 'Delete', + btn_save: 'save', + + msg_comment_posted: 'Your comment has been posted. If it does not appear right away, it is probably awaiting approval.', + + msg_count_zero: 'There are no comments on this %page_type%.', + msg_count_one: 'There is 1 comment on this %page_type%.', + msg_count_plural: 'There are %num_comments% comments on this %page_type%.', + + msg_count_unapp_mod: '%num_unapp% of those are unapproved.', + msg_count_unapp_one: 'However, there is 1 additional comment awaiting approval.', + msg_count_unapp_plural: 'However, there are %num_unapp% additional comments awaiting approval.', + + msg_note_unapp: '(Unapproved)', + + msg_delete_confirm: 'Do you really want to delete this comment?', + + postform_title: 'Got something to say?', + postform_blurb: 'If you have comments or suggestions on this article, you can shout it out here.', + postform_blurb_unapp: 'Before your post will be visible to the public, a moderator will have to approve it.', + postform_blurb_captcha: 'Because you are not logged in, you will need to enter a visual confirmation before your comment will be posted.', + postform_blurb_link: 'Leave a comment...', + postform_field_name: 'Your name/screen name:', + postform_field_subject: 'Comment subject:', + postform_field_comment: 'Comment:', + postform_field_captcha_title: 'Visual confirmation:', + postform_field_captcha_blurb: 'Please enter the confirmation code seen in the image on the right into the box. If you cannot read the code, please click on the image to generate a new one. This helps to prevent automated bot posting.', + postform_field_captcha_label: 'Confirmation code:', + postform_field_captcha_cantread_js: 'If you can\'t read the code, click on the image to generate a new one.', + postform_field_captcha_cantread_nojs: 'If you can\'t read the code, please refresh this page to generate a new one.', + postform_btn_submit: 'Submit comment', + + on_friend_list: 'On your friend list', + on_foe_list: 'On your foe list', + }, + onpage: { + lbl_pagetools: 'Page tools', + lbl_page_article: 'article', + lbl_page_admin: 'administration page', + lbl_page_system: 'system message', + lbl_page_file: 'uploaded file', + lbl_page_help: 'documentation page', + lbl_page_user: 'user page', + lbl_page_special: 'special page', + lbl_page_template: 'template', + lbl_page_project: 'project page', + lbl_page_category: 'category', + + btn_discussion: 'discussion (%num_comments%)', + btn_discussion_unapp: 'discussion (%num_comments% total, %num_unapp% unapp.)', + btn_edit: 'edit this page', + btn_viewsource: 'view source', + btn_history: 'history', + btn_moreoptions: 'more options', + + btn_rename: 'rename', + btn_printable: 'view printable version', + btn_votedelete: 'vote to delete this page', + btn_votedelete_reset: 'reset deletion votes', + lbl_wikimode: 'page wiki mode:', + btn_wikimode_on: 'on', + btn_wikimode_off: 'off', + btn_wikimode_global: 'global', + lbl_protect: 'protection:', + btn_protect_on: 'on', + btn_protect_off: 'off', + btn_protect_semi: 'semi', + btn_clearlogs: 'clear page logs', + btn_deletepage: 'delete this page', + btn_deletepage_votes: ' (%num_votes% vote%plural%)', + lbl_password: 'page password:', + btn_password_set: 'set', + btn_acl: 'manage page access', + btn_admin: 'administrative options', + + tip_article: 'View the page contents, all of the page contents, and nothing but the page contents (alt-a)', + tip_comments: 'View the comments that other users have posted about this page (alt-c)', + tip_edit: 'Edit the contents of this page (alt-e)', + tip_viewsource: 'View the source code (wiki markup) that this page uses (alt-e)', + tip_history: 'View a log of actions taken on this page (alt-h)', + tip_rename: 'Change the display name of this page (alt-r)', + tip_delvote: 'Vote to have this page deleted (alt-d)', + tip_resetvotes: 'Clear the list of votes for deletion against this page (alt-y)', + tip_printable: 'View a version of this page that is suitable for printing', + tip_protect_on: 'Prevents all non-administrators from editing this page. [alt-i]', + tip_protect_off: 'Allows everyone to edit this page. [alt-o]', + tip_protect_semi: 'Allows only users who have been registered for 4 days to edit this page. [alt-p]', + tip_flushlogs: 'Remove all edit and action logs for this page from the database. IRREVERSIBLE! (alt-l)', + tip_deletepage: 'Delete this page. This is always reversible unless the logs are cleared. (alt-k)', + tip_adminoptions: 'Administrative options for this page', + tip_moreoptions: 'Additional options for working with this page', + tip_password: 'Require a password in order for this page to be viewed', + tip_aclmanager: 'Manage who can do what with this page (alt-m)', + }, + editor: { + msg_revert_confirm: 'Do you really want to revert your changes?', + msg_discard_confirm: 'Do you really want to discard your changes?', + msg_unload: 'If you do, any changes that you have made to this page will be lost.', + btn_graphical: 'graphical editor', + btn_wikitext: 'wikitext editor', + lbl_edit_summary: 'Edit summary:', + lbl_minor_edit: 'This is a minor edit', + btn_save: 'Save changes', + btn_preview: 'Show preview', + btn_revert: 'Revert changes', + btn_cancel: 'Cancel and return to page', + btn_closeviewer: 'Close viewer', + preview_blurb: 'Reminder: This is only a preview - your changes to this page have not yet been saved.', + msg_save_success_title: 'Changes saved', + msg_save_success_body: 'Your changes to this page have been saved. Redirecting...', + }, + history: { + summary_clearlogs: 'Automatic backup created when logs were purged', + page_subtitle: 'History of edits and actions', + heading_edits: 'Edits:', + heading_other: 'Other changes:', + no_entries: 'No history entries in this category.', + btn_compare: 'Compare selected revisions', + col_diff: 'Diff', + col_datetime: 'Date/time', + col_user: 'User', + col_summary: 'Edit summary', + col_minor: 'Minor', + col_actions: 'Actions', + col_action_taken: 'Action taken', + col_extra: 'Extra info', + extra_reason: 'Reason:', + extra_oldtitle: 'Old title:', + tip_rdns: 'Click cell background for reverse DNS info', + action_view: 'View', + action_contrib: 'User contribs', + action_restore: 'Restore', + action_revert: 'Revert action', + log_protect: 'Protected page', + log_unprotect: 'Unprotected page', + log_semiprotect: 'Semi-protected page', + log_rename: 'Renamed page', + log_create: 'Created page', + log_delete: 'Deleted page', + log_uploadnew: 'Uploaded new file version', + lbl_comparingrevisions: 'Comparing revisions:', + }, + catedit: { + title: 'Select which categories this page should be included in.', + no_categories: 'There are no categories on this site yet.', + catbox_lbl_categories: 'Categories:', + catbox_lbl_uncategorized: '(Uncategorized)', + catbox_link_edit: 'edit categorization', + catbox_link_showcategorization: 'show page categorization', + }, + tags: { + catbox_link: 'show page tags', + lbl_page_tags: 'Page tags:', + lbl_no_tags: 'No tags on this page', + btn_add_tag: '(add a tag)', + lbl_add_tag: 'Add a tag:', + btn_add: '+ Add', + }, + delvote: { + lbl_votes_one: 'There is one user that thinks this page should be deleted.', + lbl_votes_plural: 'There are %num_users% users that think this page should be deleted.', + lbl_users_that_voted: 'Users that voted:', + btn_deletepage: 'Delete page', + btn_resetvotes: 'Reset votes', + }, + ajax: { + // Client-side messages + protect_prompt_reason: 'Reason for (un)protecting:', + rename_prompt: 'What title should this page be renamed to?\nNote: This does not and will never change the URL of this page, that must be done from the admin panel.', + delete_prompt_reason: 'Please enter your reason for deleting this page.', + delete_confirm: 'You are about to REVERSIBLY delete this page. Do you REALLY want to do this?\n\n(Comments and categorization data, as well as any attached files, will be permanently lost)', + delvote_confirm: 'Are you sure that you want to vote that this page be deleted?', + delvote_reset_confirm: 'This action will reset the number of votes against this page to zero. Do you really want to do this?', + clearlogs_confirm: 'You are about to DESTROY all log entries for this page. As opposed to (example) deleting this page, this action is completely IRREVERSIBLE and should not be used except in dire circumstances. Do you REALLY want to do this?', + clearlogs_confirm_nag: 'You\'re ABSOLUTELY sure???', + changestyle_select: '[Select]', + changestyle_title: 'Change your theme', + changestyle_pleaseselect_theme: 'Please select a theme from the list.', + changestyle_lbl_theme: 'Theme:', + changestyle_lbl_style: 'Style:', + changestyle_success: 'Your theme preference has been changed.\nWould you like to reload the page now to see the changes?', + killphp_confirm: 'Are you really sure you want to do this? Some pages might not function if this emergency-only feature is activated.', + killphp_success: 'Embedded PHP in pages has been disabled.', + lbl_moreoptions_nojs: 'More options for this page', + + // Server-side responses + rename_too_short: 'The name you entered is too short. Please enter a longer name for this page.', + rename_success: 'The page "%page_name_old%" has been renamed to "%page_name_new%". You are encouraged to leave a comment explaining your action.\n\nYou will see the change take effect the next time you reload this page.', + clearlogs_success: 'The logs for this page have been cleared. A backup of this page has been added to the logs table so that this page can be restored in case of vandalism or spam later.', + delete_need_reason: 'Invalid reason for deletion passed. Please enter a reason for deleting this page.', + delete_success: 'This page has been deleted. Note that there is still a log of edits and actions in the database, and anyone with admin rights can raise this page from the dead unless the log is cleared. If the deleted file is an image, there may still be cached thumbnails of it in the cache/ directory, which is inaccessible to users.', + delvote_success: 'Your vote to have this page deleted has been cast.\nYou are encouraged to leave a comment explaining the reason for your vote.', + delvote_already_voted: 'It appears that you have already voted to have this page deleted.', + delvote_reset_success: 'The number of votes for having this page deleted has been reset to zero.', + password_success: 'The password for this page has been set.', + password_disable_success: 'The password for this page has been disabled.', + + }, + sidebar: { + title_navigation: 'Navigation', + title_tools: 'Tools', + title_search: 'Search', + title_links: 'Links', + + btn_home: 'Home', + btn_createpage: 'Create a page', + btn_uploadfile: 'Upload file', + btn_specialpages: 'Special pages', + btn_administration: 'Administration', + btn_editsidebar: 'Edit the sidebar', + btn_search_go: 'Go', + + btn_userpage: 'User page', + btn_mycontribs: 'My contributions', + btn_preferences: 'Preferences', + btn_privatemessages: 'Private messages', + btn_groupcp: 'Group control panel', + btn_register: 'Create an account', + btn_login: 'Log in', + btn_logout: 'Log out', + btn_changestyle: 'Change theme', + }, + perm: { + read: 'Read page(s)', + post_comments: 'Post comments', + edit_comments: 'Edit own comments', + edit_page: 'Edit page', + view_source: 'View source', + mod_comments: 'Moderate comments', + history_view: 'View history/diffs', + history_rollback: 'Rollback history', + history_rollback_extra: 'Undelete page(s)', + protect: 'Protect page(s)', + rename: 'Rename page(s)', + clear_logs: 'Clear page logs (dangerous)', + vote_delete: 'Vote to delete', + vote_reset: 'Reset delete votes', + delete_page: 'Delete page(s)', + tag_create: 'Tag page(s)', + tag_delete_own: 'Remove own page tags', + tag_delete_other: 'Remove others\' page tags', + set_wiki_mode: 'Set per-page wiki mode', + password_set: 'Set password', + password_reset: 'Disable/reset password', + mod_misc: 'Super moderator (generate SQL backtraces, view IP addresses, and send large numbers of private messages)', + edit_cat: 'Edit categorization', + even_when_protected: 'Allow editing, renaming, and categorization even when protected', + upload_files: 'Upload files', + upload_new_version: 'Upload new versions of files', + create_page: 'Create pages', + php_in_pages: 'Embed PHP code in pages', + edit_acl: 'Edit access control lists', + }, + etc: { + redirect_title: 'Redirecting...', + redirect_body: 'Please wait while you are redirected.', + redirect_timeout: 'If you are not redirected within %timeout% seconds, please click here.', + // Generic "Save Changes" button + save_changes: 'Save changes', + // Generic "Cancel changes" button + cancel_changes: 'Cancel changes', + // Generic wizard buttons + wizard_next: 'Next >', + wizard_back: '< Back', + wizard_previous: '< Previous', + // Generic "Notice:" label + lbl_notice: 'Notice:', + // Generic "Access denied" + access_denied: 'Access to the specified file, resource, or action is denied.', + access_denied_short: 'Access denied', + return_to_page: 'Return to the page', + invalid_request_short: 'Invalid request', + // Message box buttons + ok: 'OK', + cancel: 'Cancel', + yes: 'Yes', + no: 'No', + unit_bytes: 'bytes', + unit_kilobytes: 'kilobytes', + unit_megabytes: 'megabytes', + unit_gigabytes: 'gigabytes', + unit_terabytes: 'terabytes', + unit_kilobytes_short: 'KB', + unit_megabytes_short: 'MB', + unit_gigabytes_short: 'GB', + unit_terabytes_short: 'TB', + } + } +}; + +// All done! :-) + diff -r 32429702305e -r c72b545f1304 language/english/enano.json --- a/language/english/enano.json Fri Dec 21 19:08:27 2007 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,639 +0,0 @@ -/* - * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between - * Version 1.1.1 - * Copyright (C) 2006-2007 Dan Fuhry - * - * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - */ - -// This is the main language file for Enano. Feel free to use it as a base for your own translations. -// All text in this file before the first left curly brace and all text after the last curly brace will -// be trimmed. So you can use a limited amount of Javascript in this so that the language can be imported -// via Javascript as well. - -var enano_lang = { - categories: [ - 'adm', 'meta', 'user', 'page', 'comment', 'onpage', 'etc', 'editor', 'history', 'catedit', 'tags', 'delvote', 'ajax', 'sidebar', 'acl', - 'perm', 'usercp', 'adminusers', - ], - strings: { - meta: { - adm: 'Administration panel nav menu', - meta: 'Language category strings', - user: 'Login, logout, and authentication', - page: 'Page creation and control', - comment: 'Comment display', - onpage: 'On-page buttons and controls', - etc: 'Miscellaneous strings', - editor: 'Page editor interface', - history: 'Page history and log viewer', - catedit: 'Categorization box and editor', - tags: 'Page tagging interface', - delvote: 'Page deletion vote interface', - ajax: 'On-page AJAX applets', - sidebar: 'Default sidebar blocks and buttons', - acl: 'Access control list editor', - perm: 'Page actions (for ACLs)', - usercp: 'User control panel', - adminusers: 'ACP: User management', - plural: 's', - enano_about_poweredby: '

This website is powered by Enano, the lightweight and open source CMS that everyone can use. Enano is copyright © 2006-2007 Dan Fuhry. For legal information, along with a list of libraries that Enano uses, please see Legal Information.

The developers and maintainers of Enano strongly believe that software should not only be free to use, but free to be modified, distributed, and used to create derivative works. For more information about Free Software, check out the Wikipedia page or the Free Software Foundation\'s homepage.

', - enano_about_gpl: '

This program is Free Software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.

You should have received a copy of the GNU General Public License along with this program; if not, write to:

Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor
Boston, MA 02110-1301, USA

Alternatively, you can read it online.

', - enano_about_lbl_enanoversion: 'Enano version:', - enano_about_lbl_webserver: 'Web server:', - enano_about_lbl_serverplatform: 'Server platform:', - enano_about_lbl_phpversion: 'PHP version:', - enano_about_lbl_mysqlversion: 'MySQL version:', - }, - user: { - login_message_short: 'Please enter your username and password to log in.', - login_message_short_elev: 'Please re-enter your login details', - login_body: 'Logging in enables you to use your preferences and access member information. If you don\'t have a username and password here, you can create an account.', - login_body_elev: 'You are requesting that a sensitive operation be performed. To continue, please re-enter your password to confirm your identity.', - login_field_username: 'Username', - login_field_password: 'Password', - login_forgotpass_blurb: 'Forgot your password? No problem.', - login_createaccount_blurb: 'Maybe you need to create an account.', - login_field_captcha: 'Code in image', - login_nocrypt_title: 'Important note regarding cryptography:', - login_nocrypt_body: 'Some countries do not allow the import or use of cryptographic technology. If you live in one of the countries listed below, you should log in without using encryption.', - login_nocrypt_countrylist: 'This restriction applies to the following countries: Belarus, China, India, Israel, Kazakhstan, Mongolia, Pakistan, Russia, Saudi Arabia, Singapore, Tunisia, Venezuela, and Vietnam.', - login_usecrypt_title: 'Encryption is currently turned off.', - login_usecrypt_body: 'If you are not in one of the countries listed below, you should enable encryption to secure the logon process.', - login_usecrypt_countrylist: 'The cryptography restriction applies to the following countries: Belarus, China, India, Israel, Kazakhstan, Mongolia, Pakistan, Russia, Saudi Arabia, Singapore, Tunisia, Venezuela, and Vietnam.', - login_success_title: 'Login successful', - login_success_body: 'You have successfully logged into the %config.site_name% site as "%username%". Redirecting to %redir_target%...', - login_success_body_mainpage: 'the main page', - login_success_short: 'Success.', - - login_ajax_fetching_key: 'Fetching an encryption key...', - login_ajax_prompt_title: 'Please enter your username and password to continue.', - login_ajax_prompt_title_elev: 'You are requesting a sensitive operation.', - login_ajax_prompt_body_elev: 'Please re-enter your login details, to verify your identity.', - login_ajax_link_fullform: 'Trouble logging in? Try the full login form.', - login_ajax_link_forgotpass: 'Did you forget your password?', - login_ajax_loggingin: 'Logging in...', - - err_key_not_found: 'Enano couldn\'t look up the encryption key used to encrypt your password. This most often happens if a cache rotation occurred during your login attempt, or if you refreshed the login page.', - err_key_not_found_cleared: 'It seems that the list of encryption keys used for login information has reached its maximum length, thus preventing new keys from being inserted. The list has been automatically cleared. Please try logging in again; if you are still unable to log in, please contact the site administration.', - err_key_wrong_length: 'The encryption key was the wrong length.', - err_too_big_for_britches: 'You are trying to authenticate at a level that your user account does not permit.', - err_invalid_credentials: 'You have entered an invalid username or password. Please enter your login details again.', - err_invalid_credentials_lockout: ' You have used up %fails% out of %config.lockout_threshold% login attempts. After you have used up all %config.lockout_threshold% login attempts, you will be locked out from logging in for %config.lockout_duration% minutes.', - err_invalid_credentials_lockout_captcha: ' You have used up %lockout_fails% out of %config.lockout_threshold% login attempts. After you have used up all %config.lockout_threshold% login attempts, you will have to enter a visual confirmation code while logging in, effective for %config.lockout_duration% minutes.', - err_backend_fail: 'You entered the right credentials and everything was validated, but for some reason Enano couldn\'t register your session. This is an internal problem with the site and you are encouraged to contact site administration.', - err_locked_out: 'You have used up all %config.lockout_threshold% allowed login attempts. Please wait %time_rem% minute%plural% before attempting to log in again%captcha_blurb%.', - err_locked_out_captcha_blurb: ', or enter the visual confirmation code shown above in the appropriate box', - - logout_success_title: 'Logged out', - logout_success_body: 'You have been successfully logged out, and all cookies have been cleared. You will now be transferred to the main page.', - logout_confirm_title: 'Are you sure you want to log out?', - logout_confirm_body: 'If you log out, you will no longer be able to access your user preferences, your private messages, or certain areas of this site until you log in again.', - logout_confirm_title_elev: 'Are you sure you want to de-authenticate?', - logout_confirm_body_elev: 'If you de-authenticate, you will no longer be able to use the administration panel until you re-authenticate again. You may do so at any time using the Administration button on the sidebar.', - logout_err_title: 'An error occurred during the logout process.', - // Unused at this point - logout_err_not_loggedin: 'You don\'t seem to be logged in.', - - keepalive_info_title: 'About the keep-alive feature', - keepalive_info_body: 'Keep-alive is a new Enano feature that keeps your administrative session from timing out while you are using the administration panel. This feature can be useful if you are editing a large page or doing something in the administration interface that will take longer than 15 minutes.

For security reasons, Enano mandates that high-privilege logins last only 15 minutes, with the time being reset each time a page is loaded (or, more specifically, each time the session API is started). The consequence of this is that if you are performing an action in the administration panel that takes more than 15 minutes, your session may be terminated. The keep-alive feature attempts to relieve this by sending a "ping" to the server every 10 minutes.

Please note that keep-alive state is determined by a cookie. Thus, if you log out and then back in as a different administrator, keep-alive will use the same setting that was used when you were logged in as the first administrative user. In the same way, if you log into the administration panel under your account from another computer, keep-alive will be set to "off".

For more information:
Overview of Enano\'s security model', - - type_guest: 'Guest', - type_member: 'Member', - type_mod: 'Moderator', - type_admin: 'Administrator', - - msg_elev_timed_out: 'Your administrative session has timed out. Log in again', - - reg_err_captcha: 'The confirmation code you entered was incorrect.', - reg_err_disabled_title: 'Registration disabled', - reg_err_disabled_body: 'The administrator has disabled the registration of new accounts on this site.', - reg_err_disabled_body_adminblurb: 'Oops...it seems that you are the administrator...hehe...you can also force account registration to work.', - reg_err_username_invalid: 'Your username must be at least two characters in length and may not contain any of the following characters: < > _ & ? \' " % / \\.', - // Not exactly an error - reg_err_password_good: 'The password you entered is valid.', - reg_err_alert_password_tooshort: 'Your password must be 6 characters or greater in length.', - reg_err_alert_password_nomatch: 'The passwords you entered do not match.', - reg_err_missing_key: 'Couldn\'t look up public encryption key', - - reg_msg_greatercontrol: 'A user account enables you to have greater control over your browsing experience.', - reg_msg_table_title: 'Create a user account', - reg_msg_table_subtitle: 'Please tell us a little bit about yourself.', - reg_msg_username_checking: 'Checking availability...', - reg_msg_username_available: 'This username is available.', - reg_msg_username_unavailable: 'This username is already taken.', - reg_msg_password_length: 'Your password must be at least six characters in length.', - reg_msg_password_score: 'It needs to score at least %config.pw_strength_minimum% for your registration to be accepted.', - reg_msg_password_needmatch: 'The passwords you entered do not match.', - reg_msg_email_activuser: 'An e-mail with an account activation key will be sent to this address, so please ensure that it is correct.', - reg_msg_realname_optional: 'Giving your real name is totally optional. If you choose to provide your real name, it will be used to provide attribution for any edits or contributions you may make to this site.', - reg_msg_captcha_pleaseenter: 'Please enter the code shown in the image to the right into the text box. This process helps to ensure that this registration is not being performed by an automated bot. If the image to the right is illegible, you can generate a new image.', - reg_msg_captcha_blind: 'If you are visually impaired or otherwise cannot read the text shown to the right, please contact the site management and they will create an account for you.', - reg_msg_success_title: 'Registration successful', - reg_msg_success_body: 'Thank you for registering, your user account has been created.', - reg_msg_success_activ_none: 'You may now log in with the username and password that you created.', - reg_msg_success_activ_user: 'Because this site requires account activation, you have been sent an e-mail with further instructions. Please follow the instructions in that e-mail to continue your registration.', - reg_msg_success_activ_admin: 'Because this site requires administrative account activation, you cannot use your account at the moment. A notice has been sent to the site administration team that will alert them that your account has been created.', - reg_msg_success_activ_coppa: 'However, in compliance with the Childrens\' Online Privacy Protection Act, you must have your parent or legal guardian activate your account. Please ask them to check their e-mail for further information.', - - reg_lbl_field_username: 'Preferred username:', - reg_lbl_field_password: 'Password:', - reg_lbl_field_password_confirm: 'Enter your password again to confirm.', - reg_lbl_field_email: 'E-mail address:', - reg_lbl_field_email_coppa: 'Your parent or guardian\'s e-mail address:', - reg_lbl_field_realname: 'Real name:', - reg_lbl_field_captcha: 'Visual confirmation', - reg_lbl_field_captcha_code: 'Code:', - - reg_coppa_title: 'Before you can register, please tell us your age.', - reg_coppa_link_atleast13: 'I was born on or before %yo13_date% and am at least 13 years of age', - reg_coppa_link_not13: 'I was born after %yo13_date% and am less than 13 years of age', - }, - usercp: { - avatar_err_disabled_title: 'Avatar support is disabled.', - avatar_err_disabled_body: 'The administrator has not enabled avatar support for this site.', - avatar_table_title: 'Avatar settings', - avatar_label_current: 'Current avatar:', - avatar_image_alt: '%username%\'s avatar', - avatar_image_none: 'You don\'t have an avatar currently.', - avatar_lbl_change: 'Change your avatar:', - avatar_lbl_keep: 'Keep my current avatar', - avatar_lbl_remove: 'Delete my avatar', - avatar_lbl_set_http: 'Upload a new avatar from the Web', - avatar_lbl_set_file: 'Upload a new avatar from my computer', - avatar_lbl_url: 'URL to image:', - avatar_lbl_url_desc: 'This must start with the http:// prefix and must be a valid URL. The image will be copied from the existing URL to this server - dynamic avatars are not supported.', - avatar_lbl_file: 'Upload file:', - avatar_lbl_file_desc: 'Your browser needs to support file uploads for this option to work.', - avatar_limits: 'The image cannot be more than %config.avatar_max_size% bytes in size. The maximum dimensions are %config.avatar_max_width% × %config.avatar_max_height% pixels. Allowed formats are PNG, GIF, and JPEG.', - avatar_delete_success: 'Your avatar has been deleted.', - avatar_bad_write: 'Either the remote server had trouble finding the image, or your image exceeded the allowed file size.', - avatar_bad_filetype: 'The file you selected is invalid. You must choose a file in PNG, JPEG, or GIF format.', - avatar_disallowed_animation: 'You have chosen an animated image, which is not allowed. Please choose a non-animated image.', - avatar_corrupt_image: 'The image you selected is corrupt. Please choose another image.', - avatar_too_large: 'The image you uploaded exceeds the maximum dimensions (%config.avatar_max_width% × %config.avatar_max_height%px) allowed on this site. Please choose another image.', - avatar_move_failed: 'Your image was accepted, but there was a problem moving the image file to the correct location.', - avatar_upload_success: 'Your avatar has been updated.', - avatar_file_too_large: 'The image you uploaded exceeds the maximum file size allowed for avatars on this site.', - }, - onpage: { - lbl_pagetools: 'Page tools', - lbl_page_article: 'article', - lbl_page_admin: 'administration page', - lbl_page_system: 'system message', - lbl_page_file: 'uploaded file', - lbl_page_help: 'documentation page', - lbl_page_user: 'user page', - lbl_page_special: 'special page', - lbl_page_template: 'template', - lbl_page_project: 'project page', - lbl_page_category: 'category', - - btn_discussion: 'discussion (%num_comments%)', - btn_discussion_unapp: 'discussion (%num_comments% total, %num_unapp% unapp.)', - btn_edit: 'edit this page', - btn_viewsource: 'view source', - btn_history: 'history', - btn_moreoptions: 'more options', - - btn_rename: 'rename', - btn_printable: 'view printable version', - btn_votedelete: 'vote to delete this page', - btn_votedelete_reset: 'reset deletion votes', - lbl_wikimode: 'page wiki mode:', - btn_wikimode_on: 'on', - btn_wikimode_off: 'off', - btn_wikimode_global: 'global', - lbl_protect: 'protection:', - btn_protect_on: 'on', - btn_protect_off: 'off', - btn_protect_semi: 'semi', - btn_clearlogs: 'clear page logs', - btn_deletepage: 'delete this page', - btn_deletepage_votes: ' (%num_votes% vote%plural%)', - lbl_password: 'page password:', - btn_password_set: 'set', - btn_acl: 'manage page access', - btn_admin: 'administrative options', - - tip_article: 'View the page contents, all of the page contents, and nothing but the page contents (alt-a)', - tip_comments: 'View the comments that other users have posted about this page (alt-c)', - tip_edit: 'Edit the contents of this page (alt-e)', - tip_viewsource: 'View the source code (wiki markup) that this page uses (alt-e)', - tip_history: 'View a log of actions taken on this page (alt-h)', - tip_rename: 'Change the display name of this page (alt-r)', - tip_delvote: 'Vote to have this page deleted (alt-d)', - tip_resetvotes: 'Clear the list of votes for deletion against this page (alt-y)', - tip_printable: 'View a version of this page that is suitable for printing', - tip_protect_on: 'Prevents all non-administrators from editing this page. [alt-i]', - tip_protect_off: 'Allows everyone to edit this page. [alt-o]', - tip_protect_semi: 'Allows only users who have been registered for 4 days to edit this page. [alt-p]', - tip_flushlogs: 'Remove all edit and action logs for this page from the database. IRREVERSIBLE! (alt-l)', - tip_deletepage: 'Delete this page. This is always reversible unless the logs are cleared. (alt-k)', - tip_adminoptions: 'Administrative options for this page', - tip_moreoptions: 'Additional options for working with this page', - tip_password: 'Require a password in order for this page to be viewed', - tip_aclmanager: 'Manage who can do what with this page (alt-m)', - - }, - comment: { - lbl_subject: 'Subject', - lbl_mod_options: 'Moderator options:', - heading: 'Article comments', - btn_send_privmsg: 'Send private message', - btn_add_buddy: 'Add to buddy list', - btn_edit: 'edit', - btn_delete: 'delete', - btn_mod_approve: 'Approve', - btn_mod_unapprove: 'Unapprove', - btn_mod_delete: 'Delete', - btn_save: 'save', - - msg_comment_posted: 'Your comment has been posted. If it does not appear right away, it is probably awaiting approval.', - - msg_count_zero: 'There are no comments on this %page_type%.', - msg_count_one: 'There is 1 comment on this %page_type%.', - msg_count_plural: 'There are %num_comments% comments on this %page_type%.', - - msg_count_unapp_mod: '%num_unapp% of those are unapproved.', - msg_count_unapp_one: 'However, there is 1 additional comment awaiting approval.', - msg_count_unapp_plural: 'However, there are %num_unapp% additional comments awaiting approval.', - - msg_note_unapp: '(Unapproved)', - - msg_delete_confirm: 'Do you really want to delete this comment?', - - postform_title: 'Got something to say?', - postform_blurb: 'If you have comments or suggestions on this article, you can shout it out here.', - postform_blurb_unapp: 'Before your post will be visible to the public, a moderator will have to approve it.', - postform_blurb_captcha: 'Because you are not logged in, you will need to enter a visual confirmation before your comment will be posted.', - postform_blurb_link: 'Leave a comment...', - postform_field_name: 'Your name/screen name:', - postform_field_subject: 'Comment subject:', - postform_field_comment: 'Comment:', - postform_field_captcha_title: 'Visual confirmation:', - postform_field_captcha_blurb: 'Please enter the confirmation code seen in the image on the right into the box. If you cannot read the code, please click on the image to generate a new one. This helps to prevent automated bot posting.', - postform_field_captcha_label: 'Confirmation code:', - postform_field_captcha_cantread_js: 'If you can\'t read the code, click on the image to generate a new one.', - postform_field_captcha_cantread_nojs: 'If you can\'t read the code, please refresh this page to generate a new one.', - postform_btn_submit: 'Submit comment', - - on_friend_list: 'On your friend list', - on_foe_list: 'On your foe list', - }, - adm: { - cat_general: 'General', - cat_content: 'Content', - cat_appearance: 'Appearance', - cat_users: 'Users', - cat_security: 'Security', - cat_plugins: 'Plugin configuration', - - page_general_config: 'General configuration', - page_file_uploads: 'File uploads', - page_file_types: 'Allowed file types', - page_plugins: 'Manage plugins', - page_db_backup: 'Backup database', - - page_manager: 'Manage pages', - page_editor: 'Edit page content', - page_pg_groups: 'Manage page groups', - - page_themes: 'Manage themes', - - page_users: 'Manage users', - page_user_groups: 'Edit user groups', - page_coppa: 'COPPA support', - page_mass_email: 'Mass e-mail', - - page_security_log: 'Security log', - page_ban_control: 'Ban control', - - btn_home: 'Administration panel home', - btn_logout: 'Log out of admin panel', - btn_keepalive_off: 'Turn on keep-alive', - btn_keepalive_on: 'Turn off keep-alive', - btn_keepalive_about: 'About keep-alive', - btn_keepalive_loading: 'Loading keep-alive button...', - - err_not_auth_title: 'Error: Not authenticated', - err_not_auth_body: 'It looks like your administration session is invalid or you are not authorized to access this administration page. Please re-authenticate to continue.', - }, - editor: { - msg_revert_confirm: 'Do you really want to revert your changes?', - msg_discard_confirm: 'Do you really want to discard your changes?', - msg_unload: 'If you do, any changes that you have made to this page will be lost.', - btn_graphical: 'graphical editor', - btn_wikitext: 'wikitext editor', - lbl_edit_summary: 'Edit summary:', - lbl_minor_edit: 'This is a minor edit', - btn_save: 'Save changes', - btn_preview: 'Show preview', - btn_revert: 'Revert changes', - btn_cancel: 'Cancel and return to page', - btn_closeviewer: 'Close viewer', - preview_blurb: 'Reminder: This is only a preview - your changes to this page have not yet been saved.', - msg_save_success_title: 'Changes saved', - msg_save_success_body: 'Your changes to this page have been saved. Redirecting...', - }, - history: { - summary_clearlogs: 'Automatic backup created when logs were purged', - page_subtitle: 'History of edits and actions', - heading_edits: 'Edits:', - heading_other: 'Other changes:', - no_entries: 'No history entries in this category.', - btn_compare: 'Compare selected revisions', - col_diff: 'Diff', - col_datetime: 'Date/time', - col_user: 'User', - col_summary: 'Edit summary', - col_minor: 'Minor', - col_actions: 'Actions', - col_action_taken: 'Action taken', - col_extra: 'Extra info', - extra_reason: 'Reason:', - extra_oldtitle: 'Old title:', - tip_rdns: 'Click cell background for reverse DNS info', - action_view: 'View', - action_contrib: 'User contribs', - action_restore: 'Restore', - action_revert: 'Revert action', - log_protect: 'Protected page', - log_unprotect: 'Unprotected page', - log_semiprotect: 'Semi-protected page', - log_rename: 'Renamed page', - log_create: 'Created page', - log_delete: 'Deleted page', - log_uploadnew: 'Uploaded new file version', - lbl_comparingrevisions: 'Comparing revisions:', - }, - page: { - protect_lbl_success_title: 'Page protected', - protect_lbl_success_body: 'The protection setting has been applied. Return to the page.', - protect_err_need_reason: 'Error: you must enter a reason for protecting this page.', - protect_lbl_reason: 'Reason for protecting the page:', - protect_lbl_level: 'Protecion level to be applied:', - protect_lbl_level_none: 'No protection', - protect_lbl_level_semi: 'Semi-protection', - protect_lbl_level_full: 'Full protection', - protect_btn_submit: 'Protect page', - - rename_err_need_name: 'Error: you must enter a new name for this page.', - rename_lbl: 'Please enter a new name for this page:', - rename_btn_submit: 'Rename page', - rename_success_title: 'Page renamed', - - flushlogs_warning_stern: '

You are about to destroy all logged edits and actions on this page.

Unlike deleting or editing this page, this action is not reversible! You should only do this if you are desparate for database space.

Do you really want to continue?

', - flushlogs_btn_submit: 'Flush logs', - - delvote_warning_stern: '

Your vote counts.

If you think that this page is not relavent to the content on this site, or if it looks like this page was only created in an attempt to spam the site, you can request that this page be deleted by an administrator.

After you vote, you should leave a comment explaining the reason for your vote, especially if you are the first person to vote against this page.

', - - delvote_count_zero: 'So far, no one has voted for the deletion of this page.', - delvote_count_one: 'So far, one person has voted to delete this page.', - delvote_count_plural: 'So far, %delvotes% people have voted to delete this page.', - delvote_btn_submit: 'Vote to delete this page', - delvote_reset_btn_submit: 'Reset votes', - - delete_warning_stern: '

You are about to destroy this page.

While the deletion of the page itself is completely reversible, it is impossible to recover any comments or category information on this page. If this is a file page, the file along with all older revisions of it will be permanently deleted. Also, any custom information that this page is tagged with, such as a custom name, protection status, or additional settings such as whether to allow comments, will be permanently lost.

Are you absolutely sure that you want to continue?
You will not be asked again.

', - delete_btn_submit: 'Delete this page', - delete_lbl_reason: 'Reason for deleting:', - - wikimode_success_redirect: 'Wiki mode for this page has been set. Redirecting you to the page...', - wikimode_level_on: 'Wiki features will be enabled.', - wikimode_level_off: 'Wiki features will be disabled.', - wikimode_level_global: 'Wiki features will be synchronized to the global setting.', - wikimode_heading: 'You are changing wiki mode for this page.', - wikimode_warning: 'If you want to continue, please click the button below.', - wikimode_blurb_disable: 'Because this will disable the wiki behavior on this page, several features, most notably the ability for users to vote to have this page deleted, will be disabled as they are not relevant to non-wiki pages. In addition, users will not be able to edit this page unless an ACL rule specifically permits them.', - wikimode_blurb_enable: 'Because this will enable the wiki behavior on this page, users will gain the ability to freely edit this page unless an ACL rule specifically denies them. If your site is public and gets good traffic, you should be aware of the possiblity of vandalism, and you need to be ready to revert malicious edits to this page.', - wikimode_btn_submit: 'Set wiki mode', - - detag_err_page_exists: 'The detag action is only valid for pages that have been deleted in the past.', - detag_success_title: 'Page detagged', - detag_success_body: 'All stale tags have been removed from this page.', - - err_custompage_function_missing_title: 'Page backend not found', - err_custompage_function_missing_body: 'The administration page you are looking for was properly registered using the page API, but the backend function (%function_name%) was not found. If this is a plugin page, then this is almost certainly a bug with the plugin.', - err_redirects_exceeded: 'The maximum number of internal redirects has been exceeded.', - err_redirect_to_nonexistent: 'This page redirects to another page that doesn\'t exist.', - err_redirect_infinite_loop: 'This page infinitely redirects with another page (or another series of pages), and the infinite redirect was trapped.', - err_redirect_to_special: 'This page redirects to a Special or Administration page, which is not allowed.', - err_access_denied_title: 'You don\'t have permission to view this page.', - err_access_denied_body: '

Your user account doesn\'t have the necessary permission to view this page. There are a number of possible reasons for this:

- -

If you would like to inquire further about this message, you may contact the %site_administration%.

', - err_access_denied_siteadmin: 'site administrator', - msg_this_is_a_redirector: 'This page is a redirector.
- This means that this page will not show its own content by default. Instead it will display the contents of the page it redirects to.

- To create a redirect page, make the first characters in the page content #redirect [[Page_ID]]. For more information, see the - Enano Wiki formatting guide.

- This page redirects to %redirect_target%.' - }, - catedit: { - title: 'Select which categories this page should be included in.', - no_categories: 'There are no categories on this site yet.', - catbox_lbl_categories: 'Categories:', - catbox_lbl_uncategorized: '(Uncategorized)', - catbox_link_edit: 'edit categorization', - catbox_link_showcategorization: 'show page categorization', - }, - tags: { - catbox_link: 'show page tags', - lbl_page_tags: 'Page tags:', - lbl_no_tags: 'No tags on this page', - btn_add_tag: '(add a tag)', - lbl_add_tag: 'Add a tag:', - btn_add: '+ Add', - }, - delvote: { - lbl_votes_one: 'There is one user that thinks this page should be deleted.', - lbl_votes_plural: 'There are %num_users% users that think this page should be deleted.', - lbl_users_that_voted: 'Users that voted:', - btn_deletepage: 'Delete page', - btn_resetvotes: 'Reset votes', - }, - ajax: { - // Client-side messages - protect_prompt_reason: 'Reason for (un)protecting:', - rename_prompt: 'What title should this page be renamed to?\nNote: This does not and will never change the URL of this page, that must be done from the admin panel.', - delete_prompt_reason: 'Please enter your reason for deleting this page.', - delete_confirm: 'You are about to REVERSIBLY delete this page. Do you REALLY want to do this?\n\n(Comments and categorization data, as well as any attached files, will be permanently lost)', - delvote_confirm: 'Are you sure that you want to vote that this page be deleted?', - delvote_reset_confirm: 'This action will reset the number of votes against this page to zero. Do you really want to do this?', - clearlogs_confirm: 'You are about to DESTROY all log entries for this page. As opposed to (example) deleting this page, this action is completely IRREVERSIBLE and should not be used except in dire circumstances. Do you REALLY want to do this?', - clearlogs_confirm_nag: 'You\'re ABSOLUTELY sure???', - changestyle_select: '[Select]', - changestyle_title: 'Change your theme', - changestyle_pleaseselect_theme: 'Please select a theme from the list.', - changestyle_lbl_theme: 'Theme:', - changestyle_lbl_style: 'Style:', - changestyle_success: 'Your theme preference has been changed.\nWould you like to reload the page now to see the changes?', - killphp_confirm: 'Are you really sure you want to do this? Some pages might not function if this emergency-only feature is activated.', - killphp_success: 'Embedded PHP in pages has been disabled.', - lbl_moreoptions_nojs: 'More options for this page', - - // Server-side responses - rename_too_short: 'The name you entered is too short. Please enter a longer name for this page.', - rename_success: 'The page "%page_name_old%" has been renamed to "%page_name_new%". You are encouraged to leave a comment explaining your action.\n\nYou will see the change take effect the next time you reload this page.', - clearlogs_success: 'The logs for this page have been cleared. A backup of this page has been added to the logs table so that this page can be restored in case of vandalism or spam later.', - delete_need_reason: 'Invalid reason for deletion passed. Please enter a reason for deleting this page.', - delete_success: 'This page has been deleted. Note that there is still a log of edits and actions in the database, and anyone with admin rights can raise this page from the dead unless the log is cleared. If the deleted file is an image, there may still be cached thumbnails of it in the cache/ directory, which is inaccessible to users.', - delvote_success: 'Your vote to have this page deleted has been cast.\nYou are encouraged to leave a comment explaining the reason for your vote.', - delvote_already_voted: 'It appears that you have already voted to have this page deleted.', - delvote_reset_success: 'The number of votes for having this page deleted has been reset to zero.', - password_success: 'The password for this page has been set.', - password_disable_success: 'The password for this page has been disabled.', - - }, - sidebar: { - title_navigation: 'Navigation', - title_tools: 'Tools', - title_search: 'Search', - title_links: 'Links', - - btn_home: 'Home', - btn_createpage: 'Create a page', - btn_uploadfile: 'Upload file', - btn_specialpages: 'Special pages', - btn_administration: 'Administration', - btn_editsidebar: 'Edit the sidebar', - btn_search_go: 'Go', - - btn_userpage: 'User page', - btn_mycontribs: 'My contributions', - btn_preferences: 'Preferences', - btn_privatemessages: 'Private messages', - btn_groupcp: 'Group control panel', - btn_register: 'Create an account', - btn_login: 'Log in', - btn_logout: 'Log out', - btn_changestyle: 'Change theme', - }, - acl: { - err_access_denied: 'You are not authorized to view or edit access control lists.', - err_missing_template: 'It seems that (a) the file acledit.tpl is missing from this theme, and (b) the JSON response is working.', - err_user_not_found: 'The username you entered was not found.', - err_bad_group_id: 'The group ID you submitted is not valid.', - err_demo: 'Editing access control lists is disabled in the administration demo.', - err_zero_list: 'Supplied rule list has a length of zero', - err_pleaseselect_targettype: 'Please select a target type.', - err_pleaseselect_username: 'Please enter a username.', - - radio_usergroup: 'A usergroup', - radio_user: 'A specific user', - radio_scope_thispage: 'Only this page', - radio_scope_wholesite: 'The entire website', - radio_scope_pagegroup: 'A group of pages', - - lbl_scope: 'What should this access rule control?', - lbl_welcome_title: 'Manage page access', - lbl_welcome_body: 'Please select who should be affected by this access rule.', - lbl_editwin_title_create: 'Create access rule', - lbl_editwin_title_edit: 'Editing permissions', - lbl_editwin_body: 'This panel allows you to edit what the %target_type% "%target%" can do on %scope_type%. Unless you set a permission to "Deny", these permissions may be overridden by other rules.', - lbl_deleterule: 'Delete this rule', - lbl_save_success_title: 'Permissions updated', - lbl_save_success_body: 'The permissions for %target_name% on this page have been updated successfully. If you changed permissions that affect your user account, you may not see changes until you reload the page.', - lbl_delete_success_title: 'Rule deleted', - lbl_delete_success_body: 'The access rules for %target_name% on this page have been deleted.', - lbl_field_deny: 'Deny', - lbl_field_disallow: 'Disallow', - lbl_field_wikimode: 'Wiki mode', - lbl_field_allow: 'Allow', - lbl_help: '

Permission types:

', - - scope_type_wholesite: 'this entire site', - scope_type_thispage: 'this page', - scope_type_pagegroup: 'this group of pages', - - target_type_user: 'user', - target_type_group: 'group', - - msg_guest_howto: 'To edit permissions for guests, select "a specific user", and enter Anonymous as the username.', - msg_deleterule_confirm: 'Do you really want to delete this rule?', - msg_closeacl_confirm: 'Do you really want to close the ACL manager?', - - btn_success_dismiss: 'dismiss', - btn_success_close: 'close manager', - btn_deleterule: 'Delete rule', - btn_createrule: 'Create rule', - btn_returnto_editor: 'Return to ACL editor', - btn_returnto_userscope: 'Return to user/scope selection', - }, - perm: { - read: 'Read page(s)', - post_comments: 'Post comments', - edit_comments: 'Edit own comments', - edit_page: 'Edit page', - view_source: 'View source', - mod_comments: 'Moderate comments', - history_view: 'View history/diffs', - history_rollback: 'Rollback history', - history_rollback_extra: 'Undelete page(s)', - protect: 'Protect page(s)', - rename: 'Rename page(s)', - clear_logs: 'Clear page logs (dangerous)', - vote_delete: 'Vote to delete', - vote_reset: 'Reset delete votes', - delete_page: 'Delete page(s)', - tag_create: 'Tag page(s)', - tag_delete_own: 'Remove own page tags', - tag_delete_other: 'Remove others\' page tags', - set_wiki_mode: 'Set per-page wiki mode', - password_set: 'Set password', - password_reset: 'Disable/reset password', - mod_misc: 'Super moderator (generate SQL backtraces, view IP addresses, and send large numbers of private messages)', - edit_cat: 'Edit categorization', - even_when_protected: 'Allow editing, renaming, and categorization even when protected', - upload_files: 'Upload files', - upload_new_version: 'Upload new versions of files', - create_page: 'Create pages', - php_in_pages: 'Embed PHP code in pages', - edit_acl: 'Edit access control lists', - }, - adminusers: { - avatar_heading: 'Avatar settings', - avatar_image_none: 'This user does not currently have an avatar.', - avatar_lbl_change: 'Change avatar:', - avatar_lbl_keep: 'Keep current setting', - avatar_lbl_remove: 'Delete this user\'s avatar', - avatar_lbl_set_http: 'Replace avatar using a new image from a URL', - avatar_lbl_set_file: 'Replace avatar using a new image from my computer', - }, - etc: { - redirect_title: 'Redirecting...', - redirect_body: 'Please wait while you are redirected.', - redirect_timeout: 'If you are not redirected within %timeout% seconds, please click here.', - // Generic "Save Changes" button - save_changes: 'Save changes', - // Generic "Cancel changes" button - cancel_changes: 'Cancel changes', - // Generic wizard buttons - wizard_next: 'Next >', - wizard_back: '< Back', - wizard_previous: '< Previous', - // Generic "Notice:" label - lbl_notice: 'Notice:', - // Generic "Access denied" - access_denied: 'Access to the specified file, resource, or action is denied.', - access_denied_short: 'Access denied', - return_to_page: 'Return to the page', - invalid_request_short: 'Invalid request', - // Message box buttons - ok: 'OK', - cancel: 'Cancel', - yes: 'Yes', - no: 'No' - } - } -}; - -// All done! :-) - diff -r 32429702305e -r c72b545f1304 language/english/tools.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/language/english/tools.json Wed Dec 26 00:37:26 2007 -0500 @@ -0,0 +1,84 @@ +/* + * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between + * Version 1.1.1 + * Copyright (C) 2006-2007 Dan Fuhry + * + * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. + */ + +// This is the main language file for Enano. Feel free to use it as a base for your own translations. +// All text in this file before the first left curly brace and all text after the last curly brace will +// be trimmed. So you can use a limited amount of Javascript in this so that the language can be imported +// via Javascript as well. + +var enano_lang = { + categories: [ + 'search', 'specialpage' + ], + strings: { + meta: { + search: 'Search page', + specialpage: 'Special pages', + }, + specialpage: { + administration: 'Administration', + manage_sidebar: 'Manage the Sidebar', + css: 'Templated style sheet generator', + groupcp: 'Group Membership', + create_page: 'Create page', + all_pages: 'All pages', + special_pages: 'List of special pages', + about_enano: 'About Enano', + gnu_gpl: 'GNU General Public License', + tag_cloud: 'Tag cloud', + search_rebuild: 'Rebuild search index', + search: 'Search', + upload_file: 'Upload file', + download_file: 'Download file', + log_in: 'Log in', + log_out: 'Log out', + register: 'Register', + preferences: 'Edit Profile', + contributions: 'User contributions', + change_theme: 'Change my preferred theme', + activate_account: 'Activate user account', + captcha: 'CAPTCHA image generator', + password_reset: 'Reset forgotten password', + member_list: 'Member list', + language_export: 'Language exporter', + private_messages: 'Private Messages', + }, + search: { + th_advanced_search: 'Advanced Search', + + err_query_title: 'Some problems were encountered during your search.', + err_query_body: 'There was a problem with your search query, and as a result there may be a reduced number of search results.', + err_query_too_many_terms: 'Some of your search terms were excluded because searches are limited to 20 terms to prevent excessive server load.', + err_query_has_stopwords: 'One or more of your search terms was excluded because either it was less than 2 characters in length or is a common word (a stopword) that is typically found on a large number of pages. Examples of stopwords include "the", "this", "which", "with", etc.', + err_query_dup_terms: 'One or more of your search terms was excluded because duplicate terms were encountered.', + err_query_term_too_short: 'One or more of your search terms was excluded because terms must be at least 4 characters in length.', + + btn_search: 'Search', + // note the case difference with th_advanced_search + btn_advanced_search: 'Advanced search', + + msg_no_results: 'No results.', + msg_result_detail: 'Results %start_string% - %per_string% of about %num_results% for %q_trim% in %search_time%s.', + + lbl_site_search: 'Site search', + lbl_relevance: 'Relevance:', + lbl_field_any: 'Search for pages with any of these words:', + lbl_field_exact: 'with this exact phrase:', + lbl_field_none: 'with none of these words:', + lbl_field_all: 'with all of these words:', + lbl_field_casesensitive: 'Case-sensitive search:', + } + } +}; + +// All done! :-) + diff -r 32429702305e -r c72b545f1304 language/english/user.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/language/english/user.json Wed Dec 26 00:37:26 2007 -0500 @@ -0,0 +1,309 @@ +/* + * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between + * Version 1.1.1 + * Copyright (C) 2006-2007 Dan Fuhry + * + * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. + */ + +// This is the main language file for Enano. Feel free to use it as a base for your own translations. +// All text in this file before the first left curly brace and all text after the last curly brace will +// be trimmed. So you can use a limited amount of Javascript in this so that the language can be imported +// via Javascript as well. + +var enano_lang = { + categories: [ + 'user', 'usercp', 'groupcp', 'privmsgs' + ], + strings: { + meta: { + user: 'Login, logout, and authentication', + usercp: 'User control panel', + groupcp: 'Group control panel', + privmsgs: 'Private message and buddy list CP' + }, + user: { + login_message_short: 'Please enter your username and password to log in.', + login_message_short_elev: 'Please re-enter your login details', + login_body: 'Logging in enables you to use your preferences and access member information. If you don\'t have a username and password here, you can create an account.', + login_body_elev: 'You are requesting that a sensitive operation be performed. To continue, please re-enter your password to confirm your identity.', + login_field_username: 'Username', + login_field_password: 'Password', + login_forgotpass_blurb: 'Forgot your password? No problem.', + login_createaccount_blurb: 'Maybe you need to create an account.', + login_field_captcha: 'Code in image', + login_nocrypt_title: 'Important note regarding cryptography:', + login_nocrypt_body: 'Some countries do not allow the import or use of cryptographic technology. If you live in one of the countries listed below, you should log in without using encryption.', + login_nocrypt_countrylist: 'This restriction applies to the following countries: Belarus, China, India, Israel, Kazakhstan, Mongolia, Pakistan, Russia, Saudi Arabia, Singapore, Tunisia, Venezuela, and Vietnam.', + login_usecrypt_title: 'Encryption is currently turned off.', + login_usecrypt_body: 'If you are not in one of the countries listed below, you should enable encryption to secure the logon process.', + login_usecrypt_countrylist: 'The cryptography restriction applies to the following countries: Belarus, China, India, Israel, Kazakhstan, Mongolia, Pakistan, Russia, Saudi Arabia, Singapore, Tunisia, Venezuela, and Vietnam.', + login_success_title: 'Login successful', + login_success_body: 'You have successfully logged into the %config.site_name% site as "%username%". Redirecting to %redir_target%...', + login_success_body_mainpage: 'the main page', + login_success_short: 'Success.', + + login_ajax_fetching_key: 'Fetching an encryption key...', + login_ajax_prompt_title: 'Please enter your username and password to continue.', + login_ajax_prompt_title_elev: 'You are requesting a sensitive operation.', + login_ajax_prompt_body_elev: 'Please re-enter your login details, to verify your identity.', + login_ajax_link_fullform: 'Trouble logging in? Try the full login form.', + login_ajax_link_forgotpass: 'Did you forget your password?', + login_ajax_loggingin: 'Logging in...', + + err_key_not_found: 'Enano couldn\'t look up the encryption key used to encrypt your password. This most often happens if a cache rotation occurred during your login attempt, or if you refreshed the login page.', + err_key_not_found_cleared: 'It seems that the list of encryption keys used for login information has reached its maximum length, thus preventing new keys from being inserted. The list has been automatically cleared. Please try logging in again; if you are still unable to log in, please contact the site administration.', + err_key_wrong_length: 'The encryption key was the wrong length.', + err_too_big_for_britches: 'You are trying to authenticate at a level that your user account does not permit.', + err_invalid_credentials: 'You have entered an invalid username or password. Please enter your login details again.', + err_invalid_credentials_lockout: ' You have used up %fails% out of %config.lockout_threshold% login attempts. After you have used up all %config.lockout_threshold% login attempts, you will be locked out from logging in for %config.lockout_duration% minutes.', + err_invalid_credentials_lockout_captcha: ' You have used up %lockout_fails% out of %config.lockout_threshold% login attempts. After you have used up all %config.lockout_threshold% login attempts, you will have to enter a visual confirmation code while logging in, effective for %config.lockout_duration% minutes.', + err_backend_fail: 'You entered the right credentials and everything was validated, but for some reason Enano couldn\'t register your session. This is an internal problem with the site and you are encouraged to contact site administration.', + err_locked_out: 'You have used up all %config.lockout_threshold% allowed login attempts. Please wait %time_rem% minute%plural% before attempting to log in again%captcha_blurb%.', + err_locked_out_captcha_blurb: ', or enter the visual confirmation code shown above in the appropriate box', + + logout_success_title: 'Logged out', + logout_success_body: 'You have been successfully logged out, and all cookies have been cleared. You will now be transferred to the main page.', + logout_confirm_title: 'Are you sure you want to log out?', + logout_confirm_body: 'If you log out, you will no longer be able to access your user preferences, your private messages, or certain areas of this site until you log in again.', + logout_confirm_title_elev: 'Are you sure you want to de-authenticate?', + logout_confirm_body_elev: 'If you de-authenticate, you will no longer be able to use the administration panel until you re-authenticate again. You may do so at any time using the Administration button on the sidebar.', + logout_err_title: 'An error occurred during the logout process.', + // Unused at this point + logout_err_not_loggedin: 'You don\'t seem to be logged in.', + + keepalive_info_title: 'About the keep-alive feature', + keepalive_info_body: 'Keep-alive is a new Enano feature that keeps your administrative session from timing out while you are using the administration panel. This feature can be useful if you are editing a large page or doing something in the administration interface that will take longer than 15 minutes.

For security reasons, Enano mandates that high-privilege logins last only 15 minutes, with the time being reset each time a page is loaded (or, more specifically, each time the session API is started). The consequence of this is that if you are performing an action in the administration panel that takes more than 15 minutes, your session may be terminated. The keep-alive feature attempts to relieve this by sending a "ping" to the server every 10 minutes.

Please note that keep-alive state is determined by a cookie. Thus, if you log out and then back in as a different administrator, keep-alive will use the same setting that was used when you were logged in as the first administrative user. In the same way, if you log into the administration panel under your account from another computer, keep-alive will be set to "off".

For more information:
Overview of Enano\'s security model', + + type_guest: 'Guest', + type_member: 'Member', + type_mod: 'Moderator', + type_admin: 'Administrator', + + msg_elev_timed_out: 'Your administrative session has timed out. Log in again', + + reg_err_captcha: 'The confirmation code you entered was incorrect.', + reg_err_disabled_title: 'Registration disabled', + reg_err_disabled_body: 'The administrator has disabled the registration of new accounts on this site.', + reg_err_disabled_body_adminblurb: 'Oops...it seems that you are the administrator...hehe...you can also force account registration to work.', + reg_err_username_invalid: 'Your username must be at least two characters in length and may not contain any of the following characters: < > _ & ? \' " % / \\.', + // Not exactly an error + reg_err_password_good: 'The password you entered is valid.', + reg_err_alert_password_tooshort: 'Your password must be 6 characters or greater in length.', + reg_err_alert_password_nomatch: 'The passwords you entered do not match.', + reg_err_missing_key: 'Couldn\'t look up public encryption key', + + reg_msg_greatercontrol: 'A user account enables you to have greater control over your browsing experience.', + reg_msg_table_title: 'Create a user account', + reg_msg_table_subtitle: 'Please tell us a little bit about yourself.', + reg_msg_username_checking: 'Checking availability...', + reg_msg_username_available: 'This username is available.', + reg_msg_username_unavailable: 'This username is already taken.', + reg_msg_password_length: 'Your password must be at least six characters in length.', + reg_msg_password_score: 'It needs to score at least %config.pw_strength_minimum% for your registration to be accepted.', + reg_msg_password_needmatch: 'The passwords you entered do not match.', + reg_msg_email_activuser: 'An e-mail with an account activation key will be sent to this address, so please ensure that it is correct.', + reg_msg_realname_optional: 'Giving your real name is totally optional. If you choose to provide your real name, it will be used to provide attribution for any edits or contributions you may make to this site.', + reg_msg_captcha_pleaseenter: 'Please enter the code shown in the image to the right into the text box. This process helps to ensure that this registration is not being performed by an automated bot. If the image to the right is illegible, you can generate a new image.', + reg_msg_captcha_blind: 'If you are visually impaired or otherwise cannot read the text shown to the right, please contact the site management and they will create an account for you.', + reg_msg_success_title: 'Registration successful', + reg_msg_success_body: 'Thank you for registering, your user account has been created.', + reg_msg_success_activ_none: 'You may now log in with the username and password that you created.', + reg_msg_success_activ_user: 'Because this site requires account activation, you have been sent an e-mail with further instructions. Please follow the instructions in that e-mail to continue your registration.', + reg_msg_success_activ_admin: 'Because this site requires administrative account activation, you cannot use your account at the moment. A notice has been sent to the site administration team that will alert them that your account has been created.', + reg_msg_success_activ_coppa: 'However, in compliance with the Childrens\' Online Privacy Protection Act, you must have your parent or legal guardian activate your account. Please ask them to check their e-mail for further information.', + + reg_lbl_field_username: 'Preferred username:', + reg_lbl_field_password: 'Password:', + reg_lbl_field_password_confirm: 'Enter your password again to confirm.', + reg_lbl_field_email: 'E-mail address:', + reg_lbl_field_email_coppa: 'Your parent or guardian\'s e-mail address:', + reg_lbl_field_realname: 'Real name:', + reg_lbl_field_captcha: 'Visual confirmation', + reg_lbl_field_captcha_code: 'Code:', + + reg_coppa_title: 'Before you can register, please tell us your age.', + reg_coppa_link_atleast13: 'I was born on or before %yo13_date% and am at least 13 years of age', + reg_coppa_link_not13: 'I was born after %yo13_date% and am less than 13 years of age', + }, + usercp: { + avatar_err_disabled_title: 'Avatar support is disabled.', + avatar_err_disabled_body: 'The administrator has not enabled avatar support for this site.', + avatar_table_title: 'Avatar settings', + avatar_label_current: 'Current avatar:', + avatar_image_alt: '%username%\'s avatar', + avatar_image_none: 'You don\'t have an avatar currently.', + avatar_lbl_change: 'Change your avatar:', + avatar_lbl_keep: 'Keep my current avatar', + avatar_lbl_remove: 'Delete my avatar', + avatar_lbl_set_http: 'Upload a new avatar from the Web', + avatar_lbl_set_file: 'Upload a new avatar from my computer', + avatar_lbl_url: 'URL to image:', + avatar_lbl_url_desc: 'This must start with the http:// prefix and must be a valid URL. The image will be copied from the existing URL to this server - dynamic avatars are not supported.', + avatar_lbl_file: 'Upload file:', + avatar_lbl_file_desc: 'Your browser needs to support file uploads for this option to work.', + avatar_limits: 'The image cannot be more than %config.avatar_max_size% bytes in size. The maximum dimensions are %config.avatar_max_width% × %config.avatar_max_height% pixels. Allowed formats are PNG, GIF, and JPEG.', + avatar_delete_success: 'Your avatar has been deleted.', + avatar_bad_write: 'Either the remote server had trouble finding the image, or your image exceeded the allowed file size.', + avatar_bad_filetype: 'The file you selected is invalid. You must choose a file in PNG, JPEG, or GIF format.', + avatar_disallowed_animation: 'You have chosen an animated image, which is not allowed. Please choose a non-animated image.', + avatar_corrupt_image: 'The image you selected is corrupt. Please choose another image.', + avatar_too_large: 'The image you uploaded exceeds the maximum dimensions (%config.avatar_max_width% × %config.avatar_max_height%px) allowed on this site. Please choose another image.', + avatar_move_failed: 'Your image was accepted, but there was a problem moving the image file to the correct location.', + avatar_upload_success: 'Your avatar has been updated.', + avatar_file_too_large: 'The image you uploaded exceeds the maximum file size allowed for avatars on this site.', + }, + groupcp: { + status_mod: 'You are a moderator of this group.', + status_member: 'You are a member of this group.', + status_not_member: 'You are not a member of this group.', + + err_state_system_group: 'Because this is a system group, you can\'t make it open or allow membership requests.', + err_user_not_found: 'The username you entered could not be found.', + + type_hidden: 'Hidden group', + type_closed: 'Closed group', + type_request: 'Members can request to join', + type_open: 'Anyone can join', + + lbl_current_memberships: 'Current group memberships:', + lbl_non_memberships: 'Groups you are outside of:', + lbl_group_name: 'Group name:', + lbl_status: 'Membership status:', + lbl_state: 'Group state:', + lbl_make_mod: 'User is a group moderator', + lbl_username: 'Username:', + lbl_moderator: 'Group moderator:', + + msg_membership_requested: 'A request has been sent to the moderator(s) of this group to add you.', + msg_status_pending: '(Your request to join is awaiting approval)', + msg_no_mods: 'This group has no moderators.', + msg_no_members: 'This group has no members.', + msg_system_group: '(system group)', + msg_pending_updated: 'Pending members status updated successfully.', + msg_state_updated: 'The group state was updated.', + msg_user_already_in_mod_updated: 'The user "%username%" is already in this group, so their moderator status was updated.', + msg_user_already_in: 'The user "%username%" is already in this group.', + msg_user_added: 'The user "%username%" has been added to this usergroup.', + msg_self_added: 'You have been added to this group.', + + btn_view: 'View information', + btn_request_join: 'Request membership', + btn_join: 'Join this group', + btn_approve_pending: 'Approve membership', + btn_reject_pending: 'Reject membership', + btn_remove_selected: 'Remove selected users', + btn_add_member: 'Add member', + + grp_administrators: 'Administrators', + grp_moderators: 'Moderators', + + th_select_group: 'Group membership details', + th_group_info: 'Group information', + th_pending_memberships: 'Pending memberships', + th_group_members: 'Group members', + th_group_mods: 'Group moderators', + th_add_member: 'Add a new member to this group', + th_username: 'Username', + th_email: 'E-mail', + th_reg_time: 'Registered', + th_comments: 'Total comments', + th_select: 'Select', + th_remove: 'Remove?', + }, + privmsgs: { + err_need_login: 'You need to be logged in to view private messages.', + err_not_authorized_read: 'You are not authorized to view this message.', + err_not_authorized_edit: 'You are not authorized to alter this message.', + err_send_submit: 'Your message could not be sent because the following problems were encountered:', + err_need_username: 'Please enter the username to which you want to send your message.', + err_need_subject: 'Please enter a subject for your message.', + err_need_message: 'Please enter a message to send.', + err_limit_exceeded_title: 'Recipient limit exceeded', + err_limit_exceeded_body: 'You can only send this message to a maximum of %limit% users.', + err_folder_not_exist: 'The folder "%folder_name%" does not exist. Return to your inbox.', + + msg_message_status: 'Message status', + msg_message_moved: 'Your message has been moved to the folder "%folder%".', + msg_message_deleted: 'The message has been deleted.', + msg_message_sent: 'Your message has been sent. You may edit the message if you wish; one copy for each recipient will be in your outbox until each recipient has read it. Return to your inbox.', + msg_draft_saved: 'Your message has been saved to your Drafts folder.', + msg_no_messages: 'No messages in this folder.', + + lbl_message_from: 'Private message from %sender%', + lbl_subject: 'Subject:', + lbl_date: 'Date:', + lbl_message: 'Message:', + lbl_compose_th: 'Compose new private message', + lbl_compose_to: 'To:', + lbl_compose_to_max: 'Separate multiple names with a single comma; you may send this message to up to %limit% users.', + lbl_edit_th: 'Edit draft', + + btn_send_reply: 'Send reply', + btn_archive: 'Archive message', + btn_return_to_inbox: 'Return to inbox', + btn_send: 'Send message', + btn_savedraft: 'Save as draft', + btn_archive_selected: 'Archive selected', + btn_delete_selected: 'Delete selected', + btn_delete_all: 'Delete all', + btn_compose: 'New message', + + sidebar_th_privmsgs: 'Private messages', + folder_inbox: 'Inbox', + folder_outbox: 'Outbox', + folder_sent: 'Sent items', + folder_drafts: 'Drafts', + folder_archive: 'Archive', + sidebar_th_buddies: 'Buddies', + sidebar_friend_list: 'Friend list', + sidebar_foe_list: 'Foe list', + + folder_th_foldername: 'Folder:', + folder_th_to: 'To', + folder_th_from: 'From', + folder_th_subject: 'Subject', + folder_th_date: 'Date', + folder_th_mark: 'Mark', + + // AJAX interface + ajax_err_need_js: 'It looks like your browser doesn\'t have support for Javascript. You\'ll need to have Javascript support in order to use the new Private Message interface. You can also switch to the old interface, which doesn\'t require Javascript support.', + ajax_err_json: 'The server had a problem processing your request.', + + ajax_btn_compose: 'Compose message', + ajax_btn_archive: 'Archive', + ajax_btn_unarchive: 'Restore to inbox', + ajax_btn_mark_read: 'Mark as read', + ajax_btn_mark_unread: 'Mark as unread', + ajax_btn_delete: 'Move to trash', + ajax_btn_delete_forever: 'Delete forever', + ajax_btn_refresh: 'Refresh', + ajax_btn_reply: 'Reply', + + ajax_folder_inbox: 'Inbox', + ajax_folder_starred: 'Starred', + ajax_folder_sent: 'Sent messages', + ajax_folder_drafts: 'Drafts', + ajax_folder_archive: 'Archive', + ajax_folder_trash: 'Trash', + + ajax_msg_loading: 'Loading...', + + ajax_lbl_sender: '%sender% to %recipient%', + ajax_me: 'me', + + ajax_teaser_inbox: 'No new mail.', + ajax_teaser_starred: 'You haven\'t starred any messages yet. Starring a message lets you give it a special status that separates it from the rest of your mail so it\'s easier to find. You can star a message by clicking the small gray star next to a message in your inbox or archive.', + ajax_teaser_sent: 'You haven\'t sent any messages yet. When you send a message, a copy of it will appear here.', + + ajax_no_subject: '[No subject]', + } + } +}; + +// All done! :-) + diff -r 32429702305e -r c72b545f1304 plugins/PrivateMessages.php --- a/plugins/PrivateMessages.php Fri Dec 21 19:08:27 2007 -0500 +++ b/plugins/PrivateMessages.php Wed Dec 26 00:37:26 2007 -0500 @@ -22,10 +22,10 @@ global $db, $session, $paths, $template, $plugins; // Common objects -$plugins->attachHook('base_classes_initted', ' +$plugins->attachHook('session_started', ' global $paths; $paths->add_page(Array( - \'name\'=>\'Private Messages\', + \'name\'=>\'specialpage_private_messages\', \'urlname\'=>\'PrivateMessages\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', @@ -35,9 +35,10 @@ function page_Special_PrivateMessages() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; if ( !$session->user_logged_in ) { - die_friendly('Access denied', '

You need to log in to view your private messages.

'); + die_friendly($lang->get('etc_access_denied_short'), '

' . $lang->get('privmsgs_err_need_login', array('login_link' => makeUrlNS('Special', 'Login/' . $paths->page))) . '

'); } $argv = Array(); $argv[] = $paths->getParam(0); @@ -67,7 +68,7 @@ $db->free_result(); if ( ($r['message_to'] != $session->username && $r['message_from'] != $session->username ) || $r['folder_name']=='drafts' ) { - die_friendly('Access denied', '

You are not authorized to view this message.

'); + die_friendly($lang->get('etc_access_denied_short'), '

' . $lang->get('privmsgs_err_not_authorized_read') . '

'); } if ( $r['message_to'] == $session->username ) { @@ -83,17 +84,17 @@ ?>
- - - - + + + - +
Private message from
Subject:
Date:
Message:get('privmsgs_lbl_message_from', array('sender' => htmlspecialchars($r['message_from']))); ?>
get('privmsgs_lbl_subject') ?>
get('privmsgs_lbl_date') ?>
get('privmsgs_lbl_message') ?>'; echo RenderMan::render($r['signature']); } ?>
Send reply | Delete message | Archive message | Return to inbox
get('privmsgs_btn_send_reply'); ?> | Delete message | get('privmsgs_btn_archive'); ?> | get('privmsgs_btn_return_to_inbox'); ?>
footer(); @@ -113,7 +114,7 @@ $db->free_result(); if ( $r['message_to'] != $session->username ) { - die_friendly('Access denied', '

You are not authorized to alter this message.

'); + die_friendly($lang->get('etc_access_denied_short'), '

' . $lang->get('privmsgs_err_not_authorized_edit') . '

'); } $fname = $argv[2]; if ( !$fname || ( $fname != 'Inbox' && $fname != 'Outbox' && $fname != 'Sent' && $fname != 'Drafts' && $fname != 'Archive' ) ) @@ -126,7 +127,7 @@ { $db->_die('The message was not successfully moved.'); } - die_friendly('Message status', '

Your message has been moved to the folder "'.$fname.'".

Return to inbox

'); + die_friendly($lang->get('privmsgs_msg_message_status'), '

' . $lang->get('privmsgs_msg_message_moved', array('folder' => $fname)) . '

' . $lang->get('privmsgs_btn_return_to_inbox') . '

'); break; case 'Delete': $id = $argv[1]; @@ -142,7 +143,7 @@ $r = $db->fetchrow(); if ( $r['message_to'] != $session->username ) { - die_friendly('Access denied', '

You are not authorized to delete this message.

'); + die_friendly($lang->get('etc_access_denied_short'), '

You are not authorized to delete this message.

'); } $q = $db->sql_query('DELETE FROM '.table_prefix.'privmsgs WHERE message_id='.$id.';'); if ( !$q ) @@ -150,55 +151,99 @@ $db->_die('The message was not successfully deleted.'); } $db->free_result(); - die_friendly('Message status', '

The message has been deleted.

Return to inbox

'); + die_friendly($lang->get('privmsgs_msg_message_status'), '

' . $lang->get('privmsgs_msg_message_deleted') . '

' . $lang->get('privmsgs_btn_return_to_inbox') . '

'); break; case 'Compose': if ( $argv[1]=='Send' && isset($_POST['_send']) ) { // Check each POST DATA parameter... - if(!isset($_POST['to']) || ( isset($_POST['to']) && $_POST['to'] == '')) die_friendly('Sending of message failed', '

Please enter the username to which you want to send your message.

'); - if(!isset($_POST['subject']) || ( isset($_POST['subject']) && $_POST['subject'] == '')) die_friendly('Sending of message failed', '

Please enter a subject for your message.

'); - if(!isset($_POST['message']) || ( isset($_POST['message']) && $_POST['message'] == '')) die_friendly('Sending of message failed', '

Please enter a message to send.

'); - $namelist = $_POST['to']; - $namelist = str_replace(', ', ',', $namelist); - $namelist = explode(',', $namelist); - foreach($namelist as $n) { $n = $db->escape($n); } - $subject = RenderMan::preprocess_text($_POST['subject']); - $message = RenderMan::preprocess_text($_POST['message']); - $base_query = 'INSERT INTO '.table_prefix.'privmsgs(message_from,message_to,date,subject,message_text,folder_name,message_read) VALUES'; - foreach($namelist as $n) + $errors = array(); + if(!isset($_POST['to']) || ( isset($_POST['to']) && $_POST['to'] == '')) + { + $errors[] = $lang->get('privmsgs_err_need_username'); + } + if(!isset($_POST['subject']) || ( isset($_POST['subject']) && $_POST['subject'] == '')) + { + $errors[] = $lang->get('privmsgs_err_need_subject'); + } + if(!isset($_POST['message']) || ( isset($_POST['message']) && $_POST['message'] == '')) + { + $errors[] = $lang->get('privmsgs_err_need_message'); + } + if ( count($errors) < 1 ) { - $base_query .= '(\''.$session->username.'\', \''.$n.'\', '.time().', \''.$subject.'\', \''.$message.'\', \'inbox\', 0),'; + $namelist = $_POST['to']; + $namelist = str_replace(', ', ',', $namelist); + $namelist = explode(',', $namelist); + foreach($namelist as $n) { $n = $db->escape($n); } + $subject = RenderMan::preprocess_text($_POST['subject']); + $message = RenderMan::preprocess_text($_POST['message']); + $base_query = 'INSERT INTO '.table_prefix.'privmsgs(message_from,message_to,date,subject,message_text,folder_name,message_read) VALUES'; + foreach($namelist as $n) + { + $base_query .= '(\''.$session->username.'\', \''.$n.'\', '.time().', \''.$subject.'\', \''.$message.'\', \'inbox\', 0),'; + } + $base_query = substr($base_query, 0, strlen($base_query)-1) . ';'; + $result = $db->sql_query($base_query); + $db->free_result(); + if ( !$result ) + { + $db->_die('The message could not be sent.'); + } + else + { + die_friendly($lang->get('privmsgs_msg_message_status'), '

' . $lang->get('privmsgs_msg_message_sent', array('inbox_link' => makeUrlNS('Special', 'PrivateMessages/Folder/Inbox'))) . '

'); + } + return; } - $base_query = substr($base_query, 0, strlen($base_query)-1) . ';'; - $result = $db->sql_query($base_query); - $db->free_result(); - if(!$result) $db->_die('The message could not be sent.'); - else die_friendly('Message status', '

Your message has been sent. You may edit the message if you wish; one copy for each recipient will be in your outbox until each recipient has read it. Return to your inbox.

'); - return; - } elseif($argv[1]=='Send' && isset($_POST['_savedraft'])) { - // Check each POST DATA parameter... - if(!isset($_POST['to']) || ( isset($_POST['to']) && $_POST['to'] == '')) die_friendly('Sending of message failed', '

Please enter the username to which you want to send your message.

'); - if(!isset($_POST['subject']) || ( isset($_POST['subject']) && $_POST['subject'] == '')) die_friendly('Sending of message failed', '

Please enter a subject for your message.

'); - if(!isset($_POST['message']) || ( isset($_POST['message']) && $_POST['message'] == '')) die_friendly('Sending of message failed', '

Please enter a message to send.

'); - $namelist = $_POST['to']; - $namelist = str_replace(', ', ',', $namelist); - $namelist = explode(',', $namelist); - foreach($namelist as $n) { $n = $db->escape($n); } - if(count($namelist) > MAX_PMS_PER_BATCH && $session->get_permssions('mod_misc')) die_friendly('Limit exceeded', '

You can only send this message to a maximum of '.MAX_PMS_PER_BATCH.' users.

'); - $subject = $db->escape($_POST['subject']); - $message = RenderMan::preprocess_text($_POST['message']); - $base_query = 'INSERT INTO '.table_prefix.'privmsgs(message_from,message_to,date,subject,message_text,folder_name,message_read) VALUES'; - foreach($namelist as $n) + } + else if ( $argv[1] == 'Send' && isset($_POST['_savedraft'] ) ) + { + $errors = array(); + if ( !isset($_POST['to']) || ( isset($_POST['to']) && $_POST['to'] == '') ) + { + $errors[] = $lang->get('privmsgs_err_need_username'); + } + if ( !isset($_POST['subject']) || ( isset($_POST['subject']) && $_POST['subject'] == '') ) + { + $errors[] = $lang->get('privmsgs_err_need_subject'); + } + if ( !isset($_POST['message']) || ( isset($_POST['message']) && $_POST['message'] == '') ) + { + $errors[] = $lang->get('privmsgs_err_need_message'); + } + if ( count($errors) < 1 ) { - $base_query .= '(\''.$session->username.'\', \''.$n.'\', '.time().', \''.$subject.'\', \''.$message.'\', \'drafts\', 0),'; + $namelist = $_POST['to']; + $namelist = str_replace(', ', ',', $namelist); + $namelist = explode(',', $namelist); + foreach($namelist as $n) + { + $n = $db->escape($n); + } + if ( count($namelist) > MAX_PMS_PER_BATCH && !$session->get_permssions('mod_misc') ) + { + die_friendly($lang->get('privmsgs_err_limit_exceeded_title'), '

' . $lang->get('privmsgs_err_limit_exceeded_body', array('limit' => MAX_PMS_PER_BATCH)) . '

'); + } + $subject = $db->escape($_POST['subject']); + $message = RenderMan::preprocess_text($_POST['message']); + $base_query = 'INSERT INTO '.table_prefix.'privmsgs(message_from,message_to,date,subject,message_text,folder_name,message_read) VALUES'; + foreach($namelist as $n) + { + $base_query .= '(\''.$session->username.'\', \''.$n.'\', '.time().', \''.$subject.'\', \''.$message.'\', \'drafts\', 0),'; + } + $base_query = substr($base_query, 0, strlen($base_query) - 1) . ';'; + $result = $db->sql_query($base_query); + $db->free_result(); + if ( !$result ) + { + $db->_die('The message could not be saved.'); + } } - $base_query = substr($base_query, 0, strlen($base_query)-1) . ';'; - $result = $db->sql_query($base_query); - $db->free_result(); - if(!$result) $db->_die('The message could not be saved.'); - } elseif(isset($_POST['_inbox'])) { - header('Location: '.makeUrlNS('Special', 'PrivateMessages/Folder/Inbox')); + } + else if(isset($_POST['_inbox'])) + { + redirect(makeUrlNS('Special', 'PrivateMessages/Folder/Inbox'), '', '', 0); } if($argv[1] == 'ReplyTo' && preg_match('#^([0-9]+)$#', $argv[2])) { @@ -207,12 +252,17 @@ $subj = ''; $id = $argv[2]; $q = $db->sql_query('SELECT p.message_from, p.message_to, p.subject, p.message_text, p.date, p.folder_name, u.signature FROM '.table_prefix.'privmsgs AS p LEFT JOIN '.table_prefix.'users AS u ON (p.message_from=u.username) WHERE message_id='.$id.';'); - if(!$q) $db->_die('The message data could not be selected.'); + if ( !$q ) + $db->_die('The message data could not be selected.'); + $r = $db->fetchrow(); $db->free_result(); - if( ($r['message_to'] != $session->username && $r['message_from'] != $session->username ) || $r['folder_name']=='drafts' ) die_friendly('Access denied', '

You are not authorized to view the contents of this message.

'); + if ( ($r['message_to'] != $session->username && $r['message_from'] != $session->username ) || $r['folder_name'] == 'drafts' ) + { + die_friendly($lang->get('etc_access_denied_short'), '

You are not authorized to view the contents of this message.

'); + } $subj = 'Re: ' . $r['subject']; - $text = "\n\n\nOn ".date('M j, Y G:i', $r['date']).", ".$r['message_from']." wrote:\n> ".str_replace("\n", "\n> ", $r['message_text']); // Way less complicated than using a regex ;-) + $text = "\n\n\nOn " . date('M j, Y G:i', $r['date']) . ", " . $r['message_from'] . " wrote:\n> " . str_replace("\n", "\n> ", $r['message_text']); // Way less complicated than using a regex ;-) $tbuf = $text; while( preg_match("/\n([\> ]*?)\> \>/", $text) ) @@ -224,26 +274,47 @@ } $to = $r['message_from']; - } else { - if(( $argv[1]=='to' || $argv[1]=='To' ) && $argv[2]) $to = $argv[2]; - else $to = ''; + } + else + { + if ( ( $argv[1]=='to' || $argv[1]=='To' ) && $argv[2] ) + { + $to = htmlspecialchars($argv[2]); + } + else + { + $to = ''; + } $text = ''; $subj = ''; } $template->header(); userprefs_show_menu(); - echo '
'; + if ( isset($errors) && count($errors) > 0 ) + { + echo '
+ ' . $lang->get('privmsgs_err_send_submit') . ' +
    +
  • ' . implode('
  • ', $errors) . '
  • +
+
'; + } + echo ''; + + if ( isset($_POST['_savedraft']) ) + { + echo '
' . $lang->get('privmsgs_msg_draft_saved') . '
'; + } ?>
- + - - + + + + + + + + + +
Compose new private messageget('privmsgs_lbl_compose_th'); ?>
- To:
- Separate multiple names with a single comma; you
- may send this message to up to users.
+ get('privmsgs_lbl_compose_to'); ?>
+ get('privmsgs_lbl_compose_to_max', array('limit' => MAX_PMS_PER_BATCH)); ?>
username_field('to', (isset($_POST['_savedraft'])) ? $_POST['to'] : $to ); ?> @@ -251,12 +322,37 @@
- Subject: + get('privmsgs_lbl_subject'); ?> -
Message:
+ get('privmsgs_lbl_message'); ?> + + tinymce_textarea('message', $content, 20, 40); + ?> +
+ + + +
'; @@ -264,61 +360,162 @@ break; case 'Edit': $id = $argv[1]; - if(!preg_match('#^([0-9]+)$#', $id)) die_friendly('Message error', '

Invalid message ID

'); + if ( !preg_match('#^([0-9]+)$#', $id) ) + { + die_friendly('Message error', '

Invalid message ID

'); + } $q = $db->sql_query('SELECT message_from, message_to, subject, message_text, date, folder_name, message_read FROM '.table_prefix.'privmsgs WHERE message_id='.$id.''); - if(!$q) $db->_die('The message data could not be selected.'); + if ( !$q ) + { + $db->_die('The message data could not be selected.'); + } $r = $db->fetchrow(); $db->free_result(); - if($r['message_from'] != $session->username || $r['message_read'] == 1 ) die_friendly('Access denied', '

You are not authorized to edit this message.

'); + if ( $r['message_from'] != $session->username || $r['message_read'] == 1 ) + { + die_friendly($lang->get('etc_access_denied_short'), '

You are not authorized to edit this message.

'); + } $fname = $argv[2]; if(isset($_POST['_send'])) { // Check each POST DATA parameter... - if(!isset($_POST['to']) || ( isset($_POST['to']) && $_POST['to'] == '')) die_friendly('Sending of message failed', '

Please enter the username to which you want to send your message.

'); - if(!isset($_POST['subject']) || ( isset($_POST['subject']) && $_POST['subject'] == '')) die_friendly('Sending of message failed', '

Please enter a subject for your message.

'); - if(!isset($_POST['message']) || ( isset($_POST['message']) && $_POST['message'] == '')) die_friendly('Sending of message failed', '

Please enter a message to send.

'); - $namelist = $_POST['to']; - $namelist = str_replace(', ', ',', $namelist); - $namelist = explode(',', $namelist); - foreach($namelist as $n) { $n = $db->escape($n); } - $subject = RenderMan::preprocess_text($_POST['subject']); - $message = RenderMan::preprocess_text($_POST['message']); - $base_query = 'UPDATE '.table_prefix.'privmsgs SET subject=\''.$subject.'\',message_to=\''.$namelist[0].'\',message_text=\''.$message.'\',folder_name=\'inbox\' WHERE message_id='.$id.';'; - $result = $db->sql_query($base_query); - $db->free_result(); - if(!$result) $db->_die('The message could not be sent.'); - else die_friendly('Message status', '

Your message has been sent. You may edit the message if you wish; one copy for each recipient will be in your outbox until each recipient has read it. Return to your inbox.

'); - return; - } elseif(isset($_POST['_savedraft'])) { + $errors = array(); + if(!isset($_POST['to']) || ( isset($_POST['to']) && $_POST['to'] == '')) + { + $errors[] = $lang->get('privmsgs_err_need_username'); + } + if(!isset($_POST['subject']) || ( isset($_POST['subject']) && $_POST['subject'] == '')) + { + $errors[] = $lang->get('privmsgs_err_need_subject'); + } + if(!isset($_POST['message']) || ( isset($_POST['message']) && $_POST['message'] == '')) + { + $errors[] = $lang->get('privmsgs_err_need_message'); + } + if ( count($errors) < 1 ) + { + $namelist = $_POST['to']; + $namelist = str_replace(', ', ',', $namelist); + $namelist = explode(',', $namelist); + foreach ($namelist as $n) + { + $n = $db->escape($n); + } + $subject = RenderMan::preprocess_text($_POST['subject']); + $message = RenderMan::preprocess_text($_POST['message']); + $base_query = 'UPDATE '.table_prefix.'privmsgs SET subject=\''.$subject.'\',message_to=\''.$namelist[0].'\',message_text=\''.$message.'\',folder_name=\'inbox\' WHERE message_id='.$id.';'; + $result = $db->sql_query($base_query); + $db->free_result(); + if ( !$result ) + { + $db->_die('The message could not be sent.'); + } + else + { + die_friendly($lang->get('privmsgs_msg_message_status'), '

' . $lang->get('privmsgs_msg_message_sent', array('inbox_link' => makeUrlNS('Special', 'PrivateMessages/Folder/Inbox'))) . '

'); + } + return; + } + } + else if ( isset($_POST['_savedraft']) ) + { // Check each POST DATA parameter... - if(!isset($_POST['to']) || ( isset($_POST['to']) && $_POST['to'] == '')) die_friendly('Sending of message failed', '

Please enter the username to which you want to send your message.

'); - if(!isset($_POST['subject']) || ( isset($_POST['subject']) && $_POST['subject'] == '')) die_friendly('Sending of message failed', '

Please enter a subject for your message.

'); - if(!isset($_POST['message']) || ( isset($_POST['message']) && $_POST['message'] == '')) die_friendly('Sending of message failed', '

Please enter a message to send.

'); - $namelist = $_POST['to']; - $namelist = str_replace(', ', ',', $namelist); - $namelist = explode(',', $namelist); - foreach($namelist as $n) { $n = $db->escape($n); } - $subject = $db->escape($_POST['subject']); - $message = RenderMan::preprocess_text($_POST['message']); - $base_query = 'UPDATE '.table_prefix.'privmsgs SET subject=\''.$subject.'\',message_to=\''.$namelist[0].'\',message_text=\''.$message.'\' WHERE message_id='.$id.';'; - $result = $db->sql_query($base_query); - $db->free_result(); - if(!$result) $db->_die('The message could not be saved.'); + $errors = array(); + if(!isset($_POST['to']) || ( isset($_POST['to']) && $_POST['to'] == '')) + { + $errors[] = $lang->get('privmsgs_err_need_username'); + } + if(!isset($_POST['subject']) || ( isset($_POST['subject']) && $_POST['subject'] == '')) + { + $errors[] = $lang->get('privmsgs_err_need_subject'); + } + if(!isset($_POST['message']) || ( isset($_POST['message']) && $_POST['message'] == '')) + { + $errors[] = $lang->get('privmsgs_err_need_message'); + } + if ( count($errors) < 1 ) + { + $namelist = $_POST['to']; + $namelist = str_replace(', ', ',', $namelist); + $namelist = explode(',', $namelist); + foreach ( $namelist as $n ) + { + $n = $db->escape($n); + } + $subject = $db->escape($_POST['subject']); + $message = RenderMan::preprocess_text($_POST['message']); + $base_query = 'UPDATE '.table_prefix.'privmsgs SET subject=\''.$subject.'\',message_to=\''.$namelist[0].'\',message_text=\''.$message.'\' WHERE message_id='.$id.';'; + $result = $db->sql_query($base_query); + $db->free_result(); + if ( !$result ) + { + $db->_die('The message could not be saved.'); + } + } } - if($argv[1]=='to' && $argv[2]) $to = $argv[2]; - else $to = ''; + if ( $argv[1]=='to' && $argv[2] ) + { + $to = htmlspecialchars($argv[2]); + } + else + { + $to = ''; + } $template->header(); userprefs_show_menu(); echo ''; + + if ( isset($_POST['_savedraft']) ) + { + echo '
' . $lang->get('privmsgs_msg_draft_saved') . '
'; + } ?>
- - - - - + + + + + + + + + + + + + + + + +
Edit draft
To:
Separate multiple names with a single comma
Subject:
Message:
get('privmsgs_lbl_edit_th'); ?>
+ get('privmsgs_lbl_compose_to'); ?>
+ get('privmsgs_lbl_compose_to_max', array('limit' => MAX_PMS_PER_BATCH)); ?> +
+ username_field('to', (isset($_POST['_savedraft'])) ? $_POST['to'] : $r['message_to'] ); ?> +
+ get('privmsgs_lbl_subject'); ?> + + +
+ get('privmsgs_lbl_message'); ?> + + tinymce_textarea('message', $content, 20, 40); + ?> +
+ + +
'; @@ -330,7 +527,10 @@ switch($argv[1]) { default: - echo '

The folder "'.$argv[1].'" does not exist. Return to your inbox.

'; + echo '

' . $lang->get('privmsgs_err_folder_not_exist', array( + 'folder_name' => htmlspecialchars($argv[1]), + 'inbox_url' => makeUrlNS('Special', 'PrivateMessages/Folder/Inbox') + )) . '

'; break; case 'Inbox': case 'Outbox': @@ -342,15 +542,15 @@ @@ -373,36 +573,88 @@ $q = $db->sql_query('SELECT p.message_id, p.message_from, p.message_to, p.date, p.subject, p.message_read FROM '.table_prefix.'privmsgs AS p WHERE p.folder_name=\''.$fname.'\' AND p.message_from=\''.$session->username.'\' ORDER BY date DESC;'); break; } - if($argv[1] == 'Drafts' || $argv[1] == 'Outbox') $act = 'Edit'; - else $act = 'View'; - if(!$q) $db->_die('The private message data could not be selected.'); - echo '
'; + if ( !$q ) + { + $db->_die('The private message data could not be selected.'); + } + if ( $argv[1] == 'Drafts' || $argv[1] == 'Outbox' ) + { + $act = 'Edit'; + } + else + { + $act = 'View'; + } + echo ' +
+
Folder: '.$argv[1].'
'; - if($fname == 'drafts' || $fname == 'Outbox') echo 'To'; else echo 'From'; - echo 'SubjectDateMark
+ + + + + + + + + '; if($db->numrows() < 1) - echo ''; - else { + { + echo ''; + } + else + { $cls = 'row2'; - while($r = $db->fetchrow()) + while ( $r = $db->fetchrow() ) { if($cls == 'row2') $cls='row1'; else $cls = 'row2'; $mto = str_replace(' ', '_', $r['message_to']); $mfr = str_replace(' ', '_', $r['message_from']); echo ''; } $db->free_result(); } - echo ''; + echo ' + + '; echo '
' . $lang->get('privmsgs_folder_th_foldername') . ' ' . $lang->get('privmsgs_folder_' . strtolower($argv[1])) . '
'; + if ( $fname == 'drafts' || $fname == 'Outbox' ) + { + echo $lang->get('privmsgs_folder_th_to'); + } + else + { + echo $lang->get('privmsgs_folder_th_from'); + } + echo '' . $lang->get('privmsgs_folder_th_subject') . '' . $lang->get('privmsgs_folder_th_date') . '' . $lang->get('privmsgs_folder_th_mark') . '
No messages in this folder.
' . $lang->get('privmsgs_msg_no_messages') . '
'; - if($fname == 'drafts' || $fname == 'outbox') echo $r['message_to']; else echo $r['message_from']; + if ( $fname == 'drafts' || $fname == 'outbox' ) + { + echo $r['message_to']; + } + else + { + echo $r['message_from']; + } + echo ''; - if($r['message_read'] == 0) echo ''; + + if ( $r['message_read'] == 0 ) + { + echo ''; + } echo $r['subject']; - if($r['message_read'] == 0) echo ''; + if ( $r['message_read'] == 0 ) + { + echo ''; + } echo ''.date('M j, Y G:i', $r['date']).'
+ + + + +

- New message + ' . $lang->get('privmsgs_btn_compose') . ' '; break; } diff -r 32429702305e -r c72b545f1304 plugins/SpecialAdmin.php --- a/plugins/SpecialAdmin.php Fri Dec 21 19:08:27 2007 -0500 +++ b/plugins/SpecialAdmin.php Wed Dec 26 00:37:26 2007 -0500 @@ -22,17 +22,17 @@ global $db, $session, $paths, $template, $plugins; // Common objects -$plugins->attachHook('base_classes_initted', ' +$plugins->attachHook('session_started', ' global $paths; $paths->add_page(Array( - \'name\'=>\'Administration\', + \'name\'=>\'specialpage_administration\', \'urlname\'=>\'Administration\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', )); $paths->add_page(Array( - \'name\'=>\'Manage the Sidebar\', + \'name\'=>\'specialpage_manage_sidebar\', \'urlname\'=>\'EditSidebar\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', diff -r 32429702305e -r c72b545f1304 plugins/SpecialCSS.php --- a/plugins/SpecialCSS.php Fri Dec 21 19:08:27 2007 -0500 +++ b/plugins/SpecialCSS.php Wed Dec 26 00:37:26 2007 -0500 @@ -22,10 +22,10 @@ global $db, $session, $paths, $template, $plugins; // Common objects -$plugins->attachHook('base_classes_initted', ' +$plugins->attachHook('session_started', ' global $paths; $paths->add_page(Array( - \'name\'=>\'CSS\', + \'name\'=>\'specialpage_css\', \'urlname\'=>\'CSS\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>0,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', diff -r 32429702305e -r c72b545f1304 plugins/SpecialGroups.php --- a/plugins/SpecialGroups.php Fri Dec 21 19:08:27 2007 -0500 +++ b/plugins/SpecialGroups.php Wed Dec 26 00:37:26 2007 -0500 @@ -20,10 +20,10 @@ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. */ -$plugins->attachHook('base_classes_initted', ' +$plugins->attachHook('session_started', ' global $paths; $paths->add_page(Array( - \'name\'=>\'Group Membership\', + \'name\'=>\'specialpage_groupcp\', \'urlname\'=>\'Usergroups\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', @@ -34,6 +34,7 @@ { global $db, $session, $paths, $template, $plugins; // Common objects global $email; // Import e-mail encryption functions + global $lang; if ( !$session->user_logged_in ) { @@ -43,6 +44,7 @@ } $template->header(); + userprefs_show_menu(); if ( isset($_POST['do_view']) || isset($_POST['do_view_n']) || ( isset($_GET['act']) && isset($_POST['group_id']) ) ) { $gid = ( isset ( $_POST['do_view_n'] ) ) ? intval($_POST['group_id_n']) : intval($_POST['group_id']); @@ -102,20 +104,20 @@ } $status = ( $is_member && $is_mod ) - ? 'You are a moderator of this group.' + ? $lang->get('groupcp_status_mod') : ( ( $is_member && !$is_mod ) - ? 'You are a member of this group.' - : 'You are not a member of this group.' + ? $lang->get('groupcp_status_member') + : $lang->get('groupcp_status_not_member') ); $can_do_admin_stuff = ( $is_mod || $session->user_level >= USER_LEVEL_ADMIN ); switch ( $row['group_type'] ) { - case GROUP_HIDDEN: $g_state = 'Hidden group'; break; - case GROUP_CLOSED: $g_state = 'Closed group'; break; - case GROUP_REQUEST: $g_state = 'Members can request to join'; break; - case GROUP_OPEN: $g_state = 'Anyone can join'; break; + case GROUP_HIDDEN: $g_state = $lang->get('groupcp_type_hidden'); break; + case GROUP_CLOSED: $g_state = $lang->get('groupcp_type_closed'); break; + case GROUP_REQUEST: $g_state = $lang->get('groupcp_type_request'); break; + case GROUP_OPEN: $g_state = $lang->get('groupcp_type_open'); break; } if ( isset($_GET['act']) && $can_do_admin_stuff ) @@ -139,7 +141,7 @@ $r = $db->fetchrow(); if ( $r['system_group'] == 1 && ( intval($_POST['group_state']) == GROUP_OPEN || intval($_POST['group_state']) == GROUP_REQUEST ) ) { - echo '
Because this is a system group, you can\'t make it open or allow membership requests.
'; + echo '
' . $lang->get('groupcp_err_state_system_group') . '
'; $error = true; } if ( !$error ) @@ -148,7 +150,7 @@ if (!$q) $db->_die('SpecialGroups.php, line ' . __LINE__); $row['group_type'] = $_POST['group_state']; - echo '
The group state was updated.
'; + echo '
' . $lang->get('groupcp_msg_state_updated') . '
'; } break; case 'adduser': @@ -160,7 +162,7 @@ $db->_die('SpecialGroups.php, line ' . __LINE__); if ($db->numrows() < 1) { - echo '
The username you entered could not be found.
'; + echo '
' . $lang->get('groupcp_err_user_not_found') . '
'; break; } $r = $db->fetchrow(); @@ -184,11 +186,11 @@ if ( $member['member_id'] == $r['member_id'] ) $members[$i]['is_mod'] = (int)$mod; } - echo '
The user "' . $username . '" is already in this group, so their moderator status was updated.
'; + echo '
' . $lang->get('groupcp_msg_user_already_in_mod_updated', array('username' => $username)) . '
'; } else { - echo '
The user "' . $username . '" is already in this group.
'; + echo '
' . $lang->get('groupcp_msg_user_already_in', array('username' => $username)) . '
'; } break; } @@ -198,7 +200,7 @@ $q = $db->sql_query('INSERT INTO '.table_prefix.'group_members(group_id,user_id,is_mod) VALUES(' . intval($_POST['group_id']) . ', ' . $uid . ', ' . $mod . ');'); if (!$q) $db->_die('SpecialGroups.php, line ' . __LINE__); - echo '
The user "' . $username . '" has been added to this usergroup.
'; + echo '
' . $lang->get('groupcp_msg_user_added', array('username' => $username)) . '
'; $q = $db->sql_query('SELECT u.username,u.email,u.reg_time,m.member_id,m.user_id,m.is_mod,COUNT(c.comment_id) AS num_comments FROM '.table_prefix.'users AS u @@ -255,17 +257,17 @@ } } } - echo '
Pending members status updated successfully.
'; + echo '
' . $lang->get('groupcp_msg_pending_updated') . '
'; break; } } - if ( isset($_GET['act']) && $_GET['act'] == 'update' && !$is_member && $row['group_type'] == GROUP_OPEN ) + if ( isset($_GET['act']) && $_GET['act'] == 'update' && !$is_member && $row['group_type'] == GROUP_OPEN && !$can_do_admin_stuff ) { $q = $db->sql_query('INSERT INTO '.table_prefix.'group_members(group_id,user_id) VALUES(' . $gid . ', ' . $session->user_id . ');'); if (!$q) $db->_die('SpecialGroups.php, line ' . __LINE__); - echo '
You have been added to this group.
'; + echo '
' . $lang->get('groupcp_msg_self_added') . '
'; $q = $db->sql_query('SELECT u.username,u.email,u.reg_time,m.member_id,m.user_id,m.is_mod,COUNT(c.comment_id) AS num_comments FROM '.table_prefix.'users AS u @@ -288,55 +290,60 @@ } - if ( isset($_GET['act']) && $_GET['act'] == 'update' && !$is_member && $row['group_type'] == GROUP_REQUEST && !$is_pending ) + if ( isset($_GET['act']) && $_GET['act'] == 'update' && !$is_member && $row['group_type'] == GROUP_REQUEST && !$is_pending && !$can_do_admin_stuff ) { $q = $db->sql_query('INSERT INTO '.table_prefix.'group_members(group_id,user_id,pending) VALUES(' . $gid . ', ' . $session->user_id . ', 1);'); if (!$q) $db->_die('SpecialGroups.php, line ' . __LINE__); - echo '
A request has been sent to the moderator(s) of this group to add you.
'; + echo '
' . $lang->get('groupcp_msg_membership_requested') . '
'; } $state_btns = ( $can_do_admin_stuff ) ? - ' - - - ' + ' + + + ' : $g_state; if ( !$can_do_admin_stuff && $row['group_type'] == GROUP_REQUEST && !$is_member ) { if ( $is_pending ) - $state_btns .= ' (Your request to join is awaiting approval)'; + $state_btns .= ' ' . $lang->get('groupcp_msg_status_pending'); else - $state_btns .= ' '; + $state_btns .= ' '; } if ( !$can_do_admin_stuff && $row['group_type'] == GROUP_OPEN && !$is_member ) { - $state_btns .= ' '; + $state_btns .= ' '; } + $g_name_local = 'groupcp_grp_' . strtolower($row['group_name']); + $str = $lang->get($g_name_local); + if ( $str != $g_name_local ) + $row['group_name'] = $str; + echo '
- + - - + + - + - + ' . ( ( $is_mod || $session->user_level >= USER_LEVEL_ADMIN ) ? ' ' : '' ) . ' @@ -348,15 +355,15 @@ { echo ' -

Pending memberships

+

' . $lang->get('groupcp_th_pending_memberships') . '

Group information' . $lang->get('groupcp_th_group_info') . '
Group name:' . $row['group_name'] . ( $row['system_group'] == 1 ? ' (system group)' : '' ) . '' . $lang->get('groupcp_lbl_group_name') . '' . $row['group_name'] . ( $row['system_group'] == 1 ? ' ' . $lang->get('groupcp_msg_system_group') : '' ) . '
Membership status:' . $lang->get('groupcp_lbl_status') . ' ' . $status . '
Group state:' . $lang->get('groupcp_lbl_state') . ' ' . $state_btns . '
- +
- - - - - + + + + + '; $cls = 'row2'; foreach ( $pending as $member ) @@ -378,26 +385,26 @@
With selected: - - + +
'; } echo ' -

Group members

+

' . $lang->get('groupcp_th_group_members') . '

UsernameE-mailRegisteredTotal commentsSelect' . $lang->get('groupcp_th_username') . '' . $lang->get('groupcp_th_email') . '' . $lang->get('groupcp_th_reg_time') . '' . $lang->get('groupcp_th_comments') . '' . $lang->get('groupcp_th_select') . '
- - - - - ' . ( ( $can_do_admin_stuff ) ? " - - " : '' ) . ' + + + + + ' . ( ( $can_do_admin_stuff ) ? ' + + ' : '' ) . ' - + '; $mod_printed = false; $mem_printed = false; @@ -425,8 +432,8 @@ "; } if (!$mod_printed) - echo ''; - echo ''; + echo ''; + echo ''; foreach ( $members as $member ) { if ( $member['is_mod'] == 1 ) @@ -449,12 +456,12 @@ "; } if (!$mem_printed) - echo ''; + echo ''; echo '
UsernameE-mailRegisteredTotal commentsRemove?' . $lang->get('groupcp_th_username') . '' . $lang->get('groupcp_th_email') . '' . $lang->get('groupcp_th_reg_time') . '' . $lang->get('groupcp_th_comments') . '' . $lang->get('groupcp_th_remove') . '
Group moderators' . $lang->get('groupcp_th_group_mods') . '
This group has no moderators.
Group members
' . $lang->get('groupcp_msg_no_mods') . '
' . $lang->get('groupcp_th_group_members') . '
This group has no members.
' . $lang->get('groupcp_msg_no_members') . '
'; if ( $can_do_admin_stuff ) { - echo "
"; + echo "
get('groupcp_btn_remove_selected') . "\" />
"; } echo ' '; @@ -464,17 +471,17 @@
- + - + - +
Add a new member to this group' . $lang->get('groupcp_th_add_member') . '
Username:' . $template->username_field('add_username') . '' . $lang->get('groupcp_lbl_username') . '' . $template->username_field('add_username') . '
Group moderator:' . $lang->get('groupcp_lbl_moderator') . '
- +
@@ -489,11 +496,11 @@ echo '
- + '; diff -r 32429702305e -r c72b545f1304 plugins/SpecialPageFuncs.php --- a/plugins/SpecialPageFuncs.php Fri Dec 21 19:08:27 2007 -0500 +++ b/plugins/SpecialPageFuncs.php Wed Dec 26 00:37:26 2007 -0500 @@ -22,45 +22,45 @@ global $db, $session, $paths, $template, $plugins; // Common objects -$plugins->attachHook('base_classes_initted', ' +$plugins->attachHook('session_started', ' global $paths; $paths->add_page(Array( - \'name\'=>\'Create page\', + \'name\'=>\'specialpage_create_page\', \'urlname\'=>\'CreatePage\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', )); $paths->add_page(Array( - \'name\'=>\'All pages\', + \'name\'=>\'specialpage_all_pages\', \'urlname\'=>\'AllPages\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', )); $paths->add_page(Array( - \'name\'=>\'List of special pages\', + \'name\'=>\'specialpage_special_pages\', \'urlname\'=>\'SpecialPages\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', )); $paths->add_page(Array( - \'name\'=>\'About Enano\', + \'name\'=>\'specialpage_about_enano\', \'urlname\'=>\'About_Enano\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', )); $paths->add_page(Array( - \'name\'=>\'GNU General Public License\', + \'name\'=>\'specialpage_gnu_gpl\', \'urlname\'=>\'GNU_General_Public_License\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', )); $paths->add_page(Array( - \'name\'=>\'Tag cloud\', + \'name\'=>\'specialpage_tag_cloud\', \'urlname\'=>\'TagCloud\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', diff -r 32429702305e -r c72b545f1304 plugins/SpecialSearch.php --- a/plugins/SpecialSearch.php Fri Dec 21 19:08:27 2007 -0500 +++ b/plugins/SpecialSearch.php Wed Dec 26 00:37:26 2007 -0500 @@ -20,17 +20,17 @@ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. */ -$plugins->attachHook('base_classes_initted', ' +$plugins->attachHook('session_started', ' global $paths; $paths->add_page(Array( - \'name\'=>\'Rebuild search index\', + \'name\'=>\'specialpage_search_rebuild\', \'urlname\'=>\'SearchRebuild\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', )); $paths->add_page(Array( - \'name\'=>\'Search\', + \'name\'=>\'specialpage_search\', \'urlname\'=>\'Search\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', @@ -40,7 +40,10 @@ function page_Special_SearchRebuild() { global $db, $session, $paths, $template, $plugins; // Common objects - if(!$session->get_permissions('mod_misc')) die_friendly('Unauthorized', '

You need to be an administrator to rebuild the search index

'); + if ( !$session->get_permissions('mod_misc') ) + { + die_friendly('Unauthorized', '

You need to be an administrator to rebuild the search index

'); + } $template->header(); @set_time_limit(0); if($paths->rebuild_search_index(true)) @@ -54,6 +57,8 @@ { global $db, $session, $paths, $template, $plugins; // Common objects global $aggressive_optimize_html; + global $lang; + $aggressive_optimize_html = false; if ( !$q = $paths->getParam(0) ) @@ -95,7 +100,7 @@ $qin = ( isset($q) ) ? str_replace('"', '\"', htmlspecialchars($q)) : ''; $search_form = ' -   Advanced search +   ' . $lang->get('search_btn_advanced_search') . ' ' . ( $session->auth_level > USER_LEVEL_MEMBER ? '' : '' ) . ' '; @@ -103,7 +108,7 @@ { $search_start = microtime_float(); - $results = perform_search($q, $warn, ( isset($_GET['match_case']) )); + $results = perform_search($q, $warn, ( isset($_GET['match_case']) ), $word_list); $warn = array_unique($warn); if ( file_exists( ENANO_ROOT . '/themes/' . $template->theme . '/search-result.tpl' ) ) @@ -122,7 +127,7 @@ {PAGE_TEXT} {PAGE_URL} - {PAGE_LENGTH} {PAGE_LENGTH_UNIT} - - Relevance: {RELEVANCE_SCORE}% + {lang:search_lbl_relevance} {RELEVANCE_SCORE}%

@@ -138,22 +143,25 @@ if ( !empty($result['page_text']) ) $result['page_text'] .= '
'; $result['page_name'] = str_replace(array('', ''), array('', ''), $result['page_name']); + $result['url_highlight'] = str_replace(array('', ''), array('', ''), $result['url_highlight']); if ( $result['page_length'] >= 1048576 ) { $result['page_length'] = round($result['page_length'] / 1048576, 1); - $length_unit = 'MB'; + $length_unit = $lang->get('etc_unit_megabytes_short'); } else if ( $result['page_length'] >= 1024 ) { $result['page_length'] = round($result['page_length'] / 1024, 1); - $length_unit = 'KB'; + $length_unit = $lang->get('etc_unit_kilobytes_short'); } else { - $length_unit = 'bytes'; + $length_unit = $lang->get('etc_unit_bytes'); } - $url = makeUrlComplete($result['namespace'], $result['page_id']); - $url = preg_replace('/\?.+$/', '', $url); + //$url = makeUrlComplete($result['namespace'], $result['page_id']); + //$url = preg_replace('/\?.+$/', '', $url); + $url = $result['url_highlight']; + $parser->assign_vars(array( 'PAGE_TITLE' => $result['page_name'], 'PAGE_TEXT' => $result['page_text'], @@ -193,13 +201,20 @@ $q_trim = ( strlen($q) > 30 ) ? substr($q, 0, 27) . '...' : $q; $q_trim = htmlspecialchars($q_trim); - $result_string = ( count($results) > 0 ) ? "Results $start_string - $per_string of about $num_results for " . $q_trim . " in {$search_time}s." : 'No results.'; + $result_detail = $lang->get('search_msg_result_detail', array( + 'start_string' => $start_string, + 'per_string' => $per_string, + 'q_trim' => $q_trim, + 'num_results' => $num_results, + 'search_time' => $search_time + )); + $result_string = ( count($results) > 0 ) ? $result_detail : $lang->get('search_msg_no_results'); echo '
' . $result_string . '
- Site search + ' . $lang->get('search_lbl_site_search') . '
' . $search_form . ' @@ -208,8 +223,8 @@ if ( count($warn) > 0 ) { echo '
'; - echo 'Some problems were encountered during your search.
- There was a problem with your search query, and as a result there may be a reduced number of search results.'; + echo '' . $lang->get('search_err_query_title') . '
+ ' . $lang->get('search_err_query_body'); echo '
  • ' . implode('
  • ', $warn) . '
'; echo '
'; } @@ -254,26 +269,26 @@ endif; ?>
Group membership details' . $lang->get('groupcp_th_select_group') . '
- Current group memberships: + ' . $lang->get('groupcp_lbl_current_memberships') . ' '; $taboo = Array('Everyone'); @@ -505,11 +512,15 @@ $taboo[] = $group; if ( $group != 'Everyone' ) { + $g_name_local = 'groupcp_grp_' . strtolower($group); + $str = $lang->get($g_name_local); + if ( $str != $g_name_local ) + $group = $str; echo ''; } } echo ' - '; + '; } else { @@ -530,7 +541,7 @@ { echo '
- Non-memberships: + ' . $lang->get('groupcp_lbl_non_memberships') . ' - +
- + - + - + - + - +
Advanced Search
get('search_th_advanced_search'); ?>
Search for pages with any of these words:get('search_lbl_field_any'); ?>
with this exact phrase:get('search_lbl_field_exact'); ?>
with none of these words:get('search_lbl_field_none'); ?>
with all of these words:get('search_lbl_field_all'); ?>
- + @@ -281,7 +296,7 @@
- +
diff -r 32429702305e -r c72b545f1304 plugins/SpecialUpdownload.php --- a/plugins/SpecialUpdownload.php Fri Dec 21 19:08:27 2007 -0500 +++ b/plugins/SpecialUpdownload.php Wed Dec 26 00:37:26 2007 -0500 @@ -23,17 +23,17 @@ global $db, $session, $paths, $template, $plugins; // Common objects -$plugins->attachHook('base_classes_initted', ' +$plugins->attachHook('session_started', ' global $paths; $paths->add_page(Array( - \'name\'=>\'Upload file\', + \'name\'=>\'specialpage_upload_file\', \'urlname\'=>\'UploadFile\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', )); $paths->add_page(Array( - \'name\'=>\'Download file\', + \'name\'=>\'download_file\', \'urlname\'=>\'DownloadFile\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', diff -r 32429702305e -r c72b545f1304 plugins/SpecialUserFuncs.php --- a/plugins/SpecialUserFuncs.php Fri Dec 21 19:08:27 2007 -0500 +++ b/plugins/SpecialUserFuncs.php Wed Dec 26 00:37:26 2007 -0500 @@ -22,77 +22,77 @@ global $db, $session, $paths, $template, $plugins; // Common objects -$plugins->attachHook('base_classes_initted', ' +$plugins->attachHook('session_started', ' global $paths; $paths->add_page(Array( - \'name\'=>\'Log in\', + \'name\'=>\'specialpage_log_in\', \'urlname\'=>\'Login\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', )); $paths->add_page(Array( - \'name\'=>\'Log out\', + \'name\'=>\'specialpage_log_out\', \'urlname\'=>\'Logout\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', )); $paths->add_page(Array( - \'name\'=>\'Register\', + \'name\'=>\'specialpage_register\', \'urlname\'=>\'Register\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', )); $paths->add_page(Array( - \'name\'=>\'Edit Profile\', + \'name\'=>\'specialpage_preferences\', \'urlname\'=>\'Preferences\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', )); $paths->add_page(Array( - \'name\'=>\'Contributions\', + \'name\'=>\'specialpage_contributions\', \'urlname\'=>\'Contributions\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', )); $paths->add_page(Array( - \'name\'=>\'Change style\', + \'name\'=>\'specialpage_change_theme\', \'urlname\'=>\'ChangeStyle\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', )); $paths->add_page(Array( - \'name\'=>\'Activate user account\', + \'name\'=>\'specialpage_activate_account\', \'urlname\'=>\'ActivateAccount\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', )); $paths->add_page(Array( - \'name\'=>\'Captcha\', + \'name\'=>\'specialpage_captcha\', \'urlname\'=>\'Captcha\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', )); $paths->add_page(Array( - \'name\'=>\'Forgot password\', + \'name\'=>\'specialpage_password_reset\', \'urlname\'=>\'PasswordReset\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', )); $paths->add_page(Array( - \'name\'=>\'Member list\', + \'name\'=>\'specialpage_member_list\', \'urlname\'=>\'Memberlist\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', )); $paths->add_page(Array( - \'name\'=>\'Language exporter\', + \'name\'=>\'specialpage_language_export\', \'urlname\'=>\'LangExportJSON\', \'namespace\'=>\'Special\', \'special\'=>0,\'visible\'=>0,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', @@ -168,8 +168,7 @@ unset($x, $y); } - $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); - $response = $json->encode($response); + $response = enano_json_encode($response); echo $response; return null; } @@ -369,8 +368,7 @@ if ( isset($_GET['act']) && $_GET['act'] == 'ajaxlogin' ) { $plugins->attachHook('login_password_reset', 'SpecialLogin_SendResponse_PasswordReset($row[\'user_id\'], $row[\'temp_password\']);'); - $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); - $data = $json->decode($_POST['params']); + $data = enano_json_decode($_POST['params']); $captcha_hash = ( isset($data['captcha_hash']) ) ? $data['captcha_hash'] : false; $captcha_code = ( isset($data['captcha_code']) ) ? $data['captcha_code'] : false; $level = ( isset($data['level']) ) ? intval($data['level']) : USER_LEVEL_MEMBER; @@ -397,7 +395,7 @@ 'captcha' => $captcha ); } - $response = $json->encode($response); + $response = enano_json_encode($response); echo $response; $db->close(); exit; @@ -445,7 +443,6 @@ function SpecialLogin_SendResponse_PasswordReset($user_id, $passkey) { - $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); $response = Array( 'result' => 'success_reset', @@ -453,7 +450,7 @@ 'temppass' => $passkey ); - $response = $json->encode($response); + $response = enano_json_encode($response); echo $response; $db->close(); @@ -1722,7 +1719,6 @@ else $lang_local = new Language($lang_id); - $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); $timestamp = date('D, j M Y H:i:s T', $lang_local->lang_timestamp); header("Last-Modified: $timestamp"); @@ -1733,7 +1729,7 @@ echo "if ( typeof(enano_lang) != 'object' ) var enano_lang = new Object(); -enano_lang[{$lang->lang_id}] = " . $json->encode($lang_local->strings) . ";"; +enano_lang[{$lang->lang_id}] = " . enano_json_encode($lang_local->strings) . ";"; } diff -r 32429702305e -r c72b545f1304 plugins/SpecialUserPrefs.php --- a/plugins/SpecialUserPrefs.php Fri Dec 21 19:08:27 2007 -0500 +++ b/plugins/SpecialUserPrefs.php Wed Dec 26 00:37:26 2007 -0500 @@ -103,6 +103,7 @@ userprefs_menu_add('Profile/membership', 'Edit e-mail address and password', makeUrlNS('Special', 'Preferences/EmailPassword') . '" onclick="ajaxLoginNavTo(\'Special\', \'Preferences/EmailPassword\', '.USER_LEVEL_CHPREF.'); return false;'); userprefs_menu_add('Profile/membership', 'Edit signature', makeUrlNS('Special', 'Preferences/Signature')); userprefs_menu_add('Profile/membership', 'Edit public profile', makeUrlNS('Special', 'Preferences/Profile')); + userprefs_menu_add('Profile/membership', 'Group memberships', makeUrlNS('Special', 'Usergroups')); if ( getConfig('avatar_enable') == '1' ) { userprefs_menu_add('Profile/membership', 'Avatar settings', makeUrlNS('Special', 'Preferences/Avatar')); @@ -112,6 +113,14 @@ userprefs_menu_add('Private messages', 'Sent items', makeUrlNS('Special', 'PrivateMessages/Folder/Sent')); userprefs_menu_add('Private messages', 'Drafts', makeUrlNS('Special', 'PrivateMessages/Folder/Drafts')); userprefs_menu_add('Private messages', 'Archive', makeUrlNS('Special', 'PrivateMessages/Folder/Archive')); + /* + userprefs_menu_add('Private messages', 'Inbox', makeUrlNS('Special', 'Private_Messages#folder:inbox')); + userprefs_menu_add('Private messages', 'Starred', makeUrlNS('Special', 'Private_Messages#folder:starred')); + userprefs_menu_add('Private messages', 'Sent items', makeUrlNS('Special', 'Private_Messages#folder:sent')); + userprefs_menu_add('Private messages', 'Drafts', makeUrlNS('Special', 'Private_Messages#folder:drafts')); + userprefs_menu_add('Private messages', 'Archive', makeUrlNS('Special', 'Private_Messages#folder:archive')); + userprefs_menu_add('Private messages', 'Trash', makeUrlNS('Special', 'Private_Messages#folder:trash')); + */ $userprefs_menu_links['Profile/membership'] = makeUrlNS('Special', 'Preferences'); $userprefs_menu_links['Private messages'] = makeUrlNS('Special', 'PrivateMessages'); @@ -123,7 +132,7 @@ } } -$plugins->attachHook('session_started', 'userprefs_menu_init();'); +$plugins->attachHook('common_post', 'userprefs_menu_init();'); function page_Special_Preferences() { diff -r 32429702305e -r c72b545f1304 plugins/admin/PageGroups.php --- a/plugins/admin/PageGroups.php Fri Dec 21 19:08:27 2007 -0500 +++ b/plugins/admin/PageGroups.php Wed Dec 26 00:37:26 2007 -0500 @@ -481,7 +481,6 @@ if ( isset($_POST['action']['edit']['add_page']) && isset($_GET['src']) && $_GET['src'] == 'ajax' ) { - $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); $return = array('successful' => false); // @@ -493,7 +492,7 @@ if ( !$edit_id ) { $return = array('mode' => 'error', 'text' => 'Hack attempt'); - echo $json->encode($return); + echo enano_json_encode($return); return; } @@ -502,7 +501,7 @@ if ( empty($page) ) { $return = array('mode' => 'error', 'text' => 'Please enter a page title.'); - echo $json->encode($return); + echo enano_json_encode($return); return; } @@ -511,7 +510,7 @@ if ( !isPage($page) ) { $return = array('mode' => 'error', 'text' => 'The page you are trying to add (' . htmlspecialchars($page) . ') does not exist.'); - echo $json->encode($return); + echo enano_json_encode($return); return; } */ @@ -522,7 +521,7 @@ if ( !isset($paths->namespace[$namespace]) ) { $return = array('mode' => 'error', 'text' => 'Invalid namespace return from RenderMan::strToPageID()'); - echo $json->encode($return); + echo enano_json_encode($return); return; } @@ -530,13 +529,13 @@ if ( !$q ) { $return = array('mode' => 'error', 'text' => $db->get_error()); - echo $json->encode($return); + echo enano_json_encode($return); return; } if ( $db->numrows() > 0 ) { $return = array('mode' => 'error', 'text' => 'The page you are trying to add is already in this group.'); - echo $json->encode($return); + echo enano_json_encode($return); return; } @@ -544,7 +543,7 @@ if ( !$q ) { $return = array('mode' => 'error', 'text' => $db->get_error()); - echo $json->encode($return); + echo enano_json_encode($return); return; } @@ -552,7 +551,7 @@ $return = array('mode' => 'info', 'text' => 'The page has been added to the specified group.', 'successful' => true, 'title' => $title, 'member_id' => $db->insert_id()); - echo $json->encode($return); + echo enano_json_encode($return); return; } diff -r 32429702305e -r c72b545f1304 themes/oxygen/css/bleu.css --- a/themes/oxygen/css/bleu.css Fri Dec 21 19:08:27 2007 -0500 +++ b/themes/oxygen/css/bleu.css Wed Dec 26 00:37:26 2007 -0500 @@ -251,6 +251,12 @@ filter: alpha(opacity=50); } +input[type ^="button"][disabled ^="disabled"], input[type ^="submit"][disabled ^="disabled"], button[disabled ^="disabled"], .btn-disabled { + color: #808080 !important; + background-image: none !important; + background-color: #e0e0e0 !important; +} + /* JWS window theming */ div.jswindow { border: 2px solid #7090B0; border-top: 5px solid #7090B0; padding: 0px; font-family: Trebuchet MS, tahoma, verdana, arial, sans-serif; font-size: 9pt; display: none; position: absolute; background-color: #FFFFFF; } div.titlebar { background-color: #7090B0; color: #FFFFFF; font-family: Trebuchet MS, tahoma, verdana, arial, sans-serif; font-size: 9pt; padding-bottom: 4px; cursor: default; }