r64364 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64363‎ | r64364 | r64365 >
Date:22:18, 29 March 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Made edit buttons on StoryReview point to Story/storyTitle?action=edit
Modified paths:
  • /trunk/extensions/Storyboard/Storyboard.php (modified) (history)
  • /trunk/extensions/Storyboard/specials/Story/Story_body.php (modified) (history)
  • /trunk/extensions/Storyboard/specials/StoryReview/StoryReview_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Storyboard/specials/Story/Story_body.php
@@ -100,11 +100,11 @@
101101 if ( $wgUser->isAllowed( 'storyreview' ) ) {
102102 global $wgParser;
103103
104 - $wgOut->addWikiMsg(
105 - $wgParser->recursiveTagParse(
 104+ $wgOut->addWikiMsgArray(
 105+ //$wgParser->recursiveTagParse(
106106 'storyboard-canedit',
107107 $this->getTitle()->getLocalURL( 'action=edit' )
108 - )
 108+ //)
109109 );
110110 }
111111 }
Index: trunk/extensions/Storyboard/specials/StoryReview/StoryReview_body.php
@@ -101,20 +101,22 @@
102102 $title = htmlspecialchars( $story->story_title );
103103 $text = htmlspecialchars( $story->story_text );
104104
105 - // TODO: htmlspecialchars the messages?
106 -
107105 $publishAction = $story->story_is_published ? 'unpublish' : 'publish';
108106 // Uses storyboard-unpublish or storyboard-publish
109 - $publishMsg = wfMsg( "storyboard-$publishAction" );
 107+ $publishMsg = htmlspecialchars( wfMsg( "storyboard-$publishAction" ) );
110108
111109 $imageAction = $story->story_image_hidden ? 'unhideimage' : 'hideimage';
112110 // Uses storyboard-unhideimage or storyboard-hideimage
113 - $imageMsg = wfMsg( "storyboard-$imageAction" );
 111+ $imageMsg = htmlspecialchars( wfMsg( "storyboard-$imageAction" ) );
114112
115 - $editMsg = wfMsg( 'edit' );
116 - $hideMsg = wfMsg( 'hide' );
117 - $deleteImageMsg = wfMsg( 'storyboard-deleteimage' );
 113+ $editMsg = htmlspecialchars( wfMsg( 'edit' ) );
 114+ $hideMsg = htmlspecialchars( wfMsg( 'hide' ) );
 115+ $deleteImageMsg = htmlspecialchars( wfMsg( 'storyboard-deleteimage' ) );
118116
 117+ // TODO: add some returnto feature here
 118+ $editUrl = SpecialPage::getTitleFor( 'story', $story->story_title )->getFullURL('action=edit');
 119+ $editUrl = Xml::escapeJsString( $editUrl );
 120+
119121 return <<<EOT
120122 <table width="100%" border="1" id="story_$story->story_id">
121123 <tr>
@@ -129,7 +131,7 @@
130132 <tr>
131133 <td align="center" height="35">
132134 <button type="button" onclick="stbDoStoryAction( this, $story->story_id, '$publishAction' )">$publishMsg</button>&nbsp;&nbsp;&nbsp;
133 - <button type="button" onclick="">$editMsg</button>&nbsp;&nbsp;&nbsp;
 135+ <button type="button" onclick="window.location='$editUrl'">$editMsg</button>&nbsp;&nbsp;&nbsp;
134136 <button type="button" onclick="stbDoStoryAction( this, $story->story_id, 'hide' )">$hideMsg</button>&nbsp;&nbsp;&nbsp;
135137 <button type="button" onclick="stbDoStoryAction( this, $story->story_id, '$imageAction' )">$imageMsg</button>&nbsp;&nbsp;&nbsp;
136138 <button type="button" onclick="stbDeleteStoryImage( this, $story->story_id )">$deleteImageMsg</button>
Index: trunk/extensions/Storyboard/Storyboard.php
@@ -98,6 +98,7 @@
9999 }
100100
101101 function efStoryboardAddStoryEditAction( &$content_actions ) {
 102+ // TODO: currently not having any affect on Special:Story for some reason
102103 global $wgRequest, $wgRequest, $wgTitle;
103104
104105 $action = $wgRequest->getText( 'action' );

Status & tagging log