Index: trunk/extensions/SemanticForms/specials/SF_CreateCategory.php |
— | — | @@ -11,29 +11,8 @@ |
12 | 12 | global $IP; |
13 | 13 | require_once( "$IP/includes/SpecialPage.php" ); |
14 | 14 | |
15 | | -global $sfgSpecialPagesSpecialInit; |
16 | | -if ($sfgSpecialPagesSpecialInit) { |
17 | | - global $wgSpecialPages; |
18 | | - $wgSpecialPages['CreateCategory'] = 'SFCreateCategory'; |
| 15 | +SpecialPage::addPage( new SpecialPage('CreateCategory','',true,'doSpecialCreateCategory',false) ); |
19 | 16 | |
20 | | - class SFCreateCategory extends SpecialPage { |
21 | | - |
22 | | - /** |
23 | | - * Constructor |
24 | | - */ |
25 | | - public function __construct() { |
26 | | - smwfInitUserMessages(); |
27 | | - parent::__construct('CreateCategory', '', true); |
28 | | - } |
29 | | - |
30 | | - function execute() { |
31 | | - doSpecialCreateCategory(); |
32 | | - } |
33 | | - } |
34 | | -} else { |
35 | | - SpecialPage::addPage( new SpecialPage('CreateCategory','',true,'doSpecialCreateCategory',false) ); |
36 | | -} |
37 | | - |
38 | 17 | function createCategoryText($default_form, $category_name, $parent_category) { |
39 | 18 | global $sfgContLang; |
40 | 19 | |
Index: trunk/extensions/SemanticForms/specials/SF_AddData.php |
— | — | @@ -12,29 +12,8 @@ |
13 | 13 | global $IP; |
14 | 14 | require_once( "$IP/includes/SpecialPage.php" ); |
15 | 15 | |
16 | | -global $sfgSpecialPagesSpecialInit; |
17 | | -if ($sfgSpecialPagesSpecialInit) { |
18 | | - global $wgSpecialPages; |
19 | | - $wgSpecialPages['AddData'] = 'SFAddData'; |
20 | | - |
21 | | - class SFAddData extends SpecialPage { |
| 16 | +SpecialPage::addPage( new SpecialPage('AddData','',true,'doSpecialAddData',false) ); |
22 | 17 | |
23 | | - /** |
24 | | - * Constructor |
25 | | - */ |
26 | | - public function __construct() { |
27 | | - smwfInitUserMessages(); |
28 | | - SpecialPage::SpecialPage('AddData','',true,'doSpecialAddData',false); |
29 | | - } |
30 | | - |
31 | | - function execute($query='') { |
32 | | - doSpecialAddData($query); |
33 | | - } |
34 | | - } |
35 | | -} else { |
36 | | - SpecialPage::addPage( new SpecialPage('AddData','',true,'doSpecialAddData',false) ); |
37 | | -} |
38 | | - |
39 | 18 | function doSpecialAddData($query = '') { |
40 | 19 | global $wgRequest; |
41 | 20 | |
Index: trunk/extensions/SemanticForms/specials/SF_AddPage.php |
— | — | @@ -12,29 +12,8 @@ |
13 | 13 | global $IP; |
14 | 14 | require_once( "$IP/includes/SpecialPage.php" ); |
15 | 15 | |
16 | | -global $sfgSpecialPagesSpecialInit; |
17 | | -if ($sfgSpecialPagesSpecialInit) { |
18 | | - global $wgSpecialPages; |
19 | | - $wgSpecialPages['AddPage'] = 'SFAddPage'; |
20 | | - |
21 | | - class SFAddPage extends SpecialPage { |
| 16 | +SpecialPage::addPage( new SpecialPage('AddPage','',true,'doSpecialAddPage',false) ); |
22 | 17 | |
23 | | - /** |
24 | | - * Constructor |
25 | | - */ |
26 | | - public function __construct() { |
27 | | - smwfInitUserMessages(); |
28 | | - parent::__construct('AddPage', '', true); |
29 | | - } |
30 | | - |
31 | | - function execute($query='') { |
32 | | - doSpecialAddPage($query); |
33 | | - } |
34 | | - } |
35 | | -} else { |
36 | | - SpecialPage::addPage( new SpecialPage('AddPage','',true,'doSpecialAddPage',false) ); |
37 | | -} |
38 | | - |
39 | 18 | function doSpecialAddPage($query = '') { |
40 | 19 | global $wgOut, $wgRequest, $sfgScriptPath; |
41 | 20 | |
Index: trunk/extensions/SemanticForms/specials/SF_Forms.php |
— | — | @@ -10,31 +10,8 @@ |
11 | 11 | global $IP; |
12 | 12 | require_once( "$IP/includes/SpecialPage.php" ); |
13 | 13 | |
14 | | -global $sfgSpecialPagesSpecialInit; |
15 | | -if ($sfgSpecialPagesSpecialInit) { |
16 | | - global $wgSpecialPages; |
17 | | - $wgSpecialPages['Forms'] = 'SFForms'; |
18 | | - |
19 | | - class SFForms extends SpecialPage { |
| 14 | +SpecialPage::addPage( new SpecialPage('Forms','',true,'doSpecialForms',false) ); |
20 | 15 | |
21 | | - /** |
22 | | - * Constructor |
23 | | - */ |
24 | | - public function __construct() { |
25 | | - smwfInitUserMessages(); |
26 | | - parent::__construct('Forms', '', true); |
27 | | - } |
28 | | - |
29 | | - function execute() { |
30 | | - list( $limit, $offset ) = wfCheckLimits(); |
31 | | - $rep = new FormsPage(); |
32 | | - return $rep->doQuery( $offset, $limit ); |
33 | | - } |
34 | | - } |
35 | | -} else { |
36 | | - SpecialPage::addPage( new SpecialPage('Forms','',true,'doSpecialForms',false) ); |
37 | | -} |
38 | | - |
39 | 16 | class FormsPage extends QueryPage { |
40 | 17 | function getName() { |
41 | 18 | return "Forms"; |
Index: trunk/extensions/SemanticForms/specials/SF_CreateForm.php |
— | — | @@ -12,29 +12,8 @@ |
13 | 13 | require_once( "$IP/includes/SpecialPage.php" ); |
14 | 14 | require_once( "$sfgIP/includes/SF_FormClasses.inc" ); |
15 | 15 | |
16 | | -global $sfgSpecialPagesSpecialInit; |
17 | | -if ($sfgSpecialPagesSpecialInit) { |
18 | | - global $wgSpecialPages; |
19 | | - $wgSpecialPages['CreateForm'] = 'SFCreateForm'; |
20 | | - |
21 | | - class SFCreateForm extends SpecialPage { |
| 16 | +SpecialPage::addPage( new SpecialPage('CreateForm','',true,'doSpecialCreateForm',false) ); |
22 | 17 | |
23 | | - /** |
24 | | - * Constructor |
25 | | - */ |
26 | | - public function __construct() { |
27 | | - smwfInitUserMessages(); |
28 | | - parent::__construct('CreateForm', '', true); |
29 | | - } |
30 | | - |
31 | | - function execute() { |
32 | | - doSpecialCreateForm(); |
33 | | - } |
34 | | - } |
35 | | -} else { |
36 | | - SpecialPage::addPage( new SpecialPage('CreateForm','',true,'doSpecialCreateForm',false) ); |
37 | | -} |
38 | | - |
39 | 18 | function doSpecialCreateForm() { |
40 | 19 | global $wgOut, $wgRequest, $wgUser, $sfgScriptPath, $wgContLang; |
41 | 20 | $db = wfGetDB( DB_SLAVE ); |
Index: trunk/extensions/SemanticForms/specials/SF_CreateProperty.php |
— | — | @@ -13,29 +13,8 @@ |
14 | 14 | global $IP; |
15 | 15 | require_once( "$IP/includes/SpecialPage.php" ); |
16 | 16 | |
17 | | -global $sfgSpecialPagesSpecialInit; |
18 | | -if ($sfgSpecialPagesSpecialInit) { |
19 | | - global $wgSpecialPages; |
20 | | - $wgSpecialPages['CreateProperty'] = 'SFCreateProperty'; |
| 17 | +SpecialPage::addPage( new SpecialPage('CreateProperty','',true,'doSpecialCreateProperty',false) ); |
21 | 18 | |
22 | | - class SFCreateProperty extends SpecialPage { |
23 | | - |
24 | | - /** |
25 | | - * Constructor |
26 | | - */ |
27 | | - public function __construct() { |
28 | | - smwfInitUserMessages(); |
29 | | - parent::__construct('CreateProperty', '', true); |
30 | | - } |
31 | | - |
32 | | - function execute() { |
33 | | - doSpecialCreateProperty(); |
34 | | - } |
35 | | - } |
36 | | -} else { |
37 | | - SpecialPage::addPage( new SpecialPage('CreateProperty','',true,'doSpecialCreateProperty',false) ); |
38 | | -} |
39 | | - |
40 | 19 | function createPropertyText($property_type, $allowed_values_str) { |
41 | 20 | global $smwgContLang; |
42 | 21 | |
Index: trunk/extensions/SemanticForms/specials/SF_Templates.php |
— | — | @@ -10,31 +10,8 @@ |
11 | 11 | global $IP; |
12 | 12 | require_once( "$IP/includes/SpecialPage.php" ); |
13 | 13 | |
14 | | -global $sfgSpecialPagesSpecialInit; |
15 | | -if ($sfgSpecialPagesSpecialInit) { |
16 | | - global $wgSpecialPages; |
17 | | - $wgSpecialPages['Templates'] = 'SFTemplates'; |
| 14 | +SpecialPage::addPage( new SpecialPage('Templates','',true,'doSpecialTemplates',false) ); |
18 | 15 | |
19 | | - class SFTemplates extends SpecialPage { |
20 | | - |
21 | | - /** |
22 | | - * Constructor |
23 | | - */ |
24 | | - public function __construct() { |
25 | | - smwfInitUserMessages(); |
26 | | - parent::__construct('Templates', '', true); |
27 | | - } |
28 | | - |
29 | | - function execute() { |
30 | | - list( $limit, $offset ) = wfCheckLimits(); |
31 | | - $rep = new TemplatesPage(); |
32 | | - return $rep->doQuery( $offset, $limit ); |
33 | | - } |
34 | | - } |
35 | | -} else { |
36 | | - SpecialPage::addPage( new SpecialPage('Templates','',true,'doSpecialTemplates',false) ); |
37 | | -} |
38 | | - |
39 | 16 | class TemplatesPage extends QueryPage { |
40 | 17 | function getName() { |
41 | 18 | return "Templates"; |
Index: trunk/extensions/SemanticForms/specials/SF_CreateTemplate.php |
— | — | @@ -13,29 +13,8 @@ |
14 | 14 | global $IP; |
15 | 15 | require_once( "$IP/includes/SpecialPage.php" ); |
16 | 16 | |
17 | | -global $sfgSpecialPagesSpecialInit; |
18 | | -if ($sfgSpecialPagesSpecialInit) { |
19 | | - global $wgSpecialPages; |
20 | | - $wgSpecialPages['CreateTemplate'] = 'SFCreateTemplate'; |
21 | | - |
22 | | - class SFCreateTemplate extends SpecialPage { |
| 17 | +SpecialPage::addPage( new SpecialPage('CreateTemplate','',true,'doSpecialCreateTemplate',false) ); |
23 | 18 | |
24 | | - /** |
25 | | - * Constructor |
26 | | - */ |
27 | | - public function __construct() { |
28 | | - smwfInitUserMessages(); |
29 | | - parent::__construct('CreateTemplate', '', true); |
30 | | - } |
31 | | - |
32 | | - function execute() { |
33 | | - doSpecialCreateTemplate(); |
34 | | - } |
35 | | - } |
36 | | -} else { |
37 | | - SpecialPage::addPage( new SpecialPage('CreateTemplate','',true,'doSpecialCreateTemplate',false) ); |
38 | | -} |
39 | | - |
40 | 19 | // Custom sort function, used in both getSemanticProperties() functions |
41 | 20 | function cmp($a, $b) { |
42 | 21 | if ($a == $b) { |
Index: trunk/extensions/SemanticForms/specials/SF_EditData.php |
— | — | @@ -11,29 +11,8 @@ |
12 | 12 | global $IP; |
13 | 13 | require_once( "$IP/includes/SpecialPage.php" ); |
14 | 14 | |
15 | | -global $sfgSpecialPagesSpecialInit; |
16 | | -if ($sfgSpecialPagesSpecialInit) { |
17 | | - global $wgSpecialPages; |
18 | | - $wgSpecialPages['EditData'] = 'SFEditData'; |
19 | | - |
20 | | - class SFEditData extends SpecialPage { |
| 15 | +SpecialPage::addPage( new SpecialPage('EditData','',true,'doSpecialEditData',false) ); |
21 | 16 | |
22 | | - /** |
23 | | - * Constructor |
24 | | - */ |
25 | | - public function __construct() { |
26 | | - smwfInitUserMessages(); |
27 | | - parent::__construct('EditData', '', true); |
28 | | - } |
29 | | - |
30 | | - function execute($query = '') { |
31 | | - doSpecialEditData($query); |
32 | | - } |
33 | | - } |
34 | | -} else { |
35 | | - SpecialPage::addPage( new SpecialPage('EditData','',true,'doSpecialEditData',false) ); |
36 | | -} |
37 | | - |
38 | 17 | function doSpecialEditData($query = '') { |
39 | 18 | global $wgRequest; |
40 | 19 | |
— | — | @@ -89,20 +68,19 @@ |
90 | 69 | // get contents of target page |
91 | 70 | $target_title = Title::newFromText($target_name); |
92 | 71 | |
93 | | - $s = wfMsg('sf_editdata_title', $form_title->getText(), $target_title->getPrefixedText()); |
94 | | - $wgOut->setPageTitle($s); |
95 | | - |
96 | 72 | if (! $form_title || ! $form_title->exists() ) { |
97 | 73 | if ($form_name == '') |
98 | | - $text = '<p>' . wfMsg('sf_editdata_badurl') . "</p>\n"; |
| 74 | + $text = '<p class="error">' . wfMsg('sf_editdata_badurl') . "</p>\n"; |
99 | 75 | else |
100 | | - $text = "<p>Error: No form page was found at " . sffLinkText(SF_NS_FORM, $form_name) . ".</p>\n"; |
| 76 | + $text = '<p class="error">Error: No form page was found at ' . sffLinkText(SF_NS_FORM, $form_name) . ".</p>\n"; |
101 | 77 | } elseif (! $target_title || ! $target_title->exists() ) { |
102 | 78 | if ($target_name == '') |
103 | | - $text = '<p>' . wfMsg('sf_editdata_badurl') . "</p>\n"; |
| 79 | + $text = '<p class="error">' . wfMsg('sf_editdata_badurl') . "</p>\n"; |
104 | 80 | else |
105 | | - $text = "<p>Error: No page was found at " . sffLinkText(null, $target_name) . ".</p>\n"; |
| 81 | + $text = '<p class="error">Error: No page was found at ' . sffLinkText(null, $target_name) . ".</p>\n"; |
106 | 82 | } else { |
| 83 | + $s = wfMsg('sf_editdata_title', $form_title->getText(), $target_title->getPrefixedText()); |
| 84 | + $wgOut->setPageTitle($s); |
107 | 85 | $form_article = new Article($form_title); |
108 | 86 | $form_definition = $form_article->getContent(); |
109 | 87 | $submit_url = $form_title->getLocalURL('action=submit'); |