Extension:OCExtensions

'''NOTICE: This page is a work in progress. I have not actually set up any means of downloading these extensions yet. Please check back later. Thanks!'''

= Outreach Connections Extensions =

This is the main page for a suite of extensions that were originally written for Outreach Connections: Native Health Information (aka OC). The intended audience of Outreach Connections has very little technical experience and thus finds wiki text very cumbersome and daunting. These extensions were written to improve usability for users that are intimidated by wiki text. They were also designed to integrate well with FCK Editor and the CategoryTree extension.

'''BEWARE: These extensions may require significant modification to suit your wiki. I have tried to make them as abstract as possible, and as easy to customize as possible, in order to benefit the open source community, so hopefully you won't have many problems... BUT, just in case, you should be aware that you may need to dive in deep to order to get them working according to your needs.'''

BY DEFAULT, THIS LIBRARY WILL REMOVE THE "SHOW CHANGES" BUTTON THAT APPEARS AT THE BOTTOM WHEN EDITING A PAGE. (The complexity of integrating these extensions with FCK Editor made me decide to nix the "Show Changes" option. You can re-enable it if you wish, but if you are using FCK Editor you will probably run into bugs.)

Details
In my experience, average non-technical users find wiki text very intimidating. They are accustomed to using word processors such as Microsoft Word or Open Office. FCK Editor helps smooth the transition for these users, but the use of templates still requires wiki text, and it is very confusing to a lot of users.

Let's say you have a site-wide template, which should appear on every page in the main namespace, and it requires the user to enter parameters, such as:

To make it easier for non-technical users to add this template to their page, the OC extensions contain a PHP class that will help you add a user-friendly form. This is the core functionality of the OC extensions, although they do add other functionality. (To be documented.)

= Usage =

Here is the breakdown of the extensions in this suite.

OCProjectInfo and OCContactInfo
The most prominent extension in this suite is OCProjectInfo, followed by OCContactInfo, which is similar, but without the AJAX. Most likely, you are not going to want to use these extensions as they exist in the snapshot, since they are highly specific to the Outreach Connections wiki. Instead, think of them as a starting point for creating and introducing your own forms into your edit page. You can rename them if you want (requires a bit of code modification), or just change the content to suit your needs. You can also create your own "OC" extensions based off of them, by extending the OCInfo class.

What follows is a description of each, to give you a better starting point.

OCProjectInfo
OCProjectInfo injects an HTML form into the edit page before the main textarea on every page in the main namespace. When you fill out the form and submit the page, it converts everything the user entered into wikitext, which gets prepended to the article text before it is saved. An example of the generated wikitext would be:

This functionality was needed because Outreach Connections' main namespace is dedicated to posting information gleaned from health sciences projects around the country, and it needed to have a standardized template on each page.

OCProjectInfo contains an AJAX interface that adds an auto-suggest box below each textbox in the form. It's a really cool interface, but the implementation is complex and you are unlikely to be able to use it without some major work, first because the template that was designed to receive the data puts everything into a category which is then further categorized by a bot (which I may not include in the download), and second because I don't know if I will have time to document it.

OCContactInfo
(To be documented later...)

OC-Common
The core of the OC Extensions is OC-Common, which doesn't really do much on its own. It contains a PHP class called OCInfo, as well as javascript functions, all of which are required by the other OC extensions that generate HTML forms. So, if you want to create a custom form that will convert its input into wiki text (for template parameters), you can create as many of your own OC extensions as you want by placing each one in the directory " ", and then extend the OCInfo class. (Details to come.) You can study OCContactInfo and OCProjectInfo for examples on how to do this.

Here is what the OC-Common extension itself will do:


 * Adds a CSS class to the HTML table displayed at special:allpages.
 * Adds a permanent sandbox header to the sandbox page (assuming you have a template called  and a sandbox located at  ). The reason for doing this (in an extension, rather than on the sandbox page in the wiki itself) is to prevent new users from being confused when they see a line that says,  . New, non-technical users do not understand what this is there for, and why this does not show when the page renders. It also creates an ugly template icon if using FCKeditor, which new users are likely to delete accidentally.

Installation
Each extension within the OC suite is a fully independent extension (aside from the OCInfo class in OC-Common, which most of them depend on). To install, follow these steps.

Step 1: Create Templates in Your Wiki
You will need to make sure that you have pre-existing templates in your wiki that have the parameters your forms are designed to fill. Included in the download are two xml files that were exported from the OC wiki which can be imported into the template namespace (look in the OCContactInfo and OCProjectInfo directories). These will give you an idea of what types of templates these extensions are designed to help fill out. Note that you will also need the Parser Functions extension installed if you want to take advantage of the conditional logic in these templates. Alternatively, you can just view the source here: ocproject template and here: occontact template. You are not required to use these templates -- you can create your own template with parameters of your own choosing with any layout you wish.

Step 2: Modify Local Settings
Add the following to LocalSettings.php:

Note that we add  to the   array manually, in LocalSettings.php. I could have just made the OC-Common extension itself do this, but the OC-Common extension performs a few minor utility functions on the site that you may want to disable by removing it from the  array.