r83058 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83057‎ | r83058 | r83059 >
Date:00:14, 2 March 2011
Author:yaron
Status:deferred
Tags:
Comment:
Moving extension's actual starting code from includes/SF_Settings.php to SemanticForms.php (formerly just a placeholder)
Modified paths:
  • /trunk/extensions/SemanticForms/SemanticForms.php (replaced) (history)
  • /trunk/extensions/SemanticForms/includes/SF_Settings.php (deleted) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/SemanticForms.php
@@ -1,7 +1,131 @@
22 <?php
3 -
43 /**
5 - * Main entry point for the SemanticForms extension.
 4+ * Default settings for Semantic Forms.
 5+ *
 6+ * Note:
 7+ * Do not use this file as entry point,
 8+ * use SemanticForms.php in this extensions root instead.
69 */
 10+if ( !defined( 'MEDIAWIKI' ) ) die();
711
8 -require_once dirname( __FILE__ ) . '/includes/SF_Settings.php';
\ No newline at end of file
 12+# ##
 13+# This is the path to your installation of Semantic Forms as
 14+# seen from the web. Change it if required ($wgScriptPath is the
 15+# path to the base directory of your wiki). No final slash.
 16+# #
 17+$sfgPartialPath = '/extensions/SemanticForms';
 18+$sfgScriptPath = $wgScriptPath . $sfgPartialPath;
 19+# #
 20+
 21+# ##
 22+# This is the path to your installation of Semantic Forms as
 23+# seen on your local filesystem. Used against some PHP file path
 24+# issues.
 25+# #
 26+$sfgIP = dirname( __FILE__ ) . '/..';
 27+# #
 28+
 29+
 30+// PHP fails to find relative includes at some level of inclusion:
 31+// $pathfix = $IP . $sfgScriptPath;
 32+
 33+// load global functions
 34+require_once( 'SF_GlobalFunctions.php' );
 35+
 36+sffInitNamespaces();
 37+
 38+# ##
 39+# The number of allowed values per autocomplete - too many might
 40+# slow down the database, and Javascript's completion
 41+# ##
 42+$sfgMaxAutocompleteValues = 1000;
 43+
 44+# ##
 45+# Whether to autocomplete on all characters in a string, not just the
 46+# beginning of words - this is especially important for Unicode strings,
 47+# since the use of the '\b' regexp character to match on the beginnings
 48+# of words fails for them.
 49+# ##
 50+$sfgAutocompleteOnAllChars = false;
 51+
 52+# ##
 53+# Global variables for handling the two edit tabs (for traditional editing
 54+# and for editing with a form):
 55+# $sfgRenameEditTabs renames the edit-with-form tab to just "Edit", and
 56+# the traditional-editing tab, if it is visible, to "Edit source", in
 57+# whatever language is being used.
 58+# $sfgRenameMainEditTab renames only the traditional editing tab, to
 59+# "Edit source".
 60+# The wgGroupPermissions 'viewedittab' setting dictates which types of
 61+# visitors will see the "Edit" tab, for pages that are editable by form -
 62+# by default all will see it.
 63+# ##
 64+$sfgRenameEditTabs = false;
 65+$sfgRenameMainEditTab = false;
 66+$wgGroupPermissions['*']['viewedittab'] = true;
 67+$wgAvailableRights[] = 'viewedittab';
 68+
 69+# ##
 70+# Permission to edit form fields defined as 'restricted'
 71+# ##
 72+$wgGroupPermissions['sysop']['editrestrictedfields'] = true;
 73+$wgAvailableRights[] = 'editrestrictedfields';
 74+
 75+# ##
 76+# Permission to view, and create pages with, Special:CreateClass
 77+# ##
 78+$wgGroupPermissions['user']['createclass'] = true;
 79+$wgAvailableRights[] = 'createclass';
 80+
 81+# ##
 82+# List separator character
 83+# ##
 84+$sfgListSeparator = ",";
 85+
 86+# ##
 87+# Extend the edit form from the internal EditPage class rather than using a
 88+# special page and hacking things up.
 89+#
 90+# @note This is experimental and requires updates to EditPage which I have only
 91+# added into MediaWiki 1.14a
 92+# ##
 93+$sfgUseFormEditPage = false;// method_exists('EditPage', 'showFooter');
 94+
 95+# ##
 96+# Use 24-hour time format in forms, e.g. 15:30 instead of 3:30 PM
 97+# ##
 98+$sfg24HourTime = false;
 99+
 100+# ##
 101+# Cache parsed form definitions in the page_props table, to improve loading
 102+# speed
 103+# ##
 104+$sfgCacheFormDefinitions = false;
 105+
 106+# ##
 107+# When modifying red links to potentially point to a form to edit that page,
 108+# check only the properties pointing to that missing page from the page the
 109+# user is currently on, instead of from all pages in the wiki.
 110+# ##
 111+$sfgRedLinksCheckOnlyLocalProps = false;
 112+
 113+# ##
 114+# Page properties, used for the API
 115+# ##
 116+$wgPageProps['formdefinition'] = 'Definition of the semantic form used on the page';
 117+
 118+# ##
 119+# Global variables for registering input types
 120+# ##
 121+$sfgDefaultInputForPropType = array();
 122+$sfgDefaultInputForPropTypeList = array();
 123+$sfgPossibleInputsForPropType = array();
 124+$sfgPossibleInputsForPropTypeList = array();
 125+
 126+# ##
 127+# Global variables for Javascript
 128+# ##
 129+$sfgShowOnSelect = array();
 130+$sfgAutocompleteValues = array();
 131+$sfgInitJSFunctions = array();
 132+$sfgValidationJSFunctions = array();
Index: trunk/extensions/SemanticForms/includes/SF_Settings.php
@@ -1,131 +0,0 @@
2 -<?php
3 -/**
4 - * Default settings for Semantic Forms.
5 - *
6 - * Note:
7 - * Do not use this file as entry point,
8 - * use SemanticForms.php in this extensions root instead.
9 - */
10 -if ( !defined( 'MEDIAWIKI' ) ) die();
11 -
12 -# ##
13 -# This is the path to your installation of Semantic Forms as
14 -# seen from the web. Change it if required ($wgScriptPath is the
15 -# path to the base directory of your wiki). No final slash.
16 -# #
17 -$sfgPartialPath = '/extensions/SemanticForms';
18 -$sfgScriptPath = $wgScriptPath . $sfgPartialPath;
19 -# #
20 -
21 -# ##
22 -# This is the path to your installation of Semantic Forms as
23 -# seen on your local filesystem. Used against some PHP file path
24 -# issues.
25 -# #
26 -$sfgIP = dirname( __FILE__ ) . '/..';
27 -# #
28 -
29 -
30 -// PHP fails to find relative includes at some level of inclusion:
31 -// $pathfix = $IP . $sfgScriptPath;
32 -
33 -// load global functions
34 -require_once( 'SF_GlobalFunctions.php' );
35 -
36 -sffInitNamespaces();
37 -
38 -# ##
39 -# The number of allowed values per autocomplete - too many might
40 -# slow down the database, and Javascript's completion
41 -# ##
42 -$sfgMaxAutocompleteValues = 1000;
43 -
44 -# ##
45 -# Whether to autocomplete on all characters in a string, not just the
46 -# beginning of words - this is especially important for Unicode strings,
47 -# since the use of the '\b' regexp character to match on the beginnings
48 -# of words fails for them.
49 -# ##
50 -$sfgAutocompleteOnAllChars = false;
51 -
52 -# ##
53 -# Global variables for handling the two edit tabs (for traditional editing
54 -# and for editing with a form):
55 -# $sfgRenameEditTabs renames the edit-with-form tab to just "Edit", and
56 -# the traditional-editing tab, if it is visible, to "Edit source", in
57 -# whatever language is being used.
58 -# $sfgRenameMainEditTab renames only the traditional editing tab, to
59 -# "Edit source".
60 -# The wgGroupPermissions 'viewedittab' setting dictates which types of
61 -# visitors will see the "Edit" tab, for pages that are editable by form -
62 -# by default all will see it.
63 -# ##
64 -$sfgRenameEditTabs = false;
65 -$sfgRenameMainEditTab = false;
66 -$wgGroupPermissions['*']['viewedittab'] = true;
67 -$wgAvailableRights[] = 'viewedittab';
68 -
69 -# ##
70 -# Permission to edit form fields defined as 'restricted'
71 -# ##
72 -$wgGroupPermissions['sysop']['editrestrictedfields'] = true;
73 -$wgAvailableRights[] = 'editrestrictedfields';
74 -
75 -# ##
76 -# Permission to view, and create pages with, Special:CreateClass
77 -# ##
78 -$wgGroupPermissions['user']['createclass'] = true;
79 -$wgAvailableRights[] = 'createclass';
80 -
81 -# ##
82 -# List separator character
83 -# ##
84 -$sfgListSeparator = ",";
85 -
86 -# ##
87 -# Extend the edit form from the internal EditPage class rather than using a
88 -# special page and hacking things up.
89 -#
90 -# @note This is experimental and requires updates to EditPage which I have only
91 -# added into MediaWiki 1.14a
92 -# ##
93 -$sfgUseFormEditPage = false;// method_exists('EditPage', 'showFooter');
94 -
95 -# ##
96 -# Use 24-hour time format in forms, e.g. 15:30 instead of 3:30 PM
97 -# ##
98 -$sfg24HourTime = false;
99 -
100 -# ##
101 -# Cache parsed form definitions in the page_props table, to improve loading
102 -# speed
103 -# ##
104 -$sfgCacheFormDefinitions = false;
105 -
106 -# ##
107 -# When modifying red links to potentially point to a form to edit that page,
108 -# check only the properties pointing to that missing page from the page the
109 -# user is currently on, instead of from all pages in the wiki.
110 -# ##
111 -$sfgRedLinksCheckOnlyLocalProps = false;
112 -
113 -# ##
114 -# Page properties, used for the API
115 -# ##
116 -$wgPageProps['formdefinition'] = 'Definition of the semantic form used on the page';
117 -
118 -# ##
119 -# Global variables for registering input types
120 -# ##
121 -$sfgDefaultInputForPropType = array();
122 -$sfgDefaultInputForPropTypeList = array();
123 -$sfgPossibleInputsForPropType = array();
124 -$sfgPossibleInputsForPropTypeList = array();
125 -
126 -# ##
127 -# Global variables for Javascript
128 -# ##
129 -$sfgShowOnSelect = array();
130 -$sfgAutocompleteValues = array();
131 -$sfgInitJSFunctions = array();
132 -$sfgValidationJSFunctions = array();