Initial Commit
The initial public commit of MVGL website code.
This commit is contained in:
commit
b39ecf1638
2043 changed files with 215154 additions and 0 deletions
47
app/Core/Adapters/BootstrapBase.php
Normal file
47
app/Core/Adapters/BootstrapBase.php
Normal file
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
namespace App\Core\Adapters;
|
||||
|
||||
abstract class BootstrapBase
|
||||
{
|
||||
public static function initBase()
|
||||
{
|
||||
theme()->addHtmlAttribute('body', 'id', 'kt_body');
|
||||
|
||||
if (theme()->isDarkModeEnabled() && theme()->getCurrentMode() === 'dark') {
|
||||
theme()->addHtmlClass('body', 'dark-mode');
|
||||
}
|
||||
|
||||
if (theme()->getOption('layout', 'main/body/background-image')) {
|
||||
theme()->addHtmlAttribute('body', 'style', 'background-image: url(' . asset(theme()->getMediaUrlPath() . theme()->getOption('layout', 'main/body/background-image')) . ')');
|
||||
}
|
||||
|
||||
if (theme()->getOption('layout', 'main/body/class')) {
|
||||
theme()->addHtmlClass('body', theme()->getOption('layout', 'main/body/class'));
|
||||
}
|
||||
|
||||
if (theme()->getOption('layout', 'main/body/attributes')) {
|
||||
theme()->addHtmlAttributes('body', theme()->getOption('layout', 'main/body/attributes'));
|
||||
}
|
||||
|
||||
if (theme()->getOption('layout', 'loader/display') === true) {
|
||||
theme()->addHtmlClass('body', 'page-loading-enabled');
|
||||
theme()->addHtmlClass('body', 'page-loading');
|
||||
}
|
||||
}
|
||||
|
||||
public static function run()
|
||||
{
|
||||
if (theme()->getOption('layout', 'base') === 'docs') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Init base
|
||||
static::initBase();
|
||||
|
||||
// Init layout
|
||||
if (theme()->getOption('layout', 'main/type') === 'default') {
|
||||
static::initLayout();
|
||||
}
|
||||
}
|
||||
}
|
61
app/Core/Adapters/Menu.php
Normal file
61
app/Core/Adapters/Menu.php
Normal file
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
|
||||
namespace App\Core\Adapters;
|
||||
|
||||
/**
|
||||
* Adapter class to make the Metronic core lib compatible with the Laravel functions
|
||||
*
|
||||
* Class Menu
|
||||
*
|
||||
* @package App\Core\Adapters
|
||||
*/
|
||||
class Menu extends \App\Core\Menu
|
||||
{
|
||||
public function build()
|
||||
{
|
||||
ob_start();
|
||||
|
||||
parent::build();
|
||||
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter menu item based on the user permission using Spatie plugin
|
||||
*
|
||||
* @param $array
|
||||
*/
|
||||
public static function filterMenuPermissions(&$array)
|
||||
{
|
||||
if (!is_array($array)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$user = auth()->user();
|
||||
|
||||
$checkPermission = $checkRole = false;
|
||||
if (auth()->check()) {
|
||||
// check if the spatie plugin functions exist
|
||||
$checkPermission = method_exists($user, 'hasAnyPermission');
|
||||
$checkRole = method_exists($user, 'hasAnyRole');
|
||||
}
|
||||
|
||||
foreach ($array as $key => &$value) {
|
||||
if (is_callable($value)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($checkPermission && isset($value['permission']) && !$user->hasAnyPermission((array) $value['permission'])) {
|
||||
unset($array[$key]);
|
||||
}
|
||||
|
||||
if ($checkRole && isset($value['role']) && !$user->hasAnyRole((array) $value['role'])) {
|
||||
unset($array[$key]);
|
||||
}
|
||||
|
||||
if (is_array($value)) {
|
||||
self::filterMenuPermissions($value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
501
app/Core/Adapters/Theme.php
Normal file
501
app/Core/Adapters/Theme.php
Normal file
|
@ -0,0 +1,501 @@
|
|||
<?php
|
||||
|
||||
namespace App\Core\Adapters;
|
||||
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* Adapter class to make the Metronic core lib compatible with the Laravel functions
|
||||
*
|
||||
* Class Theme
|
||||
*
|
||||
* @package App\Core\Adapters
|
||||
*/
|
||||
class Theme extends \App\Core\Theme
|
||||
{
|
||||
public static $page = '';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Set demo to initialize
|
||||
*
|
||||
* @param string $demo
|
||||
*/
|
||||
public static function setDemo($demo = 'demo1')
|
||||
{
|
||||
Theme::$demo = $demo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print HTML classes in the HTML class attribute
|
||||
*
|
||||
* @param $scope
|
||||
* @param bool $full
|
||||
*
|
||||
* @return false|string
|
||||
*/
|
||||
public static function printHtmlClasses($scope, $full = true)
|
||||
{
|
||||
ob_start();
|
||||
|
||||
// Call the function from core Theme
|
||||
\App\Core\Theme::printHtmlClasses($scope, $full);
|
||||
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* Print the SVG icon content as HTML
|
||||
* Use {!! getSvgIcon !!} in blade template file
|
||||
*
|
||||
* @param $path
|
||||
* @param string $class
|
||||
* @param string $svgClass
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function getSvgIcon($path, $class = '', $svgClass = '')
|
||||
{
|
||||
// Call the function from core Theme
|
||||
return get_svg_icon($path, $class, $svgClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the route or URL
|
||||
*
|
||||
* @param $path
|
||||
* @param string $demo
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getPageUrl($path, $demo = '', $mode = null)
|
||||
{
|
||||
$params = [];
|
||||
if (isset($_REQUEST['rtl']) && $_REQUEST['rtl']) {
|
||||
$params['rtl'] = 1;
|
||||
}
|
||||
if (isset($_REQUEST['demo']) && $_REQUEST['demo']) {
|
||||
$params['demo'] = $_REQUEST['demo'];
|
||||
}
|
||||
|
||||
if ($mode !== null) {
|
||||
if ($mode) {
|
||||
$params['mode'] = $mode;
|
||||
}
|
||||
} elseif (isset($_REQUEST['mode']) && $_REQUEST['mode']) {
|
||||
$params['mode'] = $_REQUEST['mode'];
|
||||
}
|
||||
|
||||
if (!empty($demo)) {
|
||||
$params['demo'] = $demo;
|
||||
}
|
||||
|
||||
$a = '';
|
||||
if (count($params) && $path !== '#') {
|
||||
$a = '?' . http_build_query($params);
|
||||
}
|
||||
|
||||
// check if the route exist in the laravel
|
||||
$name = str_replace('/', '.', $path);
|
||||
if (Route::has($name)) {
|
||||
return route($name) . $a;
|
||||
}
|
||||
|
||||
// otherwise return as url
|
||||
return url($path) . $a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print HTML attributes
|
||||
*
|
||||
* @param $scope
|
||||
*
|
||||
* @return false|string
|
||||
*/
|
||||
public static function printHtmlAttributes($scope)
|
||||
{
|
||||
ob_start();
|
||||
|
||||
// Call the function from core Theme
|
||||
\App\Core\Theme::printHtmlAttributes($scope);
|
||||
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* Print CSS variables
|
||||
*
|
||||
* @param $scope
|
||||
*
|
||||
* @return false|string
|
||||
*/
|
||||
public static function printCssVariables($scope)
|
||||
{
|
||||
ob_start();
|
||||
|
||||
// Call the function from core Theme
|
||||
\App\Core\Theme::printCssVariables($scope);
|
||||
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is wrapper function of Laravel view()
|
||||
* All view files under "layout" has a demo, this helps to append the demo name into the path
|
||||
*
|
||||
* @param $path
|
||||
* @param array $params
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
public static function getView($path, $params = array(), $once = false)
|
||||
{
|
||||
// Check if the layout file exist
|
||||
if (view()->exists($path)) {
|
||||
return view($path, $params);
|
||||
}
|
||||
|
||||
// Append demo folder for layout view
|
||||
if (Str::startsWith($path, 'layout')) {
|
||||
$path = str_replace('layout', 'layout/' . self::$demo, $path);
|
||||
}
|
||||
|
||||
$view = view($path, $params);
|
||||
|
||||
// Special fix to print _mega-menu content for Core/Theme.php
|
||||
if (strpos($path, '_mega-menu') !== false) {
|
||||
echo $view;
|
||||
}
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print fonts in the HTML head
|
||||
*
|
||||
* @param string $value
|
||||
*/
|
||||
public static function includeFonts($value = '')
|
||||
{
|
||||
if (self::hasOption('assets', 'fonts/google')) {
|
||||
$fonts = self::getOption('assets', 'fonts/google');
|
||||
|
||||
echo '<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=' . implode('|', $fonts) . '"/>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the option has a value
|
||||
*
|
||||
* @param $scope
|
||||
* @param false $path
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function hasOption($scope, $path = false)
|
||||
{
|
||||
return (bool) self::getOption($scope, $path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the option's value from config
|
||||
*
|
||||
* @param $scope
|
||||
* @param false $path
|
||||
* @param null $default
|
||||
*
|
||||
* @return mixed|string
|
||||
*/
|
||||
public static function getOption($scope, $path = false, $default = null)
|
||||
{
|
||||
$demo = self::getDemo() ?? 'demo1';
|
||||
|
||||
// Map the config path
|
||||
if (array_key_exists($scope, config($demo . '.general', []))) {
|
||||
$scope = 'general.' . $scope;
|
||||
}
|
||||
|
||||
if (in_array($scope, ['page', 'pages'])) {
|
||||
$scope = 'pages';
|
||||
$segments = request()->segments();
|
||||
$scope .= '.' . implode('.', $segments);
|
||||
}
|
||||
|
||||
// Get current page path
|
||||
$deepPath = '';
|
||||
if (!empty($path)) {
|
||||
$deepPath = '.' . str_replace('/', '.', $path);
|
||||
}
|
||||
|
||||
// Demo config
|
||||
$demoConfig = config($demo . '.' . $scope . $deepPath, $default);
|
||||
|
||||
// check if it is a callback
|
||||
if (is_callable($demoConfig) && !is_string($demoConfig)) {
|
||||
$demoConfig = $demoConfig();
|
||||
}
|
||||
|
||||
return $demoConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current demo
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getDemo()
|
||||
{
|
||||
if (class_exists('request')) {
|
||||
return request()->input('demo', self::$demo);
|
||||
}
|
||||
|
||||
return self::$demo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the product name string wrapped with the <strong> tag
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getProductNameHtml()
|
||||
{
|
||||
return '<strong>' . self::getProductName() . ' Laravel</strong> ';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get plain product name text
|
||||
*
|
||||
* @return mixed|string
|
||||
*/
|
||||
public static function getProductName()
|
||||
{
|
||||
return self::getOption('product', 'name');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the version number string from config file
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function getVersion()
|
||||
{
|
||||
$versions = array_keys(config('changelog', []));
|
||||
if (isset($versions[0])) {
|
||||
return str_replace('v', '', $versions[0]);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current page title from config page.php
|
||||
*/
|
||||
public static function getPageTitle()
|
||||
{
|
||||
return theme()->getOption('page', 'title');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current route name and replace with a new route name
|
||||
*
|
||||
* @param $name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function subRoute($name)
|
||||
{
|
||||
$routes = explode('.', Route::currentRouteName());
|
||||
array_pop($routes);
|
||||
|
||||
$parent = implode('.', $routes);
|
||||
|
||||
return $parent . '.' . $name;
|
||||
}
|
||||
|
||||
public static function putProVersionTooltip($attr = array())
|
||||
{
|
||||
ob_start();
|
||||
|
||||
// Call the function from core Theme
|
||||
parent::putProVersionTooltip($attr);
|
||||
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
public static function getIllustrationUrl($file, $dark = true)
|
||||
{
|
||||
if ($dark === true) {
|
||||
if (self::isDarkMode()) {
|
||||
$file = str_replace(".svg", "-dark.svg", $file);
|
||||
$file = str_replace(".png", "-dark.png", $file);
|
||||
$file = str_replace(".jpg", "-dark.jpg", $file);
|
||||
}
|
||||
}
|
||||
|
||||
$folder = 'illustrations/' . self::getOption('layout', 'illustrations/set');
|
||||
|
||||
return self::getMediaUrlPath() . $folder . '/' . $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check dark mode
|
||||
*
|
||||
* @return mixed|string
|
||||
*/
|
||||
public static function isDarkMode()
|
||||
{
|
||||
return self::getCurrentMode() === 'dark';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current skin
|
||||
*
|
||||
* @return mixed|string
|
||||
*/
|
||||
public static function getCurrentMode()
|
||||
{
|
||||
if (self::isDarkModeEnabled() && isset($_REQUEST['mode']) && $_REQUEST['mode']) {
|
||||
return $_REQUEST['mode'];
|
||||
}
|
||||
|
||||
return 'light';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if current theme has dark mode
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isDarkModeEnabled()
|
||||
{
|
||||
return (bool) self::getOption('layout', 'main/dark-mode-enabled');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get media path
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMediaUrlPath()
|
||||
{
|
||||
return theme()->getDemo() . '/media/';
|
||||
}
|
||||
|
||||
public static function getImageUrl($folder, $file, $dark = true)
|
||||
{
|
||||
if ($dark) {
|
||||
if (self::isDarkMode()) {
|
||||
$file = str_replace(".svg", "-dark.svg", $file);
|
||||
$file = str_replace(".png", "-dark.png", $file);
|
||||
$file = str_replace(".jpg", "-dark.jpg", $file);
|
||||
}
|
||||
}
|
||||
|
||||
return self::getMediaUrlPath() . $folder . '/' . $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild config and merge with main and page config level in boot
|
||||
*/
|
||||
public function initConfig()
|
||||
{
|
||||
$mainConfig = collect(config('global'));
|
||||
$demoConfig = config(Theme::$demo);
|
||||
$mergedConfig = $mainConfig->replaceRecursive($demoConfig);
|
||||
config([Theme::$demo => $mergedConfig->all()]);
|
||||
|
||||
self::$config = $mergedConfig->all();
|
||||
|
||||
// Get config by url path
|
||||
$configPath = Theme::$demo . '.pages.' . str_replace('/', '.', Theme::getPagePath());
|
||||
$pageConfig = collect(config($configPath));
|
||||
|
||||
// Merge group config with child config
|
||||
$pageGroupOptions = Theme::getPageGroupOptions(config(Theme::$demo . '.pages'), Theme::getPagePath());
|
||||
if ($pageGroupOptions) {
|
||||
$overridenConfig = $pageConfig->replaceRecursive($pageGroupOptions);
|
||||
config([$configPath => $overridenConfig->all()]);
|
||||
}
|
||||
|
||||
$generalConfig = collect(config(Theme::$demo . '.general'));
|
||||
// Merge general config with page level config
|
||||
config([Theme::$demo . '.general' => $generalConfig->replaceRecursive(config($configPath))->all()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current page path
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function getPagePath()
|
||||
{
|
||||
// Override page path
|
||||
$segments = request()->segments();
|
||||
if (!empty($segments)) {
|
||||
\App\Core\Theme::$page = implode('/', $segments);
|
||||
}
|
||||
|
||||
return \App\Core\Theme::getPagePath();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get menu array from config
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getMenu()
|
||||
{
|
||||
$menus = self::getOption('menu');
|
||||
|
||||
$output = [];
|
||||
|
||||
foreach ($menus as $menu) {
|
||||
if (is_array($menu)) {
|
||||
$this->iterateMenu($menu, $output);
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterate menu array for self::getMenu() function
|
||||
*
|
||||
* @param $menus
|
||||
* @param $output
|
||||
*/
|
||||
private function iterateMenu($menus, &$output)
|
||||
{
|
||||
if (!is_array($menus)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isset($menus['path'])) {
|
||||
$output[] = $menus;
|
||||
}
|
||||
|
||||
if (is_array($menus)) {
|
||||
foreach ($menus as $menu) {
|
||||
$this->iterateMenu($menu, $output);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function getDemosTotal()
|
||||
{
|
||||
$total = 0;
|
||||
|
||||
foreach (self::getOption('product', 'demos') as $id => $demo) {
|
||||
if ($demo['published'] === true) {
|
||||
$total++;
|
||||
}
|
||||
}
|
||||
|
||||
return $total;
|
||||
}
|
||||
}
|
70
app/Core/Adapters/Util.php
Normal file
70
app/Core/Adapters/Util.php
Normal file
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
|
||||
namespace App\Core\Adapters;
|
||||
|
||||
/**
|
||||
* Adapter class to make the Metronic core lib compatible with the Laravel functions
|
||||
*
|
||||
* Class Util
|
||||
*
|
||||
* @package App\Core\Adapters
|
||||
*/
|
||||
class Util extends \App\Core\Util
|
||||
{
|
||||
/**
|
||||
* Print the value if the condition met
|
||||
*
|
||||
* @param $cond
|
||||
* @param $value
|
||||
* @param string $alt
|
||||
*
|
||||
* @return false|string
|
||||
*/
|
||||
public static function putIf($cond, $value, $alt = '')
|
||||
{
|
||||
ob_start();
|
||||
|
||||
// Call the function from core Util
|
||||
echo self::getIf($cond, $value, $alt);
|
||||
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* Print the notice
|
||||
*
|
||||
* @param $text
|
||||
* @param string $state
|
||||
* @param string $icon
|
||||
*/
|
||||
public static function notice($text, $state = 'danger', $icon = 'icons/duotone/Tools/Compass.svg')
|
||||
{
|
||||
$html = '';
|
||||
|
||||
$html .= '<!--begin::Notice-->';
|
||||
$html .= '<div class="d-flex align-items-center rounded py-4 px-4 bg-light-' . $state . ' ">';
|
||||
if ($icon) {
|
||||
$html .= ' <!--begin::Icon-->';
|
||||
$html .= ' <div class="d-flex h-80px w-80px flex-shrink-0 flex-center position-relative ms-5 me-8">';
|
||||
$html .= ' ' . Theme::getSvgIcon("icons/duotone/Layout/Layout-polygon.svg", "svg-icon-' . $state . ' position-absolute opacity-10", "w-80px h-80px");
|
||||
$html .= ' ' . Theme::getSvgIcon($icon, 'svg-icon-3x svg-icon-' . $state . ' position-absolute');
|
||||
$html .= ' </div>';
|
||||
$html .= ' <!--end::Icon-->';
|
||||
}
|
||||
|
||||
$html .= ' <!--begin::Description-->';
|
||||
$html .= ' <div class="text-gray-600 fw-bold fs-6 lh-lg">';
|
||||
$html .= $text;
|
||||
$html .= ' </div>';
|
||||
$html .= ' <!--end::Description-->';
|
||||
$html .= '</div>';
|
||||
$html .= '<!--end::Notice-->';
|
||||
|
||||
echo $html;
|
||||
}
|
||||
|
||||
public static function putHtmlAttributes($attributes)
|
||||
{
|
||||
return self::getHtmlAttributes($attributes);
|
||||
}
|
||||
}
|
200
app/Core/Bootstraps/BootstrapDemo1.php
Normal file
200
app/Core/Bootstraps/BootstrapDemo1.php
Normal file
|
@ -0,0 +1,200 @@
|
|||
<?php
|
||||
|
||||
namespace App\Core\Bootstraps;
|
||||
|
||||
use App\Core\Adapters\BootstrapBase;
|
||||
use App\Core\Adapters\Menu;
|
||||
use App\Core\Adapters\Theme;
|
||||
|
||||
class BootstrapDemo1 extends BootstrapBase
|
||||
{
|
||||
// Private Properties
|
||||
private static $asideMenu;
|
||||
|
||||
private static $horizontalMenu;
|
||||
|
||||
// Private Methods
|
||||
private static function initHeader()
|
||||
{
|
||||
if (Theme::getOption('layout', 'header/width') == 'fluid') {
|
||||
Theme::addHtmlClass('header-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('header-container', 'container');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'header/fixed/desktop') === true) {
|
||||
Theme::addHtmlClass('body', 'header-fixed');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'header/fixed/tablet-and-mobile') === true) {
|
||||
Theme::addHtmlClass('body', 'header-tablet-and-mobile-fixed');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initToolbar()
|
||||
{
|
||||
if (Theme::getOption('layout', 'toolbar/display') === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
Theme::addHtmlClass('body', 'toolbar-enabled');
|
||||
|
||||
if (Theme::getOption('layout', 'toolbar/width') == 'fluid') {
|
||||
Theme::addHtmlClass('toolbar-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('toolbar-container', 'container');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'toolbar/fixed/desktop') === true) {
|
||||
Theme::addHtmlClass('body', 'toolbar-fixed');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'toolbar/fixed/tablet-and-mobile') === true) {
|
||||
Theme::addHtmlClass('body', 'toolbar-tablet-and-mobile-fixed');
|
||||
}
|
||||
|
||||
// Height setup
|
||||
$type = Theme::getOption('layout', 'toolbar/layout');
|
||||
$typeOptions = Theme::getOption('layout', 'toolbar/layouts/' . $type);
|
||||
|
||||
if ($typeOptions) {
|
||||
if (isset($typeOptions['height'])) {
|
||||
Theme::addCssVariable('body', '--kt-toolbar-height', $typeOptions['height']);
|
||||
}
|
||||
|
||||
if (isset($typeOptions['height-tablet-and-mobile'])) {
|
||||
Theme::addCssVariable('body', '--kt-toolbar-height-tablet-and-mobile', $typeOptions['height-tablet-and-mobile']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function initPageTitle()
|
||||
{
|
||||
if (Theme::getOption('layout', 'page-title/display') === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'page-title/direction') == 'column') {
|
||||
Theme::addHtmlClass('page-title', 'flex-column align-items-start me-3');
|
||||
} else {
|
||||
Theme::addHtmlClass('page-title', 'align-items-center flex-wrap me-3');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'header/left') === 'page-title') {
|
||||
Theme::setOption('layout', 'page-title/responsive-target', '#kt_header_nav');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'page-title/responsive') === true) {
|
||||
Theme::addHtmlClass('page-title', 'mb-5 mb-lg-0');
|
||||
|
||||
$attr = array();
|
||||
$attr['data-kt-swapper'] = 'true';
|
||||
$attr['data-kt-swapper-mode'] = 'prepend';
|
||||
$attr['data-kt-swapper-parent'] = "{default: '#kt_content_container', '" . Theme::getOption('layout', 'page-title/responsive-breakpoint') . "': '" . Theme::getOption('layout', 'page-title/responsive-target') . "'}";
|
||||
|
||||
Theme::addHtmlAttributes('page-title', $attr);
|
||||
}
|
||||
}
|
||||
|
||||
private static function initContent()
|
||||
{
|
||||
if (Theme::getOption('layout', 'content/width') == 'fluid') {
|
||||
Theme::addHtmlClass('content-container', 'container-fluid');
|
||||
} elseif (Theme::getOption('layout', 'content/width') == 'fixed') {
|
||||
Theme::addHtmlClass('content-container', 'container-xxl');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'content/class')) {
|
||||
Theme::addHtmlClass('content', Theme::getOption('layout', 'content/class'));
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'content/container-class')) {
|
||||
Theme::addHtmlClass('content-container', Theme::getOption('layout', 'content/container-class'));
|
||||
}
|
||||
}
|
||||
|
||||
private static function initAside()
|
||||
{
|
||||
// Check if aside is displayed
|
||||
if (Theme::getOption('layout', 'aside/display') != true) {
|
||||
return;
|
||||
}
|
||||
|
||||
Theme::addHtmlClass('body', 'aside-enabled');
|
||||
Theme::addHtmlClass('aside', 'aside-' . Theme::getOption('layout', 'aside/theme'));
|
||||
|
||||
// Fixed aside
|
||||
if (Theme::getOption('layout', 'aside/fixed')) {
|
||||
Theme::addHtmlClass('body', 'aside-fixed');
|
||||
}
|
||||
|
||||
// Default minimized
|
||||
if (Theme::getOption('layout', 'aside/minimized')) {
|
||||
Theme::addHtmlAttribute('body', 'data-kt-aside-minimize', 'on');
|
||||
}
|
||||
|
||||
// Hoverable on minimize
|
||||
if (Theme::getOption('layout', 'aside/hoverable')) {
|
||||
Theme::addHtmlClass('aside', 'aside-hoverable');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initAsideMenu()
|
||||
{
|
||||
self::$asideMenu = new Menu(Theme::getOption('menu', 'main'), Theme::getPagePath());
|
||||
|
||||
if (Theme::getOption('layout', 'aside/menu-icons-display') === false) {
|
||||
self::$asideMenu->displayIcons(false);
|
||||
}
|
||||
|
||||
self::$asideMenu->setIconType(Theme::getOption('layout', 'aside/menu-icon'));
|
||||
}
|
||||
|
||||
private static function initHorizontalMenu()
|
||||
{
|
||||
self::$horizontalMenu = new Menu(Theme::getOption('menu', 'horizontal'), Theme::getPagePath());
|
||||
self::$horizontalMenu->setItemLinkClass('py-3');
|
||||
self::$horizontalMenu->setIconType(Theme::getOption('layout', 'header/menu-icon', 'svg'));
|
||||
}
|
||||
|
||||
private static function initFooter()
|
||||
{
|
||||
if (Theme::getOption('layout', 'footer/width') == 'fluid') {
|
||||
Theme::addHtmlClass('footer-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('footer-container', 'container-xxl');
|
||||
}
|
||||
}
|
||||
|
||||
// Public Methods
|
||||
public static function initLayout()
|
||||
{
|
||||
self::initHeader();
|
||||
self::initPageTitle();
|
||||
self::initToolbar();
|
||||
self::initContent();
|
||||
self::initAside();
|
||||
self::initFooter();
|
||||
self::initAsideMenu();
|
||||
self::initHorizontalMenu();
|
||||
}
|
||||
|
||||
public static function getAsideMenu()
|
||||
{
|
||||
return self::$asideMenu;
|
||||
}
|
||||
|
||||
public static function getHorizontalMenu()
|
||||
{
|
||||
return self::$horizontalMenu;
|
||||
}
|
||||
|
||||
public static function getBreadcrumb()
|
||||
{
|
||||
$options = array(
|
||||
'skip-active' => false
|
||||
);
|
||||
|
||||
return self::getAsideMenu()->getBreadcrumb($options);
|
||||
}
|
||||
}
|
160
app/Core/Bootstraps/BootstrapDemo2.php
Normal file
160
app/Core/Bootstraps/BootstrapDemo2.php
Normal file
|
@ -0,0 +1,160 @@
|
|||
<?php
|
||||
|
||||
namespace App\Core\Bootstraps;
|
||||
|
||||
use App\Core\Adapters\BootstrapBase;
|
||||
use App\Core\Adapters\Menu;
|
||||
use App\Core\Adapters\Theme;
|
||||
|
||||
class BootstrapDemo2 extends BootstrapBase
|
||||
{
|
||||
// Private Properties
|
||||
private static $asideMenu;
|
||||
|
||||
private static $horizontalMenu;
|
||||
|
||||
// Private Methods
|
||||
private static function initPage()
|
||||
{
|
||||
Theme::addHtmlAttribute('body', 'style', 'background-image: url(' . asset(Theme::getMediaUrlPath() . 'patterns/' . (Theme::isDarkMode() ? 'header-bg-dark.png' : 'header-bg.jpg')) . ')');
|
||||
}
|
||||
|
||||
private static function initHeader()
|
||||
{
|
||||
if (Theme::getOption('layout', 'header/width') == 'fluid') {
|
||||
Theme::addHtmlClass('header-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('header-container', 'container');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'header/fixed/desktop') === true) {
|
||||
Theme::addHtmlClass('body', 'header-fixed');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'header/fixed/tablet-and-mobile') === true) {
|
||||
Theme::addHtmlClass('body', 'header-tablet-and-mobile-fixed');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initToolbar()
|
||||
{
|
||||
if (Theme::getOption('layout', 'toolbar/display') === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
Theme::addHtmlClass('body', 'toolbar-enabled');
|
||||
|
||||
if (Theme::getOption('layout', 'toolbar/width') == 'fluid') {
|
||||
Theme::addHtmlClass('toolbar-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('toolbar-container', 'container');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initPageTitle()
|
||||
{
|
||||
if (Theme::getOption('layout', 'page-title/display') === false) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private static function initContent()
|
||||
{
|
||||
if (Theme::getOption('layout', 'content/width') == 'fluid') {
|
||||
Theme::addHtmlClass('content-container', 'container-fluid');
|
||||
} elseif (Theme::getOption('layout', 'content/width') == 'fixed') {
|
||||
Theme::addHtmlClass('content-container', 'container');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'content/class')) {
|
||||
Theme::addHtmlClass('content', Theme::getOption('layout', 'content/class'));
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'content/container-class')) {
|
||||
Theme::addHtmlClass('content-container', Theme::getOption('layout', 'content/container-class'));
|
||||
}
|
||||
}
|
||||
|
||||
private static function initAside()
|
||||
{
|
||||
// Check if aside is displayed
|
||||
if (Theme::getOption('layout', 'aside/display') != true) {
|
||||
return;
|
||||
}
|
||||
|
||||
Theme::addHtmlClass('body', 'aside-enabled');
|
||||
}
|
||||
|
||||
private static function initAsideMenu()
|
||||
{
|
||||
self::$asideMenu = new Menu(Theme::getOption('menu', 'main'), Theme::getPagePath());
|
||||
|
||||
if (Theme::getOption('layout', 'aside/menu-icons-display') === false) {
|
||||
self::$asideMenu->displayIcons(false);
|
||||
}
|
||||
|
||||
self::$asideMenu->setIconType(Theme::getOption('layout', 'aside/menu-icon'));
|
||||
}
|
||||
|
||||
private static function initHorizontalMenu()
|
||||
{
|
||||
self::$horizontalMenu = new Menu(Theme::getOption('menu', 'horizontal'), Theme::getPagePath());
|
||||
self::$horizontalMenu->setItemLinkClass('py-3');
|
||||
self::$horizontalMenu->setIconType(Theme::getOption('layout', 'header/menu-icon'));
|
||||
}
|
||||
|
||||
private static function initFooter()
|
||||
{
|
||||
if (Theme::getOption('layout', 'footer/width') == 'fluid') {
|
||||
Theme::addHtmlClass('footer-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('footer-container', 'container');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initScripts()
|
||||
{
|
||||
Theme::addPageJs('js/custom/widgets.js');
|
||||
Theme::addPageJs('js/custom/apps/chat/chat.js');
|
||||
Theme::addPageJs('js/custom/modals/create-app.js');
|
||||
Theme::addPageJs('js/custom/modals/upgrade-plan.js');
|
||||
|
||||
if (Theme::getViewMode() !== 'release') {
|
||||
Theme::addPageJs('js/custom/intro.js');
|
||||
}
|
||||
}
|
||||
|
||||
// Public Methods
|
||||
public static function getAsideMenu()
|
||||
{
|
||||
return self::$asideMenu;
|
||||
}
|
||||
|
||||
public static function getHorizontalMenu()
|
||||
{
|
||||
return self::$horizontalMenu;
|
||||
}
|
||||
|
||||
public static function getBreadcrumb()
|
||||
{
|
||||
$options = array(
|
||||
'skip-active' => false
|
||||
);
|
||||
|
||||
return self::getHorizontalMenu()->getBreadcrumb($options);
|
||||
}
|
||||
|
||||
public static function initLayout()
|
||||
{
|
||||
self::initPage();
|
||||
self::initHeader();
|
||||
self::initPageTitle();
|
||||
self::initToolbar();
|
||||
self::initContent();
|
||||
self::initAside();
|
||||
self::initFooter();
|
||||
self::initAsideMenu();
|
||||
self::initHorizontalMenu();
|
||||
self::initScripts();
|
||||
}
|
||||
}
|
116
app/Core/Bootstraps/BootstrapDemo3.php
Normal file
116
app/Core/Bootstraps/BootstrapDemo3.php
Normal file
|
@ -0,0 +1,116 @@
|
|||
<?php
|
||||
|
||||
namespace App\Core\Bootstraps;
|
||||
|
||||
use App\Core\Adapters\BootstrapBase;
|
||||
use App\Core\Adapters\Menu;
|
||||
use App\Core\Adapters\Theme;
|
||||
|
||||
class BootstrapDemo3 extends BootstrapBase
|
||||
{
|
||||
// Private Properties
|
||||
private static $menu;
|
||||
|
||||
// Private Methods
|
||||
private static function initHeader()
|
||||
{
|
||||
if (Theme::getOption('layout', 'header/width') == 'fluid') {
|
||||
Theme::addHtmlClass('header-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('header-container', 'container');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'header/fixed/desktop') === true) {
|
||||
Theme::addHtmlClass('body', 'header-fixed');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'header/fixed/tablet-and-mobile') === true) {
|
||||
Theme::addHtmlClass('body', 'header-tablet-and-mobile-fixed');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initContent()
|
||||
{
|
||||
if (Theme::getOption('layout', 'content/width') == 'fluid') {
|
||||
Theme::addHtmlClass('content-container', 'container-fluid');
|
||||
} elseif (Theme::getOption('layout', 'content/width') == 'fixed') {
|
||||
Theme::addHtmlClass('content-container', 'container');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'content/class')) {
|
||||
Theme::addHtmlClass('content', Theme::getOption('layout', 'content/class'));
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'content/container-class')) {
|
||||
Theme::addHtmlClass('content-container', Theme::getOption('layout', 'content/container-class'));
|
||||
}
|
||||
}
|
||||
|
||||
private static function initAside()
|
||||
{
|
||||
// Aside enabled
|
||||
if (Theme::getOption('layout', 'aside/display')) {
|
||||
Theme::addHtmlClass('body', 'aside-enabled');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initSidebar()
|
||||
{
|
||||
// Sidebar enabled
|
||||
if (Theme::getOption('layout', 'sidebar/display')) {
|
||||
Theme::addHtmlClass('body', 'sidebar-enabled');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initMenu()
|
||||
{
|
||||
self::$menu = new Menu(Theme::getOption('menu', 'main'), Theme::getPagePath());
|
||||
}
|
||||
|
||||
private static function initFooter()
|
||||
{
|
||||
if (Theme::getOption('layout', 'footer/width') == 'fluid') {
|
||||
Theme::addHtmlClass('footer-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('footer-container', 'container');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initScripts()
|
||||
{
|
||||
Theme::addPageJs('js/custom/widgets.js');
|
||||
Theme::addPageJs('js/custom/apps/chat/chat.js');
|
||||
Theme::addPageJs('js/custom/modals/create-app.js');
|
||||
Theme::addPageJs('js/custom/modals/upgrade-plan.js');
|
||||
|
||||
if (Theme::getViewMode() !== 'release') {
|
||||
Theme::addPageJs('js/custom/intro.js');
|
||||
}
|
||||
}
|
||||
|
||||
// Public Methods
|
||||
public static function getMenu()
|
||||
{
|
||||
return self::$menu;
|
||||
}
|
||||
|
||||
public static function getBreadcrumb()
|
||||
{
|
||||
$options = array(
|
||||
'skip-active' => false
|
||||
);
|
||||
|
||||
return self::getMenu()->getBreadcrumb($options);
|
||||
}
|
||||
|
||||
public static function initLayout()
|
||||
{
|
||||
self::initHeader();
|
||||
self::initContent();
|
||||
self::initAside();
|
||||
self::initSidebar();
|
||||
self::initFooter();
|
||||
self::initMenu();
|
||||
self::initScripts();
|
||||
}
|
||||
}
|
127
app/Core/Bootstraps/BootstrapDemo4.php
Normal file
127
app/Core/Bootstraps/BootstrapDemo4.php
Normal file
|
@ -0,0 +1,127 @@
|
|||
<?php
|
||||
|
||||
namespace App\Core\Bootstraps;
|
||||
|
||||
use App\Core\Adapters\BootstrapBase;
|
||||
use App\Core\Adapters\Menu;
|
||||
use App\Core\Adapters\Theme;
|
||||
|
||||
class BootstrapDemo4 extends BootstrapBase
|
||||
{
|
||||
// Private Properties
|
||||
private static $asideMenu;
|
||||
private static $horizontalMenu;
|
||||
|
||||
// Private Methods
|
||||
private static function initHeader()
|
||||
{
|
||||
if (Theme::getOption('layout', 'header/width') == 'fluid') {
|
||||
Theme::addHtmlClass('header-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('header-container', 'container-xxl');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'header/fixed/desktop') === true) {
|
||||
Theme::addHtmlClass('body', 'header-fixed');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'header/fixed/tablet-and-mobile') === true) {
|
||||
Theme::addHtmlClass('body', 'header-tablet-and-mobile-fixed');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initContent()
|
||||
{
|
||||
if (Theme::getOption('layout', 'content/width') == 'fluid') {
|
||||
Theme::addHtmlClass('content-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('content-container', 'container');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initAside()
|
||||
{
|
||||
// Fixed aside
|
||||
if (Theme::getOption('layout', 'aside/fixed')) {
|
||||
Theme::addHtmlClass('body', 'aside-fixed');
|
||||
}
|
||||
|
||||
// Default minimized
|
||||
if (Theme::getOption('layout', 'aside/minimized')) {
|
||||
Theme::addHtmlAttribute('body', 'data-kt-aside-minimize', 'on');
|
||||
Theme::addHtmlClass('asideToggle', 'active');
|
||||
}
|
||||
|
||||
// Aside Secondary
|
||||
if (Theme::getOption('layout', 'aside/secondary-display') === true) {
|
||||
Theme::addHtmlClass('body', 'aside-secondary-enabled');
|
||||
} else {
|
||||
Theme::addHtmlClass('body', 'aside-secondary-disabled');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initAsideMenu()
|
||||
{
|
||||
self::$asideMenu = new Menu(Theme::getOption('menu', 'compact'), Theme::getPagePath());
|
||||
self::$asideMenu->setIconType(Theme::getOption('layout', 'aside/menu-icon', 'svg'));
|
||||
}
|
||||
|
||||
private static function initHorizontalMenu()
|
||||
{
|
||||
self::$horizontalMenu = new Menu(Theme::getOption('menu', 'horizontal'), Theme::getPagePath());
|
||||
self::$horizontalMenu->setItemLinkClass('py-3');
|
||||
self::$horizontalMenu->setIconType(Theme::getOption('layout', 'header/menu-icon', 'svg'));
|
||||
}
|
||||
|
||||
private static function initFooter()
|
||||
{
|
||||
if (Theme::getOption('layout', 'footer/width') == 'fluid') {
|
||||
Theme::addHtmlClass('footer-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('footer-container', 'container-xxl');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initScripts()
|
||||
{
|
||||
Theme::addPageJs('js/custom/widgets.js');
|
||||
Theme::addPageJs('js/custom/apps/chat/chat.js');
|
||||
Theme::addPageJs('js/custom/modals/create-app.js');
|
||||
Theme::addPageJs('js/custom/modals/upgrade-plan.js');
|
||||
|
||||
if (Theme::getViewMode() !== 'release') {
|
||||
Theme::addPageJs('js/custom/intro.js');
|
||||
}
|
||||
}
|
||||
|
||||
// Public Methods
|
||||
public static function getAsideMenu()
|
||||
{
|
||||
return self::$asideMenu;
|
||||
}
|
||||
|
||||
public static function getHorizontalMenu()
|
||||
{
|
||||
return self::$horizontalMenu;
|
||||
}
|
||||
|
||||
public static function getBreadcrumb()
|
||||
{
|
||||
$options = array(
|
||||
'skip-active' => false
|
||||
);
|
||||
|
||||
return self::getHorizontalMenu()->getBreadcrumb($options);
|
||||
}
|
||||
|
||||
public static function initLayout()
|
||||
{
|
||||
self::initHeader();
|
||||
self::initContent();
|
||||
self::initAside();
|
||||
self::initFooter();
|
||||
self::initAsideMenu();
|
||||
self::initHorizontalMenu();
|
||||
self::initScripts();
|
||||
}
|
||||
}
|
99
app/Core/Bootstraps/BootstrapDemo5.php
Normal file
99
app/Core/Bootstraps/BootstrapDemo5.php
Normal file
|
@ -0,0 +1,99 @@
|
|||
<?php
|
||||
|
||||
namespace App\Core\Bootstraps;
|
||||
|
||||
use App\Core\Adapters\BootstrapBase;
|
||||
use App\Core\Adapters\Menu;
|
||||
use App\Core\Adapters\Theme;
|
||||
|
||||
class BootstrapDemo5 extends BootstrapBase
|
||||
{
|
||||
// Private Properties
|
||||
private static $horizontalMenu;
|
||||
|
||||
// Private Methods
|
||||
private static function initHeader()
|
||||
{
|
||||
if (Theme::getOption('layout', 'header/width') == 'fluid') {
|
||||
Theme::addHtmlClass('header-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('header-container', 'container-xxl');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'header/fixed/desktop') === true) {
|
||||
Theme::addHtmlClass('body', 'header-fixed');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'header/fixed/tablet-and-mobile') === true) {
|
||||
Theme::addHtmlClass('body', 'header-tablet-and-mobile-fixed');
|
||||
}
|
||||
}
|
||||
|
||||
// Private Methods
|
||||
private static function initContent()
|
||||
{
|
||||
if (Theme::getOption('layout', 'content/width') == 'fluid') {
|
||||
Theme::addHtmlClass('content-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('content-container', 'container-xxl');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initAside()
|
||||
{
|
||||
if (Theme::getOption('layout', 'aside/display') === true) {
|
||||
Theme::addHtmlClass('body', 'aside-enabled');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initSidebar()
|
||||
{
|
||||
if (Theme::getOption('layout', 'sidebar/display') === true) {
|
||||
Theme::addHtmlClass('body', 'sidebar-enabled');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initHorizontalMenu()
|
||||
{
|
||||
self::$horizontalMenu = new Menu(Theme::getOption('menu', 'horizontal'), Theme::getPagePath());
|
||||
self::$horizontalMenu->setItemLinkClass('py-3');
|
||||
self::$horizontalMenu->setIconType(Theme::getOption('layout', 'header/menu-icon', 'svg'));
|
||||
}
|
||||
|
||||
private static function initScripts()
|
||||
{
|
||||
Theme::addPageJs('js/custom/widgets.js');
|
||||
Theme::addPageJs('js/custom/apps/chat/chat.js');
|
||||
Theme::addPageJs('js/custom/modals/create-app.js');
|
||||
Theme::addPageJs('js/custom/modals/upgrade-plan.js');
|
||||
|
||||
if (Theme::getViewMode() !== 'release') {
|
||||
Theme::addPageJs('js/custom/intro.js');
|
||||
}
|
||||
}
|
||||
|
||||
// Public Methods
|
||||
public static function initLayout()
|
||||
{
|
||||
self::initHeader();
|
||||
self::initContent();
|
||||
self::initAside();
|
||||
self::initSidebar();
|
||||
self::initHorizontalMenu();
|
||||
self::initScripts();
|
||||
}
|
||||
|
||||
public static function getHorizontalMenu()
|
||||
{
|
||||
return self::$horizontalMenu;
|
||||
}
|
||||
|
||||
public static function getBreadcrumb()
|
||||
{
|
||||
$options = array(
|
||||
'skip-active' => false
|
||||
);
|
||||
|
||||
return self::getHorizontalMenu()->getBreadcrumb($options);
|
||||
}
|
||||
}
|
177
app/Core/Bootstraps/BootstrapDemo6.php
Normal file
177
app/Core/Bootstraps/BootstrapDemo6.php
Normal file
|
@ -0,0 +1,177 @@
|
|||
<?php
|
||||
|
||||
namespace App\Core\Bootstraps;
|
||||
|
||||
use App\Core\Adapters\BootstrapBase;
|
||||
use App\Core\Adapters\Menu;
|
||||
use App\Core\Adapters\Theme;
|
||||
|
||||
class BootstrapDemo6 extends BootstrapBase
|
||||
{
|
||||
// Private Properties
|
||||
private static $asideMenu;
|
||||
|
||||
private static $horizontalMenu;
|
||||
|
||||
// Private Methods
|
||||
private static function initPage()
|
||||
{
|
||||
if (Theme::getOption('layout', 'main/body/background-image')) {
|
||||
Theme::addHtmlAttribute('body', 'style', 'background-image: url(' . Theme::getOption('layout', 'main/body/background-image') . ')');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initHeader()
|
||||
{
|
||||
if (Theme::getOption('layout', 'header/width') == 'fluid') {
|
||||
Theme::addHtmlClass('header-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('header-container', 'container-xxl');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'header/fixed/desktop') === true) {
|
||||
Theme::addHtmlClass('body', 'header-fixed');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'header/fixed/tablet-and-mobile') === true) {
|
||||
Theme::addHtmlClass('body', 'header-tablet-and-mobile-fixed');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initToolbar()
|
||||
{
|
||||
if (Theme::getOption('layout', 'toolbar/display') === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
Theme::addHtmlClass('body', 'toolbar-enabled');
|
||||
|
||||
if (Theme::getOption('layout', 'toolbar/width') == 'fluid') {
|
||||
Theme::addHtmlClass('toolbar-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('toolbar-container', 'container-xxl');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'toolbar/fixed/desktop') === true) {
|
||||
Theme::addHtmlClass('body', 'toolbar-fixed');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'toolbar/fixed/tablet-and-mobile') === true) {
|
||||
Theme::addHtmlClass('body', 'toolbar-tablet-and-mobile-fixed');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initPageTitle()
|
||||
{
|
||||
if (Theme::getOption('layout', 'page-title/display') === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'header/left') === 'page-title') {
|
||||
Theme::setOption('layout', 'page-title/responsive-target', '#kt_header_nav');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'page-title/responsive') === true) {
|
||||
Theme::addHtmlClass('page-title', 'mb-5 mb-lg-0');
|
||||
|
||||
$attr = array();
|
||||
$attr['data-kt-swapper'] = 'true';
|
||||
$attr['data-kt-swapper-mode'] = 'prepend';
|
||||
$attr['data-kt-swapper-parent'] = "{default: '#kt_content_container', '" . Theme::getOption('layout', 'page-title/responsive-breakpoint') . "': '" . Theme::getOption('layout', 'page-title/responsive-target') . "'}";
|
||||
|
||||
Theme::addHtmlAttributes('page-title', $attr);
|
||||
}
|
||||
}
|
||||
|
||||
private static function initContent()
|
||||
{
|
||||
if (Theme::getOption('layout', 'content/width') == 'fluid') {
|
||||
Theme::addHtmlClass('content-container', 'container-fluid');
|
||||
} elseif (Theme::getOption('layout', 'content/width') == 'fixed') {
|
||||
Theme::addHtmlClass('content-container', 'container-xxl');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initAside()
|
||||
{
|
||||
// Check if aside is displayed
|
||||
if (Theme::getOption('layout', 'aside/display') != true) {
|
||||
return;
|
||||
}
|
||||
|
||||
Theme::addHtmlClass('body', 'aside-enabled');
|
||||
|
||||
// Fixed aside
|
||||
if (Theme::getOption('layout', 'aside/fixed')) {
|
||||
Theme::addHtmlClass('body', 'aside-fixed');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initAsideMenu()
|
||||
{
|
||||
self::$asideMenu = new Menu(Theme::getOption('menu', 'demo6-aside'), Theme::getPagePath());
|
||||
self::$asideMenu->setIconType(Theme::getOption('layout', 'aside/menu-icon'));
|
||||
}
|
||||
|
||||
private static function initHorizontalMenu()
|
||||
{
|
||||
self::$horizontalMenu = new Menu(Theme::getOption('menu', 'horizontal'), Theme::getPagePath());
|
||||
self::$horizontalMenu->setItemLinkClass('py-3');
|
||||
self::$horizontalMenu->setIconType(Theme::getOption('layout', 'header/menu-icon', 'svg'));
|
||||
}
|
||||
|
||||
private static function initFooter()
|
||||
{
|
||||
if (Theme::getOption('layout', 'footer/width') == 'fluid') {
|
||||
Theme::addHtmlClass('footer-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('footer-container', 'container-xxl');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initScripts()
|
||||
{
|
||||
Theme::addPageJs('js/custom/widgets.js');
|
||||
Theme::addPageJs('js/custom/apps/chat/chat.js');
|
||||
Theme::addPageJs('js/custom/modals/create-app.js');
|
||||
Theme::addPageJs('js/custom/modals/upgrade-plan.js');
|
||||
|
||||
if (Theme::getViewMode() !== 'release') {
|
||||
Theme::addPageJs('js/custom/intro.js');
|
||||
}
|
||||
}
|
||||
|
||||
// Public Methods
|
||||
public static function getAsideMenu()
|
||||
{
|
||||
return self::$asideMenu;
|
||||
}
|
||||
|
||||
public static function getHorizontalMenu()
|
||||
{
|
||||
return self::$horizontalMenu;
|
||||
}
|
||||
|
||||
public static function getBreadcrumb()
|
||||
{
|
||||
$options = array(
|
||||
'skip-active' => false
|
||||
);
|
||||
|
||||
return self::getHorizontalMenu()->getBreadcrumb($options);
|
||||
}
|
||||
|
||||
public static function initLayout()
|
||||
{
|
||||
self::initPage();
|
||||
self::initHeader();
|
||||
self::initPageTitle();
|
||||
self::initToolbar();
|
||||
self::initContent();
|
||||
self::initAside();
|
||||
self::initFooter();
|
||||
self::initAsideMenu();
|
||||
self::initHorizontalMenu();
|
||||
self::initScripts();
|
||||
}
|
||||
}
|
128
app/Core/Bootstraps/BootstrapDemo7.php
Normal file
128
app/Core/Bootstraps/BootstrapDemo7.php
Normal file
|
@ -0,0 +1,128 @@
|
|||
<?php
|
||||
|
||||
namespace App\Core\Bootstraps;
|
||||
|
||||
use App\Core\Adapters\BootstrapBase;
|
||||
use App\Core\Adapters\Menu;
|
||||
use App\Core\Adapters\Theme;
|
||||
|
||||
class BootstrapDemo7 extends BootstrapBase
|
||||
{
|
||||
// Private Properties
|
||||
private static $menu;
|
||||
|
||||
// Private Methods
|
||||
private static function initPage()
|
||||
{
|
||||
Theme::addHtmlAttribute('body', 'style', 'background-image: url(' . Theme::getOption('layout', 'main/body/background-image') . ')');
|
||||
}
|
||||
|
||||
private static function initHeader()
|
||||
{
|
||||
if (Theme::getOption('layout', 'header/width') == 'fluid') {
|
||||
Theme::addHtmlClass('header-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('header-container', 'container-xxl');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'header/fixed/desktop') === true) {
|
||||
Theme::addHtmlClass('body', 'header-fixed');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'header/fixed/tablet-and-mobile') === true) {
|
||||
Theme::addHtmlClass('body', 'header-tablet-and-mobile-fixed');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initContent()
|
||||
{
|
||||
if (Theme::getOption('layout', 'content/width') == 'fluid') {
|
||||
Theme::addHtmlClass('content-container', 'container-fluid');
|
||||
} elseif (Theme::getOption('layout', 'content/width') == 'fixed') {
|
||||
Theme::addHtmlClass('content-container', 'container-xxl');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initAside()
|
||||
{
|
||||
// Fixed aside
|
||||
if (Theme::getOption('layout', 'aside/fixed')) {
|
||||
Theme::addHtmlClass('body', 'aside-fixed');
|
||||
}
|
||||
|
||||
// Default minimized
|
||||
if (Theme::getOption('layout', 'aside/minimized')) {
|
||||
Theme::addHtmlAttribute('body', 'data-kt-aside-minimize', 'on');
|
||||
Theme::addHtmlClass('asideToggle', 'active');
|
||||
}
|
||||
|
||||
// Aside Secondary
|
||||
if (Theme::getOption('layout', 'aside/secondary-display') === true) {
|
||||
Theme::addHtmlClass('body', 'aside-secondary-enabled');
|
||||
} else {
|
||||
Theme::addHtmlClass('body', 'aside-secondary-disabled');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initMenu()
|
||||
{
|
||||
self::$menu = new Menu(Theme::getOption('menu', 'main'), Theme::getPagePath());
|
||||
|
||||
if (Theme::getOption('layout', 'aside/menu-icons-display') === false) {
|
||||
self::$menu->displayIcons(false);
|
||||
}
|
||||
|
||||
self::$menu->setIconType(Theme::getOption('layout', 'aside/menu-icon'));
|
||||
}
|
||||
|
||||
private static function initFooter()
|
||||
{
|
||||
if (Theme::getOption('layout', 'footer/width') == 'fluid') {
|
||||
Theme::addHtmlClass('footer-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('footer-container', 'container-xxl');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initScripts()
|
||||
{
|
||||
// Global widgets
|
||||
Theme::addPageJs('js/widgets.bundle.js');
|
||||
|
||||
// Custom widgets
|
||||
Theme::addPageJs('js/custom/widgets.js');
|
||||
|
||||
// Chat app
|
||||
Theme::addPageJs('js/custom/apps/chat/chat.js');
|
||||
|
||||
if (Theme::getViewMode() !== 'release') {
|
||||
Theme::addPageJs('js/custom/intro.js');
|
||||
}
|
||||
}
|
||||
|
||||
// Public Methods
|
||||
public static function getMenu()
|
||||
{
|
||||
return self::$menu;
|
||||
}
|
||||
|
||||
public static function getBreadcrumb()
|
||||
{
|
||||
$options = array(
|
||||
'skip-active' => false
|
||||
);
|
||||
|
||||
return self::getMenu()->getBreadcrumb($options);
|
||||
}
|
||||
|
||||
public static function initLayout()
|
||||
{
|
||||
self::initPage();
|
||||
self::initHeader();
|
||||
self::initContent();
|
||||
self::initAside();
|
||||
self::initFooter();
|
||||
self::initMenu();
|
||||
self::initScripts();
|
||||
}
|
||||
}
|
97
app/Core/Bootstraps/BootstrapDemo8.php
Normal file
97
app/Core/Bootstraps/BootstrapDemo8.php
Normal file
|
@ -0,0 +1,97 @@
|
|||
<?php
|
||||
|
||||
namespace App\Core\Bootstraps;
|
||||
|
||||
use App\Core\Adapters\BootstrapBase;
|
||||
use App\Core\Adapters\Menu;
|
||||
use App\Core\Adapters\Theme;
|
||||
|
||||
class BootstrapDemo8 extends BootstrapBase
|
||||
{
|
||||
// Private Properties
|
||||
private static $asideMenu;
|
||||
|
||||
// Private Methods
|
||||
private static function initHeader()
|
||||
{
|
||||
if (Theme::getOption('layout', 'header/width') == 'fluid') {
|
||||
Theme::addHtmlClass('header-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('header-container', 'container-xxl');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'header/fixed/tablet-and-mobile') === true) {
|
||||
Theme::addHtmlClass('body', 'header-tablet-and-mobile-fixed');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initContent()
|
||||
{
|
||||
if (Theme::getOption('layout', 'content/width') == 'fluid') {
|
||||
Theme::addHtmlClass('content-container', 'container-fluid');
|
||||
} elseif (Theme::getOption('layout', 'content/width') == 'fixed') {
|
||||
Theme::addHtmlClass('content-container', 'container-xxl');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initAside()
|
||||
{
|
||||
Theme::addHtmlClass('body', 'aside-enabled');
|
||||
|
||||
// Default minimized
|
||||
if (Theme::getOption('layout', 'aside/minimized')) {
|
||||
Theme::addHtmlAttribute('body', 'data-kt-aside-minimize', 'on');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initAsideMenu()
|
||||
{
|
||||
self::$asideMenu = new Menu(Theme::getOption('menu', 'main'), Theme::getPagePath());
|
||||
}
|
||||
|
||||
private static function initFooter()
|
||||
{
|
||||
if (Theme::getOption('layout', 'footer/width') == 'fluid') {
|
||||
Theme::addHtmlClass('footer-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('footer-container', 'container');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initScripts()
|
||||
{
|
||||
Theme::addPageJs('js/custom/widgets.js');
|
||||
Theme::addPageJs('js/custom/apps/chat/chat.js');
|
||||
Theme::addPageJs('js/custom/modals/create-app.js');
|
||||
Theme::addPageJs('js/custom/modals/upgrade-plan.js');
|
||||
|
||||
if (Theme::getViewMode() !== 'release') {
|
||||
Theme::addPageJs('js/custom/intro.js');
|
||||
}
|
||||
}
|
||||
|
||||
// Public Methods
|
||||
public static function initLayout()
|
||||
{
|
||||
self::initHeader();
|
||||
self::initContent();
|
||||
self::initAside();
|
||||
self::initFooter();
|
||||
self::initAsideMenu();
|
||||
self::initScripts();
|
||||
}
|
||||
|
||||
public static function getAsideMenu()
|
||||
{
|
||||
return self::$asideMenu;
|
||||
}
|
||||
|
||||
public static function getBreadcrumb()
|
||||
{
|
||||
$options = array(
|
||||
'skip-active' => false
|
||||
);
|
||||
|
||||
return self::getAsideMenu()->getBreadcrumb($options);
|
||||
}
|
||||
}
|
127
app/Core/Bootstraps/BootstrapDemo9.php
Normal file
127
app/Core/Bootstraps/BootstrapDemo9.php
Normal file
|
@ -0,0 +1,127 @@
|
|||
<?php
|
||||
|
||||
namespace App\Core\Bootstraps;
|
||||
|
||||
use App\Core\Adapters\BootstrapBase;
|
||||
use App\Core\Adapters\Menu;
|
||||
use App\Core\Adapters\Theme;
|
||||
|
||||
class BootstrapDemo9 extends BootstrapBase
|
||||
{
|
||||
// Private Properties
|
||||
private static $asideMenu;
|
||||
private static $horizontalMenu;
|
||||
|
||||
// Private Methods
|
||||
private static function initHeader()
|
||||
{
|
||||
if (Theme::getOption('layout', 'header/width') == 'fluid') {
|
||||
Theme::addHtmlClass('header-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('header-container', 'container-xxl');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'header/fixed/desktop') === true) {
|
||||
Theme::addHtmlClass('body', 'header-fixed');
|
||||
}
|
||||
|
||||
if (Theme::getOption('layout', 'header/fixed/tablet-and-mobile') === true) {
|
||||
Theme::addHtmlClass('body', 'header-tablet-and-mobile-fixed');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initContent()
|
||||
{
|
||||
if (Theme::getOption('layout', 'content/width') == 'fluid') {
|
||||
Theme::addHtmlClass('content-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('content-container', 'container-xxl');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initAside()
|
||||
{
|
||||
// Fixed aside
|
||||
if (Theme::getOption('layout', 'aside/fixed')) {
|
||||
Theme::addHtmlClass('body', 'aside-fixed');
|
||||
}
|
||||
|
||||
// Default minimized
|
||||
if (Theme::getOption('layout', 'aside/minimized')) {
|
||||
Theme::addHtmlAttribute('body', 'data-kt-aside-minimize', 'on');
|
||||
Theme::addHtmlClass('asideToggle', 'active');
|
||||
}
|
||||
|
||||
// Aside Secondary
|
||||
if (Theme::getOption('layout', 'aside/secondary-display') === true) {
|
||||
Theme::addHtmlClass('body', 'aside-secondary-enabled');
|
||||
} else {
|
||||
Theme::addHtmlClass('body', 'aside-secondary-disabled');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initAsideMenu()
|
||||
{
|
||||
self::$asideMenu = new Menu(Theme::getOption('menu', 'demo9-aside'), Theme::getPagePath());
|
||||
self::$asideMenu->setIconType(Theme::getOption('layout', 'aside/menu-icon', 'svg'));
|
||||
}
|
||||
|
||||
private static function initHorizontalMenu()
|
||||
{
|
||||
self::$horizontalMenu = new Menu(Theme::getOption('menu', 'horizontal'), Theme::getPagePath());
|
||||
self::$horizontalMenu->setItemLinkClass('py-3');
|
||||
self::$horizontalMenu->setIconType(Theme::getOption('layout', 'header/menu-icon', 'svg'));
|
||||
}
|
||||
|
||||
private static function initFooter()
|
||||
{
|
||||
if (Theme::getOption('layout', 'footer/width') == 'fluid') {
|
||||
Theme::addHtmlClass('footer-container', 'container-fluid');
|
||||
} else {
|
||||
Theme::addHtmlClass('footer-container', 'container-xxl');
|
||||
}
|
||||
}
|
||||
|
||||
private static function initScripts()
|
||||
{
|
||||
Theme::addPageJs('js/custom/widgets.js');
|
||||
Theme::addPageJs('js/custom/apps/chat/chat.js');
|
||||
Theme::addPageJs('js/custom/modals/create-app.js');
|
||||
Theme::addPageJs('js/custom/modals/upgrade-plan.js');
|
||||
|
||||
if (Theme::getViewMode() !== 'release') {
|
||||
Theme::addPageJs('js/custom/intro.js');
|
||||
}
|
||||
}
|
||||
|
||||
// Public Methods
|
||||
public static function getAsideMenu()
|
||||
{
|
||||
return self::$asideMenu;
|
||||
}
|
||||
|
||||
public static function getHorizontalMenu()
|
||||
{
|
||||
return self::$horizontalMenu;
|
||||
}
|
||||
|
||||
public static function getBreadcrumb()
|
||||
{
|
||||
$options = array(
|
||||
'skip-active' => false
|
||||
);
|
||||
|
||||
return self::getHorizontalMenu()->getBreadcrumb($options);
|
||||
}
|
||||
|
||||
public static function initLayout()
|
||||
{
|
||||
self::initHeader();
|
||||
self::initContent();
|
||||
self::initAside();
|
||||
self::initFooter();
|
||||
self::initAsideMenu();
|
||||
self::initHorizontalMenu();
|
||||
self::initScripts();
|
||||
}
|
||||
}
|
81
app/Core/Components.php
Normal file
81
app/Core/Components.php
Normal file
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
|
||||
namespace App\Core;
|
||||
|
||||
class Components
|
||||
{
|
||||
public static function getAvatar($options)
|
||||
{
|
||||
$avatarClasses = array();
|
||||
$avatarInitialsClasses = array();
|
||||
|
||||
// Set default options
|
||||
if (isset($options['circle']) === false) {
|
||||
$options['circle'] = true;
|
||||
}
|
||||
|
||||
if (isset($options['size']) === false) {
|
||||
$options['size'] = '40px';
|
||||
}
|
||||
|
||||
if (isset($options['initials'])) {
|
||||
if (isset($options['initials']['font-size']) === false) {
|
||||
$options['initials']['font-size'] = '40px';
|
||||
}
|
||||
}
|
||||
|
||||
// Class
|
||||
if (isset($options['class'])) {
|
||||
$avatarClasses[] = $options['class'];
|
||||
}
|
||||
|
||||
// Size
|
||||
if ($options['size']) {
|
||||
$avatarClasses[] = 'symbol-' . $options['size'];
|
||||
}
|
||||
|
||||
// Shape
|
||||
if ($options['circle'] === true) {
|
||||
$avatarClasses[] = 'symbol-circle';
|
||||
}
|
||||
|
||||
// Initials
|
||||
if (isset($options['initials'])) {
|
||||
if (isset($options['initials']['state'])) {
|
||||
$avatarInitialsClasses[] = 'bg-light-' . $options['initials']['state'];
|
||||
$avatarInitialsClasses[] = 'text-' . $options['initials']['state'];
|
||||
}
|
||||
|
||||
if (isset($options['initials']['font-size'])) {
|
||||
$avatarInitialsClasses[] = $options['initials']['font-size'];
|
||||
}
|
||||
|
||||
if (isset($options['initials']['font-weight'])) {
|
||||
$avatarInitialsClasses[] = $options['initials']['font-weight'];
|
||||
}
|
||||
}
|
||||
|
||||
$html = '';
|
||||
|
||||
$html .= '<!--begin::Avatar-->';
|
||||
$html .= '<div class="symbol ' . util()->getHtmlClass($avatarClasses, false) . '">';
|
||||
|
||||
if (isset($options['avatar'])) {
|
||||
$html .= '<img alt="Pic" src="' . asset(theme()->getMediaUrlPath() . $options['avatar']) . '"/>';
|
||||
} else {
|
||||
$html .= '<span class="symbol-label ' . util()->getHtmlClass($avatarInitialsClasses, false) . '">';
|
||||
$html .= $options['initials']['label'];
|
||||
$html .= '</span>';
|
||||
}
|
||||
|
||||
// Online badge
|
||||
if (isset($options['badge'])) {
|
||||
$html .= $options['badge'];
|
||||
}
|
||||
|
||||
$html .= '</div>';
|
||||
$html .= '<!--end::Avatar-->';
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
622
app/Core/Data.php
Normal file
622
app/Core/Data.php
Normal file
|
@ -0,0 +1,622 @@
|
|||
<?php
|
||||
|
||||
namespace App\Core;
|
||||
|
||||
use function PHPSTORM_META\map;
|
||||
|
||||
class Data
|
||||
{
|
||||
public static function getCountriesList()
|
||||
{
|
||||
return array(
|
||||
'AF' => array('name' => 'Afghanistan', 'flag' => 'flags/afghanistan.svg'),
|
||||
'AX' => array('name' => 'Aland Islands', 'flag' => 'flags/aland-islands.svg'),
|
||||
'AL' => array('name' => 'Albania', 'flag' => 'flags/albania.svg'),
|
||||
'DZ' => array('name' => 'Algeria', 'flag' => 'flags/algeria.svg'),
|
||||
'AS' => array('name' => 'American Samoa', 'flag' => 'flags/american-samoa.svg'),
|
||||
'AD' => array('name' => 'Andorra', 'flag' => 'flags/andorra.svg'),
|
||||
'AO' => array('name' => 'Angola', 'flag' => 'flags/angola.svg'),
|
||||
'AI' => array('name' => 'Anguilla', 'flag' => 'flags/anguilla.svg'),
|
||||
'AG' => array('name' => 'Antigua and Barbuda', 'flag' => 'flags/antigua-and-barbuda.svg'),
|
||||
'AR' => array('name' => 'Argentina', 'flag' => 'flags/argentina.svg'),
|
||||
'AM' => array('name' => 'Armenia', 'flag' => 'flags/armenia.svg'),
|
||||
'AW' => array('name' => 'Aruba', 'flag' => 'flags/aruba.svg'),
|
||||
'AU' => array('name' => 'Australia', 'flag' => 'flags/australia.svg'),
|
||||
'AT' => array('name' => 'Austria', 'flag' => 'flags/austria.svg'),
|
||||
'AZ' => array('name' => 'Azerbaijan', 'flag' => 'flags/azerbaijan.svg'),
|
||||
'BS' => array('name' => 'Bahamas', 'flag' => 'flags/bahamas.svg'),
|
||||
'BH' => array('name' => 'Bahrain', 'flag' => 'flags/bahrain.svg'),
|
||||
'BD' => array('name' => 'Bangladesh', 'flag' => 'flags/bangladesh.svg'),
|
||||
'BB' => array('name' => 'Barbados', 'flag' => 'flags/barbados.svg'),
|
||||
'BY' => array('name' => 'Belarus', 'flag' => 'flags/belarus.svg'),
|
||||
'BE' => array('name' => 'Belgium', 'flag' => 'flags/belgium.svg'),
|
||||
'BZ' => array('name' => 'Belize', 'flag' => 'flags/belize.svg'),
|
||||
'BJ' => array('name' => 'Benin', 'flag' => 'flags/benin.svg'),
|
||||
'BM' => array('name' => 'Bermuda', 'flag' => 'flags/bermuda.svg'),
|
||||
'BT' => array('name' => 'Bhutan', 'flag' => 'flags/bhutan.svg'),
|
||||
'BO' => array('name' => 'Bolivia, Plurinational State of', 'flag' => 'flags/bolivia.svg'),
|
||||
'BQ' => array('name' => 'Bonaire, Sint Eustatius and Saba', 'flag' => 'flags/bonaire.svg'),
|
||||
'BA' => array('name' => 'Bosnia and Herzegovina', 'flag' => 'flags/bosnia-and-herzegovina.svg'),
|
||||
'BW' => array('name' => 'Botswana', 'flag' => 'flags/botswana.svg'),
|
||||
'BR' => array('name' => 'Brazil', 'flag' => 'flags/brazil.svg'),
|
||||
'IO' => array('name' => 'British Indian Ocean Territory', 'flag' => 'flags/british-indian-ocean-territory.svg'),
|
||||
'BN' => array('name' => 'Brunei Darussalam', 'flag' => 'flags/brunei.svg'),
|
||||
'BG' => array('name' => 'Bulgaria', 'flag' => 'flags/bulgaria.svg'),
|
||||
'BF' => array('name' => 'Burkina Faso', 'flag' => 'flags/burkina-faso.svg'),
|
||||
'BI' => array('name' => 'Burundi', 'flag' => 'flags/burundi.svg'),
|
||||
'KH' => array('name' => 'Cambodia', 'flag' => 'flags/cambodia.svg'),
|
||||
'CM' => array('name' => 'Cameroon', 'flag' => 'flags/cameroon.svg'),
|
||||
'CA' => array('name' => 'Canada', 'flag' => 'flags/canada.svg'),
|
||||
'CV' => array('name' => 'Cape Verde', 'flag' => 'flags/cape-verde.svg'),
|
||||
'KY' => array('name' => 'Cayman Islands', 'flag' => 'flags/cayman-islands.svg'),
|
||||
'CF' => array('name' => 'Central African Republic', 'flag' => 'flags/central-african-republic.svg'),
|
||||
'TD' => array('name' => 'Chad', 'flag' => 'flags/chad.svg'),
|
||||
'CL' => array('name' => 'Chile', 'flag' => 'flags/chile.svg'),
|
||||
'CN' => array('name' => 'China', 'flag' => 'flags/china.svg'),
|
||||
'CX' => array('name' => 'Christmas Island', 'flag' => 'flags/christmas-island.svg'),
|
||||
'CC' => array('name' => 'Cocos (Keeling) Islands', 'flag' => 'flags/cocos-island.svg'),
|
||||
'CO' => array('name' => 'Colombia', 'flag' => 'flags/colombia.svg'),
|
||||
'KM' => array('name' => 'Comoros', 'flag' => 'flags/comoros.svg'),
|
||||
'CK' => array('name' => 'Cook Islands', 'flag' => 'flags/cook-islands.svg'),
|
||||
'CR' => array('name' => 'Costa Rica', 'flag' => 'flags/costa-rica.svg'),
|
||||
'CI' => array('name' => 'Côte d\'Ivoire', 'flag' => 'flags/ivory-coast.svg'),
|
||||
'HR' => array('name' => 'Croatia', 'flag' => 'flags/croatia.svg'),
|
||||
'CU' => array('name' => 'Cuba', 'flag' => 'flags/cuba.svg'),
|
||||
'CW' => array('name' => 'Curaçao', 'flag' => 'flags/curacao.svg'),
|
||||
'CZ' => array('name' => 'Czech Republic', 'flag' => 'flags/czech-republic.svg'),
|
||||
'DK' => array('name' => 'Denmark', 'flag' => 'flags/denmark.svg'),
|
||||
'DJ' => array('name' => 'Djibouti', 'flag' => 'flags/djibouti.svg'),
|
||||
'DM' => array('name' => 'Dominica', 'flag' => 'flags/dominica.svg'),
|
||||
'DO' => array('name' => 'Dominican Republic', 'flag' => 'flags/dominican-republic.svg'),
|
||||
'EC' => array('name' => 'Ecuador', 'flag' => 'flags/ecuador.svg'),
|
||||
'EG' => array('name' => 'Egypt', 'flag' => 'flags/egypt.svg'),
|
||||
'SV' => array('name' => 'El Salvador', 'flag' => 'flags/el-salvador.svg'),
|
||||
'GQ' => array('name' => 'Equatorial Guinea', 'flag' => 'flags/equatorial-guinea.svg'),
|
||||
'ER' => array('name' => 'Eritrea', 'flag' => 'flags/eritrea.svg'),
|
||||
'EE' => array('name' => 'Estonia', 'flag' => 'flags/estonia.svg'),
|
||||
'ET' => array('name' => 'Ethiopia', 'flag' => 'flags/ethiopia.svg'),
|
||||
'FK' => array('name' => 'Falkland Islands (Malvinas)', 'flag' => 'flags/falkland-islands.svg'),
|
||||
'FJ' => array('name' => 'Fiji', 'flag' => 'flags/fiji.svg'),
|
||||
'FI' => array('name' => 'Finland', 'flag' => 'flags/finland.svg'),
|
||||
'FR' => array('name' => 'France', 'flag' => 'flags/france.svg'),
|
||||
'PF' => array('name' => 'French Polynesia', 'flag' => 'flags/french-polynesia.svg'),
|
||||
'GA' => array('name' => 'Gabon', 'flag' => 'flags/gabon.svg'),
|
||||
'GM' => array('name' => 'Gambia', 'flag' => 'flags/gambia.svg'),
|
||||
'GE' => array('name' => 'Georgia', 'flag' => 'flags/georgia.svg'),
|
||||
'DE' => array('name' => 'Germany', 'flag' => 'flags/germany.svg'),
|
||||
'GH' => array('name' => 'Ghana', 'flag' => 'flags/ghana.svg'),
|
||||
'GI' => array('name' => 'Gibraltar', 'flag' => 'flags/gibraltar.svg'),
|
||||
'GR' => array('name' => 'Greece', 'flag' => 'flags/greece.svg'),
|
||||
'GL' => array('name' => 'Greenland', 'flag' => 'flags/greenland.svg'),
|
||||
'GD' => array('name' => 'Grenada', 'flag' => 'flags/grenada.svg'),
|
||||
'GU' => array('name' => 'Guam', 'flag' => 'flags/guam.svg'),
|
||||
'GT' => array('name' => 'Guatemala', 'flag' => 'flags/guatemala.svg'),
|
||||
'GG' => array('name' => 'Guernsey', 'flag' => 'flags/guernsey.svg'),
|
||||
'GN' => array('name' => 'Guinea', 'flag' => 'flags/guinea.svg'),
|
||||
'GW' => array('name' => 'Guinea-Bissau', 'flag' => 'flags/guinea-bissau.svg'),
|
||||
'HT' => array('name' => 'Haiti', 'flag' => 'flags/haiti.svg'),
|
||||
'VA' => array('name' => 'Holy See (Vatican City State)', 'flag' => 'flags/vatican-city.svg'),
|
||||
'HN' => array('name' => 'Honduras', 'flag' => 'flags/honduras.svg'),
|
||||
'HK' => array('name' => 'Hong Kong', 'flag' => 'flags/hong-kong.svg'),
|
||||
'HU' => array('name' => 'Hungary', 'flag' => 'flags/hungary.svg'),
|
||||
'IS' => array('name' => 'Iceland', 'flag' => 'flags/iceland.svg'),
|
||||
'IN' => array('name' => 'India', 'flag' => 'flags/india.svg'),
|
||||
'ID' => array('name' => 'Indonesia', 'flag' => 'flags/indonesia.svg'),
|
||||
'IR' => array('name' => 'Iran, Islamic Republic of', 'flag' => 'flags/iran.svg'),
|
||||
'IQ' => array('name' => 'Iraq', 'flag' => 'flags/iraq.svg'),
|
||||
'IE' => array('name' => 'Ireland', 'flag' => 'flags/ireland.svg'),
|
||||
'IM' => array('name' => 'Isle of Man', 'flag' => 'flags/isle-of-man.svg'),
|
||||
'IL' => array('name' => 'Israel', 'flag' => 'flags/israel.svg'),
|
||||
'IT' => array('name' => 'Italy', 'flag' => 'flags/italy.svg'),
|
||||
'JM' => array('name' => 'Jamaica', 'flag' => 'flags/jamaica.svg'),
|
||||
'JP' => array('name' => 'Japan', 'flag' => 'flags/japan.svg'),
|
||||
'JE' => array('name' => 'Jersey', 'flag' => 'flags/jersey.svg'),
|
||||
'JO' => array('name' => 'Jordan', 'flag' => 'flags/jordan.svg'),
|
||||
'KZ' => array('name' => 'Kazakhstan', 'flag' => 'flags/kazakhstan.svg'),
|
||||
'KE' => array('name' => 'Kenya', 'flag' => 'flags/kenya.svg'),
|
||||
'KI' => array('name' => 'Kiribati', 'flag' => 'flags/kiribati.svg'),
|
||||
'KP' => array('name' => 'Korea, Democratic People\'s Republic of', 'flag' => 'flags/north-korea.svg'),
|
||||
'KW' => array('name' => 'Kuwait', 'flag' => 'flags/kuwait.svg'),
|
||||
'KG' => array('name' => 'Kyrgyzstan', 'flag' => 'flags/kyrgyzstan.svg'),
|
||||
'LA' => array('name' => 'Lao People\'s Democratic Republic', 'flag' => 'flags/laos.svg'),
|
||||
'LV' => array('name' => 'Latvia', 'flag' => 'flags/latvia.svg'),
|
||||
'LB' => array('name' => 'Lebanon', 'flag' => 'flags/lebanon.svg'),
|
||||
'LS' => array('name' => 'Lesotho', 'flag' => 'flags/lesotho.svg'),
|
||||
'LR' => array('name' => 'Liberia', 'flag' => 'flags/liberia.svg'),
|
||||
'LY' => array('name' => 'Libya', 'flag' => 'flags/libya.svg'),
|
||||
'LI' => array('name' => 'Liechtenstein', 'flag' => 'flags/liechtenstein.svg'),
|
||||
'LT' => array('name' => 'Lithuania', 'flag' => 'flags/lithuania.svg'),
|
||||
'LU' => array('name' => 'Luxembourg', 'flag' => 'flags/luxembourg.svg'),
|
||||
'MO' => array('name' => 'Macao', 'flag' => 'flags/macao.svg'),
|
||||
'MG' => array('name' => 'Madagascar', 'flag' => 'flags/madagascar.svg'),
|
||||
'MW' => array('name' => 'Malawi', 'flag' => 'flags/malawi.svg'),
|
||||
'MY' => array('name' => 'Malaysia', 'flag' => 'flags/malaysia.svg'),
|
||||
'MV' => array('name' => 'Maldives', 'flag' => 'flags/maldives.svg'),
|
||||
'ML' => array('name' => 'Mali', 'flag' => 'flags/mali.svg'),
|
||||
'MT' => array('name' => 'Malta', 'flag' => 'flags/malta.svg'),
|
||||
'MH' => array('name' => 'Marshall Islands', 'flag' => 'flags/marshall-island.svg'),
|
||||
'MQ' => array('name' => 'Martinique', 'flag' => 'flags/martinique.svg'),
|
||||
'MR' => array('name' => 'Mauritania', 'flag' => 'flags/mauritania.svg'),
|
||||
'MU' => array('name' => 'Mauritius', 'flag' => 'flags/mauritius.svg'),
|
||||
'MX' => array('name' => 'Mexico', 'flag' => 'flags/mexico.svg'),
|
||||
'FM' => array('name' => 'Micronesia, Federated States of', 'flag' => 'flags/micronesia.svg'),
|
||||
'MD' => array('name' => 'Moldova, Republic of', 'flag' => 'flags/moldova.svg'),
|
||||
'MC' => array('name' => 'Monaco', 'flag' => 'flags/monaco.svg'),
|
||||
'MN' => array('name' => 'Mongolia', 'flag' => 'flags/mongolia.svg'),
|
||||
'ME' => array('name' => 'Montenegro', 'flag' => 'flags/montenegro.svg'),
|
||||
'MS' => array('name' => 'Montserrat', 'flag' => 'flags/montserrat.svg'),
|
||||
'MA' => array('name' => 'Morocco', 'flag' => 'flags/morocco.svg'),
|
||||
'MZ' => array('name' => 'Mozambique', 'flag' => 'flags/mozambique.svg'),
|
||||
'MM' => array('name' => 'Myanmar', 'flag' => 'flags/myanmar.svg'),
|
||||
'NA' => array('name' => 'Namibia', 'flag' => 'flags/namibia.svg'),
|
||||
'NR' => array('name' => 'Nauru', 'flag' => 'flags/nauru.svg'),
|
||||
'NP' => array('name' => 'Nepal', 'flag' => 'flags/nepal.svg'),
|
||||
'NL' => array('name' => 'Netherlands', 'flag' => 'flags/netherlands.svg'),
|
||||
'NZ' => array('name' => 'New Zealand', 'flag' => 'flags/new-zealand.svg'),
|
||||
'NI' => array('name' => 'Nicaragua', 'flag' => 'flags/nicaragua.svg'),
|
||||
'NE' => array('name' => 'Niger', 'flag' => 'flags/niger.svg'),
|
||||
'NG' => array('name' => 'Nigeria', 'flag' => 'flags/nigeria.svg'),
|
||||
'NU' => array('name' => 'Niue', 'flag' => 'flags/niue.svg'),
|
||||
'NF' => array('name' => 'Norfolk Island', 'flag' => 'flags/norfolk-island.svg'),
|
||||
'MP' => array('name' => 'Northern Mariana Islands', 'flag' => 'flags/northern-mariana-islands.svg'),
|
||||
'NO' => array('name' => 'Norway', 'flag' => 'flags/norway.svg'),
|
||||
'OM' => array('name' => 'Oman', 'flag' => 'flags/oman.svg'),
|
||||
'PK' => array('name' => 'Pakistan', 'flag' => 'flags/pakistan.svg'),
|
||||
'PW' => array('name' => 'Palau', 'flag' => 'flags/palau.svg'),
|
||||
'PS' => array('name' => 'Palestinian Territory, Occupied', 'flag' => 'flags/palestine.svg'),
|
||||
'PA' => array('name' => 'Panama', 'flag' => 'flags/panama.svg'),
|
||||
'PG' => array('name' => 'Papua New Guinea', 'flag' => 'flags/papua-new-guinea.svg'),
|
||||
'PY' => array('name' => 'Paraguay', 'flag' => 'flags/paraguay.svg'),
|
||||
'PE' => array('name' => 'Peru', 'flag' => 'flags/peru.svg'),
|
||||
'PH' => array('name' => 'Philippines', 'flag' => 'flags/philippines.svg'),
|
||||
'PL' => array('name' => 'Poland', 'flag' => 'flags/poland.svg'),
|
||||
'PT' => array('name' => 'Portugal', 'flag' => 'flags/portugal.svg'),
|
||||
'PR' => array('name' => 'Puerto Rico', 'flag' => 'flags/puerto-rico.svg'),
|
||||
'QA' => array('name' => 'Qatar', 'flag' => 'flags/qatar.svg'),
|
||||
'RO' => array('name' => 'Romania', 'flag' => 'flags/romania.svg'),
|
||||
'RU' => array('name' => 'Russian Federation', 'flag' => 'flags/russia.svg'),
|
||||
'RW' => array('name' => 'Rwanda', 'flag' => 'flags/rwanda.svg'),
|
||||
'BL' => array('name' => 'Saint Barthélemy', 'flag' => 'flags/st-barts.svg'),
|
||||
'KN' => array('name' => 'Saint Kitts and Nevis', 'flag' => 'flags/saint-kitts-and-nevis.svg'),
|
||||
'LC' => array('name' => 'Saint Lucia', 'flag' => 'flags/st-lucia.svg'),
|
||||
'MF' => array('name' => 'Saint Martin (French part)', 'flag' => 'flags/sint-maarten.svg'),
|
||||
// 'PM' => array('name' => 'Saint Pierre and Miquelon', 'flag' => 'flags/saint-pierre.svg'),
|
||||
'VC' => array('name' => 'Saint Vincent and the Grenadines', 'flag' => 'flags/st-vincent-and-the-grenadines.svg'),
|
||||
'WS' => array('name' => 'Samoa', 'flag' => 'flags/samoa.svg'),
|
||||
'SM' => array('name' => 'San Marino', 'flag' => 'flags/san-marino.svg'),
|
||||
'ST' => array('name' => 'Sao Tome and Principe', 'flag' => 'flags/sao-tome-and-prince.svg'),
|
||||
'SA' => array('name' => 'Saudi Arabia', 'flag' => 'flags/saudi-arabia.svg'),
|
||||
'SN' => array('name' => 'Senegal', 'flag' => 'flags/senegal.svg'),
|
||||
'RS' => array('name' => 'Serbia', 'flag' => 'flags/serbia.svg'),
|
||||
'SC' => array('name' => 'Seychelles', 'flag' => 'flags/seychelles.svg'),
|
||||
'SL' => array('name' => 'Sierra Leone', 'flag' => 'flags/sierra-leone.svg'),
|
||||
'SG' => array('name' => 'Singapore', 'flag' => 'flags/singapore.svg'),
|
||||
'SX' => array('name' => 'Sint Maarten (Dutch part)', 'flag' => 'flags/sint-maarten.svg'),
|
||||
'SK' => array('name' => 'Slovakia', 'flag' => 'flags/slovakia.svg'),
|
||||
'SI' => array('name' => 'Slovenia', 'flag' => 'flags/slovenia.svg'),
|
||||
'SB' => array('name' => 'Solomon Islands', 'flag' => 'flags/solomon-islands.svg'),
|
||||
'SO' => array('name' => 'Somalia', 'flag' => 'flags/somalia.svg'),
|
||||
'ZA' => array('name' => 'South Africa', 'flag' => 'flags/south-africa.svg'),
|
||||
'KR' => array('name' => 'South Korea', 'flag' => 'flags/south-korea.svg'),
|
||||
'SS' => array('name' => 'South Sudan', 'flag' => 'flags/south-sudan.svg'),
|
||||
'ES' => array('name' => 'Spain', 'flag' => 'flags/spain.svg'),
|
||||
'LK' => array('name' => 'Sri Lanka', 'flag' => 'flags/sri-lanka.svg'),
|
||||
'SD' => array('name' => 'Sudan', 'flag' => 'flags/sudan.svg'),
|
||||
'SR' => array('name' => 'Suriname', 'flag' => 'flags/suriname.svg'),
|
||||
'SZ' => array('name' => 'Swaziland', 'flag' => 'flags/swaziland.svg'),
|
||||
'SE' => array('name' => 'Sweden', 'flag' => 'flags/sweden.svg'),
|
||||
'CH' => array('name' => 'Switzerland', 'flag' => 'flags/switzerland.svg'),
|
||||
'SY' => array('name' => 'Syrian Arab Republic', 'flag' => 'flags/syria.svg'),
|
||||
'TW' => array('name' => 'Taiwan, Province of China', 'flag' => 'flags/taiwan.svg'),
|
||||
'TJ' => array('name' => 'Tajikistan', 'flag' => 'flags/tajikistan.svg'),
|
||||
'TZ' => array('name' => 'Tanzania, United Republic of', 'flag' => 'flags/tanzania.svg'),
|
||||
'TH' => array('name' => 'Thailand', 'flag' => 'flags/thailand.svg'),
|
||||
'TG' => array('name' => 'Togo', 'flag' => 'flags/togo.svg'),
|
||||
'TK' => array('name' => 'Tokelau', 'flag' => 'flags/tokelau.svg'),
|
||||
'TO' => array('name' => 'Tonga', 'flag' => 'flags/tonga.svg'),
|
||||
'TT' => array('name' => 'Trinidad and Tobago', 'flag' => 'flags/trinidad-and-tobago.svg'),
|
||||
'TN' => array('name' => 'Tunisia', 'flag' => 'flags/tunisia.svg'),
|
||||
'TR' => array('name' => 'Turkey', 'flag' => 'flags/turkey.svg'),
|
||||
'TM' => array('name' => 'Turkmenistan', 'flag' => 'flags/turkmenistan.svg'),
|
||||
'TC' => array('name' => 'Turks and Caicos Islands', 'flag' => 'flags/turks-and-caicos.svg'),
|
||||
'TV' => array('name' => 'Tuvalu', 'flag' => 'flags/tuvalu.svg'),
|
||||
'UG' => array('name' => 'Uganda', 'flag' => 'flags/uganda.svg'),
|
||||
'UA' => array('name' => 'Ukraine', 'flag' => 'flags/ukraine.svg'),
|
||||
'AE' => array('name' => 'United Arab Emirates', 'flag' => 'flags/united-arab-emirates.svg'),
|
||||
'GB' => array('name' => 'United Kingdom', 'flag' => 'flags/united-kingdom.svg'),
|
||||
'US' => array('name' => 'United States', 'flag' => 'flags/united-states.svg'),
|
||||
'UY' => array('name' => 'Uruguay', 'flag' => 'flags/uruguay.svg'),
|
||||
'UZ' => array('name' => 'Uzbekistan', 'flag' => 'flags/uzbekistan.svg'),
|
||||
'VU' => array('name' => 'Vanuatu', 'flag' => 'flags/vanuatu.svg'),
|
||||
'VE' => array('name' => 'Venezuela, Bolivarian Republic of', 'flag' => 'flags/venezuela.svg'),
|
||||
'VN' => array('name' => 'Vietnam', 'flag' => 'flags/vietnam.svg'),
|
||||
'VI' => array('name' => 'Virgin Islands', 'flag' => 'flags/virgin-islands.svg'),
|
||||
'YE' => array('name' => 'Yemen', 'flag' => 'flags/yemen.svg'),
|
||||
'ZM' => array('name' => 'Zambia', 'flag' => 'flags/zambia.svg'),
|
||||
'ZW' => array('name' => 'Zimbabwe', 'flag' => 'flags/zimbabwe.svg')
|
||||
);
|
||||
}
|
||||
|
||||
public static function getLanguagesList()
|
||||
{
|
||||
$countryArr = Data::getCountriesList();
|
||||
|
||||
return array(
|
||||
'id' => array('name' => 'Bahasa Indonesia - Indonesian', 'country' => $countryArr['ID']),
|
||||
'msa' => array('name' => 'Bahasa Melayu - Malay', 'country' => $countryArr['MY']),
|
||||
'ca' => array('name' => 'Català - Catalan', 'country' => $countryArr['CA']),
|
||||
'cs' => array('name' => 'Čeština - Czech', 'country' => $countryArr['CZ']),
|
||||
'da' => array('name' => 'Dansk - Danish', 'country' => $countryArr['NL']),
|
||||
'de' => array('name' => 'Deutsch - German', 'country' => $countryArr['DE']),
|
||||
'en' => array('name' => 'English', 'country' => $countryArr['GB']),
|
||||
'en-gb' => array('name' => 'English UK - British English', 'country' => $countryArr['GB']),
|
||||
'es' => array('name' => 'Español - Spanish', 'country' => $countryArr['ES']),
|
||||
'fil' => array('name' => 'Filipino', 'country' => $countryArr['PH']),
|
||||
'fr' => array('name' => 'Français - French', 'country' => $countryArr['FR']),
|
||||
'ga' => array('name' => 'Gaeilge - Irish (beta)', 'country' => $countryArr['GA']),
|
||||
'gl' => array('name' => 'Galego - Galician (beta)', 'country' => $countryArr['GL']),
|
||||
'hr' => array('name' => 'Hrvatski - Croatian', 'country' => $countryArr['HR']),
|
||||
'it' => array('name' => 'Italiano - Italian', 'country' => $countryArr['IT']),
|
||||
'hu' => array('name' => 'Magyar - Hungarian', 'country' => $countryArr['HU']),
|
||||
'nl' => array('name' => 'Nederlands - Dutch', 'country' => $countryArr['NL']),
|
||||
'no' => array('name' => 'Norsk - Norwegian', 'country' => $countryArr['NO']),
|
||||
'pl' => array('name' => 'Polski - Polish', 'country' => $countryArr['PL']),
|
||||
'pt' => array('name' => 'Português - Portuguese', 'country' => $countryArr['PT']),
|
||||
'ro' => array('name' => 'Română - Romanian', 'country' => $countryArr['RO']),
|
||||
'sk' => array('name' => 'Slovenčina - Slovak', 'country' => $countryArr['SK']),
|
||||
'fi' => array('name' => 'Suomi - Finnish', 'country' => $countryArr['FI']),
|
||||
'sv' => array('name' => 'Svenska - Swedish', 'country' => $countryArr['SV']),
|
||||
'vi' => array('name' => 'Tiếng Việt - Vietnamese', 'country' => $countryArr['VI']),
|
||||
'tr' => array('name' => 'Türkçe - Turkish', 'country' => $countryArr['TR']),
|
||||
'el' => array('name' => 'Ελληνικά - Greek', 'country' => $countryArr['GR']),
|
||||
'bg' => array('name' => 'Български език - Bulgarian', 'country' => $countryArr['BG']),
|
||||
'ru' => array('name' => 'Русский - Russian', 'country' => $countryArr['RU']),
|
||||
'sr' => array('name' => 'Српски - Serbian', 'country' => $countryArr['SR']),
|
||||
'uk' => array('name' => 'Українська мова - Ukrainian', 'country' => $countryArr['UA']),
|
||||
'he' => array('name' => 'עִבְרִית - Hebrew', 'country' => $countryArr['IL']),
|
||||
'ur' => array('name' => 'اردو - Urdu (beta)', 'country' => $countryArr['PK']),
|
||||
'ar' => array('name' => 'العربية - Arabic', 'country' => $countryArr['AR']),
|
||||
'fa' => array('name' => 'فارسی - Persian', 'country' => $countryArr['AR']),
|
||||
'mr' => array('name' => 'मराठी - Marathi', 'country' => $countryArr['MR']),
|
||||
'hi' => array('name' => 'हिन्दी - Hindi', 'country' => $countryArr['IN']),
|
||||
'bn' => array('name' => 'বাংলা - Bangla', 'country' => $countryArr['BD']),
|
||||
'gu' => array('name' => 'ગુજરાતી - Gujarati', 'country' => $countryArr['GU']),
|
||||
'ta' => array('name' => 'தமிழ் - Tamil', 'country' => $countryArr['IN']),
|
||||
'kn' => array('name' => 'ಕನ್ನಡ - Kannada', 'country' => $countryArr['KN']),
|
||||
'th' => array('name' => 'ภาษาไทย - Thai', 'country' => $countryArr['TH']),
|
||||
'ko' => array('name' => '한국어 - Korean', 'country' => $countryArr['KR']),
|
||||
'ja' => array('name' => '日本語 - Japanese', 'country' => $countryArr['JP']),
|
||||
'zh-cn' => array('name' => '简体中文 - Simplified Chinese', 'country' => $countryArr['CN']),
|
||||
'zh-tw' => array('name' => '繁體中文 - Traditional Chinese', 'country' => $countryArr['TW'])
|
||||
);
|
||||
}
|
||||
|
||||
public static function getCurrencyList()
|
||||
{
|
||||
$countryArr = Data::getCountriesList();
|
||||
|
||||
return array(
|
||||
'USD' => array('name' => 'USA dollar', 'country' => $countryArr['US']),
|
||||
'GBP' => array('name' => 'British pound', 'country' => $countryArr['GB']),
|
||||
'AUD' => array('name' => 'Australian dollar', 'country' => $countryArr['AU']),
|
||||
'JPY' => array('name' => 'Japanese yen', 'country' => $countryArr['JP']),
|
||||
'SEK' => array('name' => 'Swedish krona', 'country' => $countryArr['SE']),
|
||||
'CAD' => array('name' => 'Canadian dollar', 'country' => $countryArr['CA']),
|
||||
'CHF' => array('name' => 'Swiss franc', 'country' => $countryArr['CH'])
|
||||
);
|
||||
}
|
||||
|
||||
public static function getTimeZonesList()
|
||||
{
|
||||
return array(
|
||||
'International Date Line West' => array('name' => '(GMT-11:00) International Date Line West', 'offset' => '-39600'),
|
||||
'Midway Island' => array('name' => '(GMT-11:00) Midway Island', 'offset' => '-39600'),
|
||||
'Samoa' => array('name' => '(GMT-11:00) Samoa', 'offset' => '-39600'),
|
||||
'Hawaii' => array('name' => '(GMT-10:00) Hawaii', 'offset' => '-36000'),
|
||||
'Alaska' => array('name' => '(GMT-08:00) Alaska', 'offset' => '-28800'),
|
||||
'Pacific Time (US & Canada)' => array('name' => '(GMT-07:00) Pacific Time (US & Canada)', 'offset' => '-25200'),
|
||||
'Tijuana' => array('name' => '(GMT-07:00) Tijuana', 'offset' => '-25200'),
|
||||
'Arizona' => array('name' => '(GMT-07:00) Arizona', 'offset' => '-25200'),
|
||||
'Mountain Time (US & Canada)' => array('name' => '(GMT-06:00) Mountain Time (US & Canada)', 'offset' => '-21600'),
|
||||
'Chihuahua' => array('name' => '(GMT-06:00) Chihuahua', 'offset' => '-21600'),
|
||||
'Mazatlan' => array('name' => '(GMT-06:00) Mazatlan', 'offset' => '-21600'),
|
||||
'Saskatchewan' => array('name' => '(GMT-06:00) Saskatchewan', 'offset' => '-21600'),
|
||||
'Central America' => array('name' => '(GMT-06:00) Central America', 'offset' => '-21600'),
|
||||
'Central Time (US & Canada)' => array('name' => '(GMT-05:00) Central Time (US & Canada)', 'offset' => '-18000'),
|
||||
'Guadalajara' => array('name' => '(GMT-05:00) Guadalajara', 'offset' => '-18000'),
|
||||
'Mexico City' => array('name' => '(GMT-05:00) Mexico City', 'offset' => '-18000'),
|
||||
'Monterrey' => array('name' => '(GMT-05:00) Monterrey', 'offset' => '-18000'),
|
||||
'Bogota' => array('name' => '(GMT-05:00) Bogota', 'offset' => '-18000'),
|
||||
'Lima' => array('name' => '(GMT-05:00) Lima', 'offset' => '-18000'),
|
||||
'Quito' => array('name' => '(GMT-05:00) Quito', 'offset' => '-18000'),
|
||||
'Eastern Time (US & Canada)' => array('name' => '(GMT-04:00) Eastern Time (US & Canada)', 'offset' => '-14400'),
|
||||
'Indiana (East)' => array('name' => '(GMT-04:00) Indiana (East)', 'offset' => '-14400'),
|
||||
'Caracas' => array('name' => '(GMT-04:00) Caracas', 'offset' => '-14400'),
|
||||
'La Paz' => array('name' => '(GMT-04:00) La Paz', 'offset' => '-14400'),
|
||||
'Georgetown' => array('name' => '(GMT-04:00) Georgetown', 'offset' => '-14400'),
|
||||
'Atlantic Time (Canada)' => array('name' => '(GMT-03:00) Atlantic Time (Canada)', 'offset' => '-10800'),
|
||||
'Santiago' => array('name' => '(GMT-03:00) Santiago', 'offset' => '-10800'),
|
||||
'Brasilia' => array('name' => '(GMT-03:00) Brasilia', 'offset' => '-10800'),
|
||||
'Buenos Aires' => array('name' => '(GMT-03:00) Buenos Aires', 'offset' => '-10800'),
|
||||
'Newfoundland' => array('name' => '(GMT-02:30) Newfoundland', 'offset' => '-9000'),
|
||||
'Greenland' => array('name' => '(GMT-02:00) Greenland', 'offset' => '-7200'),
|
||||
'Mid-Atlantic' => array('name' => '(GMT-02:00) Mid-Atlantic', 'offset' => '-7200'),
|
||||
'Cape Verde Is.' => array('name' => '(GMT-01:00) Cape Verde Is.', 'offset' => '-3600'),
|
||||
'Azores' => array('name' => '(GMT) Azores', 'offset' => '0'),
|
||||
'Monrovia' => array('name' => '(GMT) Monrovia', 'offset' => '0'),
|
||||
'UTC' => array('name' => '(GMT) UTC', 'offset' => '0'),
|
||||
'Dublin' => array('name' => '(GMT+01:00) Dublin', 'offset' => '3600'),
|
||||
'Edinburgh' => array('name' => '(GMT+01:00) Edinburgh', 'offset' => '3600'),
|
||||
'Lisbon' => array('name' => '(GMT+01:00) Lisbon', 'offset' => '3600'),
|
||||
'London' => array('name' => '(GMT+01:00) London', 'offset' => '3600'),
|
||||
'Casablanca' => array('name' => '(GMT+01:00) Casablanca', 'offset' => '3600'),
|
||||
'West Central Africa' => array('name' => '(GMT+01:00) West Central Africa', 'offset' => '3600'),
|
||||
'Belgrade' => array('name' => '(GMT+02:00) Belgrade', 'offset' => '7200'),
|
||||
'Bratislava' => array('name' => '(GMT+02:00) Bratislava', 'offset' => '7200'),
|
||||
'Budapest' => array('name' => '(GMT+02:00) Budapest', 'offset' => '7200'),
|
||||
'Ljubljana' => array('name' => '(GMT+02:00) Ljubljana', 'offset' => '7200'),
|
||||
'Prague' => array('name' => '(GMT+02:00) Prague', 'offset' => '7200'),
|
||||
'Sarajevo' => array('name' => '(GMT+02:00) Sarajevo', 'offset' => '7200'),
|
||||
'Skopje' => array('name' => '(GMT+02:00) Skopje', 'offset' => '7200'),
|
||||
'Warsaw' => array('name' => '(GMT+02:00) Warsaw', 'offset' => '7200'),
|
||||
'Zagreb' => array('name' => '(GMT+02:00) Zagreb', 'offset' => '7200'),
|
||||
'Brussels' => array('name' => '(GMT+02:00) Brussels', 'offset' => '7200'),
|
||||
'Copenhagen' => array('name' => '(GMT+02:00) Copenhagen', 'offset' => '7200'),
|
||||
'Madrid' => array('name' => '(GMT+02:00) Madrid', 'offset' => '7200'),
|
||||
'Paris' => array('name' => '(GMT+02:00) Paris', 'offset' => '7200'),
|
||||
'Amsterdam' => array('name' => '(GMT+02:00) Amsterdam', 'offset' => '7200'),
|
||||
'Berlin' => array('name' => '(GMT+02:00) Berlin', 'offset' => '7200'),
|
||||
'Bern' => array('name' => '(GMT+02:00) Bern', 'offset' => '7200'),
|
||||
'Rome' => array('name' => '(GMT+02:00) Rome', 'offset' => '7200'),
|
||||
'Stockholm' => array('name' => '(GMT+02:00) Stockholm', 'offset' => '7200'),
|
||||
'Vienna' => array('name' => '(GMT+02:00) Vienna', 'offset' => '7200'),
|
||||
'Cairo' => array('name' => '(GMT+02:00) Cairo', 'offset' => '7200'),
|
||||
'Harare' => array('name' => '(GMT+02:00) Harare', 'offset' => '7200'),
|
||||
'Pretoria' => array('name' => '(GMT+02:00) Pretoria', 'offset' => '7200'),
|
||||
'Bucharest' => array('name' => '(GMT+03:00) Bucharest', 'offset' => '10800'),
|
||||
'Helsinki' => array('name' => '(GMT+03:00) Helsinki', 'offset' => '10800'),
|
||||
'Kiev' => array('name' => '(GMT+03:00) Kiev', 'offset' => '10800'),
|
||||
'Kyiv' => array('name' => '(GMT+03:00) Kyiv', 'offset' => '10800'),
|
||||
'Riga' => array('name' => '(GMT+03:00) Riga', 'offset' => '10800'),
|
||||
'Sofia' => array('name' => '(GMT+03:00) Sofia', 'offset' => '10800'),
|
||||
'Tallinn' => array('name' => '(GMT+03:00) Tallinn', 'offset' => '10800'),
|
||||
'Vilnius' => array('name' => '(GMT+03:00) Vilnius', 'offset' => '10800'),
|
||||
'Athens' => array('name' => '(GMT+03:00) Athens', 'offset' => '10800'),
|
||||
'Istanbul' => array('name' => '(GMT+03:00) Istanbul', 'offset' => '10800'),
|
||||
'Minsk' => array('name' => '(GMT+03:00) Minsk', 'offset' => '10800'),
|
||||
'Jerusalem' => array('name' => '(GMT+03:00) Jerusalem', 'offset' => '10800'),
|
||||
'Moscow' => array('name' => '(GMT+03:00) Moscow', 'offset' => '10800'),
|
||||
'St. Petersburg' => array('name' => '(GMT+03:00) St. Petersburg', 'offset' => '10800'),
|
||||
'Volgograd' => array('name' => '(GMT+03:00) Volgograd', 'offset' => '10800'),
|
||||
'Kuwait' => array('name' => '(GMT+03:00) Kuwait', 'offset' => '10800'),
|
||||
'Riyadh' => array('name' => '(GMT+03:00) Riyadh', 'offset' => '10800'),
|
||||
'Nairobi' => array('name' => '(GMT+03:00) Nairobi', 'offset' => '10800'),
|
||||
'Baghdad' => array('name' => '(GMT+03:00) Baghdad', 'offset' => '10800'),
|
||||
'Abu Dhabi' => array('name' => '(GMT+04:00) Abu Dhabi', 'offset' => '14400'),
|
||||
'Muscat' => array('name' => '(GMT+04:00) Muscat', 'offset' => '14400'),
|
||||
'Baku' => array('name' => '(GMT+04:00) Baku', 'offset' => '14400'),
|
||||
'Tbilisi' => array('name' => '(GMT+04:00) Tbilisi', 'offset' => '14400'),
|
||||
'Yerevan' => array('name' => '(GMT+04:00) Yerevan', 'offset' => '14400'),
|
||||
'Tehran' => array('name' => '(GMT+04:30) Tehran', 'offset' => '16200'),
|
||||
'Kabul' => array('name' => '(GMT+04:30) Kabul', 'offset' => '16200'),
|
||||
'Ekaterinburg' => array('name' => '(GMT+05:00) Ekaterinburg', 'offset' => '18000'),
|
||||
'Islamabad' => array('name' => '(GMT+05:00) Islamabad', 'offset' => '18000'),
|
||||
'Karachi' => array('name' => '(GMT+05:00) Karachi', 'offset' => '18000'),
|
||||
'Tashkent' => array('name' => '(GMT+05:00) Tashkent', 'offset' => '18000'),
|
||||
'Chennai' => array('name' => '(GMT+05:30) Chennai', 'offset' => '19800'),
|
||||
'Kolkata' => array('name' => '(GMT+05:30) Kolkata', 'offset' => '19800'),
|
||||
'Mumbai' => array('name' => '(GMT+05:30) Mumbai', 'offset' => '19800'),
|
||||
'New Delhi' => array('name' => '(GMT+05:30) New Delhi', 'offset' => '19800'),
|
||||
'Sri Jayawardenepura' => array('name' => '(GMT+05:30) Sri Jayawardenepura', 'offset' => '19800'),
|
||||
'Kathmandu' => array('name' => '(GMT+05:45) Kathmandu', 'offset' => '20700'),
|
||||
'Astana' => array('name' => '(GMT+06:00) Astana', 'offset' => '21600'),
|
||||
'Dhaka' => array('name' => '(GMT+06:00) Dhaka', 'offset' => '21600'),
|
||||
'Almaty' => array('name' => '(GMT+06:00) Almaty', 'offset' => '21600'),
|
||||
'Urumqi' => array('name' => '(GMT+06:00) Urumqi', 'offset' => '21600'),
|
||||
'Rangoon' => array('name' => '(GMT+06:30) Rangoon', 'offset' => '23400'),
|
||||
'Novosibirsk' => array('name' => '(GMT+07:00) Novosibirsk', 'offset' => '25200'),
|
||||
'Bangkok' => array('name' => '(GMT+07:00) Bangkok', 'offset' => '25200'),
|
||||
'Hanoi' => array('name' => '(GMT+07:00) Hanoi', 'offset' => '25200'),
|
||||
'Jakarta' => array('name' => '(GMT+07:00) Jakarta', 'offset' => '25200'),
|
||||
'Krasnoyarsk' => array('name' => '(GMT+07:00) Krasnoyarsk', 'offset' => '25200'),
|
||||
'Beijing' => array('name' => '(GMT+08:00) Beijing', 'offset' => '28800'),
|
||||
'Chongqing' => array('name' => '(GMT+08:00) Chongqing', 'offset' => '28800'),
|
||||
'Hong Kong' => array('name' => '(GMT+08:00) Hong Kong', 'offset' => '28800'),
|
||||
'Kuala Lumpur' => array('name' => '(GMT+08:00) Kuala Lumpur', 'offset' => '28800'),
|
||||
'Singapore' => array('name' => '(GMT+08:00) Singapore', 'offset' => '28800'),
|
||||
'Taipei' => array('name' => '(GMT+08:00) Taipei', 'offset' => '28800'),
|
||||
'Perth' => array('name' => '(GMT+08:00) Perth', 'offset' => '28800'),
|
||||
'Irkutsk' => array('name' => '(GMT+08:00) Irkutsk', 'offset' => '28800'),
|
||||
'Ulaan Bataar' => array('name' => '(GMT+08:00) Ulaan Bataar', 'offset' => '28800'),
|
||||
'Seoul' => array('name' => '(GMT+09:00) Seoul', 'offset' => '32400'),
|
||||
'Osaka' => array('name' => '(GMT+09:00) Osaka', 'offset' => '32400'),
|
||||
'Sapporo' => array('name' => '(GMT+09:00) Sapporo', 'offset' => '32400'),
|
||||
'Tokyo' => array('name' => '(GMT+09:00) Tokyo', 'offset' => '32400'),
|
||||
'Yakutsk' => array('name' => '(GMT+09:00) Yakutsk', 'offset' => '32400'),
|
||||
'Darwin' => array('name' => '(GMT+09:30) Darwin', 'offset' => '34200'),
|
||||
'Adelaide' => array('name' => '(GMT+09:30) Adelaide', 'offset' => '34200'),
|
||||
'Canberra' => array('name' => '(GMT+10:00) Canberra', 'offset' => '36000'),
|
||||
'Melbourne' => array('name' => '(GMT+10:00) Melbourne', 'offset' => '36000'),
|
||||
'Sydney' => array('name' => '(GMT+10:00) Sydney', 'offset' => '36000'),
|
||||
'Brisbane' => array('name' => '(GMT+10:00) Brisbane', 'offset' => '36000'),
|
||||
'Hobart' => array('name' => '(GMT+10:00) Hobart', 'offset' => '36000'),
|
||||
'Vladivostok' => array('name' => '(GMT+10:00) Vladivostok', 'offset' => '36000'),
|
||||
'Guam' => array('name' => '(GMT+10:00) Guam', 'offset' => '36000'),
|
||||
'Port Moresby' => array('name' => '(GMT+10:00) Port Moresby', 'offset' => '36000'),
|
||||
'Solomon Is.' => array('name' => '(GMT+10:00) Solomon Is.', 'offset' => '36000'),
|
||||
'Magadan' => array('name' => '(GMT+11:00) Magadan', 'offset' => '39600'),
|
||||
'New Caledonia' => array('name' => '(GMT+11:00) New Caledonia', 'offset' => '39600'),
|
||||
'Fiji' => array('name' => '(GMT+12:00) Fiji', 'offset' => '43200'),
|
||||
'Kamchatka' => array('name' => '(GMT+12:00) Kamchatka', 'offset' => '43200'),
|
||||
'Marshall Is.' => array('name' => '(GMT+12:00) Marshall Is.', 'offset' => '43200'),
|
||||
'Auckland' => array('name' => '(GMT+12:00) Auckland', 'offset' => '43200'),
|
||||
'Wellington' => array('name' => '(GMT+12:00) Wellington', 'offset' => '43200'),
|
||||
'Nuku\'alofa' => array('name' => '(GMT+13:00) Nuku\'alofa', 'offset' => '46800')
|
||||
);
|
||||
}
|
||||
|
||||
public static function getSampleUserInfo($index = -1)
|
||||
{
|
||||
$users = array(
|
||||
array(
|
||||
'name' => 'Emma Smith',
|
||||
'avatar' => 'avatars/300-6.jpg',
|
||||
'email' => 'e.smith@kpmg.com.au',
|
||||
'position' => 'Art Director',
|
||||
"online" => false
|
||||
),
|
||||
array(
|
||||
'name' => 'Melody Macy',
|
||||
'initials' => array('label' => 'M', 'state' => 'danger'),
|
||||
'email' => 'melody@altbox.com',
|
||||
'position' => 'Marketing Analytic',
|
||||
"online" => true
|
||||
),
|
||||
array(
|
||||
'name' => 'Max Smith',
|
||||
'avatar' => 'avatars/300-1.jpg',
|
||||
'email' => 'max@kt.com',
|
||||
'position' => 'Software Enginer',
|
||||
"online" => false
|
||||
),
|
||||
array(
|
||||
'name' => 'Sean Bean',
|
||||
'avatar' => 'avatars/300-5.jpg',
|
||||
'email' => 'sean@dellito.com',
|
||||
'position' => 'Web Developer',
|
||||
"online" => false
|
||||
),
|
||||
array(
|
||||
'name' => 'Brian Cox',
|
||||
'avatar' => 'avatars/300-25.jpg',
|
||||
'email' => 'brian@exchange.com',
|
||||
'position' => 'UI/UX Designer',
|
||||
"online" => false
|
||||
),
|
||||
array(
|
||||
'name' => 'Mikaela Collins',
|
||||
'initials' => array('label' => 'C', 'state' => 'warning'),
|
||||
'email' => 'mikaela@pexcom.com',
|
||||
'position' => 'Head Of Marketing',
|
||||
"online" => true
|
||||
),
|
||||
array(
|
||||
'name' => 'Francis Mitcham',
|
||||
'avatar' => 'avatars/300-9.jpg',
|
||||
'email' => 'f.mitcham@kpmg.com.au',
|
||||
'position' => 'Software Arcitect',
|
||||
"online" => false
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'Olivia Wild',
|
||||
'initials' => array('label' => 'O', 'state' => 'danger'),
|
||||
'email' => 'olivia@corpmail.com',
|
||||
'position' => 'System Admin',
|
||||
"online" => true
|
||||
),
|
||||
array(
|
||||
'name' => 'Neil Owen',
|
||||
'initials' => array('label' => 'N', 'state' => 'primary'),
|
||||
'email' => 'owen.neil@gmail.com',
|
||||
'position' => 'Account Manager',
|
||||
"online" => true
|
||||
),
|
||||
array(
|
||||
'name' => 'Dan Wilson',
|
||||
'avatar' => 'avatars/300-23.jpg',
|
||||
'email' => 'dam@consilting.com',
|
||||
'position' => 'Web Desinger',
|
||||
"online" => false
|
||||
),
|
||||
array(
|
||||
'name' => 'Emma Bold',
|
||||
'initials' => array('label' => 'E', 'state' => 'danger'),
|
||||
'email' => 'emma@intenso.com',
|
||||
'position' => 'Corporate Finance',
|
||||
"online" => true
|
||||
),
|
||||
array(
|
||||
'name' => 'Ana Crown',
|
||||
'avatar' => 'avatars/300-12.jpg',
|
||||
'email' => 'ana.cf@limtel.com',
|
||||
'position' => 'Customer Relationship',
|
||||
"online" => false
|
||||
),
|
||||
array(
|
||||
'name' => 'Robert Doe',
|
||||
'initials' => array('label' => 'A', 'state' => 'info'),
|
||||
'email' => 'robert@benko.com',
|
||||
'position' => 'Marketing Executive',
|
||||
"online" => true
|
||||
),
|
||||
array(
|
||||
'name' => 'John Miller',
|
||||
'avatar' => 'avatars/300-13.jpg',
|
||||
'email' => 'miller@mapple.com',
|
||||
'position' => 'Project Manager',
|
||||
"online" => false
|
||||
),
|
||||
array(
|
||||
'name' => 'Lucy Kunic',
|
||||
'initials' => array('label' => 'L', 'state' => 'success'),
|
||||
'email' => 'lucy.m@fentech.com',
|
||||
'position' => 'SEO Master',
|
||||
"online" => true
|
||||
),
|
||||
array(
|
||||
'name' => 'Ethan Wilder',
|
||||
'avatar' => 'avatars/300-21.jpg',
|
||||
'email' => 'ethan@loop.com.au',
|
||||
'position' => 'Accountant',
|
||||
"online" => true
|
||||
)
|
||||
);
|
||||
|
||||
$total = count($users);
|
||||
|
||||
if ($index === -1 || isset($users[$index]) === false) {
|
||||
$index = rand(0, $total - 1);
|
||||
}
|
||||
|
||||
return $users[$index];
|
||||
}
|
||||
|
||||
public static function getSampleStatus($index = -1)
|
||||
{
|
||||
$statuses = array(
|
||||
array('label' => 'Approved', 'state' => 'success'),
|
||||
array('label' => 'Pending', 'state' => 'warning'),
|
||||
array('label' => 'Rejected', 'state' => 'danger'),
|
||||
array('label' => 'In progress', 'state' => 'info'),
|
||||
array('label' => 'Completed', 'state' => 'primary'),
|
||||
);
|
||||
|
||||
$total = count($statuses);
|
||||
|
||||
if ($index === -1 || isset($statuses[$index]) === false) {
|
||||
$index = rand(0, $total - 2);
|
||||
}
|
||||
|
||||
return $statuses[$index];
|
||||
}
|
||||
|
||||
public static function getSampleDate()
|
||||
{
|
||||
$dates = array('Feb 21', 'Mar 10', 'Apr 15', 'May 05', 'Jun 20', 'Jun 24', 'Jul 25', 'Aug 19', 'Sep 22', 'Oct 25', 'Nov 10', 'Dec 20');
|
||||
|
||||
$date = $dates[rand(0, count($dates) - 1)] . ", " . date("Y");
|
||||
|
||||
return $date;
|
||||
}
|
||||
|
||||
public static function getSampleDatetime()
|
||||
{
|
||||
$dates = array('21 Feb', '10 Mar', '15 Apr', '05 May', '20 Jun', '24 Jun', '25 Jul', '19 Aug', '22 Sep', '25 Oct', '10 Nov', '20 Dec');
|
||||
$times = array('8:43 pm', '10:30 am', '5:20 pm', '2:40 pm', '11:05 am', '10:10 pm', '6:05 pm', '11:30 am', '5:30 pm', '9:23 pm', '6:43 am');
|
||||
|
||||
$date = $dates[rand(0, count($dates) - 1)] . " " . date("Y") . ", " . $times[rand(0, count($times) - 1)];
|
||||
|
||||
return $date;
|
||||
}
|
||||
}
|
521
app/Core/Menu.php
Normal file
521
app/Core/Menu.php
Normal file
|
@ -0,0 +1,521 @@
|
|||
<?php
|
||||
|
||||
namespace App\Core;
|
||||
|
||||
use App\Core\Adapters\Theme;
|
||||
|
||||
class Menu
|
||||
{
|
||||
// Menu config
|
||||
public $items;
|
||||
|
||||
// Current page path
|
||||
private $path;
|
||||
|
||||
// Default menu tag
|
||||
private $parentTag = 'div';
|
||||
|
||||
// Default menu item tag
|
||||
private $itemTag = 'div';
|
||||
|
||||
// Default icon visibility
|
||||
private $displayIcons = true;
|
||||
|
||||
// Hide root level icons
|
||||
private $hideRootLevelIcons = false;
|
||||
|
||||
// Menu registered callbacks
|
||||
private $callbacks = array();
|
||||
|
||||
// Default item link class
|
||||
private $itemLinkClass = '';
|
||||
|
||||
// Default icon type in menu config
|
||||
private $iconType = 'svg';
|
||||
|
||||
// Default root icon
|
||||
private $iconRoot = '';
|
||||
|
||||
// Hide root arrow
|
||||
private $hideRootArrow = false;
|
||||
|
||||
// Iteration level
|
||||
private $linkLevel = 0;
|
||||
|
||||
/**
|
||||
* Private Methods.
|
||||
*
|
||||
*/
|
||||
private function _generateItem($item, $level = 0)
|
||||
{
|
||||
$classes = array('menu-item');
|
||||
$attributes = array();
|
||||
|
||||
// Set iteration level
|
||||
$this->linkLevel = $level;
|
||||
|
||||
// Overcome recursive infinite loop
|
||||
if ($level > 10000) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Process callable item
|
||||
if (is_callable($item)) {
|
||||
$item = call_user_func($item);
|
||||
}
|
||||
|
||||
// Exit if item is null
|
||||
if ($item === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Handle menu item visiblity with callback function
|
||||
if (isset($item['hide'])) {
|
||||
if (is_callable($item['hide'])) {
|
||||
$hide = call_user_func($item['hide'], $this, $item);
|
||||
} else {
|
||||
$hide = $item['hide'];
|
||||
}
|
||||
|
||||
if ($hide === true) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($item['sub']) && ($this->_matchParentItemByPath($item) === true)) {
|
||||
$classes[] = 'here show';
|
||||
}
|
||||
|
||||
if (isset($item['attributes']) && isset($item['attributes']['item'])) {
|
||||
$attributes = $item['attributes']['item'];
|
||||
} elseif (isset($item['attributes']) && isset($item['attributes']['link']) === false) {
|
||||
$attributes = $item['attributes'];
|
||||
}
|
||||
|
||||
if (isset($item['classes']) && isset($item['classes']['item'])) {
|
||||
$classes[] = $item['classes']['item'];
|
||||
}
|
||||
|
||||
echo '<' . $this->itemTag . ' ' . Util::getHtmlAttributes($attributes) . Util::getHtmlClass($classes) . '>';
|
||||
|
||||
if (isset($item['custom'])) {
|
||||
$this->_generateItemCustom($item);
|
||||
}
|
||||
|
||||
if (isset($item['content'])) {
|
||||
$this->_generateItemContent($item);
|
||||
}
|
||||
|
||||
if (isset($item['title']) || isset($item['breadcrumb-title'])) {
|
||||
$this->_generateItemLink($item);
|
||||
}
|
||||
|
||||
if (isset($item['heading'])) {
|
||||
$this->_generateItemHeading($item);
|
||||
}
|
||||
|
||||
if (isset($item['sub'])) {
|
||||
$this->_generateItemSub($item['sub'], $level++);
|
||||
}
|
||||
|
||||
echo '</' . $this->itemTag . '>';
|
||||
}
|
||||
|
||||
private function _generateItemLink($item)
|
||||
{
|
||||
$classes = array('menu-link');
|
||||
$attributes = array();
|
||||
$tag = 'a';
|
||||
// Construct li ks attributes
|
||||
if (isset($item['path'])) {
|
||||
// Assign the page URL
|
||||
$attributes['href'] = Theme::getPageUrl($item['path']);
|
||||
|
||||
// Handle open in new tab mode
|
||||
if (isset($item['new-tab']) && $item['new-tab'] === true) {
|
||||
$attributes['target'] = 'blank';
|
||||
}
|
||||
|
||||
// Add special attribute for links to pro pages
|
||||
if (Theme::isFreeVersion() === true && Theme::isProPage($item['path']) === true) {
|
||||
$attributes['data-kt-page'] = 'pro';
|
||||
}
|
||||
} else {
|
||||
$tag = 'span';
|
||||
}
|
||||
|
||||
if (isset($item['attributes']) && isset($item['attributes']['link'])) {
|
||||
$attributes = array_merge($attributes, $item['attributes']['link']);
|
||||
}
|
||||
|
||||
if ($this->_matchItemByPath($item) === true) {
|
||||
$classes[] = 'active';
|
||||
}
|
||||
|
||||
if (!empty($this->itemLinkClass)) {
|
||||
$classes[] = $this->itemLinkClass;
|
||||
}
|
||||
|
||||
if (isset($item['classes']) && isset($item['classes']['link'])) {
|
||||
$classes[] = $item['classes']['link'];
|
||||
}
|
||||
|
||||
echo '<' . $tag . Util::getHtmlClass($classes) . Util::getHtmlAttributes($attributes) . '>';
|
||||
|
||||
if ($this->displayIcons !== false) {
|
||||
$this->_generateItemLinkIcon($item);
|
||||
}
|
||||
|
||||
$this->_generateItemLinkBullet($item);
|
||||
|
||||
if (isset($item['title'])) {
|
||||
$this->_generateItemLinkTitle($item);
|
||||
}
|
||||
|
||||
$this->_generateItemLinkBadge($item);
|
||||
|
||||
if (isset($item['sub']) && @$item['arrow'] !== false) {
|
||||
if (!($this->hideRootArrow === true && $this->linkLevel === 0)) {
|
||||
$this->_generateItemLinkArrow($item);
|
||||
}
|
||||
}
|
||||
|
||||
echo '</' . $tag . '>';
|
||||
}
|
||||
|
||||
private function _generateItemLinkTitle($item)
|
||||
{
|
||||
$classes = array('menu-title');
|
||||
|
||||
if (isset($item['classes']) && isset($item['classes']['title'])) {
|
||||
$classes[] = $item['classes']['title'];
|
||||
}
|
||||
|
||||
if (!is_string($item['title']) && is_callable($item['title'])) {
|
||||
$item['title'] = call_user_func($item['title'], $item);
|
||||
}
|
||||
|
||||
echo '<span ' . Util::getHtmlClass($classes) . '>';
|
||||
|
||||
if (isset($this->callbacks['title']) && is_callable($this->callbacks['title'])) {
|
||||
echo call_user_func($this->callbacks['title'], $item, $item['title']);
|
||||
} else {
|
||||
echo __($item['title']);
|
||||
// Append exclusive badge
|
||||
if (isset($item['path']) && Theme::isExclusivePage($item['path']) === true) {
|
||||
echo '<span class="badge badge-exclusive badge-light-success fw-bold fs-9 px-2 py-1 ms-1">Exclusive</span>';
|
||||
}
|
||||
|
||||
// Append pro badge
|
||||
if (Theme::isFreeVersion()) {
|
||||
if ((isset($item['path']) && Theme::isProPage($item['path']) === true) || (isset($item['pro']) && $item['pro'] === true)) {
|
||||
echo '<span class="badge badge-pro badge-light-danger fw-bold fs-9 px-2 py-1 ms-1">Pro</span>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo '</span>';
|
||||
}
|
||||
|
||||
private function _generateItemLinkIcon($item)
|
||||
{
|
||||
$classes = array('menu-icon');
|
||||
|
||||
if (isset($item['classes']) && isset($item['classes']['icon'])) {
|
||||
$classes[] = $item['classes']['icon'];
|
||||
}
|
||||
|
||||
if (isset($item['icon'])) {
|
||||
echo '<span ' . Util::getHtmlClass($classes) . '>';
|
||||
|
||||
if ($this->linkLevel === 0 && !empty($this->iconRoot)) {
|
||||
echo $this->iconRoot;
|
||||
} else {
|
||||
if (is_array($item['icon'])) {
|
||||
echo $item['icon'][$this->iconType];
|
||||
} else {
|
||||
echo $item['icon'];
|
||||
}
|
||||
}
|
||||
|
||||
echo '</span>';
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private function _generateItemLinkBullet($item)
|
||||
{
|
||||
if (isset($item['icon']) === true && $this->displayIcons !== false) {
|
||||
return;
|
||||
}
|
||||
|
||||
$classes = array('menu-bullet');
|
||||
|
||||
if (isset($item['classes']) && isset($item['classes']['bullet'])) {
|
||||
$classes[] = $item['classes']['bullet'];
|
||||
}
|
||||
|
||||
if (isset($item['bullet'])) {
|
||||
echo '<span ' . Util::getHtmlClass($classes) . '>';
|
||||
|
||||
if (isset($item['bullet'])) {
|
||||
echo $item['bullet'];
|
||||
}
|
||||
|
||||
echo '</span>';
|
||||
}
|
||||
}
|
||||
|
||||
private function _generateItemLinkBadge($item)
|
||||
{
|
||||
$classes = array('menu-badge');
|
||||
|
||||
if (isset($item['classes']) && isset($item['classes']['badge'])) {
|
||||
$classes[] = $item['classes']['badge'];
|
||||
}
|
||||
|
||||
if (isset($item['badge'])) {
|
||||
echo '<span ' . Util::getHtmlClass($classes) . '>';
|
||||
echo $item['badge'];
|
||||
echo '</span>';
|
||||
}
|
||||
}
|
||||
|
||||
private function _generateItemLinkArrow($item)
|
||||
{
|
||||
$classes = array('menu-arrow');
|
||||
|
||||
if (isset($item['classes']['arrow'])) {
|
||||
$classes[] = $item['classes']['arrow'];
|
||||
}
|
||||
|
||||
echo '<span ' . Util::getHtmlClass($classes) . '>';
|
||||
echo '</span>';
|
||||
}
|
||||
|
||||
private function _generateItemSub($sub, $level)
|
||||
{
|
||||
$classes = array('menu-sub');
|
||||
|
||||
if (isset($sub['class'])) {
|
||||
$classes[] = $sub['class'];
|
||||
}
|
||||
|
||||
echo '<' . $this->parentTag . ' ' . Util::getHtmlClass($classes) . '>';
|
||||
|
||||
if (isset($sub['view'])) {
|
||||
Theme::getView($sub['view']);
|
||||
} else {
|
||||
foreach ($sub['items'] as $item) {
|
||||
$this->_generateItem($item, $level++);
|
||||
}
|
||||
}
|
||||
|
||||
echo '</' . $this->parentTag . '>';
|
||||
}
|
||||
|
||||
private function _generateItemHeading($item)
|
||||
{
|
||||
$classes = array('menu-content');
|
||||
|
||||
if (isset($item['heading'])) {
|
||||
if (isset($this->callbacks['heading']) && is_callable($this->callbacks['heading'])) {
|
||||
echo call_user_func($this->callbacks['heading'], $item['heading']);
|
||||
} else {
|
||||
echo '<h3 ' . Util::getHtmlClass($classes) . '>';
|
||||
echo $item['heading'];
|
||||
echo '</h3>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function _generateItemContent($item)
|
||||
{
|
||||
$classes = array('menu-content');
|
||||
|
||||
if (isset($item['classes']) && isset($item['classes']['content'])) {
|
||||
$classes[] = $item['classes']['content'];
|
||||
}
|
||||
|
||||
if (isset($item['content'])) {
|
||||
echo '<div ' . Util::getHtmlClass($classes) . '>';
|
||||
echo $item['content'];
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
private function _generateItemCustom($item)
|
||||
{
|
||||
if (isset($item['custom'])) {
|
||||
echo $item['custom'];
|
||||
}
|
||||
}
|
||||
|
||||
private function _matchParentItemByPath($item, $level = 0)
|
||||
{
|
||||
if ($level > 1000) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->_matchItemByPath($item) === true) {
|
||||
return true;
|
||||
} else {
|
||||
if (isset($item['sub']) && isset($item['sub']['items'])) {
|
||||
foreach ($item['sub']['items'] as $currentItem) {
|
||||
if ($this->_matchParentItemByPath($currentItem, $level++) === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private function _matchItemByPath($item)
|
||||
{
|
||||
if (isset($item['path']) && ($this->path === $item['path'] || $this->path === $item['path'] . '/index')) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private function _buildBreadcrumb($items, &$breadcrumb, $options, $level = 0)
|
||||
{
|
||||
if ($level > 10000) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($items as $item) {
|
||||
$title = '';
|
||||
|
||||
if (isset($item['breadcrumb-title'])) {
|
||||
$title = $item['breadcrumb-title'];
|
||||
} elseif (isset($item['title'])) {
|
||||
if (!is_string($item['title']) && is_callable($item['title'])) {
|
||||
$title = call_user_func($item['title'], $item);
|
||||
} else {
|
||||
$title = $item['title'];
|
||||
}
|
||||
} elseif (isset($item['heading'])) {
|
||||
$title = $item['heading'];
|
||||
}
|
||||
|
||||
if (isset($item['path']) && ($item['path'] === $this->path || $item['path'] . '/index' === $this->path)) {
|
||||
if (@$options['skip-active'] !== true) {
|
||||
$breadcrumb[] = array(
|
||||
'title' => $title,
|
||||
'path' => isset($item['path']) ? $item['path'] : '',
|
||||
'active' => true
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
} elseif (isset($item['sub']) && isset($item['sub']['items'])) {
|
||||
if ($this->_buildBreadcrumb($item['sub']['items'], $breadcrumb, $options, $level++) === true) {
|
||||
$breadcrumb[] = array(
|
||||
'title' => $title,
|
||||
'path' => isset($item['path']) ? $item['path'] : ( isset($item['alt-path']) ? $item['alt-path'] : ''),
|
||||
'active' => false
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Public Methods.
|
||||
*
|
||||
*/
|
||||
public function __construct($items, $path = '')
|
||||
{
|
||||
$this->items = $items;
|
||||
$this->path = $path;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* options: array('includeHomeLink' => boolean, 'homeLink' => array(), 'skipCurrentPage' => boolean)
|
||||
*
|
||||
*/
|
||||
public function getBreadcrumb($options = array())
|
||||
{
|
||||
$breadcrumb = array();
|
||||
|
||||
//$includeHomeLink = true, $homeLink = null
|
||||
|
||||
$this->_buildBreadcrumb($this->items, $breadcrumb, $options);
|
||||
|
||||
$breadcrumb = array_reverse($breadcrumb, true);
|
||||
|
||||
if (!empty($breadcrumb)) {
|
||||
if (isset($options['home'])) {
|
||||
array_unshift($breadcrumb, $options['home']);
|
||||
} else {
|
||||
array_unshift($breadcrumb, array(
|
||||
'title' => 'Home',
|
||||
'path' => 'index',
|
||||
'active' => false
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
return $breadcrumb;
|
||||
}
|
||||
|
||||
public function setPath($path)
|
||||
{
|
||||
$this->path = $path;
|
||||
}
|
||||
|
||||
public function displayIcons($flag)
|
||||
{
|
||||
$this->displayIcons = $flag;
|
||||
}
|
||||
|
||||
public function hideRootArrow($flag)
|
||||
{
|
||||
$this->hideRootArrow = $flag;
|
||||
}
|
||||
|
||||
public function setItemTag($tagName)
|
||||
{
|
||||
$this->itemTag = $tagName;
|
||||
}
|
||||
|
||||
public function setIconType($type)
|
||||
{
|
||||
$this->iconType = $type;
|
||||
}
|
||||
|
||||
public function setDefaultRootIcon($icon)
|
||||
{
|
||||
$this->iconRoot = $icon;
|
||||
}
|
||||
|
||||
public function setItemLinkClass($class)
|
||||
{
|
||||
$this->itemLinkClass = $class;
|
||||
}
|
||||
|
||||
public function addCallback($target, $callback)
|
||||
{
|
||||
if (!is_string($callback) && is_callable($callback)) {
|
||||
$this->callbacks[$target] = $callback;
|
||||
}
|
||||
}
|
||||
|
||||
public function build()
|
||||
{
|
||||
foreach ($this->items as $item) {
|
||||
$this->_generateItem($item);
|
||||
}
|
||||
}
|
||||
}
|
1352
app/Core/Theme.php
Normal file
1352
app/Core/Theme.php
Normal file
File diff suppressed because it is too large
Load diff
20
app/Core/Traits/SpatieLogsActivity.php
Normal file
20
app/Core/Traits/SpatieLogsActivity.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace App\Core\Traits;
|
||||
|
||||
use Spatie\Activitylog\LogOptions;
|
||||
use Spatie\Activitylog\Traits\LogsActivity;
|
||||
|
||||
trait SpatieLogsActivity
|
||||
{
|
||||
use LogsActivity;
|
||||
|
||||
public function getActivitylogOptions(): LogOptions
|
||||
{
|
||||
$logOptions = new LogOptions();
|
||||
$logOptions->logAll();
|
||||
$logOptions->logOnlyDirty();
|
||||
|
||||
return $logOptions;
|
||||
}
|
||||
}
|
523
app/Core/Util.php
Normal file
523
app/Core/Util.php
Normal file
|
@ -0,0 +1,523 @@
|
|||
<?php
|
||||
|
||||
namespace App\Core;
|
||||
|
||||
use tidy;
|
||||
use App\Core\Adapters\Theme;
|
||||
|
||||
class Util
|
||||
{
|
||||
/**
|
||||
* Class init state.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private static $initialized = false;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
*/
|
||||
public static function init()
|
||||
{
|
||||
if (self::$initialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
self::$initialized = true;
|
||||
}
|
||||
|
||||
public static function startCode()
|
||||
{
|
||||
ob_start();
|
||||
}
|
||||
|
||||
public static function endCode()
|
||||
{
|
||||
$str = ob_get_clean();
|
||||
$str = trim($str);
|
||||
$str = htmlspecialchars($str);
|
||||
|
||||
echo $str;
|
||||
}
|
||||
|
||||
public static function outputCode($str)
|
||||
{
|
||||
$str = trim($str);
|
||||
$str = htmlspecialchars($str);
|
||||
|
||||
echo $str;
|
||||
}
|
||||
|
||||
public static function code($str)
|
||||
{
|
||||
echo self::getCode($str);
|
||||
}
|
||||
|
||||
public static function getCode($str)
|
||||
{
|
||||
$str = trim($str);
|
||||
$str = htmlspecialchars($str);
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
public static function parseCode($code, $lang = 'html', $height = 0)
|
||||
{
|
||||
$height = $height > 0 ? 'style="height:' . $height . 'px"' : '';
|
||||
|
||||
$code = '<pre class="language-' . $lang . '" ' . $height . '><code class="language-' . $lang . '">' . htmlspecialchars(trim($code), ENT_QUOTES) . '</code></pre>';
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
public static function highlight()
|
||||
{
|
||||
$tabItemActive = 'active';
|
||||
$tabPaneActive = 'show active';
|
||||
|
||||
$args = func_get_args();
|
||||
|
||||
echo '<!--begin::Highlight-->';
|
||||
echo '<div class="highlight">';
|
||||
echo ' <button class="highlight-copy btn" data-bs-toggle="tooltip" title="Copy code">copy</button>';
|
||||
|
||||
if (!empty($args)) {
|
||||
if (isset($args[0]) && is_array($args[0]) === false) {
|
||||
echo ' <div class="highlight-code">';
|
||||
echo Util::parseCode($args[0], @$args[1], @$args[2]);
|
||||
echo ' </div>';
|
||||
} elseif (is_array($args[0]) && isset($args[1]) === false) {
|
||||
$options = $args[0];
|
||||
|
||||
echo '<ul class="nav nav-pills" role="tablist">';
|
||||
foreach ($options as $key => $each) {
|
||||
if (isset($each['lang']) === true) {
|
||||
$uid = 'kt_highlight_' . uniqid();
|
||||
$options[$key]['id'] = $uid;
|
||||
|
||||
echo '<li class="nav-item">';
|
||||
echo ' <a class="nav-link ' . $tabItemActive . '" href="#" data-bs-toggle="tab" href="#' . $uid . '" role="tab">' . strtoupper($each['lang']) . '</a>';
|
||||
echo '</li>';
|
||||
|
||||
$tabItemActive = '';
|
||||
}
|
||||
}
|
||||
echo '</ul>';
|
||||
|
||||
echo '<div class="tab-content">';
|
||||
foreach ($options as $each) {
|
||||
if (isset($each['lang']) === true) {
|
||||
echo '<div class="tab-pane fade ' . $tabPaneActive . '" id="' . $each['id'] . '" role="tabpanel">';
|
||||
echo ' <div class="highlight-code">';
|
||||
echo Util::parseCode($each['code'], $each['lang'], @$each['height']);
|
||||
echo ' </div>';
|
||||
echo '</div>';
|
||||
|
||||
$tabPaneActive = '';
|
||||
}
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
echo '<!--end::Highlight-->';
|
||||
}
|
||||
|
||||
|
||||
public static function tidyHtml($buffer)
|
||||
{
|
||||
if (! extension_loaded('Tidy')) {
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
// Specify configuration
|
||||
$config = array(
|
||||
// 'clean' => true,
|
||||
'drop-empty-elements' => false,
|
||||
'doctype' => 'omit',
|
||||
'indent' => 2,
|
||||
// 'output-html' => true,
|
||||
// 'output-xhtml' => true,
|
||||
// 'force-output' => true,
|
||||
'show-body-only' => true,
|
||||
'indent-with-tabs' => true,
|
||||
'tab-size' => 1,
|
||||
'indent-spaces' => 1,
|
||||
'tidy-mark' => false,
|
||||
'wrap' => 0,
|
||||
'indent-attributes' => false,
|
||||
'input-xml' => true,
|
||||
// HTML5 tags
|
||||
'new-blocklevel-tags' => 'article aside audio bdi canvas details dialog figcaption figure footer header hgroup main menu menuitem nav section source summary template track video',
|
||||
'new-empty-tags' => 'command embed keygen source track wbr',
|
||||
'new-inline-tags' => 'code audio command datalist embed keygen mark menuitem meter output progress source time video wbr',
|
||||
);
|
||||
|
||||
// Tidy
|
||||
$tidy = new Tidy();
|
||||
$tidy->parseString($buffer, $config, 'utf8');
|
||||
$tidy->cleanRepair();
|
||||
|
||||
// Output
|
||||
return $tidy;
|
||||
}
|
||||
|
||||
public static function setArrayValue(&$array, $path, $value)
|
||||
{
|
||||
$loc = &$array;
|
||||
foreach (explode('/', $path) as $step) {
|
||||
$loc = &$loc[ $step ];
|
||||
}
|
||||
|
||||
return $loc = $value;
|
||||
}
|
||||
|
||||
public static function getArrayValue($array, $path)
|
||||
{
|
||||
if (is_string($path)) {
|
||||
// dot delimiter
|
||||
$path = explode('/', $path);
|
||||
}
|
||||
|
||||
$ref = &$array;
|
||||
foreach ($path as $key) {
|
||||
if (! is_array($ref)) {
|
||||
$ref = [];
|
||||
}
|
||||
|
||||
$ref = &$ref[$key];
|
||||
}
|
||||
|
||||
$prev = $ref;
|
||||
|
||||
return $prev;
|
||||
}
|
||||
|
||||
public static function hasArrayValue($array, $path)
|
||||
{
|
||||
return self::getArrayValue($array, $path) !== null;
|
||||
}
|
||||
|
||||
public static function getArrayPath($array, $searchKey = '')
|
||||
{
|
||||
//create a recursive iterator to loop over the array recursively
|
||||
$iter = new RecursiveIteratorIterator(
|
||||
new RecursiveArrayIterator($array),
|
||||
RecursiveIteratorIterator::SELF_FIRST
|
||||
);
|
||||
|
||||
//loop over the iterator
|
||||
foreach ($iter as $key => $value) {
|
||||
//if the value matches our search
|
||||
if ($value === $searchKey) {
|
||||
//add the current key
|
||||
$keys = array( $key );
|
||||
//loop up the recursive chain
|
||||
for ($i = $iter->getDepth() - 1; $i >= 0; $i--) {
|
||||
//add each parent key
|
||||
array_unshift($keys, $iter->getSubIterator($i)->key());
|
||||
}
|
||||
//return our output array
|
||||
return $keys;
|
||||
}
|
||||
}
|
||||
|
||||
//return false if not found
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function matchArrayByKeyValue($array, $searchKey, $searchValue)
|
||||
{
|
||||
//create a recursive iterator to loop over the array recursively
|
||||
$iter = new RecursiveIteratorIterator(
|
||||
new RecursiveArrayIterator($array),
|
||||
RecursiveIteratorIterator::SELF_FIRST
|
||||
);
|
||||
|
||||
//loop over the iterator
|
||||
foreach ($iter as $key => $value) {
|
||||
//if the value matches our search
|
||||
if ($key === $searchKey && $value === $searchValue) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//return false if not found
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function searchArrayByKeyValue($array, $searchKey, $searchValue)
|
||||
{
|
||||
$result = array();
|
||||
|
||||
//create a recursive iterator to loop over the array recursively
|
||||
$iter = new RecursiveIteratorIterator(
|
||||
new RecursiveArrayIterator($array),
|
||||
RecursiveIteratorIterator::SELF_FIRST
|
||||
);
|
||||
|
||||
//loop over the iterator
|
||||
foreach ($iter as $key => $value) {
|
||||
//if the value matches our search
|
||||
if ($key === $searchKey && $value === $searchValue) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//return false if not found
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function separateCamelCase($str)
|
||||
{
|
||||
$re = '/
|
||||
(?<=[a-z])
|
||||
(?=[A-Z])
|
||||
| (?<=[A-Z])
|
||||
(?=[A-Z][a-z])
|
||||
/x';
|
||||
$a = preg_split($re, $str);
|
||||
$formattedStr = implode(' ', $a);
|
||||
|
||||
return $formattedStr;
|
||||
}
|
||||
|
||||
public static function isExternalURL($url)
|
||||
{
|
||||
$url = trim(strtolower($url));
|
||||
|
||||
if (substr($url, 0, 2) == '//') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (substr($url, 0, 7) == 'http://') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (substr($url, 0, 8) == 'https://') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (substr($url, 0, 5) == 'www.') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function getIf($cond, $value, $alt = '')
|
||||
{
|
||||
return $cond ? $value : $alt;
|
||||
}
|
||||
|
||||
public static function putIf($cond, $value, $alt = '')
|
||||
{
|
||||
echo self::getIf($cond, $value, $alt);
|
||||
}
|
||||
|
||||
public static function notice($text, $state = 'danger', $icon = 'icons/duotune/art/art006.svg')
|
||||
{
|
||||
$html = '';
|
||||
|
||||
$html .= '<!--begin::Notice-->';
|
||||
$html .= '<div class="d-flex align-items-center rounded py-5 px-4 bg-light-' . $state . ' ">';
|
||||
$html .= ' <!--begin::Icon-->';
|
||||
$html .= ' <div class="d-flex h-80px w-80px flex-shrink-0 flex-center position-relative ms-3 me-6">';
|
||||
$html .= ' ' . Theme::getSvgIcon("icons/duotune/abstract/abs051.svg", "svg-icon-" . $state . " position-absolute opacity-10", "w-80px h-80px");
|
||||
$html .= ' ' . Theme::getSvgIcon($icon, "svg-icon-3x svg-icon-" . $state . " position-absolute");
|
||||
$html .= ' </div>';
|
||||
$html .= ' <!--end::Icon-->';
|
||||
|
||||
$html .= ' <!--begin::Description-->';
|
||||
$html .= ' <div class="text-gray-700 fw-bold fs-6 lh-lg">';
|
||||
$html .= $text;
|
||||
$html .= ' </div>';
|
||||
$html .= ' <!--end::Description-->';
|
||||
$html .= '</div>';
|
||||
$html .= '<!--end::Notice-->';
|
||||
|
||||
echo $html;
|
||||
}
|
||||
|
||||
public static function info($text, $state = 'danger', $icon = 'icons/duotune/general/gen044.svg')
|
||||
{
|
||||
$html = '';
|
||||
|
||||
$html .= '<!--begin::Information-->';
|
||||
$html .= '<div class="d-flex align-items-center rounded py-5 px-5 bg-light-' . $state . ' ">';
|
||||
$html .= ' <!--begin::Icon-->';
|
||||
$html .= ' ' . Theme::getSvgIcon($icon, 'svg-icon-3x svg-icon-' . $state . ' me-5');
|
||||
$html .= ' <!--end::Icon-->';
|
||||
|
||||
$html .= ' <!--begin::Description-->';
|
||||
$html .= ' <div class="text-gray-700 fw-bold fs-6">';
|
||||
$html .= $text;
|
||||
$html .= ' </div>';
|
||||
$html .= ' <!--end::Description-->';
|
||||
$html .= '</div>';
|
||||
$html .= '<!--end::Information-->';
|
||||
|
||||
echo $html;
|
||||
}
|
||||
|
||||
public static function getHtmlAttributes($attributes = array())
|
||||
{
|
||||
$result = array();
|
||||
|
||||
if (empty($attributes)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($attributes as $name => $value) {
|
||||
if (!empty($value)) {
|
||||
$result[] = $name . '="' . $value . '"';
|
||||
}
|
||||
}
|
||||
|
||||
return ' ' . implode(' ', $result) . ' ';
|
||||
}
|
||||
|
||||
public static function putHtmlAttributes($attributes)
|
||||
{
|
||||
$result = self::getHtmlAttributes($attributes);
|
||||
|
||||
if ($result) {
|
||||
echo $result;
|
||||
}
|
||||
}
|
||||
|
||||
public static function getHtmlClass($classes, $full = true)
|
||||
{
|
||||
$result = array();
|
||||
|
||||
$classes = implode(' ', $classes);
|
||||
|
||||
if ($full === true) {
|
||||
return ' class="' . $classes . '" ';
|
||||
} else {
|
||||
return ' ' . $classes . ' ';
|
||||
}
|
||||
}
|
||||
|
||||
public static function getCssVariables($variables, $full = true)
|
||||
{
|
||||
$result = array();
|
||||
|
||||
foreach ($variables as $name => $value) {
|
||||
if (!empty($value)) {
|
||||
$result[] = $name . ':' . $value;
|
||||
}
|
||||
}
|
||||
|
||||
$result = implode(';', $result);
|
||||
|
||||
if ($full === true) {
|
||||
return ' style="' . $result . '" ';
|
||||
} else {
|
||||
return ' ' . $result . ' ';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a cache file
|
||||
*
|
||||
* @param $key
|
||||
* @param $value
|
||||
*/
|
||||
public static function putCache($key, $value)
|
||||
{
|
||||
global $_COMMON_PATH;
|
||||
|
||||
// check if cache file exist
|
||||
$cache = $_COMMON_PATH . '/dist/libs/cache/' . $key . '.cache.json';
|
||||
|
||||
// create cache folder if folder does not exist
|
||||
if (!file_exists(dirname($cache))) {
|
||||
mkdir(dirname($cache), 0777, true);
|
||||
}
|
||||
|
||||
// create cache file
|
||||
file_put_contents($cache, json_encode($value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a cache file by key
|
||||
*
|
||||
* @param $key
|
||||
*
|
||||
* @return mixed|null
|
||||
*/
|
||||
public static function getCache($key)
|
||||
{
|
||||
global $_COMMON_PATH;
|
||||
|
||||
// check if cache file exist
|
||||
$cache = $_COMMON_PATH . '/dist/libs/cache/' . $key . '.cache.json';
|
||||
|
||||
// check if the requested cache file exists
|
||||
if (file_exists($cache)) {
|
||||
return json_decode(file_get_contents($cache), true);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sample demo for docs for multidemo site
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function sampleDemoText()
|
||||
{
|
||||
$demo = '';
|
||||
if (Theme::isMultiDemo()) {
|
||||
$demo = '--demo1';
|
||||
}
|
||||
return $demo;
|
||||
}
|
||||
|
||||
public static function camelize($input, $separator = '_')
|
||||
{
|
||||
return str_replace($separator, ' ', ucwords($input, $separator));
|
||||
}
|
||||
|
||||
public static function arrayMergeRecursive()
|
||||
{
|
||||
$arrays = func_get_args();
|
||||
$merged = array();
|
||||
|
||||
while ($arrays) {
|
||||
$array = array_shift($arrays);
|
||||
|
||||
if (!is_array($array)) {
|
||||
trigger_error(__FUNCTION__ . ' encountered a non array argument', E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$array) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($array as $key => $value) {
|
||||
if (is_string($key)) {
|
||||
if (is_array($value) && array_key_exists($key, $merged) && is_array($merged[$key])) {
|
||||
$merged[$key] = self::arrayMergeRecursive($merged[$key], $value);
|
||||
} else {
|
||||
$merged[$key] = $value;
|
||||
}
|
||||
} else {
|
||||
$merged[] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $merged;
|
||||
}
|
||||
|
||||
public static function isHexColor($color)
|
||||
{
|
||||
return preg_match('/^#[a-f0-9]{6}$/i', $color);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue