toendaCMS Wiki

Reference guide for developer

From toendaCMS Wiki

i18n Deutsch English Français Italian Espanol Português do Brasil 繁體中文 简体中文 Русский Slovencina


Back to API Reference



Information: The toendaCMS components system API is only available with toendaCMS version 1.0!


Contents

ATTENTION

This reference guide is currently in work ...


Tutorial

...


Needed files

  • backend.php
  • component.xml
  • A frontendfile. The name must be written in the component.xml file.


API description

The toendaCMS components system makes an global API array available. This array is called _TCMS_CS_ARRAY and includes all information from your XML settings file. Furthermore it exists some global API variables.

Set the id's in the backend of toendaCMS.


_TCMS_CS_ID
The _TCMS_CS_ID is the a array with some usefull information in it.
  • _TCMS_CS_ID[ *Your id* ]['id'] is filled with the current id of the global array.
  • _TCMS_CS_ID[ *Your id* ]['name'] is filled with your id like 'calendar'.


_TCMS_CS_ARRAY
The _TCMS_CS_ARRAY includes the complete XML settings file for your component.
  • _TCMS_CS_ARRAY[ *Your id* ]['content'][ *contains the XML tags* ] is filled with the XML settings file data.
  • _TCMS_CS_ARRAY[ *Your id* ]['attribute'][ *contains the XML tags* ][ *contains the attribute tag* ] is filled with an array with all attributes you have for an XML tag in your settings file.


Example component header code

This is a example header of the webcam component. With this code you can get the information from your own xml description file.

$webcamTitle = $_TCMS_CS_ARRAY['webcam']['content']['webcam_title']; // Get the title of the webcam

$webcamSubTitle = $_TCMS_CS_ARRAY['webcam']['content']['webcam_subtitle']; // Get the sub title of the webcam

$show_webcam_title = $_TCMS_CS_ARRAY['webcam']['content']['show_webcam_title']; // Should the title be display?

$cs_font_style = $_TCMS_CS_ARRAY['webcam']['content']['font_style']; // The font style

$refreshSeconds = $_TCMS_CS_ARRAY['webcam']['content']['refresh']; // Refresh time in seconds

$image_width = $_TCMS_CS_ARRAY['webcam']['content']['image_width']; // The size of the image

$webcamFolder = $_TCMS_CS_ID['webcam']['folder'];

if($_TCMS_CS_ARRAY['webcam']['attribute']['webcam_title']['ENCODE'] == 1) // Encode the title ? $webcamTitle =

    $tcms_main->encode_text_without_crypt($webcamTitle, '2', $c_charset); // Do it


After this, there's only the code of the webcam. The code above is to get all the information from the xml file. The component API reads the file and parse it into the global $_TCMS_CS_ARRAY where you can read the information.