Esempio n. 1
0
<!-- ==========================CONTENT STARTS HERE ========================== -->
<!-- MAIN PANEL -->
<div id="main" role="main">
	<?php 
//configure ribbon (breadcrumbs) array("name"=>"url"), leave url empty if no url
//$breadcrumbs["New Crumb"] => "http://url.com"
$breadcrumbs["Misc"] = "";
include "inc/ribbon.php";
?>

	<!-- MAIN CONTENT -->
	<div id="content">
		<section id="widget-grid" class="">
			<?php 
$ui = new SmartUI();
$btn_simple = $ui->create_button('Click Me!', 'danger')->attr('href', 'http://facebook.com')->attr('target', '_blank')->icon('fa-gear')->print_html(true);
$btn_spinning = $ui->create_button('', 'success')->class(array('bg-color-green', 'txt-color-white'))->icon('fa-refresh fa-4x fa-spin')->print_html(true);
$btn_circle = $ui->create_button('', 'primary')->class('btn-circle')->size('lg')->icon('fa-check')->print_html(true);
$btn_labeled = $ui->create_button('A Labeled Button', 'success')->icon('fa-check')->options('labeled', true)->print_html(true);
// dropdown
$items = array('<a href="javascript:void(0);">Some action</a>', '<a href="javascript:void(0);">Some other action</a>', '-', array('content' => '<a tabindex="-1" href="javascript:void(0);">Hover me for more options</a>', 'submenu' => array('<a tabindex="-1" href="javascript:void(0);">Second level</a>', array('content' => '<a href="javascript:void(0);">Even More..</a>', 'submenu' => array('<a href="javascript:void(0);">3rd level</a>', '<a href="javascript:void(0);">3rd level</a>')), '<a href="javascript:void(0);">Second level</a>', '<a href="javascript:void(0);">Second level</a>')));
$dropdown = $ui->create_button('Simple Dropdown')->dropdown('items', $items)->dropdown('split', false)->print_html(true);
$dropdown_split = $ui->create_button('Split Dropdown')->dropdown('items', $items)->dropdown('split', array('type' => 'success', 'disabled' => false, 'dropup' => false, 'class' => array('class-1', 'class-2', 'class-custom'), 'attr' => array('data-custom-attr' => '12345')))->dropdown('multilevel', true)->attr('href', 'http://twitter.com')->attr('data-custom-id', '34343')->size(Button::BUTTON_SIZE_XSMALL)->print_html(true);
$run_time = $ui->run_time(false);
$widget = $ui->create_widget();
$body = $btn_simple . $btn_spinning . $btn_circle . $btn_labeled . '
					<hr class="simple" />
					' . $dropdown . '
					<hr class="simple" />
					' . $dropdown_split;
$widget->body('content', $body)->header('title', '<h2>SmartUI::Button</h2>')->print_html();
Esempio n. 2
0
		<section id="widget-grid" class="">
			
			<?php 
$ui = new SmartUI();
$ui->start_track();
$data = json_decode(file_get_contents(APP_URL . '/data/data.json'));
// SmartForm layout
$fields = array('fname' => array('type' => 'input', 'col' => 6, 'properties' => array('placeholder' => 'First name', 'icon' => 'fa-user', 'icon_append' => false)), 'lname' => array('type' => 'input', 'col' => 6, 'properties' => array('placeholder' => 'Last name', 'icon' => 'fa-user', 'icon_append' => false)), 'email' => array('type' => 'input', 'col' => 6, 'properties' => array('placeholder' => 'E-mail', 'icon' => 'fa-envelope', 'type' => 'email', 'icon_append' => false)), 'phone' => array('type' => 'input', 'col' => 6, 'properties' => array('placeholder' => 'Phone', 'icon' => 'fa-phone', 'type' => 'email', 'icon_append' => false)), 'country' => array('type' => 'select', 'col' => 5, 'properties' => array('data' => array(array('country' => 'Philippines'), array('country' => 'USA'), array('country' => 'Canada')))), 'city' => array('type' => 'input', 'col' => 4, 'properties' => array('placeholder' => 'City')), 'zip' => array('type' => 'input', 'col' => 3, 'properties' => array('placeholder' => 'Post Code')), 'address' => array('type' => 'input', 'properties' => 'Address'), 'other-info' => array('type' => 'textarea', 'properties' => 'Additional Info'), 'card' => array('type' => 'radio', 'properties' => array('items' => array(array('label' => 'Visa', 'checked' => true), 'MasterCard', 'American Express'), 'inline' => true)), 'name-on-card' => array('col' => 10, 'properties' => 'Name on card'), 'cvv' => array('col' => 2, 'properties' => 'CVV2'), 'card-label' => array('type' => 'label', 'col' => 4, 'properties' => 'Expiration Date'), 'card-month' => array('type' => 'select', 'col' => 5, 'properties' => array('data' => array(array('month' => 'January'), array('month' => 'February'), array('month' => '...')))), 'card-year' => array('col' => 3, 'properties' => 'Year'));
$form = $ui->create_smartform($fields);
$form->options('method', 'post');
$form->fieldset(0, array('fname', 'lname', 'email', 'phone'));
$form->fieldset(1, array('country', 'city', 'zip', 'address', 'other-info'));
$form->fieldset(2, array('card', 'name-on-card', 'cvv', 'card-label', 'card-month', 'card-year'));
$form->header('Automatic Layout Creation!');
$form->footer(function ($this) use($ui) {
    $btn = $ui->create_button('Submit', 'primary')->attr(array('type' => 'submit'));
    return $btn->print_html(true);
});
$form->title('<h2>Auto Layout</h2>');
$result = $form->print_html(true);
echo $result;
// individual print field
$body = '
					
					<form class="smart-form">
						<header>Individual Print Fields (setup your own form HTML)</header>
						<fieldset>
							<div class="row">
								' . SmartForm::print_field('name', SmartForm::FORM_FIELD_INPUT, array('icon' => 'fa-user', 'tooltip' => 'Input name', 'placeholder' => 'Name', 'label' => 'Your Name', 'note' => '<strong>Note:</strong> Type in something to autocomplete', 'autocomplete' => array('data' => $data, 'display' => 'Name', 'value' => 'Name')), 6, true) . '
								' . SmartForm::print_field('email', SmartForm::FORM_FIELD_INPUT, array('icon' => 'fa-envelope', 'tooltip' => 'This is a tooltip', 'type' => 'email', 'label' => 'Email Address', 'placeholder' => '*****@*****.**'), 6, true) . '
							</div>