simpleMultiUser

Plugin for CMSimple

Version 1.1, supported by CMSimple 2.7+ , Plugin Loader 2, Svarrers Memberpages ver 1.0 beta and better.

5th March 2009

 

simpleMultiUser (short: sMU) enables multiple editors / moderators with permissions to edit particular pages. These editors / moderators do not have access to the CMSimple administration area, they have only access to the web pages which have been assigned to them. This plugin is thought to be run in conjunction with Svarrer's Memberpages plugin, since it is itself not coming with an own member management. That means: It does not really makes much sense to run sMU without them. You can manage as many editors and their webpages as the Memberpages handle. The Memberpages can be downloaded from CMSimpleWiki

1. How it works

The website admin has to generate empty pages which shall be edited by the editors and later be viewed by the public. To realize it the admin has to generate two sets of pages: the ones which are shown to the public, and mirror pages with an editor and preview section for the people who are in charge of the pages. These mirror pages are hidden behind Svarrer's Memberpages. The pages which are filled by the editors behind the memperpage barrier can be viewed by the public on the frontend. So we have one frontend and as many backends with different permissions as are handled by the Memberpages.

Let's say, we have 4 editors - Betty, Fritz, Marc and Susann. The CMSimple admin generates 4 sets of webpages for them, one set for each person. Such a set can contain H1, H2 and H3 pages. In addition, the admin generates the same amount of mirror pages which are hidden behind the Memberpages.

Example
openWYSIWYG Editor with Preview

+ Betty
|
+ Fritz
|
+ Marc
|
+ Susann
|
| for the public
|
+-Memberpage barrier
|
| members only
|
+ Betty
|
+ Fritz
|
+ Marc
|
+ Susann

What Betty - or any other editor - types in with the editor behind the memberpage barrier can be seen by the public at the frontend, as soon as Betty presses the SAVE button. And if permissions are set right, Betty can manage only her set of pages.

 

2. Installation of the plugin

To install simpleMultiUser is actually very simple. You just copy the plugin into the plugin folder - that's it!!! No configuration, no styling, no plugin's main settings - nothing!

Server rights: Ok, since you want something to be edited and saved it will be required to chmod some folders. In the plugin folder you will have two folders - content and content/images - which you both have to chmod 777.

Furthermore, you have to connect the plugin with the empty pages with a CMSimple type script to make it all work. To explain that, let's go back to Betty. Betty is supposed to get one H1 page to edit. So, what you as a CMSimple admin first generate is:

<h1>Betty</h1>
#CMSimple $output .= simpleMultiUser("betty1");#

This will represent the page for the public. Here, everything will be shown, what Betty types in with her editor. You do not have to use "betty1", you can use any word you want, but it has to be unique, and it has to be the same as on the mirror side behind the memberpage barrier. On the mirror side you type in:

<h1>Betty - Edit </h1>
#CMSimple $output .= simpleMultiUser("betty1", "editor_on" );#

"editor_on" will call up the included openWYSIWYG editor, which has been enhanced a lot by "Haggi", to enable image upload and management. For openWYSIWYG check the site of openWebWare, Haggi's work is dokumented on the openWYSIWYG forum.

Now, we have two Betty-pages - one frontend and one backend page. The backend page, though, is not hidden yet by the memberpages. For doing that we first need to have installed Svarrer's Memberpages. How to do that, is not the topic of this outline. For that, you should read Svarrer's explainations. Anyway, if they are installed, you call the backend page with the following script instead:

<h1>Betty - Edit </h1>
#CMSimple $output.=memberspage("Member_Not_logged_in","1"); $output .= simpleMultiUser("betty1","editor_on");#

This is quite a long script. But if you just copy and paste, it is quickly done with all your different pages. You just have to care about the member's permissions (1,2,3,4,5, and so on) and choose different page names for Betty (betty1, betty2, betty3, betty4 and so on) and the other editors.

If the editor starts with a new page, the page will be created in the plugin's content folder, as soon as the editor presses the SAVE button.

 

3. Configuration

Starting with version 1.1 the plugin comes with one configuration option. If the option "change lastupdate" has been set on "true" under configuration, the last update output - if present in your template - will be changed after saving the content in the backend. If you keep the field free or add "false", the last updated output will not be updated.

 

4. Modification of the editor

As editor openWebWare's openWYSIWYG is being used. It is a small but powerfull Editor. It is a multi platform editor. However, due to "Haggi's work and refinement it has lost a lot of its multi platform capability. While it will work with Internet Explorer, Firefox and even with Opera, it does not look so good on the Mac. As I read, it will not run anymore with the Safari browser, for example.

The editor of the simpleMultiUser plugin has been installed in a way, that it always adjusts itself to 100 % of the width it gets offered by the CMSimple template. You can shrink the editor down to a width of about 350 pixels. If it is still too wide, you have to remove some buttons.

How do I do that?

Open the folder "plugins/simpleMultiUser/openwysiwyg/scripts/" and edit the file "wysiwyg.js". Between the lines 100 and 170 all buttons are defined. Just outcomment the button you want to remove. How to do this, orientate yourself according to the buttons I already have outcommented.

For more information about the editor, please, check the web site of openWebWare.

 

5. What does simpleMultiUser do

The CMSimple admin just generates CMSimple pages which are connected to the simpleMultiUser plugin via CMSimple scripting. The editors / moderators add content using the openWYSIWYG editor. The content is saved in the plugin's content folder - here it is saved in individual files. Each editor page is connected to its own content file. The name of a file consist of the word which has been used as parameter of the script function (in this case it is "betty1"), the language code and the .txt ending. In case of the example above, the file name would look like:

betty1_en.txt

Such a file is created by the plugin itself. The CMSimple admin does not have to generate it!!!

The simpleMultiUser backend consists of two parts (see image above). The openWYSIWYG editor is located at the top of the page. It is followed by the "Preview" section, which shows the content as soon as it has been saved. The content is already formated the way as it is shown to the public. That means, an editor / moderator can follow the development of the page while he / she is working on it.

"Haggi's" openWYSIWYG editor offers great image handling. You can upload images to the "content/images" folder and insert them in your content. If the CMSimple Admin has generated image subfolders, every editor can have his/her own image folder - although everybody can peek into any other's folder.

 

6. Disclaimer

There is no warrenty using this plugin. It will be used on everybody's own risk. We will not assume any liability in case of data losses caused by simpleMultiUser usage.

 

7. Acknowledgement

I would like to acknowledge Jan Neugebauer (djot) who made my life much easier with his example-plugin.

 

© Tillman Schuster, NMuD, 2006 - 2009