Skip to content

Commit 23791ee

Browse files
committed
V 1.0.6
1 parent 4fd3e13 commit 23791ee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+3615
-494
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ Must be considered while developing StagPHP application, to avoid conflicts.
5454

5555
## Update Log
5656

57+
### V 1.0.5 - Beta Build (10-03-2020)
58+
1. App view section removed - as we are working on new concept
59+
2. App Controller menu removed - as are moving towards the integration of StagOns
60+
3. Super Admin Panel navigation menu updated
61+
62+
### V 1.0.4 - Beta Build (20-02-2020)
63+
1. Update logic optimized
64+
2. Super Admin Panel UI modified including navigation
65+
3. Setup Optimized, multiple fields added, to customize framework during installation
66+
4. Core Modules Optimized
67+
5. Folder structure Modified
68+
6. Security enhanced
69+
5770
### V 1.0.3 - Beta Build (10-01-2020)
5871
1. Several minor bugs fixed
5972
2. Backed enqueue logic created

includes/admin/api/deploy-app.php

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?php
2+
3+
ini_set('upload_max_filesize', '60M');
4+
ini_set('max_execution_time', '999');
5+
ini_set('memory_limit', '128M');
6+
ini_set('post_max_size', '60M');
7+
8+
/** API response template */
9+
stag_include_controller('/functions/response-template.php', 'admin-api');
10+
11+
/** Secure internal api functions */
12+
// stag_include_controller('/functions/secure-request-internal.php', 'admin-api');
13+
14+
/** Include URL Fetcher to fetch URLs */
15+
require_once(STAG_LIB_DIR.'/file-upload/main.php');
16+
17+
/** Include Application Deploy functionality */
18+
require_once(STAG_COMPONENTS_DIR.'/core/update-management/app/deploy-app.php');
19+
20+
function format_file_name($filename){
21+
$file_name_original = str_replace("/.*(\/|\\)/", "", $filename);
22+
$file_name_array = explode('.', $file_name_original);
23+
24+
// File Extension
25+
$extension = $file_name_array[count($file_name_array) - 1];
26+
27+
// var_dump($extension);
28+
29+
// File name without extension
30+
$filename = str_replace('.'.$extension, '', $file_name_original);
31+
$filename = preg_replace('/(^-+)|([^a-zA-Z0-9\-]+)|(-$)|(-{2,})/', "", $filename);
32+
33+
return array(
34+
'name' => $filename,
35+
'ext' => $extension,
36+
'name-ext' => $filename.'.'.$extension
37+
);
38+
}
39+
40+
if(empty($_POST['action'])) error_response(array('description' => 'Invalid request!'));
41+
42+
else if('upload' == $_POST['action']){
43+
/** Upload instance */
44+
$cyz_upload = new cyz_upload($_FILES['zu-upload-field']);
45+
46+
/** Upload argument */
47+
$upload_arg = array(
48+
'file-type-allowed' => 'application',
49+
'extensions-allowed' => 'zip',
50+
'save-as' => 'app',
51+
'save-location' => '/cache/app-archive/'
52+
);
53+
54+
/** Uploading */
55+
$result = $cyz_upload->upload_file($upload_arg);
56+
57+
/** Success */
58+
if(true === $result['status']) {
59+
success_response(array(
60+
'description' => 'Application Uploaded Successfully!',
61+
'result' => array('response' => TRUE)
62+
));
63+
}
64+
65+
/** Error */
66+
else error_response(array(
67+
'description' => 'Application Uploaded Failed: '.$result['description']
68+
));
69+
}
70+
71+
else if('install' == $_POST['action']){
72+
if(deploy_application()) success_response(array(
73+
'description' => 'Application Installed Successfully!',
74+
'result' => array('response' => TRUE)
75+
));
76+
77+
/** Error */
78+
else error_response(array(
79+
'description' => 'Application Installation Failed'
80+
));
81+
}

includes/admin/api/stagon-add.php

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?php
2+
3+
/** API response template */
4+
stag_include_controller('/functions/response-template.php', 'admin-api');
5+
6+
/** Secure internal api functions */
7+
// stag_include_controller('/functions/secure-request-internal.php', 'admin-api');
8+
9+
/** Include URL Fetcher to fetch URLs */
10+
require_once(STAG_LIB_DIR.'/file-upload/main.php');
11+
12+
/** Include StagON Installation and
13+
* update functionality */
14+
require_once(STAG_COMPONENTS_DIR.'/core/update-management/stagon/install-update.php');
15+
16+
function format_file_name($filename){
17+
$file_name_original = str_replace("/.*(\/|\\)/", "", $filename);
18+
$file_name_array = explode('.', $file_name_original);
19+
20+
// File Extension
21+
$extension = $file_name_array[count($file_name_array) - 1];
22+
23+
// var_dump($extension);
24+
25+
// File name without extension
26+
$filename = str_replace('.'.$extension, '', $file_name_original);
27+
$filename = preg_replace('/(^-+)|([^a-zA-Z0-9\-]+)|(-$)|(-{2,})/', "", $filename);
28+
29+
return array(
30+
'name' => $filename,
31+
'ext' => $extension,
32+
'name-ext' => $filename.'.'.$extension
33+
);
34+
}
35+
36+
if(empty($_POST['action'])) error_response(array('description' => 'Invalid request!'));
37+
38+
else if('upload' == $_POST['action']){
39+
40+
if(!isset($_POST['zu-file-name']) && empty($_POST['zu-file-name'])) error_response(array(
41+
'description' => 'Stagon Uploaded Failed: Filename not specified'
42+
));
43+
44+
/** File Name */
45+
$file_name = format_file_name($_POST['zu-file-name']);
46+
47+
/** Upload instance */
48+
$cyz_upload = new cyz_upload($_FILES['zu-upload-field']);
49+
50+
/** Upload argument */
51+
$upload_arg = array(
52+
'file-type-allowed' => 'application',
53+
'extensions-allowed' => 'zip',
54+
'save-as' => $file_name['name'],
55+
'save-location' => '/cache/stagons-archive/'
56+
);
57+
58+
/** Uploading */
59+
$result = $cyz_upload->upload_file($upload_arg);
60+
61+
/** Success */
62+
if(true === $result['status']) {
63+
$_SESSION['stagon_file_name'] = $file_name['name'];
64+
65+
success_response(array(
66+
'description' => 'Stagon Uploaded Successfully!',
67+
'result' => array('response' => TRUE)
68+
));
69+
}
70+
71+
/** Error */
72+
else error_response(array(
73+
'description' => 'Stagon Uploaded Failed: '.$result['description']
74+
));
75+
}
76+
77+
else if('install' == $_POST['action']){
78+
if(!isset($_SESSION['stagon_file_name']) && empty($_SESSION['stagon_file_name']))
79+
error_response(array('description' => 'Invalid request!'));;
80+
81+
if(install_stagon($_SESSION['stagon_file_name'])) success_response(array(
82+
'description' => 'Stagon Installed Successfully!',
83+
'result' => array('response' => TRUE)
84+
));
85+
86+
/** Error */
87+
else error_response(array(
88+
'description' => 'Stagon Installation Failed'
89+
));
90+
}

includes/admin/api/upload-application-package.php

Lines changed: 0 additions & 45 deletions
This file was deleted.

includes/admin/assets/css/components/_elements.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44
@import 'elements/tabs';
55
@import 'elements/stagon-block';
66
@import 'elements/loaders';
7-
@import 'elements/miscellaneous-items';
7+
@import 'elements/miscellaneous-items';
8+
@import 'elements/zu-block';
9+
@import 'elements/ajax-loader';
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
.box-loader {
2+
position: relative;
3+
height: 100px;
4+
line-height: 100px;
5+
text-align: center;
6+
7+
.ajax-loader {
8+
display: inline-block;
9+
height: 8px;
10+
width: 8px;
11+
vertical-align: middle;
12+
pointer-events: none;
13+
color: #00ACC1;
14+
box-shadow: -16px -16px 0 8px #00ACC1, -16px -16px 0 8px #00ACC1, -16px -16px 0 8px #00ACC1, -16px -16px 0 8px #00ACC1;
15+
-webkit-animation: ajax-loader-animation 6s infinite, ajax-loader-rotate-animation 12s infinite;
16+
animation: ajax-loader-animation 6s infinite, ajax-loader-rotate-animation 12s infinite;
17+
}
18+
}
19+
20+
@keyframes ajax-loader-animation {
21+
0% {
22+
box-shadow: -16px -16px 0 8px #00ACC1, -16px -16px 0 8px #00ACC1, -16px -16px 0 8px #00ACC1, -16px -16px 0 8px #00ACC1;
23+
}
24+
25+
8.33% {
26+
box-shadow: -16px -16px 0 8px #00ACC1, 16px -16px 0 8px #00ACC1, 16px -16px 0 8px #00ACC1, 16px -16px 0 8px #00ACC1;
27+
}
28+
29+
16.66% {
30+
box-shadow: -16px -16px 0 8px #00ACC1, 16px -16px 0 8px #00ACC1, 16px 16px 0 8px #00ACC1, 16px 16px 0 8px #00ACC1;
31+
}
32+
33+
24.99% {
34+
box-shadow: -16px -16px 0 8px #00ACC1, 16px -16px 0 8px #00ACC1, 16px 16px 0 8px #00ACC1, -16px 16px 0 8px #00ACC1;
35+
}
36+
37+
33.32% {
38+
box-shadow: -16px -16px 0 8px #00ACC1, 16px -16px 0 8px #00ACC1, 16px 16px 0 8px #00ACC1, -16px -16px 0 8px #00ACC1;
39+
}
40+
41+
41.65% {
42+
box-shadow: 16px -16px 0 8px #00ACC1, 16px -16px 0 8px #00ACC1, 16px 16px 0 8px #00ACC1, 16px -16px 0 8px #00ACC1;
43+
}
44+
45+
49.98% {
46+
box-shadow: 16px 16px 0 8px #00ACC1, 16px 16px 0 8px #00ACC1, 16px 16px 0 8px #00ACC1, 16px 16px 0 8px #00ACC1;
47+
}
48+
49+
58.31% {
50+
box-shadow: -16px 16px 0 8px #00ACC1, -16px 16px 0 8px #00ACC1, 16px 16px 0 8px #00ACC1, -16px 16px 0 8px #00ACC1;
51+
}
52+
53+
66.64% {
54+
box-shadow: -16px -16px 0 8px #00ACC1, -16px -16px 0 8px #00ACC1, 16px 16px 0 8px #00ACC1, -16px 16px 0 8px #00ACC1;
55+
}
56+
57+
74.97% {
58+
box-shadow: -16px -16px 0 8px #00ACC1, 16px -16px 0 8px #00ACC1, 16px 16px 0 8px #00ACC1, -16px 16px 0 8px #00ACC1;
59+
}
60+
61+
83.3% {
62+
box-shadow: -16px -16px 0 8px #00ACC1, 16px 16px 0 8px #00ACC1, 16px 16px 0 8px #00ACC1, -16px 16px 0 8px #00ACC1;
63+
}
64+
65+
91.63% {
66+
box-shadow: -16px -16px 0 8px #00ACC1, -16px 16px 0 8px #00ACC1, -16px 16px 0 8px #00ACC1, -16px 16px 0 8px #00ACC1;
67+
}
68+
69+
100% {
70+
box-shadow: -16px -16px 0 8px #00ACC1, -16px -16px 0 8px #00ACC1, -16px -16px 0 8px #00ACC1, -16px -16px 0 8px #00ACC1;
71+
}
72+
}
73+
74+
@keyframes ajax-loader-rotate-animation{
75+
0% {
76+
transform: rotate(0deg);
77+
}
78+
24.99% {
79+
transform: rotate(0deg);
80+
}
81+
25% {
82+
transform: rotate(90deg);
83+
}
84+
49.99% {
85+
transform: rotate(90deg);
86+
}
87+
50% {
88+
transform: rotate(180deg);
89+
}
90+
74.99% {
91+
transform: rotate(180deg);
92+
}
93+
75% {
94+
transform: rotate(270deg);
95+
}
96+
99.99% {
97+
transform: rotate(270deg);
98+
}
99+
100% {
100+
transform: rotate(360deg);
101+
}
102+
}

includes/admin/assets/css/components/elements/_miscellaneous-items.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@
1515
background-color: #00ACC1;
1616
}
1717
}
18+
19+
.dropzone {
20+
border: 2px dashed rgba(0,0,0,0.2) !important;
21+
border-radius: 4px;
22+
}

0 commit comments

Comments
 (0)