Example #1
0
 private function TraverseComment(&$box, $comments)
 {
     if (sizeof($comments) > 0) {
         foreach ($comments as $comment) {
             if (is_a($comment, 'Comment')) {
                 $args = null;
                 if (Login::IsLoggedIn()) {
                     $args = array('onclick' => 'SelectComment(' . $comment->GetId() . ')');
                 }
                 $childbox = new RTK_Box($comment->GetId(), 'comment');
                 $infobox = new RTK_Box($comment->GetId(), 'commentinfo', $args);
                 $infobox->AddChild(new RTK_Textview($comment->GetUser()->getUserName() . ':', true, null, 'commentposter'));
                 $infobox->AddChild(new RTK_Textview($comment->GetContents(), true, null, 'commentmessage'));
                 $infobox->AddChild(new RTK_Textview('Posted ' . $comment->GetTime(), true, null, 'commenttime'));
                 $childbox->AddChild($infobox);
                 if (!empty($comment->GetComments())) {
                     $this->TraverseComment($childbox, $comment->GetComments());
                 }
                 $box->AddChild($childbox);
             }
         }
     }
 }
Example #2
0
<?php

// Page Logic
if (Value::SetAndNotNull($_POST, 'submit2')) {
    $image = Site::GetUploadedImage('pffile');
}
$text1 = "Normally, both your asses would be dead as f*****g fried chicken, but you happen to pull this shit while I&apos;m in a transitional period so I don&apos;t wanna kill you, I wanna help you. But I can&apos;t give you this case, it don&apos;t belong to me. Besides, I&apos;ve already been through too much shit this morning over this case to hand it over to your dumb ass.";
$text2 = "Look, just because I don&apos;t be givin&apos; no man a foot massage don&apos;t make it right for Marsellus to throw Antwone into a glass motherfuckin&apos; house, f****n&apos; up the way the nigger talks. M**********r do that shit to me, he better paralyze my ass, &apos;cause I&apos;ll kill the m**********r, know what I&apos;m sayin&apos;?";
$text3 = "Your bones don&apos;t break, mine do. That&apos;s clear. Your cells react to bacteria and viruses differently than mine. You don&apos;t get sick, I do. That&apos;s also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We&apos;re on the same curve, just on opposite ends.";
$text4 = "Now that we know who you are, I know who I am. I&apos;m not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain&apos;s going to be? He&apos;s the exact opposite of the hero. And most times they&apos;re friends, like you and me! I should&apos;ve known way back when... You know why, David? Because of the kids. They called me Mr Glass";
// Page Output
include_once 'Pages/OnAllPages.php';
$box1 = new RTK_Box(null, 'widgettest');
$box1->AddChild(new RTK_Pagination(Site::GetBaseURL() . 'notreallyalink/', 100, 10, 5));
$box2 = new RTK_Box(null, 'subtest1');
$box2->AddChild(new RTK_Header("Example Recipe #" . rand(100, 1000)));
$box2->AddChild(new RTK_Image('/imgtest.png', 'alttext', array('class' => 'right')));
$box2->AddChild(new RTK_Textview($text1 . $text4, true));
$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!');
Example #3
0
<?php

// Page Logic
//if (Value::SetAndNotNull($_POST, 'submit2')) {
//	$image = Site::GetUploadedImage('pffile');
//}
$text1 = "Normally, both your asses would be dead as f*****g fried chicken, but you happen to pull this shit while I&apos;m in a transitional period so I don&apos;t wanna kill you, I wanna help you. But I can&apos;t give you this case, it don&apos;t belong to me. Besides, I&apos;ve already been through too much shit this morning over this case to hand it over to your dumb ass.";
$text2 = "Look, just because I don&apos;t be givin&apos; no man a foot massage don&apos;t make it right for Marsellus to throw Antwone into a glass motherfuckin&apos; house, f****n&apos; up the way the nigger talks. M**********r do that shit to me, he better paralyze my ass, &apos;cause I&apos;ll kill the m**********r, know what I&apos;m sayin&apos;?";
$text3 = "Your bones don&apos;t break, mine do. That&apos;s clear. Your cells react to bacteria and viruses differently than mine. You don&apos;t get sick, I do. That&apos;s also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We&apos;re on the same curve, just on opposite ends.";
$text4 = "Now that we know who you are, I know who I am. I&apos;m not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain&apos;s going to be? He&apos;s the exact opposite of the hero. And most times they&apos;re friends, like you and me! I should&apos;ve known way back when... You know why, David? Because of the kids. They called me Mr Glass";
// Page Output
$box1 = new RTK_Box(null, 'widgettest');
$box1->AddChild(new RTK_Pagination('#', 100, 10, 5));
$box2 = new RTK_Box(null, 'subtest1');
$box2->AddChild(new RTK_Header("Example Recipe #" . rand(100, 1000)));
$box2->AddChild(new RTK_Image('image/img00.png', 'alttext', array('class' => 'right')));
$box2->AddChild(new RTK_Textview($text1 . $text4, true));
$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!');
Example #4
0
    Login::SetError(EMPTYSTRING);
}
// Handle the login
if (!Login::IsLoggedIn() && Site::CheckSecurityToken()) {
    if (Login::TryToLogin()) {
        Site::BackToHome();
    }
}
// Page Output
include_once 'Pages/OnAllPages.php';
$RTK->AddJavascript('/jquery-2.1.4.min.js');
$RTK->AddJavascript('/login.js');
if (Login::GetError() != EMPTYSTRING) {
    $RTK->AddElement(new RTK_Textview(Login::GetError()));
}
$loginbox = new RTK_Box('loginbox');
if (Login::IsLoggedIn()) {
    // If a user is logged in
    $loginbox->AddChild(new RTK_Textview('You are logged in as: ' . Login::GetUsername()));
    $loginbox->AddChild(new RTK_Link('Logout' . URLPAGEEXT, 'click here for log out', true));
} elseif (Site::HasHttps()) {
    // If a user is not logged in, but the site is running secure
    $loginform = new RTK_Form('loginform', EMPTYSTRING, 'POST');
    $loginform->AddTextField('loginname', 'Username:'******'loginpass', 'Password:'******'submit', 'log in');
    $loginbox->AddChild($loginform);
} else {
    // If a user is not logged in, and the site is not running secure
    $loginbox->AddChild(new RTK_Textview('You are not running secure and therefore cannot be allowed to log in.'));
    $loginbox->AddChild(new RTK_Link('Login' . URLPAGEEXT, 'click here for encrypted login', true));
Example #5
0
            $commentid = Site::GetPostValueSafely('CommentSelect');
            if (!is_numeric($commentid)) {
                $commentid = EMPTYSTRING;
            }
            Comment::Insert($message, $id, $commentid);
            Site::Redirect(EMPTYSTRING);
        }
    } else {
        Site::BackToHome();
    }
} else {
    Site::BackToHome();
}
// Page Output
include_once 'Pages/OnAllPages.php';
$recipebox = new RTK_Box('recipebox');
$recipedescription = new RTK_Box(null, 'recipedescription');
$recipedescription->AddChild(new RTK_Header($recipe->GetTitle()));
//if (!$edit) { $recipedescription->AddChild(new RTK_Link('EditRecipe'.URLPAGEEXT, 'Edit')); }
if ($recipe->GetPicture() != null) {
    $recipedescription->AddChild(new RTK_Image('/' . $recipe->GetPicture()->GetFileName()));
}
$recipedescription->AddChild(new RTK_Textview($recipe->GetDescription()));
$recipedescription->AddChild(new RTK_Box(null, 'clearfix'));
$recipebox->AddChild($recipedescription);
$i = 0;
if ($edit) {
    $recipebox->AddChild(new RTK_Link('CreateStep' . URLPAGEEXT . '?index=1', 'Add Step Before'));
}
foreach ($recipe->GetSteps() as $step) {
    $i++;
Example #6
0
if (!in_array($showpage, $pages)) {
    $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();
Example #7
0
<?php

// Page Logic
if (Value::SetAndNotNull($_POST, 'submit2')) {
    $image = Site::GetUploadedImage('pffile');
}
$text1 = "Here you can add a recipe to securipe.";
// Page Output
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);
Example #8
0
 /**
  * Adds a Popup to the HTML document
  * @param HtmlElement $element The element to display
  **/
 public function AddPopup($element)
 {
     $id = 'Popup-' . (sizeof($this->_popups) + 1);
     $popup = new RTK_Box($id, 'popup', array('onclick' => 'ClosePopup(\'' . $id . '\')'));
     if (is_a($element, 'HtmlElement')) {
         $popup->AddChild($element);
     } elseif (is_string($element)) {
         $popup->SetContent($element);
     } else {
         $popup = null;
     }
     if ($popup != null) {
         $close = new RTK_Image(RTK_DIRECTORY . 'image/' . RTK_STYLE . '/close.png', 'X', array('class' => 'close'));
         $popup->AddChild($close, 0);
         $this->_popups[] = $popup;
     }
 }
Example #9
0
<?php

// Page Logic
//if (Value::SetAndNotNull($_POST, 'submit2')) {
//	$image = Site::GetUploadedImage('pffile');
//}
$text = "Normally, both your asses would be dead as f*****g fried chicken, but you happen to pull this shit while I&apos;m in a transitional period so I don&apos;t wanna kill you, I wanna help you. But I can&apos;t give you this case, it don&apos;t belong to me. Besides, I&apos;ve already been through too much shit this morning over this case to hand it over to your dumb ass. Look, just because I don&apos;t be givin&apos; no man a foot massage don&apos;t make it right for Marsellus to throw Antwone into a glass motherfuckin&apos; house, f****n&apos; up the way the nigger talks. M**********r do that shit to me, he better paralyze my ass, &apos;cause I&apos;ll kill the m**********r, know what I&apos;m sayin&apos;? Your bones don&apos;t break, mine do. That&apos;s clear. Your cells react to bacteria and viruses differently than mine. You don&apos;t get sick, I do. That&apos;s also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We&apos;re on the same curve, just on opposite ends. Now that we know who you are, I know who I am. I&apos;m not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain&apos;s going to be? He&apos;s the exact opposite of the hero. And most times they&apos;re friends, like you and me! I should&apos;ve known way back when... You know why, David? Because of the kids. They called me Mr Glass";
// Page Output
$box1 = new RTK_Box(null, 'widgettest');
$box1->AddChild(new RTK_Pagination('#', 100, 10, 5));
$prof = new RTK_Box(null, 'subtest1');
$prof->AddChild(new RTK_Header('User profile for: "Ztudmuffin02"'));
$prof->AddChild(new RTK_Image('image/img00.png', 'alttext', array('class' => 'right')));
$prof->AddChild(new RTK_Textview($text, true));
$prof->AddChild(new RTK_Link('woop', 'a link'));
$prof->AddChild(new RTK_Box(null, 'clearfix'));
$box1->AddChild($prof);
$form = new RTK_Form('testform');
$form->AddHiddenField('supersecret', 2);
$form->AddTextField('username', 'Username:'******'Ztudmuffin02');
$form->AddTextField('firstname', 'First name:', 'John');
$form->AddTextField('lastname', 'Last name:', 'Doe');
$form->AddTextField('phonenumber', 'Phone number:');
$form->AddTextField('email', 'Email:');
$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')));
Example #10
0
 /**
  * Adds a comment directly to the view (only use for demonstration purposes)
  * @param string $comment the comment to add to the view
  **/
 public function AddComment($comment)
 {
     if (is_string($comment)) {
         $args = null;
         if (Login::IsLoggedIn()) {
             $args = array('onclick' => 'SelectComment(' . $comment->GetId() . ')');
         }
         $childbox = new RTK_Box($comment->GetId(), 'comment');
         $infobox = new RTK_Box($comment->GetId(), 'commentinfo', $args);
         $infobox->AddChild(new RTK_Textview($comment->GetUser()->GetUserName() . ':', true, null, 'commentposter'));
         $infobox->AddChild(new RTK_Textview($comment->GetContents(), true, null, 'commentmessage'));
         $infobox->AddChild(new RTK_Textview('Posted ' . $comment->GetTime(), true, null, 'commenttime'));
         $childbox->AddChild($infobox);
         if (!empty($comment->GetComments())) {
             $this->TraverseComment($childbox, $comment->GetComments());
         }
         $this->_commentbox::GetLastChild()->AddChild($childbox);
     }
 }