Votings: common requirements
Modulestructure
Before having a look at the single components of the module, we should have a short look at the structure of the modules' file system.
After downloading and extracting the archive, the module comes with the following structure:
-
modul_votings
-
admin-
elemente-
class_element_votings.php
-
- class_modul_votings_admin.php
-
-
-
installer
-
installer_votings.php
-
-
lang
-
admin-
modul_elemente-
lang_votings_de.php - lang_votings_en.php
-
-
modul_votings
-
lang_votings_de.php - lang_votings_en.php
-
-
-
portal
-
modul_votings-
lang_votings_de.php - lang_votings_en.php
-
-
-
-
portal
-
elemente-
class_element_votings.php
-
-
pics
-
kajona-
icon_progressbar.gif
-
-
- class_modul_votings_portal.php
-
-
system
-
config-
modul_votings_id.php
-
- class_modul_votings_answer.php
- class_modul_votings_voting.php
-
-
templates
-
modul_votings-
votings.tpl
-
-
The relevant files are discussed in detail, some only partly. The order conforms to the advised order when creating a new module.
As with every project, before starting the implementation all requirements should be clarified. This includes the functionality and the design of the modules' architecture.
In case of the votings, the successive facts should be applied as requirements:
-
A voting can be created via the backend
-
A voting consists of a text (thread) - A start- and end-date may be defined for the voting
- Using the permissions-system, it can be configured who is allowed to vote
- By default guest should have the needed permissions to vote
-
-
A voting consists of any number of answers
-
Every answer consists of a text - The order of the answers should be sortable
-
-
Every voting should be presentable on the portal
-
It should be possible to separate between the voting-procedure and the result-presentation of a single voting - A voting submitted should be saved via a cookie to prevent multiple votings for the same thread
- The presentation should be based on templates completely
-
Put into graphics, the requirements contain the following entities:

When creating the module, to following order proved to be rather useful:
- installer
- model-classes (entity-classes / beans), here: voting and answer
- admin-classes
- admin-elements
- portal-elements
- portal-classes
- add finishing touches :)
In parallel, the files containing the texts and the templates are created.



