diff --git a/.gitignore b/.gitignore index 131f98b0d48..176c075ede6 100644 --- a/.gitignore +++ b/.gitignore @@ -47,4 +47,4 @@ addons/shared_addons/plugins/* !addons/shared_addons/field_types addons/shared_addons/field_types/* !addons/shared_addons/field_types/index.html -system/cms/config/config.php +system/cms/config/config.php \ No newline at end of file diff --git a/installer/language/italian/complete_lang.php b/installer/language/italian/complete_lang.php index b0377fa4451..1164d5f32f9 100644 --- a/installer/language/italian/complete_lang.php +++ b/installer/language/italian/complete_lang.php @@ -5,7 +5,7 @@ $lang['intro_text'] = 'PyroCMS è stato installato ed è pronot! Per favore entra nel pannello di controllo con i seguenti parametri.'; $lang['email'] = 'E-mail'; $lang['password'] = 'Password'; -$lang['show_password'] = 'Show Password?'; #translate +$lang['show_password'] = 'Mostrare password?'; $lang['outro_text'] = 'Ed infine, elimina la cartella installer dal tuo server perchè se lasciata al suo posto può permettere l\'hackeraggio del tuo sito.'; $lang['go_website'] = 'Vai al sito'; diff --git a/installer/language/italian/global_lang.php b/installer/language/italian/global_lang.php index 714edd2381d..e1e3d1b66c4 100644 --- a/installer/language/italian/global_lang.php +++ b/installer/language/italian/global_lang.php @@ -7,5 +7,5 @@ $lang['step4'] = 'Passo #4'; $lang['final'] = 'Passo Finale'; -$lang['installer.passwords_match'] = "Passwords Match."; #translate -$lang['installer.passwords_dont_match'] = "Passwords Don\'t Match."; #translate \ No newline at end of file +$lang['installer.passwords_match'] = "Le password coincidono."; +$lang['installer.passwords_dont_match'] = "Le password non coincidono."; \ No newline at end of file diff --git a/installer/language/italian/index_lang.php b/installer/language/italian/index_lang.php index 5972a851ffe..4d3d0868ae4 100644 --- a/installer/language/italian/index_lang.php +++ b/installer/language/italian/index_lang.php @@ -5,3 +5,4 @@ $lang['text'] = 'Installare PyroCMS è molto semplice, segui i passaggi ed i messaggi a schermo. In caso di problemi nell\'installazione del sistema non preoccuparti, ti verrà spiegato cosa fare.'; $lang['step1'] = 'Passo 1'; $lang['link'] = 'Vai al primo passo'; + \ No newline at end of file diff --git a/installer/language/italian/step_1_lang.php b/installer/language/italian/step_1_lang.php index 3c7fa3fb6cf..4370e930048 100644 --- a/installer/language/italian/step_1_lang.php +++ b/installer/language/italian/step_1_lang.php @@ -6,7 +6,7 @@ $lang['db_settings'] = 'Impostazioni del Database'; $lang['db_text'] = 'Per verificare la versione del tuo server MySQL devi inserire hostname, username e password nel modulo sottostante. Questi parametri saranno inoltre usati per installare il database.'; -$lang['db_missing'] = 'The mysql database driver for PHP were not found, installation cannot continue. Ask your host or server administrator to install it.'; #translate +$lang['db_missing'] = 'I driver PHP per il database MySQL non sono stati trovati, non è possibile continuare con l\'installazione. Chiedi all\'amminsitratore del tuo server o al tuo hosting di installarli.'; $lang['server'] = 'Server'; $lang['username'] = 'Username'; @@ -14,9 +14,9 @@ $lang['portnr'] = 'Porta'; $lang['server_settings']= 'Impostazioni Server'; $lang['httpserver'] = 'HTTP Server'; -$lang['httpserver_text']= 'PyroCMS requires a HTTP Server to display dynamic content when a user goes to your website. It looks like you already have one by the fact that you can see this page, but if know exactly which type then PyroCMS can configure itself even better. If you do not know what any of this means just ignore it and carry on with the installation.'; #translate -$lang['rewrite_fail'] = 'You have selected "(Apache with mod_rewrite)" but we are unable to tell if mod_rewrite is enabled on your server. Ask your host if mod_rewrite is enabled or simply install at your own risk.'; -$lang['mod_rewrite'] = 'You have selected "(Apache with mod_rewrite)" but your server does not have the rewrite module enabled. Ask your host to enable it or install PyroCMS using the "Apache (without mod_rewrite)" option.'; +$lang['httpserver_text']= 'PyroCMS richiede un Server HTTP per mostrare il contenuto dinamico quando un utente visita il tuo sito. Sembra che ne possiedi già uno, infatti puoi vedere questa pagina, ma se sai esattamente quale PyroCMS puà configurarsi automaticamente al meglio. Se non sai quale è o non sai cosa tutto questo vuol dire ignora semplicemente il messaggio e vai avanti con l\'installazione.'; +$lang['rewrite_fail'] = 'Hai selezionato "(Apache con mod_rewrite)" ma non siamo in grado di assicurarti che il mod_rewrite sia abilitato sul tuo server. Prova a chiedere al tuo hosting se il mod_rewrite è abilitato o prova ad installarlo a tuo rischio.'; +$lang['mod_rewrite'] = 'Hai selezionato "(Apache con mod_rewrite)" ma il tuo server non ha il modulo abilitato. Chiedi al tuo hosting di abilitarlo o installa PyroCMS utilizzando l\'opzione "(Apache senza mod_rewrite)".'; $lang['step2'] = 'Passo 2'; // messages diff --git a/installer/language/italian/step_4_lang.php b/installer/language/italian/step_4_lang.php index ded435b358a..6a480bc08b4 100644 --- a/installer/language/italian/step_4_lang.php +++ b/installer/language/italian/step_4_lang.php @@ -2,15 +2,15 @@ // labels $lang['header'] = 'Passo 4: Crea il Database'; -$lang['intro_text'] = 'Complete the form below and hit the button labelled "Install" to install PyroCMS. Be sure to install PyroCMS into the right database since all existing changes will be lost!'; +$lang['intro_text'] = 'Completa i campi seguenti e clicca sul pulsante "Installa" per installare PyroCMS. Assicurati di installare PyroCMS nel database corretto perchè tutte le modifiche esistenti saranno perse!'; $lang['db_settings'] = 'Impstazioni Database'; $lang['db_create'] = 'Crea il Database'; $lang['db_notice'] = 'Potrebbe essere necessario farlo da soli'; $lang['default_user'] = 'Utente di Default'; $lang['database'] = 'Database'; -$lang['site_settings'] = 'Site Settings'; #translate -$lang['site_ref'] = 'Site Ref'; #translate +$lang['site_settings'] = 'Impostazioni Sito'; +$lang['site_ref'] = 'Site Ref'; $lang['user_name'] = 'Username'; $lang['first_name'] = 'Nome'; $lang['last_name'] = 'Cognome'; @@ -19,7 +19,7 @@ $lang['conf_password'] = 'Conferma Password'; $lang['finish'] = 'Installa'; -$lang['invalid_db_name'] = 'The database name you entered is invalid. Please use only alphanumeric characters and underscores.'; #translate +$lang['invalid_db_name'] = 'Il nome del database che hai inserito non è valido. Per favore usa solo caratteri alfanumerici e underscores (trattini bassi).'; $lang['error_101'] = 'Il database non è stato trovato. Se hai chiesto all\' installer di crearlo, il problema potrebbero essere i permessi non corretti.'; $lang['error_102'] = 'L\' installer non può aggiungere nessuna tabella al database.'; $lang['error_103'] = 'L\' installer non può inserire dati nel database.'; diff --git a/system/cms/config/constants.php b/system/cms/config/constants.php index ef4a2b5b521..c7027842928 100644 --- a/system/cms/config/constants.php +++ b/system/cms/config/constants.php @@ -85,7 +85,7 @@ | */ -define('CMS_VERSION', '2.2.0-dev'); +define('CMS_VERSION', '2.1.3-dev'); /* |-------------------------------------------------------------------------- diff --git a/system/cms/controllers/admin.php b/system/cms/controllers/admin.php index 7d024201d81..92b29593b9b 100644 --- a/system/cms/controllers/admin.php +++ b/system/cms/controllers/admin.php @@ -92,6 +92,8 @@ public function _check_login($email) { if ($this->ion_auth->login($email, $this->input->post('password'), (bool)$this->input->post('remember'))) { + Events::trigger('post_admin_login'); + return true; } diff --git a/system/cms/core/MY_Exceptions.php b/system/cms/core/MY_Exceptions.php index 50fb0ad90cd..8bce1f53161 100644 --- a/system/cms/core/MY_Exceptions.php +++ b/system/cms/core/MY_Exceptions.php @@ -24,7 +24,7 @@ function show_404($page = '', $log_error = TRUE) // Set the HTTP Status header set_status_header(404); - echo Modules::run('pages/_remap', '404'); + Modules::run('pages/_remap', '404'); } } \ No newline at end of file diff --git a/system/cms/core/REST_Controller.php b/system/cms/core/REST_Controller.php index 1aea761c4bc..011c90d212d 100644 --- a/system/cms/core/REST_Controller.php +++ b/system/cms/core/REST_Controller.php @@ -1,20 +1,24 @@ 'application/xml', - 'rawxml' => 'application/xml', 'json' => 'application/json', 'jsonp' => 'application/javascript', 'serialized' => 'application/vnd.php.serialized', @@ -112,7 +129,7 @@ class REST_Controller extends MY_Controller */ protected function early_checks() { - + } /** @@ -123,16 +140,26 @@ public function __construct() { parent::__construct(); + $this->_zlib_oc = @ini_get('zlib.output_compression'); + // Lets grab the config and get ready to party $this->load->config('rest'); // How is this request being made? POST, DELETE, GET, PUT? + $this->request = new stdClass(); $this->request->method = $this->_detect_method(); + // Create argument container, if nonexistent + if ( ! isset($this->{'_'.$this->request->method.'_args'})) + { + $this->{'_'.$this->request->method.'_args'} = array(); + } + // Set up our GET variables $this->_get_args = array_merge($this->_get_args, $this->uri->ruri_to_assoc()); //$this->load->library('security'); + // This library is bundled with REST_Controller 2.5+, but will eventually be part of CodeIgniter itself $this->load->library('format'); @@ -142,53 +169,21 @@ public function __construct() // Some Methods cant have a body $this->request->body = NULL; - switch ($this->request->method) - { - case 'get': - // Grab proper GET variables - parse_str(parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY), $get); - - // Merge both the URI segements and GET params - $this->_get_args = array_merge($this->_get_args, $get); - break; - - case 'post': - $this->_post_args = $_POST; - - $this->request->format and $this->request->body = file_get_contents('php://input'); - break; - - case 'put': - // It might be a HTTP body - if ($this->request->format) - { - $this->request->body = file_get_contents('php://input'); - } - - // If no file type is provided, this is probably just arguments - else - { - parse_str(file_get_contents('php://input'), $this->_put_args); - } - - break; - - case 'delete': - // Set up out DELETE variables (which shouldn't really exist, but sssh!) - parse_str(file_get_contents('php://input'), $this->_delete_args); - break; - } + $this->{'_parse_' . $this->request->method}(); // Now we know all about our request, let's try and parse the body if it exists if ($this->request->format and $this->request->body) { $this->request->body = $this->format->factory($this->request->body, $this->request->format)->to_array(); + // Assign payload arguments to proper method container + $this->{'_'.$this->request->method.'_args'} = $this->request->body; } // Merge both for one mega-args variable - $this->_args = array_merge($this->_get_args, $this->_put_args, $this->_post_args, $this->_delete_args); + $this->_args = array_merge($this->_get_args, $this->_put_args, $this->_post_args, $this->_delete_args, $this->{'_'.$this->request->method.'_args'}); // Which format should the data be returned in? + $this->response = new stdClass(); $this->response->format = $this->_detect_output_format(); // Which format should the data be returned in? @@ -217,6 +212,7 @@ public function __construct() } } + $this->rest = new StdClass(); // Load DB if its enabled if (config_item('rest_database_group') AND (config_item('rest_enable_keys') OR config_item('rest_enable_logging'))) { @@ -236,7 +232,7 @@ public function __construct() } // only allow ajax requests - if (!$this->input->is_ajax_request() AND config_item('rest_ajax_only')) + if ( ! $this->input->is_ajax_request() AND config_item('rest_ajax_only')) { $this->response(array('status' => false, 'error' => 'Only AJAX requests are accepted.'), 505); } @@ -245,8 +241,8 @@ public function __construct() /** * Remap * - * Requests are not made to methods directly, the request will be for - * an "object". This simply maps the object and method to the correct + * Requests are not made to methods directly, the request will be for + * an "object". This simply maps the object and method to the correct * Controller method. * * @param string $object_called @@ -280,7 +276,7 @@ public function _remap($object_called, $arguments) } // Sure it exists, but can they do anything with it? - if (!method_exists($this, $controller_method)) + if ( ! method_exists($this, $controller_method)) { $this->response(array('status' => false, 'error' => 'Unknown method.'), 404); } @@ -317,7 +313,20 @@ public function _remap($object_called, $arguments) } // And...... GO! - call_user_func_array(array($this, $controller_method), $arguments); + $this->_fire_method(array($this, $controller_method), $arguments); + } + + /** + * Fire Method + * + * Fires the designated controller method with the given arguments. + * + * @param array $method The controller method to fire + * @param array $args The arguments to pass to the controller method + */ + protected function _fire_method($method, $args) + { + call_user_func_array($method, $args); } /** @@ -326,22 +335,36 @@ public function _remap($object_called, $arguments) * Takes pure data and optionally a status code, then creates the response. * * @param array $data - * @param null|int $http_code + * @param null|int $http_code */ public function response($data = array(), $http_code = null) { + global $CFG; + // If data is empty and not code provide, error and bail if (empty($data) && $http_code === null) { $http_code = 404; - //create the output variable here in the case of $this->response(array()); - $output = $data; + // create the output variable here in the case of $this->response(array()); + $output = NULL; } // Otherwise (if no data but 200 provided) or some data, carry on camping! else { + // Is compression requested? + if ($CFG->item('compress_output') === TRUE && $this->_zlib_oc == FALSE) + { + if (extension_loaded('zlib')) + { + if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) AND strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE) + { + ob_start('ob_gzhandler'); + } + } + } + is_numeric($http_code) OR $http_code = 200; // If the format method exists, call and return the output in that format @@ -369,19 +392,25 @@ public function response($data = array(), $http_code = null) } } - header('HTTP/1.1: '.$http_code); - header('Status: '.$http_code); - header('Content-Length: '.strlen($output)); + header('HTTP/1.1: ' . $http_code); + header('Status: ' . $http_code); + + // If zlib.output_compression is enabled it will compress the output, + // but it will not modify the content-length header to compensate for + // the reduction, causing the browser to hang waiting for more data. + // We'll just skip content-length in those cases. + if ( ! $this->_zlib_oc && ! $CFG->item('compress_output')) + { + header('Content-Length: ' . strlen($output)); + } exit($output); } - /** + /* * Detect input format * * Detect which format the HTTP Body is provided in - * - * @return null|string */ protected function _detect_input_format() { @@ -409,8 +438,8 @@ protected function _detect_input_format() * Detect format * * Detect which format should be used to output the data. - * - * @return string The output format. + * + * @return string The output format. */ protected function _detect_output_format() { @@ -460,13 +489,13 @@ protected function _detect_output_format() // HTML or XML have shown up as a match else { - // If it is truely HTML, it wont want any XML + // If it is truly HTML, it wont want any XML if ($format == 'html' AND strpos($this->input->server('HTTP_ACCEPT'), 'xml') === FALSE) { return $format; } - // If it is truely XML, it wont want any HTML + // If it is truly XML, it wont want any HTML elseif ($format == 'xml' AND strpos($this->input->server('HTTP_ACCEPT'), 'html') === FALSE) { return $format; @@ -475,8 +504,9 @@ protected function _detect_output_format() } } } // End HTTP_ACCEPT checking + // Well, none of that has worked! Let's see if the controller has a default - if (!empty($this->rest_format)) + if ( ! empty($this->rest_format)) { return $this->rest_format; } @@ -488,20 +518,27 @@ protected function _detect_output_format() /** * Detect method * - * Detect which method (POST, PUT, GET, DELETE) is being used - * - * @return string + * Detect which HTTP method is being used + * + * @return string */ protected function _detect_method() { $method = strtolower($this->input->server('REQUEST_METHOD')); - if ($this->config->item('enable_emulate_request') && $this->input->post('_method')) + if ($this->config->item('enable_emulate_request')) { - $method = $this->input->post('_method'); + if ($this->input->post('_method')) + { + $method = strtolower($this->input->post('_method')); + } + elseif ($this->input->server('HTTP_X_HTTP_METHOD_OVERRIDE')) + { + $method = strtolower($this->input->server('HTTP_X_HTTP_METHOD_OVERRIDE')); + } } - if (in_array($method, array('get', 'delete', 'post', 'put'))) + if (in_array($method, $this->allowed_http_methods) && method_exists($this, '_parse_' . $method)) { return $method; } @@ -513,12 +550,11 @@ protected function _detect_method() * Detect API Key * * See if the user has provided an API key - * - * @return boolean + * + * @return boolean */ protected function _detect_api_key() { - // Get the api key name variable set in the rest config file $api_key_variable = config_item('rest_key_name'); @@ -527,12 +563,13 @@ protected function _detect_api_key() $this->rest->key = NULL; $this->rest->level = NULL; + $this->rest->user_id = NULL; $this->rest->ignore_limits = FALSE; // Find the key from server or arguments if (($key = isset($this->_args[$api_key_variable]) ? $this->_args[$api_key_variable] : $this->input->server($key_name))) { - if (!($row = $this->rest->db->where('key', $key)->get(config_item('rest_keys_table'))->row())) + if ( ! ($row = $this->rest->db->where('key', $key)->get(config_item('rest_keys_table'))->row())) { return FALSE; } @@ -554,12 +591,12 @@ protected function _detect_api_key() * Detect language(s) * * What language do they want it in? - * + * * @return null|string The language code. */ protected function _detect_lang() { - if (!$lang = $this->input->server('HTTP_ACCEPT_LANGUAGE')) + if ( ! $lang = $this->input->server('HTTP_ACCEPT_LANGUAGE')) { return NULL; } @@ -589,9 +626,9 @@ protected function _detect_lang() * Log request * * Record the entry for awesomeness purposes - * + * * @param boolean $authorized - * @return object + * @return object */ protected function _log_request($authorized = FALSE) { @@ -611,13 +648,13 @@ protected function _log_request($authorized = FALSE) * * Check if the requests are coming in a tad too fast. * - * @param string $controller_method The method deing called. - * @return boolean + * @param string $controller_method The method being called. + * @return boolean */ protected function _check_limit($controller_method) { // They are special, or it might not even have a limit - if (!empty($this->rest->ignore_limits) OR !isset($this->methods[$controller_method]['limit'])) + if ( ! empty($this->rest->ignore_limits) OR !isset($this->methods[$controller_method]['limit'])) { // On your way sonny-jim. return TRUE; @@ -634,7 +671,7 @@ protected function _check_limit($controller_method) ->row(); // No calls yet, or been an hour since they called - if (!$result OR $result->hour_started < time() - (60 * 60)) + if ( ! $result OR $result->hour_started < time() - (60 * 60)) { // Right, set one up from scratch $this->rest->db->insert(config_item('rest_limits_table'), array( @@ -667,10 +704,10 @@ protected function _check_limit($controller_method) /** * Auth override check * - * Check if there is a specific auth type set for the current class/method + * Check if there is a specific auth type set for the current class/method * being called. * - * @return boolean + * @return boolean */ protected function _auth_override_check() { @@ -717,11 +754,60 @@ protected function _auth_override_check() return true; } - // Return false when there is an override value set but it does not match + // Return false when there is an override value set but it does not match // 'basic', 'digest', or 'none'. (the value was misspelled) return false; } + /** + * Parse GET + */ + protected function _parse_get() + { + // Grab proper GET variables + parse_str(parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY), $get); + + // Merge both the URI segments and GET params + $this->_get_args = array_merge($this->_get_args, $get); + } + + /** + * Parse POST + */ + protected function _parse_post() + { + $this->_post_args = $_POST; + + $this->request->format and $this->request->body = file_get_contents('php://input'); + } + + /** + * Parse PUT + */ + protected function _parse_put() + { + // It might be a HTTP body + if ($this->request->format) + { + $this->request->body = file_get_contents('php://input'); + } + + // If no file type is provided, this is probably just arguments + else + { + parse_str(file_get_contents('php://input'), $this->_put_args); + } + } + + /** + * Parse DELETE + */ + protected function _parse_delete() + { + // Set up out DELETE variables (which shouldn't really exist, but sssh!) + parse_str(file_get_contents('php://input'), $this->_delete_args); + } + // INPUT FUNCTION -------------------------------------------------------------- /** @@ -755,7 +841,7 @@ public function post($key = NULL, $xss_clean = TRUE) return $this->_post_args; } - return $this->input->post($key, $xss_clean); + return array_key_exists($key, $this->_post_args) ? $this->_xss_clean($this->_post_args[$key], $xss_clean) : FALSE; } /** @@ -812,7 +898,7 @@ protected function _xss_clean($val, $process) /** * Retrieve the validation errors. * - * @return array + * @return array */ public function validation_errors() { @@ -828,7 +914,7 @@ public function validation_errors() * * @param string $username The user's name * @param string $password The user's password - * @return boolean + * @return boolean */ protected function _check_login($username = '', $password = NULL) { @@ -839,7 +925,7 @@ protected function _check_login($username = '', $password = NULL) $valid_logins = & $this->config->item('rest_valid_logins'); - if (!array_key_exists($username, $valid_logins)) + if ( ! array_key_exists($username, $valid_logins)) { return FALSE; } @@ -854,7 +940,7 @@ protected function _check_login($username = '', $password = NULL) } /** - * @todo document this. + * @todo document this. */ protected function _prepare_basic_auth() { @@ -883,14 +969,14 @@ protected function _prepare_basic_auth() } } - if (!$this->_check_login($username, $password)) + if ( ! $this->_check_login($username, $password)) { $this->_force_login(); } } /** - * @todo Document this. + * @todo Document this. */ protected function _prepare_digest_auth() { @@ -916,7 +1002,7 @@ protected function _prepare_digest_auth() $digest_string = ""; } - // The $_SESSION['error_prompted'] variable is used to ask the password + // The $_SESSION['error_prompted'] variable is used to ask the password // again if none given or if the user enters wrong auth information. if (empty($digest_string)) { @@ -927,7 +1013,7 @@ protected function _prepare_digest_auth() preg_match_all('@(username|nonce|uri|nc|cnonce|qop|response)=[\'"]?([^\'",]+)@', $digest_string, $matches); $digest = array_combine($matches[1], $matches[2]); - if (!array_key_exists('username', $digest) OR !$this->_check_login($digest['username'])) + if ( ! array_key_exists('username', $digest) OR !$this->_check_login($digest['username'])) { $this->_force_login($uniqid); } @@ -962,7 +1048,7 @@ protected function _check_whitelist_auth() $ip = trim($ip); } - if (!in_array($this->input->ip_address(), $whitelist)) + if ( ! in_array($this->input->ip_address(), $whitelist)) { $this->response(array('status' => false, 'error' => 'Not authorized'), 401); } @@ -971,7 +1057,7 @@ protected function _check_whitelist_auth() /** * @todo Document this. * - * @param string $nonce + * @param string $nonce */ protected function _force_login($nonce = '') { @@ -991,12 +1077,12 @@ protected function _force_login($nonce = '') * Force it into an array * * @param object|array $data - * @return array + * @return array */ protected function _force_loopable($data) { // Force it to be something useful - if (!is_array($data) AND !is_object($data)) + if ( ! is_array($data) AND !is_object($data)) { $data = (array) $data; } @@ -1009,9 +1095,9 @@ protected function _force_loopable($data) /** * Encode as JSONP - * + * * @param array $data The input data. - * @return string The JSONP data string (loadable from Javascript). + * @return string The JSONP data string (loadable from Javascript). */ protected function _format_jsonp($data = array()) { diff --git a/system/cms/helpers/MY_array_helper.php b/system/cms/helpers/MY_array_helper.php index 6ace213e12e..ead439eec8d 100644 --- a/system/cms/helpers/MY_array_helper.php +++ b/system/cms/helpers/MY_array_helper.php @@ -111,7 +111,7 @@ function html_to_assoc($html_array) } -if (!function_exists('html_to_assoc')) +if (!function_exists('assoc_array_prop')) { /** * Associative array property diff --git a/system/cms/language/english/global_lang.php b/system/cms/language/english/global_lang.php index 33fd445f6ac..10703c9da6d 100644 --- a/system/cms/language/english/global_lang.php +++ b/system/cms/language/english/global_lang.php @@ -92,4 +92,8 @@ $lang['global:keywords'] = 'Keywords'; +$lang['global:or'] = 'or'; +$lang['global:and'] = 'and'; +$lang['global:at'] = 'at'; + /* End of file main_lang.php */ \ No newline at end of file diff --git a/system/cms/language/italian/global_lang.php b/system/cms/language/italian/global_lang.php index 51dac7718c3..4dfbc2e509a 100644 --- a/system/cms/language/italian/global_lang.php +++ b/system/cms/language/italian/global_lang.php @@ -9,6 +9,9 @@ $lang['version_label'] = 'Versione'; $lang['global:author'] = 'Autore'; $lang['global:action'] = 'Azione'; +$lang['global:slug'] = 'Slug'; +$lang['global:user'] = 'User'; + $lang['dialog.delete_message'] = 'Sei sicuro di volerlo eliminare? L\'azione non può essere annullata.'; $lang['dialog.confirm'] = 'Conferma'; diff --git a/system/cms/libraries/Akismet.php b/system/cms/libraries/Akismet.php index d794faff597..58e8f2d4101 100644 --- a/system/cms/libraries/Akismet.php +++ b/system/cms/libraries/Akismet.php @@ -1,270 +1,261 @@ $value) { - foreach ($config as $key => $value) - { - $this->$key = $value; - } - - $this->set_comment($this->comment); - - $this->_connect(); - - if($this->errors_exist()) - { - $this->errors = array_merge($this->errors, $this->get_errors()); - } - - // Check if the API key is valid - if(!$this->_is_valid_api_key($this->api_key)) - { - $this->set_error('AKISMET_INVALID_KEY', "Your Akismet API key is not valid."); - } + $this->$key = $value; } - // Connect to the Akismet server and store that connection in the instance variable $con - function _connect() - { - if(!($this->con = @fsockopen($this->akismet_server, $this->api_port))) - { - $this->set_error('AKISMET_SERVER_NOT_FOUND', "Could not connect to akismet server."); - } - } + $this->set_comment($this->comment); + + $this->_connect(); - // Close the connection to the Akismet server - function _disconnect() + if ($this->errors_exist()) { - @fclose($this->con); + $this->errors = array_merge($this->errors, $this->get_errors()); } - function get_response($request, $path, $type = "post", $response_length = 1160) + // Check if the API key is valid + if ($this->_is_valid_api_key($this->api_key) === false) { - $this->_connect(); - - if($this->con && !$this->is_error('AKISMET_SERVER_NOT_FOUND')) - { - $request = - strToUpper($type)." /{$this->akismet_version}/$path HTTP/1.0\r\n" . - "Host: ".((!empty($this->api_key)) ? $this->api_key."." : null)."{$this->akismet_server}\r\n" . - "Content-Type: application/x-www-form-urlencoded; charset=utf-8\r\n" . - "Content-Length: ".strlen($request)."\r\n" . - "User-Agent: Akismet CodeIgniter Library\r\n" . - "\r\n" . - $request - ; - $response = ""; - - @fwrite($this->con, $request); - - while(!feof($this->con)) - { - $response .= @fgets($this->con, $response_length); - } - - $response = explode("\r\n\r\n", $response, 2); - return $response[1]; - } - else - { - $this->set_error('AKISMET_RESPONSE_FAILED', "The response could not be retrieved."); - } - - $this->_disconnect(); + $this->set_error('AKISMET_INVALID_KEY', "The Akismet API key is not valid."); } - - function set_error($name, $message) + } + + // Connect to the Akismet server and store that connection in the instance variable $con + private function _connect() + { + if ( ! ($this->con = @fsockopen($this->akismet_server, $this->api_port))) { - $this->errors[$name] = $message; + $this->set_error('AKISMET_SERVER_NOT_FOUND', "Could not connect to akismet server."); } + } + + // Close the connection to the Akismet server + private function _disconnect() + { + @fclose($this->con); + } + + public function get_response($request, $path, $type = "POST", $response_length = 1160) + { + $this->_connect(); - function get_error($name) + if ($this->con && ! $this->is_error('AKISMET_SERVER_NOT_FOUND')) { - if($this->is_error($name)) + $request = + strtoupper($type)." /{$this->akismet_version}/$path HTTP/1.1\r\n" . + "Host: ".$this->api_key.".{$this->akismet_server}\r\n" . + "Content-Type: application/x-www-form-urlencoded; charset=utf-8\r\n" . + "Content-Length: ".strlen($request)."\r\n" . + "User-Agent: PyroCMS/".CMS_VERSION."\r\n" . + "\r\n" . + $request + ; + $response = ""; + + @fwrite($this->con, $request); + + while ( ! feof($this->con)) { - return $this->errors[$name]; - } - else - { - return false; + $response .= @fgets($this->con, $response_length); } + + $response = explode("\r\n\r\n", $response, 2); + return $response[1]; } - - function get_errors() - { - return (array)$this->errors; - } - - function is_error($name) + else { - return isset($this->errors[$name]); + $this->set_error('AKISMET_RESPONSE_FAILED', "The response could not be retrieved."); } - function errors_exist() + $this->_disconnect(); + } + + public function set_error($name, $message) + { + $this->errors[$name] = $message; + } + + public function get_error($name) + { + if ($this->is_error($name)) { - return (count($this->errors) > 0); + return $this->errors[$name]; } - function is_spam() - { - $response = $this->get_response($this->_get_query_string(), 'comment-check'); - - return ($response == "true"); - } + return false; + } + + public function get_errors() + { + return (array) $this->errors; + } + + public function is_error($name) + { + return isset($this->errors[$name]); + } + + public function errors_exist() + { + return (count($this->errors) > 0); + } + + public function is_spam() + { + $response = $this->get_response($this->_get_query_string(), 'comment-check'); + return ($response == "true"); + } + + + public function submit_spam() + { + $this->get_response($this->_get_querystring(), 'submit-spam'); + } + + + public function submit_ham() + { + $this->get_response($this->_get_query_string(), 'submit-ham'); + } + + public function set_comment($comment) + { + $this->comment = $comment; - function submit_spam() + if(!empty($comment)) { - $this->get_response($this->_get_querystring(), 'submit-spam'); + $this->_format_comment_array(); + $this->_fill_comment_values(); } + } + + public function get_comment() + { + return $this->comment; + } + + private function _is_valid_api_key($key) + { + $key_check = $this->get_response("key=".$this->api_key."&blog=".$this->blog_url, 'verify-key'); + return ($key_check === "valid"); + } + + private function _format_comment_array() { + $format = array( + 'type' => 'comment_type', + 'author' => 'comment_author', + 'email' => 'comment_author_email', + 'website' => 'comment_author_url', + 'body' => 'comment_content' + ); - function submit_ham() - { - $this->get_response($this->_get_query_string(), 'submit-ham'); - } - - function set_comment($comment) + foreach ($format as $short => $long) { - $this->comment = $comment; - - if(!empty($comment)) + if (isset($this->comment[$short])) { - $this->_format_comment_array(); - $this->_fill_comment_values(); + $this->comment[$long] = $this->comment[$short]; + unset($this->comment[$short]); } } - - function get_comment() + } + + + /** + * Fill any values not provided by the developer with available values. + * + * @return void + */ + + private function _fill_comment_values() + { + if(!isset($this->comment['user_ip'])) { - return $this->comment; + $this->comment['user_ip'] = ($_SERVER['REMOTE_ADDR'] != getenv('SERVER_ADDR')) ? $_SERVER['REMOTE_ADDR'] : getenv('HTTP_X_FORWARDED_FOR'); } - function _is_valid_api_key($key) + if(!isset($this->comment['user_agent'])) { - $key_check = $this->get_response("key=".$this->api_key."&blog=".$this->blog_url, 'verify-key'); - - return ($key_check == "valid"); + $this->comment['user_agent'] = $_SERVER['HTTP_USER_AGENT']; } - function _format_comment_array() { - - $format = array( - 'type' => 'comment_type', - 'author' => 'comment_author', - 'email' => 'comment_author_email', - 'website' => 'comment_author_url', - 'body' => 'comment_content' - ); - - foreach($format as $short => $long) - { - if(isset($this->comment[$short])) - { - $this->comment[$long] = $this->comment[$short]; - unset($this->comment[$short]); - } - } + if(!isset($this->comment['referrer']) && !empty($_SERVER['HTTP_REFERER'])) + { + $this->comment['referrer'] = $_SERVER['HTTP_REFERER']; } - - /** - * Fill any values not provided by the developer with available values. - * - * @return void - */ - - function _fill_comment_values() + if(!isset($this->comment['blog'])) { - if(!isset($this->comment['user_ip'])) - { - $this->comment['user_ip'] = ($_SERVER['REMOTE_ADDR'] != getenv('SERVER_ADDR')) ? $_SERVER['REMOTE_ADDR'] : getenv('HTTP_X_FORWARDED_FOR'); - } - - if(!isset($this->comment['user_agent'])) - { - $this->comment['user_agent'] = $_SERVER['HTTP_USER_AGENT']; - } - - if(!isset($this->comment['referrer']) && !empty($_SERVER['HTTP_REFERER'])) - { - $this->comment['referrer'] = $_SERVER['HTTP_REFERER']; - } - - if(!isset($this->comment['blog'])) - { - $this->comment['blog'] = $this->blog_url; - } + $this->comment['blog'] = $this->blog_url; } - - - function _get_query_string() + } + + + private function _get_query_string() + { + foreach($_SERVER as $key => $value) { - foreach($_SERVER as $key => $value) + if(!in_array($key, $this->ignore)) { - if(!in_array($key, $this->ignore)) + if($key == 'REMOTE_ADDR') { - if($key == 'REMOTE_ADDR') - { - $this->comment[$key] = $this->comment['user_ip']; - } - else - { - $this->comment[$key] = $value; - } + $this->comment[$key] = $this->comment['user_ip']; + } + else + { + $this->comment[$key] = $value; } } - - $query_string = ''; - - foreach($this->comment as $key => $data) - { - $query_string .= $key . '=' . urlencode(stripslashes($data)) . '&'; - } - - return $query_string; } + + $query_string = ''; + + foreach($this->comment as $key => $data) + { + $query_string .= $key . '=' . urlencode(stripslashes($data)) . '&'; + } + + return $query_string; } - -?> +} \ No newline at end of file diff --git a/system/cms/libraries/Lex/Parser.php b/system/cms/libraries/Lex/Parser.php index d17494e9781..b33c52ab128 100644 --- a/system/cms/libraries/Lex/Parser.php +++ b/system/cms/libraries/Lex/Parser.php @@ -774,12 +774,12 @@ protected function parse_parameters($parameters, $data, $callback) $parameters = $this->inject_extractions($parameters, '__param_str'); $this->in_condition = false; - if (preg_match_all('/(.*?)\s*=\s*(\'|"|&#?\w+;)(.*?)\2/s', trim($parameters), $matches)) + if (preg_match_all('/(.*?)\s*=\s*(\'|"|&#?\w+;)(.*?)(? $attr) { - $return[trim($matches[1][$i])] = $matches[3][$i]; + $return[trim($matches[1][$i])] = stripslashes($matches[3][$i]); } return $return; diff --git a/system/cms/libraries/MY_Form_validation.php b/system/cms/libraries/MY_Form_validation.php index cfcec32ed25..c48e28a65e0 100644 --- a/system/cms/libraries/MY_Form_validation.php +++ b/system/cms/libraries/MY_Form_validation.php @@ -31,7 +31,7 @@ function alpha_dot_dash($str) /** * Sneaky function to get field data from - * the form validation libraru + * the form validation library * * @access public * @param string diff --git a/system/cms/libraries/Streams/drivers/Streams_entries.php b/system/cms/libraries/Streams/drivers/Streams_entries.php index f10764485e8..64d451d22f3 100755 --- a/system/cms/libraries/Streams/drivers/Streams_entries.php +++ b/system/cms/libraries/Streams/drivers/Streams_entries.php @@ -57,25 +57,26 @@ class Streams_entries extends CI_Driver { * @var array */ public $pagination_config = array( - 'num_links' => 3, + 'num_links' => 3, 'full_tag_open' => '

', 'full_tag_close' => '

', 'first_link' => 'First', 'first_tag_open' => '
', 'first_tag_close' => '
', - 'last_link' => 'Last', + 'last_link' => 'Last', 'last_tag_open' => '
', 'last_tag_close' => '
', - 'next_link' => '>', + 'next_link' => '>', 'next_tag_open' => '
', 'next_tag_close' => '
', - 'prev_link' => '<', + 'prev_link' => '<', 'prev_tag_open' => '
', 'prev_tag_close' => '
', 'cur_tag_open' => '', 'cur_tag_close' => '', 'num_tag_open' => '
', - 'num_tag_close' => '
' + 'num_tag_close' => '', + 'display_pages' => true ); // -------------------------------------------------------------------------- diff --git a/system/cms/migrations/098_Increase_mime_length.php b/system/cms/migrations/098_Increase_mime_length.php new file mode 100644 index 00000000000..a744d1cf166 --- /dev/null +++ b/system/cms/migrations/098_Increase_mime_length.php @@ -0,0 +1,18 @@ +dbforge->modify_column('files', array( + 'mimetype' => array('type' => 'VARCHAR', 'constraint' => 100, 'null' => false), + )); + } + + public function down() + { + $this->dbforge->modify_column('files', array( + 'mimetype' => array('type' => 'VARCHAR', 'constraint' => 50, 'null' => false), + )); + } +} \ No newline at end of file diff --git a/system/cms/modules/blog/controllers/admin.php b/system/cms/modules/blog/controllers/admin.php index 8fde3840fbe..3fb565c1e72 100644 --- a/system/cms/modules/blog/controllers/admin.php +++ b/system/cms/modules/blog/controllers/admin.php @@ -164,7 +164,6 @@ public function create() $this->form_validation->set_rules($this->validation_rules); - if ($this->input->post('created_on')) { $created_on = strtotime(sprintf('%s %s:%s', $this->input->post('created_on'), $this->input->post('created_on_hour'), $this->input->post('created_on_minute'))); @@ -226,6 +225,7 @@ public function create() else { // Go through all the known fields and get the post values + $post = new stdClass; foreach ($this->validation_rules as $key => $field) { $post->$field['field'] = set_value($field['field']); diff --git a/system/cms/modules/blog/controllers/blog.php b/system/cms/modules/blog/controllers/blog.php index 4b80b849458..c28c2638e5d 100644 --- a/system/cms/modules/blog/controllers/blog.php +++ b/system/cms/modules/blog/controllers/blog.php @@ -268,9 +268,11 @@ private function _single_view($post, $build = 'view') // Set some defaults else { - $post->category->id = 0; - $post->category->slug = ''; - $post->category->title = ''; + $post->category = (object) array( + 'id' => 0, + 'slug' => '', + 'title' => '', + ); } $this->session->set_flashdata(array('referrer' => $this->uri->uri_string)); diff --git a/system/cms/modules/blog/language/french/blog_lang.php b/system/cms/modules/blog/language/french/blog_lang.php index 4cd44645398..dc4c562e4f3 100644 --- a/system/cms/modules/blog/language/french/blog_lang.php +++ b/system/cms/modules/blog/language/french/blog_lang.php @@ -1,7 +1,7 @@ session->set_flashdata('comment', $comment); $this->session->set_flashdata('error', $result['message']); @@ -192,7 +192,7 @@ private function _allow_comment() $this->load->library('akismet'); $comment = array( - 'author' => $this->current_user ? $this->current_user->first_name.' '.$this->current_user->last_name : $this->input->post('name'), + 'author' => $this->current_user ? $this->current_user->display_name : $this->input->post('name'), 'email' => $this->current_user ? $this->current_user->email : $this->input->post('email'), 'website' => $this->current_user ? $this->current_user->website : $this->input->post('website'), 'body' => $this->input->post('body') @@ -200,7 +200,7 @@ private function _allow_comment() $config = array( 'blog_url' => BASE_URL, - 'api_key' => $this->settings->get('akismet_api_key'), + 'api_key' => Settings::get('akismet_api_key'), 'comment' => $comment ); diff --git a/system/cms/modules/comments/views/comments.php b/system/cms/modules/comments/views/comments.php old mode 100644 new mode 100755 index 2c6fffdc386..a83c4e2ff96 --- a/system/cms/modules/comments/views/comments.php +++ b/system/cms/modules/comments/views/comments.php @@ -15,7 +15,7 @@

- website, $item->name, 'rel="external nofollow"') : $item->name; ?> + website ? anchor($item->website, $item->name, 'rel="external nofollow"') : $item->name; ?>

@@ -77,4 +77,4 @@ -
\ No newline at end of file +
diff --git a/system/cms/modules/contact/language/french/contact_lang.php b/system/cms/modules/contact/language/french/contact_lang.php index c869b55eb4c..0ac8c1f6418 100644 --- a/system/cms/modules/contact/language/french/contact_lang.php +++ b/system/cms/modules/contact/language/french/contact_lang.php @@ -11,6 +11,6 @@ * @since Version 0.9.8 * @filesource */ -$lang['contact_submit_error'] = 'Désolé. Vous tentez d\'envoyer les éléments du formulaire directement. Ceci n\'est pas autorisé.Sorry.'; +$lang['contact_submit_error'] = 'Désolé. Vous tentez d\'envoyer les éléments du formulaire directement. Ceci n\'est pas autorisé.'; $lang['contact_sent_text'] = 'Votre message a été envoyé. Nous reviendrons vers vous dès que possible.'; $lang['contact_error_message'] = 'Un problème est survenu lors de l\'envoie du message. Merci de ré-essayer plus tard...'; \ No newline at end of file diff --git a/system/cms/modules/contact/language/italian/contact_lang.php b/system/cms/modules/contact/language/italian/contact_lang.php index 4550b0796f1..07a4e279e19 100644 --- a/system/cms/modules/contact/language/italian/contact_lang.php +++ b/system/cms/modules/contact/language/italian/contact_lang.php @@ -11,6 +11,6 @@ * @since Version 0.9.8 * @filesource */ -$lang['contact_submit_error'] = 'Spiacenti. Sembra che tu abbia provato a inviare il messaggio in modo diretto, questo non &eacuta; consentito.'; +$lang['contact_submit_error'] = 'Spiacenti. Sembra che tu abbia provato a inviare il messaggio in modo diretto, questo non è consentito.'; $lang['contact_sent_text'] = 'Il tuo messaggio è stato inviato. Ti risponderemo il prima possibile.'; -$lang['contact_error_message'] = 'Si &eacuta; verificato un problema durante l\'invio del messaggio. Per favore riprova più tardi.'; \ No newline at end of file +$lang['contact_error_message'] = 'Si è verificato un problema durante l\'invio del messaggio. Per favore riprova più tardi.'; \ No newline at end of file diff --git a/system/cms/modules/files/controllers/admin.php b/system/cms/modules/files/controllers/admin.php index 970e5e62ce1..a8d354935c9 100644 --- a/system/cms/modules/files/controllers/admin.php +++ b/system/cms/modules/files/controllers/admin.php @@ -97,7 +97,11 @@ public function new_folder() $parent_id = $this->input->post('parent'); $name = $this->input->post('name'); - echo json_encode(Files::create_folder($parent_id, $name)); + $result = Files::create_folder($parent_id, $name); + + $result['status'] AND Events::trigger('file_folder_created', $result['data']); + + echo json_encode($result); } /** @@ -169,7 +173,11 @@ public function rename_folder() if ($id = $this->input->post('folder_id') AND $name = $this->input->post('name')) { - echo json_encode(Files::rename_folder($id, $name)); + $result = Files::rename_folder($id, $name); + + $result['status'] AND Events::trigger('file_folder_updated', $id); + + echo json_encode($result); } } @@ -186,7 +194,11 @@ public function delete_folder() if ($id = $this->input->post('folder_id')) { - echo json_encode(Files::delete_folder($id)); + $result = Files::delete_folder($id); + + $result['status'] AND Events::trigger('file_folder_deleted', $id); + + echo json_encode($result); } } @@ -205,7 +217,11 @@ public function upload() if ($input['folder_id'] AND $input['name']) { - echo json_encode(Files::upload($input['folder_id'], $input['name'], 'file', $input['width'], $input['height'], $input['ratio'])); + $result = Files::upload($input['folder_id'], $input['name'], 'file', $input['width'], $input['height'], $input['ratio']); + + $result['status'] AND Events::trigger('file_uploaded', $result['data']); + + echo json_encode($result); } } @@ -222,7 +238,11 @@ public function rename_file() if ($id = $this->input->post('file_id') AND $name = $this->input->post('name')) { - echo json_encode(Files::rename_file($id, $name)); + $result = Files::rename_file($id, $name); + + $result['status'] AND Events::trigger('file_updated', $result['data']); + + echo json_encode($result); } } @@ -293,7 +313,11 @@ public function delete_file() if ($id = $this->input->post('file_id')) { - echo json_encode(Files::delete_file($id)); + $result = Files::delete_file($id); + + $result['status'] AND Events::trigger('file_deleted', $id); + + echo json_encode($result); } } diff --git a/system/cms/modules/files/details.php b/system/cms/modules/files/details.php index 94ca845217a..f21757a3b4f 100755 --- a/system/cms/modules/files/details.php +++ b/system/cms/modules/files/details.php @@ -85,8 +85,8 @@ public function install() 'filename' => array('type' => 'VARCHAR', 'constraint' => 255,), 'path' => array('type' => 'VARCHAR', 'constraint' => 255, 'default' => ''), 'description' => array('type' => 'TEXT',), - 'extension' => array('type' => 'VARCHAR', 'constraint' => 10,), - 'mimetype' => array('type' => 'VARCHAR', 'constraint' => 50,), + 'extension' => array('type' => 'VARCHAR', 'constraint' => 5,), + 'mimetype' => array('type' => 'VARCHAR', 'constraint' => 100,), 'width' => array('type' => 'INT', 'constraint' => 5, 'null' => true,), 'height' => array('type' => 'INT', 'constraint' => 5, 'null' => true,), 'filesize' => array('type' => 'INT', 'constraint' => 11, 'default' => 0,), diff --git a/system/cms/modules/files/js/functions.js b/system/cms/modules/files/js/functions.js index f91ef7f7f55..9fb801a5aba 100644 --- a/system/cms/modules/files/js/functions.js +++ b/system/cms/modules/files/js/functions.js @@ -712,6 +712,7 @@ jQuery(function($){ $item_details.find('li').hide(); if ($item) { + if ($item.id) $item_details.find('.id') .html($item.id).parent().show(); if ($item.name) $item_details.find('.name') .html($item.name).parent().show(); if ($item.slug) $item_details.find('.slug') .html($item.slug).parent().show(); if ($item.path) $item_details.find('.path') .val($item.path).parent().show(); diff --git a/system/cms/modules/files/language/arabic/files_lang.php b/system/cms/modules/files/language/arabic/files_lang.php index 081fe355c71..a5c617cde87 100644 --- a/system/cms/modules/files/language/arabic/files_lang.php +++ b/system/cms/modules/files/language/arabic/files_lang.php @@ -20,6 +20,7 @@ $lang['files:forward'] = 'تقدم'; $lang['files:start'] = 'ابدأ الرفع'; $lang['files:details'] = 'التفاصيل'; +$lang['files:id'] = 'ID'; #translate $lang['files:name'] = 'الاسم'; $lang['files:slug'] = 'المختصر'; $lang['files:path'] = 'المسار'; diff --git a/system/cms/modules/files/language/dutch/files_lang.php b/system/cms/modules/files/language/dutch/files_lang.php index 3dd44bb8461..d75fbe8030e 100644 --- a/system/cms/modules/files/language/dutch/files_lang.php +++ b/system/cms/modules/files/language/dutch/files_lang.php @@ -20,6 +20,7 @@ $lang['files:forward'] = 'Volgende'; $lang['files:start'] = 'Start Upload'; $lang['files:details'] = 'Details'; +$lang['files:id'] = 'ID'; #translate $lang['files:name'] = 'Naam'; $lang['files:slug'] = 'Slug'; $lang['files:path'] = 'Pad'; diff --git a/system/cms/modules/files/language/english/files_lang.php b/system/cms/modules/files/language/english/files_lang.php index bb1dcc14388..89ead3c2880 100644 --- a/system/cms/modules/files/language/english/files_lang.php +++ b/system/cms/modules/files/language/english/files_lang.php @@ -20,6 +20,7 @@ $lang['files:forward'] = 'Forward'; $lang['files:start'] = 'Start Upload'; $lang['files:details'] = 'Details'; +$lang['files:id'] = 'ID'; $lang['files:name'] = 'Name'; $lang['files:slug'] = 'Slug'; $lang['files:path'] = 'Path'; diff --git a/system/cms/modules/files/language/french/files_lang.php b/system/cms/modules/files/language/french/files_lang.php index 64effb81065..9b81eea5ad9 100644 --- a/system/cms/modules/files/language/french/files_lang.php +++ b/system/cms/modules/files/language/french/files_lang.php @@ -20,6 +20,7 @@ $lang['files:forward'] = 'Avant'; $lang['files:start'] = 'Commencer le téléchargement'; $lang['files:details'] = 'Details'; +$lang['files:id'] = 'ID'; #translate $lang['files:name'] = 'Nom'; $lang['files:slug'] = 'Slug'; $lang['files:path'] = 'Chemin'; @@ -53,7 +54,7 @@ // Folders -$lang['files:no_folders'] = 'Les fichiers et dossiers sont gérés comme ils le sont sur votre ordinateur. Faites un clic droit dans la zone sous ce message pour créer votre premier dossier. Puis faite un clic droit sur le dossier pour le renommer, le supprimer, uploader des fichiers ou modifier les détails le concernant comme par exemple le relier à un dossier in Cloud.'; // todo : check french translation +$lang['files:no_folders'] = 'Les fichiers et dossiers sont gérés comme ils le sont sur votre ordinateur. Faites un clic droit dans la zone sous ce message pour créer votre premier dossier. Puis faite un clic droit sur le dossier pour le renommer, le supprimer, uploader des fichiers ou modifier les détails le concernant comme par exemple le relier à un dossier sur un espace de stockage à distance.'; $lang['files:no_folders_places'] = 'Les dossiers que vous créez s\'affiche dans un arbre de données qui peut être affiché ou masqué. Cliquez sur "Places" pour voir le dossier racine.'; $lang['files:no_folders_wysiwyg'] = 'Aucun dossier n\'a été créé pour le moment'; $lang['files:new_folder_name'] = 'Dossier sans nom'; diff --git a/system/cms/modules/files/language/greek/files_lang.php b/system/cms/modules/files/language/greek/files_lang.php index 30fba6416fc..38853a895e7 100644 --- a/system/cms/modules/files/language/greek/files_lang.php +++ b/system/cms/modules/files/language/greek/files_lang.php @@ -20,6 +20,7 @@ $lang['files:forward'] = 'Εμπρός'; $lang['files:start'] = 'Εκκίνηση'; $lang['files:details'] = 'Λεπτομέρειες'; +$lang['files:id'] = 'ID'; #translate $lang['files:name'] = 'Όνομα'; $lang['files:slug'] = 'Σύντομο όνομα'; $lang['files:path'] = 'Διαδρομή'; diff --git a/system/cms/modules/files/language/indonesian/files_lang.php b/system/cms/modules/files/language/indonesian/files_lang.php index 558fabfd16e..6076ba2a57d 100644 --- a/system/cms/modules/files/language/indonesian/files_lang.php +++ b/system/cms/modules/files/language/indonesian/files_lang.php @@ -20,6 +20,7 @@ $lang['files:forward'] = 'Maju'; $lang['files:start'] = 'Mulai Mengunggah'; $lang['files:details'] = 'Detail'; +$lang['files:id'] = 'ID'; #translate $lang['files:name'] = 'Nama'; $lang['files:slug'] = 'Slug'; $lang['files:path'] = 'Path'; diff --git a/system/cms/modules/files/language/italian/files_lang.php b/system/cms/modules/files/language/italian/files_lang.php new file mode 100644 index 00000000000..764587e190f --- /dev/null +++ b/system/cms/modules/files/language/italian/files_lang.php @@ -0,0 +1,101 @@ +oppure
Clicca per selezionare i file'; + +// Context Menu +$lang['files:open'] = 'Apri'; +$lang['files:new_folder'] = 'Nuova cartella'; +$lang['files:upload'] = 'Carica'; +$lang['files:rename'] = 'Rinomina'; +$lang['files:delete'] = 'Cancella'; +$lang['files:edit'] = 'Modifica'; +$lang['files:details'] = 'Dettagli'; + +// Folders + +$lang['files:no_folders'] = 'File e cartelle sono gestite come faresti sul tuo computer. Clicca con il tasto destro del mouse nell\'area sottostante per creare la prima cartella. Poi sempre con il tasto destro sulla cartella creata potrai rinominarla, cancellarla e caricare file al suo interno o su un servizio cloud.'; +$lang['files:no_folders_places'] = 'Le cartelle che creerai saranno mostrate qui sottoforma di albero che puoi espandere e contrarre. Clicca su "Cartelle" per vedere la root principale.'; +$lang['files:no_folders_wysiwyg'] = 'Non sono ancora state create cartelle'; +$lang['files:new_folder_name'] = 'Cartella senza nome'; +$lang['files:folder'] = 'Cartella'; +$lang['files:folders'] = 'Cartelle'; +$lang['files:select_folder'] = 'Seleziona una cartella'; +$lang['files:subfolders'] = 'Sottocartelle'; +$lang['files:root'] = 'Root'; +$lang['files:no_subfolders'] = 'Non ci sono sottocartelle'; +$lang['files:folder_not_empty'] = 'Devi prima cancellare il contenuto di "%s"'; +$lang['files:mkdir_error'] = 'Non è stato possibile creare %s. Devi crearla manualmente'; +$lang['files:chmod_error'] = 'La cartella di upload non è scrivibile. Deve avere i permessi a 0777'; +$lang['files:location_saved'] = 'La locazione della cartella è stata salvata'; +$lang['files:container_exists'] = '"%s" esiste di già. Salva per linkare i contenuti a questa cartella'; +$lang['files:container_not_exists'] = '"%s" non esiste nel tuo account. Salva per provare a crearla'; +$lang['files:error_container'] = '"%s" non puà essere creata e non si riesce a determinarne il motivo'; +$lang['files:container_created'] = '"%s" è stata creata e ora è linkata a questa cartella'; +$lang['files:unwritable'] = '"%s" non è scrivibile, per favore imposta i suoi permessi a 0777'; +$lang['files:specify_valid_folder'] = 'Devi indicare una cartella per caricare i file'; +$lang['files:enable_cdn'] = 'Devi abilitare il CDN per "%s" attraverso il tuo pannello di controllo Rackspace prima di poter sincronizzare'; +$lang['files:synchronization_started'] = 'Avvio sincronizzazione'; +$lang['files:synchronization_complete'] = 'Sincronizzazione per "%s" terminata'; +$lang['files:untitled_folder'] = 'Cartella senza nome'; + +// Files +$lang['files:no_files'] = 'File non trovato'; +$lang['files:file_uploaded'] = '"%s" è stato caricato'; +$lang['files:unsuccessful_fetch'] = 'Non è stato possibile leggere "%s". Sicuro che sia un file pubblico?'; +$lang['files:invalid_container'] = '"%s" sembra non essere un contenitore valido.'; +$lang['files:no_records_found'] = 'Non sono stati trovati risultati'; +$lang['files:invalid_extension'] = '"%s" ha una estensione che non è ammessa'; +$lang['files:upload_error'] = 'L\'upload del file è fallito'; +$lang['files:description_saved'] = 'La descrizione del file è stata salvata'; +$lang['files:file_moved'] = '"%s" è stato spostato con successo'; +$lang['files:exceeds_server_setting'] = 'Il server non può gestire file così grossi'; +$lang['files:exceeds_allowed'] = 'Il file eccede la dimensione massima'; +$lang['files:file_type_not_allowed'] = 'Questo tipo di file non è ammesso'; +$lang['files:type_a'] = 'Audio'; +$lang['files:type_v'] = 'Video'; +$lang['files:type_d'] = 'Documento'; +$lang['files:type_i'] = 'Immagine'; +$lang['files:type_o'] = 'Altro'; + +/* End of file files_lang.php */ \ No newline at end of file diff --git a/system/cms/modules/files/language/italian/help_lang.php b/system/cms/modules/files/language/italian/help_lang.php new file mode 100644 index 00000000000..12597139fd8 --- /dev/null +++ b/system/cms/modules/files/language/italian/help_lang.php @@ -0,0 +1,50 @@ +Overview
+

The files module is an excellent way for the site admin to manage the files in use on the site. +All images or files that are inserted into pages, galleries, or blog posts are stored here. +For page content images you may upload them directly from the WYSIWYG editor or you can upload them here and just insert them via WYSIWYG.

+

The files interface works much like a local file system: it uses the right click to show a context menu. Everything in the middle pane is clickable.

+ +
Managing Folders
+

After you create the top level folder or folders you may create as many subfolders as you need such as blog/images/screenshots/ or pages/audio/. +The folder names are for your use only, the name is not displayed in the download link on the front end. +To manage a folder either right click on it and select an action from the resulting menu or double click on the folder to open it. +You can also click on folders in the left column to open them.

+

If cloud providers are enabled you will be able to set the location of the folder by right clicking on the folder and then selecting Details. +You can then select a location (for example \"Amazon S3\") and put in the name of your remote bucket or container. If the bucket or container does +not exist it will be created when you click Save. Note that you can only change the location of an empty folder.

+ +
Managing Files
+

To manage files navigate to the folder using the folder tree in the left column or by clicking on the folder in the center pane. +Once you are viewing the files you may edit them by right clicking on them. You can also order them by dragging them into position. Note +that if you have folders and files in the same parent folder the folders will always be displayed first followed by the files.

+ +
Uploading Files
+

After right clicking the desired folder an upload window will appear. +You may add files by either dropping them in the Upload Files box or by clicking in the box and choosing the files from your standard file dialog. +You can select multiple files by holding your Control/Command or Shift key while clicking them. The selected files will display in a list at the bottom of the screen. +You may then either delete unnecessary files from the list or if satisfied click Upload to start the upload process.

+

If you get a warning about the files size being too large be advised that many hosts do not allow file uploads over 2MB. +Many modern cameras produce images in exess of 5MB so it is very common to run into this issue. +To remedy this limitation you may either ask your host to change the upload limit or you may wish to resize your images before uploading. +Resizing has the added advantage of faster upload times. You may change the upload limit in +CP > Files > Settings also but it is secondary to the host's limitation. For example if the host allows a 50MB upload you can still limit the size +of the upload by setting a maximum of \"20\" (for example) in CP > Files > Settings.

+ +
Synchronizing Files
+

If you are storing files with a cloud provider you may want to use the Synchronize function. This allows you to \"refresh\" +your database of files to keep it up to date with the remote storage location. For example if you have another service +that dumps files into a folder on Amazon that you want to display in your weekly blog post you can simply go to your folder +that is linked to that bucket and click Synchronize. This will pull down all the available information from Amazon and +store it in the database as if the file was uploaded via the Files interface. The files are now available to be inserted into page content, +your blog post, or etc. If files have been deleted from the remote bucket since your last Synchronize they will now be removed from +the database also.

+ +
Search
+

You may search all of your files and folders by typing a search term in the right column and then hitting Enter. The first +5 folder matches and the first 5 file matches will be returned. When you click on an item its containing folder will be displayed +and the items that match your search will be highlighted. Items are searched using the folder name, file name, extension, +location, and remote container name.

"; \ No newline at end of file diff --git a/system/cms/modules/files/language/italian/permission_lang.php b/system/cms/modules/files/language/italian/permission_lang.php new file mode 100644 index 00000000000..9f095e70764 --- /dev/null +++ b/system/cms/modules/files/language/italian/permission_lang.php @@ -0,0 +1,14 @@ +file_m->update($id, array('name' => $name)); - return self::result(TRUE, lang('files:item_updated'), $name, array('name' => $name)); + return self::result(TRUE, lang('files:item_updated'), $name, array('id' => $id, 'name' => $name)); } // ------------------------------------------------------------------------ diff --git a/system/cms/modules/files/views/admin/index.php b/system/cms/modules/files/views/admin/index.php index ff48c20cf4b..b3e392eea47 100644 --- a/system/cms/modules/files/views/admin/index.php +++ b/system/cms/modules/files/views/admin/index.php @@ -70,6 +70,9 @@

- -
  • - - '.$field['instructions'].'

    '; } ?> -
    - -
    -
  • - + + +
  • + + + '.$field['instructions'].'

    '; ?> + +
    + +
    +
  • + + diff --git a/system/cms/themes/pyrocms/css/workless/responsive.css b/system/cms/themes/pyrocms/css/workless/responsive.css index 556e869ac08..bc66f727b51 100644 --- a/system/cms/themes/pyrocms/css/workless/responsive.css +++ b/system/cms/themes/pyrocms/css/workless/responsive.css @@ -540,7 +540,7 @@ padding: 0px; margin: 0px; line-height: 60px; - width: 60%; + width: 65%; vertical-align: middle; } diff --git a/system/codeigniter/language/italian/calendar_lang.php b/system/codeigniter/language/italian/calendar_lang.php index 16372546d70..0a5881c6c71 100644 --- a/system/codeigniter/language/italian/calendar_lang.php +++ b/system/codeigniter/language/italian/calendar_lang.php @@ -19,11 +19,11 @@ $lang['cal_fri'] = "Ven"; $lang['cal_sat'] = "Sab"; $lang['cal_sunday'] = "Domenica"; -$lang['cal_monday'] = "Lunedì"; -$lang['cal_tuesday'] = "Martedì"; -$lang['cal_wednesday'] = "Mercoledì"; -$lang['cal_thursday'] = "Giovedì"; -$lang['cal_friday'] = "Venerdì"; +$lang['cal_monday'] = "Lunedì"; +$lang['cal_tuesday'] = "Martedì"; +$lang['cal_wednesday'] = "Mercoledì"; +$lang['cal_thursday'] = "Giovedì"; +$lang['cal_friday'] = "Venerd'"; $lang['cal_saturday'] = "Sabato"; $lang['cal_jan'] = "Gen"; $lang['cal_feb'] = "Feb"; diff --git a/system/codeigniter/language/italian/form_validation_lang.php b/system/codeigniter/language/italian/form_validation_lang.php index 9cfbc232944..fd31f11ac8a 100644 --- a/system/codeigniter/language/italian/form_validation_lang.php +++ b/system/codeigniter/language/italian/form_validation_lang.php @@ -2,26 +2,27 @@ /* Translation made By Alessandro Piconi: all update on invernomuto.net */ /* Date 18/09/2009 */ /* Modified by Nicola Tudino */ +/* Update by Christian Giupponi */ /* Date 04/11/2010 */ -$lang['required'] = "Il campo %s è necessario."; +$lang['required'] = "Il campo %s è necessario."; $lang['isset'] = "Il campo %s deve avere un valore."; $lang['valid_email'] = "Il campo %s deve contenere un indirizzo email valido."; $lang['valid_emails'] = "Il campo %s deve contenere tutti indirizzi email validi."; $lang['valid_url'] = "Il campo %s deve contenere un URL valido."; -$lang['valid_ip'] = "Il campo %s deve contenenre un indirizzo IP valido."; +$lang['valid_ip'] = "Il campo %s deve contenere un indirizzo IP valido."; $lang['min_length'] = "Il campo %s deve essere composto da almeno %s caratteri."; $lang['max_length'] = "Il campo %s deve essere composto da meno di %s caratteri."; -$lang['exact_length'] = "Il campo %s deve essere composto esattamente da %s caratetteri."; -$lang['alpha'] = "Il campo %s deve contenere solo caratterti alfabetici."; +$lang['exact_length'] = "Il campo %s deve essere composto esattamente da %s caratteri."; +$lang['alpha'] = "Il campo %s deve contenere solo caratteri alfabetici."; $lang['alpha_numeric'] = "Il campo %s deve contenere solo caratteri alfa-numerici."; $lang['alpha_dash'] = "Il campo %s deve contenere solo caratteri alfa-numerici, underscore e trattini."; $lang['numeric'] = "Il campo %s deve contenere un numero."; $lang['is_numeric'] = "Il campo %s deve contenere un numero."; $lang['integer'] = "Il campo %s deve contenere un intero."; -$lang['regex_match'] = "The %s field is not in the correct format."; #translate -$lang['matches'] = "Il campo %s non è uguale al campo %s."; -$lang['is_natural'] = "Il campo %s deve contenenre un numero."; +$lang['regex_match'] = "Il campo %s non è nel formato corretto."; +$lang['matches'] = "Il campo %s non è uguale al campo %s."; +$lang['is_natural'] = "Il campo %s deve contenere un numero."; $lang['is_natural_no_zero'] = "Il campo %s deve contenere un numero più grande di zero."; diff --git a/system/codeigniter/language/italian/ftp_lang.php b/system/codeigniter/language/italian/ftp_lang.php index ab90a44af7b..5dd63c056c0 100644 --- a/system/codeigniter/language/italian/ftp_lang.php +++ b/system/codeigniter/language/italian/ftp_lang.php @@ -9,7 +9,7 @@ $lang['ftp_unable_to_login'] = "Impossibile effettuare il login al server FTP. Controllare username e password."; $lang['ftp_unable_to_makdir'] = "Impossibile creare la directory specificata."; $lang['ftp_unable_to_changedir'] = "Impossibile cambiare directory."; -$lang['ftp_unable_to_chmod'] = "Impossibile settare i permessi del file. Controllare l'indirizzo. Note: Questa funzionalità è disponibile solo con PHP 5 o superiore."; +$lang['ftp_unable_to_chmod'] = "Impossibile settare i permessi del file. Controllare l'indirizzo. Note: Questa funzionalità è disponibile solo con PHP 5 o superiore."; $lang['ftp_unable_to_upload'] = "Impossibile eseguire l'upload del file specificato. Controllare l'indirizzo."; $lang['ftp_no_source_file'] = "Impossibile localizzare il file sorgente. Controllare l'indirizzo."; $lang['ftp_unable_to_rename'] = "Impossibile rinominare il file."; diff --git a/system/codeigniter/language/italian/imglib_lang.php b/system/codeigniter/language/italian/imglib_lang.php index f8675d021cf..2b8194434c6 100644 --- a/system/codeigniter/language/italian/imglib_lang.php +++ b/system/codeigniter/language/italian/imglib_lang.php @@ -5,21 +5,21 @@ /* Date 04/11/2010 */ $lang['imglib_source_image_required'] = "Occorre specificare una immagine nelle preferenze."; -$lang['imglib_gd_required'] = "La libreria GD è necessaria per questa funzionalità."; +$lang['imglib_gd_required'] = "La libreria GD è necessaria per questa funzionalità."; $lang['imglib_gd_required_for_props'] = "Il tuo server deve supportare la libreria GD per poter determinare le proprietà dell\'immagine."; $lang['imglib_unsupported_imagecreate'] = "Il tuo server non supporta la libreria GD, necessaria a elaborare questo tipo di immagine."; $lang['imglib_gif_not_supported'] = "Le immagini GIF sono spesso non supportate a causa delle restrizioni della licenza. E' necessario utilizzare il formato JPG o PNG."; $lang['imglib_jpg_not_supported'] = "Le immagini JPG non sono supportate."; $lang['imglib_png_not_supported'] = "Le immagini PNG non sono supportate."; $lang['imglib_jpg_or_png_required'] = "Il protocollo per il resize delle immagini specificato nelle preferenze funziona esclusivamente con immagini di tipo JPEG or PNG."; -$lang['imglib_copy_error'] = "Si è verificato un errore durante il tentativo di sostituire il file. Assicurarsi che la directory sia scrivibile."; +$lang['imglib_copy_error'] = "Si è verificato un errore durante il tentativo di sostituire il file. Assicurarsi che la directory sia scrivibile."; $lang['imglib_rotate_unsupported'] = "La rotazione delle immagini sembra non essere supportata dal tuo server."; -$lang['imglib_libpath_invalid'] = "L'indirizzo della libreria delle immagini non è corretto. Impostare l'indirizzo corretto nei settaggi delle immagini."; +$lang['imglib_libpath_invalid'] = "L'indirizzo della libreria delle immagini non è corretto. Impostare l'indirizzo corretto nei settaggi delle immagini."; $lang['imglib_image_process_failed'] = "Lavorazione dell'immagine fallita. Verificare che il server supporti il protocollo scelto e che l'indirizzo della libreria delle immagini sia corretto."; -$lang['imglib_rotation_angle_required'] = "Un angolo di rotazione è necessario per poter eseguire la rotazione di una immagine."; +$lang['imglib_rotation_angle_required'] = "Un angolo di rotazione è necessario per poter eseguire la rotazione di una immagine."; $lang['imglib_writing_failed_gif'] = "immagine GIF."; -$lang['imglib_invalid_path'] = "L'indirizzo dell'immagine non è corretto."; -$lang['imglib_copy_failed'] = "Il tentativo di copiare l'immagine è fallito."; +$lang['imglib_invalid_path'] = "L'indirizzo dell'immagine non è corretto."; +$lang['imglib_copy_failed'] = "Il tentativo di copiare l'immagine è fallito."; $lang['imglib_missing_font'] = "Impossibile trovare la font da utilizzare."; $lang['imglib_save_failed'] = "Impossibile salvare l'immagine. Verificare che l'immagine e la directory siano scrivibili."; diff --git a/system/codeigniter/language/italian/profiler_lang.php b/system/codeigniter/language/italian/profiler_lang.php index 33e0a6c871a..3c91dea92e8 100644 --- a/system/codeigniter/language/italian/profiler_lang.php +++ b/system/codeigniter/language/italian/profiler_lang.php @@ -12,8 +12,8 @@ $lang['profiler_post_data'] = 'POST DATA'; $lang['profiler_uri_string'] = 'URI STRING'; $lang['profiler_memory_usage'] = 'MEMORY USAGE'; -$lang['profiler_no_db'] = 'Il driver del database non è attualmente caricato'; -$lang['profiler_no_queries'] = 'Nessuna query è stata eseguita'; +$lang['profiler_no_db'] = 'Il driver del database non è attualmente caricato'; +$lang['profiler_no_queries'] = 'Nessuna query è stata eseguita'; $lang['profiler_no_post'] = 'Nessun POST esistente'; $lang['profiler_no_get'] = 'Nessun GET esistente'; $lang['profiler_no_uri'] = 'Nessun URI esistente'; diff --git a/system/codeigniter/language/italian/upload_lang.php b/system/codeigniter/language/italian/upload_lang.php index a55ede96db5..ee197b0d6f2 100644 --- a/system/codeigniter/language/italian/upload_lang.php +++ b/system/codeigniter/language/italian/upload_lang.php @@ -7,19 +7,19 @@ $lang['upload_userfile_not_set'] = "Impossibile trovare nel post una variabile chiamata userfile."; $lang['upload_file_exceeds_limit'] = "Il file supera le dimensioni massime consentite nel file di configurazione del PHP."; $lang['upload_file_exceeds_form_limit'] = "Il file supera le dimensioni massime consentite dall'invio del form."; -$lang['upload_file_partial'] = "Il file &egravae; stato ricevuto solo parzialmente."; -$lang['upload_no_temp_directory'] = "La cartella temporanea è mancante."; +$lang['upload_file_partial'] = "Il file è stato ricevuto solo parzialmente."; +$lang['upload_no_temp_directory'] = "La cartella temporanea è mancante."; $lang['upload_unable_to_write_file'] = "Il file non può essere scritto su disco."; -$lang['upload_stopped_by_extension'] = "L'upload del file è stato interrotto dall\'estensione."; -$lang['upload_no_file_selected'] = "Non è stato selezionato nessun file da caricare."; -$lang['upload_invalid_filetype'] = "Il tipo di file che si sta cercando di caricare non è consentito."; +$lang['upload_stopped_by_extension'] = "L'upload del file è stato interrotto dall\'estensione."; +$lang['upload_no_file_selected'] = "Non è stato selezionato nessun file da caricare."; +$lang['upload_invalid_filetype'] = "Il tipo di file che si sta cercando di caricare non è consentito."; $lang['upload_invalid_filesize'] = "La dimensione del file che si sta cercando di caricare supera il limite consentito."; $lang['upload_invalid_dimensions'] = "L'immagine che si sta cercando di caricare supera il limite massimo di altezza e larghezza."; -$lang['upload_destination_error'] = "Si è verificato un problema durante il tentativo di spostamento del file alla sua destinazione finale."; -$lang['upload_no_filepath'] = "Il percorso di upload non è valido."; +$lang['upload_destination_error'] = "Si è verificato un problema durante il tentativo di spostamento del file alla sua destinazione finale."; +$lang['upload_no_filepath'] = "Il percorso di upload non è valido."; $lang['upload_no_file_types'] = "Non sono stati specificati i tipi di file permessi."; -$lang['upload_bad_filename'] = "Il nome del file che è stato inviato è già presente sul server."; -$lang['upload_not_writable'] = "La cartella di upload non è scrivibile."; +$lang['upload_bad_filename'] = "Il nome del file che è stato inviato è già presente sul server."; +$lang['upload_not_writable'] = "La cartella di upload non è scrivibile."; /* End of file upload_lang.php */