Skip to content

Commit

Permalink
Update 1.6.38
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmoud Ibrahim authored and Mahmoud Ibrahim committed Feb 26, 2022
1 parent 670e8ac commit 9db7bae
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 77 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -38,7 +38,7 @@

`Package Name: IT`

`Version: 1.6.37`
`Version: 1.6.38`

`Offline Docs: 1.1` - [Online Docs](https://it.phpanonymous.com/docs)

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -22,7 +22,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.6.37.x-dev"
"dev-master": "1.6.38.x-dev"
},
"laravel": {
"providers": [
Expand All @@ -33,7 +33,7 @@
}
}
},
"version":"1.6.37",
"version":"1.6.38",
"minimum-stability": "dev",
"prefer-stable": true
}
3 changes: 1 addition & 2 deletions it/environment/resources/views/admin/ajax.blade.php
Expand Up @@ -71,14 +71,13 @@
@if($selectedvalue > 0)
var selectIDValue = $('#'+selectID+' option:selected').val();
$.ajax({
url:'{{ $url }}',
dataType:'html',
type:'post',
data:{
_token:'{{ csrf_token() }}',
'{{ $selectID }}': '{{ $selectedvalue }}',
'{{ $selectID }}': '{{ $parentValue }}',
select:'{{ $selectedvalue }}'
},
beforeSend: function(){
Expand Down
9 changes: 9 additions & 0 deletions it/environment/resources/views/admin/dropzone.blade.php
Expand Up @@ -124,9 +124,13 @@
var myDropzone{{$dz_param}} = new Dropzone(
"#drop_{{ $dz_param }}",
{ // Make the whole body a dropzone
timeout: "999999",
url: "{{ aurl($route.'/upload/multi') }}", // Set the url
paramName:"{{ $dz_param }}",
// crossDomain: true,
// format: "json",
thumbnailWidth: '{{ !empty($thumbnailWidth)?$thumbnailWidth:80 }}',
thumbnailHeight: '{{ !empty($thumbnailHeight)?$thumbnailHeight:80 }}',
parallelUploads: '{{ !empty($parallelUploads)?$parallelUploads:20 }}',
Expand All @@ -137,6 +141,11 @@
autoQueue: {{ !empty($autoQueue)?$autoQueue:'false' }} , // Make sure the files aren't queued until manually added
previewsContainer: "#previews_{{ $dz_param }}", // Define the container to display the previews
clickable: ".fileinput-button_{{ $dz_param }}", // Define the element that should be used as click trigger to select files.
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}',
'X-XSRF-TOKEN': '{{ csrf_token() }}',
'x-csrftoken': '{{ csrf_token() }}',
},
@if(!empty($acceptedMimeTypes))
acceptedMimeTypes:"{{ str_replace('|',',',$acceptedMimeTypes) }}",
Expand Down
144 changes: 72 additions & 72 deletions it/helper/it.php
Expand Up @@ -8,13 +8,13 @@ function disable_folder_list() {
if (!function_exists('getnamespace')) {
function getnamespace($namespaces) {
$namespaces = str_replace('App/Http/Controllers/', '', str_replace('\\', '/', $namespaces));
$namespaces = app_path('Http/Controllers/' . $namespaces);
foreach (array_filter(glob($namespaces . '/*'), 'is_dir') as $namespace) {
$controller_namespace_prefix = str_replace('/', '\\', 'App\\' . explode('app', $namespace)[1]);
$namespaces = app_path('Http/Controllers/'.$namespaces);
foreach (array_filter(glob($namespaces.'/*'), 'is_dir') as $namespace) {
$controller_namespace_prefix = str_replace('/', '\\', 'App\\'.explode('app', $namespace)[1]);
$controller_namespace_prefix = str_replace('\\\\', '\\', $controller_namespace_prefix);
echo getnamespace($namespaces);
echo $namespace;
echo '<option value="' . $controller_namespace_prefix . '">' . $controller_namespace_prefix . '</option>';
echo '<option value="'.$controller_namespace_prefix.'">'.$controller_namespace_prefix.'</option>';
}

}
Expand All @@ -23,20 +23,20 @@ function getnamespace($namespaces) {
if (!function_exists('get_model_baboon')) {
function get_model_baboon($model_list) {
$model_list = str_replace('App/Http/Controllers/', '', str_replace('\\', '/', $model_list));
$model_list = app_path('Http/Controllers/' . $model_list);
foreach (array_filter(glob($model_list . '/*'), 'is_dir') as $namespace) {
$model_list_files = str_replace('/', '\\', 'App\\' . explode('app', $namespace)[1]);
$model_list = app_path('Http/Controllers/'.$model_list);
foreach (array_filter(glob($model_list.'/*'), 'is_dir') as $namespace) {
$model_list_files = str_replace('/', '\\', 'App\\'.explode('app', $namespace)[1]);
$model_list_files = str_replace('\\\\', '\\', $model_list_files);
echo get_model_baboon($model_list);
echo $namespace;
echo '<optgroup label="' . $model_list_files . '">' . $model_list_files . '</optgroup>';
echo '<optgroup label="'.$model_list_files.'">'.$model_list_files.'</optgroup>';
}
}
}

if (!function_exists('check_package')) {
function check_package($packageName) {
$file = base_path('composer.lock');
$file = base_path('composer.lock');
$packages = json_decode(file_get_contents($file), true)['packages'];
foreach ($packages as $package) {
if ($package['name'] == $packageName) {
Expand All @@ -56,26 +56,26 @@ function it_int() {
if (!function_exists('it_views')) {
// Init & RUN Baboon Module Class
function it_views($view, $data = []) {
return view('it::' . $view, $data);
return view('it::'.$view, $data);
}
}

if (!function_exists('it_version_message')) {
function it_version_message() {
$version = '[it v ' . it_version() . ']';
$version = '[it v '.it_version().']';
app()->singleton('it_version_message', function () use ($version) {
return $version;
});
return $version;
});
return $version;
}
}

if (!function_exists('it_version')) {
function it_version() {
$version = '1.6.37';
$version = '1.6.38';
app()->singleton('it_version', function () use ($version) {
return $version;
});
return $version;
});
return $version;
}
}
Expand All @@ -94,66 +94,66 @@ function it_laravelversion() {

if (!function_exists('it_trans')) {
function it_trans($trans, $choose = []) {
return Lang::get('it::' . $trans, $choose);
return Lang::get('it::'.$trans, $choose);
}
}

if (!function_exists('it_des')) {
function it_des($path) {
return url('it_des/' . $path);
return url('it_des/'.$path);
}
}

if (!function_exists('it_permissions')) {
function it_permissions($path) {
$perms = fileperms($path);

switch ($perms & 0xF000) {
case 0xC000: // socket
$info = 's';
break;
case 0xA000: // symbolic link
$info = 'l';
break;
case 0x8000: // regular
$info = 'r';
break;
case 0x6000: // block special
$info = 'b';
break;
case 0x4000: // directory
$info = 'd';
break;
case 0x2000: // character special
$info = 'c';
break;
case 0x1000: // FIFO pipe
$info = 'p';
break;
default: // unknown
$info = 'u';
switch ($perms&0xF000) {
case 0xC000:// socket
$info = 's';
break;
case 0xA000:// symbolic link
$info = 'l';
break;
case 0x8000:// regular
$info = 'r';
break;
case 0x6000:// block special
$info = 'b';
break;
case 0x4000:// directory
$info = 'd';
break;
case 0x2000:// character special
$info = 'c';
break;
case 0x1000:// FIFO pipe
$info = 'p';
break;
default:// unknown
$info = 'u';
}

// Owner
$info .= (($perms & 0x0100) ? 'r' : '-');
$info .= (($perms & 0x0080) ? 'w' : '-');
$info .= (($perms & 0x0040) ?
(($perms & 0x0800) ? 's' : 'x') :
(($perms & 0x0800) ? 'S' : '-'));
$info .= (($perms&0x0100)?'r':'-');
$info .= (($perms&0x0080)?'w':'-');
$info .= (($perms&0x0040)?
(($perms&0x0800)?'s':'x'):
(($perms&0x0800)?'S':'-'));

// Group
$info .= (($perms & 0x0020) ? 'r' : '-');
$info .= (($perms & 0x0010) ? 'w' : '-');
$info .= (($perms & 0x0008) ?
(($perms & 0x0400) ? 's' : 'x') :
(($perms & 0x0400) ? 'S' : '-'));
$info .= (($perms&0x0020)?'r':'-');
$info .= (($perms&0x0010)?'w':'-');
$info .= (($perms&0x0008)?
(($perms&0x0400)?'s':'x'):
(($perms&0x0400)?'S':'-'));

// World
$info .= (($perms & 0x0004) ? 'r' : '-');
$info .= (($perms & 0x0002) ? 'w' : '-');
$info .= (($perms & 0x0001) ?
(($perms & 0x0200) ? 't' : 'x') :
(($perms & 0x0200) ? 'T' : '-'));
$info .= (($perms&0x0004)?'r':'-');
$info .= (($perms&0x0002)?'w':'-');
$info .= (($perms&0x0001)?
(($perms&0x0200)?'t':'x'):
(($perms&0x0200)?'T':'-'));

return $info;
}
Expand All @@ -164,30 +164,30 @@ function it_permissions($path) {
function it_rule_convention($attribute, $value, $fail) {
$i = explode('.', $attribute)[1];
// Name Column
$name = '(<b style="color:#ffa306">' . request('col_name')[$i] . ' - ' . request(explode('.', $attribute)[0])[$i] . '</b>)';
$name = '(<b style="color:#ffa306">'.request('col_name')[$i].' - '.request(explode('.', $attribute)[0])[$i].'</b>)';

if (in_array(request('col_type')[$i], ['text', 'number', 'email', 'url', 'textarea', 'textarea_ckeditor', 'file', 'dropzone', 'password', 'date', 'date_time', 'time', 'timestamp', 'color'])) {
preg_match("/[^A-Za-z0-9'_' ']/", $value) ?
$fail($name . 'There should not be any signs such as (!@#$%^&*()|><) only numbers and letters')
: '';
preg_match("/[^A-Za-z0-9'_' ']/", $value)?
$fail($name.'There should not be any signs such as (!@#$%^&*()|><) only numbers and letters')
:'';
} elseif (in_array(request('col_type')[$i], ['checkbox', 'radio'])) {
$secound_value = explode('#', $value);

!preg_match("/#/i", $value) || empty($secound_value[1]) ?
$fail($name . ' There should have signs such as (column_name#value)')
: '';
!preg_match("/#/i", $value) || empty($secound_value[1])?
$fail($name.' There should have signs such as (column_name#value)')
:'';
} elseif (in_array(request('col_type')[$i], ['select'])) {
$secound_value = explode('|', $value);
!preg_match('/(\d+)\+(\d+)|,/i', $value) || empty($secound_value[1]) ?
$fail($name . ' There should have signs such as (status|accept,Accept/pending,Pending) or ( user_id|App\Models\User::pluck("name","id") )')
: '';
!preg_match('/(\d+)\+(\d+)|,/i', $value) || empty($secound_value[1])?
$fail($name.' There should have signs such as (status|accept,Accept/pending,Pending) or ( user_id|App\Models\User::pluck("name","id") )')
:'';

// Scan if have forgin key and exisit pluck model
if (preg_match('/App\\\\/i', request(explode('.', $attribute)[0])[$i])) {
if (empty(request('references' . $i)) || empty(request('forgin_table_name' . $i))) {
$fail($name . ' Should be complete Schema Relation add References and Table Name');
if (empty(request('references'.$i)) || empty(request('forgin_table_name'.$i))) {
$fail($name.' Should be complete Schema Relation add References and Table Name');
} elseif (empty(request('schema_name')) || !in_array($secound_value[0], request('schema_name'))) {
$fail($name . ' click releations tab and add new relation key ' . $secound_value[0] . ' and choose model from dropdown ');
$fail($name.' click releations tab and add new relation key '.$secound_value[0].' and choose model from dropdown ');
}
}
}
Expand All @@ -197,7 +197,7 @@ function it_rule_convention($attribute, $value, $fail) {

if (!function_exists('checkIfExisitValue')) {
function checkIfExisitValue($request_name, $value) {
return !empty(request($request_name)) && in_array($value, request($request_name)) ? true : false;
return !empty(request($request_name)) && in_array($value, request($request_name))?true:false;
}
}
if (!function_exists('api_check')) {
Expand All @@ -217,6 +217,6 @@ function api_check($name) {

if (!function_exists('faker_locale')) {
function faker_locale($val, $module_data) {
return !empty($module_data) && !empty($module_data->faker_local) && $module_data->faker_local == $val ? true : false;
return !empty($module_data) && !empty($module_data->faker_local) && $module_data->faker_local == $val?true:false;
}
}
9 changes: 9 additions & 0 deletions it/patch_update/resources/views/admin/dropzone.blade.baboon
Expand Up @@ -124,9 +124,13 @@ $temp_id = !empty(request('temp_id'))?request('temp_id'):(time()*rand(0000,9999)

var myDropzone{{$dz_param}} = new Dropzone(
"#drop_{{ $dz_param }}",

{ // Make the whole body a dropzone
timeout: "999999",
url: "{{ aurl($route.'/upload/multi') }}", // Set the url
paramName:"{{ $dz_param }}",
// crossDomain: true,
// format: "json",
thumbnailWidth: '{{ !empty($thumbnailWidth)?$thumbnailWidth:80 }}',
thumbnailHeight: '{{ !empty($thumbnailHeight)?$thumbnailHeight:80 }}',
parallelUploads: '{{ !empty($parallelUploads)?$parallelUploads:20 }}',
Expand All @@ -137,6 +141,11 @@ $temp_id = !empty(request('temp_id'))?request('temp_id'):(time()*rand(0000,9999)
autoQueue: {{ !empty($autoQueue)?$autoQueue:'false' }} , // Make sure the files aren't queued until manually added
previewsContainer: "#previews_{{ $dz_param }}", // Define the container to display the previews
clickable: ".fileinput-button_{{ $dz_param }}", // Define the element that should be used as click trigger to select files.
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}',
'X-XSRF-TOKEN': '{{ csrf_token() }}',
'x-csrftoken': '{{ csrf_token() }}',
},

@if(!empty($acceptedMimeTypes))
acceptedMimeTypes:"{{ str_replace('|',',',$acceptedMimeTypes) }}",
Expand Down

0 comments on commit 9db7bae

Please sign in to comment.