Isarra has uploaded a new change for review.

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

Change subject: Add support for editing the icon field to 
specialeditcollaborationhub
......................................................................

Add support for editing the icon field to specialeditcollaborationhub

Since images are important. Proper icon selection is still needed, but
I'll make a mockup for a js interface for that.

Change-Id: Ic57dd8dfd26c845c8afc1f53759c67b23866dac4
---
M i18n/en.json
M i18n/qqq.json
M includes/SpecialEditCollaborationHub.php
M includes/content/CollaborationHubContentHandler.php
4 files changed, 22 insertions(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/03/295903/1

diff --git a/i18n/en.json b/i18n/en.json
index 4b723f7..206e4ad 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -13,6 +13,8 @@
        "collaborationkit-edit-pagetitle": "Editing $1",
        "collaborationkit-edit-hub-name": "Collaboration Hub display name",
        "collaborationkit-edit-page-name": "Page display name",
+       "collaborationjit-edit-hub-icon": "Project image",
+       "collaborationjit-edit-page-icon": "Page icon",
        "collaborationkit-edit-page-type": "Page type",
        "collaborationkit-edit-description": "Description",
        "collaborationkit-edit-content": "Content",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 2d24c4e..59d1a2e 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -13,6 +13,8 @@
        "collaborationkit-edit-pagetitle": "Replaces the page title on 
Special:EditCollaborationHub to mimic the title of action=edit",
        "collaborationkit-edit-hub-name": "Label for hub display name input on 
Special:EditCollaborationHub for collaboration hub mainpages, which in their 
case is also the page display name",
        "collaborationkit-edit-page-name": "Label for page display name input 
on Special:EditCollaborationHub",
+       "collaborationjit-edit-hub-icon": "Label for the image input on 
Special:EditCollaborationHub on hubs",
+       "collaborationjit-edit-page-icon": "Label for the image input on 
Special:EditCollaborationHub on subpages",
        "collaborationkit-edit-page-type": "Label for the page type dropdown on 
Special:EditCollaborationHub",
        "collaborationkit-edit-description": "Label for the description 
textarea on Special:EditCollaborationHub",
        "collaborationkit-edit-content": "Label for the content textarea on 
Special:EditCollaborationHub",
diff --git a/includes/SpecialEditCollaborationHub.php 
b/includes/SpecialEditCollaborationHub.php
index 9d0e2d6..496358b 100644
--- a/includes/SpecialEditCollaborationHub.php
+++ b/includes/SpecialEditCollaborationHub.php
@@ -147,6 +147,7 @@
                $pageType = $pageContent->getPageType();
                $contentType = $pageContent->getContentType();
                $content = $pageContent->getContent();
+               $icon = $pageContent->getIcon();
 
                // Get the more complicated bits
                if ( $contentType !== 'wikitext' ) {
@@ -158,16 +159,18 @@
 
                // Check which label to use for page_name
                if ( $pageType == 'main' ) {
-                       $label = 'collaborationkit-edit-hub-name';
+                       $nameLabel = 'collaborationkit-edit-hub-name';
+                       $iconLabel = 'collaborationjit-edit-hub-icon';
                } else {
-                       $label = 'collaborationkit-edit-page-name';
+                       $nameLabel = 'collaborationkit-edit-page-name';
+                       $iconLabel = 'collaborationjit-edit-page-icon';
                }
                $formJunk['page_name'] = array(
                        'type' => 'text',
                        'maxlength' => 255,
                        'size' => 40,
                        'default' => ( $pageName !== null ) ? $pageName : '',
-                       'label-message' => $label,
+                       'label-message' => $nameLabel,
                        'cssclass' => 'ext-ck-edit-pagename',
                );
 
@@ -194,6 +197,14 @@
                        );
                }
 
+               $formJunk['icon'] = array(
+                       'type' => 'text',
+                       'default' => $icon,
+                       'maxlength' => 255,
+                       'size' => 50,
+                       'label-message' => $iconLabel,
+                       'cssclass' => 'ext-ck-edit-icon',
+               );
                $formJunk['description'] = array(
                        'type' => 'textarea',
                        'rows' => 4,
@@ -326,6 +337,7 @@
                $editResult = CollaborationHubContentHandler::edit(
                        $this->title,
                        $data['page_name'],
+                       $data['icon'],
                        $pageType,
                        $contentType,
                        $data['description'],
diff --git a/includes/content/CollaborationHubContentHandler.php 
b/includes/content/CollaborationHubContentHandler.php
index 2cc9dca..d082ca6 100644
--- a/includes/content/CollaborationHubContentHandler.php
+++ b/includes/content/CollaborationHubContentHandler.php
@@ -60,10 +60,11 @@
         * @param IContextSource $context The calling context
         * @return Status
         */
-       public static function edit( Title $title, $pageName, $pageType, 
$contentType, $description, $content, $summary, IContextSource $context ) {
+       public static function edit( Title $title, $pageName, $icon, $pageType, 
$contentType, $description, $content, $summary, IContextSource $context ) {
                $contentBlock = array(
                        'page_name' => $pageName,
-                       'description' => $description
+                       'description' => $description,
+                       'icon' => $icon
                );
                if ( $contentType == 'wikitext' ) {
                        $contentBlock['content'] = $content;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic57dd8dfd26c845c8afc1f53759c67b23866dac4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Isarra <zhoris...@gmail.com>

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

Reply via email to