include "../config/application.php"; $currentPage = basename(__FILE__); $XBMC = new XBMCHelper(); $jqm = new jqmPhp(); $jqm->head()->title($config['AppTitle']); $jqm->head()->add("<meta name='viewport' content='width=device-width, initial-scale=1'/>"); // $jqm->head()->add(new jqmLink("themes/PandoraTV.min.css")); $page = new jqmPage('index'); $page->theme('b')->title($config['AppTitle']); $page->header()->theme('a'); $nav = $page->header()->add(new jqmNavbar(), true); $nav->add(new jqmButton('', '', '', 'a', "index.php", 'Home', '', true)); $nav->add(new jqmButton('', '', '', 'a', 'shows.php?ac=sl', 'All Shows', '', false)); $nav->add(new jqmButton('', '', '', 'a', 'channels.php?ac=cl', 'Channels', '', false)); //$page->AddContent('<h1>Pandora TV</h1>'); $g = $page->addContent(new jqmGrid(), true); $g->grid('b'); $ShowsList = $XBMC->RetrieveShowList(); $randshows = shuffle($ShowsList); $column1 = 0; $column2 = 0; $list = new jqmListviem(); $list->inset(true)->theme('a'); $list->addDivider('Random Shows')->dividerTheme('a')->countTheme('b'); foreach ($ShowsList as $k => $v) { if ($column1 != 4) { $list->AddBasic($v['SeriesName'], 'shows.php?ac=si&id=' . $v['idShow']); $column1++; } } $page->AddContent($list);
/** * Create and config a new jqmListview object and add Items. */ $list1 = new jqmListview(); $list1->splitIcon('search')->splitTheme('c'); $list1->addDivider('Beginner', '2')->inset(true); $list1->addBasic('Basic Example', 'example-1.php#'); $list1->items()->get(1)->add('<a href="example-1.php.txt" rel="external" target="_blank"></a>'); $list1->addBasic('Adding Pages', 'example-2.php#'); $list1->items()->get(2)->add('<a href="example-2.php.txt" rel="external" target="_blank"></a>'); $list1->addDivider('Intermediate', '3'); $list1->addBasic('Adding Objects', 'example-3.php#'); $list1->items()->get(4)->add('<a href="example-3.php.txt" rel="external" target="_blank"></a>'); $list1->addBasic('Adding Form Elements', 'example-4.php#'); $list1->items()->get(5)->add('<a href="example-4.php.txt" rel="external" target="_blank"></a>'); $list1->addBasic('Adding Listview', 'example-5.php#'); $list1->items()->get(6)->add('<a href="example-5.php.txt" rel="external" target="_blank"></a>'); $list1->addDivider('Advanced', '3'); $list1->add('<li><a href="custom-css.php" rel="external">Custom CSS</a><a href="custom-css.php.txt" rel="external" target="_blank"></a></li>'); $list1->add('<li><a href="custom-js.php" rel="external">Custom JavaScript</a><a href="custom-js.php.txt" rel="external" target="_blank"></a></li>'); $list1->addBasic('Load Simple XML', 'simple-xml.php#'); $list1->items()->get(10)->add('<a href="simple-xml.php.txt" rel="external" target="_blank"></a>'); $p->addContent($list1); /** * Add the page to jqmPhp object. */ $j->addPage($p); /** * Generate the HTML code. */ echo $j;
// Adding a custom CSS. $j->head()->add(new jqmScript('js/custom.js')); // Adding a custom JavaScript. //$j->body()->attribute('onload', 'initCustom();'); // Adding a custom attribute to 'body' tag. /** * Create and config a jqmPage object. * Most methods return the object itself allowing call * another method on the object in sequence. */ $p = new jqmPage('example-3'); $p->theme('b')->title('Example 3')->header()->addButton('Example 2', 'example-2.php#', 'a', 'arrow-l')->addButton('Example 4', 'example-4.php#', 'b', 'arrow-r')->theme('a'); /** * addContent() is alias to content()->add(). */ $p->content()->add('<h1>Adding Objects</h1>'); $p->addContent('<h3>Controlgroup and Buttons</h3>'); /** * Create and config a new jqmControlgroup object and add items. * Most methods of addition have the last parameter $returnAdded. * If it is set to 'true' the added object is returned, otherwise * the object that called the method is returned. */ $cg = $p->content()->add(new jqmControlgroup(), true); $cg->dataType('vertical'); $cg->add(new jqmButton('', '', '', 'a', 'index.php#', 'Home', 'home', false)); $cg->add(new jqmButton('', '', '', 'b', 'example-1.php#', 'Example 1', 'arrow-l', false)); $cg->add(new jqmButton('', '', '', 'b', 'example-2.php#', 'Example 2', 'arrow-l', false)); $cg->add(new jqmButton('', '', '', 'b', '#', 'Example 3', 'check', true)); $cg->add(new jqmButton('', '', '', 'b', 'example-4.php#', 'Example 4', 'arrow-r', false)); $cg->add(new jqmButton('', '', '', 'b', 'example-5.php#', 'Example 5', 'arrow-r', false)); /**
*/ $jqmPhp->head()->title('Custom JS Example'); $jqmPhp->head()->add(new jqmScript('custom.js')); /** * Create a new jqmPage object. */ $p = new jqmPage('custom-js'); $p->theme('b'); $p->title('Custom JS Example'); $p->header()->theme('a'); $bt = $p->header()->addButton('', 'index.php#', 'a', 'home', false, false, true); $bt->rel('external')->attribute('data-iconpos', 'notext'); /** * Adding Content. */ $p->addContent('<h1>Adding Custom JavaScript</h1>'); $p->addContent('<p align="justify">To add a custom JS you need add the tag <b>' . htmlspecialchars('<script...></script>') . '</b>'); $p->addContent(' to the jqmHead object [<b>' . htmlspecialchars('$jqmPhp->head()') . '</b>] in the jqmPhp instance. '); $p->addContent('To facilitate the addition of JS you can use the class <b>jqmScript</b> as example:</p>'); $p->addContent('<pre class="ui-body-c" style="padding:20px;">$jqmPhp = new jqmPhp();' . "\n" . '$jqmPhp->head()->add(' . "\n\t" . 'new jqmScript(\'custom.js\')' . "\n" . ');</pre>'); $p->addContent(new jqmTag('p', 'p_js', 'class="ui-body-c" style="padding:20px;"', ' ')); /** * Adding Source Code Links. */ $list = new jqmListview(); $list->inset(true)->dividerTheme('a'); $list->addDivider('Source Code'); $li = $list->addBasic('custom.js', 'custom.js', '', true); $li->rel('external')->target('_blank'); $li = $list->addBasic('custom-js.php', 'custom-js.php.txt', '', true); $li->rel('external')->target('_blank');
*/ $jqmPhp->head()->title('Custom CSS Example'); $jqmPhp->head()->add(new jqmLink('custom.css')); /** * Create a new jqmPage object. */ $p = new jqmPage('custom-css'); $p->theme('b'); $p->title('Custom CSS Example'); $p->header()->theme('a'); $bt = $p->header()->addButton('', 'index.php#', 'a', 'home', false, false, true); $bt->rel('external')->attribute('data-iconpos', 'notext'); /** * Adding Content. */ $p->addContent('<h1>Adding Custom CSS</h1>'); $p->addContent('<p align="justify">To add a custom CSS you need add the tag <b>' . htmlspecialchars('<link...></link>') . '</b>'); $p->addContent(' to the jqmHead object [<b>' . htmlspecialchars('$jqmPhp->head()') . '</b>] in the jqmPhp instance. '); $p->addContent('To facilitate the addition of CSS you can use the class <b>jqmLink</b> as example:</p>'); $p->addContent('<pre class="ui-body-c">$jqmPhp = new jqmPhp();' . "\n" . '$jqmPhp->head()->add(' . "\n\t" . 'new jqmLink(\'custom.css\')' . "\n" . ');</pre>'); /** * Adding Source Code Links. */ $list = new jqmListview(); $list->inset(true)->dividerTheme('a'); $list->addDivider('Source Code'); $li = $list->addBasic('custom.css', 'custom.css', '', true); $li->rel('external')->target('_blank'); $li = $list->addBasic('custom-css.php', 'custom-css.php.txt', '', true); $li->rel('external')->target('_blank'); $p->addContent($list);
/** * Create a new jqmPhp object. */ $jqmPhp = new jqmPhp(); /** * Create a new jqmPage object. */ $p = new jqmPage('simple-xml'); $p->theme('b'); $p->title('Cars'); $bt = $p->header()->addButton('', 'index.php#', 'b', 'home', false, false, true); $bt->rel('external')->attribute('data-iconpos', 'notext'); /** * Adding Listview to jqmPage. */ $lv = $p->addContent(new jqmListviem(), true); $lv->filter(true); /** * Reading XML; */ $xml = @simplexml_load_file('cars.xml') or die("error loading xml file."); foreach ($xml->brandGroup as $brandGroup) { /** * Adding Dividers. */ $lv->addDivider($brandGroup->name); foreach ($brandGroup->brand as $brand) { /** * Creating a new Listview. This will be added as a nested item. */ $lv_cars = new jqmListview();
$nav->add(new jqmButton('', '', '', 'a', 'example-3.php#', 'EX3', '', false)); $nav->add(new jqmButton('', '', '', 'a', 'example-4.php#', 'EX4', '', false)); $nav->add(new jqmButton('', '', '', 'a', '#', 'EX5', '', true)); /** * Confif page footer (jqmFooter). */ $p->footer()->addButton('EX1', 'example-1.php#', '', 'arrow-l'); $p->footer()->addButton('EX2', 'example-2.php#', '', 'arrow-l'); $p->footer()->addButton('EX3', 'example-3.php#', '', 'arrow-l'); $p->footer()->addButton('EX4', 'example-4.php#', '', 'arrow-l'); $p->footer()->addButton('EX5', '#', '', 'check', true); $p->footer()->group(true)->uiBar(true)->theme('a'); /** * Create and config a new jqmListview object and add Basic Items. */ $p->addContent('<h1>Adding Listviews</h1>'); $p->addContent('<h3>Basic</h3>'); $list1 = new jqmListview(); $list1->addDivider('Basic Examples', '2')->inset(true); $list1->addBasic('Example 1', 'example-1.php#'); $list1->addBasic('Example 2', 'example-2.php#'); $list1->addDivider('Advanced Examples', '3')->inset(true); $list1->addBasic('Example 3', 'example-3.php#'); $list1->addBasic('Example 4', 'example-4.php#'); $list1->addBasic('Example 5', '#'); $p->addContent($list1); /** * Create and config a new jqmListview object and add Icon Items. */ $p->addContent('<h3>Icon</h3>'); $list2 = new jqmListview();
*/ include '../lib/jqmPhp.php'; /** * Create a new jqmPhp object. */ $j = new jqmPhp(); /** * Create a new jqmPage object. */ $p = new jqmPage('example-2'); $p->theme('b'); $p->title('Example 2'); $p->header()->addButton('Example 1', 'example-1.php#', 'a', 'arrow-l'); $p->header()->addButton('Example 3', 'example-3.php#', 'b', 'arrow-r'); $p->header()->theme('a'); $p->addContent('<h1>Adding Pages</h1>'); $p->addContent('<p>In this example we create a page (jqmPage),'); $p->addContent(' add content and buttons to the header.'); $p->addContent(' After we add the page to jqmPhp object.</p>'); $p->addContent('<a href="index.php#" data-role="button" data-theme="a">Home</a>'); $p->addContent('<a href="example-3.php#" data-role="button">Example 3</a>'); $p->footer()->title('Example 2 Footer'); $p->footer()->position('fixed'); $p->footer()->theme('a'); /** * Add the page to jqmPhp object. */ $j->addPage($p); /** * Generate the HTML code. */
$nav->add(new jqmButton('', '', '', 'a', '#', 'EX4', '', true)); $nav->add(new jqmButton('', '', '', 'a', 'example-5.php#', 'EX5', '', false)); /** * Confif page footer (jqmFooter). */ $p->footer()->addButton('EX1', 'example-1.php#', '', 'arrow-l'); $p->footer()->addButton('EX2', 'example-2.php#', '', 'arrow-l'); $p->footer()->addButton('EX3', 'example-3.php#', '', 'arrow-l'); $p->footer()->addButton('EX4', '#', '', 'check', true); $p->footer()->addButton('EX5', 'example-5.php#', '', 'arrow-r'); $p->footer()->group(true)->uiBar(true)->theme('a'); /** * Create and config a new jqmForm object and add items. */ $p->content()->add('<h1>Adding Form Elements</h1>'); $form = $p->addContent(new jqmForm(), true); $form->action('example-4.php?rand=' . rand(0, 9999))->method('POST'); /** * Add some jqmInput objects. */ $form->add('<h3>Text Inputs</h3>'); $form->add(new jqmInput('uid', 'uid', 'text', '', 'Username:'******'', true)); $form->add(new jqmInput('pwd', 'pwd', 'password', '', 'Password:'******'', true)); $form->add(new jqmInput('find', 'find', 'search', '', 'Search:', '', true)); /** * Add a jqmTextarea object. */ $form->add('<h3>Textarea</h3>'); $form->add(new jqmTextarea('msg', 'msg', '', '80', '4', 'Comments:', '', true)); /** * Add a jqmRange object.