documentation - pascalfree/ProjectLK GitHub Wiki

Structure of ProjectLK

The code can be divided into the following parts:

  • Core
  • GUI (graphical user interface)
  • MySQL database
  • language files
  • content files

Core

The core consists of the 'core.php' file and everything inside the 'core' folder. It connects to the database and provides an interface (Ajax) for the GUI. It also validates all requests to the database. The requested URL is parsed by the core and it will load the corresponding page from the GUI. The javascript folder inside /core contains some helper functions and the 'req' function which is used to send and get information to and from the database via Ajax. It also provides the 'query engine' which lets the user review words. A more detailed description of the core will (hopefully) follow.

GUI

The graphical user interface is what the user will see. The GUI is interchangeable, so the look and feel can be changed completely without changing the core. The user can also change the GUI in the settings. For now there is only one GUI: the default GUI. Find out more about GUIs in the GUI reference.

MySQL database

All data is saved in a MySQL database. The structure is installed by importing the 'install.sql' file. The database should never be modified manually, unless you know what you do. The core will manage all interactions with the database.

language files

language files are written in json/javascript. The reason is simple: By loading the javascript file the language will be available in the global variable 'la'. The file will also be loaded into php by removing the first 4 characters of the file and all comments and decoding the remaining json code. To add a new language copy an existing language file in the folder '/language' and modify the quoted words or expressions. The file name should correspond to the language code e.g. en for English. The language is now available in the user settings -> language. The 'content' pages are not translated yet. See the next chapter.

content files

content files are static *.xml files. The home page, login page and about page are examples for content files. For every supported language there is a set of content files. See the folder '/content' for examples. The basic Syntax of a content file is the following:

<content title="" language="">
  <links>
    <link dest=""></link>
  </links>
  <body>
    <section title="">
      <title></title>
      <text></text>
    </section>
  </body>
</content>

The links inside 'links' are shown as navigation links on top of the page. The GUI decides how the content is displayed in it's content.php file. To add new language for the content pages go to the '/content' folder, copy another language and modify it. The created folder must correspond to the chosen language code from the language file.

⚠️ **GitHub.com Fallback** ⚠️