Index: trunk/extensions/PageSchemas/PS_Tabs.php |
— | — | @@ -16,17 +16,19 @@ |
17 | 17 | return true; |
18 | 18 | } |
19 | 19 | |
| 20 | + $category = $title->getText(); |
| 21 | + $pageSchemaObj = new PSSchema( $category ); |
| 22 | + $isPSDefined = $pageSchemaObj->isPSDefined(); |
| 23 | + |
20 | 24 | global $wgRequest; |
21 | 25 | |
22 | 26 | $content_actions['editschema'] = array( |
23 | | - 'text' => wfMsg( 'editschema' ), |
| 27 | + 'text' => ( $isPSDefined ) ? wfMsg( 'editschema' ) : wfMsg( 'createschema' ), |
24 | 28 | 'class' => $wgRequest->getVal( 'action' ) == 'editschema' ? 'selected' : '', |
25 | 29 | 'href' => $title->getLocalURL( 'action=editschema' ) |
26 | 30 | ); |
27 | 31 | |
28 | | - $category = $title->getText(); |
29 | | - $pageSchemaObj = new PSSchema( $category ); |
30 | | - if ( $pageSchemaObj->isPSDefined() ) { |
| 32 | + if ( $isPSDefined ) { |
31 | 33 | $content_actions['generatepages'] = array( |
32 | 34 | 'text' => wfMsg( 'generatepages' ), |
33 | 35 | 'class' => $wgRequest->getVal( 'action' ) == 'generatepages' ? 'selected' : '', |
Index: trunk/extensions/PageSchemas/specials/PS_EditSchema.php |
— | — | @@ -530,11 +530,13 @@ |
531 | 531 | $row = $dbr->fetchRow( $res ); |
532 | 532 | if ( $row == null && !$title->exists() ) { |
533 | 533 | // Category doesn't exist. |
| 534 | + $wgOut->setPageTitle( wfMsg( 'createschema' ) ); |
534 | 535 | $text = '<p>' . wfMsg( 'ps-page-desc-cat-not-exist' ) . '</p>'; |
535 | 536 | $text .= self::printForm(); |
536 | 537 | } elseif ( ( $row[1] != 'PageSchema' ) || ( $row[2] == null ) ) { |
537 | 538 | // Category exists, but has no page schema. |
538 | 539 | $text = '<p>' . wfMsg( 'ps-page-desc-ps-not-exist' ) . '</p>'; |
| 540 | + $wgOut->setPageTitle( wfMsg( 'createschema' ) ); |
539 | 541 | $text .= self::printForm(); |
540 | 542 | } else { |
541 | 543 | // It's a category with an existing page schema - |