Example #1
0
 protected function createComponentForm()
 {
     $form = new Form();
     $form->addText('title', 'Titulek', 80)->addRule(Form::FILLED, 'Vyplňte prosím titulek!');
     $form->addTextarea('text', 'Text', 50, 20)->addRule(Form::FILLED, 'Vyplňte prosím text článku!')->getControlPrototype()->setClass('wysiwyg');
     $form->addSubmit('ok', 'Upravit')->getControlPrototype()->data['confirm'] = "Opravdu chcete upravit tento clanek?";
     $form->onSuccess[] = callback($this, 'process');
     return $form;
 }
<?php

session_start();
require "include/template2.inc.php";
require "include/beContent.inc.php";
require "include/auth.inc.php";
$main = new Skin();
$form = new Form("dataEntry", $channelEntity);
$form->addSection("Picture Management");
$form->addText("title", "Title", 50, MANDATORY);
$form->addTextarea("description", "Description", 2, 100);
$form->addSelectFromReference2($albumEntity, "title_album", "Select Album", 100);
$form->addSelectFromReference2($usersEntity, "username_users", "Username", 100);
if (!isset($_REQUEST['action'])) {
    $_REQUEST['action'] = "edit";
}
switch ($_REQUEST['action']) {
    case "add":
        $main->setContent("body", $form->addItem());
        break;
    case "edit":
        $main->setContent("body", $form->editItem());
        break;
}
$main->close();
?>
 
<?php

session_start();
require "include/template2.inc.php";
require "include/beContent.inc.php";
require "include/auth.inc.php";
$main = new Skin();
$form = new Form("dataEntry", $testEntity);
$form->addSection("Testimonial Management");
$form->addText("name", "Name", 60, MANDATORY);
$form->addPosition("posizione", "Posizione", "name");
$form->addText("edizione", "Edizione", 20, MANDATORY);
$form->addText("affiliazione", "Affiliazione", 60, MANDATORY);
$form->addFile("photo", "Foto");
$form->addTextarea("messaggio", "Messaggio", 10, 60);
if (!isset($_REQUEST['action'])) {
    $_REQUEST['action'] = "edit";
}
switch ($_REQUEST['action']) {
    case "add":
        $main->setContent("body", $form->addItem());
        break;
    case "edit":
        $main->setContent("body", $form->editItem());
        break;
}
$main->close();
?>
 
<?php

session_start();
require "include/template2.inc.php";
require "include/beContent.inc.php";
require "include/auth.inc.php";
$main = new Skin();
$form = new Form("dataEntry", $genEntity);
$form->addSection("Configurations Management");
$form->addText("name", "Name", 40, MANDATORY);
$form->addText("description", "Description", 60);
$form->addTextarea("metadata", "Metadata", 10, 80);
if (!isset($_REQUEST['action'])) {
    $_REQUEST['action'] = "edit";
}
switch ($_REQUEST['action']) {
    case "add":
        $main->setContent("body", $form->addItem());
        break;
    case "edit":
        $main->setContent("body", $form->editItem());
        break;
}
$main->close();
?>