<?php /** * Examples Index * @package jqmPhp * @filesource */ /** * Include the jqmPhp class. */ include '../lib/jqmPhp.php'; /** * Create a new jqmPhp object. */ $j = new jqmPhp(); /** * Config 'html' and 'head' tag. */ $j->head()->title('Examples'); /** * Create and config a jqmPage object. */ $p = new jqmPage('examples'); $p->theme('b')->title('Examples'); $p->header()->theme('a'); $p->header()->addButton('Home', './', '', 'home'); //Get the Button Added and Set Attributes $p->header()->items()->get(1)->attribute('data-iconpos', 'notext')->attribute('rel', 'external'); /** * Create and config a new jqmListview object and add Items. */
<?php /** * Adding Custom JavaScript * @package jqmPhp * @filesource */ /** * Include the jqmPhp class. */ include '../lib/jqmPhp.php'; /** * Create a new jqmPhp object. */ $jqmPhp = new jqmPhp(); /** * Adding custom JavaScript to jqmHead in jqmPhp */ $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.
<?php /* * OpenUluh version 0.0.1 * * Copyright (c) 2012-* ShadowEO / Toxus Communications Systems * Licensed under the GPLv3 * You are free to modify, distribute or redistribute this code as you please * so long as the above copyright notice remains intact. */ include "lib/jqmPhp.php"; include "../libs/XBMCHelper.class.php"; 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);
<?php /** * Example 1 - This is a minimalist example. * All classes in the jqmPhp package can be converted * to string and printed with an 'echo' function. * @package jqmPhp * @filesource */ /** * Include the jqmPhp class. */ include '../lib/jqmPhp.php'; $j = new jqmPhp(); $j->addBasicPage('example-1', 'Example 1', '<h1>Hello World</h1><p>This is a basic page!</p><a href="index.php#">Home</a> | <a href="example-2.php#">Example 2</a>'); echo $j;
<?php /* * OpenUluh version 0.0.1 * * Copyright (c) 2012-* ShadowEO / Toxus Communications Systems * Licensed under the GPLv3 * You are free to modify, distribute or redistribute this code as you please * so long as the above copyright notice remains intact. */ include "lib/jqmPhp.php"; include "../libs/XBMCHelper.class.php"; $XBMC = new XBMCHelper(); $jqm = new jqmPhp(); $jqm->head()->add('<meta name="viewport" content="width=device-width, initial-scale=1">'); $page = new jqmPage('episodes', array('data-add-back-btn=true')); $currentPage = basename(__FILE__); switch ($_GET['ac']) { case 'el': $ShowInfo = $XBMC->RetrieveShowInfo($_GET['id']); $page->theme('b')->title($ShowInfo['SeriesName']); $page->header()->theme('a'); $page->AddContent("<h1>Episodes</h1>"); // $page->header()->addButton('Back',"#shows.php?ac=si&id=".$_GET['id'],'a', 'arrow-l'); $list = new jqmListviem(); $list->inset(true)->theme('a'); // $list->addDivider('Episodes', $XBMC->CountShows())->dividerTheme('a')->countTheme('b'); $Shows = $XBMC->RetrieveEpisodesForShow($_GET['id']); foreach ($Shows as $k => $v) { $list->AddIcon("   S" . $v['season'] . "E" . $v['episode'] . ": " . $v['EpisodeName'], 'episodes.php?ac=ei&id=' . $v['idEpisode'], '../getimage.php?ac=et&ri=1&w=400&h=400&id=' . $v['idEpisode']); }
<?php /** * Example 3 - Adding Objects * @package jqmPhp * @filesource */ /** * Include the jqmPhp class. */ include '../lib/jqmPhp.php'; /** * Create a new jqmPhp object. */ $j = new jqmPhp(); /** * Config 'html' and 'head' tag. */ $j->html()->doctype('html'); $j->head()->title('Example 3'); $j->head()->css('http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.css'); $j->head()->jq('http://code.jquery.com/jquery-1.4.4.min.js'); $j->head()->jqm('http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js'); $j->head()->add(new jqmLink('css/custom.css')); // 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
<?php /** * Adding custom CSS * @package jqmPhp * @filesource */ /** * Include the jqmPhp class. */ include '../lib/jqmPhp.php'; /** * Create a new jqmPhp object. */ $jqmPhp = new jqmPhp(); /** * Adding custom CSS to jqmHead in jqmPhp */ $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.
<?php /** * Simple XML Load File to Listview * @package jqmPhp * @filesource */ /** * Include the jqmPhp class. */ include '../lib/jqmPhp.php'; /** * 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; */
<?php /* * OpenUluh version 0.0.1 * * Copyright (c) 2012-* ShadowEO / Toxus Communications Systems * Licensed under the GPLv3 * You are free to modify, distribute or redistribute this code as you please * so long as the above copyright notice remains intact. */ include "lib/jqmPhp.php"; include "../libs/XBMCHelper.class.php"; include "../config/application.php"; $XBMC = new XBMCHelper(); $jqm = new jqmPhp(); $jqm->head()->add('<meta name="viewport" content="width=device-width, initial-scale=1"/>'); $jqm->head()->add('<style> .ui-content { padding: 0px; }</style>'); if ($_GET['ac'] == "si") { $page = new jqmPage('shows', array('data-add-back-btn=true')); } elseif ($_GET['ac'] == "csl") { $page = new jqmPage('shows', array('data-add-back-btn' => 'true')); } else { $page = new jqmPage('shows'); } $currentPage = basename(__FILE__); switch ($_GET['ac']) { case 'csl': $page->theme('b')->title('Shows'); $page->header()->theme('a'); $nav = $page->header()->add(new jqmNavbar(), true); // $page->AddContent('<div style="padding: 15px;">');
<?php /** * Example 2 - Adding Pages * @package jqmPhp * @filesource */ /** * Include the jqmPhp class. */ 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');