/** * 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. */ $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->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'); $p->addContent($list); /** * Add the page to jqmPhp object. */ $jqmPhp->addPage($p); /** * Generate the HTML code. */ echo $jqmPhp;
/** * Creating a new Listview. This will be added as a nested item. */ $lv_cars = new jqmListview(); foreach ($brand->car as $car) { $lv_cars->addBasic($car, '#'); } /** * Adding Nested Item (Other Listview); */ $lv->addNested($brand->name, $lv_cars); } } /** * Adding Source Code Links. */ $list = new jqmListview(); $li = $list->addBasic('cars.xml', 'cars.xml', '', true); $li->rel('external')->target('_blank'); $li = $list->addBasic('simple-xml.php', 'simple-xml.php.txt', '', true); $li->rel('external')->target('_blank'); $lv->addDivider('S'); $lv->addNested('Source Code', $list); /** * Add the page to jqmPhp object. */ $jqmPhp->addPage($p); /** * Generate the HTML code. */ echo $jqmPhp;
$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); /** * Add the page to jqmPhp object. */ $jqmPhp->addPage($p); /** * Generate the HTML code. */ echo $jqmPhp;
/** * Create and config a new jqmListview object and add Nested Items. */ $p->addContent('<h3>Nested</h3>'); $list5 = new jqmListview(); $list5->inset(true)->theme('a'); $list5->addDivider('Cars'); $fiat = new jqmListview(); $fiat->addBasic('Bravo', 'example-5.php#'); $fiat->addBasic('Linea', 'example-5.php#'); $fiat->addBasic('Punto', 'example-5.php#'); $list5->addNested('Fiat', $fiat); $gm = new jqmListview(); $gm->addBasic('Celta', 'example-5.php#'); $gm->addBasic('Agile', 'example-5.php#'); $gm->addBasic('Vectra', 'example-5.php#'); $list5->addNested('GM', $gm); $honda = new jqmListview(); $honda->addBasic('Fit', 'example-5.php#'); $honda->addBasic('City', 'example-5.php#'); $honda->addBasic('Civic', 'example-5.php#'); $list5->addNested('Honda', $honda); $p->addContent($list5); /** * Add the page to jqmPhp object. */ $j->addPage($p); /** * Generate the HTML code. */ echo $j;