Бесплатная CMS  - Limbo CMS (система управления сайтом)
Главная arrow Введение в Лимбо arrow Новые шаблоны для Limbo

Навигация
Сайт
Каталог
Материалы сайта

RSS

Программный интерфейс Версия для печати
14.02.2005 4006 Опубликовал: Serebro

4 Программный интерфейс

7.1 Admin classes

These classes are utilized when building an administrator interface and this document details some details on how to use them

7.2.1 class_interface.php

This class takes all the variables and generates the user interface ( No HTML is required ) This way preserving the GUI concistency and freeing programmer from designing forms . Given below an example of the class being used to generate the front page module's edit interface

function edit_newsflash($type='edit')
{
global $conn,$cid;

if($type=='edit')
{
$rs=$conn->Execute("SELECT id,title,message,access FROM lc_newsflash WHERE id = ".$cid[0]);
$rsa=$rs->GetArray();
$rsar=$rsa[0];
$c_info = "Edit Newsflash : You can edit a newsflash over here.";
$t_head = "Edit a Newsflash";
}else
{
$rsar=array("id"=>"","title"=>"","message"=>"","access"=>"0");
$c_info = "New Newsflash : You can create a new newsflash over here .";
$t_head = "Create New Newsflash";
}
$c_interface=new interface();
$c_interface->add("form","adminform","","admin.php?com_option=newsflash");
$c_interface->add("bar");
$c_interface->add("com_header","Add / Edit Newsflash");
$c_interface->add("com_info",$c_info);
$c_interface->add("tab_head");
$c_interface->add("tab_simple","",$t_head,"");
$c_interface->add("form_hidden","newsflash_id","",$rsar['id']);
$c_interface->add("form_textfield","newsflash_title","Title of news",$rsar['title']);
$access_level=array(array("name"=>"Public","value"=>"0"),array("name"=>"Registered","value"=>"1"),array("name"=>"Administrator","value"=>"2"));
$access_level=select($access_level,$rsar['access']);
$c_interface->add("form_select","newsflash_access","Access Level:",$access_level);
$c_interface->add("form_textarea","newsflash_message","Complete news",$rsar['message']);
$c_interface->add("tab_end");
$c_interface->add("tab_tail");
$c_interface->add("end_form");
$c_interface->add("bar");

$c_interface->generate();
}

.

7.2.2 class_toolbar.php

This class is used to build the toolbar which has the button like install , new , edit etc.

The class is already declared as $toolbar so this is how you use it

$toolbar->add("save");
$toolbar->add("back");
$toolbar->generate();

When you click the form it submits the required form ( usally adminform ) and set variable $task as the value defined in the add .

7.2.3 class_upload.php

This class is used to upload files to specified directories

it is used something like

case "upload" : include($aclasses_dir.'class_upload.php');
Upload :: upload_files($absolute_path."admin/backups/");
$antcore->redir("admin.php?com_option=system&option=manage");
break;
case "upload_form" :
include($aclasses_dir.'class_upload.php');
Upload :: interface("admin.php?com_option=system&option=manage",$absolute_path."data/backup/");
break;

Близкие по теме статьи
-

English
Switch to English...
BabelFish.AltaVista.com auto-translate
Скачать Limbo
Ваше мнение?
Что вам мешает использовать Limbo в своих проекта
Безопасность
Недостаток компонентов/модулей
Слабая техподдержка
Плохой форум
Плохие отзывы о Limbo
Недостаток документации


Результаты