protected function _call($ui_member, $structure, $name, $args) { if (property_exists($structure, $name)) { if (!$args) { return $structure->{$name}; } $value = null; $key = null; if (count($args) > 1 && is_array($structure->{$name})) { $key = $args[0]; $value = $args[1]; if (!is_string($key) && !is_int($key)) { SmartUI::err("SmartUI structure property: {$name} must be string or int."); return null; } $structure->{$name}[$key] = $value; if (isset($args[2]) && SmartUtil::is_closure($args[2])) { //process callback $callback = $args[2]; SmartUtil::run_callback($callback, array($ui_member)); } return $ui_member; } else { if (isset($args[1]) && SmartUtil::is_closure($args[1])) { $value = $args[0]; $structure->{$name} = $value; $callback = $args[1]; SmartUtil::run_callback($callback, array($ui_member)); return $ui_member; } else { if (is_array($structure->{$name}) && (is_string($args[0]) || is_int($args[0]))) { $key = $args[0]; if (!is_string($key) && !is_int($key)) { SmartUI::err("SmartUI property key: {$key} must be string or int."); return null; } return $structure->{$name}[$key]; } else { $value = $args[0]; $structure->{$name} = $value; return $ui_member; } } } } SmartUI::err('Undefined structure property: ' . $name); return null; }
<?php use App\Libraries\SmartUI; //configure constants $directory = realpath(dirname(__FILE__)); $document_root = realpath($_SERVER['DOCUMENT_ROOT']); $base_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST']; if (strpos($directory, $document_root) === 0) { $base_url .= str_replace(DIRECTORY_SEPARATOR, '/', substr($directory, strlen($document_root))); } defined("APP_URL") ? null : define("APP_URL", str_replace("/lib", "", $base_url)); //Assets URL, location of your css, img, js, etc. files defined("ASSETS_URL") ? null : define("ASSETS_URL", APP_URL); //require library files //require_once("util.php"); SmartUI::$icon_source = 'fa'; // register our UI plugins SmartUI::register('widget', 'Widget'); SmartUI::register('datatable', 'DataTable'); SmartUI::register('button', 'Button'); SmartUI::register('tab', 'Tab'); SmartUI::register('accordion', 'Accordion'); SmartUI::register('carousel', 'Carousel'); SmartUI::register('smartform', 'SmartForm'); SmartUI::register('nav', 'Nav'); //require_once("class.html-indent.php"); //require_once("class.parsedown.php");
{{--<i class="fa fa-angle-down"></i>--}} </a> </span> </div> <!-- end user info --> <!-- NAVIGATION : This navigation is also responsive To make this navigation dynamic please make sure to link the node (the reference to the nav > ul) after page load. Or the navigation will not initialize. --> <nav> <!-- NOTE: Notice the gaps after each icon usage <i></i>.. Please note that these links work a bit different than traditional hre="" links. See documentation for details. --> <?php use App\Libraries\SmartUI; use App\Libraries; // $arrSidebar["50"]["sub"]["2"]["active"] = true; $ui = new SmartUI(); $ui->create_nav($arrSidebar)->print_html(); ?> </nav> <span class="minifyme" data-action="minifyMenu"> <i class="fa fa-arrow-circle-left hit"></i> </span> </aside> <!-- END NAVIGATION -->