Skip to content

Commit

Permalink
0.6.7
Browse files Browse the repository at this point in the history
- Removed forso.php crutch
- Added basic MVC support; Superior\ControllerHandler similar to routers
- Many fixes for MyPanel
- Fixed Permission allow for admins
  • Loading branch information
Farrien committed Oct 12, 2018
1 parent 464fdf1 commit d213333
Show file tree
Hide file tree
Showing 49 changed files with 963 additions and 425 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ vc/documents-vc.php
client/promo.css
vc/promo-vc.php
public/promo.php
mypanel/index_dont_use.php
vc/forso.php
support/sanity_origin.sql
3 changes: 3 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
AddDefaultCharset utf-8

ErrorDocument 404 /errordocument/
ErrorDocument 403 /errordocument/

<Files *.php>
Order Deny,Allow
Deny from all
Expand Down
5 changes: 4 additions & 1 deletion app_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ OWNER_NAME=Farrien
APP_NAME=SimpleApp
LOGO_ADDR=
IGNORE_HTMLTAGS=1
PATCH_VER=0.6.6
PATCH_VER=0.6.7
PATCH_NAME=TOBEYOND
REQUESTS_DETECTING=

Expand All @@ -26,6 +26,9 @@ TPL_PAGE_FOOTER=page_parts/footer.tpl
SUPPORT_PHONE=88005553535
SMS_NOTIFICATION_RECEIVER_PHONE=

;Sanity Content

;Sanity Sales
SHOP_SHOW_RELATED_PRODUCTS=1
SHOP_CONTACT_PHONE=89174672350
SHOP_MAX_SHOWN_ITEMS_PAGINATION=16
Expand Down
8 changes: 6 additions & 2 deletions client/app-shop.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ if (!bin) {
sn.shop.orders.setItem('bin', JSON.stringify(temp_bin));
}

sn.shop.addToCart = function(product_id) {

}


sn.shop.addToOrder = function(product_id) {
let json_bin = sn.shop.orders.getItem('bin');
Expand All @@ -22,11 +26,11 @@ sn.shop.clearOrder = function() {

sn.shop.completeOrder = function() {
mr.Query('../get/ShopBasket/performNewOrder', {items : sn.shop.orders.getItem('bin')}, function(response) {
// console.log(response);
console.log(response);
var r = JSON.parse(response);

if (r.result == true) {
sn.shop.clearOrder();
// sn.shop.clearOrder();
}
});
}
Expand Down
67 changes: 66 additions & 1 deletion client/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,68 @@ button.xver:hover {
border-left: 1px solid #d3d3d3;
}

.shop-goods-item-bottom-items {
position: absolute;
width: 100%;
bottom: 0;
padding: 12px 0;
}

.shop-goods-item-buy-button {
font-family: 'SanFranciscoDisplay';
font-size: 15px;
font-weight: 500;
letter-spacing: .02em;
background: transparent;
color: #ff2142;
position: relative;
text-transform: uppercase;
display: inline-block;
line-height: 22px;
cursor: pointer;
border: 1px solid #000;
padding: 0 24px 0 8px;
box-sizing: border-box;
}

.shop-goods-item-buy-button:hover {
background-color: #ff2142;
color: #fff;
}

.shop-goods-item-buy-button.added-to-cart {
opacity: .6;
pointer-events: none;
background-color: #ff2142;
border-color: #ff2142;
color: #fff;
padding: 0 8px;
transition: 100ms all linear;
}

.shop-goods-item-buy-button.added-to-cart:after {
content: none;
}

.shop-goods-item-buy-button:hover:after {
border-left-color: #fff;
}

.shop-goods-item-buy-button:after {
content: '';
position: absolute;
right: 10px;
bottom: calc(50% - 4px);
width: 0;
height: 0;
border-top: 4px solid transparent;
border-bottom: 4px solid transparent;
border-left: 4px solid #ff2142;
}

.shop-shopping-goods {
display: flex;
flex-wrap: wrap;

}

.shop-shopping-goods .shop-shipping-goods-item {
Expand All @@ -196,8 +254,15 @@ button.xver:hover {
color: #444;
text-align: center;
position: relative;
padding-bottom: 24px;
}

.shop-shopping-goods .shop-shipping-goods-item.unavailable {

}

.shop-shopping-goods .shop-shipping-goods-item a {display: block;}

.shop-shopping-goods .shop-shipping-goods-item .product_cover {
width: 100%;
padding-bottom: 100%;
Expand Down
50 changes: 50 additions & 0 deletions client/sn-design.css
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,35 @@ label.toRight input[type="checkbox"].switcher {
margin-right: 0;
}

.FileForm {
position: relative;
overflow: hidden;
}

.FileForm input[type="file"].FileForm_input {
overflow: hidden;
display: block;
opacity: 0;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
}

.FileForm .FileForm_button {
display: block;
background-color: var(--snBlue-color);
color: #fff;
font-size: 100%;
font-family: inherit;
line-height: 40px;
padding: 0 16px;
text-align: center;
}

.RangeForm {

}
Expand Down Expand Up @@ -1212,6 +1241,27 @@ button.whiteBlue {
.ContentOverlay.nicePads {padding: 16px;}
.ContentOverlay.nicePads:last-child {padding-right: 16px !important;}


.FileForm .FileForm_button {

background-color: #fff;
color: var(--snBlue-color);
border: 2px solid var(--snBlue-color);
border-radius: 4px;
line-height: 32px;
box-sizing: border-box;
font-weight: 600;
}
.FileForm .FileForm_button:hover {
cursor: pointer;
}
.FileForm input[type="file"] {
visibility: hidden;
}
.FileForm input[type="file"]:hover {
cursor: pointer;
}

/* Spoiler elements */
.Spoiler {
border-radius: 6px;
Expand Down
51 changes: 51 additions & 0 deletions client/sn-design.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,49 @@
mr.Dom(function() {
initFileForms();
initSelectForms();
initMaterialButtons();
initRangeForms();
initSpoilers();
});

function initFileForms() {
if (!document.querySelector('.FileForm')) return;

var x = document.querySelectorAll('.FileForm');
for (var i = 0; i < x.length; i++) {
x[i].innerHTML = '';

let paramAccept = x[i].getAttribute('p-accept');
let paramName = x[i].getAttribute('p-name');

let inputFile = document.createElement('input');
inputFile.setAttribute('type', 'file');
inputFile.setAttribute('name', paramName);
inputFile.setAttribute('class', 'FileForm_input');
inputFile.setAttribute('accept', paramAccept);
inputFile = x[i].insertBefore(inputFile, x[i].firstChild);

let btn = document.createElement('div');
btn.setAttribute('class', 'FileForm_button');
btn.innerText = 'Upload a photo';
btn = x[i].insertBefore(btn, x[i].firstChild);

let xi = x[i].querySelector('input[type="file"]')
btn.onclick = function() {
if (!xi) return;
xi.click();
};

x[i].removeAttribute('p-accept');
x[i].removeAttribute('p-name');
}

console.log('[SN Design] File forms are created.');
}

function initMaterialButtons() {
if (!document.querySelector('.button.xver.material')) return;

var x, j, selElmnt, b, c;
x = document.querySelectorAll('button.xver.material');
for (var i = 0; i < x.length; i++) {
Expand Down Expand Up @@ -46,9 +84,12 @@ function initMaterialButtons() {

};
}
console.log('[SN Design] Dynamic light buttons are created.');
}

function initSelectForms() {
if (!document.querySelector('.SelectForm')) return;

var x, i, j, selElmnt, a, b, c;
x = document.getElementsByClassName("SelectForm");
for (i = 0; i < x.length; i++) {
Expand Down Expand Up @@ -102,9 +143,13 @@ function initSelectForms() {
this.parentNode.querySelectorAll('.Variables')[0].classList.toggle('select-hide');
};
}

console.log('[SN Design] Select forms are created.');
}

function initRangeForms() {
if (!document.querySelector('.RangeForm')) return;

var x = document.getElementsByClassName('RangeForm');
for (i = 0; i < x.length; i++) {
let xrf_vn = x[i].querySelector('.RangeForm_valueNode');
Expand Down Expand Up @@ -132,9 +177,13 @@ function initRangeForms() {
});
}
}

console.log('[SN Design] Range forms are created.');
}

function initSpoilers() {
if (!document.querySelector('.Spoiler')) return;

let x = document.querySelectorAll('.Spoiler');
for (var i = 0; i < x.length; i++) {
let s = x[i];
Expand All @@ -151,6 +200,8 @@ function initSpoilers() {
}
}
}

console.log('[SN Design] Spoilers are created.');
}

function closeAllSelect(elmnt) {
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"require": {
"php":">=5.3.0",
"setasign/fpdi-tcpdf": "2.0"
"setasign/fpdi-tcpdf": "2.0",
"nesbot/carbon": "^2.3"
}
}
8 changes: 0 additions & 8 deletions database.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@

use SN\Management as SN;

/*
try {
$pdo_db = new PDO('mysql:host='.DATABASE_SETTING_HOSTNAME.';dbname='.DATABASE_SETTING_DBNAME.';charset=utf8;', DATABASE_SETTING_USER, DATABASE_SETTING_PASSWORD);
} catch (PDOException $e) {
$SN->AddErr();
$SN->ExplainLastError($e->getMessage());
}*/

$databaseParams = [
'host' => DATABASE_SETTING_HOSTNAME,
'port' => DATABASE_SETTING_HOSTPORT,
Expand Down
Loading

0 comments on commit d213333

Please sign in to comment.