Esempio n. 1
0
?>

	<!-- MAIN CONTENT -->
	<div id="content">
		<!-- widget grid -->
		<section id="widget-grid" class="">
		
			<!-- row -->
			<div class="row">
				
				<!-- NEW WIDGET START -->
				<article class="col-xs-12">
					<?php 
$ui = new SmartUI();
$options = array("fullscreenbutton" => false);
$widget = $ui->create_widget($options);
//you can also set options this way
//$widget->options = $options;
//set a widget property by passing closure
$widget->attr = function ($widget) {
    return 'data-custom-attr="test" data-some-id="12341111"';
};
//set a widget property by passing an array
//$widget->attr = array("data-custom-attr"=>"test", "data-some-id" => "12341111");
//set a widget property by passing string (some properties are required only to have strings)
//$widget->attr = 'data-custom-attr="test" data-some-id="12341111"';
//same as attr example, you can do the same with other widget properties
//$widget->header = '<h2><strong>Default</strong> <i>Widget</i> PHP</h2>';
//Let's do some dynamic content on the header. Passing toolbar and content keys to $widget->header
$widget->header = array("icon" => 'fa-check', "toolbar" => array(array("id" => "toolbar-id", "content" => '<label class="input"> <i class="icon-append fa fa-question-circle"></i>
												<input type="text" placeholder="Focus to view the tooltip">
					            ' . $dt->js("oTable") . '.fnFilter(filters.join("|"), 7, true, false);
					        })');
// print JS content
$js = $dt->print_js(true);
$run_time = $ui->run_time(false);
echo $html;
?>
				</article>
				<article class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
					<?php 
$options = array("editbutton" => false, "colorbutton" => false, "collapsed" => true);
// print html output
$hb = new HTMLIndent();
$html_snippet = SmartUtil::clean_html_string($hb->indent($html), false);
$contents = array("body" => '<pre class="prettyprint linenums">' . $html_snippet . '</pre>', "header" => array("icon" => 'fa fa-code', "title" => '<h2>HTML Output (Run Time: ' . $run_time . ')</h2>'));
$ui->create_widget($options, $contents)->color('pink')->print_html();
// print js
$js_snippet = SmartUtil::clean_html_string($js);
$js_contents = array("body" => '<pre class="prettyprint linenums">' . $js_snippet . '</pre>', "header" => array("icon" => 'fa fa-code', "title" => '<h2>JS Output</h2>'));
$ui->create_widget($options, $js_contents)->color('green')->print_html();
?>
				</article>
			</div>
			<div class="row">

				<div class="col-sm-12">
					<div class="well">
						<?php 
$md = file_get_contents("docs/smartui/datatable.md");
$parsedown = new Parsedown();
$doc = $parsedown->parse($md);
Esempio n. 3
0
// smartui code
$prg_simple = SmartUI::print_progress(33, 'info', null, true);
$prg_danger_right_striped_active = SmartUI::print_progress(55.5, 'danger', array('position' => 'right', 'striped' => 'active', 'tooltip' => 'This is tooltip'), true);
$prg_small_striped = SmartUI::print_progress(20, '', array('background' => 'redLight', 'size' => 'sm', 'striped' => true), true);
$prg_micro = SmartUI::print_progress(60, '', array('background' => 'greenLight', 'size' => 'micro'), true);
$prg_trans = SmartUI::print_progress('21%', 'success', array('transitional' => true), true);
$prg_trans_vertical_bottom = SmartUI::print_progress('80%', '', array('transitional' => true, 'vertical' => true, 'position' => 'bottom', 'background' => 'redLight'), true);
$prg_trans_vertical = SmartUI::print_progress('80%', 'primary', array('transitional' => true, 'vertical' => true), true);
// stack progress bars
$prg_stack = array();
$prg_stack[] = SmartUI::get_progress(80, '', array('background' => 'redLight'));
$prg_stack[] = SmartUI::get_progress(55, 'info');
$prg_stack[] = SmartUI::get_progress(33, 'success');
$prg_stack_progress = SmartUI::print_stack_progress($prg_stack, array('size' => 'sm', 'tooltip' => 'Stacked Progress', 'striped' => 'active'), true);
$body = $prg_simple . $prg_micro . $prg_small_striped . $prg_danger_right_striped_active . $prg_trans . $prg_trans_vertical . $prg_trans_vertical_bottom . $prg_stack_progress;
$ui->create_widget()->body('content', $body)->header('title', '<h2>SmartUI Alerts</h2>')->print_html();
// print html output
$run_time = $ui->run_time(false);
$hb = new HTMLIndent();
$html_snippet = SmartUtil::clean_html_string($hb->indent($body), false);
$contents = array("body" => '<pre class="prettyprint linenums">' . $html_snippet . '</pre>', "header" => array("icon" => 'fa fa-code', "title" => '<h2>HTML Output (Run Time: ' . $run_time . ')</h2>'));
$options = array("editbutton" => false, "colorbutton" => false, "collapsed" => true);
$ui->create_widget($options, $contents)->color('pink')->print_html();
?>
			
			<div class="row">
		
				<div class="col-sm-12">
					<div class="well">
						<?php 
$md = file_get_contents("docs/smartui/progress.md");
Esempio n. 4
0
			<?php 
$ui = new SmartUI();
$ui->start_track();
// smartui code
$panels = array('panel1' => 'Collapsible Group Item #1', 'panel2' => 'Collapsible Group Item #2', 'panel3' => 'Collapsible Group Item #3');
$accordion = $ui->create_accordion($panels);
$accordion->content('panel1', 'Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et.');
$accordion->content('panel2', function ($this, $panels) use($ui) {
    $data = json_decode(file_get_contents(APP_URL . "/data/data.json"));
    $dt = $ui->create_datatable($data)->options('in_widget', false);
    return $dt->print_html(true);
})->padding('panel2', false)->expand('panel2', true);
$accordion->icons('panel2', array('fa fa-fw fa-plus-circle txt-color-green pull-right', 'fa-fw fa-minus-circle txt-color-red pull-right'));
$accordion_html = $accordion->print_html(true);
$body = $accordion_html;
$ui->create_widget()->body('content', $body)->options('editbutton', false)->header('title', '<h2>SmartUI::Accordion</h2>')->print_html();
// print html output
$run_time = $ui->run_time(false);
$hb = new HTMLIndent();
$html_snippet = SmartUtil::clean_html_string($hb->indent($body), false);
$contents = array("body" => '<pre class="prettyprint linenums">' . $html_snippet . '</pre>', "header" => array("icon" => 'fa fa-code', "title" => '<h2>HTML Output (Run Time: ' . $run_time . ')</h2>'));
$options = array("editbutton" => false, "colorbutton" => false, "collapsed" => true);
$ui->create_widget($options, $contents)->color('pink')->print_html();
?>
			
			<div class="row">
		
				<div class="col-sm-12">
					<div class="well">
						<?php 
$md = file_get_contents("docs/smartui/accordion.md");
Esempio n. 5
0
						</fieldset>
						<fieldset>
							' . SmartForm::print_field('rating-star', SmartForm::FORM_FIELD_RATING, 10, null, true) . '
							' . SmartForm::print_field('rating-star2', SmartForm::FORM_FIELD_RATING, array('max' => 8, 'icon' => 'fa-asterisk', 'label' => 'Rating', 'note' => '<strong>Note:</strong> This is a customized rating field'), null, true) . '

						</fieldset>
						<fieldset>
							' . SmartForm::print_field('rating-multiple', SmartForm::FORM_FIELD_RATINGS, array('items' => array(array('max' => 6, 'icon' => 'fa-trophy', 'label' => 'The Rating'), 3, 7, 10, 20), 'label' => 'Multiple Ratings? No problem!'), null, true) . '
						</fieldset>
						<footer>
							' . $ui->create_button('Submit', 'primary')->container('button')->attr(array('type' => 'submit'))->print_html(true) . '
						</footer>
					</form>

				';
$ui->create_widget()->body('content', $body)->options('editbutton', false)->body('class', 'no-padding')->header('title', '<h2>SmartUI::SmartForm</h2>')->print_html();
// print html output
$run_time = $ui->run_time(false);
$hb = new HTMLIndent();
$html_snippet = SmartUtil::clean_html_string($hb->indent($body), false);
$contents = array("body" => '<pre class="prettyprint linenums">' . $html_snippet . '</pre>', "header" => array("icon" => 'fa fa-code', "title" => '<h2>HTML Output (Run Time: ' . $run_time . ')</h2>'));
$options = array("editbutton" => false, "colorbutton" => false, "collapsed" => true);
$ui->create_widget($options, $contents)->color('pink')->print_html();
?>
			
			<div class="row">
		
				<div class="col-sm-12">
					<div class="well">
						<?php 
$md = file_get_contents("docs/smartui/smartform.md");