Miguel2706 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/135048

Change subject: Creating the extension
......................................................................

Creating the extension

Change-Id: I55f43fa471e9ce6b91b0642c74049e6a6f6bd067
---
A i18n/en.json
A i18n/es.json
A visualchat.alias.php
A visualchat.i18n.php
A visualchat.php
A visualchat.special.php
6 files changed, 169 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualChat 
refs/changes/48/135048/1

diff --git a/i18n/en.json b/i18n/en.json
new file mode 100644
index 0000000..8b33e77
--- /dev/null
+++ b/i18n/en.json
@@ -0,0 +1,22 @@
+{
+    "@metadata": {
+        "authors": [
+            "Miguel2706"
+        ]
+    },
+    "updatemediawiki": "Update MediaWiki",
+    "updatemediawiki-desc": "Allows updating MediaWiki via a special page",
+    "updatemediawiki-current": "Current version",
+    "updatemediawiki-update-nofound": "No update is available",
+    "updatemediawiki-update-found": "New update found",
+    "updatemediawiki-update-downloading": "Downloading new update",
+    "updatemediawiki-update-saved": "Update downloaded and saved",
+    "updatemediawiki-update-exist": "Update already downloaded",
+    "updatemediawiki-update-copyready": "Copy ready",
+    "updatemediawiki-update-database": "Update the data base now?",
+    "updatemediawiki-update-updateready": "Update ready",
+    "updatemediawiki-update-install": "Install now?",
+    "updatemediawiki-update-updated": "MediaWiki updated to version $1",
+    "updatemediawiki-update-error": "Could not find latest realeases",
+    "updatemediawiki-update-aborted": "Could not save new update. Operation 
aborted"
+}
diff --git a/i18n/es.json b/i18n/es.json
new file mode 100644
index 0000000..10a86e6
--- /dev/null
+++ b/i18n/es.json
@@ -0,0 +1,22 @@
+{
+    "@metadata": {
+        "authors": [
+            "Miguel2706"
+        ]
+    },
+    "updatemediawiki": "Actualizar MediaWiki",
+    "updatemediawiki-desc": "Permite a los administradores y usuarios 
autorizados actualizar MediaWiki desde una página especial.",
+    "updatemediawiki-current": "Versión Actual",
+    "updatemediawiki-update-nofound": "No hay actualizaciones disponibles",
+    "updatemediawiki-update-found": "Nueva actualización encontrada",
+    "updatemediawiki-update-downloading": "Descargando nueva actualización",
+    "updatemediawiki-update-saved": "Nueva actualización descargada y 
guardada",
+    "updatemediawiki-update-exist": "La actualización ya se había descargado",
+    "updatemediawiki-update-copyready": "Copia lista",
+    "updatemediawiki-update-database": "¿Actualizar la base de datos ahora?",
+    "updatemediawiki-update-updateready": "Actualización lista",
+    "updatemediawiki-update-install": "¿Instalar ahora?",
+    "updatemediawiki-update-updated": "MediaWiki actualizado a la versión",
+    "updatemediawiki-update-error": "No se pudo obtener las últimas 
actualizaciones",
+    "updatemediawiki-update-aborted": "No se pudo descargar la actualización. 
Operación abortada"
+}
diff --git a/visualchat.alias.php b/visualchat.alias.php
new file mode 100644
index 0000000..411c3d9
--- /dev/null
+++ b/visualchat.alias.php
@@ -0,0 +1,28 @@
+<?php
+/*********************************************************************
+*
+* Aliases for VisualChat
+*
+* This file is part of the VisualChat extension for MediaWiki
+* @file
+* @ingroup Extensions
+* @author Miguel Peláez <miguel2706outlook.com>
+* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 
or later
+* @link http://www.mediawiki.org/wiki/Extension:VisualChat Documentation
+**********************************************************************/
+
+$specialPageAliases = array();
+
+/** English
+ * @author Miguel2706
+ */
+$specialPageAliases[ 'en' ] = array(
+       'visualchat' => array( 'VisualChat', 'Visual Chat' ),
+);
+
+/** Spanish
+ * @author Miguel2706
+ */
+$specialPageAliases[ 'es' ] = array(
+       'visualchat' => array( 'VisualChat', 'Visual Chat' ),
+);
diff --git a/visualchat.i18n.php b/visualchat.i18n.php
new file mode 100644
index 0000000..1802b2b
--- /dev/null
+++ b/visualchat.i18n.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * This is a backwards-compatibility shim, generated by:
+ * 
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php
+ *
+ * Beginning with MediaWiki 1.23, translation strings are stored in json files,
+ * and the EXTENSION.i18n.php file only exists to provide compatibility with
+ * older releases of MediaWiki. For more information about this migration, see:
+ * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format
+ *
+ * This shim maintains compatibility back to MediaWiki 1.17.
+ */
+$messages = array();
+if ( !function_exists( 'wfJsonI18nShim9648fbddfca06a8b' ) ) {
+       function wfJsonI18nShim9648fbddfca06a8b( $cache, $code, &$cachedData ) {
+               $codeSequence = array_merge( array( $code ), 
$cachedData['fallbackSequence'] );
+               foreach ( $codeSequence as $csCode ) {
+                       $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json";
+                       if ( is_readable( $fileName ) ) {
+                               $data = FormatJson::decode( file_get_contents( 
$fileName ), true );
+                               foreach ( array_keys( $data ) as $key ) {
+                                       if ( $key === '' || $key[0] === '@' ) {
+                                               unset( $data[$key] );
+                                       }
+                               }
+                               $cachedData['messages'] = array_merge( $data, 
$cachedData['messages'] );
+                       }
+
+                       $cachedData['deps'][] = new FileDependency( $fileName );
+               }
+               return true;
+       }
+
+       $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 
'wfJsonI18nShim9648fbddfca06a8b';
+}
diff --git a/visualchat.php b/visualchat.php
new file mode 100644
index 0000000..9fbee40
--- /dev/null
+++ b/visualchat.php
@@ -0,0 +1,36 @@
+<?php
+
+/*********************************************************************
+**
+** This file is part of the VisualChat extension for MediaWiki
+* @file
+* @ingroup Extensions
+* @author Miguel Peláez <miguel2706outlook.com>
+* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 
or later
+* @link http://www.mediawiki.org/wiki/Extension:VisualChat Documentation
+**********************************************************************/
+
+# Alert the user that this is not a valid access point to MediaWiki if they 
try to access the special pages file directly.
+if ( !defined( 'MEDIAWIKI' ) ) {
+        echo <<<EOT
+To install the VisualChat extension, put the following line in 
LocalSettings.php:
+require_once( "\$IP/extensions/visualchat/visualchat.php" );
+Run this file is not required.
+EOT;
+        exit( 1 );
+}
+
+$wgExtensionCredits['specialpage'][] = array(
+       'path' => __FILE__,
+       'name' => 'VisualChat',
+       'author' =>'Miguel Peláez',
+       'url' => 'https://www.mediawiki.org/wiki/Extension:VisualChat',
+       'descriptionmsg' => 'visualchat-desc',
+       'version'  => '0.3.0',
+);
+
+$wgAutoloadClasses[ 'SpecialVisualChat' ] = __DIR__ . '/SpecialVisualChat.php';
+$wgMessagesDirs['visualchat'] = __DIR__ . '/i18n';
+$wgExtensionMessagesFiles[ 'visualchat' ] = __DIR__ . '/visualchat.i18n.php';
+$wgSpecialPages[ 'visualchat' ] = 'VisualChat';
+$wgExtensionMessagesFiles['visualchatAlias'] = dirname( __FILE__ ) . 
'/visualchat.alias.php';
diff --git a/visualchat.special.php b/visualchat.special.php
new file mode 100644
index 0000000..8db25aa
--- /dev/null
+++ b/visualchat.special.php
@@ -0,0 +1,26 @@
+<?php
+/*********************************************************************
+**
+** This file is part of the VisualChat extension for MediaWiki
+* @file
+* @ingroup Extensions
+* @author Miguel Peláez <miguel2706outlook.com>
+* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 
or later
+* @link http://www.mediawiki.org/wiki/Extension:VisualChat Documentation
+**********************************************************************/
+class SpecialVisualChat extends SpecialPage {
+       function __construct() {
+               #TODO: Allow to restricting the indicated group
+               parent::__construct( 'VisualChat');
+       }
+ 
+       function execute( $par ) {
+               $request = $this->getRequest();
+               $output = $this->getOutput();
+               $this->setHeaders();
+ 
+               # Show the HTML text
+               $wikitext = 'Hello world!';
+               $output->addWikiText( $wikitext );
+       }
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/135048
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I55f43fa471e9ce6b91b0642c74049e6a6f6bd067
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualChat
Gerrit-Branch: master
Gerrit-Owner: Miguel2706 <miguel2...@outlook.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to