Update Helper & Sample .env
This commit is contained in:
parent
4d2959b538
commit
05b26a4b95
@ -4,6 +4,11 @@ APP_KEY=
|
|||||||
APP_DEBUG=true
|
APP_DEBUG=true
|
||||||
APP_URL=http://localhost:8000
|
APP_URL=http://localhost:8000
|
||||||
|
|
||||||
|
METHOD_AUTH=usermanager
|
||||||
|
IP_USER_MANAGER=10.0.20.68
|
||||||
|
PORT_USER_MANAGER=82
|
||||||
|
APP_ID=WOF
|
||||||
|
|
||||||
LOG_CHANNEL=stack
|
LOG_CHANNEL=stack
|
||||||
LOG_DEPRECATIONS_CHANNEL=null
|
LOG_DEPRECATIONS_CHANNEL=null
|
||||||
LOG_LEVEL=debug
|
LOG_LEVEL=debug
|
||||||
|
@ -1,425 +1,545 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
if (!function_exists('theme')) {
|
if (!function_exists('theme')) {
|
||||||
function theme()
|
function theme()
|
||||||
{
|
{
|
||||||
return app(App\Core\Theme::class);
|
return app(App\Core\Theme::class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('getName')) {
|
if (!function_exists('getName')) {
|
||||||
/**
|
/**
|
||||||
* Get product name
|
* Get product name
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function getName()
|
function getName()
|
||||||
{
|
{
|
||||||
return config('settings.KT_THEME');
|
return config('settings.KT_THEME');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('addHtmlAttribute')) {
|
if (!function_exists('addHtmlAttribute')) {
|
||||||
/**
|
/**
|
||||||
* Add HTML attributes by scope
|
* Add HTML attributes by scope
|
||||||
*
|
*
|
||||||
* @param $scope
|
* @param $scope
|
||||||
* @param $name
|
* @param $name
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function addHtmlAttribute($scope, $name, $value)
|
function addHtmlAttribute($scope, $name, $value)
|
||||||
{
|
{
|
||||||
theme()->addHtmlAttribute($scope, $name, $value);
|
theme()->addHtmlAttribute($scope, $name, $value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('addHtmlAttributes')) {
|
if (!function_exists('addHtmlAttributes')) {
|
||||||
/**
|
/**
|
||||||
* Add multiple HTML attributes by scope
|
* Add multiple HTML attributes by scope
|
||||||
*
|
*
|
||||||
* @param $scope
|
* @param $scope
|
||||||
* @param $attributes
|
* @param $attributes
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function addHtmlAttributes($scope, $attributes)
|
function addHtmlAttributes($scope, $attributes)
|
||||||
{
|
{
|
||||||
theme()->addHtmlAttributes($scope, $attributes);
|
theme()->addHtmlAttributes($scope, $attributes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('addHtmlClass')) {
|
if (!function_exists('addHtmlClass')) {
|
||||||
/**
|
/**
|
||||||
* Add HTML class by scope
|
* Add HTML class by scope
|
||||||
*
|
*
|
||||||
* @param $scope
|
* @param $scope
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function addHtmlClass($scope, $value)
|
function addHtmlClass($scope, $value)
|
||||||
{
|
{
|
||||||
theme()->addHtmlClass($scope, $value);
|
theme()->addHtmlClass($scope, $value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('printHtmlAttributes')) {
|
if (!function_exists('printHtmlAttributes')) {
|
||||||
/**
|
/**
|
||||||
* Print HTML attributes for the HTML template
|
* Print HTML attributes for the HTML template
|
||||||
*
|
*
|
||||||
* @param $scope
|
* @param $scope
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function printHtmlAttributes($scope)
|
function printHtmlAttributes($scope)
|
||||||
{
|
{
|
||||||
return theme()->printHtmlAttributes($scope);
|
return theme()->printHtmlAttributes($scope);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('printHtmlClasses')) {
|
if (!function_exists('printHtmlClasses')) {
|
||||||
/**
|
/**
|
||||||
* Print HTML classes for the HTML template
|
* Print HTML classes for the HTML template
|
||||||
*
|
*
|
||||||
* @param $scope
|
* @param $scope
|
||||||
* @param $full
|
* @param $full
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function printHtmlClasses($scope, $full = true)
|
function printHtmlClasses($scope, $full = true)
|
||||||
{
|
{
|
||||||
return theme()->printHtmlClasses($scope, $full);
|
return theme()->printHtmlClasses($scope, $full);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('getSvgIcon')) {
|
if (!function_exists('getSvgIcon')) {
|
||||||
/**
|
/**
|
||||||
* Get SVG icon content
|
* Get SVG icon content
|
||||||
*
|
*
|
||||||
* @param $path
|
* @param $path
|
||||||
* @param $classNames
|
* @param $classNames
|
||||||
* @param $folder
|
* @param $folder
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getSvgIcon($path, $classNames = 'svg-icon', $folder = 'assets/media/icons/')
|
function getSvgIcon($path, $classNames = 'svg-icon', $folder = 'assets/media/icons/')
|
||||||
{
|
{
|
||||||
return theme()->getSvgIcon($path, $classNames, $folder);
|
return theme()->getSvgIcon($path, $classNames, $folder);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('setModeSwitch')) {
|
if (!function_exists('setModeSwitch')) {
|
||||||
/**
|
/**
|
||||||
* Set dark mode enabled status
|
* Set dark mode enabled status
|
||||||
*
|
*
|
||||||
* @param $flag
|
* @param $flag
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function setModeSwitch($flag)
|
function setModeSwitch($flag)
|
||||||
{
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('isModeSwitchEnabled')) {
|
if (!function_exists('isModeSwitchEnabled')) {
|
||||||
/**
|
/**
|
||||||
* Check dark mode status
|
* Check dark mode status
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function isModeSwitchEnabled()
|
function isModeSwitchEnabled()
|
||||||
{
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('setModeDefault')) {
|
if (!function_exists('setModeDefault')) {
|
||||||
/**
|
/**
|
||||||
* Set the mode to dark or light
|
* Set the mode to dark or light
|
||||||
*
|
*
|
||||||
* @param $mode
|
* @param $mode
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function setModeDefault($mode)
|
function setModeDefault($mode)
|
||||||
{
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('getModeDefault')) {
|
if (!function_exists('getModeDefault')) {
|
||||||
/**
|
/**
|
||||||
* Get current mode
|
* Get current mode
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function getModeDefault()
|
function getModeDefault()
|
||||||
{
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('setDirection')) {
|
if (!function_exists('setDirection')) {
|
||||||
/**
|
/**
|
||||||
* Set style direction
|
* Set style direction
|
||||||
*
|
*
|
||||||
* @param $direction
|
* @param $direction
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function setDirection($direction)
|
function setDirection($direction)
|
||||||
{
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('getDirection')) {
|
if (!function_exists('getDirection')) {
|
||||||
/**
|
/**
|
||||||
* Get style direction
|
* Get style direction
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function getDirection()
|
function getDirection()
|
||||||
{
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('isRtlDirection')) {
|
if (!function_exists('isRtlDirection')) {
|
||||||
/**
|
/**
|
||||||
* Check if style direction is RTL
|
* Check if style direction is RTL
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function isRtlDirection()
|
function isRtlDirection()
|
||||||
{
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('extendCssFilename')) {
|
if (!function_exists('extendCssFilename')) {
|
||||||
/**
|
/**
|
||||||
* Extend CSS file name with RTL or dark mode
|
* Extend CSS file name with RTL or dark mode
|
||||||
*
|
*
|
||||||
* @param $path
|
* @param $path
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function extendCssFilename($path)
|
function extendCssFilename($path)
|
||||||
{
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('includeFavicon')) {
|
if (!function_exists('includeFavicon')) {
|
||||||
/**
|
/**
|
||||||
* Include favicon from settings
|
* Include favicon from settings
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function includeFavicon()
|
function includeFavicon()
|
||||||
{
|
{
|
||||||
return theme()->includeFavicon();
|
return theme()->includeFavicon();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('includeFonts')) {
|
if (!function_exists('includeFonts')) {
|
||||||
/**
|
/**
|
||||||
* Include the fonts from settings
|
* Include the fonts from settings
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function includeFonts()
|
function includeFonts()
|
||||||
{
|
{
|
||||||
return theme()->includeFonts();
|
return theme()->includeFonts();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('getGlobalAssets')) {
|
if (!function_exists('getGlobalAssets')) {
|
||||||
/**
|
/**
|
||||||
* Get the global assets
|
* Get the global assets
|
||||||
*
|
*
|
||||||
* @param $type
|
* @param $type
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function getGlobalAssets($type = 'js')
|
function getGlobalAssets($type = 'js')
|
||||||
{
|
{
|
||||||
return theme()->getGlobalAssets($type);
|
return theme()->getGlobalAssets($type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('addVendors')) {
|
if (!function_exists('addVendors')) {
|
||||||
/**
|
/**
|
||||||
* Add multiple vendors to the page by name. Refer to settings KT_THEME_VENDORS
|
* Add multiple vendors to the page by name. Refer to settings KT_THEME_VENDORS
|
||||||
*
|
*
|
||||||
* @param $vendors
|
* @param $vendors
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function addVendors($vendors)
|
function addVendors($vendors)
|
||||||
{
|
{
|
||||||
theme()->addVendors($vendors);
|
theme()->addVendors($vendors);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('addVendor')) {
|
if (!function_exists('addVendor')) {
|
||||||
/**
|
/**
|
||||||
* Add single vendor to the page by name. Refer to settings KT_THEME_VENDORS
|
* Add single vendor to the page by name. Refer to settings KT_THEME_VENDORS
|
||||||
*
|
*
|
||||||
* @param $vendor
|
* @param $vendor
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function addVendor($vendor)
|
function addVendor($vendor)
|
||||||
{
|
{
|
||||||
theme()->addVendor($vendor);
|
theme()->addVendor($vendor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('addJavascriptFile')) {
|
if (!function_exists('addJavascriptFile')) {
|
||||||
/**
|
/**
|
||||||
* Add custom javascript file to the page
|
* Add custom javascript file to the page
|
||||||
*
|
*
|
||||||
* @param $file
|
* @param $file
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function addJavascriptFile($file)
|
function addJavascriptFile($file)
|
||||||
{
|
{
|
||||||
theme()->addJavascriptFile($file);
|
theme()->addJavascriptFile($file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('addCssFile')) {
|
if (!function_exists('addCssFile')) {
|
||||||
/**
|
/**
|
||||||
* Add custom CSS file to the page
|
* Add custom CSS file to the page
|
||||||
*
|
*
|
||||||
* @param $file
|
* @param $file
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function addCssFile($file)
|
function addCssFile($file)
|
||||||
{
|
{
|
||||||
theme()->addCssFile($file);
|
theme()->addCssFile($file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('getVendors')) {
|
if (!function_exists('getVendors')) {
|
||||||
/**
|
/**
|
||||||
* Get vendor files from settings. Refer to settings KT_THEME_VENDORS
|
* Get vendor files from settings. Refer to settings KT_THEME_VENDORS
|
||||||
*
|
*
|
||||||
* @param $type
|
* @param $type
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function getVendors($type)
|
function getVendors($type)
|
||||||
{
|
{
|
||||||
return theme()->getVendors($type);
|
return theme()->getVendors($type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('getCustomJs')) {
|
if (!function_exists('getCustomJs')) {
|
||||||
/**
|
/**
|
||||||
* Get custom js files from the settings
|
* Get custom js files from the settings
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function getCustomJs()
|
function getCustomJs()
|
||||||
{
|
{
|
||||||
return theme()->getCustomJs();
|
return theme()->getCustomJs();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('getCustomCss')) {
|
if (!function_exists('getCustomCss')) {
|
||||||
/**
|
/**
|
||||||
* Get custom css files from the settings
|
* Get custom css files from the settings
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function getCustomCss()
|
function getCustomCss()
|
||||||
{
|
{
|
||||||
return theme()->getCustomCss();
|
return theme()->getCustomCss();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('getHtmlAttribute')) {
|
if (!function_exists('getHtmlAttribute')) {
|
||||||
/**
|
/**
|
||||||
* Get HTML attribute based on the scope
|
* Get HTML attribute based on the scope
|
||||||
*
|
*
|
||||||
* @param $scope
|
* @param $scope
|
||||||
* @param $attribute
|
* @param $attribute
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function getHtmlAttribute($scope, $attribute)
|
function getHtmlAttribute($scope, $attribute)
|
||||||
{
|
{
|
||||||
return theme()->getHtmlAttribute($scope, $attribute);
|
return theme()->getHtmlAttribute($scope, $attribute);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('isUrl')) {
|
if (!function_exists('isUrl')) {
|
||||||
/**
|
/**
|
||||||
* Get HTML attribute based on the scope
|
* Get HTML attribute based on the scope
|
||||||
*
|
*
|
||||||
* @param $url
|
* @param $url
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
function isUrl($url)
|
function isUrl($url)
|
||||||
{
|
{
|
||||||
return filter_var($url, FILTER_VALIDATE_URL);
|
return filter_var($url, FILTER_VALIDATE_URL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('image')) {
|
if (!function_exists('image')) {
|
||||||
/**
|
/**
|
||||||
* Get image url by path
|
* Get image url by path
|
||||||
*
|
*
|
||||||
* @param $path
|
* @param $path
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function image($path)
|
function image($path)
|
||||||
{
|
{
|
||||||
return asset('assets/media/'.$path);
|
return asset('assets/media/' . $path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('getIcon')) {
|
if (!function_exists('getIcon')) {
|
||||||
/**
|
/**
|
||||||
* Get icon
|
* Get icon
|
||||||
*
|
*
|
||||||
* @param $path
|
* @param $path
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getIcon($name, $class = '', $type = '')
|
function getIcon($name, $class = '', $type = '')
|
||||||
{
|
{
|
||||||
return theme()->getIcon($name, $class, $type);
|
return theme()->getIcon($name, $class, $type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function verify_user($id, $passwd, $SERVER_ADDR, $IPUserManager, $portUserManager, $appId)
|
||||||
|
{
|
||||||
|
|
||||||
|
$USERMANPROG = "user_verification.php";
|
||||||
|
$sock = fsockopen("tcp://" . $IPUserManager, $portUserManager, $errno, $errstr, 30);
|
||||||
|
|
||||||
|
|
||||||
|
if (!$sock) die("$errstr ($errno)\n");
|
||||||
|
|
||||||
|
$data = "appsid=" . urlencode($appId) . "&loginid=" . urlencode($id) . "&passwd=" . urlencode($passwd) . "&addr=" . $SERVER_ADDR . "&version=2";
|
||||||
|
|
||||||
|
//echo "data: $data <BR>";
|
||||||
|
|
||||||
|
fwrite($sock, "POST /user_verification_dev.php HTTP/1.0\r\n");
|
||||||
|
fwrite($sock, "Host: $IPUserManager\r\n");
|
||||||
|
fwrite($sock, "Content-type: application/x-www-form-urlencoded\r\n");
|
||||||
|
fwrite($sock, "Content-length: " . strlen($data) . "\r\n");
|
||||||
|
fwrite($sock, "Accept: */*\r\n");
|
||||||
|
fwrite($sock, "\r\n");
|
||||||
|
fwrite($sock, "$data\r\n");
|
||||||
|
fwrite($sock, "\r\n");
|
||||||
|
|
||||||
|
$headers = "";
|
||||||
|
while ($str = trim(fgets($sock, 4096))) $headers .= "$str\n";
|
||||||
|
|
||||||
|
$body = "";
|
||||||
|
while (!feof($sock)) $body .= fgets($sock, 4096);
|
||||||
|
|
||||||
|
|
||||||
|
fclose($sock);
|
||||||
|
|
||||||
|
return decompress($body);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getAllowableScript($sessionMenu)
|
||||||
|
{
|
||||||
|
//$sessionMenu = $_SESSION['MENU'];
|
||||||
|
|
||||||
|
if (!empty($sessionMenu)) {
|
||||||
|
$tempMenuArrayLine = explode('-', $sessionMenu);
|
||||||
|
//print_r($tempMenuArrayLine);
|
||||||
|
if (count($tempMenuArrayLine) > 0) {
|
||||||
|
foreach ($tempMenuArrayLine as $tkey => $tval) {
|
||||||
|
$tempMenuArray = explode('|', $tval);
|
||||||
|
if (count($tempMenuArray) > 0) {
|
||||||
|
foreach ($tempMenuArray as $mkey => $mval) {
|
||||||
|
[$menukey, $menuval] = explode('>', $mval);
|
||||||
|
if ($menukey === 'LINK') {
|
||||||
|
$SCRIPT_ALLOW[$menuval] = 1;
|
||||||
|
}
|
||||||
|
//$menu[$menuCounter][$menukey] = $menuval;
|
||||||
|
}
|
||||||
|
//$menuCounter++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $SCRIPT_ALLOW;
|
||||||
|
}
|
||||||
|
|
||||||
|
function decompress($data)
|
||||||
|
{
|
||||||
|
$text = '';
|
||||||
|
$total = strlen($data);
|
||||||
|
for ($j = 0; $j < $total; $j = $j + 2) {
|
||||||
|
$text .= chr(hexdec(substr($data, $j, 2)));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $text;
|
||||||
|
}
|
||||||
|
|
||||||
|
function compress($data)
|
||||||
|
{
|
||||||
|
$text = '';
|
||||||
|
$total = strlen($data);
|
||||||
|
for ($i = 0; $i < $total; $i++) {
|
||||||
|
$temp = dechex(ord(substr($data, $i, 1)));
|
||||||
|
if (strlen($temp) < 2) {
|
||||||
|
$temp = '0' . $temp;
|
||||||
|
}
|
||||||
|
$text .= $temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return $text;
|
||||||
|
}
|
||||||
|
|
||||||
|
function jsonToView($jsonText = '')
|
||||||
|
{
|
||||||
|
$arr = json_decode($jsonText, true);
|
||||||
|
$html = "";
|
||||||
|
if ($arr && is_array($arr)) {
|
||||||
|
$html .= _arrayToHtmlTableRecursive($arr);
|
||||||
|
}
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _arrayToHtmlTableRecursive($arr)
|
||||||
|
{
|
||||||
|
$str = "<table><tbody>";
|
||||||
|
foreach ($arr as $key => $val) {
|
||||||
|
$str .= "<tr>";
|
||||||
|
$str .= "<td>$key</td>";
|
||||||
|
$str .= "<td>";
|
||||||
|
if (is_array($val)) {
|
||||||
|
if (!empty($val)) {
|
||||||
|
$str .= _arrayToHtmlTableRecursive($val);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$str .= "<strong>$val</strong>";
|
||||||
|
}
|
||||||
|
$str .= "</td></tr>";
|
||||||
|
}
|
||||||
|
$str .= "</tbody></table>";
|
||||||
|
|
||||||
|
return $str;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user