Actions

Accessing the source code: Difference between revisions

From LimeSurvey Manual

No edit summary
 
No edit summary
Line 33: Line 33:
*Codeigniter - The old CodeIgniter branch - it is deprecated, do not use it, and will be removed soon
*Codeigniter - The old CodeIgniter branch - it is deprecated, do not use it, and will be removed soon


=Important files=
=Further documentation=


If you want to get familiar with Limesurvey code these are the most important files:
Please make sure you code accoding to our [[Coding guidelines]].
 
==Root folder==
 
'''Configuration files:'''
* config.php
* config-ldap.php
* config-defaults.php
 
'''Survey core files:'''
* common.php: common functions used in 'survey at runtime' code and in 'admin gui code'
* ldap-functions.php: common functions for ldap connector (currently only used in import tokens)
* qanda.php: functions handling questions (display, ...)
* question.php: code handling '1 question per page' kind of survey
* group.php: code handling '1 group per page' kind of survey
* survey.php: code handling 'All in one page' kind of survey
* register.php: code handling public registration to survey
* verfification.php: code handling captcha registration check(image verification to avoid non human regostration)
* load.php: code handling partial survey completion saving
* save.php: code that actually records answers in the database at survey runtime
 
==Admin folder==
 
When accessing the admin GUI the following scripts are used:
* admin.php: main admin script which checks for user rights for the accessed action and reads the 'action' get parameter to call the desired submodule
* login_check.php: security code that checks that the session is authenticated
* access_denied.php: action forbidden screen
 
The admin section consist of several submodules. To see which one is called the passed 'subaction' value is checked by the "if ($action == ...") statements in admin.php (lines 54-213). A submodule reads the 'subaction' get parameter to process the corresponding part of the code . This submodule writes its output to a variable (for instance $tokenoutput for the tokens.php file) and this variable is then appended by admin.php to the adminoutput
 
(see admin.php lines 216-274).
 
==Dealing with languages==
 
To translate string the language.php class is used. Translated strings can be added in any part of the admin GUI
 
code by using the global variable $clang.
 
Examples:
* For htmlized translation of Yes use $clang->gT("Yes")
* For javascript-escaped translation of Yes use $clang->gT("Yes","js")
* For unescaped translation of Yes use $clang->gT("Yes","unescaped"). This one is used when you want to compare a "translated Get param" that was sent as htmlized string but received as unescaped string

Revision as of 11:45, 15 February 2012

Accessing the LimeSurvey Source Code

Always be aware that most of the LimeSurvey Source code is bleeding edge. Do not use it for production purposes (except fo the master branch!

As for many other free software projects only community support is available.

Access the LimeSurvey source code with a Subversion client for your operating system.

  • For Windows we recommend: SmartGit because it is very easy to use.
  • For Mac we recommend: Git. Commandline all the way ;)

Step-by-Step How-To (Windows)

  1. Create a GitHub account.
  2. Download and install SmartGit.
  3. Clone the LimeSurvey repository at GitHub. You can find the right clone URL at  https://github.com/LimeSurvey/LimeSurvey .
  4. The whole source code repository should be downloading now.
  5. By default you should see the 'master' branch in the current directory
  6. Use the Switch command from the SmartGit GUI to switch to the branch you need.
  7. That's it.

Please add instructions for other OSs or complete the existing ones.

Available branches

These are the available GitHub branches right now:

  • master - This is the always the current stable (plus) version including any fixes not yet released.
  • Dev - this is currently the branch for the 1.92 version being in Release candidate period
  • Yii - the branch for the Yii 2.0 version which is the bleeding edge currently
  • original_art and original_art 2: These are the SVG files for almost all icons the stable and Yii version.
  • other_scripts, server_scripts, translation status: These are scripts being used in limesurvey.org or for new releases. We will merge these to a single 'server-scripts' branch soon.
  • Codeigniter - The old CodeIgniter branch - it is deprecated, do not use it, and will be removed soon

Further documentation

Please make sure you code accoding to our Coding guidelines.