Index: trunk/extensions/CodeReview/CodeReview.i18n.php |
— | — | @@ -31,6 +31,7 @@ |
32 | 32 | 'code-authors' => 'authors', |
33 | 33 | 'code-status' => 'states', |
34 | 34 | 'code-tags' => 'tags', |
| 35 | + 'code-tags-no-tags' => 'No tags exist in this repository.', |
35 | 36 | 'code-authors-text' => 'Below is a list of repo authors in order of commit name. Local wiki accounts are shown in parentheses. Data may be cached.', |
36 | 37 | 'code-author-haslink' => 'This author is linked to the wiki user $1', |
37 | 38 | 'code-author-orphan' => 'This author has no link with a wiki account', |
Index: trunk/extensions/CodeReview/ui/CodeTagListView.php |
— | — | @@ -12,8 +12,13 @@ |
13 | 13 | $name = $this->mRepo->getName(); |
14 | 14 | $list = $this->mRepo->getTagList(); |
15 | 15 | |
16 | | - $tc = new WordCloud( $list, array( $this, 'linkCallback' ) ); |
17 | | - $wgOut->addHTML( $tc->showCloud() ); |
| 16 | + if( 0 === count( $list ) ) { |
| 17 | + $wgOut->addWikiText( wfMsg( 'code-tags-no-tags' ) ); |
| 18 | + } else { |
| 19 | + # Show a cloud made of tags |
| 20 | + $tc = new WordCloud( $list, array( $this, 'linkCallback' ) ); |
| 21 | + $wgOut->addHTML( $tc->showCloud() ); |
| 22 | + } |
18 | 23 | } |
19 | 24 | |
20 | 25 | public function linkCallback( $tag, $weight ) { |
Index: trunk/extensions/CodeReview/ui/WordCloud.php |
— | — | @@ -85,6 +85,9 @@ |
86 | 86 | * @return String |
87 | 87 | */ |
88 | 88 | public function showCloud() { |
| 89 | + if( 0 === count( $this->wordsArray ) ) { |
| 90 | + return; |
| 91 | + } |
89 | 92 | $this->shuffleCloud(); |
90 | 93 | $max = max( $this->wordsArray ); |
91 | 94 | if( is_array( $this->wordsArray ) ) { |