Isarra has uploaded a new change for review.
https://gerrit.wikimedia.org/r/315117
Change subject: Fix coding style, remove some outdated comments, extra var_dumb
......................................................................
Fix coding style, remove some outdated comments, extra var_dumb
Change-Id: Ia2a94ca954080721dcc5b7b7dec902bb3a672cb0
---
M includes/content/CollaborationHubContent.php
M includes/content/CollaborationHubContentSchema.php
M includes/content/CollaborationListContent.php
3 files changed, 51 insertions(+), 67 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit
refs/changes/17/315117/1
diff --git a/includes/content/CollaborationHubContent.php
b/includes/content/CollaborationHubContent.php
index 62c359d..f85d132 100644
--- a/includes/content/CollaborationHubContent.php
+++ b/includes/content/CollaborationHubContent.php
@@ -220,7 +220,6 @@
$html .= Html::rawElement(
'div',
[ 'class' => 'wp-header-image' ],
- // TODO move all image stuff to ToC class (what is that
class even going to be, anyway?)
$this->getParsedImage( $this->getImage(), 200 )
);
// get members list
@@ -316,31 +315,31 @@
if ( $membersTitle->exists() ) {
$membersContent = Revision::newFromTitle( $membersTitle
)->getContent();
$wikitext = $membersContent->convertToWikitext(
- $lang,
- [
- 'includeDesc'
=> false,
- 'maxItems' => 3,
- 'defaultSort'
=> 'random'
- ]
- );
+ $lang,
+ [
+ 'includeDesc' => false,
+ 'maxItems' => 3,
+ 'defaultSort' => 'random'
+ ]
+ );
$membersListHtml = $wgParser->parse( $wikitext,
$membersTitle, $options )->getText();
// rawElement is used because we don't want [edit]
links or usual header behavior
$membersHeader = Html::rawElement(
-
'h3',
-
[ 'style' => 'text-align: center; padding-bottom: 1em;' ],
-
wfMessage( 'collaborationkit-hub-members-header' )
- );
+ 'h3',
+ [ 'style' => 'text-align: center;
padding-bottom: 1em;' ],
+ wfMessage(
'collaborationkit-hub-members-header' )
+ );
$membersViewButton = new OOUI\ButtonWidget( [
-
'label' => wfMessage( 'collaborationkit-hub-members-view'
)->inContentLanguage()->text(),
-
'href' => $membersTitle->getLinkURL()
- ] );
+ 'label' => wfMessage(
'collaborationkit-hub-members-view' )->inContentLanguage()->text(),
+ 'href' => $membersTitle->getLinkURL()
+ ] );
$membersJoinButton = new OOUI\ButtonWidget( [
-
'label' => wfMessage( 'collaborationkit-hub-members-signup'
)->inContentLanguage()->text(),
-
'href' => $membersTitle->getEditURL(), // Going through editor is non-JS
fallback
-
'flags' => [ 'primary', 'progressive' ]
- ] );
+ 'label' => wfMessage(
'collaborationkit-hub-members-signup' )->inContentLanguage()->text(),
+ 'href' => $membersTitle->getEditURL(), // Going
through editor is non-JS fallback
+ 'flags' => [ 'primary', 'progressive' ]
+ ] );
OutputPage::setupOOUI();
$text = $membersHeader . $membersListHtml .
$membersViewButton->toString() . $membersJoinButton->toString();
@@ -370,19 +369,22 @@
protected function getParsedAnnouncements( Title $title, ParserOptions
$options ) {
$announcementsSubpageName = wfMessage(
'collaborationkit-hub-pagetitle-announcements' )->inContentLanguage()->text();
$announcementsTitle = Title::newFromText( $title->getFullText()
. '/' . $announcementsSubpageName );
+
if ( $announcementsTitle->exists() ) {
$announcementsWikiPage = WikiPage::factory(
$announcementsTitle );
$announcementsText =
$announcementsWikiPage->getContent()->getParserOutput( $announcementsTitle
)->getText();
$announcementsEditLink = Html::rawElement(
-
"a",
-
[ 'href' => $announcementsTitle->getEditURL() ],
-
wfMessage( 'edit' ) );
+ 'a',
+ [ 'href' => $announcementsTitle->getEditURL() ],
+ wfMessage( 'edit' )
+ );
$announcementsHeader = Html::rawElement(
-
"h3",
-
(object)[],
-
$announcementsSubpageName . ' [' .
$announcementsEditLink . ']' );
+ 'h3',
+ (object)[],
+ "$announcementsSubpageName
[$announcementsEditLink]"
+ );
return $announcementsHeader . $announcementsText;
}
}
diff --git a/includes/content/CollaborationHubContentSchema.php
b/includes/content/CollaborationHubContentSchema.php
index 05df63a..adb02a4 100644
--- a/includes/content/CollaborationHubContentSchema.php
+++ b/includes/content/CollaborationHubContentSchema.php
@@ -1,28 +1,21 @@
<?php
return [
'type' => 'object',
- 'properties' =>
- [
- 'introduction' =>
- [
+ 'properties' => [
+ 'introduction' => [
'type' => 'string',
],
- 'footer' =>
- [
+ 'footer' => [
'type' => 'string',
],
- 'display_name' =>
- [
+ 'display_name' => [
'type' => 'string',
],
- 'image' =>
- [
+ 'image' => [
'type' => 'string',
],
- 'colour' =>
- [
- 'enum' =>
- [
+ 'colour' => [
+ 'enum' => [
0 => 'red1',
1 => 'red2',
2 => 'grey1',
@@ -48,38 +41,28 @@
22 => 'black',
],
],
- 'content' =>
- [
+ 'content' => [
'type' => 'array',
- 'items' =>
- [
- [
- 'type' => 'object',
- 'properties' =>
- [
- 'title' =>
- [
- 'type' =>
'string',
- ],
- 'image' =>
- [
- 'type' =>
'string',
- ],
- 'display_title' =>
- [
- 'type' =>
'string',
- ],
- ],
- 'required' =>
- [
- 0 => 'title',
+ 'items' => [ [
+ 'type' => 'object',
+ 'properties' => [
+ 'title' => [
+ 'type' => 'string',
+ ],
+ 'image' => [
+ 'type' => 'string',
+ ],
+ 'display_title' => [
+ 'type' => 'string',
],
],
- ],
+ 'required' => [
+ 0 => 'title',
+ ],
+ ] ],
],
],
- 'required' =>
- [
+ 'required' => [
0 => 'content',
],
];
diff --git a/includes/content/CollaborationListContent.php
b/includes/content/CollaborationListContent.php
index 33d32aa..f10cce9 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -235,7 +235,6 @@
// you also need to change it in the
stylesheet.
$text .= '[[File:' . $image->getName()
. "|left|64px|alt=]]\n";
} else {
-var_dump( $options );
if ( $options['ismemberlist'] ) {
$placeholderIcon =
'mw-ckicon-user-grey2';
} else {
--
To view, visit https://gerrit.wikimedia.org/r/315117
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2a94ca954080721dcc5b7b7dec902bb3a672cb0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Isarra <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits