예제 #1
0
파일: index.php 프로젝트: iensenfirippu/RTK
    $showpage = $pages[0];
}
if (!in_array($showstyle, $styles)) {
    $showstyle = $styles[0];
}
// create the requested page
$RTK = new HtmlDocument("RTK example test site");
$RTK->ClearStylesheets();
$faviconpath = 'image' . DIRECTORY_SEPARATOR . 'favicon.png';
if (file_exists($faviconpath)) {
    $RTK->SetFavicon($faviconpath);
}
$RTK->AddStylesheet(RTK_DIRECTORY . 'style/rtk-' . $showstyle . '.css');
$RTK->AddStylesheet('style' . DIRECTORY_SEPARATOR . 'style.css');
$topbar = new RTK_Box('topbar');
$pagestyleform = new RTK_Form('pagestyleform', 'index.php', 'GET', false);
$pagestyleform->AddDropDown('page', 'Page:', $pages, $showpage);
$pagestyleform->AddDropDown('style', 'Style:', $styles, $showstyle);
$topbar->AddChild($pagestyleform);
$button = new RTK_Button();
$button->AddAttributes(array('onclick' => "document.getElementById('pagestyleform').submit()"));
$topbar->AddChild($button);
$RTK->AddElement($topbar, 'BODY', 'topbar');
$wrapper = new RTK_Box('wrapper');
$RTK->AddElement($wrapper, 'BODY', 'wrapper');
$main = new RTK_Box('main');
$RTK->AddElement($main, 'wrapper', 'main');
include_once 'example/' . $showpage . '.php';
echo $RTK;
//Database::Disconnect();
//echo "\n".(microtime(true) - STARTTIME);*/
예제 #2
0
$box2->AddChild(new RTK_Link('woop', 'a link'));
$box2->AddChild(new RTK_Box(null, 'clearfix'));
$box3 = new RTK_Box(null, 'subtest3');
$list = new RTK_ListView(array('woop', 'test', 'wahoo', 'pebkac', 'kesmit'));
$list->AddRow(array('1111', '1111', '1111', '1111', '1111'));
$list->AddRow(array('2222', '2222', '2222', '2222', '2222'));
$list->AddRow(array('3333', '3333', '3333', '3333', '3333'));
$box3->AddChild($list);
$box4 = new RTK_Box(null, 'subtest4');
$form = new RTK_Form('testform');
$form->AddText($text2 . $text3);
$form->AddHiddenField('supersecret', 2);
$form->AddTextField('pfffth', 'Pfft!');
$form->AddTextField('pfffth', 'Pfft!');
$form->AddTextField('pfffth', 'Pfft!');
$form->AddTextField('pfffth', 'Pfft!');
$form->AddTextField('pfffth', 'Pfft!');
$form->AddFileUpload('pffile', 'Phajl!');
$form->AddTextField('pfffffffth', 'Pffffft!', null, 5);
$form->AddPasswordField('passw0rds', 'A password: '******'chk_salmon', 'Has salmon: ', true, 'salmon');
$form->AddRadioButtons('rad_options', '_buttons: ', array(array('opt_1', 'fisk'), 'opt_2', array('opt_3', 'ikkefisk')), 'opt_2');
$form->AddDropDown('DROP', 'daun', array(array('opt_1', 'fisk'), 'opt_2', array('opt_3', 'ikkefisk')), 'opt_3');
$form->AddElement('custom', 'Custom "input": ', new RTK_Image('/imgtest.png', 'bleh', array('customarg1' => 'nisser')));
$form->AddButton('submit2', 'Submit2!');
$box4->AddChild($form);
$box4->AddChild(new RTK_Box(null, 'clearfix'));
$box1->AddChild($box2);
$box1->AddChild($box3);
$box1->AddChild($box4);
$RTK->AddElement($box1);
예제 #3
0
include_once 'Pages/OnAllPages.php';
$box1 = new RTK_Box(null, 'createrecipe');
$box2 = new RTK_Box(null, 'subtest1');
$box2->AddChild(new RTK_Header("Create a recipe"));
$box2->AddChild(new RTK_Textview($text1, true));
$box2->AddChild(new RTK_Box(null, 'clearfix'));
$box3 = new RTK_Box(null, 'subtest3');
$items = array();
$items[] = array('0', 'fisk');
$items[] = array('1', 'ost');
$items[] = array('2', 'ikkefisk');
$box4 = new RTK_Box(null, 'subtest4');
$form = new RTK_Form('testform');
$form->AddTextField('title', 'Recipe title:');
$form->AddTextField('description', 'Description:', null, 5);
$form->AddDropDown('type', 'Type:', $items, $items[2][0]);
$form->AddFileUpload('imagepath', 'Image: ');
$form->AddButton('Submit', 'Submit recipe');
$box4->AddChild($form);
$box4->AddChild(new RTK_Box(null, 'clearfix'));
$box1->AddChild($box2);
$box1->AddChild($box3);
$box1->AddChild($box4);
$RTK->AddElement($box1);
//$recipeId = "1";
if (Value::SetAndNotNull($_POST, 'Submit')) {
    $imagepath = Site::GetPostValueSafely("imagepath");
    $title = Site::GetPostValueSafely("title");
    $type = Site::GetPostValueSafely("type");
    $description = Site::GetPostValueSafely("description");
    //$image = new Image($imagepath);