$styles[] = RTK::RemovePrefix(pathinfo($dir)['filename'], 'rtk-'); } 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';