first commit

This commit is contained in:
2024-04-11 10:58:06 +02:00
commit 146bdb0b14
5691 changed files with 800415 additions and 0 deletions

374
.htaccess Normal file
View File

@@ -0,0 +1,374 @@
RewriteEngine On
RewriteBase /
Options +FollowSymlinks
Options -Indexes
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{SERVER_PORT} !=443
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=permanent]
ErrorDocument 404 /404.html
RewriteCond %{REQUEST_URI} !^(.*)/libraries/(.*) [NC]
RewriteCond %{REQUEST_URI} !^(.*)/css/(.*) [NC]
RewriteRule ^admin/([^/]*)/([^/]*)/(.*)$ admin/index.php?module=$1&action=$2&$3 [L]
RewriteRule ^admin/$ admin/index.php [L]
RewriteRule ^wyszukiwarka$ index.php?search=true&lang=pl [L]
RewriteRule ^wersja-tymczasowa$ index.php?devel=true&lang=pl [L]
RewriteRule ^pixieset/(.*)$ index.php?module=articles&action=image&hash=$1 [L]
RewriteRule ^pixieset-wszystkie/(.*)$ index.php?module=articles&action=images_download&hash=$1 [L]
RewriteRule ^audyt-seo/wynik$ index.php?module=auditSEO&action=main_view&%{QUERY_STRING} [L]
RewriteCond %{REQUEST_URI} ^/auditSEO/(.*) [NC]
RewriteRule ^([^/]*)/([^/]*)/(.*)$ index.php?module=$1&action=$2&$3 [L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index.php
RewriteRule ^ /%1 [R=301,L]
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 year"
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType image/x-icon "access plus 1 week"
ExpiresByType text/x-component "access plus 1 year"
ExpiresByType text/html "access plus 0 seconds"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
ExpiresByType text/cache-manifest "access plus 0 seconds"
ExpiresByType audio/ogg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType video/mp4 "access plus 1 year"
ExpiresByType video/ogg "access plus 1 year"
ExpiresByType video/webm "access plus 1 year"
ExpiresByType application/atom+xml "access plus 1 hour"
ExpiresByType application/rss+xml "access plus 1 hour"
ExpiresByType application/font-woff "access plus 1 year"
ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
ExpiresByType application/x-font-ttf "access plus 1 year"
ExpiresByType font/opentype "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
</IfModule>
<Files *.conf>
Order Deny,Allow
Deny from all
</Files>
<Files *.log>
Order Deny,Allow
Deny from all
</Files>
<Files *.ini>
Order Deny,Allow
Deny from all
</Files>
RewriteRule ^pl/$ index.php?a=change_language&id=pl [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid|hash)=[^&]+(&.*)?
RewriteRule ^$ index.php?a=page&id=1&lang=pl&%{QUERY_STRING} [L]
RewriteCond %{REQUEST_URI} ^/home$
RewriteRule ^(.*)$ https://kobcrane-montaze.pl/ [R=301,L]
RewriteCond %{REQUEST_URI} ^/home-s-1$
RewriteRule ^(.*)$ https://kobcrane-montaze.pl/ [R=301,L]
RewriteCond %{REQUEST_URI} "^/$"
RewriteRule ^$ index.php?a=page&id=1&lang=pl [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^home$ index.php?a=page&id=1&lang=pl&%{QUERY_STRING} [L]
RewriteRule ^home-s-1$ home [R=301,L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^home-s-([0-9]+)$ index.php?a=page&id=1&lang=pl&bs=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule home %{REQUEST_URI}? [R=301,L]
RewriteRule ^home$ index.php?a=page&id=1&lang=pl [L]
RewriteRule ^home-s-([0-9]+)$ index.php?a=page&id=1&lang=pl&bs=$1 [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^produkty$ index.php?a=page&id=8&lang=pl&%{QUERY_STRING} [L]
RewriteRule ^produkty-s-1$ produkty [R=301,L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^produkty-s-([0-9]+)$ index.php?a=page&id=8&lang=pl&bs=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule produkty %{REQUEST_URI}? [R=301,L]
RewriteRule ^produkty$ index.php?a=page&id=8&lang=pl [L]
RewriteRule ^produkty-s-([0-9]+)$ index.php?a=page&id=8&lang=pl&bs=$1 [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^aktualnoci$ index.php?a=page&id=2&lang=pl&%{QUERY_STRING} [L]
RewriteRule ^aktualnoci-s-1$ aktualnoci [R=301,L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^aktualnoci-s-([0-9]+)$ index.php?a=page&id=2&lang=pl&bs=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule aktualnoci %{REQUEST_URI}? [R=301,L]
RewriteRule ^aktualnoci$ index.php?a=page&id=2&lang=pl [L]
RewriteRule ^aktualnoci-s-([0-9]+)$ index.php?a=page&id=2&lang=pl&bs=$1 [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^podnosniki-teleskopowe$ index.php?a=page&id=13&lang=pl&%{QUERY_STRING} [L]
RewriteRule ^podnosniki-teleskopowe-s-1$ podnosniki-teleskopowe [R=301,L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^podnosniki-teleskopowe-s-([0-9]+)$ index.php?a=page&id=13&lang=pl&bs=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule podnosniki-teleskopowe %{REQUEST_URI}? [R=301,L]
RewriteRule ^podnosniki-teleskopowe$ index.php?a=page&id=13&lang=pl [L]
RewriteRule ^podnosniki-teleskopowe-s-([0-9]+)$ index.php?a=page&id=13&lang=pl&bs=$1 [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^o-firmie$ index.php?a=page&id=3&lang=pl&%{QUERY_STRING} [L]
RewriteRule ^o-firmie-s-1$ o-firmie [R=301,L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^o-firmie-s-([0-9]+)$ index.php?a=page&id=3&lang=pl&bs=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule o-firmie %{REQUEST_URI}? [R=301,L]
RewriteRule ^o-firmie$ index.php?a=page&id=3&lang=pl [L]
RewriteRule ^o-firmie-s-([0-9]+)$ index.php?a=page&id=3&lang=pl&bs=$1 [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^podnosniki-przegubowo-teleskopowe$ index.php?a=page&id=14&lang=pl&%{QUERY_STRING} [L]
RewriteRule ^podnosniki-przegubowo-teleskopowe-s-1$ podnosniki-przegubowo-teleskopowe [R=301,L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^podnosniki-przegubowo-teleskopowe-s-([0-9]+)$ index.php?a=page&id=14&lang=pl&bs=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule podnosniki-przegubowo-teleskopowe %{REQUEST_URI}? [R=301,L]
RewriteRule ^podnosniki-przegubowo-teleskopowe$ index.php?a=page&id=14&lang=pl [L]
RewriteRule ^podnosniki-przegubowo-teleskopowe-s-([0-9]+)$ index.php?a=page&id=14&lang=pl&bs=$1 [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^nasi-partnerzy$ index.php?a=page&id=4&lang=pl&%{QUERY_STRING} [L]
RewriteRule ^nasi-partnerzy-s-1$ nasi-partnerzy [R=301,L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^nasi-partnerzy-s-([0-9]+)$ index.php?a=page&id=4&lang=pl&bs=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule nasi-partnerzy %{REQUEST_URI}? [R=301,L]
RewriteRule ^nasi-partnerzy$ index.php?a=page&id=4&lang=pl [L]
RewriteRule ^nasi-partnerzy-s-([0-9]+)$ index.php?a=page&id=4&lang=pl&bs=$1 [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^multipurpose$ index.php?a=page&id=21&lang=pl&%{QUERY_STRING} [L]
RewriteRule ^multipurpose-s-1$ multipurpose [R=301,L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^multipurpose-s-([0-9]+)$ index.php?a=page&id=21&lang=pl&bs=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule multipurpose %{REQUEST_URI}? [R=301,L]
RewriteRule ^multipurpose$ index.php?a=page&id=21&lang=pl [L]
RewriteRule ^multipurpose-s-([0-9]+)$ index.php?a=page&id=21&lang=pl&bs=$1 [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^do-pobrania$ index.php?a=page&id=5&lang=pl&%{QUERY_STRING} [L]
RewriteRule ^do-pobrania-s-1$ do-pobrania [R=301,L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^do-pobrania-s-([0-9]+)$ index.php?a=page&id=5&lang=pl&bs=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule do-pobrania %{REQUEST_URI}? [R=301,L]
RewriteRule ^do-pobrania$ index.php?a=page&id=5&lang=pl [L]
RewriteRule ^do-pobrania-s-([0-9]+)$ index.php?a=page&id=5&lang=pl&bs=$1 [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^podnosniki-na-podwoziu-typu-furgon$ index.php?a=page&id=15&lang=pl&%{QUERY_STRING} [L]
RewriteRule ^podnosniki-na-podwoziu-typu-furgon-s-1$ podnosniki-na-podwoziu-typu-furgon [R=301,L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^podnosniki-na-podwoziu-typu-furgon-s-([0-9]+)$ index.php?a=page&id=15&lang=pl&bs=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule podnosniki-na-podwoziu-typu-furgon %{REQUEST_URI}? [R=301,L]
RewriteRule ^podnosniki-na-podwoziu-typu-furgon$ index.php?a=page&id=15&lang=pl [L]
RewriteRule ^podnosniki-na-podwoziu-typu-furgon-s-([0-9]+)$ index.php?a=page&id=15&lang=pl&bs=$1 [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^podnosniki-gasienicowe$ index.php?a=page&id=16&lang=pl&%{QUERY_STRING} [L]
RewriteRule ^podnosniki-gasienicowe-s-1$ podnosniki-gasienicowe [R=301,L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^podnosniki-gasienicowe-s-([0-9]+)$ index.php?a=page&id=16&lang=pl&bs=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule podnosniki-gasienicowe %{REQUEST_URI}? [R=301,L]
RewriteRule ^podnosniki-gasienicowe$ index.php?a=page&id=16&lang=pl [L]
RewriteRule ^podnosniki-gasienicowe-s-([0-9]+)$ index.php?a=page&id=16&lang=pl&bs=$1 [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^podnosniki-szynowo-drogowe$ index.php?a=page&id=17&lang=pl&%{QUERY_STRING} [L]
RewriteRule ^podnosniki-szynowo-drogowe-s-1$ podnosniki-szynowo-drogowe [R=301,L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^podnosniki-szynowo-drogowe-s-([0-9]+)$ index.php?a=page&id=17&lang=pl&bs=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule podnosniki-szynowo-drogowe %{REQUEST_URI}? [R=301,L]
RewriteRule ^podnosniki-szynowo-drogowe$ index.php?a=page&id=17&lang=pl [L]
RewriteRule ^podnosniki-szynowo-drogowe-s-([0-9]+)$ index.php?a=page&id=17&lang=pl&bs=$1 [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^kontakt$ index.php?a=page&id=7&lang=pl&%{QUERY_STRING} [L]
RewriteRule ^kontakt-s-1$ kontakt [R=301,L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^kontakt-s-([0-9]+)$ index.php?a=page&id=7&lang=pl&bs=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule kontakt %{REQUEST_URI}? [R=301,L]
RewriteRule ^kontakt$ index.php?a=page&id=7&lang=pl [L]
RewriteRule ^kontakt-s-([0-9]+)$ index.php?a=page&id=7&lang=pl&bs=$1 [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^podnosniki-izolowane-do-750-kv$ index.php?a=page&id=18&lang=pl&%{QUERY_STRING} [L]
RewriteRule ^podnosniki-izolowane-do-750-kv-s-1$ podnosniki-izolowane-do-750-kv [R=301,L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^podnosniki-izolowane-do-750-kv-s-([0-9]+)$ index.php?a=page&id=18&lang=pl&bs=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule podnosniki-izolowane-do-750-kv %{REQUEST_URI}? [R=301,L]
RewriteRule ^podnosniki-izolowane-do-750-kv$ index.php?a=page&id=18&lang=pl [L]
RewriteRule ^podnosniki-izolowane-do-750-kv-s-([0-9]+)$ index.php?a=page&id=18&lang=pl&bs=$1 [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^pianoplan$ index.php?a=page&id=19&lang=pl&%{QUERY_STRING} [L]
RewriteRule ^pianoplan-s-1$ pianoplan [R=301,L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^pianoplan-s-([0-9]+)$ index.php?a=page&id=19&lang=pl&bs=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule pianoplan %{REQUEST_URI}? [R=301,L]
RewriteRule ^pianoplan$ index.php?a=page&id=19&lang=pl [L]
RewriteRule ^pianoplan-s-([0-9]+)$ index.php?a=page&id=19&lang=pl&bs=$1 [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^serwis-i-naprawa-podestow-ruchomych$ index.php?a=page&id=9&lang=pl&%{QUERY_STRING} [L]
RewriteRule ^serwis-i-naprawa-podestow-ruchomych-s-1$ serwis-i-naprawa-podestow-ruchomych [R=301,L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^serwis-i-naprawa-podestow-ruchomych-s-([0-9]+)$ index.php?a=page&id=9&lang=pl&bs=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule serwis-i-naprawa-podestow-ruchomych %{REQUEST_URI}? [R=301,L]
RewriteRule ^serwis-i-naprawa-podestow-ruchomych$ index.php?a=page&id=9&lang=pl [L]
RewriteRule ^serwis-i-naprawa-podestow-ruchomych-s-([0-9]+)$ index.php?a=page&id=9&lang=pl&bs=$1 [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^czesci$ index.php?a=page&id=10&lang=pl&%{QUERY_STRING} [L]
RewriteRule ^czesci-s-1$ czesci [R=301,L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^czesci-s-([0-9]+)$ index.php?a=page&id=10&lang=pl&bs=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule czesci %{REQUEST_URI}? [R=301,L]
RewriteRule ^czesci$ index.php?a=page&id=10&lang=pl [L]
RewriteRule ^czesci-s-([0-9]+)$ index.php?a=page&id=10&lang=pl&bs=$1 [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^akcesoria$ index.php?a=page&id=11&lang=pl&%{QUERY_STRING} [L]
RewriteRule ^akcesoria-s-1$ akcesoria [R=301,L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^akcesoria-s-([0-9]+)$ index.php?a=page&id=11&lang=pl&bs=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule akcesoria %{REQUEST_URI}? [R=301,L]
RewriteRule ^akcesoria$ index.php?a=page&id=11&lang=pl [L]
RewriteRule ^akcesoria-s-([0-9]+)$ index.php?a=page&id=11&lang=pl&bs=$1 [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^nowe-w-magazynie$ index.php?a=page&id=12&lang=pl&%{QUERY_STRING} [L]
RewriteRule ^nowe-w-magazynie-s-1$ nowe-w-magazynie [R=301,L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^nowe-w-magazynie-s-([0-9]+)$ index.php?a=page&id=12&lang=pl&bs=$1&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule nowe-w-magazynie %{REQUEST_URI}? [R=301,L]
RewriteRule ^nowe-w-magazynie$ index.php?a=page&id=12&lang=pl [L]
RewriteRule ^nowe-w-magazynie-s-([0-9]+)$ index.php?a=page&id=12&lang=pl&bs=$1 [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^teleskopowe/cte$ index.php?article=1&lang=pl&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^teleskopowe/cte %{REQUEST_URI}? [R=301,L]
RewriteRule ^teleskopowe/cte$ index.php?article=1&lang=pl [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^a-3-ochrona-danych$ index.php?article=3&lang=pl&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^a-3-ochrona-danych %{REQUEST_URI}? [R=301,L]
RewriteRule ^a-3-ochrona-danych$ index.php?article=3&lang=pl [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^teleskopowe/france-elevateur$ index.php?article=4&lang=pl&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^teleskopowe/france-elevateur %{REQUEST_URI}? [R=301,L]
RewriteRule ^teleskopowe/france-elevateur$ index.php?article=4&lang=pl [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^przegubowo-teleskopowe/cte$ index.php?article=5&lang=pl&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^przegubowo-teleskopowe/cte %{REQUEST_URI}? [R=301,L]
RewriteRule ^przegubowo-teleskopowe/cte$ index.php?article=5&lang=pl [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^przegubowo-teleskopowe/france-elevateur$ index.php?article=6&lang=pl&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^przegubowo-teleskopowe/france-elevateur %{REQUEST_URI}? [R=301,L]
RewriteRule ^przegubowo-teleskopowe/france-elevateur$ index.php?article=6&lang=pl [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^na-podwoziu-typu-furgon/france-elevateur$ index.php?article=7&lang=pl&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^na-podwoziu-typu-furgon/france-elevateur %{REQUEST_URI}? [R=301,L]
RewriteRule ^na-podwoziu-typu-furgon/france-elevateur$ index.php?article=7&lang=pl [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^na-podwozu-gasienicowym/cte$ index.php?article=8&lang=pl&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^na-podwozu-gasienicowym/cte %{REQUEST_URI}? [R=301,L]
RewriteRule ^na-podwozu-gasienicowym/cte$ index.php?article=8&lang=pl [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^szynowo-drogowe/france-elevateur$ index.php?article=9&lang=pl&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^szynowo-drogowe/france-elevateur %{REQUEST_URI}? [R=301,L]
RewriteRule ^szynowo-drogowe/france-elevateur$ index.php?article=9&lang=pl [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^izolowane-do-750-kv/france-elevateur$ index.php?article=10&lang=pl&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^izolowane-do-750-kv/france-elevateur %{REQUEST_URI}? [R=301,L]
RewriteRule ^izolowane-do-750-kv/france-elevateur$ index.php?article=10&lang=pl [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^multipurpose/producent-cte$ index.php?article=11&lang=pl&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^multipurpose/producent-cte %{REQUEST_URI}? [R=301,L]
RewriteRule ^multipurpose/producent-cte$ index.php?article=11&lang=pl [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^pianoplan/producent-cte$ index.php?article=12&lang=pl&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^pianoplan/producent-cte %{REQUEST_URI}? [R=301,L]
RewriteRule ^pianoplan/producent-cte$ index.php?article=12&lang=pl [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^a-13-inteligentny-system-stabilizacji-s3-smart-stability-system$ index.php?article=13&lang=pl&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^a-13-inteligentny-system-stabilizacji-s3-smart-stability-system %{REQUEST_URI}? [R=301,L]
RewriteRule ^a-13-inteligentny-system-stabilizacji-s3-smart-stability-system$ index.php?article=13&lang=pl [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^a-14-o-firmie$ index.php?article=14&lang=pl&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^a-14-o-firmie %{REQUEST_URI}? [R=301,L]
RewriteRule ^a-14-o-firmie$ index.php?article=14&lang=pl [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^a-15-nasi-partnerzy$ index.php?article=15&lang=pl&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^a-15-nasi-partnerzy %{REQUEST_URI}? [R=301,L]
RewriteRule ^a-15-nasi-partnerzy$ index.php?article=15&lang=pl [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^a-20-cte-prenentuje-nowy-model-b-lift20j-teleskopowy-podest-ruchomy-z-ramieniem-jib$ index.php?article=20&lang=pl&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^a-20-cte-prenentuje-nowy-model-b-lift20j-teleskopowy-podest-ruchomy-z-ramieniem-jib %{REQUEST_URI}? [R=301,L]
RewriteRule ^a-20-cte-prenentuje-nowy-model-b-lift20j-teleskopowy-podest-ruchomy-z-ramieniem-jib$ index.php?article=20&lang=pl [L]
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)(utm_source|gclid)=[^&]+(&.*)?
RewriteRule ^a-21-energetab-2020$ index.php?article=21&lang=pl&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^a-21-energetab-2020 %{REQUEST_URI}? [R=301,L]
RewriteRule ^a-21-energetab-2020$ index.php?article=21&lang=pl [L]
RewriteRule ^newsletter/signin/$ index.php?module=newsletter&action=signin [L]
RewriteRule ^newsletter/confirm/hash=(.*)$ index.php?module=newsletter&action=confirm&hash=$1 [L]
RewriteRule ^newsletter/unsubscribe/hash=(.*)$ index.php?module=newsletter&action=unsubscribe&hash=$1 [L]

17
.vscode/ftp-kr.json vendored Normal file
View File

@@ -0,0 +1,17 @@
{
"host": "kobcrane.home.pl",
"username": "projectpro@kobcrane-montaze.pl",
"password": "UqNL18uDy",
"remotePath": "/",
"protocol": "ftp",
"port": 0,
"fileNameEncoding": "utf8",
"autoUpload": true,
"autoDelete": false,
"autoDownload": false,
"ignoreRemoteModification": true,
"ignore": [
".git",
"/.vscode"
]
}

12
.vscode/sftp.json vendored Normal file
View File

@@ -0,0 +1,12 @@
{
"name": "kobcrane.home.pl",
"host": "kobcrane.home.pl",
"protocol": "ftp",
"port": 21,
"username": "projectpro@kobcrane-montaze.pl",
"password": "UqNL18uDy",
"remotePath": "/",
"uploadOnSave": false,
"useTempFile": false,
"openSsh": false
}

50
404.html Normal file
View File

@@ -0,0 +1,50 @@
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Błąd 404</title>
<style type="text/css">
body {
font-family:Arial, Helvetica, sans-serif;
}
.wrap {
width: 1000px;
margin: 0 auto;
}
.logo {
width: 300px;
position: absolute;
top: 25%;
left: 50%;
transform: translateX(-50%);
}
#p404 {
font-size: 180px;
padding: 0;
margin: 0;
}
#btn a {
color: #eee;
font-size: 13px;
padding: 5px 10px;
background: #5b7fb1;
text-decoration: none;
border-radius: 3px;
display: block;
text-align: center;
}
#btn a:hover {
background: #2E5386;
}
</style>
</head>
<body>
<div class="wrap">
<div class="logo">
<p id="p404">404</p>
<p>Przykro nam, żądana strona nie istnieje</p>
<p id="btn"><a href="/">Wróć do strony głównej</a></p>
</div>
</div>
</body>
</html>

38
admin/ajax.php Normal file
View File

@@ -0,0 +1,38 @@
<?
error_reporting( E_ALL ^ E_NOTICE ^ E_STRICT );
function __autoload_my_classes( $classname )
{
$q = explode( '\\' , $classname );
$c = array_pop( $q );
$f = '../autoload/' . implode( '/' , $q ) . '/class.' . $c . '.php';
if ( $c == 'Savant3' )
{
require_once( '../autoload/Savant3.php' );
return true;
}
if ( file_exists( $f ) )
require_once( $f );
}
spl_autoload_register( '__autoload_my_classes' );
require_once '../config.php';
require_once '../libraries/medoo/medoo.php';
require_once '../libraries/grid/config.php';
date_default_timezone_set('Europe/Warsaw');
session_start();
$mdb = new medoo( [
'database_type' => 'mysql',
'database_name' => $database['name'],
'server' => $database['host'],
'username' => $database['user'],
'password' => $database['password'],
'charset' => 'utf8'
] );
require_once 'ajax/pages.php';
require_once 'ajax/articles.php';
require_once 'ajax/users.php';
require_once 'ajax/newsletter.php';
?>

54
admin/ajax/articles.php Normal file
View File

@@ -0,0 +1,54 @@
<?php
$a = \S::get( 'a' );
if ( $a == 'article_image_delete' )
{
$response = [ 'status' => 'error', 'msg' => 'Podczas usuwania zdjecia wystąpił błąd. Proszę spróbować ponownie.' ];
if ( \admin\factory\Articles::delete_img( \S::get( 'image_id' ) ) )
$response = [ 'status' => 'ok' ];
echo json_encode( $response );
exit;
}
if ( $a == 'article_file_delete' )
{
$response = [ 'status' => 'error', 'msg' => 'Podczas usuwania załącznika wystąpił błąd. Proszę spróbować ponownie.' ];
if ( \admin\factory\Articles::delete_file( \S::get( 'file_id' ) ) )
$response = [ 'status' => 'ok' ];
echo json_encode( $response );
exit;
}
if ( $a == 'article_image_alt_change' )
{
$response = [ 'status' => 'error', 'msg' => 'Podczas zmiany atrybutu alt zdjęcia wystąpił błąd. Proszę spróbować ponownie.' ];
if ( \admin\factory\Articles::image_alt_change( \S::get( 'image_id' ), \S::get( 'image_alt' ) ) )
$response = [ 'status' => 'ok' ];
echo json_encode( $response );
exit;
}
if ( $a == 'article_file_name_change' )
{
$response = [ 'status' => 'error', 'msg' => 'Podczas zmiany nazwy załącznika wystąpił błąd. Proszę spróbować ponownie.' ];
if ( \admin\factory\Articles::file_name_change( \S::get( 'file_id' ), \S::get( 'file_name' ) ) )
$response = [ 'status' => 'ok' ];
echo json_encode( $response );
exit;
}
if ( $a == 'google_url_preview_article' )
{
if ( \S::get( 'article_id' ) )
echo $_SERVER['SERVER_NAME'] . '/a-' . \S::get( 'article_id' ) . '-' . \S::seo( \S::get( 'title' ) );
else
echo $_SERVER['SERVER_NAME'] . '/a-' . ( \S::max_db_value( 'pp_articles', 'id' ) + 1 ) . '-' . \S::seo( \S::get( 'title' ) );
}

16
admin/ajax/newsletter.php Normal file
View File

@@ -0,0 +1,16 @@
<?php
$a = \S::get( 'a' );
if ( $a == 'newsletter-preview' )
{
$dates = explode( ' - ', \S::get( 'dates' ) );
$template = \S::get('template');
echo \admin\view\Newsletter::preview(
\admin\factory\Articles::articles_by_date_add( $dates[0], $dates[1] ),
\admin\factory\Settings::settings_details(),
\admin\factory\Newsletter::email_template_detalis( $template ),
\S::get( 'dates' )
);
exit;
}

91
admin/ajax/pages.php Normal file
View File

@@ -0,0 +1,91 @@
<?php
$a = \S::get('a');
if ($a == 'save_articles_order') {
$response = ['status' => 'error', 'msg' => 'Podczas zapisywania kolejności wyświetlania artykułów wystąpił błąd. Proszę spróbować ponownie.'];
if (\admin\factory\Pages::save_articles_order(\S::get('page_id'), \S::get('articles')))
$response = ['status' => 'ok'];
echo json_encode($response);
exit;
}
if ($a == 'save_pages_order') {
$response = ['status' => 'error', 'msg' => 'Podczas zapisywania kolejności stron wystąpił błąd. Proszę spróbować ponownie.'];
if (\admin\factory\Pages::save_pages_order(\S::get('menu_id'), \S::get('pages')))
$response = ['status' => 'ok'];
echo json_encode($response);
exit;
}
if ($a == 'generate_seo_link') {
$response = ['status' => 'error', 'msg' => 'Podczas generowania pola "seo link" wystąpił błąd. Proszę spróbować ponownie.'];
if ($seo_link = \admin\factory\Pages::generate_seo_link(\S::get('title'), \S::get('page_id'), \S::get('article_id'), \S::get('lang'), \S::get('pid')))
$response = ['status' => 'ok', 'seo_link' => $seo_link];
echo json_encode($response);
exit;
}
if ($a == 'cookie_menus') {
$array = unserialize($_COOKIE['cookie_menus']);
if ($array[\S::get('menu_id')] == 0)
$array[\S::get('menu_id')] = 1;
else
$array[\S::get('menu_id')] = 0;
$array = serialize($array);
setcookie('cookie_menus', $array, time() + 3600 * 24 * 365);
}
if ($a == 'cookie_pages') {
$array = unserialize($_COOKIE['cookie_pages']);
if ($array[\S::get('page_id')] == 0)
$array[\S::get('page_id')] = 1;
else
$array[\S::get('page_id')] = 0;
$array = serialize($array);
setcookie('cookie_pages', $array, time() + 3600 * 24 * 365);
}
if ( $a == 'google_url_preview' )
{
$settings = \front\factory\Settings::settings_details();
$structure = $settings['links_structure'];
if ( $structure )
{
if ( \S::get( 'page_id' ) )
{
$seo_link = \admin\factory\Pages::google_url_preview(\S::get('page_id'), \S::get('title'), \S::get('lang_id'), \S::get('pid'), 0, \S::get('seo_link'));
echo $seo_link;
}
else
{
$seo_link = \admin\factory\Pages::google_url_preview(0, \S::get('title'), \S::get('lang_id'), \S::get('pid'), \S::max_db_value('pp_pages', 'id') + 1, \S::get('seo_link'));
echo $seo_link;
}
}
else
{
if ( \S::get( 'seo_link' ) )
echo \S::get( 'seo_link' );
else
{
if ( \S::get( 'page_id' ) )
echo $prefix . 's-' . \S::get('page_id') . '-' . \S::seo(\S::get('title'));
else
echo $prefix . 's-' . ( \S::max_db_value('pp_pages', 'id') + 1 ) . '-' . \S::seo(\S::get('title'));
}
}
}

9
admin/ajax/users.php Normal file
View File

@@ -0,0 +1,9 @@
<?php
$a = \S::get( 'a' );
if ( $a == 'check_login' )
{
$response = \admin\factory\Users::check_login( \S::get( 'login' ), \S::get( 'user_id' ) );
echo json_encode( $response );
exit;
}

550
admin/css/custom.css Normal file
View File

@@ -0,0 +1,550 @@
body.external-page #content .admin-form {
max-width: 450px;
}
.sidebar-menu > li > a > span:nth-child(2) {
padding: 0;
}
ol.sortable, ol.sortable ol {
margin: 0 0 0 25px;
padding: 0;
list-style-type: none;
}
ol.sortable {
margin: 0;
}
ol.sortable, ol.sortable *, ol.sortable *:before, ol.sortable *:after {
box-sizing: content-box;
}
.sortable li {
margin: 0;
padding: 0;
}
.sortable li div.content {
color: #454545;
cursor: move;
height: 45px;
line-height: 45px;
margin: 0;
padding: 0 10px;
border-bottom: 1px solid #e1e1e1;
}
.sortable li div.content.text-danger {
color: #e9573f !important;
}
.sortable li.sort-branch div {
color: #383838;
}
.sort-leaf .disclose {
content: "- ";
text-indent: -3000px;
background-image: url( "/libraries/jquery-nested-sortable/skin-vista/icons.gif" );
background-position: -16px -64px;
background-repeat: no-repeat;
display: inline-block;
height: 16px;
vertical-align: top;
width: 16px;
margin: 16px 5px 0 1px;
}
li.sort-collapsed.sort-hover div {
border-color: #999999;
}
.disclose {
cursor: pointer;
width: 20px;
display: none;
text-align: center;
}
.sortable li.sort-collapsed > ol {
display: none;
}
.sortable li.sort-branch > div > .disclose {
display: block;
float: left;
margin-right: 15px;
}
.sortable li.sort-collapsed > div > .disclose > span:before {
display: inline-block;
font-family: FontAwesome;
font-size: 10px;
content: "\f054";
height: 25px;
width: 25px;
line-height: 25px;
border-radius: 13px;
background: #eeeeee;
color: #3bafda;
border: 1px solid #3bafda;
}
.sortable li.sort-collapsed > div > .disclose:hover > span:before, .sortable li.sort-expanded > div > .disclose:hover > span:before {
background: #3bafda;
color: #FFF;
}
.sortable li.sort-expanded > div > .disclose > span:before {
display: inline-block;
font-family: FontAwesome;
font-size: 10px;
content: "\f078";
height: 25px;
width: 25px;
line-height: 25px;
border-radius: 13px;
background: #eeeeee;
color: #3bafda;
border: 1px solid #3bafda;
}
.placeholder {
outline: 1px dashed #4183C4;
}
.sort-error {
background: #fbe3e4;
border-color: transparent;
}
.menu_sortable .btn-group {
margin-top: 7px;
display: none;
}
.menu_sortable div:hover .btn-group {
display: block;
}
.menu_sortable div:hover {
background: #f0f0f0;
}
.resp-vtabs::after {
content: '';
display: block;
clear: both;
}
.resp-tab-content {
padding: 25px 15px;
}
.resp-tab-content .resp-tab-content {
padding: 0;
border: 0;
}
.resp-tabs-list li, .resp-tab-active {
padding: 8px 20px !important;
}
.resp-tab-content .resp-tabs-list {
border-bottom: 0;
margin-bottom: 10px;
background: #f1f1f1;
}
.resp-tab-content .resp-tabs-list li {
border-left: 0 !important;
border-right: 0 !important;
float: right;
}
.resp-tab-content .resp-tabs-list::after {
clear: both;
content: '';
display: block;
}
.resp-tab-content .resp-tab-active {
position: relative;
top: -1px;
}
.resp-tab-content .form-group {
margin: 0 0 15px 0;
}
.input-group span.btn-info {
border-color: rgba(0, 0, 0, 0.05);
}
#overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1300;
background: rgba( 0, 0, 0, 0.2 );
display: none;
cursor: pointer;
}
#g-row-limit {
width: auto;
display: inline-block;
height: 30px;
line-height: 30px;
padding: 4px 12px;
}
#images-uploader, #files-uploader {
clear: both;
}
#images-uploader, #images-uploader *, #files-uploader, #files-uploader * {
box-sizing: content-box !important;
}
#images-list {
margin: 0;
padding: 0 5px;
}
#images-list li {
background: #FFF;
text-align: center;
display: block;
height: 165px;
margin: 5px 5px 10px 5px;
vertical-align: middle;
float: left;
width: calc( 25% - 10px );
position: relative;
}
#images-list li.sortable-chosen {
-webkit-box-shadow: -1px 1px 6px rgba( 0, 0, 0, .75 );
-moz-box-shadow: -1px 1px 6px rgba( 0, 0, 0, .75 );
box-shadow: -1px 1px 6px rgba( 0, 0, 0, .75 );
}
#images-list li .article-image {
height: 100%;
width: 100%;
object-fit: cover;
}
#images-list li .image-alt {
padding: 5px;
height: 30px;
font-size: 13px;
}
#images-list li .article_image_delete {
border: 0;
padding: 13px;
position: absolute;
top: 0;
right: 0;
}
#images-list li .article_image_delete i {
font-size: 18px;
}
#images-list li .image-alt {
position: absolute;
bottom: 10px;
border: 0;
background: rgba( 0, 0, 0, .2 );
text-align: center;
color: #FFF;
}
#images-list li .image-alt::placeholder {
color: #FFF;
}
#images-list li:hover .article-image-edit, #images-list li.pending .article-image-edit {
display: block;
}
.article-image-edit {
background: rgba( 255, 255, 255, .8 );
position: absolute;
height: 100%;
width: 150px;
cursor: pointer;
line-height: 168px;
display: none;
}
.article-image-edit i {
font-size: 28px;
color: #cc0000;
}
.article-image-edit img {
height: 50px;
position: relative;
top: 12px;
}
#files-list {
list-style-type: none;
margin: 0;
padding: 0;
}
#files-list li {
float: left;
margin: 5px 7px;
}
#files-list li .article_file_delete {
border-color: rgba(0, 0, 0, 0.05);
}
#elfinder * {
box-sizing: content-box !important;
}
#elfinder {
background: #EBEBEB;
}
.elfinder-button {
background: #FFF !important;
}
.elfinder-cwd, .elfinder .elfinder-navbar, .std42-dialog .ui-dialog-content, .elfinder-contextmenu .elfinder-contextmenu-item span {
font-size: 12px;
}
.elfinder-contextmenu-item {
background: #FFF;
color: #000;
}
.elfinder-cwd-view-icons .elfinder-cwd-filename {
-webkit-border-radius: 0px;
border-radius: 0px;
}
.elfinder-cwd-view-icons .elfinder-cwd-file .elfinder-cwd-filename.ui-state-hover, .elfinder-cwd table td.ui-state-hover, .elfinder-button-menu .ui-state-hover {
background: #2c373d;
}
.elfinder-cwd-filename input[type="text"] {
border: 0px !important;
padding: 0px !important;
}
#elfinder {
height: 750px !important;
position: relative;
}
.elfinder-cwd table tr:nth-child(2n+1) {
background: #D3D3D3;
}
.elfinder-cwd table tr {
border-top: 1px solid #CCC;
}
.elfinder-cwd table tr td {
padding: 5px 12px !important;
}
.elfinder-workzone {
clear: both;
}
#elfinder .ui-dialog {
border: 1px solid #ccc;
position: absolute !important;
}
.navbar-branding .navbar-brand {
float: left;
}
.navbar-branding .navbar-version {
opacity: .5;
font-size: 12px;
height: 60px;
line-height: 60px;
padding: 0 15px;
color: #666;
float: left;
}
.navbar .label {
position: relative;
top: 15px;
float: left;
height: 28px;
}
body.sb-top .navbar-branding {
width: 250px;
}
.flags {
margin: -4px 0 0 20px !important;
background: none;
cursor: move;
}
.flags:hover {
border: 0px !important;
background: none !important;
}
.flags img {
height: 10px;
margin-right: 5px;
opacity: .4;
}
.CodeMirror {
height: 500px !important;
}
.nav > li > a {
font-size: 12px;
}
#newsletter-preview {
border: 1px solid #ccc;
padding: 20px;
}
div.jqi .jqititle {
margin-bottom: 0;
}
#google-preview {
padding: 10px;
}
.google-title {
color: #1a0dab;
font-family: arial,sans-serif;
cursor: pointer;
font-size: 18px;
line-height: 21.6px;
width: 600px;
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.google-url {
color: rgb(0, 102, 33);
font-family: arial,sans-serif;
font-size: 14px;
line-height: 16px;
width: 600px;
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.google-description {
color: rgb(84, 84, 84);
font-family: arial,sans-serif;
font-size: 13px;
line-height: 18.2px;
width: 600px;
display: block;
}
.sidebar-left-content {
background: #114975;
}
.sidebar-menu li.disable_menu {
pointer-events: none;
opacity: .3;
}
body.sb-top #sidebar_left .sidebar-menu > li > a {
color: #FFF;
}
body.sb-top.sb-top-sm #sidebar_left .sidebar-menu > li > a > span:nth-child(1) {
font-size: 13px;
}
body.sb-top #sidebar_left .sidebar-menu li > a > span.caret {
color: #FFF;
}
body.sb-top #sidebar_left .sidebar-menu > li.active > a,
body.sb-top #sidebar_left .sidebar-menu > li:hover > a,
body.sb-top #sidebar_left .sidebar-menu > li > a.menu-open,
body.sb-top #sidebar_left .sidebar-menu > li > a:hover,
body.sb-top #sidebar_left .sidebar-menu > li > a:focus {
background: #FFF;
color: #114975;
}
body.sb-top #sidebar_left .sidebar-menu liactive > a > span.caret,
body.sb-top #sidebar_left .sidebar-menu > li:hover > a > span.caret,
body.sb-top #sidebar_left .sidebar-menu > li > a.menu-open > span.caret,
body.sb-top #sidebar_left .sidebar-menu > li > a:hover > span.caret,
body.sb-top #sidebar_left .sidebar-menu > li > a:focus > span.caret {
color: #114975;
}
.sidebar-menu > li > ul {
background: #FFF;
-webkit-box-shadow: -1px 1px 6px rgba(0,0,0,0.2);
-moz-box-shadow: -1px 1px 6px rgba(0,0,0,0.2);
box-shadow: -1px 1px 6px rgba(0,0,0,0.2);
}
.sidebar-menu > li > ul > li > a {
color: #114975;
border-bottom: 1px solid #f3f3f3;
}
body.sb-top #sidebar_left .sidebar-menu > li > ul > li > a.menu-open:after, body.sb-top #sidebar_left .sidebar-menu > li > ul > li.active > a:after, body.sb-top #sidebar_left .sidebar-menu > li > ul > li:hover > a:after, body.sb-top #sidebar_left .sidebar-menu > li > ul > li:focus > a:after {
width: 5px;
left: 0;
}
.sidebar-menu > li > ul > li > a:hover, .sidebar-menu > li > ul > li > a:focus {
color: #114975;
}
.sidebar-menu > li > ul > li:hover > a:after, .sidebar-menu > li > ul > li:focus > a:after {
background: #70ca63;
}
body.sb-top #sidebar_left .sidebar-menu > li > ul {
padding-bottom: 0;
}
.progress-box {
position: absolute;
top: 0px;
width:100%;
height:100%;
z-index:200;
background: #fff;
padding:0px;
margin-left:-15px;
}
.progress{
margin:15px;
height:35px;
transform: translateY(-100%);
position:relative;
top:30%;
background-color: #333;
}
.version{
position:relative;
top: 5%;
}
.version h3 p{
display: inline-block;
}
.version h3{
text-align: center;
}
.form-group.text-right div{
padding-right:15px;
}
.remember{
font-size: 13px !important;
}
#remember{
display: inline-block !important;
width:15px;
height:15px;
top: 2px;
position: relative;
}
.popo {
display: inline-block;
border: 1px solid;
border-color: red;
border-radius: 50%;
height: 20px;
width: 20px;
text-align: center;
}
.popover-btn {
cursor: pointer;
position: relative;
display: block;
color: red;
height: 20px;
width: 20px;
text-indent: -4px;
}
.mfp-auto-cursor .mfp-content {
max-width: 1000px;
}
.mfp-auto-cursor .mfp-content .col-lg-9,
.mfp-auto-cursor .mfp-content .row {
width: 100%;
float: none;
max-width: 1000px;
}
.mfp-auto-cursor .mfp-content .g-container {
max-width: 1000px;
}
.mfp-close, .mfp-close:active {
right: -7px;
top: -27px;
background: #FFF !important;
}
.affix {
top: 0;
z-index: 100;
left:0px;
}
.affix + .panel-heading{
padding-top: 70px;
}
.g-container hr {
margin: 5px 0;
}
.resp-vtabs li.resp-tab-active {
background: #4186da !important;
color: #FFF;
border-left: 0 !important;
}
.resp-vtabs > .resp-tabs-container {
border: 0 !important;
border-left: 1px solid #e5e5e5 !important;
}
@media ( min-width: 1199px ) {
.g-container .panel-body form {
max-width: 1400px;
}
}
@media (max-width: 900px) {
body.sb-top #toggle_sidemenu_t {
width: 60px;
}
}

BIN
admin/css/lang-de.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
admin/css/lang-en.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

BIN
admin/css/lang-fr.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
admin/css/lang-it.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
admin/css/lang-pl.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
admin/css/lang-ru.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
admin/css/lang-uk.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
admin/css/user-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

86
admin/index.php Normal file
View File

@@ -0,0 +1,86 @@
<?
if ( file_exists( 'ip.conf' ) )
{
$ips = file_get_contents( 'ip.conf' );
$ips = preg_split( "/\\r\\n|\\r|\\n/", $ips );
$ips = array_filter( $ips );
if ( is_array( $ips ) and !empty( $ips ) )
{
if ( !in_array( $_SERVER['REMOTE_ADDR'], $ips ) )
die( 'Brak dostępu.' );
}
}
error_reporting( E_ALL ^ E_NOTICE ^ E_STRICT ^ E_WARNING ^ E_DEPRECATED );
function __autoload_my_classes( $classname )
{
$q = explode( '\\' , $classname );
$c = array_pop( $q );
$f = '../autoload/' . implode( '/' , $q ) . '/class.' . $c . '.php';
if ( file_exists( $f ) )
require_once( $f );
}
spl_autoload_register( '__autoload_my_classes' );
require_once '../config.php';
require_once '../libraries/medoo/medoo.php';
require_once '../libraries/grid/config.php';
date_default_timezone_set( 'Europe/Warsaw' );
$settings = \front\factory\Settings::settings_details();
if ( file_exists( 'config.php' ) )
include 'config.php';
session_start();
if ( !isset( $_SESSION['check'] ) )
{
session_regenerate_id();
$_SESSION['check'] = true;
$_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];
}
if ( $_SESSION['ip'] !== $_SERVER['REMOTE_ADDR'] )
{
session_destroy();
header( 'Location: /admin/' );
exit;
}
$mdb = new medoo( [
'database_type' => 'mysql',
'database_name' => $database['name'],
'server' => $database['host'],
'username' => $database['user'],
'password' => $database['password'],
'charset' => 'utf8'
] );
$user = \S::get_session( 'user' , true );
\admin\Site::special_actions();
$domain = preg_replace( '#^(http(s)?://)?w{3}\.#', '$1', $_SERVER['SERVER_NAME'] );
$cookie_name = str_replace( '.', '-', $domain );
if ( isset( $_COOKIE[$cookie_name] ) && !isset( $_SESSION['user'] ) )
{
$obj = json_decode( $_COOKIE[$cookie_name] );
$login = $obj -> {'login'};
$password = $obj -> {'hash'};
if ( $mdb -> get( 'pp_users', '*',
[ 'AND' =>
[ 'login' => $login, 'status' => 1, 'password' => $password,
'OR' => [ 'active_to[>=]' => date( 'Y-m-d' ), 'active_to' => null ]
]
] ) )
{
\S::set_session( 'user', \admin\factory\Users::details( $login ) );
header( 'Location: /admin/articles/view_list/' );
exit;
}
}
echo \admin\view\Page::show();
?>

0
admin/ip.conf Normal file
View File

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,67 @@
<?php
global $gdb;
$grid = new \grid( 'pp_articles' );
$grid -> gdb_opt = $gdb;
$grid -> sql = 'SELECT *'
. 'FROM ( '
. 'SELECT '
. 'id, date_add, date_modify, status, '
. '( SELECT title FROM pp_articles_langs AS pal, pp_langs AS pl WHERE lang_id = pl.id AND article_id = pa.id AND title != \'\' ORDER BY o ASC LIMIT 1 ) AS title '
. 'FROM '
. 'pp_articles AS pa WHERE status = -1 '
. ') AS q1 '
. 'WHERE '
. '1=1 [where] '
. 'ORDER BY '
. '[order_p1] [order_p2]';
$grid -> sql_count = 'SELECT '
. 'COUNT(0) FROM ( '
. 'SELECT '
. 'id, date_add, date_modify, status, '
. '( SELECT title FROM pp_articles_langs AS pal, pp_langs AS pl WHERE lang_id = pl.id AND article_id = pa.id AND title != \'\' ORDER BY o ASC LIMIT 1 ) AS title '
. 'FROM '
. 'pp_articles AS pa WHERE status = -1 '
. ') AS q1 '
. 'WHERE '
. '1=1 [where] ';
$grid -> debug = true;
$grid -> order = [ 'column' => 'date_add', 'type' => 'DESC' ];
$grid -> columns_view = [
[
'name' => 'Lp.',
'th' => [ 'class' => 'g-lp' ],
'td' => [ 'class' => 'g-center' ],
'autoincrement' => true
],
[
'name' => 'Tytuł',
'db' => 'id',
'replace' => [ 'sql' => "SELECT title FROM pp_articles_langs AS pal, pp_langs AS pl WHERE lang_id = pl.id AND article_id = [id] AND title != '' ORDER BY o ASC LIMIT 1" ]
],
[
'name' => 'Data dodania',
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 140px;' ],
'php' => 'echo date( "Y-m-d H:i", strtotime( "[date_add]" ) );'
],
[
'name' => 'Data modyfikacji',
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 140px;' ],
'php' => 'echo date( "Y-m-d H:i", strtotime( "[date_modify]" ) );'
],
[
'name' => 'Akcja',
'th' => [ 'class' => 'g-center' ],
'td' => [ 'class' => 'g-center', 'style' => 'width: 50px;' ],
'content' => '<a href="/admin/articles_archive/article_restore/id=[id]">przywróć</a>'
],
[
'name' => 'Akcja',
'action' => [ 'type' => 'delete', 'url' => '/admin/articles_archive/article_delete/id=[id]' ],
'th' => [ 'class' => 'g-center' ],
'td' => [ 'class' => 'g-center', 'style' => 'width: 50px;' ]
]
];
echo $grid -> draw();

View File

@@ -0,0 +1,115 @@
<?php
global $gdb;
$grid = new \grid( 'pp_articles' );
$grid -> gdb_opt = $gdb;
$grid -> sql = 'SELECT *'
. 'FROM ( '
. 'SELECT '
. 'id, date_add, date_modify, status, '
. '( SELECT title FROM pp_articles_langs AS pal, pp_langs AS pl WHERE lang_id = pl.id AND article_id = pa.id AND title != \'\' ORDER BY o ASC LIMIT 1 ) AS title, '
. '( SELECT login FROM pp_users AS pu WHERE pu.id = pa.modify_by ) AS user '
. 'FROM '
. 'pp_articles AS pa WHERE status != -1 '
. ') AS q1 '
. 'WHERE '
. '1=1 [where] '
. 'ORDER BY '
. '[order_p1] [order_p2]';
$grid -> sql_count = 'SELECT '
. 'COUNT(0) FROM ( '
. 'SELECT '
. 'id, date_add, date_modify, status, '
. '( SELECT title FROM pp_articles_langs AS pal, pp_langs AS pl WHERE lang_id = pl.id AND article_id = pa.id AND title != \'\' ORDER BY o ASC LIMIT 1 ) AS title, '
. '( SELECT login FROM pp_users AS pu WHERE pu.id = pa.modify_by ) AS user '
. 'FROM '
. 'pp_articles AS pa WHERE status != -1 '
. ') AS q1 '
. 'WHERE '
. '1=1 [where] ';
$grid -> debug = true;
$grid -> order = [ 'column' => 'date_add', 'type' => 'DESC' ];
$grid -> search = [
[ 'name' => 'Tytuł', 'db' => 'title', 'type' => 'text' ],
[ 'name' => 'Aktywny', 'db' => 'status', 'type' => 'select', 'replace' => [ 'array' => [ 0 => 'nie', 1 => 'tak' ] ] ],
[ 'name' => 'Data dodania', 'db' => 'date_add', 'type' => 'date_range' ],
[ 'name' => 'Data modyfikacji', 'db' => 'date_modify', 'type' => 'date_range' ]
];
$grid -> columns_view = [
[
'name' => 'Lp.',
'th' => [ 'class' => 'g-lp' ],
'td' => [ 'class' => 'g-center' ],
'autoincrement' => true
],
[
'name' => 'Tytuł',
'db' => 'title',
'sort' => true,
'php' => 'echo "[title]"; echo "<small class=\'text-muted\'>" . \admin\factory\Articles::article_pages( [id] ) . "</small>";'
],
[
'name' => 'Aktywny',
'db' => 'status',
'replace' => [ 'array' => [ 0 => '<span style="color: #FF0000;">nie</span>', 1 => 'tak' ] ],
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
'sort' => true
],
[
'name' => 'Data dodania',
'db' => 'date_add',
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 220px;' ],
'php' => 'echo date( "Y-m-d H:i", strtotime( "[date_add]" ) );'
],
[
'name' => 'Data modyfikacji',
'db' => 'date_modify',
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 220px;' ],
'php' => 'echo date( "Y-m-d H:i", strtotime( "[date_modify]" ) );'
],
[
'name' => 'Modyfikowany przez',
'db' => 'user',
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 220px;' ],
],
[
'name' => 'Akcja',
'db' => 'id',
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 120px;' ],
'php' => 'echo "<a href=\'#\' class=\'button\' url=\'/" . \admin\factory\Articles::article_url( [id] ) . "\'>wybierz</a>";'
]
];
echo $grid -> draw();
?>
<style type="text/css">
body.sb-top.sb-top-sm .navbar.navbar-fixed-top + #sidebar_left + #content_wrapper {
padding-top: 0;
}
</style>
<script type="text/javascript">
function getUrlParam(paramName)
{
var reParam = new RegExp('(?:[\?&]|&amp;)' + paramName + '=([^&]+)', 'i');
var match = window.location.search.match(reParam);
return (match && match.length > 1) ? match[1] : '';
}
$( function()
{
$( '#sidebar_left, .navbar-fixed-top' ).hide();
var funcNum = getUrlParam('CKEditorFuncNum');
$( 'body' ).on( 'click', '.button', function()
{
window.opener.CKEDITOR.tools.callFunction(funcNum, $( this ).attr( 'url' ) );
window.close();
});
});
</script>

View File

@@ -0,0 +1,144 @@
<?php
global $gdb;
$grid = new \grid( 'pp_articles' );
$grid -> gdb_opt = $gdb;
$grid -> sql = 'SELECT *'
. 'FROM ( '
. 'SELECT '
. 'id, date_add, date_modify, status, '
. '( SELECT title FROM pp_articles_langs AS pal, pp_langs AS pl WHERE lang_id = pl.id AND article_id = pa.id AND title != \'\' ORDER BY o ASC LIMIT 1 ) AS title, '
. '( SELECT login FROM pp_users AS pu WHERE pu.id = pa.modify_by ) AS user '
. 'FROM '
. 'pp_articles AS pa WHERE status != -1 '
. ') AS q1 '
. 'WHERE '
. '1=1 [where] '
. 'ORDER BY '
. '[order_p1] [order_p2]';
$grid -> sql_count = 'SELECT '
. 'COUNT(0) FROM ( '
. 'SELECT '
. 'id, date_add, date_modify, status, '
. '( SELECT title FROM pp_articles_langs AS pal, pp_langs AS pl WHERE lang_id = pl.id AND article_id = pa.id AND title != \'\' ORDER BY o ASC LIMIT 1 ) AS title, '
. '( SELECT login FROM pp_users AS pu WHERE pu.id = pa.modify_by ) AS user '
. 'FROM '
. 'pp_articles AS pa WHERE status != -1 '
. ') AS q1 '
. 'WHERE '
. '1=1 [where] ';
$grid -> debug = true;
if ( !\S::get_session( 'gpp_articlesorder' ) )
$grid -> order = [ 'column' => 'date_add', 'type' => 'DESC' ];
$grid -> search = [
[ 'name' => 'Tytuł', 'db' => 'title', 'type' => 'text' ],
[ 'name' => 'Aktywny', 'db' => 'status', 'type' => 'select', 'replace' => [ 'array' => [ 0 => 'nie', 1 => 'tak' ] ] ],
[ 'name' => 'Data dodania', 'db' => 'date_add', 'type' => 'date_range' ],
[ 'name' => 'Data modyfikacji', 'db' => 'date_modify', 'type' => 'date_range' ]
];
$grid -> columns_view = [
[
'name' => 'Lp.',
'th' => [ 'class' => 'g-lp' ],
'td' => [ 'class' => 'g-center' ],
'autoincrement' => true
],
[
'name' => 'Tytuł',
'db' => 'title',
'sort' => true,
'php' => 'echo "<a href=\'/admin/articles/article_edit/id=[id]\'>[title]</a>"; echo "<small class=\'text-muted\'>" . \admin\factory\Articles::article_pages( [id] ) . "</small>";'
],
[
'name' => 'Aktywny',
'db' => 'status',
'replace' => [ 'array' => [ 0 => '<span style="color: #FF0000;">nie</span>', 1 => 'tak' ] ],
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
'sort' => true
],
[
'name' => 'Data dodania',
'db' => 'date_add',
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 220px;' ],
'php' => 'echo date( "Y-m-d H:i", strtotime( "[date_add]" ) );',
'sort' => true
],
[
'name' => 'Data modyfikacji',
'db' => 'date_modify',
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 220px;' ],
'php' => 'echo date( "Y-m-d H:i", strtotime( "[date_modify]" ) );',
'sort' => true
],
[
'name' => 'Modyfikowany przez',
'db' => 'user',
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 220px;' ],
], [
'name' => 'Akcja',
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 120px;' ],
'php' => 'echo "<a href=\'#\' class=\'duplicate-article\' article-id=\'[id]\'>duplikuj</a>";'
], [
'name' => 'Edytuj',
'action' => [ 'type' => 'edit', 'url' => '/admin/articles/article_edit/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
],
[
'name' => 'Usuń',
'action' => [ 'type' => 'delete', 'url' => '/admin/articles/article_delete/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
]
];
$grid -> buttons = [
[
'label' => 'Dodaj artykuł',
'url' => '/admin/articles/article_edit/',
'icon' => 'fa-plus-circle',
'class' => 'btn-success'
]
];
echo $grid -> draw();
?>
<script type="text/javascript">
$( function() {
$( 'body' ).on( 'click', '.duplicate-article', function(e) {
e.preventDefault();
var article_id = $( this ).attr( 'article-id' );
$.alert(
{
title: 'Potwierdź',
content: 'Na pewno chcesz zduplikować wybrany artykuł?',
type: 'orange',
closeIcon: true,
closeIconClass: 'fa fa-close',
typeAnimated: true,
animation: 'opacity',
theme: 'modern',
columnClass: 'col-lg-8 col-lg-offset-2',
buttons: {
confirm: {
text: 'Zatwierdź',
btnClass: 'btn-blue',
keys: ['enter'],
action: function() {
document.location.href = '/admin/articles/duplicate_article/id=' + article_id;
}
},
cancel:
{
text: 'Zamknij',
btnClass: 'btn-dark',
action: function() {}
}
}
});
});
});
</script>

View File

@@ -0,0 +1,16 @@
<? if ( is_array( $this -> pages ) ):?>
<ol>
<? foreach ( $this -> pages as $page ):?>
<li id="list_<?= $page['id'];?>" idk="<?= $page['id'];?>" class="sort-nonesting list_<?= $page['id'];?>" menu="<?= $page['menu_id'];?>">
<div class="content <?= $this -> step < 2 ? $tmp = 'content_page' : $tmp = 'content_page_last_level';?>" <? if ( !$page['status'] ) echo 'style="color: #cc0000;"';?>>
<span class="disclose"><span></span></span>
<input type="checkbox" class="g-checkbox" name="pages" value="<?= $page['id'];?>" <? if ( is_array( $this -> article_pages ) and in_array( $page['id'], $this -> article_pages ) ):?>checked="checked"<? endif;?> /><?= $page['title'];?>
</div>
<?
if ( is_array( $page['subpages'] ) )
echo \admin\view\Articles::subpages_list( $page['subpages'], $this -> article_pages, $page['id'], $this -> step + 1 );
?>
</li>
<? endforeach;?>
</ol>
<? endif;?>

View File

@@ -0,0 +1,65 @@
<?php
global $gdb;
$grid = new \grid( 'pp_backups' );
$grid -> gdb_opt = $gdb;
$grid -> src = $this -> backups;
$grid -> debug = true;
$grid -> order = [ 'column' => 'name', 'type' => 'DESC' ];
$grid -> columns_view = [
[
'name' => 'Lp.',
'th' => [ 'class' => 'g-lp' ],
'td' => [ 'class' => 'g-center' ],
'autoincrement' => true
],
[
'name' => 'Nazwa',
'db' => 'name',
'sort' => true,
'php' => 'echo "<a href=\'/../backups/[name]\' target=\'_blank\'>[name]</a>";'
],
[
'name' => 'Usuń',
'action' => [ 'type' => 'delete', 'url' => '/admin/backups/backup_delete/name=[name]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
]
];
$grid -> buttons = [
[
'label' => 'Utwórz kopie zapasową',
'url' => '#',
'icon' => 'fa-plus-circle',
'class' => 'confirm btn btn-success btn-sm mr5"'
],
[
'label' => 'Pobierz plik restore.php',
'url' => '/admin/backups/download_restore_file/',
'icon' => 'fa-download',
'class' => 'btn btn-system btn-sm mr5"'
]
];
echo $grid -> draw();
?>
<script>
$(document).ready(function ()
{
$('body').on('click', '.confirm', function ()
{
$.prompt('Na pewno chcesz utworzyć kopię zapasową ?',
{
title: 'Potwierdź utworzenie',
submit: function (e, v, m, f)
{
if ( v === true)
document.location.href = '/admin/backups/backup_save/';
},
buttons: {
'tak': true, 'nie': false
},
focus: 1
});
});
});
</script>

View File

@@ -0,0 +1,180 @@
<script type="text/javascript" src="/libraries/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/libraries/ckeditor/adapters/jquery.js"></script>
<?
\S::set_session( 'admin', true );
global $db;
ob_start();
?>
<div id="settings-tabs">
<ul class="resp-tabs-list settings-tabs">
<li><i class="fa fa-wrench"></i>Ustawienia</li>
<li><i class="fa fa-file"></i>Zawartość</li>
</ul>
<div class="resp-tabs-container settings-tabs">
<div>
<?= \Html::input(
array(
'label' => 'Nazwa',
'name' => 'name',
'id' => 'name',
'value' => $this -> banner['name'],
'class' => 'require'
) );
?>
<?= \Html::input_switch(
array(
'label' => 'Aktywny',
'name' => 'status',
'checked' => $this -> banner['status'] == 1 or ! $this -> banner['id'] ? true : false
)
);
?>
<?= Html::input(
array(
'label' => 'Data rozpoczęcia',
'name' => 'date_start',
'id' => 'date_start',
'value' => $this -> banner['date_start'],
'class' => 'date'
)
);
?>
<?= \Html::input(
array(
'label' => 'Data zakończenia',
'name' => 'date_end',
'id' => 'date_end',
'value' => $this -> banner['date_end'],
'class' => 'date'
) );
?>
<?= \Html::input_switch(
array(
'label' => 'Slajder / Strona główna',
'name' => 'home_page',
'checked' => $this -> banner['home_page'] == 1 ? true : false
)
);
?>
</div>
<div>
<div id="languages-main">
<ul class="resp-tabs-list languages-main">
<? if ( is_array( $this -> languages ) ): foreach ( $this -> languages as $lg ):?>
<? if ( $lg['status'] ):?>
<li><?= $lg['name'];?></a></li>
<? endif;?>
<? endforeach;
endif;?>
</ul>
<div class="resp-tabs-container languages-main">
<? if ( is_array( $this -> languages ) ): foreach ( $this -> languages as $lg ):?>
<? if ( $lg['status'] ):?>
<div>
<?= \Html::input_icon(
array(
'label' => 'Obraz',
'name' => 'src',
'id' => 'src_' . $lg['id'],
'value' => $this -> banner['languages'][ $lg['id'] ]['src'],
'icon_content' => 'przeglądaj',
'icon_js' => "window.open ( 'http://" . $_SERVER['SERVER_NAME'] . "/libraries/filemanager-9.14.0/dialog.php?type=1&popup=1&field_id=src_" . $lg['id'] . "&akey=c3cb2537d25c0efc9e573d059d79c3b8', 'mywindow', 'location=1,status=1,scrollbars=1, width=1100,height=700');"
)
);
?>
<?= \Html::input(
array(
'label' => 'Url',
'name' => 'url',
'id' => 'url_' . $lg['id'],
'value' => $this -> banner['languages'][ $lg['id'] ]['url']
)
);
?>
<?= \Html::textarea(
array(
'label' => 'Kod html',
'name' => 'html',
'id' => 'html_' . $lg['id'],
'value' => $this -> banner['languages'][$lg['id']]['html']
)
);
?>
<?= \Html::textarea(
array(
'label' => 'Treść',
'name' => 'text',
'id' => 'text_' . $lg['id'],
'value' => $this -> banner['languages'][$lg['id']]['text']
)
);
?>
<script type="text/javascript">
$(function () {
$('#text_<?= $lg['id'];?>').ckeditor({
toolbar: 'MyTool',
height: '300'
});
});
</script>
</div>
<? endif;?>
<? endforeach; endif;?>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<?
$out = ob_get_clean();
$grid = new \gridEdit;
$grid -> id = 'banner-edit';
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'Edycja baneru';
$grid -> fields = [
[
'db' => 'id',
'type' => 'hidden',
'value' => $this -> banner['id']
]
];
$grid -> external_code = $out;
$grid -> actions = [
'save' => [ 'url' => '/admin/banners/banner_save/', 'back_url' => '/admin/banners/view_list/' ],
'cancel' => [ 'url' => '/admin/banners/view_list/' ]
];
$grid -> persist_edit = true;
$grid -> id_param = 'id';
echo $grid -> draw();
?>
<script type="text/javascript">
$(function ()
{
disable_menu();
$('input[type="text"].date').datetimepicker({
format: "YYYY-MM-DD",
pickTime: false
});
$( '#settings-tabs' ).easyResponsiveTabs({
width: 'auto',
fit: true,
tabidentify: 'settings-tabs',
type: 'vertical'
});
$('#languages-main').easyResponsiveTabs({
width: 'auto',
fit: true,
tabidentify: 'languages-main'
});
});
</script>
<script>CKEDITOR.dtd.$removeEmpty['span'] = false;</script>

View File

@@ -0,0 +1,78 @@
<?php
global $gdb;
$grid = new \grid( 'pp_banners' );
$grid -> gdb_opt = $gdb;
$grid -> order = [ 'column' => 'name', 'type' => 'ASC' ];
$grid -> search = [
[ 'name' => 'Nazwa', 'db' => 'name', 'type' => 'text' ],
[ 'name' => 'Aktywny', 'db' => 'status', 'type' => 'select', 'replace' => [ 'array' => [ 0 => 'nie', 1 => 'tak' ] ] ]
];
$grid -> columns_view = [
[
'name' => 'Lp.',
'th' => [ 'class' => 'g-lp' ],
'td' => [ 'class' => 'g-center' ],
'autoincrement' => true
],
[
'name' => 'Nazwa',
'db' => 'name',
'sort' => true,
'php' => 'echo "<a href=\"/admin/banners/banner_edit/id=[id]\">[name]</a>";'
],
[
'name' => 'Aktywny',
'db' => 'status',
'replace' => [ 'array' => [ 0 => '<span style="color: #FF0000;">nie</span>', 1 => 'tak' ] ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
'td' => [ 'class' => 'g-center' ]
],
[
'name' => 'Strona główna',
'db' => 'home_page',
'replace' => [ 'array' => [ 0 => 'nie', 1 => '<span class="text-system">tak</span>' ] ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
'td' => [ 'class' => 'g-center' ]
],
[
'name' => 'Slajder',
'db' => 'home_page',
'replace' => [ 'array' => [ 1 => 'nie', 0 => '<span class="text-system">tak</span>' ] ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
'td' => [ 'class' => 'g-center' ]
],
[
'name' => 'Data rozpoczęcia',
'th' => [ 'class' => 'g-center', 'style' => 'width: 140px;' ],
'td' => [ 'class' => 'g-center' ],
'php' => 'if ( "[date_start]" ) echo date( "Y-m-d", strtotime( "[date_start]" ) ); else echo "-";'
],
[
'name' => 'Data zakończenia',
'th' => [ 'class' => 'g-center', 'style' => 'width: 140px;' ],
'td' => [ 'class' => 'g-center' ],
'php' => 'if ( "[date_end]" ) echo date( "Y-m-d", strtotime( "[date_end]" ) ); else echo "-";'
],
[
'name' => 'Edytuj',
'action' => [ 'type' => 'edit', 'url' => '/admin/banners/banner_edit/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
],
[
'name' => 'Usuń',
'action' => [ 'type' => 'delete', 'url' => '/admin/banners/banner_delete/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
]
];
$grid -> buttons = [
[
'label' => 'Dodaj baner',
'url' => '/admin/banners/banner_edit/',
'icon' => 'fa-plus-circle',
'class' => 'btn-success'
]
];
echo $grid -> draw();

View File

@@ -0,0 +1,56 @@
<?php
global $db;
ob_start();
?>
<div class="form-group ">
<label class="col-lg-3 control-label text-right">Email:</label>
<div class="col-lg-9">
<p><?= $this -> email['email'];?></p>
</div>
</div>
<div class="form-group ">
<label class="col-lg-3 control-label text-right">Numer telefonu:</label>
<div class="col-lg-9">
<p><?= $this -> email['phone'];?></p>
</div>
</div>
<div class="form-group ">
<label class="col-lg-3 control-label text-right">Temat:</label>
<div class="col-lg-9">
<p><?= $this -> email['title'];?></p>
</div>
</div>
<div class="form-group ">
<label class="col-lg-3 control-label text-right">Wiadomość:</label>
<div class="col-lg-9">
<p><?= nl2br($this -> email['mail']);?></p>
</div>
</div>
<div class="form-group ">
<label class="col-lg-3 control-label text-right">Data wysłania:</label>
<div class="col-lg-9">
<p><?= date( "Y-m-d H:i", strtotime( $this -> email[add_date] ) )?></p>
</div>
</div>
<?
$out = ob_get_clean();
$grid = new \gridEdit();
$grid -> id = 'email-details';
$grid -> gdb_opt = $gdb;
$grid -> title = 'Szczegóły Wiadomości';
$grid -> external_code = $out;
$grid -> actions = [
'save' => [ '' => '/admin/emails/view_list/', 'back_url' => '/admin/emails/view_list/'],
'cancel' => [ 'url' => '/admin/emails/view_list/' ]
];
$grid -> form = false;
echo $grid -> draw();
?>
<style>
#g-edit-save{
display: none;
}
</style>

View File

@@ -0,0 +1,56 @@
<?php
global $db;
ob_start();
?>
<div class="form-group ">
<label class="col-lg-4 control-label text-right">Email:</label>
<div class="col-lg-8">
<p><?= $this -> email['email'];?></p>
</div>
</div>
<div class="form-group ">
<label class="col-lg-4 control-label text-right">Numer telefonu:</label>
<div class="col-lg-8">
<p> <?= $this -> email['phone'];?></p>
</div>
</div>
<div class="form-group ">
<label class="col-lg-4 control-label text-right">Temat:</label>
<div class="col-lg-8">
<p> <?= $this -> email['title'];?></p>
</div>
</div>
<div class="form-group ">
<label class="col-lg-4 control-label text-right">Wiadomość:</label>
<div class="col-lg-8">
<p> <?= nl2br($this -> email['mail']);?></p>
</div>
</div>
<div class="form-group ">
<label class="col-lg-4 control-label text-right">Data wysłania:</label>
<div class="col-lg-8">
<p> <?=date( "Y-m-d H:i", strtotime( $this -> email[add_date] ) )?></p>
</div>
</div>
<?
$out = ob_get_clean();
$grid = new \gridEdit();
$grid -> id = 'email-detali';
$grid -> gdb_opt = $gdb;
$grid -> title = 'Szczegóły Wiadomości';
$grid -> external_code = $out;
$grid -> actions = [
'save' => [ '' => '/admin/emails/view_list/', 'back_url' => '/admin/emails/view_list/'],
'cancel' => [ 'url' => '/admin/emails/view_list/' ]
];
$grid -> form = false;
echo $grid -> draw();
?>
<style>
#g-edit-save{
display: none;
}
</style>

View File

@@ -0,0 +1,41 @@
<?php
global $gdb;
$grid = new \grid( 'pp_contact_emails' );
$grid -> gdb_opt = $gdb;
$grid -> columns_view = [
[
'name' => 'Lp.',
'th' => [ 'class' => 'g-lp' ],
'td' => [ 'class' => 'g-center' ],
'autoincrement' => true
],
[
'name' => 'Data',
'db' => 'add_date',
'td' => [ ],
'th' => ['style' => 'width: 220px;' ],
'php' => 'echo date( "Y-m-d H:i", strtotime( "[add_date]" ) );',
'sort' => true
],
[
'name' => 'Email',
'db' => 'email',
'content' => '<a href="/admin/emails/email_details/id=[id]">[email]</a>',
'sort' => true ,
],
[
'name' => 'Temat',
'db' => 'title',
],
[
'name' => 'Szczegóły',
'content' => '<a href="/admin/emails/email_details/id=[id]">Szczegóły</a>',
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
]
];
echo $grid -> draw();

View File

@@ -0,0 +1 @@
<iframe src="/libraries/filemanager-9.14.0/dialog.php?akey=c3cb2537d25c0efc9e573d059d79c3b8" style="border: 0px; width: 100%; height: 800px; background: #FFF; padding: 5px;"></iframe>

View File

@@ -0,0 +1,25 @@
<?
$out = '<a ';
$out .= 'class="btn ' . $this -> params['class'] . '" ';
if ( $this -> params['style'] )
$out .= 'style="' . $this -> params['style'] . '" ';
if ( $this -> params['js'] )
$out .= 'onclick="' . htmlspecialchars( $this -> params['js'] ) . '" ';
if ( $this -> params['url'] )
$out .= 'href="' . htmlspecialchars( $this -> params['url'] ) . '" ';
if ( $this -> params['id'] )
$out .= 'id="' . $this -> params['id'] . '" ';
if ( $this -> params['title'] )
$out .= 'title="' . htmlspecialchars( $this -> params['title'] ) . '" ';
$out .= '>';
if ( $this -> params['icon'] )
$out .= '<i class="fa ' . $this -> params['icon'] . ' mr5"></i>';
$out .= $this -> params['text'];
$out .= '</a>';
echo $out;

View File

@@ -0,0 +1,8 @@
<div class="form-group">
<label class="col-lg-3 control-label"><?= $this -> params['label'];?>:</label>
<div class="col-lg-9">
<p class="form-control-static" id="<?= $this -> params['id'];?>">
<?= $this -> params['text'];?>
</p>
</div>
</div>

View File

@@ -0,0 +1,70 @@
<?
if ( $this -> params['label'] )
{
$out .= '<div class="form-group ';
if ( $this -> params['inline'] )
$out .= 'pl10 pr10';
$out .= '">';
$out .= '<label class="';
if ( !$this -> params['inline'] )
$out .= 'col-lg-3 ';
if ( $this -> params['inline'] )
$out .= 'mb5 ';
$out .= 'control-label">' . $this -> params['label'] . ':</label>';
$out .= '<div class="';
if ( !$this -> params['inline'] )
$out .= 'col-lg-9';
$out .= '">';
}
$out .= '<div class="input-group">';
$out .= '<input ';
$out .= 'type="' . $this -> params['type'] . '" ';
if ( $this -> params['id'] )
$out .= 'id="' . $this -> params['id'] . '" ';
if ( $this -> params['class'] or $this -> params['label'] )
{
if ( $this -> params['label'] )
$out .= 'class="' . $this -> params['class'] . ' form-control" ';
else if ( $this -> params['class'] )
$out .= 'class="' . $this -> params['class'] . '" ';
}
$out .= 'name="' . $this -> params['name'] . '" ';
$out .= 'value="' . $this -> secureHTML( $this -> params['value'] ) . '" ';
if ( $this -> params['js'] )
$out .= 'onchange="' . htmlspecialchars( $this -> params['js'] ) . '" ';
if ( $this -> params['js_key'] )
$out .= 'onkeyup="' . htmlspecialchars( $this -> params['js_key'] ) . '" ';
if ( $this -> params['style'] )
$out .= 'style="' . $this -> params['style'] . '" ';
if ( $this -> params['readonly'] )
$out .= 'readonly="readonly" ';
if ( $this -> params['autocomplete'] == 'off' )
$out .= 'autocomplete="off" ';
$out .= ' />';
$out .= '<span class="input-group-addon btn btn-info ' . $this -> params['icon_class'] . '"';
if ( $this -> params['icon_js'] )
$out .= 'onclick="' . htmlspecialchars( $this -> params['icon_js'] ) . '" ';
$out .= '>';
$out .= $this -> params['icon_content'];
$out .= '</span>';
$out .= '</div>';
if ( $this -> params['label'] )
{
$out .= '</div>';
$out .= '</div>';
}
echo $out;

View File

@@ -0,0 +1,36 @@
<?
if ( $this -> params['label'] )
{
$out .= '<div class="form-group">';
$out .= '<label class="col-lg-3 control-label">' . $this -> params['label'] . ':</label>';
$out .= '<div class="col-lg-9 pt5">';
}
$out .= '<div class="switch switch-primary round switch-inline">';
$out .= '<input ';
if ( $this -> params['id'] )
$out .= 'id="' . $this -> params['id'] . '" ';
else
$out .= 'id="' . $this -> params['name'] . '" ';
$out .= 'name="' . $this -> params['name'] . '" type="checkbox"';
if ( $this -> params['checked'] )
$out .= 'checked="checked" ';
$out .= '>';
$out .= '<label for="';
if ( $this -> params['id'] )
$out .= $this -> params['id'];
else
$out .= $this -> params['name'];
$out .= '"></label>';
$out .= '</div>';
if ( $this -> params['label'] )
{
$out .= '</div>';
$out .= '</div>';
}
echo $out;

View File

@@ -0,0 +1,63 @@
<?
if ( $this -> params['label'] )
{
$out .= '<div class="form-group ';
if ( $this -> params['inline'] )
$out .= 'pl10 pr10';
$out .= '">';
$out .= '<label class="';
if ( !$this -> params['inline'] )
$out .= 'col-lg-3 ';
if ( $this -> params['inline'] )
$out .= 'mb5 ';
$out .= 'control-label">' . $this -> params['label'] . ':</label>';
$out .= '<div class="';
if ( !$this -> params['inline'] )
$out .= 'col-lg-9';
$out .= '">';
}
$out .= '<input ';
$out .= 'type="' . $this -> params['type'] . '" ';
if ( $this -> params['id'] )
$out .= 'id="' . $this -> params['id'] . '" ';
if ( $this -> params['class'] or $this -> params['label'] )
{
if ( $this -> params['label'] )
$out .= 'class="' . $this -> params['class'] . ' form-control" ';
else if ( $this -> params['class'] )
$out .= 'class="' . $this -> params['class'] . '" ';
}
$out .= 'name="' . $this -> params['name'] . '" ';
$out .= 'value="' . $this -> secureHTML( $this -> params['value'] ) . '" ';
if ( $this -> params['style'] )
$out .= 'style="' . $this -> params['style'] . '" ';
if ( $this -> params['js'] )
$out .= 'onchange="' . htmlspecialchars( $this -> params['js'] ) . '" ';
if ( $this -> params['js_key'] )
$out .= 'onkeyup="' . htmlspecialchars( $this -> params['js_key'] ) . '" ';
if ( $this -> params['readonly'] )
$out .= 'readonly="readonly" ';
if ( $this -> params['autocomplete'] == 'off' )
$out .= 'autocomplete="off" ';
if ( is_array( $this -> params['params'] ) and count( $this -> params['params'] ) ) foreach ( $this -> params['params'] as $key => $val )
$out .= $key . '="' . $val . '" ';
$out .= ' />';
if ( $this -> params['label'] )
{
$out .= '</div>';
$out .= '</div>';
}
echo $out;

View File

@@ -0,0 +1,8 @@
<div class="panel <?= $this -> params['class'];?>">
<div class="panel-heading">
<span class="panel-title"><?= $this -> params['title'];?></span>
</div>
<div class="panel-body">
<?= $this -> params['content'];?>
</div>
</div>

View File

@@ -0,0 +1,62 @@
<?
if ( $this -> params['label'] )
{
$out .= '<div class="form-group ';
if ( $this -> params['inline'] )
$out .= 'pl10 pr10';
$out .= '">';
$out .= '<label class="';
if ( !$this -> params['inline'] )
$out .= 'col-lg-3 ';
if ( $this -> params['inline'] )
$out .= 'mb5 ';
$out .= 'control-label">' . $this -> params['label'] . ':</label>';
$out .= '<div class="';
if ( !$this -> params['inline'] )
$out .= 'col-lg-9';
$out .= '">';
}
$out .= '<select ';
if ( $this -> params['id'] )
$out .= 'id="' . $this -> params['id'] . '" ';
if ( $this -> params['class'] or $this -> params['label'] )
{
if ( $this -> params['label'] )
$out .= 'class="' . $this -> params['class'] . ' form-control" ';
else if ( $this -> params['class'] )
$out .= 'class="' . $this -> params['class'] . '" ';
}
$out .= 'name="' . $this -> params['name'] . '" ';
if ( $this -> params['style'] )
$out .= 'style="' . $this -> params['style'] . '" ';
if ( $this -> params['readonly'] )
$out .= 'readonly="readonly" ';
if ( is_array( $this -> params['params'] ) and count( $this -> params['params'] ) ) foreach ( $this -> params['params'] as $key => $val )
$out .= $key . '="' . $val . '" ';
$out .= '>';
if ( $this -> params['empty'] )
$out .= '<option value="">--- ' . mb_strtolower( $this -> params['label'], 'UTF-8' ) . ' ---</option>';
if ( is_array( $this -> params['values'] ) ) foreach ( $this -> params['values'] as $key => $val )
{
$out .= '<option value="' . $key . '"'; if ( $key == $this -> params['value'] and $this -> params['value'] !== null ) $out .= 'selected="selected"'; $out .='>' . $val . '</option>';
}
$out .= '</select>';
if ( $this -> params['label'] )
{
$out .= '</div>';
$out .= '</div>';
}
echo $out;

View File

@@ -0,0 +1,52 @@
<?
if ( $this -> params['label'] )
{
$out .= '<div class="form-group ';
if ( $this -> params['inline'] )
$out .= 'pl10 pr10';
$out .= '">';
$out .= '<label class="';
if ( !$this -> params['inline'] )
$out .= 'col-lg-3 ';
if ( $this -> params['inline'] )
$out .= 'mb5 ';
$out .= 'control-label">' . $this -> params['label'] . ':</label>';
$out .= '<div class="';
if ( !$this -> params['inline'] )
$out .= 'col-lg-9';
$out .= '">';
}
$out .= '<textarea ';
if ( $this -> params['id'] )
$out .= 'id="' . $this -> params['id'] . '" ';
if ( $this -> params['class'] or $this -> params['label'] )
{
if ( $this -> params['label'] )
$out .= 'class="' . $this -> params['class'] . ' form-control" ';
else if ( $this -> params['class'] )
$out .= 'class="' . $this -> params['class'] . '" ';
}
if ( $this -> params['js'] )
$out .= 'onchange="' . htmlspecialchars( $this -> params['js'] ) . '" ';
if ( $this -> params['js_key'] )
$out .= 'onkeyup="' . htmlspecialchars( $this -> params['js_key'] ) . '" ';
$out .= 'name="' . $this -> params['name'] . '" ';
if ( $this -> params['style'] )
$out .= 'style="' . $this -> params['style'] . '" ';
$out .= ' rows="' . $this -> params['rows'] . '">' . $this -> secureHTML( $this -> params['value'] ) . '</textarea>';
if ( $this -> params['label'] )
{
$out .= '</div>';
$out .= '</div>';
}
echo $out;

View File

@@ -0,0 +1,98 @@
<?
global $db;
ob_start();
echo \Html::input(
array(
'type' => 'hidden',
'name' => 'o',
'value' => $this -> language['o']
)
);
echo \Html::input(
array(
'label' => 'Język',
'type' => 'text',
'class' => 'require',
'name' => 'name',
'value' => $this -> language['name']
)
);
if ( $this -> language['id'] )
{
echo \Html::input(
array(
'type' => 'hidden',
'name' => 'id',
'value' => $this -> language['id']
)
);
}
else
{
echo \Html::input(
array(
'label' => 'ID (2 znaki)',
'class' => 'require',
'type' => 'text',
'name' => 'id'
)
);
}
echo \Html::input_switch(
array(
'label' => 'Aktywny',
'name' => 'status',
'checked' => $this -> language['status'] == 1 ? true : false
)
);
echo \Html::input_switch(
array(
'label' => 'Domyślny',
'name' => 'start',
'checked' => $this -> language['start'] == 1 ? true : false
)
);
echo '<hr />';
echo \Html::input(
array(
'label' => 'Domena',
'type' => 'text',
'name' => 'domain',
'value' => $this -> language['domain']
)
);
echo \Html::input_switch(
array(
'label' => 'Domena domyślna',
'name' => 'main_domain',
'checked' => $this -> language['main_domain'] == 1 ? true : false
)
);
$out = ob_get_clean();
$grid = new \gridEdit;
$grid -> id = 'language-edit';
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'Edycja języka';
$grid -> external_code = $out;
$grid -> actions = [
'save' => [ 'url' => '/admin/languages/language_save/', 'back_url' => '/admin/languages/view_list/' ],
'cancel' => [ 'url' => '/admin/languages/view_list/' ]
];
$grid -> persist_edit = true;
$grid -> id_param = 'id';
echo $grid -> draw();
?>
<script type="text/javascript">
$( function()
{
disable_menu();
$( 'input[type="text"].date' ).datetimepicker({
format: "YYYY-MM-DD",
pickTime: false
});
});
</script>

View File

@@ -0,0 +1,72 @@
<?php
global $gdb;
$grid = new \grid( 'pp_langs' );
$grid -> gdb_opt = $gdb;
$grid -> order = [ 'column' => 'name', 'type' => 'ASC' ];
$grid -> search = [
[ 'name' => 'Język', 'db' => 'name', 'type' => 'text' ],
[ 'name' => 'Aktywny', 'db' => 'status', 'type' => 'select', 'replace' => [ 'array' => [ 0 => 'nie', 1 => 'tak' ] ] ],
[ 'name' => 'Domyślny', 'db' => 'start', 'type' => 'select', 'replace' => [ 'array' => [ 0 => 'nie', 1 => 'tak' ] ] ]
];
$grid -> columns_view = [
[
'name' => 'Lp.',
'th' => [ 'class' => 'g-lp' ],
'td' => [ 'class' => 'g-center' ],
'autoincrement' => true
],
[
'name' => 'Domyślny',
'db' => 'start',
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
'td' => [ 'class' => 'g-center' ],
'php' => 'if ( [start] ) echo "<span class=\'text-system\'>tak</span>"; else echo "nie";'
],
[
'name' => 'Aktywny',
'db' => 'status',
'replace' => [ 'array' => [ 0 => '<span style="color: #FF0000;">nie</span>', 1 => 'tak' ] ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
'td' => [ 'class' => 'g-center' ]
],
[
'name' => 'Język',
'db' => 'name',
'php' => 'echo "<a href=\'/admin/languages/language_edit/id=[id]\'>[name]</a>";',
'sort' => true
],
[
'name' => 'Domena',
'db' => 'domain',
'sort' => true
],
[
'name' => 'Domena domyślna',
'db' => 'main_domain',
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
'td' => [ 'class' => 'g-center' ],
'php' => 'if ( [main_domain] ) echo "<span class=\'text-system\'>tak</span>"; else echo "nie";'
],
[
'name' => 'Edytuj',
'action' => [ 'type' => 'edit', 'url' => '/admin/languages/language_edit/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
],
[
'name' => 'Usuń',
'action' => [ 'type' => 'delete', 'url' => '/admin/languages/language_delete/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
]
];
$grid -> buttons = [
[
'label' => 'Dodaj język',
'url' => '/admin/languages/language_edit/',
'icon' => 'fa-plus-circle',
'class' => 'btn-success'
]
];
echo $grid -> draw();

View File

@@ -0,0 +1,60 @@
<?
global $db;
ob_start();
?>
<?
echo \Html::input(
array(
'type' => 'text',
'label' => 'Tekst',
'name' => 'text',
'class' => 'require',
'value' => $this -> translation['text']
)
);
if ( is_array( $this -> languages ) ): foreach ( $this -> languages as $language ):
echo \Html::input(
array(
'type' => 'text',
'label' => $language['name'],
'name' => $language['id'],
'value' => $this -> translation[$language['id']]
) );
endforeach;
endif;
$out = ob_get_clean();
$grid = new \gridEdit;
$grid -> id = 'translation-edit';
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'Edycja tłumaczenia';
$grid -> fields = [
[
'db' => 'id',
'type' => 'hidden',
'value' => $this -> translation['id']
]
];
$grid -> external_code = $out;
$grid -> actions = [
'save' => [ 'url' => '/admin/languages/translation_save/', 'back_url' => '/admin/languages/translation_list/' ],
'cancel' => [ 'url' => '/admin/languages/translation_list/' ]
];
$grid -> persist_edit = true;
$grid -> id_param = 'id';
echo $grid -> draw();
?>
<script type="text/javascript">
$(function ()
{
disable_menu();
$('input[type="text"].date').datetimepicker({
format: "YYYY-MM-DD",
pickTime: false
});
});
</script>

View File

@@ -0,0 +1,44 @@
<?php
global $gdb;
$grid = new \grid( 'pp_langs_translations' );
$grid -> gdb_opt = $gdb;
$grid -> order = [ 'column' => 'text', 'type' => 'ASC' ];
$grid -> search = [
[ 'name' => 'Tekst', 'db' => 'text', 'type' => 'text' ]
];
$grid -> columns_view = [
[
'name' => 'Lp.',
'th' => [ 'class' => 'g-lp' ],
'td' => [ 'class' => 'g-center' ],
'autoincrement' => true
],
[
'name' => 'Tekst',
'db' => 'text',
'php' => 'echo "<a href=\'/admin/languages/translation_edit/id=[id]\'>[text]</a>";',
'sort' => true
],
[
'name' => 'Edytuj',
'action' => [ 'type' => 'edit', 'url' => '/admin/languages/translation_edit/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
],
[
'name' => 'Usuń',
'action' => [ 'type' => 'delete', 'url' => '/admin/languages/translation_delete/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
]
];
$grid -> buttons = [
[
'label' => 'Dodaj tłumaczenie',
'url' => '/admin/languages/translation_edit/',
'icon' => 'fa-plus-circle',
'class' => 'btn-success'
]
];
echo $grid -> draw();

View File

@@ -0,0 +1,262 @@
<link rel="stylesheet" href="/libraries/codemirror/lib/codemirror.css" />
<link rel="stylesheet" href="/libraries/codemirror/theme/material.css" />
<script type="text/javascript" src="/libraries/jquery-nested-sortable/jquery.mjs.nestedSortable.js"></script>
<script type="text/javascript" src="/libraries/codemirror/lib/codemirror.js"></script>
<script type="text/javascript" src="/libraries/codemirror/mode/css/css.js"></script>
<script type="text/javascript" src="/libraries/codemirror/mode/xml/xml.js"></script>
<script type="text/javascript" src="/libraries/codemirror/mode/javascript/javascript.js"></script>
<script type="text/javascript" src="/libraries/codemirror/mode/htmlmixed/htmlmixed.js"></script>
<script type="text/javascript" src="/libraries/codemirror/addon/mode/multiplex.js"></script>
<script type="text/javascript">
$( function()
{
var code_html = CodeMirror.fromTextArea( document.getElementById( "html" ),{
lineWrapping: true,
mode: "text/html"
});
code_html.on( 'change', function(cm) {
$( '#html' ).val( cm.getValue() );
});
code_html.setOption( "theme", 'material' );
var code_css = CodeMirror.fromTextArea( document.getElementById( "css" ),{
lineWrapping: true,
mode: "css"
});
code_css.on( 'change', function(cm) {
$( '#css' ).val( cm.getValue() );
});
code_css.setOption( "theme", 'material' );
var code_js = CodeMirror.fromTextArea( document.getElementById( "js" ),{
lineWrapping: true,
mode: "javascript"
});
code_js.on( 'change', function(cm) {
$( '#js' ).val( cm.getValue() );
});
code_js.setOption( "theme", 'material' );
var code_m_html = CodeMirror.fromTextArea( document.getElementById( "m_html" ),{
lineWrapping: true,
mode: "text/html"
});
code_m_html.on( 'change', function(cm) {
$( '#m_html' ).val( cm.getValue() );
});
code_m_html.setOption( "theme", 'material' );
var code_m_css = CodeMirror.fromTextArea( document.getElementById( "m_css" ),{
lineWrapping: true,
mode: "css"
});
code_m_css.on( 'change', function(cm) {
$( '#m_css' ).val( cm.getValue() );
});
code_m_css.setOption( "theme", 'material' );
var code_m_js = CodeMirror.fromTextArea( document.getElementById( "m_js" ),{
lineWrapping: true,
mode: "javascript"
});
code_m_js.on( 'change', function(cm) {
$( '#m_js' ).val( cm.getValue() );
});
code_m_js.setOption( "theme", 'material' );
disable_menu();
$( '#layout-tabs' ).easyResponsiveTabs(
{
width: 'auto',
fit: true,
tabidentify: 'layout-tabs',
type: 'vertical'
});
$( 'body' ).on( 'click', '.select-page', function()
{
$( this ).parent( 'div' ).children( 'div.icheckbox_minimal-blue' ).children( 'input' ).iCheck( 'toggle' );
});
$('ol.sortable').nestedSortable(
{
forcePlaceholderSize: true,
handle: 'div',
helper: 'clone',
items: 'li',
opacity: .6,
placeholder: 'placeholder',
revert: 250,
tabSize: 25,
tolerance: 'pointer',
toleranceElement: '> div',
maxLevels: 3,
isTree: true,
expandOnHover: 700,
isAllowed: function()
{
return false;
}
});
$( '.disclose' ).on( 'click', function()
{
$( this ).closest( 'li' ).toggleClass( 'sort-collapsed' ).toggleClass( 'sort-expanded' );
});
$( '.disclose' ).mousedown( function(e)
{
if ( e.which === 1 ) {
if ( $( this ).parent( 'div' ).hasClass( 'content_menu' ) )
{
var menu_id = $( this ).parent( 'div' ).parent( 'li' ).attr( 'menu' );
$.ajax(
{
type: 'POST',
cache: false,
url: '/admin/ajax.php',
data: {
a: 'cookie_menus',
menu_id: menu_id
}
});
}
else
{
var page_id = $( this ).parent( 'div' ).parent( 'li' ).attr( 'id' );
$.ajax(
{
type: 'POST',
cache: false,
url: '/admin/ajax.php',
data: {
a: 'cookie_pages',
page_id: page_id
}
});
}
}
});
<?php
$array = unserialize( $_COOKIE[ 'cookie_pages' ] );
if ( is_array( $array ) ): foreach ( $array as $key => $val ):
if ( $val ):
?>$( '.<?= $key;?>' ).children( 'div' ).children( 'span.disclose' ).click();<?
endif;
endforeach; endif;
$array = unserialize( $_COOKIE[ 'cookie_menus' ] );
if ( is_array( $array ) ): foreach ( $array as $key => $val ):
if ( $val ):
?>$( '.menu_<?= $key;?>' ).children( 'div' ).children( 'span.disclose' ).click();<?
endif;
endforeach; endif;
?>
});
</script>
<?
global $db;
ob_start();
?>
<div id="layout-tabs">
<ul class="resp-tabs-list layout-tabs">
<li><i class="fa fa-wrench"></i>Ustawienia</li>
<li><i class="fa fa-html5"></i>HTML</li>
<li><i class="fa fa-html5"></i>CSS</li>
<li><i class="fa fa-html5"></i>JS</li>
<li><i class="fa fa-mobile"></i>HTML - mobile</li>
<li><i class="fa fa-mobile"></i>CSS - mobile</li>
<li><i class="fa fa-mobile"></i>JS - mobile</li>
</ul>
<div class="resp-tabs-container layout-tabs">
<div>
<?= \Html::input(
array(
'label' => 'Nazwa',
'name' => 'name',
'id' => 'name',
'value' => $this -> layout['name']
)
);?>
<?= \Html::input_switch(
array(
'label' => 'Szablon domyślny',
'name' => 'status',
'checked' => $this -> layout['status'] == 1 ? true : false
)
);?>
<div class="form-group">
<label class="col-lg-3 control-label">Strony:</label>
<div class="col-lg-9">
<?
if ( is_array( $this -> menus ) ) foreach ( $this -> menus as $menu )
{
?>
<div class="menu_sortable">
<ol class="sortable" id="sortable_<?= $menu['id'];?>">
<li id="list_<?= $menu['id'];?>" class="menu_<?= $menu['id'];?>" menu="<?= $menu['id'];?>">
<div class="context_0 content content_menu" <? if ( !$menu['status'] ) echo 'style="color: #cc0000;"';?>>
<span class="disclose"><span></span></span>
Menu: <b><?= $menu['name'];?></b>
</div>
<?= \admin\view\Layouts::subpages_list( \admin\factory\Pages::menu_pages( $menu['id'] ), $this -> layout['pages'] );?>
</li>
</ol>
</div>
<?
}
?>
</div>
</div>
</div>
<div>
<textarea name="html" id="html" style="width: 100%; height: 500px; border: 0; padding: 10px; margin: -10px 0 -15px; font-size: 12px; box-sizing: border-box;"><?= htmlspecialchars( $this -> layout['html'] );?></textarea>
</div>
<div>
<textarea name="css" id="css" style="width: 100%; height: 500px; border: 0; padding: 10px; margin: -10px 0 -15px; font-size: 12px; box-sizing: border-box;"><?= htmlspecialchars( $this -> layout['css'] );?></textarea>
</div>
<div>
<textarea name="js" id="js" style="width: 100%; height: 500px; border: 0; padding: 10px; margin: -10px 0 -15px; font-size: 12px; box-sizing: border-box;"><?= htmlspecialchars( $this -> layout['js'] );?></textarea>
</div>
<div>
<textarea name="m_html" id="m_html" style="width: 100%; height: 500px; border: 0; padding: 10px; margin: -10px 0 -15px; font-size: 12px; box-sizing: border-box;"><?= htmlspecialchars( $this -> layout['m_html'] );?></textarea>
</div>
<div>
<textarea name="m_css" id="m_css" style="width: 100%; height: 500px; border: 0; padding: 10px; margin: -10px 0 -15px; font-size: 12px; box-sizing: border-box;"><?= htmlspecialchars( $this -> layout['m_css'] );?></textarea>
</div>
<div>
<textarea name="m_js" id="m_js" style="width: 100%; height: 500px; border: 0; padding: 10px; margin: -10px 0 -15px; font-size: 12px; box-sizing: border-box;"><?= htmlspecialchars( $this -> layout['m_js'] );?></textarea>
</div>
</div>
<div class="clear"></div>
<?
$out = ob_get_clean();
$grid = new \gridEdit;
$grid -> id = 'layout-edit';
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'Edycja szablonu';
$grid -> fields = [
[
'db' => 'id',
'type' => 'hidden',
'value' => $this -> layout['id']
]
];
$grid -> actions = [
'save' => [ 'url' => '/admin/layouts/layout_save/', 'back_url' => '/admin/layouts/view_list/' ],
'cancel' => [ 'url' => '/admin/layouts/view_list/' ]
];
$grid -> external_code = $out;
$grid -> persist_edit = true;
$grid -> id_param = 'id';
echo $grid -> draw();
?>

View File

@@ -0,0 +1,47 @@
<?php
global $gdb;
$grid = new \grid( 'pp_layouts' );
$grid -> gdb_opt = $gdb;
$grid -> order = [ 'column' => 'name', 'type' => 'ASC' ];
$grid -> search = [
[ 'name' => 'Nazwa', 'db' => 'name', 'type' => 'text' ],
[ 'name' => 'Szablon domyślny', 'db' => 'status', 'type' => 'select', 'replace' => [ 'array' => [ 0 => 'nie', 1 => 'tak' ] ] ]
];
$grid -> columns_view = [
[
'name' => 'Lp.',
'th' => [ 'class' => 'g-lp' ],
'td' => [ 'class' => 'g-center' ],
'autoincrement' => true
],
[
'name' => 'Nazwa',
'db' => 'name',
'php' => 'echo "<a href=\'/admin/layouts/layout_edit/id=[id]\'>[name]</a>";',
'sort' => true
],
[
'name' => 'Szablon domyślny',
'db' => 'status',
'replace' => [ 'array' => [ 0 => 'nie', 1 => '<span class="text-system">tak</span>' ] ],
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ]
],
[
'name' => 'Akcja',
'action' => [ 'type' => 'edit', 'url' => '/admin/layouts/layout_edit/id=[id]' ],
'th' => [ 'class' => 'g-center' ],
'td' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ]
],
[
'name' => 'Akcja',
'action' => [ 'type' => 'delete', 'url' => '/admin/layouts/layout_delete/id=[id]' ],
'th' => [ 'class' => 'g-center' ],
'td' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ]
]
];
$grid -> buttons = [
[ 'label' => 'Dodaj szablon', 'url' => '/admin/layouts/layout_edit/', 'icon' => 'fa-plus-circle', 'class' => 'btn-success' ]
];
echo $grid -> draw();

View File

@@ -0,0 +1,16 @@
<? if ( is_array( $this -> pages ) ):?>
<ol>
<? foreach ( $this -> pages as $page ):?>
<li id="list_<?= $page['id'];?>" idk="<?= $page['id'];?>" class="list_<?= $page['id'];?>" menu="<?= $page['menu_id'];?>">
<div class="content <?= $this -> step < 2 ? $tmp = 'content_page' : $tmp = 'content_page_last_level';?>" <? if ( !$page['status'] ) echo 'style="color: #cc0000;"';?>>
<span class="disclose"><span></span></span>
<input type="checkbox" class="g-checkbox" name="pages" value="<?= $page['id'];?>" <? if ( is_array( $this -> layout_pages ) and in_array( $page['id'], $this -> layout_pages ) ):?>checked="checked"<? endif;?> /><?= $page['title'];?>
</div>
<?
if ( is_array( $page['subpages'] ) )
echo \admin\view\Layouts::subpages_list( $page['subpages'], $this -> layout_pages, $page['id'], $this -> step + 1 );
?>
</li>
<? endforeach;?>
</ol>
<? endif;?>

View File

@@ -0,0 +1,63 @@
<script type="text/javascript" src="/libraries/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/libraries/ckeditor/adapters/jquery.js"></script>
<?
global $db;
ob_start();
?>
<?= \Html::input(
array(
'label' => 'Nazwa',
'name' => 'name',
'id' => 'name',
'value' => $this -> email_template['name'],
'inline' => true,
'readonly' => $this -> email_template['is_admin'] ? true : false
)
);?>
<?= \Html::textarea(
array(
'label' => 'Treść',
'name' => 'text',
'id' => 'text',
'value' => $this ->email_template['text'],
'inline' => true
)
);?>
<?
$out = ob_get_clean();
$grid = new \gridEdit;
$grid -> id = 'email-templates-edit';
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'Edycja szablonu newslettera';
$grid -> fields = [
[
'db' => 'id',
'type' => 'hidden',
'value' => $this -> email_template['id']
]
];
$grid -> external_code = $out;
$grid -> actions = [
'save' => [
'url' => '/admin/newsletter/template_save/',
'back_url' => $this -> email_template['is_admin'] ? '/admin/newsletter/email_templates_admin/' : '/admin/newsletter/email_templates_user/'
],
'cancel' => [
'url' => $this -> email_template['is_admin'] ? '/admin/newsletter/email_templates_admin/' : '/admin/newsletter/email_templates_user/'
]
];
$grid -> persist_edit = true;
$grid -> id_param = 'id';
echo $grid -> draw();
?>
<script type="text/javascript">
$( function() {
$( '#text' ).ckeditor( {
toolbar : 'MyTool',
height:'350'
});
});
</script>

View File

@@ -0,0 +1,28 @@
<?php
global $gdb;
$grid = new \grid( 'pp_newsletter_templates' );
$grid -> gdb_opt = $gdb;
$grid -> order = [ 'column' => 'name', 'type' => 'ASC' ];
$grid -> where = [ 'is_admin' => 1 ];
$grid -> columns_view = [
[
'name' => 'Lp.',
'th' => [ 'class' => 'g-lp' ],
'td' => [ 'class' => 'g-center' ],
'autoincrement' => true
],
[
'name' => 'Nazwa',
'db' => 'name',
'php' => 'echo "<a href=\'/admin/newsletter/email_template_edit/id=[id]\'>[name]</a>";',
'sort' => true
],
[
'name' => 'Edytuj',
'action' => [ 'type' => 'edit', 'url' => '/admin/newsletter/email_template_edit/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
]
];
echo $grid -> draw();

View File

@@ -0,0 +1,42 @@
<?php
global $gdb;
$grid = new \grid( 'pp_newsletter_templates' );
$grid -> gdb_opt = $gdb;
$grid -> order = [ 'column' => 'name', 'type' => 'ASC' ];
$grid -> where = [ 'is_admin' => 0 ];
$grid -> columns_view = [
[
'name' => 'Lp.',
'th' => [ 'class' => 'g-lp' ],
'td' => [ 'class' => 'g-center' ],
'autoincrement' => true
],
[
'name' => 'Nazwa',
'db' => 'name',
'php' => 'echo "<a href=\'/admin/newsletter/email_template_edit/id=[id]\'>[name]</a>";',
'sort' => true
],
[
'name' => 'Edytuj',
'action' => [ 'type' => 'edit', 'url' => '/admin/newsletter/email_template_edit/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
],
[
'name' => 'Usuń',
'action' => [ 'type' => 'delete', 'url' => '/admin/newsletter/email_template_delete/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
]
];
$grid -> buttons = [
[
'label' => 'Dodaj szablon',
'url' => '/admin/newsletter/email_template_edit/',
'icon' => 'fa-plus-circle',
'class' => 'btn-success'
]
];
echo $grid -> draw();

View File

@@ -0,0 +1,38 @@
<?php
global $gdb;
$grid = new \grid( 'pp_newsletter' );
$grid -> gdb_opt = $gdb;
$grid -> order = [ 'column' => 'email', 'type' => 'ASC' ];
$grid -> search = [
[ 'name' => 'Email', 'db' => 'email', 'type' => 'text' ]
];
$grid -> columns_view = [
[
'name' => 'Lp.',
'th' => [ 'class' => 'g-lp' ],
'td' => [ 'class' => 'g-center' ],
'autoincrement' => true
],
[
'name' => 'Email',
'db' => 'email',
'sort' => true
],
[
'name' => 'Potwierdzony',
'db' => 'status',
'sort' => true,
'replace' => [ 'array' => [ 0 => '<span style="color: #FF0000;">nie</span>', 1 => 'tak' ] ]
]
];
$grid -> buttons = [
[
'label' => 'Importuj emaile',
'url' => '/admin/newsletter/import/',
'icon' => 'fa-plus-circle',
'class' => 'btn-success'
]
];
$grid -> actions = [ 'delete' => true ];
echo $grid -> draw();

View File

@@ -0,0 +1,41 @@
<?
global $db;
ob_start();
?>
<?= \Html::textarea(
array(
'label' => 'Maile (oddzielone nowym wierszem)',
'name' => 'emails',
'id' => 'emails'
)
);?>
<?
$out = ob_get_clean();
$grid = new \gridEdit;
$grid -> id = 'emails';
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'Import adresów mailowych';
$grid -> fields = [
[
'db' => 'id',
'type' => 'hidden',
'value' => $this -> element['id']
]
];
$grid -> external_code = $out;
$grid -> actions = [
'save' => [
'url' => '/admin/newsletter/emails_import/',
'back_url' => '/admin/newsletter/emails_list/'
],
'cancel' => [
'url' => '/admin/newsletter/emails_list/'
]
];
$grid -> persist_edit = false;
$grid -> id_param = 'id';
echo $grid -> draw();
?>

View File

@@ -0,0 +1,140 @@
<?
global $db;
ob_start();
?>
<div class="form-group">
<label class="col-lg-3 control-label">Wysyłaj tylko raz:</label>
<div class="col-lg-9 pt5">
<div class="switch switch-primary round switch-inline">
<input id="only_once" name="only_once" type="checkbox">
<label for="only_once"></label>
<small><i>Dotyczy wysyłki maili z szablonu.</i></small>
</div>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Zakres dat:</label>
<div class="col-lg-9">
<div class="input-group">
<input type="text" id="dates" name="dates" data="search-column:date_add;search-type:date_range" class="form-control date-range require" value="">
<span class="input-group-addon cursor date-range-icon">
<i class="fa fa-calendar"></i>
</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">lub / i</label>
</div>
<?
$templates[''] = '---- szablon ----';
if ( is_array( $this -> templates ) ): foreach ( $this -> templates as $template ):
$templates[ $template['id'] ] = $template['name'];
endforeach; endif;
?>
<?= \Html::select(
array(
'label' => 'Szablon',
'name' => 'template',
'id' => 'template',
'values' => $templates,
'value' => $this -> templates['id']
));?>
<div class="form-group">
<label class="col-lg-3 control-label">Podgląd:</label>
<div class="col-lg-9">
<div id="newsletter-preview"></div>
</div>
</div>
<?
$out = ob_get_clean();
$grid = new \gridEdit;
$grid -> id = 'newsletter-prepare';
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'Wysyłka newslettera - przygotowanie';
$grid -> default_buttons = false;
$grid -> external_code = $out;
$grid -> buttons = [
[
'label' => 'Wyślij newsletter',
'class' => 'btn-success',
'icon' => 'fa-send',
'js' => 'send_newsletter();'
]
];
echo $grid -> draw();
?>
<script type="text/javascript">
function send_newsletter()
{
var dates = $( '#dates' ).val();
var template = $('#template').val();
if ( !dates && !template )
$.prompt( 'Proszę wybrać zakres dat lub szablon.', { title: 'Błąd' } );
$( '#fg-newsletter-prepare' ).submit();
return false;
}
$( function()
{
$( '#fg-newsletter-prepare' ).attr( 'action', '/admin/newsletter/send/' );
$( 'body' ).on( 'change', '#dates', function()
{
var dates = $( this ).val();
var template = $('#template').val();
$.ajax(
{
type: 'POST',
cache: false,
url: '/admin/ajax.php',
data: {
a: 'newsletter-preview',
dates: dates,
template: template
},
beforeSend: function()
{
$( '#overlay' ).show();
},
success: function( response )
{
$( '#overlay' ).hide();
$( '#newsletter-preview' ).html( response );
}
});
});
$( 'body' ).on( 'change', '#template', function()
{
var dates = $( '#dates' ).val();
var template = $( this ).val();
$.ajax(
{
type: 'POST',
cache: false,
url: '/admin/ajax.php',
data: {
a: 'newsletter-preview',
template: template,
dates: dates
},
beforeSend: function()
{
$( '#overlay' ).show();
},
success: function( response )
{
$( '#overlay' ).hide();
$( '#newsletter-preview' ).html( response );
}
});
});
});
</script>

View File

@@ -0,0 +1,33 @@
<?= $this -> settings['newsletter_header'] ? $this -> settings['newsletter_header'] : '<p style="text-align: center;">--- brak zdefiniowanego nagłówka ---</p>';?>
<? if ( is_array( $this -> template ) ):?>
<?= $this -> template['text']?>
<? endif;?>
<? if ( is_array( $this -> articles ) ):?>
<? foreach ( $this -> articles as $article ):?>
<? $article['language']['seo_link'] ? $url = $article['language']['seo_link'] : $url = 'a-' . $article['id'] . '-' . \S::seo( $article['language']['title'] );?>
<div style="padding: 10px; background: #F1F1F1; margin-bottom: 10px">
<?
$article['language']['seo_link'] ? $url = $article['language']['seo_link'] : $url = 'a-' . $article['id'] . '-' . \S::seo( $article['language']['title'] );
?>
<a href="http://<?= $_SERVER['SERVER_NAME'];?>/<?= $url;?>" title="<?= $article['language']['title'];?>" style="margin-bottom: 10px; display: block; font-size: 14px; color: #5b7fb1; font-weight: 600;">
<?= $article['language']['title'];?>
</a>
<div>
<?
if ( $article['language']['entry'] )
echo $article['language']['entry'];
else
echo $article['language']['text'];
?>
</div>
<div style="clear: both;"></div>
</div>
<? endforeach;?>
<? else:?>
<? if ( $this -> dates ):?>
<div style="padding: 10px; background: #F1F1F1; margin-bottom: 10px; text-align: center;">
--- brak artykułów w danym okresie ---
</div>
<? endif;?>
<? endif;?>
<?= $this -> settings['newsletter_footer_2'] ? $this -> settings['newsletter_footer_2'] : '<p style="text-align: center;">--- brak zdefiniowanej stopki cz. 2 ---</p>';?>

View File

@@ -0,0 +1,60 @@
<script type="text/javascript" src="/libraries/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/libraries/ckeditor/adapters/jquery.js"></script>
<script type="text/javascript">
$( function()
{
$( 'textarea' ).ckeditor(
{
toolbar : 'MyTool',
height: '150'
});
});
</script>
<?
global $db;
ob_start();
echo \Html::textarea(
array(
'label' => 'Nagłówek',
'name' => 'newsletter_header',
'id' => 'newsletter_header',
'value' => $this -> settings['newsletter_header'],
'inline' => true
)
);
echo \Html::textarea(
array(
'label' => 'Stopka cz 1. (dołączana zawsze)',
'name' => 'newsletter_footer_1',
'id' => 'newsletter_footer_1',
'value' => $this -> settings['newsletter_footer_1'],
'inline' => true
)
);
echo \Html::textarea(
array(
'label' => 'Stopka cz 2. (dołączana tylko w przypadku newslettera)',
'name' => 'newsletter_footer_2',
'id' => 'newsletter_footer_2',
'value' => $this -> settings['newsletter_footer_2'],
'inline' => true
)
);
$out = ob_get_clean();
$grid = new \gridEdit;
$grid -> id = 'settings-edit';
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'Edycja ustawień';
$grid -> actions = [
'save' => [ 'url' => '/admin/newsletter/settings_save/', 'back_url' => '/admin/newsletter/settings/' ],
];
$grid -> external_code = $out;
echo $grid -> draw();
?>
<script>CKEDITOR.dtd.$removeEmpty['span'] = false;</script>
<style type="text/css">#g-edit-cancel { display: none; }</style>

View File

@@ -0,0 +1,42 @@
<?php
global $gdb;
$grid = new \gridEdit;
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'Zapisz menu';
$grid -> fields = [
[
'db' => 'id',
'type' => 'hidden',
'value' => $this -> menu['id']
],
[
'name' => 'Nazwa',
'db' => 'name',
'type' => 'text',
'value' => $this -> menu['name'],
'params' => [ 'class' => 'require' ]
],
[
'name' => 'Aktywne',
'db' => 'status',
'type' => 'input_switch',
'checked' => $this -> menu['status'] ? true : false,
'replace' => [ 'array' => [ 0 => 'nie', 1 => 'tak' ] ]
]
];
$grid -> actions = [
'save' => [ 'url' => '/admin/pages/menu_save/', 'back_url' => '/admin/pages/view_list/' ],
'cancel' => [ 'url' => '/admin/pages/view_list/' ]
];
$grid -> persist_edit = true;
$grid -> id_param = 'id';
echo $grid -> draw();
?>
<script type="text/javascript">
$( document ).ready( function()
{
disable_menu();
});
</script>

View File

@@ -0,0 +1,89 @@
<?
global $gdb;
ob_start();
?>
<ol class="sortable" id="article-list">
<?
if ( is_array( $this -> articles ) ) foreach ( $this -> articles as $article )
{
?>
<li id="list_<?= $article['article_id'];?>">
<div class="content <? if ( !$article['status'] ) echo 'text-danger';?>"><span class="disclose"><span></span></span> <?= $article['title'];?></div>
</li>
<?
}
?>
</ol>
<?
$out = ob_get_clean();
$grid = new \gridEdit;
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> default_buttons = false;
$grid -> external_code = $out;
$grid -> title = 'Lista artykułów';
$grid -> buttons = [
[
'label' => 'Wstecz',
'url' => '/admin/pages/view_list/',
'icon' => 'fa-reply',
'class' => 'btn-dark'
]
];
echo $grid -> draw();
?>
<script type="text/javascript" src="/libraries/jquery-nested-sortable/jquery.mjs.nestedSortable.js"></script>
<script type="text/javascript">
$( document ).ready( function()
{
$( 'ol.sortable' ).nestedSortable(
{
forcePlaceholderSize: true,
handle: 'div',
helper: 'clone',
items: 'li',
opacity: .6,
placeholder: 'placeholder',
revert: 250,
tabSize: 25,
tolerance: 'pointer',
toleranceElement: '> div',
maxLevels: 1,
isTree: true,
expandOnHover: 700,
save_articles_order: true
});
});
function save_articles_order()
{
articles = $( 'ol.sortable' ).nestedSortable( 'toArray', { startDepthCount: 0 } );
$.ajax(
{
type: 'POST',
cache: false,
url: '/admin/ajax.php',
data:
{
a: 'save_articles_order',
page_id: <?= $this -> page_id;?>,
articles: articles
},
beforeSend: function()
{
$.prompt( 'Trwa zapisywanie...', { title: 'Proszę czekać' } );
},
success: function( data )
{
$( '.jqibox' ).remove();
response = jQuery.parseJSON( data );
if ( response.status === 'error' )
create_error( response.msg );
}
});
}
</script>

View File

@@ -0,0 +1,514 @@
<script type="text/javascript">
var link_lang = '';
$(function ()
{
<? if ( is_array( $this -> languages ) ): foreach ( $this -> languages as $lg ):?>
google_preview('<?= $lg['id']; ?>', 0);
<? endforeach; endif;?>
disable_menu();
$('body').on('change', '#page_type', function ()
{
var page_type = $(this).val();
if (page_type == 0 || page_type == 1 || page_type == 2)
{
$('#articles_limit').parents('.form-group').show();
$('#link-content').addClass('hide');
}
else if (page_type == 3)
{
$('#link-content').removeClass('hide');
$('#articles_limit').parents('.form-group').hide();
}
else
{
$('#articles_limit').parents('.form-group').hide();
$('#link-content').addClass('hide');
}
});
$('#settings-tabs').easyResponsiveTabs({
width: 'auto',
fit: true,
tabidentify: 'settings-tabs',
type: 'vertical'
});
$('#languages-main').easyResponsiveTabs({
width: 'auto',
fit: true,
tabidentify: 'languages-main'
});
$('#languages-seo').easyResponsiveTabs({
width: 'auto',
fit: true,
tabidentify: 'languages-seo'
});
$('#languages-links').easyResponsiveTabs({
width: 'auto',
fit: true,
tabidentify: 'languages-links'
});
$('#page_type').trigger('change');
$('body').on('click', '.mfp-close', function (e)
{
e.preventDefault();
$.magnificPopup.close();
});
$('body').on('click', '.url-select', function ()
{
$('#link_' + link_lang).val($(this).attr('url'));
$.magnificPopup.close();
});
});
function generate_seo_links( lang, title, page_id, pid )
{
var default_language = '<?= \front\factory\Languages::default_language(); ?>';
if ( title === '' )
return false;
$.ajax(
{
type: 'POST',
cache: false,
url: '/admin/ajax.php',
data:
{
a: 'generate_seo_link',
title: title,
page_id: page_id,
lang: lang,
pid: pid
},
beforeSend: function ()
{
$('#overlay').show();
},
success: function (data)
{
$('#overlay').hide();
response = jQuery.parseJSON(data);
if ( response.status === 'ok' )
{
$('#seo_link_' + lang).val( response.seo_link );
google_preview( lang, pid );
}
else
create_error( response.msg );
}
});
}
function google_preview( lang_id, pid )
{
var default_language = '<?= \front\factory\Languages::default_language(); ?>';
var title = $( '#title_' + lang_id ).val();
var meta_title = $( '#meta_title_' + lang_id ).val();
var seo_link = $( '#seo_link_' + lang_id ).val();
var description = $( '#meta_description_' + lang_id ).val();
$.ajax(
{
type: 'POST',
cache: false,
url: '/admin/ajax.php',
data:
{
a: 'google_url_preview',
title: title,
lang_id: lang_id,
page_id: $('#id').val(),
pid: pid,
seo_link: seo_link,
default_language: default_language
},
success: function (data)
{
$( '#google-preview-' + lang_id + ' .google-url' ).html( '<?= $_SERVER['SERVER_NAME']; ?>/' + data );
}
});
if (typeof meta_title !== "undefined" && meta_title != '')
{
if (meta_title.length < 65)
$('#google-preview-' + lang_id + ' .google-title').html(meta_title);
else if (typeof description !== "undefined")
{
var space = meta_title.lastIndexOf(" ", 65);
$('#google-preview-' + lang_id + ' .google-title').html(meta_title.substring(0, space).concat('...'));
}
} else if (typeof title !== "undefined" && title != '')
{
title = title + ' ● <?= $this->settings['firm_name']; ?>';
if (title.length < 65)
$('#google-preview-' + lang_id + ' .google-title').html(title);
else if (typeof description !== "undefined")
{
var space = title.lastIndexOf(" ", 65);
$('#google-preview-' + lang_id + ' .google-title').html(title.substring(0, space).concat('...'));
}
}
if (typeof description !== "undefined" && description.length < 153)
$('#google-preview-' + lang_id + ' .google-description').html(description);
else if (typeof description !== "undefined")
{
var space = description.lastIndexOf(" ", 153);
$('#google-preview-' + lang_id + ' .google-description').html(description.substring(0, space).concat('...'));
}
}
function pages_url_browser(lang_id)
{
link_lang = lang_id;
$.magnificPopup.open({
removalDelay: 500,
items: {
src: '/admin/pages/pages_url_browser/modal=true'
},
type: 'ajax',
overflowY: 'scroll'
});
}
</script>
<?
global $db;
ob_start();
?>
<div id="settings-tabs">
<ul class="resp-tabs-list settings-tabs">
<li><i class="fa fa-file"></i>Treść</li>
<li><i class="fa fa-wrench"></i>Ustawienia</li>
<li><i class="fa fa-globe"></i>SEO</li>
</ul>
<div class="resp-tabs-container settings-tabs">
<div>
<div id="languages-main">
<ul class="resp-tabs-list languages-main">
<? if (is_array($this->languages)): foreach ($this->languages as $lg): ?>
<? if ($lg['status']): ?>
<li><? if ($lg['id'] == \front\factory\Languages::default_language()) echo '<i class="fa fa-star fa-lg text-system" title="Język domyślny"></i> '; ?><?= $lg['name']; ?></a></li>
<? endif; ?>
<? endforeach;
endif; ?>
</ul>
<div class="resp-tabs-container languages-main">
<? if (is_array($this->languages)): foreach ($this->languages as $lg): ?>
<? if ($lg['status']): ?>
<div>
<?=
\Html::input(
array(
'label' => 'Nazwa strony',
'name' => 'title',
'id' => 'title_' . $lg['id'],
'value' => $this->page['languages'][$lg['id']]['title'],
'js_key' => 'google_preview( "' . $lg['id'] . '", "' . \S::get('pid') . '" ); return false;'
)
);
?>
</div>
<? endif; ?>
<? endforeach;
endif; ?>
</div>
<div class="clear"></div>
</div>
</div>
<div style="padding: 15px;">
<?
if (is_array($this->menus)): foreach ($this->menus as $menu):
$menus[$menu['id']] = $menu['name'];
endforeach;
endif;
?>
<?=
\Html::select(
array(
'label' => 'Menu',
'name' => 'menu_id',
'values' => $menus,
'value' => $this->page['id'] ? $this->page['menu_id'] : $this->menu_id
)
);
?>
<?=
\Html::select(
array(
'label' => 'Typ strony',
'name' => 'page_type',
'id' => 'page_type',
'values' => \admin\factory\Pages::$_page_types,
'value' => $this->page['page_type']
)
);
?>
<div id="link-content" class="hide">
<div id="languages-links">
<ul class="resp-tabs-list languages-links">
<? if (is_array($this->languages)): foreach ($this->languages as $lg): ?>
<? if ($lg['status']): ?>
<li><? if ($lg['id'] == \front\factory\Languages::default_language()) echo '<i class="fa fa-star fa-lg text-system" title="Język domyślny"></i> '; ?><?= $lg['name']; ?></a></li>
<? endif; ?>
<? endforeach;
endif; ?>
</ul>
<div class="resp-tabs-container languages-links">
<? if (is_array($this->languages)): foreach ($this->languages as $lg): ?>
<? if ($lg['status']): ?>
<div>
<?=
\Html::input_icon(
array(
'label' => 'Link',
'name' => 'link',
'id' => 'link_' . $lg['id'],
'value' => $this->page['languages'][$lg['id']]['link'],
'icon_class' => 'fa fa-link',
'icon_js' => 'pages_url_browser( "' . $lg['id'] . '");'
)
);
?>
</div>
<? endif; ?>
<? endforeach;
endif; ?>
</div>
<div class="clear"></div>
</div>
</div>
<?=
\Html::select(
array(
'label' => 'Sortowanie artykułów',
'name' => 'sort_type',
'id' => 'sort_type',
'values' => \admin\factory\Pages::$_sort_types,
'value' => $this->page['sort_type']
)
);
?>
<?
$layouts[''] = '---- szablon ----';
if (is_array($this->layouts)): foreach ($this->layouts as $layout):
$layouts[$layout['id']] = $layout['name'];
endforeach;
endif;
?>
<?=
\Html::select(
array(
'label' => 'Szablon',
'name' => 'layout_id',
'id' => 'layout_id',
'values' => $layouts,
'value' => $this->page['layout_id']
)
);
?>
<?=
\Html::input(
array(
'label' => 'Liczba artykułów na stronę',
'name' => 'articles_limit',
'id' => 'articles_limit',
'value' => $this->page['articles_limit'] ? $this->page['articles_limit'] : 2
)
);
?>
<?=
\Html::input_switch(
array(
'label' => 'Pokaż tytuł',
'name' => 'show_title',
'checked' => $this->page['show_title'] == 1 or ! $this->page['id'] ? true : false
)
);
?>
<?= \Html::input_switch(
array(
'label' => 'Aktywna',
'name' => 'status',
'checked' => $this->page['status'] == 1 or ! $this->page['id'] ? true : false
)
);
?>
<?= Html::input_switch( [
'label' => 'Strona startowa',
'name' => 'start',
'checked' => $this->page['start'] == 1 ? true : false
]
);
?>
<?= Html::input_switch( [
'label' => 'Cache (24h)',
'name' => 'cache',
'checked' => $this -> page['cache'] == 1 ? true : false
]
);
?>
</div>
<div>
<div id="languages-seo">
<ul class="resp-tabs-list languages-seo">
<? if (is_array($this->languages)): foreach ($this->languages as $lg): ?>
<? if ($lg['status']): ?>
<li><? if ($lg['id'] == \front\factory\Languages::default_language()) echo '<i class="fa fa-star fa-lg text-system" title="Język domyślny"></i> '; ?><?= $lg['name']; ?></a></li>
<? endif; ?>
<? endforeach;
endif; ?>
</ul>
<div class="resp-tabs-container languages-seo">
<? if (is_array($this->languages)): foreach ($this->languages as $lg): ?>
<? if ($lg['status']): ?>
<div>
<?=
\Html::input_icon(
array(
'label' => 'Link SEO',
'name' => 'seo_link',
'id' => 'seo_link_' . $lg['id'],
'value' => $this->page['languages'][$lg['id']]['seo_link'],
'icon_content' => 'generuj',
'icon_js' => 'generate_seo_links( "' . $lg['id'] . '", $( "#title_' . $lg['id'] . '" ).val(), ' . (int) $this->page['id'] . ', ' . \S::get('pid') . ' );',
'js_key' => 'google_preview( "' . $lg['id'] . '", "' . \S::get('pid') . '" ); return false;'
)
);
?>
<?=
\Html::input(
array(
'label' => 'Tytuł strony (h1)',
'name' => 'site_title',
'id' => 'site_title_' . $lg['id'],
'value' => $this->page['languages'][$lg['id']]['site_title']
)
);
?>
<?=
\Html::input(
array(
'label' => 'Meta title',
'name' => 'meta_title',
'id' => 'meta_title_' . $lg['id'],
'value' => $this->page['languages'][$lg['id']]['meta_title'],
'js_key' => 'google_preview( "' . $lg['id'] . '" ); return false;'
)
);
?>
<?=
\Html::textarea(
array(
'label' => 'Meta description',
'name' => 'meta_description',
'id' => 'meta_description_' . $lg['id'],
'value' => $this->page['languages'][$lg['id']]['meta_description'],
'js_key' => 'google_preview( "' . $lg['id'] . '" ); return false;'
)
);
?>
<?=
\Html::textarea(
array(
'label' => 'Meta keywords',
'name' => 'meta_keywords',
'id' => 'meta_keywords_' . $lg['id'],
'value' => $this->page['languages'][$lg['id']]['meta_keywords']
)
);
?>
<div class="form-group ">
<label class="col-lg-3 control-label">Podgląd google:</label>
<div class="col-lg-9">
<div id="google-preview-<?= $lg['id']; ?>">
<div class="google-title"></div>
<div class="google-url"></div>
<div class="google-description"></div>
</div>
</div>
</div>
<?=
\Html::select(
array(
'label' => 'Blokuj indeksację',
'name' => "noindex",
'id' => 'noindex_' . $lg['id'],
'values' => array(
0 => 'nie', 1 => 'tak'
),
'value' => $this->page['languages'][$lg['id']]['noindex'] == 1 ? 1 : 0
)
);
?>
<?= \Html::select(
array(
'label' => 'Blokuj bezpośredni dostęp',
'name' => "block_direct_access",
'id' => 'block_direct_access_' . $lg['id'],
'values' => array(
0 => 'nie', 1 => 'tak'
),
'value' => $this -> page['languages'][ $lg['id'] ]['block_direct_access'] == 1 ? 1 : 0
)
);?>
<?= \Html::input(
array(
'label' => 'Rel canonical',
'name' => 'canonical',
'id' => 'canonical_' . $lg['id'],
'value' => $this->page['languages'][$lg['id']]['canonical']
) );?>
</div>
<? endif; ?>
<? endforeach;
endif; ?>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<div class="clear"></div>
<?
$out = ob_get_clean();
$grid = new \gridEdit;
$grid->id = 'page-edit';
$grid->gdb_opt = $gdb;
$grid->include_plugins = true;
$grid->title = 'Edycja strony';
$grid->fields = [
[
'db' => 'id',
'type' => 'hidden',
'value' => $this->page['id']
],
[
'db' => 'parent_id',
'type' => 'hidden',
'value' => $this->page['id'] ? $this->page['parent_id'] : $this->parent_id
]
];
$grid->actions = [
'save' => ['url' => '/admin/pages/page_save/', 'back_url' => '/admin/pages/view_list/'],
'cancel' => ['url' => '/admin/pages/view_list/']
];
$grid->external_code = $out;
$grid->persist_edit = true;
$grid->id_param = 'id';
echo $grid->draw();
?>

View File

@@ -0,0 +1,162 @@
<?
global $gdb;
ob_start();
if ( is_array( $this -> menus ) ) foreach ( $this -> menus as $menu )
{
?>
<div class="menu_sortable">
<ol class="sortable" id="sortable_<?= $menu['id'];?>" menu-id="<?= $menu['id'];?>">
<li id="list_<?= $menu['id'];?>" class="menu_<?= $menu['id'];?>" menu="<?= $menu['id'];?>">
<div class="context_0 content content_menu">
<span class="disclose"><span></span></span>
<? if ( !$menu['status'] ) echo '<i class="fa fa-ban fa-lg text-danger" title="Menu nieaktywne"></i>';?>
Menu: <b><?= $menu['name'];?></b>
</div>
<?= \admin\view\Pages::subpages_browse_list( \admin\factory\Pages::menu_pages( $menu['id'] ) );?>
</li>
</ol>
</div>
<?
}
$out = ob_get_clean();
$grid = new \gridEdit;
$grid -> id = 'pages-list';
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'Lista stron';
$grid -> default_buttons = false;
$grid -> external_code = $out;
echo $grid -> draw();
?>
<style type="text/css">
<? if ( $this -> modal ): echo '.mfp-container'; endif;?> body.sb-top.sb-top-sm .navbar.navbar-fixed-top + #sidebar_left + #content_wrapper {
padding-top: 0;
}
<? if ( $this -> modal ): echo '.mfp-container'; endif;?> #content {
padding: 27px 0 0;
}
<? if ( $this -> modal ): echo '.mfp-container'; endif;?> #content > .row {
margin: 0;
}
<? if ( $this -> modal ): echo '.mfp-container'; endif;?> #content > .row > .col-lg-9 {
padding: 0;
width: 100%;
float: none;
}
</style>
<script type="text/javascript" src="/libraries/jquery-nested-sortable/jquery.mjs.nestedSortable.js"></script>
<script type="text/javascript">
var menu_id = 0;
function getUrlParam(paramName)
{
var reParam = new RegExp('(?:[\?&]|&amp;)' + paramName + '=([^&]+)', 'i');
var match = window.location.search.match(reParam);
return (match && match.length > 1) ? match[1] : '';
}
$( document ).ready( function()
{
<? if ( !$this -> modal ):?>
$( '#sidebar_left, .navbar-fixed-top' ).hide();
<? endif;?>
var funcNum = getUrlParam('CKEditorFuncNum');
$( 'body' ).on( 'click', '.button', function()
{
if ( funcNum )
{
window.opener.CKEDITOR.tools.callFunction(funcNum, $( this ).attr( 'url' ) );
window.close();
}
});
$( 'ol.sortable' ).nestedSortable(
{
forcePlaceholderSize: true,
handle: 'div',
helper: 'clone',
items: 'li',
opacity: .9,
placeholder: 'placeholder',
revert: 250,
tabSize: 45,
tolerance: 'pointer',
toleranceElement: '> div',
maxLevels: 3,
isTree: true,
expandOnHover: 700,
stop: function() {
save_pages_order();
}
});
$( '.disclose' ).on( 'click', function()
{
$( this ).closest( 'li' ).toggleClass( 'sort-collapsed' ).toggleClass( 'sort-expanded' );
});
$( ".sortable *" ).mousedown( function(e)
{
menu_id = $( this ).parents( 'ol.sortable' ).attr( 'menu-id' );
});
$( '.disclose' ).mousedown( function(e)
{
if ( e.which === 1 ) {
if ( $( this ).parent( 'div' ).hasClass( 'content_menu' ) )
{
var menu_id = $( this ).parent( 'div' ).parent( 'li' ).attr( 'menu' );
$.ajax(
{
type: 'POST',
cache: false,
url: '/admin/ajax.php',
data: {
a: 'cookie_menus',
menu_id: menu_id
}
});
}
else
{
var page_id = $( this ).parent( 'div' ).parent( 'li' ).attr( 'id' );
$.ajax(
{
type: 'POST',
cache: false,
url: '/admin/ajax.php',
data: {
a: 'cookie_pages',
page_id: page_id
}
});
}
}
});
<?php
$array = unserialize( $_COOKIE[ 'cookie_pages' ] );
if ( is_array( $array ) ): foreach ( $array as $key => $val ):
if ( $val ):
?>$( '.<?= $key;?>' ).children( 'div' ).children( 'span.disclose' ).click();<?
endif;
endforeach; endif;
$array = unserialize( $_COOKIE[ 'cookie_menus' ] );
if ( is_array( $array ) ): foreach ( $array as $key => $val ):
if ( $val ):
?>$( '.menu_<?= $key;?>' ).children( 'div' ).children( 'span.disclose' ).click();<?
endif;
endforeach; endif;
?>
});
</script>

View File

@@ -0,0 +1,204 @@
<?
global $gdb;
ob_start();
if ( is_array( $this -> menus ) ) foreach ( $this -> menus as $menu )
{
?>
<div class="menu_sortable">
<ol class="sortable" id="sortable_<?= $menu['id'];?>" menu-id="<?= $menu['id'];?>">
<li id="list_<?= $menu['id'];?>" class="menu_<?= $menu['id'];?>" menu="<?= $menu['id'];?>">
<div class="context_0 content content_menu">
<span class="disclose"><span></span></span>
<? if ( !$menu['status'] ) echo '<i class="fa fa-ban fa-lg text-danger" title="Menu nieaktywne"></i>';?>
Menu: <b><?= $menu['name'];?></b>
<div class="btn-group ml20 pull-right">
<a href="/admin/pages/menu_edit/id=<?= $menu['id'];?>" title="Edytuj menu" class="btn btn-sm btn-system">
<i class="fa fa-file-text"></i> <span class="hidden-xs">Edytuj menu</span>
</a>
<a href="#" title="Usuń menu" class="btn btn-sm btn-danger menu-delete" menu-id="<?= $menu['id'];?>">
<i class="fa fa-trash"></i> <span class="hidden-xs">Usuń menu</span>
</a>
<a href="/admin/pages/page_edit/pid=0&menu_id=<?= $menu['id'];?>" title="Dodaj stronę" class="btn btn-sm btn-success">
<i class="fa fa-plus-circle"></i> <span class="hidden-xs">Dodaj stronę</span>
</a>
</div>
</div>
<?= \admin\view\Pages::subpages_list( \admin\factory\Pages::menu_pages( $menu['id'] ) );?>
</li>
</ol>
</div>
<?
}
$out = ob_get_clean();
$grid = new \gridEdit;
$grid -> id = 'pages-list';
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'Lista stron';
$grid -> default_buttons = false;
$grid -> buttons = [
[
'label' => 'Dodaj menu',
'url' => '/admin/pages/menu_edit/',
'icon' => 'fa-plus-circle',
'class' => 'btn-success'
]
];
$grid -> external_code = $out;
echo $grid -> draw();
?>
<script type="text/javascript" src="/libraries/jquery-nested-sortable/jquery.mjs.nestedSortable.js"></script>
<script type="text/javascript">
var menu_id = 0;
$( document ).ready( function()
{
$( 'body' ).on( 'click', '.menu-delete', function()
{
var menu_id = $( this ).attr( 'menu-id' );
$.prompt( "Na pewno chcesz usunąć wybrane menu?",
{
title: "Potwierdź?",
buttons: { "Tak": true, "Nie": false },
submit: function( e, v, m, f )
{
if ( v === true )
document.location.href = '/admin/pages/menu_delete/id=' + menu_id;
}
});
});
$( 'body' ).on( 'click', '.page-delete', function()
{
var page_id = $( this ).attr( 'page-id' );
$.prompt( "Na pewno chcesz usunąć wybraną stronę?",
{
title: "Potwierdź?",
buttons: { "Tak": true, "Nie": false },
submit: function( e, v, m, f )
{
if ( v === true )
document.location.href = '/admin/pages/page_delete/id=' + page_id;
}
});
});
$( 'ol.sortable' ).nestedSortable(
{
forcePlaceholderSize: true,
handle: 'div',
helper: 'clone',
items: 'li',
opacity: .9,
placeholder: 'placeholder',
revert: 250,
tabSize: 45,
tolerance: 'pointer',
toleranceElement: '> div',
maxLevels: 4,
isTree: true,
expandOnHover: 700,
stop: function() {
save_pages_order();
}
});
$( '.disclose' ).on( 'click', function()
{
$( this ).closest( 'li' ).toggleClass( 'sort-collapsed' ).toggleClass( 'sort-expanded' );
});
$( ".sortable *" ).mousedown( function(e)
{
menu_id = $( this ).parents( 'ol.sortable' ).attr( 'menu-id' );
});
$( '.disclose' ).mousedown( function(e)
{
if ( e.which === 1 ) {
if ( $( this ).parent( 'div' ).hasClass( 'content_menu' ) )
{
var menu_id = $( this ).parent( 'div' ).parent( 'li' ).attr( 'menu' );
$.ajax(
{
type: 'POST',
cache: false,
url: '/admin/ajax.php',
data: {
a: 'cookie_menus',
menu_id: menu_id
}
});
}
else
{
var page_id = $( this ).parent( 'div' ).parent( 'li' ).attr( 'id' );
$.ajax(
{
type: 'POST',
cache: false,
url: '/admin/ajax.php',
data: {
a: 'cookie_pages',
page_id: page_id
}
});
}
}
});
<?php
$array = unserialize( $_COOKIE[ 'cookie_pages' ] );
if ( is_array( $array ) ): foreach ( $array as $key => $val ):
if ( $val ):
?>$( '.<?= $key;?>' ).children( 'div' ).children( 'span.disclose' ).click();<?
endif;
endforeach; endif;
$array = unserialize( $_COOKIE[ 'cookie_menus' ] );
if ( is_array( $array ) ): foreach ( $array as $key => $val ):
if ( $val ):
?>$( '.menu_<?= $key;?>' ).children( 'div' ).children( 'span.disclose' ).click();<?
endif;
endforeach; endif;
?>
});
function save_pages_order( )
{
pages = $( '#sortable_' + menu_id ).nestedSortable( 'toArray', { startDepthCount: 0 } );
$.ajax(
{
type: 'POST',
cache: false,
url: '/admin/ajax.php',
data:
{
a: 'save_pages_order',
menu_id: menu_id,
pages: pages
},
beforeSend: function()
{
$.prompt( 'Trwa zapisywanie...', { title: 'Proszę czekać' } );
},
success: function( data )
{
$( '.jqibox' ).remove();
response = jQuery.parseJSON( data );
if ( response.status === 'error' )
create_error( response.msg );
}
});
}
</script>

View File

@@ -0,0 +1,70 @@
<? if (is_array($this->pages)): ?>
<?
$settings = \front\factory\Settings::settings_details();
?>
<ol>
<? foreach ($this->pages as $page): ?>
<li id="list_<?= $page['id']; ?>" idk="<?= $page['id']; ?>" class="list_<?= $page['id']; ?>" menu="<?= $page['menu_id']; ?>">
<div class="content">
<span class="disclose"><span></span></span>
<?
if (!$page['status'])
echo '<i class="fa fa-ban fa-lg text-danger" title="Strona nieaktywna"></i>';
if ($page['start'])
echo '<i class="fa fa-star fa-lg text-system" title="Strona startowa"></i>';
echo $page['title'];
if (is_array($page['languages'])):
echo '<div class="btn-group flags" style="display: inline-block;">';
foreach ($page['languages'] as $lg)
echo '<img src="/admin/css/lang-' . $lg['lang_id'] . '.jpg" />';
echo '</div>';
endif;
$default_language = \front\factory\Languages::default_language();
if (is_array($page['languages'])):
foreach ($page['languages'] as $lg):
echo '<div class="btn-group ml20 pull-right">';
echo '<a href="#" title="Wybierz stronę" class="btn btn-sm btn-system button url-select" url="';
if ($settings['links_structure']) {
if ($lg['seo_link']) {
$seo = '/'.\admin\factory\Pages::google_url_preview($page['id'], $lg['title'], $lg['lang_id'], 0, 0, $lg['seo_link']);
echo $seo;
}
else{
$seo = '/'. \admin\factory\Pages::google_url_preview($page['id'], $lg['title'], $lg['lang_id'], 0, 0, 0);
echo $seo;
}
}
else
{
if ($lg['seo_link']) {
if ($default_language != $lg['lang_id'])
echo '/' . $lg['lang_id'];
echo '/' . $lg['seo_link'];
}
else {
if ($default_language != $lg['lang_id'])
echo '/' . $lg['lang_id'];
echo '/s-' . $page['id'] . '-' . \S::seo($lg['title']);
}
}
echo '">';
echo '<i class="fa fa-check"></i> <span class="hidden-xs">' . strtoupper($lg['lang_id']) . '</span>';
echo '</a>';
echo '</div>';
endforeach;
endif;
?>
</div>
<?
if (is_array($page['subpages']))
echo \admin\view\Pages::subpages_browse_list($page['subpages'], $page['id'], $this->step + 1);
?>
</li>
<? endforeach; ?>
</ol>
<? endif; ?>

View File

@@ -0,0 +1,54 @@
<? if ( is_array( $this -> pages ) ):?>
<ol>
<? foreach ( $this -> pages as $page ):?>
<li id="list_<?= $page['id'];?>" idk="<?= $page['id'];?>" class="list_<?= $page['id'];?>" menu="<?= $page['menu_id'];?>">
<div class="content">
<span class="disclose"><span></span></span>
<? if ( !$page['status'] ) echo '<i class="fa fa-ban fa-lg text-danger" title="Strona nieaktywna"></i>';?>
<? if ( $page['start'] ) echo '<i class="fa fa-star fa-lg text-system" title="Strona startowa"></i>';?>
<?= mb_substr( $page['title'], 0, 75, 'UTF-8' );?><? if ( mb_strlen( $page['title'], 'utf-8' ) > 75 ) echo '...';?>
<?
if ( is_array( $page['languages'] ) ):
echo '<div class="btn-group flags" style="display: inline-block;">';
foreach ( $page['languages'] as $lg )
echo '<img src="/admin/css/lang-' . $lg['lang_id'] . '.jpg" />';
echo '</div>';
endif;
?>
<? if ( $this -> step < 3 ):?>
<div class="btn-group ml20 pull-right">
<a href="/admin/pages/page_edit/id=<?= $page['id'];?>&menu_id=<?= $page['menu_id'];?>" title="Edytuj stronę" class="btn btn-sm btn-system">
<i class="fa fa-file-text"></i> <span class="hidden-xs">Edytuj stronę</span>
</a>
<a href="#" title="Usuń stronę" class="btn btn-sm btn-danger page-delete" page-id="<?= $page['id'];?>">
<i class="fa fa-trash"></i> <span class="hidden-xs">Usuń stronę</span>
</a>
<a href="/admin/pages/page_articles/id=<?= $page['id'];?>" title="Lista artykułów" class="btn btn-sm btn-info" page-id="<?= $page['id'];?>">
<i class="fa fa-bars"></i> <span class="hidden-xs">Lista artykułów</span>
</a>
<a href="/admin/pages/page_edit/pid=<?= $page['id'];?>&menu_id=<?= $page['menu_id'];?>" title="Dodaj podstronę" class="btn btn-sm btn-success">
<i class="fa fa-plus-circle"></i> <span class="hidden-xs">Dodaj podstronę</span>
</a>
</div>
<? else:?>
<div class="btn-group ml20 pull-right">
<a href="/admin/pages/page_edit/id=<?= $page['id'];?>&menu_id=<?= $page['menu_id'];?>" title="Edytuj stronę" class="btn btn-sm btn-system">
<i class="fa fa-file-text"></i> <span class="hidden-xs">Edytuj stronę</span>
</a>
<a href="#" title="Usuń stronę" class="btn btn-sm btn-danger page-delete" page-id="<?= $page['id'];?>">
<i class="fa fa-trash"></i> <span class="hidden-xs">Usuń stronę</span>
</a>
<a href="/admin/pages/page_articles/id=<?= $page['id'];?>" title="Lista artykułów" class="btn btn-sm btn-info" page-id="<?= $page['id'];?>">
<i class="fa fa-bars"></i> <span class="hidden-xs">Lista artykułów</span>
</a>
</div>
<? endif;?>
</div>
<?
if ( is_array( $page['subpages'] ) )
echo \admin\view\Pages::subpages_list( $page['subpages'], $page['id'], $this -> step + 1 );
?>
</li>
<? endforeach;?>
</ol>
<? endif;?>

View File

@@ -0,0 +1,101 @@
<?php
global $gdb;
$grid = new \grid( 'pp_scontainers' );
$grid -> gdb_opt = $gdb;
$grid -> sql = 'SELECT *'
. 'FROM ( '
. 'SELECT '
. 'id, status, '
. '( SELECT title FROM pp_scontainers_langs AS psl, pp_langs AS pl WHERE lang_id = pl.id AND container_id = ps.id AND title != \'\' ORDER BY o ASC LIMIT 1 ) AS title '
. 'FROM '
. 'pp_scontainers AS ps '
. ') AS q1 '
. 'WHERE '
. '1=1 [where] '
. 'ORDER BY '
. '[order_p1] [order_p2]';
$grid -> sql_count = 'SELECT '
. 'COUNT(0) FROM ( '
. 'SELECT '
. 'id, status, '
. '( SELECT title FROM pp_scontainers_langs AS psl, pp_langs AS pl WHERE lang_id = pl.id AND container_id = ps.id AND title != \'\' ORDER BY o ASC LIMIT 1 ) AS title '
. 'FROM '
. 'pp_scontainers AS ps '
. ') AS q1 '
. 'WHERE '
. '1=1 [where] ';
$grid -> debug = true;
$grid -> order = [ 'column' => 'title', 'type' => 'ASC' ];
$grid -> search = [
[ 'name' => 'Tytuł', 'db' => 'title', 'type' => 'text' ],
[ 'name' => 'Aktywny', 'db' => 'status', 'type' => 'select', 'replace' => [ 'array' => [ 0 => 'nie', 1 => 'tak' ] ] ]
];
$grid -> columns_view = [
[
'name' => 'Lp.',
'th' => [ 'class' => 'g-lp' ],
'td' => [ 'class' => 'g-center' ],
'autoincrement' => true
],
[
'name' => 'Tytuł',
'db' => 'title',
'sort' => true
],
[
'name' => 'Kod',
'php' => 'echo "[KONTENER:[id]]";'
],
[
'name' => 'Aktywny',
'db' => 'status',
'replace' => [ 'array' => [ 0 => '<span style="color: #FF0000;">nie</span>', 1 => 'tak' ] ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
'td' => [ 'class' => 'g-center' ]
],
[
'name' => 'Akcja',
'db' => 'id',
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 120px;' ],
'php' => 'echo "<a href=\'#\' class=\'button\' text=\'[KONTENER:[id]]\'>wybierz</a>";'
]
];
$grid -> buttons = [
[
'label' => 'Dodaj kontener',
'url' => '/admin/scontainers/container_edit/',
'icon' => 'fa-plus-circle',
'class' => 'btn-success'
]
];
echo $grid -> draw();
?>
<style type="text/css">
body.sb-top.sb-top-sm .navbar.navbar-fixed-top + #sidebar_left + #content_wrapper {
padding-top: 0;
}
</style>
<script type="text/javascript">
function getUrlParam(paramName)
{
var reParam = new RegExp('(?:[\?&]|&amp;)' + paramName + '=([^&]+)', 'i');
var match = window.location.search.match(reParam);
return (match && match.length > 1) ? match[1] : '';
}
$( function()
{
$( '#sidebar_left, .navbar-fixed-top' ).hide();
var funcNum = getUrlParam('CKEditorFuncNum');
$( 'body' ).on( 'click', '.button', function()
{
window.opener.CKEDITOR.tools.callFunction(funcNum, $( this ).attr( 'text' ) );
window.close();
});
});
</script>

View File

@@ -0,0 +1,166 @@
<link rel="stylesheet" href="/libraries/codemirror/lib/codemirror.css" />
<link rel="stylesheet" href="/libraries/codemirror/theme/material.css" />
<script type="text/javascript" src="/libraries/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/libraries/ckeditor/adapters/jquery.js"></script>
<script type="text/javascript" src="/libraries/codemirror/lib/codemirror.js"></script>
<script type="text/javascript" src="/libraries/codemirror/mode/css/css.js"></script>
<script type="text/javascript" src="/libraries/codemirror/mode/xml/xml.js"></script>
<script type="text/javascript" src="/libraries/codemirror/mode/javascript/javascript.js"></script>
<script type="text/javascript" src="/libraries/codemirror/mode/htmlmixed/htmlmixed.js"></script>
<script type="text/javascript" src="/libraries/codemirror/addon/mode/multiplex.js"></script>
<?
global $db;
ob_start();
?>
<div id="settings-tabs">
<ul class="resp-tabs-list settings-tabs">
<li><i class="fa fa-file"></i>Treść</li>
<li><i class="fa fa-wrench"></i>Ustawienia</li>
</ul>
<div class="resp-tabs-container settings-tabs">
<div>
<div id="languages-main">
<ul class="resp-tabs-list languages-main">
<? if ( is_array( $this -> languages ) ): foreach ( $this -> languages as $lg ):?>
<? if ( $lg['status'] ):?>
<li><?= $lg['name'];?></a></li>
<? endif;?>
<? endforeach; endif;?>
</ul>
<div class="resp-tabs-container languages-main">
<? if ( is_array( $this -> languages ) ): foreach ( $this -> languages as $lg ):?>
<? if ( $lg['status'] ):?>
<div>
<?= \Html::input(
array(
'label' => 'Tytuł',
'name' => 'title',
'id' => 'title_' . $lg['id'],
'value' => $this -> container['languages'][ $lg['id'] ]['title'],
'inline' => true
)
);?>
<?= \Html::textarea(
array(
'label' => 'Treść',
'name' => 'text',
'id' => 'text_' . $lg['id'],
'value' => $this -> container['languages'][ $lg['id'] ]['text'],
'inline' => true
)
);?>
<?= \Html::textarea(
array(
'label' => 'Kod HTML',
'name' => 'html',
'id' => 'html_' . $lg['id'],
'value' => $this -> container['languages'][ $lg['id'] ]['html'],
'inline' => true
)
);?>
<script type="text/javascript">
$( function()
{
$( '#text_<?= $lg['id'];?>' ).ckeditor(
{
toolbar : 'MyToolbar',
height:'300'
});
var code_html = CodeMirror.fromTextArea( document.getElementById( "html_<?= $lg['id'];?>" ),{
lineWrapping: true,
mode: "text/html"
});
code_html.on( 'change', function(cm) {
$( '#html_<?= $lg['id'];?>' ).val( cm.getValue() );
});
code_html.setOption( "theme", 'material' );
});
</script>
</div>
<? endif;?>
<? endforeach; endif;?>
</div>
<div class="clear"></div>
</div>
</div>
<div>
<?= \Html::input_switch(
array(
'label' => 'Aktywny',
'name' => 'status',
'checked' => $this -> container['status'] == 1 or !$this -> container['id'] ? true : false
)
);
?>
<?= \Html::input_switch(
array(
'label' => 'Pokaż tytuł',
'name' => 'show_title',
'checked' => $this -> container['show_title'] == 1 ? true : false
)
);
?>
<?= \Html::input_icon(
array(
'label' => 'Tło kontenera',
'name' => 'src',
'id' => 'src',
'value' => $this->container['src'],
'icon_content' => 'przeglądaj',
'icon_js' => "window.open ( 'http://" . $_SERVER['SERVER_NAME'] . "/libraries/filemanager-9.14.0/dialog.php?type=1&popup=1&field_id=src&akey=c3cb2537d25c0efc9e573d059d79c3b8', 'mywindow', 'location=1,status=1,scrollbars=1, width=1100,height=700');"
)
);
?>
</div>
</div>
</div>
<?
$out = ob_get_clean();
$grid = new \gridEdit;
$grid -> id = 'container-edit';
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'Edycja kontenera statycznego';
$grid -> fields = [
[
'db' => 'id',
'type' => 'hidden',
'value' => $this -> container['id']
]
];
$grid -> actions = [
'save' => [ 'url' => '/admin/scontainers/container_save/', 'back_url' => '/admin/scontainers/view_list/' ],
'cancel' => [ 'url' => '/admin/scontainers/view_list/' ]
];
$grid -> external_code = $out;
$grid -> persist_edit = true;
$grid -> id_param = 'id';
echo $grid -> draw();
?>
<script type="text/javascript">
$( function()
{
disable_menu();
$( '#settings-tabs' ).easyResponsiveTabs({
width: 'auto',
fit: true,
tabidentify: 'settings-tabs',
type: 'vertical'
});
$( '#languages-main' ).easyResponsiveTabs({
width: 'auto',
fit: true,
tabidentify: 'languages-main'
});
$( '#g-menu' ).attr( 'data-spy', 'affix' );
$( '#g-menu' ).attr( 'data-offset-top', '135' );
});
</script>
<script>CKEDITOR.dtd.$removeEmpty['span'] = false;</script>

View File

@@ -0,0 +1,79 @@
<?php
global $gdb;
$grid = new \grid( 'pp_scontainers' );
$grid -> gdb_opt = $gdb;
$grid -> sql = 'SELECT *'
. 'FROM ( '
. 'SELECT '
. 'id, status, '
. '( SELECT title FROM pp_scontainers_langs AS psl, pp_langs AS pl WHERE lang_id = pl.id AND container_id = ps.id AND title != \'\' ORDER BY o ASC LIMIT 1 ) AS title '
. 'FROM '
. 'pp_scontainers AS ps '
. ') AS q1 '
. 'WHERE '
. '1=1 [where] '
. 'ORDER BY '
. '[order_p1] [order_p2]';
$grid -> sql_count = 'SELECT '
. 'COUNT(0) FROM ( '
. 'SELECT '
. 'id, status, '
. '( SELECT title FROM pp_scontainers_langs AS psl, pp_langs AS pl WHERE lang_id = pl.id AND container_id = ps.id AND title != \'\' ORDER BY o ASC LIMIT 1 ) AS title '
. 'FROM '
. 'pp_scontainers AS ps '
. ') AS q1 '
. 'WHERE '
. '1=1 [where] ';
$grid -> debug = true;
$grid -> order = [ 'column' => 'title', 'type' => 'ASC' ];
$grid -> search = [
[ 'name' => 'Tytuł', 'db' => 'title', 'type' => 'text' ],
[ 'name' => 'Aktywny', 'db' => 'status', 'type' => 'select', 'replace' => [ 'array' => [ 0 => 'nie', 1 => 'tak' ] ] ]
];
$grid -> columns_view = [
[
'name' => 'Lp.',
'th' => [ 'class' => 'g-lp' ],
'td' => [ 'class' => 'g-center' ],
'autoincrement' => true
],
[
'name' => 'Tytuł',
'db' => 'title',
'php' => 'echo "<a href=\'/admin/scontainers/container_edit/id=[id]\'>[title]</a>";',
'sort' => true
],
[
'name' => 'Kod',
'php' => 'echo "[KONTENER:[id]]";'
],
[
'name' => 'Aktywny',
'db' => 'status',
'replace' => [ 'array' => [ 0 => '<span style="color: #FF0000;">nie</span>', 1 => 'tak' ] ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
'td' => [ 'class' => 'g-center' ]
],
[
'name' => 'Edytuj',
'action' => [ 'type' => 'edit', 'url' => '/admin/scontainers/container_edit/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
],
[
'name' => 'Usuń',
'action' => [ 'type' => 'delete', 'url' => '/admin/scontainers/container_delete/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
]
];
$grid -> buttons = [
[
'label' => 'Dodaj kontener',
'url' => '/admin/scontainers/container_edit/',
'icon' => 'fa-plus-circle',
'class' => 'btn-success'
]
];
echo $grid -> draw();

View File

@@ -0,0 +1,95 @@
<script type="text/javascript" src="/libraries/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/libraries/ckeditor/adapters/jquery.js"></script>
<?
global $db;
ob_start();
?>
<?= \Html::input(
array(
'label' => 'Url',
'class' => 'required',
'name' => 'url',
'id' => 'url',
'value' => $this -> element['url']
)
);?>
<?= \Html::input_switch(
array(
'label' => 'Aktywny',
'name' => 'status',
'checked' => $this -> element['status'] == 1 or !$this -> element['id'] ? true : false
)
);?>
<?= \Html::input(
array(
'label' => 'Meta title',
'class' => 'title',
'name' => 'title',
'id' => 'title',
'value' => $this -> element['title']
)
);?>
<?= \Html::input(
array(
'label' => 'Meta keywords',
'class' => 'keywords',
'name' => 'keywords',
'id' => 'keywords',
'value' => $this -> element['keywords']
)
);?>
<?= \Html::input(
array(
'label' => 'Meta description',
'class' => 'description',
'name' => 'description',
'id' => 'description',
'value' => $this -> element['description']
)
);?>
<?= \Html::textarea(
array(
'label' => 'Dodatkowa treść',
'name' => 'text',
'id' => 'text',
'value' => $this ->element['text']
)
);?>
<?
$out = ob_get_clean();
$grid = new \gridEdit;
$grid -> id = 'seo-element-edit';
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'Edycja elementu SEO';
$grid -> fields = [
[
'db' => 'id',
'type' => 'hidden',
'value' => $this -> element['id']
]
];
$grid -> external_code = $out;
$grid -> actions = [
'save' => [
'url' => '/admin/seo_additional/element_save/',
'back_url' => '/admin/seo_additional/main_view/'
],
'cancel' => [
'url' => '/admin/seo_additional/main_view/'
]
];
$grid -> persist_edit = true;
$grid -> id_param = 'id';
echo $grid -> draw();
?>
<script type="text/javascript">
$( function() {
$( '#text' ).ckeditor( {
toolbar : 'MyTool',
height:'350'
});
});
</script>

View File

@@ -0,0 +1,58 @@
<?php
global $gdb;
$grid = new \grid( 'pp_seo_additional' );
$grid -> gdb_opt = $gdb;
$grid -> order = [ 'column' => 'url', 'type' => 'ASC' ];
$grid -> search = [
[ 'name' => 'Url', 'db' => 'url', 'type' => 'text' ],
[ 'name' => 'Aktywny', 'db' => 'status', 'type' => 'select', 'replace' => [ 'array' => [ 0 => 'nie', 1 => 'tak' ] ] ]
];
$grid -> columns_view = [
[
'name' => 'Lp.',
'th' => [ 'class' => 'g-lp' ],
'td' => [ 'class' => 'g-center' ],
'autoincrement' => true
],
[
'name' => 'Url',
'db' => 'url',
'php' => 'echo "<a href=\'/admin/seo_additional/element_edit/id=[id]\'>[url]</a>";',
'sort' => true
],
[
'name' => 'Title',
'db' => 'title',
'sort' => true
],
[
'name' => 'Aktywny',
'db' => 'status',
'replace' => [ 'array' => [ 0 => '<span style="color: #FF0000;">nie</span>', 1 => 'tak' ] ],
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
'sort' => true
],
[
'name' => 'Edytuj',
'action' => [ 'type' => 'edit', 'url' => '/admin/seo_additional/element_edit/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
],
[
'name' => 'Usuń',
'action' => [ 'type' => 'delete', 'url' => '/admin/seo_additional/element_delete/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
]
];
$grid -> buttons = [
[
'label' => 'Dodaj element',
'url' => '/admin/seo_additional/element_edit/',
'icon' => 'fa-plus-circle',
'class' => 'btn-success'
]
];
echo $grid -> draw();

View File

@@ -0,0 +1,396 @@
<script type="text/javascript" src="/libraries/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/libraries/ckeditor/adapters/jquery.js"></script>
<script type="text/javascript">
$(function ()
{
$('#settings-tabs').easyResponsiveTabs(
{
width: 'auto',
fit: true,
tabidentify: 'settings-tabs',
type: 'vertical'
});
$('#additional_info').ckeditor(
{
toolbar: 'MyTool',
height: '150'
});
});
</script>
<?
global $db;
ob_start();
?>
<div id="settings-tabs">
<ul class="resp-tabs-list settings-tabs">
<li><i class="fa fa-paper-plane"></i>Dane kontaktowe</li>
<li><i class="fa fa-envelope"></i>Poczta</li>
<li><i class="fa fa-bars"></i>Dodatkowe ustawienia</li>
<li><i class="fa fa-code"></i>Kody (m.in. statystyk)</li>
<li><i class="fa fa-cog"></i>System</li>
<li><i class="fa fa-refresh"></i>Aktualizacje</li>
</ul>
<div class="resp-tabs-container settings-tabs">
<div>
<?=
\Html::input(
array(
'label' => 'Nazwa firmy',
'name' => 'firm_name',
'id' => 'firm_name',
'value' => $this -> settings['firm_name']
)
);
?>
<?=
\Html::textarea(
array(
'label' => 'Dodatkowe informacje',
'name' => 'additional_info',
'id' => 'additional_info',
'value' => $this -> settings['additional_info']
)
);
?>
<?=
\Html::input_switch(
array(
'label' => 'Mapa',
'name' => 'google_maps',
'checked' => $this -> settings['google_maps'] == 1 ? true : false
)
);
?>
<?=
\Html::textarea(
array(
'label' => 'Mapa - adres',
'name' => 'firm_adress',
'id' => 'firm_adress',
'value' => $this -> settings['firm_adress']
)
);
?>
<?=
\Html::input_switch(
array(
'label' => 'Widget "Telefon"',
'name' => 'widget_phone',
'checked' => $this -> settings['widget_phone'] == 1 ? true : false
)
);
?>
</div>
<div>
<?=
\Html::input_switch(
array(
'label' => 'Formularz kontaktowy',
'name' => 'contact_form',
'checked' => $this -> settings['contact_form'] == 1 ? true : false
)
);
?>
<?=
\Html::input(
array(
'label' => 'Email kontaktowy',
'name' => 'contact_email',
'id' => 'contact_email',
'value' => $this -> settings['contact_email']
)
);
?>
<?=
\Html::input(
array(
'label' => 'Email - host',
'name' => 'email_host',
'id' => 'email_host',
'value' => $this -> settings['email_host']
)
);
?>
<?=
\Html::input(
array(
'label' => 'Email - port',
'name' => 'email_port',
'id' => 'email_port',
'value' => $this -> settings['email_port']
)
);
?>
<?=
\Html::input(
array(
'label' => 'Email - login',
'name' => 'email_login',
'id' => 'email_login',
'value' => $this -> settings['email_login']
)
);
?>
<?=
\Html::input(
array(
'label' => 'Email - hasło',
'name' => 'email_password',
'id' => 'email_password',
'value' => $this -> settings['email_password'],
'type' => 'text'
)
);
?>
</div>
<div>
<div class="form-group">
<label class="col-lg-3 control-label">Ilość aktualności
<div class="popo">
<i class="popover-btn" data-container="body" data-toggle="popover" data-placement="top" data-content="Ilość wyświetlanych aktulanośći w boxie [NEWS] ">?</i>
</div>
</label>
<div class="col-lg-9">
<input class="form-control" type="text" name="news_limit" id="news_limit" value="<?= $this -> settings['news_limit']?>">
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Licznik odwiedzin
<div class="popo">
<i class="popover-btn" data-container="body" data-toggle="popover" data-placement="top" data-content="Włączenie licznika odwiedzin na stronie">?</i>
</div>
</label>
<div class="col-lg-9 pt5">
<div class="switch switch-primary round switch-inline">
<input type="checkbox" name="visit_counter" id="visit_counter" <? if ( $this -> settings['visit_counter'] ):?>checked="checked"<? endif;?>>
<label for="visit_counter"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Kalendarz
<div class="popo">
<i class="popover-btn" data-container="body" data-toggle="popover" data-placement="top" data-content="Włączenie kalendarza dla artykułów">?</i>
</div>
</label>
<div class="col-lg-9 pt5">
<div class="switch switch-primary round switch-inline">
<input type="checkbox" name="calendar" id="calendar" <? if ( $this -> settings['calendar'] ):?>checked="checked"<? endif;?>>
<label for="calendar"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Tagi
<div class="popo">
<i class="popover-btn" data-container="body" data-toggle="popover" data-placement="top" data-content="Włączenie tagów dla artykułów">?</i>
</div>
</label>
<div class="col-lg-9 pt5">
<div class="switch switch-primary round switch-inline">
<input type="checkbox" name="tags" id="tags" <? if ( $this -> settings['tags'] ):?>checked="checked"<? endif;?>>
<label for="tags"></label>
</div>
</div>
</div>
<?= \Html::input( [
'label' => 'Maksmalna wielkość zdjęcia (px)',
'name' => 'image_px',
'id' => 'image_px',
'value' => $this -> settings['image_px']
] );
?>
</div>
<div>
<?=
\Html::input(
array(
'label' => 'Klucz Google Search Console',
'name' => 'google_search_console',
'id' => 'google_search_console',
'value' => $this -> settings['google_search_console']
)
);
?>
<?=
\Html::input(
array(
'label' => 'Facebook link',
'name' => 'facebook_link',
'id' => 'facebook_link',
'value' => $this -> settings['facebook_link']
)
);
?>
<?=
\Html::textarea(
array(
'label' => 'Kod statystyk',
'name' => 'statistic_code',
'id' => 'statistic_code',
'value' => $this -> settings['statistic_code'],
'rows' => 10
)
);
?>
<?=
\Html::textarea(
array(
'label' => 'Własne reguły htacess',
'name' => 'htaccess',
'id' => 'htaccess',
'value' => $this -> settings['htaccess'],
'rows' => 10
)
);
?>
<?=
\Html::textarea(
array(
'label' => 'Własne reguły robots.txt',
'name' => 'robots',
'id' => 'robots',
'value' => $this -> settings['robots'],
'rows' => 10
)
);
?>
</div>
<div>
<div class="form-group">
<label class="col-lg-3 control-label">Strona konstrukcyjna
<div class="popo">
<i class="popover-btn" data-container="body" data-toggle="popover" data-placement="top" data-content="Włączenie strony konstrukcyjnej do tworzenia szablonów">?</i>
</div>
</label>
<div class="col-lg-9 pt5">
<div class="switch switch-primary round switch-inline">
<input type="checkbox" name="devel" id="devel" <? if ( $this -> settings['devel'] ):?>checked="checked"<? endif;?>>
<label for="devel"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Wersja https://
<div class="popo">
<i class="popover-btn" data-container="body" data-toggle="popover" data-placement="top" data-content="Włączenie wersji https:// strony">?</i>
</div>
</label>
<div class="col-lg-9 pt5">
<div class="switch switch-primary round switch-inline">
<input type="checkbox" name="ssl" id="ssl" <? if ( $this -> settings['ssl'] ):?>checked="checked"<? endif;?>>
<label for="ssl"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">MySQL Debug
<div class="popo">
<i class="popover-btn" data-container="body" data-toggle="popover" data-placement="top" data-content="Umożliwienie zapisu zapytań sql do plików">?</i>
</div>
</label>
<div class="col-lg-9 pt5">
<div class="switch switch-primary round switch-inline">
<input type="checkbox" name="mysql_debug" id="mysql_debug" <? if ( $this -> settings['mysql_debug'] ):?>checked="checked"<? endif;?>>
<label for="mysql_debug"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Htaccess cache
<div class="popo">
<i class="popover-btn" data-container="body" data-toggle="popover" data-placement="top" data-content="Aktywny - dla stron rzadko aktualizowanych,<br> Niekatywny - dla stron często aktualizowanych">?</i>
</div>
</label>
<div class="col-lg-9 pt5">
<div class="switch switch-primary round switch-inline">
<input type="checkbox" name="htaccess_cache" id="htaccess_cache" <? if ( $this -> settings['htaccess_cache'] ):?>checked="checked"<? endif;?>>
<label for="htaccess_cache"></label>
</div>
</div>
</div>
<div class="form-group">
<?= \Html::select( [
'label' => "Struktura linków",
'name' => "links_structure",
'values' => [ 0 => 'skrócona', 1 => 'rozwinięta' ],
'value' => $this -> settings['links_structure'] ? 1 : 0
] );?>
</div>
<div class="form-group">
<?= \Html::select( [
'label' => "Wersja strony",
'name' => "link_version",
'values' => [ 0 => 'bez www', 1 => 'z www' ],
'value' => $this -> settings['link_version'] ? 1 : 0
] );?>
</div>
<div class="form-group">
<?= \Html::select( [
'label' => "Newsletter",
'name' => "newsletter_cron",
'values' => [ 0 => 'wysyłka za pomocą cron i strony', 1 => 'wysyłka za pomocą cron' ],
'value' => $this -> settings['newsletter_cron'] ? 1 : 0
] );?>
</div>
</div>
<div>
<div class="form-group">
<label class="col-lg-3 control-label">Aktualizacja
<div class="popo">
<i class="popover-btn " data-container="body" data-toggle="popover" data-placement="top" data-content="Wyświetlanie informacji o pojawiającej się nowej aktualizacji">?</i>
</div>
</label>
<div class="col-lg-9 pt5">
<div class="switch switch-primary round switch-inline">
<input type="checkbox" name="update" id="update" <? if ( $this -> settings['update'] ):?>checked="checked"<? endif;?>>
<label for="update"></label>
</div>
</div>
</div>
<?= Html::input(
array(
'label' => 'Numer licencji',
'name' => 'update_key',
'id' => 'update_key',
'value' => $this -> settings['update_key']
)
);
?>
</div>
<div class="clear"></div>
<?
$out = ob_get_clean();
$grid = new \gridEdit;
$grid -> id = 'settings-edit';
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'Edycja ustawień';
$grid -> actions = [
'save' => [
'url' => '/admin/settings/settings_save/',
'back_url' => '/admin/settings/view/'
]
];
$grid -> external_code = $out;
echo $grid -> draw();
?>
<script>CKEDITOR.dtd.$removeEmpty['span'] = false;</script>
<script>
$(document).ready(function () {
$('.popover-btn').popover(
{
trigger: 'hover',
html: true
});
});
</script>
<style>
#g-edit-save.btn-system{
display: none;
}
</style>
<style type="text/css">#g-edit-cancel { display: none; }</style>

View File

@@ -0,0 +1,248 @@
<? global $user, $config, $settings;?>
<!DOCTYPE html>
<html>
<head>
<title>cmsPro</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="www.project-pro.pl - internetowe rozwiązania dla biznesu">
<link rel="stylesheet" href="/libraries/framework/admin-tools/admin-forms/css/admin-forms.css">
<link rel='stylesheet' href='<? if ( $settings['ssl'] ) echo 'https'; else echo 'http';?>://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700'>
<link rel="stylesheet" href="/libraries/framework/vendor/plugins/magnific/magnific-popup.css">
<link rel="stylesheet" href="/libraries/framework/vendor/plugins/datepicker/css/bootstrap-datetimepicker.css">
<link rel="Stylesheet" type="text/css" href="/libraries/framework/vendor/jquery/jquery_ui/jquery-ui.structure.min.css">
<link rel="Stylesheet" type="text/css" href="/libraries/framework/vendor/jquery/jquery_ui/jquery-ui.theme.min.css">
<link rel="Stylesheet" type="text/css" href="/libraries/framework/vendor/plugins/daterange/daterangepicker.css">
<link rel="stylesheet" type="text/css" href="/libraries/easy-tabs/css/easy-responsive-tabs.css">
<link rel="stylesheet" type="text/css" href="/libraries/framework/vendor/plugins/tagmanager/tagmanager.css">
<link rel="stylesheet" type="text/css" href="/libraries/jquery-confirm/jquery-confirm.min.css">
<link rel="stylesheet" href="/libraries/framework/skin/default_skin/css/theme.css">
<script src="/libraries/framework/vendor/jquery/jquery-1.11.1.min.js"></script>
<script src="/libraries/framework/vendor/jquery/jquery_ui/jquery-ui.min.js"></script>
<script src="/libraries/framework/vendor/plugins/magnific/jquery.magnific-popup.js"></script>
<script type="text/javascript" src="/libraries/jquery-confirm/jquery-confirm.min.js"></script>
<script src="/libraries/easy-tabs/js/easyResponsiveTabs.js"></script>
<script src="/libraries/framework/vendor/plugins/moment/moment.js"></script>
<script src="/libraries/framework/vendor/plugins/moment/pl.js"></script>
<script src="/libraries/framework/vendor/plugins/datepicker/js/bootstrap-datetimepicker.js"></script>
<script src="/libraries/framework/vendor/plugins/daterange/daterangepicker.js"></script>
<script src="/libraries/framework/vendor/plugins/tagmanager/tagmanager.js"></script>
<script src="/libraries/functions.js"></script>
<link rel="stylesheet" href="/admin/css/custom.css" />
</head>
<body class="sb-top sb-top-sm">
<div id="main">
<header class="navbar navbar-shadow">
<div class="navbar-branding">
<a class="navbar-brand" href="/admin/pages/view_list/">
<b>cms</b>Pro
</a>
<a class="navbar-version" href="/admin/update/main_view/">
ver. <?= \S::get_version();?>
</a>
<? if ( $settings['update'] and \S::get_new_version() > \S::get_version() ):?>
<a href="/admin/update/main_view/" class="label label-danger">aktualizacja</a>
<? endif;?>
</div>
<div class="nav navbar-nav navbar-right">
<li class="dropdown menu-merge">
<a href="#" class="dropdown-toggle fw600 p15" data-toggle="dropdown" aria-expanded="false">
<img src="/admin/css/user-icon.png" alt="avatar" class="mw30 br64 mr15"> <? if ( $user['name'] or $user['surname'] ) echo $user['surname'] . ' ' . $user['name']; else echo $user['login'];?>
<span class="caret caret-tp hidden-xs"></span>
</a>
<ul class="dropdown-menu list-group dropdown-persist w250" role="menu">
<li class="list-group-item">
<a href="/admin/?s-action=user-logout" class="animated animated-short fadeInUp">
<span class="fa fa-power-off"></span>Wyloguj się
</a>
</li>
</ul>
</li>
<li id="toggle_sidemenu_t">
<span class="fa fa-bars"></span>
</li>
</div>
</header>
<aside id="sidebar_left">
<div class="sidebar-left-content nano-content">
<ul class="nav sidebar-menu">
<li>
<?if( \admin\factory\Users::check_privileges( 'page_administration', $user['id'] )
|| \admin\factory\Users::check_privileges( 'article_administration', $user['id'])
|| \admin\factory\Users::check_privileges( 'scontainer_administration', $user['id'])){?>
<a class="accordion-toggle" href="#">
<span class="sidebar-title">Zawartość</span>
<span class="caret"></span>
</a>
<?}?>
<ul class="nav sub-nav">
<li>
<? if( \admin\factory\Users::check_privileges( 'page_administration', $user['id'] ) ){ ?>
<a href="/admin/pages/view_list/">Konfiguracja menu</a>
<?}?>
</li>
<li>
<? if ( \admin\factory\Users::check_privileges( 'article_administration', $user['id'])){ ?>
<a href="/admin/articles/view_list/">Artykuły</a>
<?}?>
</li>
<li>
<? if ( \admin\factory\Users::check_privileges( 'article_administration', $user['id'])){ ?>
<a href="/admin/articles_archive/view_list/">Archiwum artykułów</a>
</li>
<?}?>
<li>
<? if ( \admin\factory\Users::check_privileges( 'scontainers_administration', $user['id'])){ ?>
<a href="/admin/scontainers/view_list/">Zawartość statyczna</a>
<?}?>
</li>
</ul>
</li>
<li>
<?if( \admin\factory\Users::check_privileges( 'fileManager_administration', $user['id'] )
|| \admin\factory\Users::check_privileges( 'baners_administration', $user['id'])
|| \admin\factory\Users::check_privileges( 'emails_administration', $user['id'])){?>
<a class="accordion-toggle" href="#">
<span class="sidebar-title">Pozostałe</span>
<span class="caret"></span>
</a>
<?}?>
<ul class="nav sub-nav">
<li>
<? if ( \admin\factory\Users::check_privileges( 'fileManager_administration', $user['id'])){ ?>
<a href="/admin/filemanager/draw/">Manadżer plików</a>
<?}?>
</li>
<li>
<? if ( \admin\factory\Users::check_privileges( 'baners_administration', $user['id'])){ ?>
<a href="/admin/banners/view_list/">Banery</a>
<?}?>
</li>
<li>
<? if ( \admin\factory\Users::check_privileges( 'emails_administration', $user['id'])){ ?>
<a href="/admin/emails/view_list/">Skrzynka pocztowa</a>
<?}?>
</li>
</ul>
</li>
<li>
<? if( \admin\factory\Users::check_privileges( 'newsletter_administration', $user['id'] ) )
{?>
<a class="accordion-toggle" href="#">
<span class="sidebar-title">Newsletter</span>
<span class="caret"></span>
</a>
<ul class="nav sub-nav">
<li>
<a href="/admin/newsletter/prepare/">Wysyłka - przygotowanie</a>
</li>
<li>
<a href="/admin/newsletter/emails_list/">Baza emaili</a>
</li>
<li>
<a href="/admin/newsletter/email_templates_user/">Szablony użytkownika</a>
</li>
<li>
<a href="/admin/newsletter/email_templates_admin/">Szablony administracyjne</a>
</li>
<li>
<a href="/admin/newsletter/settings/">Ustawienia</a>
</li>
</ul>
<?}?>
</li>
<li>
<? if( \admin\factory\Users::check_privileges( 'users_administration', $user['id'])
|| \admin\factory\Users::check_privileges( 'language_administration', $user['id'])
|| \admin\factory\Users::check_privileges( 'template_administration', $user['id'])
|| \admin\factory\Users::check_privileges( 'settings_administration', $user['id']))
{?>
<a class="accordion-toggle" href="#">
<span class="sidebar-title">Konfiguracja</span>
<span class="caret"></span>
</a>
<?}?>
<ul class="nav sub-nav">
<li>
<? if ( \admin\factory\Users::check_privileges( 'users_administration', $user['id'])){ ?>
<a href="/admin/users/view_list/">Użytkownicy</a>
<?}?>
</li>
<li>
<? if ( \admin\factory\Users::check_privileges( 'language_administration', $user['id'])){ ?>
<a href="/admin/languages/view_list/">Jęzki</a>
<?}?>
</li>
<li>
<? if ( \admin\factory\Users::check_privileges( 'language_administration', $user['id'])){ ?>
<a href="/admin/languages/translation_list/">Tłumaczenia</a>
<?} ?>
</li>
<li>
<? if ( \admin\factory\Users::check_privileges( 'settings_administration', $user['id'])){ ?>
<a href="/admin/settings/view/">Ustawienia</a>
<?}?>
</li>
<li>
<? if ( \admin\factory\Users::check_privileges( 'template_administration', $user['id'])){ ?>
<a href="/admin/layouts/view_list/">Szablony</a>
<?}?>
</li>
<li>
<? if ( \admin\factory\Users::check_privileges( 'backups_administration', $user['id'])){ ?>
<a href="/admin/backups/view_list/">Kopia zapasowa</a>
<?}?>
</li>
<li>
<? if ( \admin\factory\Users::check_privileges( 'seo_additional', $user['id'] ) ):?>
<a href="/admin/seo_additional/main_view/">Dodatkowe ustawienia SEO</a>
<? endif;?>
</li>
</ul>
</li>
<?
if ( file_exists( 'templates/additional-menu.php' ) )
include 'templates/additional-menu.php';
?>
<li>
<a href="/" target="_blank"><span class="sidebar-title">Podgląd</span></a>
</li>
</ul>
</div>
</aside>
<section id="content_wrapper">
<section id="content">
<? if ( $alert = \S::get_session( 'alert' ) ):
\S::alert( false );
?>
<div class="row">
<div class="col col-xs-12">
<div class="alert alert-primary alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<i class="fa fa-info pr10"></i>
<?= $alert;?>
</div>
</div>
</div>
<?
endif; ?>
<?= $this -> content;?>
</section>
</section>
</div>
<div id="overlay"></div>
<div id="ajax-container"></div>
<script src="/libraries/framework/js/utility/utility.js"></script>
<script src="/libraries/framework/js/main.js"></script>
<script type="text/javascript">
jQuery( document ).ready( function()
{
"use strict";
Core.init();
});
</script>
</body>
</html>

View File

@@ -0,0 +1,105 @@
<? global $user, $config, $settings;?>
<!DOCTYPE html>
<html>
<head>
<title>cmsPro</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="author" content="www.project-pro.pl - internetowe rozwiązania dla biznesu" />
<link rel="stylesheet" href="/libraries/framework/skin/default_skin/css/theme.css" />
<link rel="stylesheet" href="/libraries/framework/admin-tools/admin-forms/css/admin-forms.css" />
<link rel="stylesheet" href="/admin/css/custom.css" />
<script src="<?if ( $settings['ssl'] ) echo 'https'; else echo 'http';?>://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<body class="external-page sb-l-c sb-r-c">
<div id="main" class="animated fadeIn">
<section id="content_wrapper">
<div id="canvas-wrapper">
<canvas id="demo-canvas"></canvas>
</div>
<section id="content">
<div class="admin-form theme-info">
<div class="row mb15 table-layout">
<div class="col-xs-12">
<div class="login-links">
<a href="#"><b>cms</b>Pro</a>
</div>
</div>
</div>
<div class="panel panel-info br-n heading-border bg-white">
<div class="panel-body">
<div class="section-divider mb40">
<span>Logowanie</span>
</div>
<? if ( $alert = \S::get_session( 'alert' ) ):
\S::alert( false );
?>
<div class="container-fluid">
<div class="row">
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<i class="icon fa fa-ban pr10"></i><?= $alert;?>
</div>
</div>
</div>
<?
endif; ?>
<form method="POST" action="/admin/" class="form-horizontal" rol="form">
<input type="hidden" name="s-action" value="user-logon" />
<div class="form-group">
<label class="col col-sm-2 control-label" for="login">Login:</label>
<div class="col col-sm-10">
<div class="input-group">
<span class="input-group-addon">
<i class="fa fa-user"></i>
</span>
<input type="text" name="login" id="login" class="form-control" placeholder="Login" />
</div>
</div>
</div>
<div class="form-group">
<label class="col col-sm-2 control-label" for="password">Hasło:</label>
<div class="col col-sm-10">
<div class="input-group">
<span class="input-group-addon">
<i class="fa fa-lock"></i>
</span>
<input type="password" name="password" id="password" class="form-control" placeholder="Hasło" />
</div>
</div>
</div>
<div class="form-group">
<div class="col col-sm-10 col-sm-offset-2">
<input id="remember" type="checkbox" class="form-control" name="remember" value="1">
<label class="remember"> Pamiętaj mnie 14 dni</label>
</div>
</div>
<div class="form-group">
<div class="col col-sm-10 col-sm-offset-2">
<button class="btn btn-primary btn-flat btn-sm btn-block">Zaloguj się</button>
</div>
</div>
</form>
</div>
</div>
</div>
</section>
</section>
</div>
<script src="/libraries/framework/js/utility/utility.js"></script>
<script src="/libraries/framework/vendor/plugins/canvasbg/canvasbg.js"></script>
<script type="text/javascript">
jQuery( document ).ready( function()
{
"use strict";
CanvasBG.init({
Loc: {
x: window.innerWidth / 2,
y: window.innerHeight / 3.3
}
});
});
</script>
</body>
</html>

View File

@@ -0,0 +1,165 @@
<? global $db; ob_start();?>
<?= \Html::form_text( [
'label' => 'Twoja wersja systemu',
'id' => 'ver',
'text' => $this -> ver
] );?>
<?= \Html::form_text( [
'label' => 'Aktualna wersja systemu',
'text' => $this -> new_ver,
'id' => 'new_ver'
] );?>
<?
$ver_new = $this -> new_ver;
$ver = $this -> ver;
$valuemax = ( $ver_new - $ver ) * 1000;
?>
<div class="progress-box hidden">
<div class="version">
<h3> Aktualizacja <p class="version_curent">0</p> / <p class="version_diff">0</p></h3>
</div>
<div class="progress ">
<div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" accesskey=""aria-valuenow="" aria-valuemin="0" aria-valuemax="<?= $valuemax?>" style="width:"></div>
</div>
</div>
<div class="row">
<? if ( $this -> ver < $this -> new_ver ):?>
<div class="form-group col-lg-6 text-right">
<div class="">
<a href="#" class="btn btn-system btn-sm mb5" id="confirm">Aktualizuj do wyższej wersji</a>
</div>
</div>
<? endif;?>
<? if ( $this -> ver < $this -> new_ver ):?>
<div class="form-group col-lg-6">
<div class="">
<a href="#" class="btn btn-system btn-sm mb5" id="confirmUpdateAll">Aktualizuj do najwyższej wersji</a>
</div>
</div>
<? endif;?>
</div>
<? if ( $this -> ver < $this -> new_ver ):?>
<div class="text-danger text-center">* Przed aktualizacją systemu zalecane jest wykonanie pełnej kopii zapasowej.</div>
<div class="clear"></div>
<? endif;?>
<?
$out = ob_get_clean();
$grid = new \gridEdit;
$grid -> id = 'update-view';
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'Aktualizacja systemu';
$grid -> default_buttons = false;
$grid -> external_code = $out;
echo $grid -> draw();
?>
<?
ob_start();
echo $versions = file_get_contents( 'http://www.cmspro.project-dc.pl/updates/changelog.php' );
$out = ob_get_clean();
$grid = new \gridEdit;
$grid -> id = 'changelog';
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'Changelog';
$grid -> default_buttons = false;
$grid -> external_code = $out;
echo $grid -> draw();
?>
<script type="text/javascript">
var version_current = <?= $this -> ver;?>;
var version_new = <?= $this -> new_ver;?>;
var version_diff = Math.round((version_new - version_current) * 1000);
var width = 0;
var ac_lp = 0;
$(document).ready(function ()
{
$('body').on('click', '#confirm', function ()
{
$.prompt('Na pewno chcesz dokonać aktualizacji systemu?',
{
title: 'Potwierdź?',
submit: function (e, v, m, f)
{
if (v == true)
document.location.href = '/admin/update/update/';
},
buttons: {
'tak': true, 'nie': false
},
focus: 1
});
});
$('body').on('click', '#confirmUpdateAll', function ()
{
$.prompt('Na pewno chcesz dokonać aktualizacji systemu?',
{
title: 'Potwierdź?',
submit: function (e, v, m, f)
{
if (v == true)
{
$('.progress-box').removeClass('hidden');
$('#confirm').css('pointer-events', 'none');
$('#confirmUpdateAll').css('pointer-events', 'none');
$('.version_diff').html(version_diff);
updateAll(version_current, version_new, version_diff, width, ac_lp);
}
},
buttons: {
'tak': true, 'nie': false
}
});
});
});
function updateAll(version_current, version_new, version_diff, width, ac_lp)
{
$.ajax(
{
url: '/admin/update/updateAll/',
type: 'POST',
data:
{
version_current: version_current
},
success: function (data)
{
response = jQuery.parseJSON(data);
if (response.status == true)
{
ac_lp = ac_lp + 1;
$('.version_curent').html(ac_lp);
width = width + ((1 / version_diff) * 100);
$('.progress-bar').attr("style", "width:" + width + "%");
if (response.version < version_new)
{
updateAll(response.version, version_new, version_diff, width, ac_lp);
} else
{
$.prompt("Aktualizacja przebiegła pomyślnie.",
{
title: 'Informacja',
close: function (e, v, m, f) {
window.location.href = "/admin/update/main_view/";
}
});
}
} else
{
$.prompt("W trakcie aktualizacji systemu wystąpił błąd. Proszę spróbować ponownie.",
{
title: 'Błąd',
close: function (e, v, m, f) {
window.location.href = "/admin/update/main_view/";
}
});
}
}
}
);
};
</script>

View File

@@ -0,0 +1,325 @@
<?php
global $gdb, $config, $db;
ob_start();
$privileges = $this->privileges;
?>
<div class="form-group">
<label class="col-lg-3 control-label">Uprawnienia użytkownika:</label>
<div class="col-lg-9">
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="col-md-2 pt5">
<div class="switch switch-primary round switch-inline">
<input type="checkbox" name="privileges" value="page_administration" id="page_administration"
<?
foreach ($privileges as $pri) {
if ($pri['name'] == 'page_administration') {
echo 'checked=checked';
}
}
?> >
<label for="page_administration"></label>
</div>
</div>
<label class="col-md-10 control-label text-left ps">Strony</label>
</div>
<div class="col-xs-12 col-md-6">
<div class="col-md-2 pt5">
<div class="switch switch-primary round switch-inline ps">
<input type="checkbox" name="privileges" value="article_administration" id="article_administration"
<?
foreach ($privileges as $pri) {
if ($pri['name'] == 'article_administration') {
echo 'checked=checked';
}
}
?> >
<label for="article_administration"></label>
</div>
</div>
<label class="col-md-10 control-label text-left ps">Artykuły</label>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="col-md-2 pt5">
<div class="switch switch-primary round switch-inline">
<input type="checkbox" name="privileges" value="scontainers_administration" id="scontainers_administration"
<?
foreach ($privileges as $pri) {
if ($pri['name'] == 'scontainers_administration') {
echo 'checked=checked';
}
}
?> >
<label for="scontainers_administration"></label>
</div>
</div>
<label class="col-md-10 control-label text-left ps">Zawartość statyczna</label>
</div>
<div class="col-xs-12 col-md-6">
<div class="col-md-2 pt5">
<div class="switch switch-primary round switch-inline">
<input type="checkbox" name="privileges" value="fileManager_administration" id="fileManager_administration"
<?
foreach ($privileges as $pri) {
if ($pri['name'] == 'fileManager_administration') {
echo 'checked=checked';
}
}
?> >
<label for="fileManager_administration"></label>
</div>
</div>
<label class="col-md-10 control-label text-left ps">Menadżer plików</label>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="col-md-2 pt5">
<div class="switch switch-primary round switch-inline">
<input type="checkbox" name="privileges" value="baners_administration" id="baners_administration"
<?
foreach ($privileges as $pri) {
if ($pri['name'] == 'baners_administration') {
echo 'checked=checked';
}
}
?>
>
<label for="baners_administration"></label>
</div>
</div>
<label class="col-md-10 control-label text-left ps">Banery</label>
</div>
<div class="col-xs-12 col-md-6">
<div class="col-md-2 pt5">
<div class="switch switch-primary round switch-inline">
<input type="checkbox" name="privileges" value="emails_administration" id="emails_administration"
<?
foreach ($privileges as $pri) {
if ($pri['name'] == 'emails_administration') {
echo 'checked=checked';
}
}
?> >
<label for="emails_administration"></label>
</div>
</div>
<label class="col-md-10 control-label text-left ps">Skrzynka pocztowa</label>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="col-md-2 pt5">
<div class="switch switch-primary round switch-inline">
<input type="checkbox" name="privileges" value="newsletter_administration" id="newsletter_administration"
<?
foreach ($privileges as $pri) {
if ($pri['name'] == 'newsletter_administration') {
echo 'checked=checked';
}
}
?>
>
<label for="newsletter_administration"></label>
</div>
</div>
<label class="col-md-10 control-label text-left ps">Newsletter</label>
</div>
<div class="col-xs-12 col-md-6">
<div class="col-md-2 pt5">
<div class="switch switch-primary round switch-inline">
<input type="checkbox" name="privileges" value="users_administration" id="users_administration"
<?
foreach ($privileges as $pri) {
if ($pri['name'] == 'users_administration') {
echo 'checked=checked';
}
}
?>
>
<label for="users_administration"></label>
</div>
</div>
<label class="col-md-10 control-label text-left ps">Użytkownicy</label>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="col-md-2 pt5">
<div class="switch switch-primary round switch-inline">
<input type="checkbox" name="privileges" value="language_administration" id="language_administration"
<?
foreach ($privileges as $pri) {
if ($pri['name'] == 'language_administration') {
echo 'checked=checked';
}
}
?> >
<label for="language_administration"></label>
</div>
</div>
<label class="col-md-10 control-label text-left ps">Języki</label>
</div>
<div class="col-xs-12 col-md-6">
<div class="col-md-2 pt5">
<div class="switch switch-primary round switch-inline">
<input type="checkbox" name="privileges" value="settings_administration" id="settings_administration"
<?
foreach ($privileges as $pri) {
if ($pri['name'] == 'settings_administration') {
echo 'checked=checked';
}
}
?> >
<label for="settings_administration"></label>
</div>
</div>
<label class="col-md-10 control-label text-left ps">Ustawienia</label>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="col-md-2 pt5">
<div class="switch switch-primary round switch-inline">
<input type="checkbox" name="privileges" value="template_administration" id="template_administration"
<?
foreach ($privileges as $pri) {
if ($pri['name'] == 'template_administration') {
echo 'checked=checked';
}
}
?> >
<label for="template_administration"></label>
</div>
</div>
<label class="col-md-10 control-label text-left ps">Szablony strony</label>
</div>
<div class="col-xs-12 col-md-6">
<div class="col-md-2 pt5">
<div class="switch switch-primary round switch-inline">
<input type="checkbox" name="privileges" value="backups_administration" id="backups_administration" <? foreach ( $privileges as $pri ) if ( $pri['name'] == 'backups_administration' ) echo 'checked=checked';?>>
<label for="backups_administration"></label>
</div>
</div>
<label class="col-md-10 control-label text-left ps">Kopia zapasowa</label>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="col-md-2 pt5">
<div class="switch switch-primary round switch-inline">
<input type="checkbox" name="privileges" value="seo_administration" id="seo_administration" <? foreach ( $privileges as $pri ) if ( $pri['name'] == 'seo_administration' ) echo 'checked=checked';?>>
<label for="seo_administration"></label>
</div>
</div>
<label class="col-md-10 control-label text-left ps">Dodatkowe ustawienia SEO</label>
</div>
<div class="col-xs-12 col-md-6">
</div>
</div>
</div>
</div>
<?
$this->user['id'] ? $password_param = 'optional' : $password_param = 'require';
$out = ob_get_clean();
$grid = new \gridEdit;
$grid->gdb_opt = $gdb;
$grid->include_plugins = true;
$grid->title = 'Zapisz użytkownika';
$grid->fields = [
[
'db' => 'id',
'type' => 'hidden',
'value' => $this->user['id']
],
[
'db' => 'admin',
'type' => 'hidden',
'value' => '1'
],
[
'name' => 'Login',
'db' => 'login',
'type' => 'text',
'value' => $this->user['login'],
'params' => ['class' => 'require', 'function' => 'check_login']
],
[
'name' => 'Aktywny',
'db' => 'status',
'type' => 'input_switch',
'checked' => $this->user['status'] ? true : false
],
[
'name' => 'Aktywny do',
'db' => 'active_to',
'type' => 'text',
'id' => 'active_to',
'value' => $this->user['active_to'] == '0000-00-00' ? '' : $this->user['active_to']
],
[
'name' => 'Hasło',
'db' => 'password',
'type' => 'password',
'params' => ['class' => $password_param, 'min' => 5]
],
[
'name' => 'Hasło - powtórz',
'db' => 'password_re',
'type' => 'password',
'params' => ['class' => $password_param, 'min' => 5, 'equal' => 'password', 'error_txt' => 'Podane hasła są różne']
]
];
$grid->actions = [
'save' => ['url' => '/admin/users/user_save/', 'back_url' => '/admin/users/view_list/'],
'cancel' => ['url' => '/admin/users/view_list/']
];
$grid->external_code = $out;
$grid->persist_edit = true;
echo $grid->draw();
?>
<script type="text/javascript">
$(function ()
{
disable_menu();
});
function check_login()
{
var response = null;
$.ajax({
type: 'POST',
cache: false,
async: false,
url: '/admin/ajax.php',
data:
{
a: 'check_login',
login: $.trim($('#login').val()),
user_id: <?= (int) $this->user['id']; ?>
},
success: function (data)
{
response = $.parseJSON(data);
}
});
return response;
}
;
$(function ()
{
$('#active_to').addClass('date');
$('input[type="text"].date').datetimepicker({
format: "YYYY-MM-DD",
pickTime: false
});
});
</script>

View File

@@ -0,0 +1,47 @@
<?php
global $gdb;
$grid = new \grid( 'pp_users' );
$grid -> gdb_opt = $gdb;
$grid -> order = [ 'column' => 'login', 'type' => 'ASC' ];
$grid -> where = [ 'id[!]' => 1 ];
$grid -> search = [
[ 'name' => 'Login', 'db' => 'login', 'type' => 'text' ],
[ 'name' => 'Aktywny', 'db' => 'status', 'type' => 'select', 'replace' => [ 'array' => [ 0 => 'nie', 1 => 'tak' ] ] ]
];
$grid -> columns_view = [
[
'name' => 'Lp.',
'th' => [ 'class' => 'g-lp' ],
'td' => [ 'class' => 'g-center' ],
'autoincrement' => true
],
[
'name' => 'Aktywny',
'db' => 'status',
'replace' => [ 'array' => [ 0 => '<span style="color: #FF0000;">nie</span>', 1 => 'tak' ] ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
'td' => [ 'class' => 'g-center' ]
],
[
'name' => 'Login',
'db' => 'login',
'sort' => true
],
[
'name' => 'Edytuj',
'action' => [ 'type' => 'edit', 'url' => '/admin/users/user_edit/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 50px;' ],
'td' => [ 'class' => 'g-center' ]
],
[
'name' => 'Usuń',
'action' => [ 'type' => 'delete', 'url' => '/admin/users/user_delete/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 50px;' ],
'td' => [ 'class' => 'g-center' ]
]
];
$grid -> buttons = [
[ 'label' => 'Dodaj użytkownika', 'url' => '/admin/users/user_edit/', 'icon' => 'fa-plus-circle', 'class' => 'btn-success' ]
];
echo $grid -> draw();

207
ajax.php Normal file
View File

@@ -0,0 +1,207 @@
<?php
error_reporting( E_ALL ^ E_NOTICE ^ E_STRICT ^ E_WARNING ^ E_DEPRECATED );
function __autoload_my_classes( $classname )
{
$q = explode( '\\' , $classname );
$c = array_pop( $q );
$f = 'autoload/' . implode( '/' , $q ) . '/class.' . $c . '.php';
if ( file_exists( $f ) )
require_once( $f );
}
spl_autoload_register( '__autoload_my_classes' );
date_default_timezone_set( 'Europe/Warsaw' );
require_once 'config.php';
require_once 'libraries/medoo/medoo.php';
session_start();
$mdb = new medoo( [
'database_type' => 'mysql',
'database_name' => $database['name'],
'server' => $database['host'],
'username' => $database['user'],
'password' => $database['password'],
'charset' => 'utf8'
] );
if ( !$lang_id = \S::get_session( 'current-lang' ) )
{
$lang_id = \front\factory\Languages::default_language();
\S::set_session( 'current-lang', $lang_id );
}
if ( !$lang = \S::get_session( 'lang' ) )
{
$lang = \front\factory\Languages::lang_translations();
\S::set_session( 'lang', $lang );
}
\front\controls\Site::check_url_params();
if ( !$settings = \S::get_session( 'settings' ) )
{
$settings = \front\factory\Settings::settings_details();
\S::set_session( 'settings', $settings );
}
if ( \S::get( 'a' ) == 'calendar' )
{
echo \front\view\Site::calendar( \S::get( 'month' ), \S::get( 'year' ), true );
exit;
}
if ( \S::get( 'a' ) == 'widget-phone-now' )
{
$response = [ 'status' => 'error' ];
if ( \S::get( 'phone' ) )
{
if ( \S::send_email(
$settings['contact_email'],
'Prośba o oddzwonienie',
'<p>Nr telefonu: ' . \S::get( 'phone' ) . '</p>',
$settings['contact_email']
) )
$response = [ 'status' => 'ok' ];
}
echo json_encode( $response );
exit;
}
if ( \S::get( 'a' ) == 'contact_form' )
{
$response = [ 'status' => 'error' ];
if ( \S::get( 'email' ) )
{
if ( \S::send_email(
$settings['contact_email'],
\S::get( 'subject' ),
'<p>Nr telefonu: ' . \S::get( 'phone' ) . '</p>'
. '<p>Email: ' . \S::get( 'email' ) . '</p>'
. '<p>' . \S::get( 'text' ) . '</p>',
\S::get( 'email' )
) )
{
$mdb -> insert( 'pp_contact_emails', [
'email' => \S::get( 'email' ),
'phone' => \S::get('phone' ),
'title' => \S::get( 'subject' ),
'mail' => \S::get( 'text' ),
'add_date' => date("Y-m-d, H:i")
]);
$response = [ 'status' => 'ok' ];
}
}
echo json_encode( $response );
exit;
}
if ( \S::get( 'a' ) == 'cookie_close' )
{
setcookie( "cookie_information", "true", mktime( 0, 0, 0, 12, 31, 2115 ) );
exit;
}
if ( \S::get( 'a' ) == 'banner_close' )
{
\S::set_session( 'banner_close', true );
exit;
}
if ( \S::get( 'a' ) == 'contrast' )
{
\S::set_session( 'contrast', !\S::get_session( 'contrast' ) );
exit;
}
if ( \S::get( 'a' ) == 'article_unlock' )
{
\front\controls\Articles::article_unlock(
\S::get( 'password' ),
\S::get( 'article_id' )
);
exit;
}
if ( \S::get( 'a' ) == 'pixieset_gallery_download' ) {
$url = \front\controls\Articles::images_download( \S::get( 'hash' ) );
echo json_encode( [ 'url' => $url ] );
exit;
}
if ( \S::get( 'a' ) == 'pixieset_image_favorite' ) {
$status = \front\controls\Articles::pixieset_image_favorite( \S::get( 'image_id' ), \S::get( 'hash' ) );
echo json_encode( [ 'status' => $status ] );
exit;
}
if ( \S::get( 'a' ) == 'pixieset_save_favorite_images' ) {
$result = \front\controls\Articles::pixieset_save_favorite_images( \S::get( 'hash' ) );
echo json_encode( [ 'status' => $result ] );
exit;
}
if ( \S::get( 'a' ) == 'inline-edit-save' )
{
if ( strpos( \S::get( 'element_id' ), 'scontainer' ) !== false )
{
$scontainer_id = str_replace( [ 'scontainer-', '-content' ], [ '', '' ], \S::get( 'element_id' ) );
\Scontainer::updateByFrontEditor( $scontainer_id, \S::get( 'element_value' ), \S::get( 'lang_id' ) );
\S::delete_cache();
exit;
}
else
{
if ( \S::get( 'alltemplates' ) )
$layouts = $mdb -> select( 'pp_layouts', 'id' );
else
$layouts[] = \S::get( 'layout_id' );
foreach ( $layouts as $layout_id )
{
$layout = \front\factory\Layouts::layout_details( $layout_id );
$html = $layout['html'];
if ( strpos( $html, '[META_INDEX]' ) !== false )
{
$meta_index = true;
$html = str_replace( '[META_INDEX]', '', $html );
}
if ( strpos( $html, '[CSS]' ) !== false )
{
$css = true;
$html = str_replace( '[CSS]', '', $html );
}
if ( strpos( $html, '[JAVA_SCRIPT]' ) !== false )
{
$java_script = true;
$html = str_replace( '[JAVA_SCRIPT]', '', $html );
}
$html = preg_replace( '/^[ \t]*[\r\n]+/m', '', $html );
\S::suSetHtmlById( $html, \S::get( 'element_id' ), \S::get( 'element_value' ) );
if ( $meta_index )
$html = str_replace( '</head>', ' [META_INDEX]' . PHP_EOL . '</head>', $html );
if ( $css )
$html = str_replace( '</head>', ' [CSS]' . PHP_EOL . '</head>', $html );
if ( $java_script )
$html = str_replace( '</head>', ' [JAVA_SCRIPT]' . PHP_EOL . '</head>', $html );
$html = str_replace( [ '%5B', '%5D', '%20', '%24' ], [ '[', ']', ' ', '$' ], $html );
$mdb -> update( 'pp_layouts', [ 'html' => $html ], [ 'id' => $layout_id ] );
}
}
\S::delete_cache();
}
?>

View File

@@ -0,0 +1,71 @@
<?php
namespace admin;
class Site
{
public static function special_actions()
{
$sa = \S::get( 's-action' );
$domain = preg_replace( '#^(http(s)?://)?w{3}\.#', '$1', $_SERVER['SERVER_NAME'] );
$cookie_name = str_replace( '.', '-', $domain );
switch ( $sa )
{
case 'user-logon':
$result = \admin\factory\Users::logon( \S::get( 'login' ), \S::get( 'password' ) );
if ( $result == 1 )
{
if(\S::get('remember'))
{
$password = md5( \S::get( 'password' ) );
$login = \S::get( 'login' );
$value = [ login => $login , hash => $password ];
$value = json_encode( $value );
setcookie( $cookie_name, $value, time() +(86400 * 14), "/", $domain );
}
\S::set_session( 'user', \admin\factory\Users::details( \S::get( 'login' ) ) );
}
else
{
if ( $result == -1 )
\S::alert( 'Z powodu nieudanych 5 prób logowania Twoje konto zostało zablokowane.' );
else
\S::alert( 'Podane hasło jest nieprawidłowe, lub brak użytkownika o podanym loginie.' );
}
header( 'Location: /admin/articles/view_list/' );
exit;
break;
case 'user-logout':
setcookie( $cookie_name, "", time() -(86400), "/", $domain );
session_destroy();
header( 'Location: /admin/' );
exit;
break;
}
}
public static function route()
{
$_SESSION['admin'] = true;
$class = '\admin\controls\\';
$results = explode( '_', \S::get( 'module' ) );
if ( is_array( $results ) ) foreach ( $results as $row )
$class .= ucfirst( $row );
$action = \S::get( 'action' );
if ( class_exists( $class ) and method_exists( new $class, $action ) )
return call_user_func_array( array( $class, $action ), array() );
else
{
\S::alert( 'Nieprawidłowy adres url.' );
return false;
}
}
}

View File

@@ -0,0 +1,124 @@
<?php
namespace admin\controls;
class Articles
{
public static function duplicate_article()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'article_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
if ( \admin\factory\Articles::duplicate_article( \S::get( 'id' ) ) )
\S::alert( 'Artykuł został zuplikowany' );
header( 'Location: /admin/articles/view_list/' );
exit;
}
public static function gallery_order_save()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'article_administration', $user['id'] ) )
{
echo json_encode( [ 'status' => 'error', 'msg' => 'Nie masz uprawnień' ] );
exit;
}
if ( \admin\factory\Articles::gallery_order_save( \S::get( 'article_id' ), \S::get( 'order' ) ) )
echo json_encode( [ 'status' => 'ok', 'msg' => 'Artykuł został zapisany.' ] );
exit;
}
public static function browse_list()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'article_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
return \admin\view\Articles::browse_list();
}
public static function article_delete()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'article_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
if ( \admin\factory\Articles::articles_set_archive( \S::get( 'id' ) ) )
\S::alert( 'Artykuł został przeniesiony do archiwum.' );
header( 'Location: /admin/articles/view_list/' );
exit;
}
public static function article_save()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'article_administration',
$user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
$response = [ 'status' => 'error', 'msg' => 'Podczas zapisywania artykułu wystąpił błąd. Proszę spróbować ponownie.' ];
$values = \S::json_to_array( \S::get( 'values' ) );
if ( is_array( $values ) ) foreach ( $values as $key => $val )
{
if ( strpos( $key, 'ap_' ) !== false )
$params[$key] = $val;
}
$values['params'] = $params;
if ( $id = \admin\factory\Articles::article_save(
$values['id'], $values['title'], $values['entry'], $values['text'], $values['status'], $values['show_title'], $values['show_date_add'], $values['date_add'],
$values['show_date_modify'], $values['seo_link'], $values['meta_title'], $values['meta_description'], $values['meta_keywords'], $values['layout_id'],
$values['pages'], $values['noindex'], $values['repeat_entry'], $values['copy_from'], $values['social_icons'], $values['event_date'], $values['hidden-tags'], $values['block_direct_access'],
$values['priority'], $values['password'], $values['pixieset'], $params
) )
$response = [ 'status' => 'ok', 'msg' => 'Artykuł został zapisany.', 'id' => $id ];
\admin\factory\Articles::insert_missing_hash();
echo json_encode( $response );
exit;
}
public static function article_edit()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'article_administration',
$user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
\admin\factory\Articles::delete_nonassigned_images();
\admin\factory\Articles::delete_nonassigned_files();
return \admin\view\Articles::article_edit( [
'article' => \admin\factory\Articles::article_details( \S::get( 'id' ) ),
'menus' => \admin\factory\Pages::menus_list(),
'languages' => \admin\factory\Languages::languages_list(),
'layouts' => \admin\factory\Layouts::layouts_list(),
'additional_params_lon' => \admin\factory\Articles::additional_params( 1 ),
'additional_params_loff' => \admin\factory\Articles::additional_params( 0 ),
'settings' => \admin\factory\Settings::settings_details()
] );
}
public static function view_list()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'article_administration', $user['id'] ) )
return \S::alert( 'Brak uprawnień.' );
return \admin\view\Articles::articles_list();
}
}
?>

View File

@@ -0,0 +1,44 @@
<?php
namespace admin\controls;
class ArticlesArchive
{
public static function article_restore()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'article_administration',
$user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
if ( \admin\factory\ArticlesArchive::article_restore( \S::get( 'id' ) ) )
\S::alert( 'Artykuł został przywrócony.' );
header( 'Location: /admin/articles_archive/view_list/' );
exit;
}
public static function article_delete()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'article_administration',
$user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
if ( \admin\factory\ArticlesArchive::article_delete( \S::get( 'id' ) ) )
\S::alert( 'Artykuł został usunięty.' );
header( 'Location: /admin/articles_archive/view_list/' );
exit;
}
public static function view_list()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'article_administration',
$user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
return \admin\view\ArticlesArchive::articles_list();
}
}

View File

@@ -0,0 +1,66 @@
<?php
namespace admin\controls;
class Backups
{
public static function download_restore_file()
{
$file = '../restore.php';
if ( file_exists( $file ) )
{
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.basename($file).'"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize( $file ) );
readfile( $file );
exit;
}
}
public static function view_list()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'backups_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
return \admin\view\Backups::backups_list(
\admin\factory\Backups::backups_list()
);
}
public static function backup_save()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'backups_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
$response = 'Podczas tworzenia kopi zapasowej wystąpił błąd. Proszę spróbować ponownie.';
if ( \admin\factory\Backups::backup_save() )
\S::alert( 'Kopia zapasowa został utworzona.' );
header( 'Location: /admin/backups/view_list/' );
exit;
}
public static function backup_delete()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'backups_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
$response = 'Podczas usuwania kopi zapasowej wystąpił błąd. Proszę spróbować ponownie.';
if ( \admin\factory\Backups::backup_delete( \S::get( 'name' ) ) )
\S::alert( 'Kopia zapasowa został usunięta.' );
header( 'Location: /admin/backups/view_list/' );
exit;
}
}

View File

@@ -0,0 +1,66 @@
<?php
namespace admin\controls;
class Banners
{
public static function banner_delete()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'baners_administration',
$user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
if ( \admin\factory\Banners::banner_delete( \S::get( 'id' ) ) )
\S::alert( 'Baner został usunięty.' );
header( 'Location: /admin/banners/view_list/' );
exit;
}
public static function banner_save()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'baners_administration',
$user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
$response = [ 'status' => 'error', 'msg' => 'Podczas zapisywania baneru wystąpił błąd. Proszę spróbować ponownie.' ];
$values = \S::json_to_array( \S::get( 'values' ) );
if ( $banner_id = \admin\factory\Banners::banner_save( $values['id'], $values['name'], $values['status'], $values['date_start'], $values['date_end'],
$values['home_page'], $values['src'], $values['url'], $values['html'], $values['text'] ) )
$response = [ 'status' => 'ok', 'msg' => 'Baner został zapisany.', 'id' => $banner_id ];
echo json_encode( $response );
exit;
}
public static function banner_edit()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'baners_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
return \admin\view\Banners::banner_edit(
\admin\factory\Banners::banner_details(
\S::get( 'id' )
),
\admin\factory\Languages::languages_list()
);
}
public static function view_list()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'baners_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
return \admin\view\Banners::banners_list();
}
}
?>

View File

@@ -0,0 +1,28 @@
<?php
namespace admin\controls;
class Emails{
public static function view_list()
{
global $user;
if( !\admin\factory\Users::check_privileges( 'emails_administration', $user['id']))
return \S::alert('Nie masz uprawnień');
return \admin\view\Emails::emails_list();
}
public static function email_details()
{
global $user;
if( !\admin\factory\Users::check_privileges( 'emails_administration', $user['id']))
return \S::alert('Nie masz uprawnień');
return \admin\view\Emails::email_details(
\admin\factory\Emails::email_details(
\S::get( 'id' )
)
);
}
}

View File

@@ -0,0 +1,15 @@
<?php
namespace admin\controls;
class Filemanager
{
public function draw()
{
global $user;
if( !\admin\factory\Users::check_privileges( 'fileManager_administration', $user['id']))
return \S::alert('Nie masz uprawnień');
return \admin\view\FileManager::filemanager();
}
}
?>

View File

@@ -0,0 +1,126 @@
<?
namespace admin\controls;
class Languages
{
public static function language_delete()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'language_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
if ( \admin\factory\Languages::language_delete( \S::get( 'id' ) ) )
\S::alert( 'Język został usunięty.' );
header( 'Location: /admin/languages/view_list/' );
exit;
}
public static function language_save()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'language_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
$response = [ 'status' => 'error', 'msg' => 'Podczas zapisywania języka wystąpił błąd. Proszę spróbować ponownie.' ];
$values = \S::json_to_array( \S::get( 'values' ) );
if ( \admin\factory\Languages::language_save(
$values['id'], $values['name'], $values['status'], $values['start'], $values['o'], $values['domain'], $values['main_domain']
) )
$response = [ 'status' => 'ok', 'msg' => 'Język został zapisany.', 'id' => $id ];
echo json_encode( $response );
exit;
}
public static function language_edit()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'language_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
return \admin\view\Languages::language_edit(
\admin\factory\Languages::language_details(
\S::get( 'id' )
), \admin\factory\Languages::max_order()
);
}
public static function view_list()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'language_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
return \admin\view\Languages::languages_list();
}
public static function translation_delete()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'language_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
if ( \admin\factory\Languages::translation_delete( \S::get( 'id' ) ) )
\S::alert( 'Tłumaczenie zostało usunięte.' );
header( 'Location: /admin/languages/translation_list/' );
exit;
}
public static function translation_save()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'language_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
$response = [ 'status' => 'error', 'msg' => 'Podczas zapisywania tłumaczenia wystąpił błąd. Proszę spróbować ponownie.' ];
$values = \S::json_to_array( \S::get( 'values' ) );
$languages_list = \admin\factory\Languages::languages_list();
if ( is_array( $languages_list ) and !empty( $languages_list ) ) foreach ( $languages_list as $language )
{
\S::delete_session( 'lang-' . $language['id'] );
$languages[ $language['id'] ] = $values[ $language['id'] ];
}
if ( $id = \admin\factory\Languages::translation_save( $values['id'], $values['text'], $languages ) )
$response = [ 'status' => 'ok', 'msg' => 'Tłumaczenie zostało zapisane.', 'id' => $id ];
echo json_encode( $response );
exit;
}
public static function translation_edit()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'language_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
return \admin\view\Languages::translation_edit(
\admin\factory\Languages::translation_details( \S::get( 'id' ) ),
\admin\factory\Languages::languages_list()
);
}
public static function translation_list()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'language_administration',
$user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
return \admin\view\Languages::translations_list();
}
}
?>

View File

@@ -0,0 +1,59 @@
<?php
namespace admin\controls;
class Layouts
{
public static function layout_delete()
{
global $user;
if( !\admin\factory\Users::check_privileges( 'template_administration', $user['id']))
return \S::alert('Nie masz uprawnień');
if ( \admin\factory\Layouts::layout_delete( \S::get( 'id' ) ) )
\S::alert( 'Szablon został usunięty.' );
header( 'Location: /admin/layouts/view_list/' );
exit;
}
public static function layout_save()
{
global $user;
if( !\admin\factory\Users::check_privileges( 'template_administration', $user['id']))
return \S::alert('Nie masz uprawnień');
$response = [ 'status' => 'error', 'msg' => 'Podczas zapisywania szablonu wystąpił błąd. Proszę spróbować ponownie.' ];
$values = \S::json_to_array( \S::get( 'values' ) );
if ( $id = \admin\factory\Layouts::layout_save( $values['id'], $values['name'], $values['status'], $values['pages'], $values['html'], $values['css'], $values['js'], $values['m_html'], $values['m_css'], $values['m_js'] ) )
$response = [ 'status' => 'ok', 'msg' => 'Szablon został zapisany.', 'id' => $id ];
echo json_encode( $response );
exit;
}
public static function layout_edit()
{
global $user;
if( !\admin\factory\Users::check_privileges( 'template_administration', $user['id']))
return \S::alert('Nie masz uprawnień');
return \admin\view\Layouts::layout_edit(
\admin\factory\Layouts::layout_details(
\S::get( 'id' )
),
\admin\factory\Layouts::menus_list()
);
}
public static function view_list()
{
global $user;
if( !\admin\factory\Users::check_privileges( 'template_administration', $user['id']))
return \S::alert('Nie masz uprawnień');
return \admin\view\Layouts::layouts_list();
}
}
?>

View File

@@ -0,0 +1,167 @@
<?php
namespace admin\controls;
class Newsletter
{
public static function emails_import()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'newsletter_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
$values = \S::json_to_array( \S::get( 'values' ) );
if ( \admin\factory\Newsletter::emails_import( $values['emails'] ) )
\S::alert( 'Emaile zostały zaimportowane.' );
echo json_encode( [ 'status' => 'ok', 'msg' => 'Emaile zostały zaimportowane.' ] );
exit;
}
public static function import()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'newsletter_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
return \Tpl::view( 'newsletter/import' );
}
public static function emails_list()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'newsletter_administration', $user['id'] ) )
return \S::alert('Nie masz uprawnień');
return \admin\view\Newsletter::emails_list();
}
public static function send()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'newsletter_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
if ( \admin\factory\Newsletter::send( \S::get( 'dates' ), \S::get( 'template' ), \S::get( 'only_once' ) ) )
\S::alert( 'Newsletter został dodany do kolejki wysyłania.' );
header( 'Location: /admin/newsletter/prepare/' );
exit;
}
public static function prepare()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'newsletter_administration', $user['id'] ) )
return \S::alert('Nie masz uprawnień');
return \admin\view\Newsletter::prepare(
\admin\factory\Newsletter::templates_list()
);
}
public static function settings_save()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'newsletter_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
$values = \S::json_to_array( \S::get( 'values' ) );
\admin\factory\Settings::settings_update( 'newsletter_footer_1', $values['newsletter_footer_1'] );
\admin\factory\Settings::settings_update( 'newsletter_footer_2', $values['newsletter_footer_2'] );
\admin\factory\Settings::settings_update( 'newsletter_header', $values['newsletter_header'] );
\S::alert( 'Ustawienia zostały zapisane.' );
echo json_encode( [ 'status' => 'ok', 'msg' => 'Ustawienia zostały zapisane.' ] );
exit;
}
public static function settings()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'newsletter_administration', $user['id']))
return \S::alert('Nie masz uprawnień');
return \admin\view\Newsletter::settings(
\admin\factory\Settings::settings_details()
);
}
public static function email_templates_user()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'newsletter_administration', $user['id'] ) )
return \S::alert('Nie masz uprawnień');
return \admin\view\Newsletter::email_templates_user();
}
public static function email_templates_admin()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'newsletter_administration', $user['id'] ) )
return \S::alert('Nie masz uprawnień');
return \admin\view\Newsletter::email_templates_admin();
}
public static function email_template_delete()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'newsletter_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
$is_admin = \admin\factory\Newsletter::is_admin_template( \S::get( 'id' ) );
if ( !$is_admin and \admin\factory\Newsletter::newsletter_template_delete( \S::get( 'id' ) ) )
\S::alert( 'Szablon newslettera został usunięty.' );
if ( $is_admin )
header( 'Location: /admin/newsletter/email_templates_admin/' );
else
header( 'Location: /admin/newsletter/email_templates_user/' );
exit;
}
public static function email_template_edit()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'newsletter_administration', $user['id']))
return \S::alert('Nie masz uprawnień');
return \admin\view\Newsletter::email_template_edit(
\admin\factory\Newsletter::email_template_detalis(
\S::get( 'id' )
)
);
}
public static function template_save()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'newsletter_administration', $user['id']))
return \S::alert('Nie masz uprawnień');
$response = [ 'status' => 'error', 'msg' => 'Podczas zapisywania wystąpił błąd. Proszę spróbować ponownie.' ];
$values = \S::json_to_array( \S::get( 'values' ) );
if ( $id = \admin\factory\Newsletter::template_save( $values['id'], $values['name'], $values['text'] ) )
$response = [ 'status' => 'ok', 'msg' => 'Zmiany zostały zapisane.', 'id' => $id ];
echo json_encode( $response );
exit;
}
}

View File

@@ -0,0 +1,156 @@
<?php
namespace admin\controls;
class Pages
{
public static function pages_url_browser()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'page_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
echo \admin\view\Pages::browse_list(
\admin\factory\Pages::menus_list(),
\S::get( 'modal' )
);
exit;
}
public static function browse_list()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'page_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
return \admin\view\Pages::browse_list(
\admin\factory\Pages::menus_list()
);
}
public static function menu_delete()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'page_administration',
$user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
if ( \admin\factory\Pages::menu_delete( \S::get( 'id' ) ) )
\S::set_message( 'Menu zostało usunięte.' );
else
\S::alert( 'Podczas usuwania menu wystąpił błąd. Aby usunąć menu nie może ono posiadać przypiętych stron.' );
header( 'Location: /admin/pages/view_list/' );
exit;
}
public static function page_delete()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'page_administration',
$user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
if ( \admin\factory\Pages::page_delete( \S::get( 'id' ) ) )
\S::set_message( 'Strona została usunięta.' );
else
\S::alert( 'Podczas usuwania strony wystąpił błąd. Aby usunąć stronę nie może ona posiadać przypiętych podstron.' );
header( 'Location: /admin/pages/view_list/' );
exit;
}
public static function page_articles()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'page_administration',
$user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
return \admin\view\Pages::page_articles( \S::get( 'id' ),
\admin\factory\Pages::page_articles( \S::get( 'id' ) ) );
}
public static function page_save()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'page_administration',
$user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
$response = [ 'status' => 'error', 'msg' => 'Podczas zapisywania strony wystąpił błąd. Proszę spróbować ponownie.' ];
$values = \S::json_to_array( \S::get( 'values' ) );
if ( $id = \admin\factory\Pages::page_save(
$values['id'], $values['title'], $values['seo_link'], $values['meta_title'], $values['meta_description'], $values['meta_keywords'], $values['menu_id'],
$values['parent_id'], $values['page_type'], $values['sort_type'], $values['layout_id'], $values['articles_limit'], $values['show_title'],
$values['status'], $values['link'], $values['noindex'], $values['start'], $values['site_title'], $values['block_direct_access'], $values['cache'], $values['canonical']
) )
$response = [ 'status' => 'ok', 'msg' => 'Strona została zapisana.', 'id' => $id ];
echo json_encode( $response );
exit;
}
public static function page_edit()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'page_administration',
$user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
return \admin\view\Pages::page_edit(
\admin\factory\Pages::page_details(
\S::get( 'id' )
), \S::get( 'pid' ), \S::get( 'menu_id' ),
\admin\factory\Pages::menu_lists(),
\admin\factory\Layouts::layouts_list(),
\admin\factory\Languages::languages_list(),
\admin\factory\Settings::settings_details()
);
}
public static function menu_save()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'page_administration',
$user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
$response = [ 'status' => 'error', 'msg' => 'Podczas zapisywania menu wystąpił błąd. Proszę spróbować ponownie.' ];
$values = \S::json_to_array( \S::get( 'values' ) );
if ( \admin\factory\Pages::menu_save( $values['id'], $values['name'],
$values['status'] ) )
$response = [ 'status' => 'ok', 'msg' => 'Menu zostało zapisane.' ];
echo json_encode( $response );
exit;
}
public static function menu_edit()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'page_administration',
$user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
return \admin\view\Pages::menu_edit(
\admin\factory\Pages::menu_details( \S::get( 'id' ) )
);
}
public static function view_list()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'page_administration',
$user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
return \admin\view\Pages::pages_list(
\admin\factory\Pages::menus_list()
);
}
}
?>

View File

@@ -0,0 +1,75 @@
<?php
namespace admin\controls;
class Scontainers
{
static public function ckeditor_list()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'scontainers_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
return \Tpl::view( '/scontainers/ckeditor-list' );
}
public static function container_delete()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'scontainers_administration',
$user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
if ( \admin\factory\Scontainers::container_delete( \S::get( 'id' ) ) )
\S::alert( 'Kontener został usunięty.' );
header( 'Location: /admin/scontainers/view_list/' );
exit;
}
public static function container_save()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'scontainers_administration',
$user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
$response = [ 'status' => 'error', 'msg' => 'Podczas zapisywania kontenera wystąpił błąd. Proszę spróbować ponownie.' ];
$values = \S::json_to_array( \S::get( 'values' ) );
if ( $id = \admin\factory\Scontainers::container_save( $values['id'], $values['title'], $values['text'], $values['status'], $values['show_title'],
$values['src'], $values['html']
) )
$response = [ 'status' => 'ok', 'msg' => 'Kontener został zapisany.', 'id' => $id ];
echo json_encode( $response );
exit;
}
public static function container_edit()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'scontainers_administration',
$user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
return \admin\view\Scontainers::container_edit(
\admin\factory\Scontainers::container_details(
\S::get( 'id' )
), \admin\factory\Languages::languages_list()
);
}
public static function view_list()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'scontainers_administration',
$user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
return \admin\view\Scontainers::containers_list();
}
}

View File

@@ -0,0 +1,59 @@
<?php
namespace admin\controls;
class SeoAdditional
{
public static function element_delete()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'seo_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
if ( \admin\factory\SeoAdditional::element_delete( \S::get( 'id' ) ) )
\S::alert( 'Element został usunięty.' );
header( 'Location: /admin/seo_additional/main_view/' );
exit;
}
public static function element_save()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'seo_administration', $user['id']))
return \S::alert( 'Nie masz uprawnień' );
$response = [ 'status' => 'error', 'msg' => 'Podczas zapisywania elementu wystąpił błąd. Proszę spróbować ponownie.' ];
$values = \S::json_to_array( \S::get( 'values' ) );
if ( $id = \admin\factory\SeoAdditional::element_save( $values['id'], $values['url'], $values['status'], $values['title'], $values['keywords'], $values['description'], $values['text'] ) )
$response = [ 'status' => 'ok', 'msg' => 'Zmiany zostały zapisane.', 'id' => $id ];
echo json_encode( $response );
exit;
}
public static function element_edit()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'seo_administration', $user['id']))
return \S::alert( 'Nie masz uprawnień' );
return \admin\view\SeoAdditional::element_edit(
\admin\factory\SeoAdditional::element_details(
\S::get( 'id' )
)
);
}
public static function main_view()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'seo_administration', $user['id'] ) )
return \S::alert( 'Nie masz uprawnień' );
return \admin\view\SeoAdditional::main_view();
}
}

View File

@@ -0,0 +1,44 @@
<?
namespace admin\controls;
class Settings
{
public static function settings_save()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'settings_administration', $user['id'] ) )
return \S::alert('Nie masz uprawnień');
$settings = \admin\factory\Settings::settings_details();
$values = \S::json_to_array( \S::get( 'values' ) );
\admin\factory\Settings::settings_save(
$values['firm_name'], $values['firm_adress'], $values['additional_info'], $values['contact_form'], $values['contact_email'], $values['email_host'],
$values['email_port'], $values['email_login'], $values['email_password'], $values['google_maps'], $values['facebook_link'], $values['statistic_code'], $values['htaccess'],
$values['robots'], $settings['newsletter_header'], $settings['newsletter_footer_1'], $settings['newsletter_footer_2'], $values['google_map_key'], $values['google_search_console'], $values['update'], $values['devel'],
$values['news_limit'], $values['visit_counter'], $values['calendar'], $values['tags'], $values['ssl'], $values['mysql_debug'], $values['htaccess_cache'], $settings['visits'],
$values['links_structure'], $values['link_version'], $values['widget_phone'], $values['update_key'], $values['newsletter_cron']
);
\admin\factory\Settings::settings_update( 'image_px', $values['image_px'] );
\S::alert( 'Ustawienia zostały zapisane.' );
echo json_encode( [ 'status' => 'ok', 'msg' => 'Ustawienia zostały zapisane.' ] );
exit;
}
public static function view()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'settings_administration', $user['id']))
return \S::alert('Nie masz uprawnień');
return \admin\view\Settings::view(
\admin\factory\Settings::settings_details()
);
}
}
?>

View File

@@ -0,0 +1,29 @@
<?php
namespace admin\controls;
class Update
{
public static function update()
{
if ( !\admin\factory\Update::update() )
\S::alert( 'W trakcie aktualizacji systemu wystąpił błąd. Proszę spróbować ponownie.' );
else
\S::set_message( 'Aktualizacja przebiegła pomyślnie.' );
header( 'Location: /admin/update/main_view/' );
exit;
}
public static function updateAll()
{
$response['status'] = \admin\factory\Update::update();
$response['version'] = number_format( \S::get('version_current') + 0.001, 3, '.', '' );
echo json_encode( $response );
exit;
}
public static function main_view()
{
return \admin\view\Update::main_view();
}
}

View File

@@ -0,0 +1,59 @@
<?php
namespace admin\controls;
class Users
{
public static function user_delete()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'users_administration', $user['id'] ) )
return \S::alert('Nie masz uprawnień');
if ( \admin\factory\Users::user_delete( \S::get( 'id' ) ) )
\S::alert( 'Użytkownik został usunięty.' );
header( 'Location: /admin/users/view_list/' );
exit;
}
public static function user_save()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'users_administration', $user['id'] ) )
return \S::alert('Nie masz uprawnień');
$values = \S::json_to_array( \S::get( 'values' ) );
$response = \admin\factory\Users::user_save(
$values['id'], $values['login'], $values['status'], $values['active_to'], $values['password'], $values['password_re'], $values['admin'], $values['privileges']
);
echo json_encode( $response );
exit;
}
public static function user_edit()
{
global $user;
if ( !\admin\factory\Users::check_privileges( 'users_administration', $user['id'] ) )
return \S::alert('Nie masz uprawnień');
return \admin\view\Users::user_edit(
\admin\factory\Users::user_details(
\S::get( 'id' ) ),
\admin\factory\Users::user_privileges(
\S::get( 'id' ) )
);
}
public static function view_list()
{
global $user;
if( !\admin\factory\Users::check_privileges( 'users_administration', $user['id']))
return \S::alert('Nie masz uprawnień');
return \admin\view\Users::users_list();
}
}
?>

View File

@@ -0,0 +1,683 @@
<?php
namespace admin\factory;
class Articles
{
public static function duplicate_article( $article_id )
{
global $mdb, $user;
$article = \admin\factory\Articles::article_details( $article_id );
if ( $article )
{
$mdb -> insert( 'pp_articles', [
'show_title' => $article['show_title'],
'show_date_add' => $article['show_date_add'],
'show_date_modify' => $article['show_date_modify'],
'date_add' => date( 'Y-m-d H:i:s' ),
'date_modify' => date( 'Y-m-d H:i:s' ),
'modify_by' => $user['id'],
'layout_id' => $article['layout_id'],
'status' => $article['status'],
'repeat_entry' => $article['repeat_entry'],
'social_icons' => $article['social_icons'],
'date_start' => $article['date_start'],
'date_end' => $article['event_date'],
'priority' => $article['priority'],
'password' => $article['password'],
'pixieset' => $article['pixieset']
] );
$article_tmp_id = $mdb -> id();
if ( $article_tmp_id )
{
foreach ( $article['languages'] as $key => $val )
{
$mdb -> insert( 'pp_articles_langs', [
'article_id' => $article_tmp_id,
'lang_id' => $key,
'title' => 'Kopia: ' . $val['title'],
'entry' => $val['entry'],
'text' => $val['text'],
'meta_title' => null,
'meta_description' => null,
'meta_keywords' => null,
'seo_link' => null,
'copy_from' => $val['copy_from'],
'block_direct_access' => $val['block_direct_access']
] );
}
foreach ( $article['params'] as $param )
{
$mdb -> insert( 'pp_articles_additional_values', [
'param_id' => $param['param_id'],
'value' => $param['value'],
'article_id' => $article_tmp_id,
'language_id' => $param['language_id']
] );
}
foreach ( $article['pages'] as $page )
{
$order = self::max_order() + 1;
$mdb -> insert( 'pp_articles_pages', [
'article_id' => $article_tmp_id,
'page_id' => $page,
'o' => (int)$order
] );
}
return true;
}
}
return false;
}
public static function insert_missing_hash() {
global $mdb;
if ( $mdb -> count( 'pp_articles', [ 'hash' => null ] ) ) {
$rows = $mdb -> select( 'pp_articles', [ 'id', 'date_add' ], [ 'hash' => null ] );
if ( is_array( $rows ) ) foreach ( $rows as $row ) {
$mdb -> update( 'pp_articles', [ 'hash' => md5( $row['id'] . $row['date_add'] ) ], [ 'id' => $row['id'] ] );
}
}
return true;
}
public static function gallery_order_save( $article_id, $order )
{
global $mdb;
$order = explode( ';', $order );
if ( is_array( $order ) and !empty( $order ) ) foreach ( $order as $image_id )
{
$mdb -> update( 'pp_articles_images', [
'o' => $i++
], [
'AND' => [
'article_id' => $article_id,
'id' => $image_id
]
] );
}
}
public static function additional_params( $language = 0 )
{
global $mdb;
return $mdb -> select( 'pp_articles_additional_params', '*', [ 'AND' => [ 'status' => 1, 'language' => $language ] ] );
}
public static function image_alt_change( $image_id, $image_alt )
{
global $mdb;
$result = $mdb -> update( 'pp_articles_images', [
'alt' => $image_alt
], [
'id' => $image_id
] );
\S::delete_cache();
return $result;
}
public static function articles_by_date_add( $date_start, $date_end )
{
global $mdb;
$results = $mdb -> query( 'SELECT '
. 'id '
. 'FROM '
. 'pp_articles '
. 'WHERE '
. 'status = 1 '
. 'AND '
. 'date_add BETWEEN \'' . $date_start . '\' AND \'' . $date_end . '\' '
. 'ORDER BY '
. 'date_add DESC' ) -> fetchAll();
if ( is_array( $results ) and !empty( $results ) ) foreach ( $results as $row )
$articles[] = \front\factory\Articles::article_details( $row['id'], 'pl' );
return $articles;
}
public static function article_url( $article_id )
{
global $mdb;
$results = $mdb -> query( "SELECT seo_link FROM pp_articles_langs AS pal, pp_langs AS pl WHERE lang_id = pl.id AND article_id = " . (int)$article_id . " AND seo_link != '' ORDER BY o ASC LIMIT 1" ) -> fetchAll();
if ( !$results[0]['seo_link'] )
{
$title = self::article_title( $article_id );
return 'a-' . $article_id . '-' . \S::seo( $title );
}
else
return $results[0]['seo_link'];
}
public static function article_pages( $article_id )
{
global $mdb;
$results = $mdb -> query( "SELECT page_id FROM pp_articles_pages WHERE article_id = " . (int)$article_id ) -> fetchAll();
if ( is_array( $results ) and !empty( $results ) ) foreach ( $results as $row )
{
if ( $out == '' )
$out .= ' - ';
$out .= \admin\factory\Pages::page_title( $row['page_id'] );
if ( end( $results ) != $row )
$out .= ' / ';
}
return $out;
}
public static function article_title( $article_id )
{
global $mdb;
$results = $mdb -> query( "SELECT title FROM pp_articles_langs AS pal, pp_langs AS pl WHERE lang_id = pl.id AND article_id = " . (int)$article_id . " AND title != '' ORDER BY o ASC LIMIT 1" ) -> fetchAll();
return $results[0]['title'];
}
public static function articles_set_archive( $article_id )
{
global $mdb;
$result = $mdb -> update( 'pp_articles', [ 'status' => -1 ], [ 'id' => (int)$article_id ] );
\S::htacces();
\S::delete_cache();
return $result;
}
public static function file_name_change( $file_id, $file_name )
{
global $mdb;
$mdb -> update( 'pp_articles_files', [ 'name' => $file_name ], [ 'id' => (int)$file_id ] );
return true;
}
public static function delete_file( $file_id )
{
global $mdb;
$mdb -> update( 'pp_articles_files', [ 'to_delete' => 1 ], [ 'id' => (int)$file_id ] );
return true;
}
public static function delete_img( $image_id )
{
global $mdb;
$mdb -> update( 'pp_articles_images', [ 'to_delete' => 1 ], [ 'id' => (int)$image_id ] );
return true;
}
public static function article_details( $article_id )
{
global $mdb;
if ( $article = $mdb -> get( 'pp_articles', '*', [ 'id' => (int)$article_id ] ) )
{
$results = $mdb -> select( 'pp_articles_langs', '*', [ 'article_id' => (int)$article_id ] );
if ( is_array( $results ) ) foreach ( $results as $row )
$article['languages'][ $row['lang_id'] ] = $row;
$article['images'] = $mdb -> select( 'pp_articles_images', '*', [ 'article_id' => (int)$article_id, 'ORDER' => [ 'o' => 'ASC', 'id' => 'ASC' ] ] );
$article['files'] = $mdb -> select( 'pp_articles_files', '*', [ 'article_id' => (int)$article_id ] );
$article['pages'] = $mdb -> select( 'pp_articles_pages', 'page_id', [ 'article_id' => (int)$article_id ] );
$article['tags'] = $mdb -> select( 'pp_tags', [ '[><]pp_articles_tags' => [ 'id' => 'tag_id' ] ], 'name', [ 'article_id' => (int)$article_id ] );
$article['params'] = $mdb -> select( 'pp_articles_additional_values', [ 'param_id', 'value', 'language_id' ], [ 'article_id' => (int)$article_id ] );
}
return $article;
}
public static function max_order()
{
global $mdb;
return $mdb -> max( 'pp_articles_pages', 'o' );
}
public static function article_save(
$article_id, $title, $entry, $text, $status, $show_title, $show_date_add, $date_add, $show_date_modify, $seo_link, $meta_title, $meta_description,
$meta_keywords, $layout_id, $pages, $noindex, $repeat_entry, $copy_from, $social_icons, $event_date, $tags, $block_direct_access, $priority,
$password, $pixieset, $params )
{
global $mdb, $user;
$event_date = explode( ' - ', $event_date );
if ( !$article_id )
{
$mdb -> insert( 'pp_articles', [
'show_title' => $show_title == 'on' ? 1 : 0,
'show_date_add' => $show_date_add == 'on' ? 1 : 0,
'show_date_modify' => $show_date_modify == 'on' ? 1 : 0,
'date_add' => $date_add ? $date_add : date( 'Y-m-d H:i:s' ),
'date_modify' => $date_add ? $date_add : date( 'Y-m-d H:i:s' ),
'modify_by' => $user['id'],
'layout_id' => $layout_id ? (int)$layout_id : null,
'status' => $status == 'on' ? 1 : 0,
'repeat_entry' => $repeat_entry == 'on' ? 1 : 0,
'social_icons' => $social_icons == 'on' ? 1 : 0,
'date_start' => $event_date[0] ? $event_date[0] : null,
'date_end' => $event_date[1] ? $event_date[1] : null,
'priority' => $priority == 'on' ? 1 : 0,
'password' => $password ? $password : null,
'pixieset' => $pixieset
] );
$id = $mdb -> id();
if ( $id )
{
$i = 0;
/* tłumaczenia */
$results = $mdb -> select( 'pp_langs', [ 'id' ], [ 'status' => 1, 'ORDER' => [ 'o' => 'ASC' ] ] );
if ( is_array( $results ) and count( $results ) > 1 ) foreach ( $results as $row )
{
$mdb -> insert( 'pp_articles_langs', [
'article_id' => (int)$id,
'lang_id' => $row['id'],
'title' => $title[ $i ] != '' ? $title[ $i ] : null,
'entry' => $entry[ $i ] != '' ? $entry[ $i ] : null,
'text' => $text[ $i ] != '' ? $text[ $i ] : null,
'meta_title' => $meta_title[ $i ] != '' ? $meta_title[ $i ] : null,
'meta_description' => $meta_description[ $i ] != '' ? $meta_description[ $i ] : null,
'meta_keywords' => $meta_keywords[ $i ] != '' ? $meta_keywords[ $i ] : null,
'seo_link' => \S::seo( $seo_link[ $i ] ) != '' ? \S::seo( $seo_link[ $i ] ) : null,
'noindex' => $noindex[ $i ],
'copy_from' => $copy_from[ $i ] != '' ? $copy_from[ $i ] : null,
'block_direct_access' => $block_direct_access[ $i ]
] );
$i++;
}
else if ( is_array( $results ) and count( $results ) == 1 ) foreach ( $results as $row )
{
$mdb -> insert( 'pp_articles_langs', [
'article_id' => (int)$id,
'lang_id' => $row['id'],
'title' => $title != '' ? $title : null,
'entry' => $entry != '' ? $entry : null,
'text' => $text != '' ? $text : null,
'meta_title' => $meta_title != '' ? $meta_title : null,
'meta_description' => $meta_description != '' ? $meta_description : null,
'meta_keywords' => $meta_keywords != '' ? $meta_keywords : null,
'seo_link' => \S::seo( $seo_link ) != '' ? \S::seo( $seo_link ) : null,
'noindex' => $noindex,
'copy_from' => $copy_from != '' ? $copy_from : null,
'block_direct_access' => $block_direct_access
] );
}
/* parametry bez wersji językowych */
$results = $mdb -> select( 'pp_articles_additional_params', '*', [ 'AND' => [ 'status' => 1, 'language' => 0 ] ] );
if ( is_array( $results ) and !empty( $results ) ) foreach ( $results as $row )
{
$mdb -> insert( 'pp_articles_additional_values', [
'param_id' => $row['id'],
'value' => $params[ 'ap_' . $row['name'] ],
'article_id' => (int)$id,
'language_id' => null
] );
}
/* strony */
if ( is_array( $pages ) ) foreach ( $pages as $page )
{
$order = self::max_order() + 1;
$mdb -> insert( 'pp_articles_pages', [
'article_id' => (int)$id,
'page_id' => (int)$page,
'o' => (int)$order
] );
}
else if ( $pages )
{
$order = self::max_order() + 1;
$mdb -> insert( 'pp_articles_pages', [
'article_id' => (int)$id,
'page_id' => (int)$pages,
'o' => (int)$order
] );
}
/* pliki */
$results = $mdb -> select( 'pp_articles_files', '*', [ 'article_id' => null ] );
if ( is_array( $results ) ) foreach ( $results as $row )
{
$dir = '/upload/article_files/article_' . $id;
$new_file_name = str_replace( '/upload/article_files/tmp', $dir, $row['src'] );
if ( file_exists( '..' . $row['src'] ) )
{
if ( !is_dir( '../' . $dir ) and $created !== true )
{
if ( mkdir( '../' . $dir, 0755, true ) )
$created = true;
}
rename( '..' . $row['src'], '..' . $new_file_name );
}
$mdb -> update( 'pp_articles_files', [ 'src' => $new_file_name, 'article_id' => $id ], [ 'id' => $row['id'] ] );
}
$created = false;
/* zdjęcia */
$results = $mdb -> select( 'pp_articles_images', '*', [ 'article_id' => null ] );
if ( is_array( $results ) ) foreach ( $results as $row )
{
$dir = '/upload/article_images/article_' . $id;
$new_file_name = str_replace( '/upload/article_images/tmp', $dir, $row['src'] );
if ( file_exists( '../' . $new_file_name ) )
{
$ext = strrpos( $new_file_name, '.' );
$fileName_a = substr( $new_file_name, 0, $ext );
$fileName_b = substr( $new_file_name, $ext );
$count = 1;
while ( file_exists( '../' . $fileName_a . '_' . $count . $fileName_b ) )
$count++;
$new_file_name = $fileName_a . '_' . $count . $fileName_b;
}
if ( file_exists( '..' . $row['src'] ) )
{
if ( !is_dir( '../' . $dir ) and $created !== true )
{
if ( mkdir( '../' . $dir, 0755, true ) )
$created = true;
}
rename( '..' . $row['src'], '..' . $new_file_name );
}
$mdb -> update( 'pp_articles_images', [ 'src' => $new_file_name, 'article_id' => (int)$id ], [ 'id' => $row['id'] ] );
}
/* tagi */
$tags = explode( ',', $tags );
if ( is_array( $tags ) ) foreach ( $tags as $tag )
{
if ( trim( $tag ) != '' )
{
$tag_id = $mdb -> get( 'pp_tags', 'id', [ 'name' => $tag ] );
if ( !$tag_id )
{
$mdb -> insert( 'pp_tags', [ 'name' => $tag ] );
$tag_id = $mdb -> id();
}
$mdb -> insert( 'pp_articles_tags', [ 'article_id' => (int)$id, 'tag_id' => (int)$tag_id ] );
}
}
\S::htacces();
\S::delete_cache();
return $id;
}
}
else
{
$mdb -> update( 'pp_articles', [
'show_title' => $show_title == 'on' ? 1 : 0,
'show_date_add' => $show_date_add == 'on' ? 1 : 0,
'show_date_modify' => $show_date_modify == 'on' ? 1 : 0,
'date_modify' => date( 'Y-m-d H:i:s' ),
'modify_by' => $user['id'],
'layout_id' => $layout_id ? (int)$layout_id : null,
'status' => $status == 'on' ? 1 : 0,
'repeat_entry' => $repeat_entry == 'on' ? 1 : 0,
'social_icons' => $social_icons == 'on' ? 1 : 0,
'date_start' => $event_date[0] ? $event_date[0] : null,
'date_end' => $event_date[1] ? $event_date[1] : null,
'priority' => $priority == 'on' ? 1 : 0,
'password' => $password ? $password : null,
'pixieset' => $pixieset
], [
'id' => (int)$article_id
] );
if ( $date_add )
$mdb -> update( 'pp_articles', [ 'date_add' => $date_add ], [ 'id' => (int)$article_id ] );
$i = 0;
/* tłumaczenia */
$mdb -> delete( 'pp_articles_langs', [ 'article_id' => (int)$article_id ] );
$results = $mdb -> select( 'pp_langs', [ 'id' ], [ 'status' => 1, 'ORDER' => [ 'o' => 'ASC' ] ] );
if ( is_array( $results ) and count( $results ) > 1 ) foreach ( $results as $row )
{
$mdb -> insert( 'pp_articles_langs', [
'article_id' => (int)$article_id,
'lang_id' => $row['id'],
'title' => $title[ $i ] != '' ? $title[ $i ] : null,
'entry' => $entry[ $i ] != '' ? $entry[ $i ] : null,
'text' => $text[ $i ] != '' ? $text[ $i ] : null,
'meta_title' => $meta_title[ $i ] != '' ? $meta_title[ $i ] : null,
'meta_description' => $meta_description[ $i ] != '' ? $meta_description[ $i ] : null,
'meta_keywords' => $meta_keywords[ $i ] != '' ? $meta_keywords[ $i ] : null,
'seo_link' => \S::seo( $seo_link[ $i ] ) != '' ? \S::seo( $seo_link[ $i ] ) : null,
'noindex' => $noindex[ $i ],
'copy_from' => $copy_from[ $i ] != '' ? $copy_from[ $i ] : null,
'block_direct_access' => $block_direct_access[ $i ]
] );
$i++;
}
else if ( is_array( $results ) and count( $results ) == 1 ) foreach ( $results as $row )
{
$mdb -> insert( 'pp_articles_langs', [
'article_id' => (int)$article_id,
'lang_id' => $row['id'],
'title' => $title != '' ? $title : null,
'entry' => $entry != '' ? $entry : null,
'text' => $text != '' ? $text : null,
'meta_title' => $meta_title != '' ? $meta_title : null,
'meta_description' => $meta_description != '' ? $meta_description : null,
'meta_keywords' => $meta_keywords != '' ? $meta_keywords : null,
'seo_link' => \S::seo( $seo_link ) != '' ? \S::seo( $seo_link ) : null,
'noindex' => $noindex,
'copy_from' => $copy_from != '' ? $copy_from : null,
'block_direct_access' => $block_direct_access
] );
}
/* dodatkowe parametry */
$mdb -> delete( 'pp_articles_additional_values', [ 'article_id' => (int)$article_id ] );
/* parametry bez wersji językowych */
$results = $mdb -> select( 'pp_articles_additional_params', '*', [ 'AND' => [ 'status' => 1, 'language' => 0 ] ] );
if ( is_array( $results ) and !empty( $results ) ) foreach ( $results as $row )
{
$mdb -> insert( 'pp_articles_additional_values', [
'param_id' => $row['id'],
'value' => $params[ 'ap_' . $row['name'] ],
'article_id' => (int)$article_id,
'language_id' => null
] );
}
/* parametry z wersjami językowymi */
$results = $mdb -> select( 'pp_articles_additional_params', '*', [ 'AND' => [ 'status' => 1, 'language' => 1 ] ] );
if ( is_array( $results ) and !empty( $results ) ) foreach ( $results as $row )
{
$results2 = $mdb -> select( 'pp_langs', [ 'id' ], [ 'status' => 1, 'ORDER' => [ 'o' => 'ASC' ] ] );
if ( is_array( $results2 ) ) foreach ( $results2 as $row2 )
{
$mdb -> insert( 'pp_articles_additional_values', [
'param_id' => $row['id'],
'value' => $params[ 'ap_' . $row['name'] . '_' . $row2['id'] ],
'article_id' => (int)$article_id,
'language_id' => $row2['id']
] );
}
}
/* strony */
$not_in = [ 0 ];
if ( is_array( $pages ) ) foreach ( $pages as $page )
$not_in[] = $page;
else if ( $pages )
$not_in[] = $pages;
$mdb -> delete( 'pp_articles_pages', [ 'AND' => [ 'article_id' => (int)$article_id, 'page_id[!]' => $not_in ] ] );
$pages_tmp = $mdb -> select( 'pp_articles_pages', 'page_id', [ 'article_id' => (int)$article_id ] );
if ( !is_array( $pages ) )
$pages = [ $pages ];
$pages = array_diff( $pages, $pages_tmp );
if ( is_array( $pages ) ) foreach ( $pages as $page )
{
$order = self::max_order() + 1;
$mdb -> insert( 'pp_articles_pages', [
'article_id' => (int)$article_id,
'page_id' => (int)$page,
'o' => (int)$order
] );
}
/* pliki */
$results = $mdb -> select( 'pp_articles_files', '*', [ 'article_id' => null ] );
if ( is_array( $results ) ) foreach ( $results as $row )
{
$dir = '/upload/article_files/article_' . $article_id;
$new_file_name = str_replace( '/upload/article_files/tmp', $dir, $row['src'] );
if ( file_exists( '..' . $row['src'] ) )
{
if ( !is_dir( '../' . $dir ) and $created !== true )
{
if ( mkdir( '../' . $dir, 0755, true ) )
$created = true;
}
rename( '..' . $row['src'], '..' . $new_file_name );
}
$mdb -> update( 'pp_articles_files', [ 'src' => $new_file_name, 'article_id' => (int)$article_id ], [ 'id' => $row['id'] ] );
}
$created = false;
/* zdjęcia */
$results = $mdb -> select( 'pp_articles_images', '*', [ 'article_id' => null ] );
if ( is_array( $results ) ) foreach ( $results as $row )
{
$dir = '/upload/article_images/article_' . $article_id;
$new_file_name = str_replace( '/upload/article_images/tmp', $dir, $row['src'] );
if ( file_exists( '../' . $new_file_name ) )
{
$ext = strrpos( $new_file_name, '.' );
$fileName_a = substr( $new_file_name, 0, $ext );
$fileName_b = substr( $new_file_name, $ext );
$count = 1;
while ( file_exists( '../' . $fileName_a . '_' . $count . $fileName_b ) )
$count++;
$new_file_name = $fileName_a . '_' . $count . $fileName_b;
}
if ( file_exists( '..' . $row['src'] ) )
{
if ( !is_dir( '../' . $dir ) and $created !== true )
{
if ( mkdir( '../' . $dir, 0755, true ) )
$created = true;
}
rename( '..' . $row['src'], '..' . $new_file_name );
}
$mdb -> update( 'pp_articles_images', [ 'src' => $new_file_name, 'article_id' => (int)$article_id ], [ 'id' => $row['id'] ] );
}
$results = $mdb -> select( 'pp_articles_images', '*', [ 'AND' => [ 'article_id' => (int)$article_id, 'to_delete' => 1 ] ] );
if ( is_array( $results ) ) foreach ( $results as $row )
{
if ( file_exists( '../' . $row['src'] ) )
unlink( '../' . $row['src'] );
}
$mdb -> delete( 'pp_articles_images', [ 'AND' => [ 'article_id' => (int)$article_id, 'to_delete' => 1 ] ] );
$results = $mdb -> select( 'pp_articles_files', '*', [ 'AND' => [ 'article_id' => (int)$article_id, 'to_delete' => 1 ] ] );
if ( is_array( $results ) ) foreach ( $results as $row )
{
if ( file_exists( '../' . $row['src'] ) )
unlink( '../' . $row['src'] );
}
$mdb -> delete( 'pp_articles_files', [ 'AND' => [ 'article_id' => (int)$article_id, 'to_delete' => 1 ] ] );
/* tagi */
$mdb -> delete( 'pp_articles_tags', [ 'article_id' => (int)$article_id ] );
$tags = explode( ',', $tags );
if ( is_array( $tags ) ) foreach ( $tags as $tag )
{
if ( trim( $tag ) != '' )
{
$tag_id = $mdb -> get( 'pp_tags', 'id', [ 'name' => $tag ] );
if ( !$tag_id )
{
$mdb -> insert( 'pp_tags', [ 'name' => $tag ] );
$tag_id = $mdb -> id();
}
$mdb -> insert( 'pp_articles_tags', [ 'article_id' => (int)$article_id, 'tag_id' => (int)$tag_id ] );
}
}
\S::htacces();
\S::delete_cache();
return $article_id;
}
}
public static function delete_nonassigned_files()
{
global $mdb;
$results = $mdb -> select( 'pp_articles_files', '*', [ 'article_id' => null ] );
if ( is_array( $results ) ) foreach ( $results as $row )
{
if ( file_exists( '../' . $row['src'] ) )
unlink( '../' . $row['src'] );
}
$mdb -> delete( 'pp_articles_files', [ 'article_id' => null ] );
}
public static function delete_nonassigned_images()
{
global $mdb;
$results = $mdb -> select( 'pp_articles_images', '*', [ 'article_id' => null ] );
if ( is_array( $results ) ) foreach ( $results as $row )
{
if ( file_exists( '../' . $row['src'] ) )
unlink( '../' . $row['src'] );
}
$mdb -> delete( 'pp_articles_images', [ 'article_id' => null ] );
}
}
?>

View File

@@ -0,0 +1,29 @@
<?php
namespace admin\factory;
class ArticlesArchive
{
public static function article_restore( $article_id )
{
global $mdb;
return $mdb -> update( 'pp_articles', [ 'status' => 0 ], [ 'id' => (int)$article_id ] );
}
public static function article_delete( $article_id )
{
global $mdb;
$mdb -> delete( 'pp_articles_pages', [ 'article_id' => (int)$article_id ] );
$mdb -> delete( 'pp_articles_langs', [ 'article_id' => (int)$article_id ] );
$mdb -> delete( 'pp_articles_images', [ 'article_id' => (int)$article_id ] );
$mdb -> delete( 'pp_articles_files', [ 'article_id' => (int)$article_id ] );
$mdb -> delete( 'pp_articles_tags', [ 'article_id' => (int)$article_id ] );
$mdb -> delete( 'pp_articles', [ 'id' => (int)$article_id ] );
\S::delete_dir( '../upload/article_images/article_' . (int)$article_id . '/' );
\S::delete_dir( '../upload/article_files/article_' . (int)$article_id . '/' );
return true;
}
}

View File

@@ -0,0 +1,77 @@
<?php
namespace admin\factory;
class Backups
{
public static function backups_list()
{
if ( $handle = opendir( '../backups' ) )
{
while ( false !== ( $file = readdir( $handle ) ) )
{
if ( $file != "." && $file != ".." )
{
$row['name'] = $file;
$dir[] = $row;
}
}
closedir( $handle );
}
return $dir;
}
public static function backup_save()
{
global $mdb, $database;
$dbhost = $database['host'];
$dbuser = $database['user'];
$dbpsw = $database['password'];
$dbname = $database['name'];
$connection = mysqli_connect( $dbhost, $dbuser, $dbpsw, $dbname );
mysqli_set_charset( $connection, 'utf8' );
if ( !file_exists( '../backups' ) )
mkdir( "../backups", 0755 );
$backupfile = date( "Y_m_d_H_i_s" );
include('../libraries/MySQLDump.php');
$dump = new \MySQLDump( $connection );
$dump -> save( '../backups/' . $backupfile . '.sql' );
$zipTo = '../backups/' . $backupfile . '.zip';
$zip = new \ZipArchive();
$zip -> open( $zipTo, \ZipArchive::CREATE );
$folder = '../';
$iter = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator( $folder, \RecursiveDirectoryIterator::SKIP_DOTS ),
\RecursiveIteratorIterator::SELF_FIRST,
\RecursiveIteratorIterator::CATCH_GET_CHILD
);
foreach ( $iter as $file )
{
if ( !strstr( $file, '../backups' ) and !strstr( $file, ' ../temp' ) and !strstr( $file, '../updates' ) )
{
if ( is_dir( $file ) )
{
$zip -> addEmptyDir( str_replace( $folder, '', $file . '/' ) );
}
else if ( is_file( $file ) )
{
$zip -> addFromString( str_replace( $folder, '', $file ),
file_get_contents( $file ) );
}
}
}
$zip -> close();
return true;
}
public static function backup_delete( $file )
{
if ( file_exists( '../backups/' . $file ) )
unlink( '../backups/' . $file );
return true;
}
}

View File

@@ -0,0 +1,129 @@
<?php
namespace admin\factory;
class Banners
{
public static function banner_delete( $banner_id )
{
global $mdb;
$result = $mdb -> delete( 'pp_banners', [ 'id' => (int) $banner_id ] );
\S::delete_cache();
return $result;
}
public static function banner_save( $banner_id, $name, $status, $date_start, $date_end, $home_page, $src, $url, $html, $text )
{
global $mdb;
if ( !$banner_id )
{
$mdb -> insert( 'pp_banners', [
'name' => $name,
'status' => $status == 'on' ? 1 : 0,
'date_start' => $date_start != '' ? $date_start : null,
'date_end' => $date_end != '' ? $date_end : null,
'home_page' => $home_page == 'on' ? 1 : 0
] );
$id = $mdb -> id();
if ( $id )
{
$i = 0;
$results = $mdb -> select( 'pp_langs', [ 'id' ], [ 'status' => 1, 'ORDER' => [ 'o' => 'ASC' ] ] );
if ( is_array( $results ) and count( $results ) > 1 ) foreach ( $results as $row )
{
$mdb -> insert( 'pp_banners_langs', [
'id_banner' => (int)$id,
'id_lang' => $row['id'],
'src' => $src[ $i ],
'url' => $url[ $i ],
'html' => $html[ $i ],
'text' => $text[ $i ]
] );
$i++;
}
else if ( is_array( $results ) and count( $results ) == 1 ) foreach ( $results as $row )
{
$mdb -> insert( 'pp_banners_langs', [
'id_banner' => (int)$id,
'id_lang' => $row['id'],
'src' => $src,
'url' => $url,
'html' => $html,
'text' => $text
] );
}
\S::delete_cache();
return $id;
}
}
else
{
$mdb -> update( 'pp_banners',
[
'name' => $name,
'status' => $status == 'on' ? 1 : 0,
'date_start' => $date_start != '' ? $date_start : null,
'date_end' => $date_end != '' ? $date_end : null,
'home_page' => $home_page == 'on' ? 1 : 0
], [
'id' => (int) $banner_id
] );
$mdb -> delete( 'pp_banners_langs', [ 'id_banner' => (int)$banner_id ] );
$i = 0;
$results = $mdb -> select( 'pp_langs', [ 'id' ], [ 'status' => 1, 'ORDER' => [ 'o' => 'ASC' ] ] );
if ( is_array( $results ) and count( $results ) > 1 ) foreach ( $results as $row )
{
$mdb -> insert( 'pp_banners_langs', [
'id_banner' => (int)$banner_id,
'id_lang' => $row['id'],
'src' => $src[ $i ],
'url' => $url[ $i ],
'html' => $html[ $i ],
'text' => $text[ $i ]
] );
$i++;
}
else if ( is_array( $results ) and count( $results ) == 1 ) foreach ( $results as $row )
{
$mdb -> insert( 'pp_banners_langs', [
'id_banner' => (int)$banner_id,
'id_lang' => $row['id'],
'src' => $src,
'url' => $url,
'html' => $html,
'text' => $text
] );
}
\S::delete_cache();
return $banner_id;
}
return false;
}
public static function banner_details( $id_banner )
{
global $mdb;
$banner = $mdb -> get( 'pp_banners', '*', [ 'id' => (int)$id_banner ] );
$results = $mdb -> select( 'pp_banners_langs', '*', [ 'id_banner' => (int)$id_banner ] );
if ( is_array( $results ) ) foreach ( $results as $row )
$banner['languages'][$row['id_lang']] = $row;
return $banner;
}
}
?>

View File

@@ -0,0 +1,11 @@
<?php
namespace admin\factory;
class Emails
{
public static function email_details( $email_id )
{
global $mdb;
return $mdb -> get( 'pp_contact_emails', '*', [ 'id' => (int)$email_id ] );
}
}

View File

@@ -0,0 +1,181 @@
<?
namespace admin\factory;
class Languages
{
public static function available_domains()
{
global $mdb;
return $mdb -> query( 'SELECT domain FROM pp_langs WHERE status = 1 AND domain IS NOT NULL GROUP BY domain' ) -> fetchAll( \PDO::FETCH_ASSOC );
}
public static function default_domain()
{
global $mdb;
$results = $mdb -> query( 'SELECT domain FROM pp_langs WHERE status = 1 AND domain IS NOT NULL AND main_domain = 1' ) -> fetchAll();
return $default_domain = $results[0][0];
}
public static function translation_delete( $translation_id )
{
global $mdb;
return $mdb -> delete( 'pp_langs_translations', [ 'id' => $translation_id ] );
}
public static function translation_save( $translation_id, $text, $languages )
{
global $mdb;
if ( $translation_id )
{
$mdb -> update( 'pp_langs_translations', [ 'text' => $text ], [ 'id' => $translation_id ] );
if ( is_array( $languages ) and !empty( $languages ) ): foreach ( $languages as $key => $val ):
$mdb -> update( 'pp_langs_translations', [ $key => $val ], [ 'id' => $translation_id ] );
endforeach; endif;
\S::htacces();
\S::delete_cache();
return $translation_id;
}
else
{
$mdb -> insert( 'pp_langs_translations', [ 'text' => $text ] );
if ( $translation_id = $mdb -> id() )
{
if ( is_array( $languages ) and !empty( $languages ) ): foreach ( $languages as $key => $val ):
$mdb -> update( 'pp_langs_translations', [ $key => $val ], [ 'id' => $translation_id ] );
endforeach; endif;
}
\S::htacces();
\S::delete_cache();
return $translation_id;
}
}
public static function translation_details( $translation_id )
{
global $mdb;
return $mdb -> get( 'pp_langs_translations', '*', [ 'id' => $translation_id ] );
}
public static function language_delete( $language_id )
{
global $mdb;
if ( $mdb -> count( 'pp_langs' ) > 1 )
{
if ( $mdb -> query( 'ALTER TABLE pp_langs_translations DROP ' . $language_id )
and
$mdb -> delete( 'pp_langs', [ 'id' => $language_id ] )
)
return true;
}
return false;
}
public static function max_order()
{
global $mdb;
return $mdb -> max( 'pp_langs', 'o' );
}
public static function language_save( $language_id, $name, $status, $start, $o, $domain, $main_domain )
{
global $mdb;
if ( $start == 'on' and $status == 'on' and !\S::get_domain( $domain ) )
$mdb -> update( 'pp_langs', [
'start' => 0
], [
'id[!]' => $language_id
] );
if ( $start == 'on' and $status == 'on' and \S::get_domain( $domain ) )
$mdb -> update( 'pp_langs', [
'start' => 0
], [
'AND' => [ 'id[!]' => $language_id, 'domain' => \S::get_domain( $domain ) ]
] );
if ( $main_domain == 'on' and $domain and $status == 'on' )
$mdb -> update( 'pp_langs', [
'main_domain' => 0
], [
' id[!]' => $language_id
] );
if ( $mdb -> count( 'pp_langs', [ 'id' => $language_id ] ) )
{
$mdb -> update( 'pp_langs', [
'status' => $status == 'on' ? 1 : 0,
'start' => $start == 'on' ? 1 : 0,
'name' => $name,
'o' => $o,
'domain' => \S::get_domain( $domain ) ? \S::get_domain( $domain ) : null,
'main_domain' => $main_domain == 'on' and \S::get_domain( $domain ) ? 1 : 0,
], [
'id' => $language_id
] );
}
else
{
if ( $mdb -> query( 'ALTER TABLE pp_langs_translations ADD ' . strtolower( $language_id ) . ' TEXT NULL DEFAULT NULL' ) )
{
$mdb -> insert( 'pp_langs', [
'id' => strtolower( $language_id ),
'name' => $name,
'status' => $status == 'on' ? 1 : 0,
'start' => $start == 'on' ? 1 : 0,
'o' => $o,
'domain' => \S::get_domain( $domain ) ? \S::get_domain( $domain ) : null,
'main_domain' => $main_domain == 'on' && \S::get_domain( $domain ) ? 1 : 0,
] );
}
}
if ( !$mdb -> count( 'pp_langs', [ 'AND' => [ 'status' => 1, 'domain[!]' => null ] ] ) )
{
if ( !$mdb -> count( 'pp_langs', [ 'AND' => [ 'status' => 1, 'start' => 1, 'domain' => null ] ] ) )
{
if ( $id_tmp = $mdb -> get( 'pp_langs', 'id', [ 'status' => 1, 'ORDER' => [ 'o' => 'ASC' ] ] ) )
$mdb -> update( 'pp_langs', [ 'start' => 1 ], [ 'id' => $id_tmp ] );
}
}
$domains = $mdb -> select( 'pp_langs', 'domain', [ 'domain[!]' => null, 'GROUP' => 'domain'] );
if ( is_array( $domains ) and !empty( $domains ) )
{
$mdb -> update( 'pp_langs', [ 'start' => 0 ], [ 'domain' => null ] );
foreach ( $domains as $domain )
{
if ( !$mdb -> count( 'pp_langs', [ 'AND' => [ 'status' => 1, 'start' => 1, 'domain' => $domain ] ] ) )
{
if ( $id_tmp = $mdb -> get( 'pp_langs', 'id', [ 'AND' => [ 'status' => 1, 'domain' => $domain ], 'ORDER' => [ 'o' => 'ASC' ] ] ) )
$mdb -> update( 'pp_langs', [ 'start' => 1 ], [ 'id' => $id_tmp ] );
}
}
}
if ( !$mdb -> count( 'pp_langs', [ 'AND' => [ 'status' => 1, 'main_domain' => 1 ] ] ) )
{
if ( $id_tmp = $mdb -> get( 'pp_langs', 'id', [ 'AND' => [ 'status' => 1, 'domain[!]' => null ], 'ORDER' => [ 'o' => 'ASC' ] ] ) )
$mdb -> update( 'pp_langs', [ 'main_domain' => 1 ], [ 'id' => $id_tmp ] );
}
\S::htacces();
\S::delete_cache();
return $language_id;
}
public static function language_details( $language_id )
{
global $mdb;
return $mdb -> get( 'pp_langs', '*', [ 'id' => $language_id ] );
}
public static function languages_list()
{
global $mdb;
return $mdb -> select( 'pp_langs', '*', [ 'ORDER' => [ 'o' => 'ASC' ] ] );
}
}
?>

View File

@@ -0,0 +1,141 @@
<?php
namespace admin\factory;
class Layouts
{
public static function layout_delete( $layout_id )
{
global $mdb;
if ( $mdb -> count( 'pp_layouts' ) > 1 )
return $mdb -> delete( 'pp_layouts', [ 'id' => (int)$layout_id ] );
return false;
}
public static function layout_details( $layout_id )
{
global $mdb;
$layout = $mdb -> get( 'pp_layouts', '*', [ 'id' => (int)$layout_id ] );
$layout['pages'] = $mdb -> select( 'pp_layouts_pages', 'page_id', [ 'layout_id' => (int)$layout_id ] );
return $layout;
}
public static function layout_save( $layout_id, $name, $status, $pages, $html, $css, $js, $m_html, $m_css, $m_js )
{
global $mdb;
if ( !$layout_id )
{
if ( $status == 'on' )
$mdb -> update( 'pp_layouts', [ 'status' => 0 ] );
$mdb -> insert( 'pp_layouts', [
'name' => $name,
'html' => $html,
'css' => $css,
'js' => $js,
'm_html' => $m_html,
'm_css' => $m_css,
'm_js' => $m_js,
'status' => $status == 'on' ? 1 : 0
] );
$id = $mdb -> id();
if ( $id )
{
if ( is_array( $pages ) ) foreach ( $pages as $page )
{
$mdb -> delete( 'pp_layouts_pages', [ 'page_id' => (int)$page ] );
$mdb -> insert( 'pp_layouts_pages', [
'layout_id' => (int)$id,
'page_id' => (int)$page
] );
}
else if ( $pages )
{
$mdb -> delete( 'pp_layouts_pages', [ 'page_id' => (int)$pages ] );
$mdb -> insert( 'pp_layouts_pages', [
'layout_id' => (int)$id,
'page_id' => (int)$pages
] );
}
\S::delete_cache();
return $id;
}
}
else
{
if ( $status == 'on' )
$mdb -> update( 'pp_layouts', [ 'status' => 0 ] );
$mdb -> update( 'pp_layouts', [
'name' => $name,
'html' => $html,
'css' => $css,
'js' => $js,
'm_html' => $m_html,
'm_css' => $m_css,
'm_js' => $m_js,
'status' => $status == 'on' ? 1 : 0
], [
'id' => $layout_id
] );
$mdb -> delete( 'pp_layouts_pages', [ 'layout_id' => (int)$layout_id ] );
if ( is_array( $pages ) ) foreach ( $pages as $page )
{
$mdb -> delete( 'pp_layouts_pages', [ 'page_id' => (int)$page ] );
$mdb -> insert( 'pp_layouts_pages', [
'layout_id' => (int)$layout_id,
'page_id' => (int)$page
] );
}
else if ( $pages )
{
$mdb -> delete( 'pp_layouts_pages', [ 'page_id' => (int)$pages ] );
$mdb -> insert( 'pp_layouts_pages', [
'layout_id' => (int)$layout_id,
'page_id' => (int)$pages
] );
}
\S::delete_cache();
return $layout_id;
}
return false;
}
public static function menus_list()
{
global $mdb;
$results = $mdb -> select( 'pp_menus', 'id', [ 'ORDER' => [ 'name' => 'ASC' ] ] );
if ( is_array( $results ) ) foreach ( $results as $row )
{
$menu = \admin\factory\Pages::menu_details( $row );
$menu['pages'] = \admin\factory\Pages::menu_pages( $row );
$menus[] = $menu;
}
return $menus;
}
public static function layouts_list()
{
global $mdb;
return $mdb -> select( 'pp_layouts', '*', [ 'ORDER' => [ 'name' => 'ASC' ] ] );
}
}
?>

View File

@@ -0,0 +1,105 @@
<?php
namespace admin\factory;
class Newsletter
{
public static function emails_import( $emails )
{
global $mdb;
$emails = explode( PHP_EOL, $emails );
if ( is_array( $emails ) ) foreach ( $emails as $email )
{
if ( trim( $email ) and !$mdb -> count( 'pp_newsletter', [ 'email' => trim( $email ) ] ) )
$mdb -> insert( 'pp_newsletter', [
'email' => trim( $email ),
'hash' => md5( $email . time() ),
'status' => 1
] );
}
return true;
}
public static function is_admin_template( $template_id )
{
global $mdb;
return $mdb -> get( 'pp_newsletter_templates', 'is_admin', [ 'id' => (int)$template_id ] );
}
public static function newsletter_template_delete( $template_id )
{
global $mdb;
return $mdb -> delete( 'pp_newsletter_templates', [ 'id' => (int)$template_id ] );
}
public static function send( $dates, $template, $only_once )
{
global $mdb;
$results = $mdb -> select( 'pp_newsletter', 'email', [ 'status' => 1 ] );
if ( is_array( $results ) and !empty( $results ) ) foreach ( $results as $row )
{
if ( $template and $only_once )
{
if ( !$mdb -> count( 'pp_newsletter_send', [ 'AND' => [ 'id_template' => $template, 'email' => $row ] ] ) )
$mdb -> insert( 'pp_newsletter_send', [
'email' => $row,
'dates' => $dates,
'id_template' => $template ? $template : null,
'only_once' => ( $only_once == 'on' and $template ) ? 1 : 0
] );
}
else
$mdb -> insert( 'pp_newsletter_send', [
'email' => $row,
'dates' => $dates,
'id_template' => $template ? $template : null,
'only_once' => ( $only_once == 'on' and $template ) ? 1 : 0
] );
}
return true;
}
public static function email_template_detalis ($id_template)
{
global $mdb;
$result = $mdb -> get ('pp_newsletter_templates', '*', [ 'id' => (int)$id_template ] );
return $result;
}
public static function template_save($id, $name, $text)
{
global $mdb;
if ( !$id )
{
if ( $mdb -> insert( 'pp_newsletter_templates', [
'name' => $name,
'text' => $text
] ) )
{
\S::delete_cache();
return $mdb -> id();
}
}
else
{
$mdb -> update( 'pp_newsletter_templates', [
'name' => $name,
'text' => $text
], [
'id' => (int)$id
] );
\S::delete_cache();
return $id;
}
}
public static function templates_list()
{
global $mdb;
return $mdb -> select( 'pp_newsletter_templates', '*', [ 'is_admin' => 0, 'ORDER' => [ 'name' => 'ASC' ] ] );
}
}

View File

@@ -0,0 +1,514 @@
<?
namespace admin\factory;
class Pages
{
public static $_page_types = [ 0 => 'pełne artykuły', 1 => 'wprowadzenia', 2 => 'miniaturki', 3 => 'link', 4 => 'kontakt' ];
public static $_sort_types = [
0 => 'data dodania - najstarsze na początku',
1 => 'data dodania - najnowsze na początku',
2 => 'data modyfikacji - rosnąco',
3 => 'data mofyfikacji - malejąco',
4 => 'ręczne',
5 => 'alfabetycznie - A - Z',
6 => 'alfabetycznie - Z - A'
];
public static function save_articles_order( $page_id, $articles )
{
global $mdb;
if ( is_array( $articles ) )
{
$mdb -> update( 'pp_articles_pages', [ 'o' => 0 ],
[ 'page_id' => (int) $page_id ] );
for ( $i = 0; $i < count( $articles ); $i++ )
{
if ( $articles[$i]['item_id'] )
{
$x++;
$mdb -> update( 'pp_articles_pages', [ 'o' => $x ],
[ 'AND' => [ 'page_id' => (int) $page_id, 'article_id' => $articles[$i]['item_id'] ] ] );
}
}
}
return true;
}
public static function page_articles( $page_id )
{
global $mdb;
$results = $mdb -> query( 'SELECT '
. 'article_id, o, status '
. 'FROM '
. 'pp_articles_pages AS ap '
. 'INNER JOIN pp_articles AS a ON a.id = ap.article_id '
. 'WHERE '
. 'page_id = ' . (int) $page_id . ' AND status != -1 '
. 'ORDER BY '
. 'o ASC' ) -> fetchAll();
if ( is_array( $results ) )
foreach ( $results as $row )
{
$row['title'] = \admin\factory\Articles::article_title( $row['article_id'] );
$articles[] = $row;
}
return $articles;
}
public static function menus_list()
{
global $mdb;
return $mdb -> select( 'pp_menus', '*', [ 'ORDER' => [ 'name' => 'ASC' ] ] );
}
public static function save_pages_order( $menu_id, $pages )
{
global $mdb;
if ( is_array( $pages ) )
{
$mdb -> update( 'pp_pages', [ 'o' => 0 ], [ 'menu_id' => (int) $menu_id ] );
for ( $i = 0; $i < count( $pages ); $i++ )
{
if ( $pages[$i]['item_id'] )
{
$pages[$i]['parent_id'] ? $parent_id = $pages[$i]['parent_id'] : $parent_id = 0;
if ( $pages[$i]['item_id'] && $pages[$i]['depth'] > 1 )
{
if ( $pages[$i]['depth'] == 2 )
$parent_id = null;
$x++;
$mdb -> update( 'pp_pages', [ 'o' => $x, 'parent_id' => $parent_id ],
[ 'id' => (int) $pages[$i]['item_id'] ] );
}
}
}
}
\S::delete_cache();
return true;
}
public static function page_delete( $page_id )
{
global $mdb;
if ( $mdb -> count( 'pp_pages', [ 'parent_id' => (int) $page_id ] ) )
return false;
if ( $mdb -> delete( 'pp_pages', [ 'id' => (int) $page_id ] ) )
{
\S::delete_cache();
\S::htacces();
return true;
}
return false;
}
public static function max_order()
{
global $mdb;
return $mdb -> max( 'pp_pages', 'o' );
}
public static function page_save(
$page_id, $title, $seo_link, $meta_title, $meta_description, $meta_keywords, $menu_id, $parent_id, $page_type, $sort_type, $layout_id, $articles_limit, $show_title, $status, $link, $noindex, $start,
$site_title, $block_direct_access, $cache, $canonical
)
{
global $mdb;
if ( !$parent_id )
$parent_id = null;
if ( !$page_id )
{
$order = self::max_order() + 1;
$mdb -> insert( 'pp_pages',
[
'menu_id' => (int) $menu_id,
'page_type' => $page_type,
'sort_type' => $sort_type,
'articles_limit' => $articles_limit,
'show_title' => $show_title == 'on' ? 1 : 0,
'status' => $status == 'on' ? 1 : 0,
'o' => (int) $order,
'parent_id' => $parent_id,
'start' => $start == 'on' ? 1 : 0,
'cache' => $cache == 'on' ? 1 : 0
] );
$id = $mdb -> id();
if ( $id )
{
if ( $start )
$mdb -> update( 'pp_pages', [ 'start' => 0 ], [ 'id[!]' => (int) $id ] );
if ( $layout_id )
$mdb -> insert( 'pp_layouts_pages',
[ 'page_id' => (int) $id, 'layout_id' => (int) $layout_id ] );
$i = 0;
$results = $mdb -> select( 'pp_langs', [ 'id' ],
[ 'status' => 1, 'ORDER' => [ 'o' => 'ASC' ] ] );
if ( is_array( $results ) and count( $results ) > 1 )
foreach ( $results as $row )
{
$mdb -> insert( 'pp_pages_langs',
[
'page_id' => (int) $id,
'lang_id' => $row['id'],
'title' => $title[$i] != '' ? $title[$i] : null,
'meta_description' => $meta_description[$i] != '' ? $meta_description[$i] : null,
'meta_keywords' => $meta_keywords[$i] != '' ? $meta_keywords[$i] : null,
'meta_title' => $meta_title[$i] != '' ? $meta_title[$i] : null,
'seo_link' => \S::seo( $seo_link[$i] ) != '' ? \S::seo( $seo_link[$i] ) : null,
'noindex' => $noindex[$i],
'site_title' => $site_title[$i] != '' ? $site_title[$i] : null,
'link' => $link[$i] != '' ? $link[$i] : null,
'block_direct_access' => $block_direct_access[$i],
'canonical' => $canonical[$i] != '' ? $canonical[$i] : null
] );
$i++;
}
else if ( is_array( $results ) and count( $results ) == 1 )
foreach ( $results as $row )
{
$mdb -> insert( 'pp_pages_langs',
[
'page_id' => (int) $id,
'lang_id' => $row['id'],
'title' => $title != '' ? $title : null,
'meta_description' => $meta_description != '' ? $meta_description : null,
'meta_keywords' => $meta_keywords != '' ? $meta_keywords : null,
'meta_title' => $meta_title != '' ? $meta_title : null,
'seo_link' => \S::seo( $seo_link ) != '' ? \S::seo( $seo_link ) : null,
'noindex' => $noindex,
'site_title' => $site_title != '' ? $site_title : null,
'link' => $link != '' ? $link : null,
'block_direct_access' => $block_direct_access,
'canonical' => $canonical != '' ? $canonical : null
] );
}
\S::htacces();
\S::delete_cache();
return $id;
}
}
else
{
$mdb -> update( 'pp_pages',
[
'menu_id' => (int) $menu_id,
'page_type' => $page_type,
'sort_type' => $sort_type,
'articles_limit' => $articles_limit,
'show_title' => $show_title == 'on' ? 1 : 0,
'status' => $status == 'on' ? 1 : 0,
'parent_id' => $parent_id,
'start' => $start == 'on' ? 1 : 0,
'cache' => $cache == 'on' ? 1 : 0
], [
'id' => (int) $page_id
] );
if ( $layout_id )
{
$mdb -> delete( 'pp_layouts_pages', [ 'page_id' => (int) $page_id ] );
$mdb -> insert( 'pp_layouts_pages',
[ 'layout_id' => (int) $layout_id, 'page_id' => (int) $page_id ] );
}
if ( $start )
$mdb -> update( 'pp_pages', [ 'start' => 0 ],
[ 'id[!]' => (int) $page_id ] );
$i = 0;
$mdb -> delete( 'pp_pages_langs', [ 'page_id' => (int) $page_id ] );
$results = $mdb -> select( 'pp_langs', [ 'id' ],
[ 'status' => 1, 'ORDER' => [ 'o' => 'ASC' ] ] );
if ( is_array( $results ) and count( $results ) > 1 )
foreach ( $results as $row )
{
$mdb -> insert( 'pp_pages_langs',
[
'page_id' => (int) $page_id,
'lang_id' => $row['id'],
'title' => $title[$i] != '' ? $title[$i] : null,
'meta_description' => $meta_description[$i] != '' ? $meta_description[$i] : null,
'meta_keywords' => $meta_keywords[$i] != '' ? $meta_keywords[$i] : null,
'meta_title' => $meta_title[$i] != '' ? $meta_title[$i] : null,
'seo_link' => \S::seo( $seo_link[$i] ) != '' ? \S::seo( $seo_link[$i] ) : null,
'noindex' => $noindex[$i],
'site_title' => $site_title[$i] != '' ? $site_title[$i] : null,
'link' => $link[$i] != '' ? $link[$i] : null,
'block_direct_access' => $block_direct_access[$i],
'canonical' => $canonical[$i] != '' ? $canonical[$i] : null
] );
$i++;
}
else if ( is_array( $results ) and count( $results ) == 1 )
foreach ( $results as $row )
{
$mdb -> insert( 'pp_pages_langs',
[
'page_id' => (int) $page_id,
'lang_id' => $row['id'],
'title' => $title != '' ? $title : null,
'meta_description' => $meta_description != '' ? $meta_description : null,
'meta_keywords' => $meta_keywords != '' ? $meta_keywords : null,
'meta_title' => $meta_title != '' ? $meta_title : null,
'seo_link' => \S::seo( $seo_link ) != '' ? \S::seo( $seo_link ) : null,
'noindex' => $noindex,
'site_title' => $site_title != '' ? $site_title : null,
'link' => $link != '' ? $link : null,
'block_direct_access' => $block_direct_access,
'canonical' => $canonical != '' ? $canonical : null
] );
}
self::update_supages_menu_id( $page_id, $menu_id );
\S::htacces();
\S::delete_cache();
return $page_id;
}
return false;
}
public static function update_supages_menu_id( $parent_id, $menu_id )
{
global $mdb;
$mdb -> update( 'pp_pages', [ 'menu_id' => (int) $menu_id ],
[ 'parent_id' => $parent_id ] );
$results = $mdb -> select( 'pp_pages', [ 'id' ], [ 'parent_id' => $parent_id ] );
if ( is_array( $results ) )
foreach ( $results as $row )
self::update_supages_menu_id( $row['id'], $menu_id );
}
public static function generate_seo_link( $title, $page_id, $article_id,
$lang, $pid )
{
global $mdb;
$seo_link = \S::seo( $title );
while ( !$seo_link_check )
{
if ( $mdb -> count( 'pp_pages_langs',
[ 'AND' => [ 'seo_link' => $seo_link, 'page_id[!]' => (int) $page_id ] ] ) )
$seo_link = $seo_link . '-' . ( ++$i );
else
$seo_link_check = true;
}
$seo_link_check = false;
while ( !$seo_link_check )
{
if ( $mdb -> count( 'pp_articles_langs',
[ 'AND' => [ 'seo_link' => $seo_link, 'article_id[!]' => (int) $article_id ] ] ) )
$seo_link = $seo_link . '-' . ( ++$i );
else
$seo_link_check = true;
}
return $seo_link;
}
public static function google_url_preview( $page_id, $title, $lang, $pid, $id, $seo_link, $language_link = '' )
{
global $mdb;
$prefix = $language_link;
$status = true;
$id_page = $page_id;
do
{
if ( $page_id )
{
$parent = \admin\factory\Pages::page_details( $page_id );
$parent_id = $parent['parent_id'];
}
else
$parent_id = $pid;
if ( $parent_id )
{
$results = $mdb -> query( "SELECT title, seo_link, page_id FROM pp_pages_langs AS ppl, pp_langs AS pl WHERE lang_id = pl.id AND page_id = " . (int) $parent_id . " AND ppl.lang_id = '" . $lang . "' " ) -> fetchAll();
if ( $results[0]['seo_link'] )
$seo = $results[0]['seo_link'] . '/' . $seo;
else
$seo = 's-' . $results[0]['page_id'] . '-' . \S::seo( $results[0]['title'] ) . '/' . $seo;
$page_id = $results[0]['page_id'];
}
else
$status = false;
}
while ( $status );
if ( $id )
{
if ( !$seo_link )
$seo = $seo . 's-' . $id . '-' . \S::seo( $title );
else
$seo = $seo . $seo_link;
}
else
{
if ( !$seo_link )
$seo = $seo . 's-' . $id_page . '-' . \S::seo( $title );
else
$seo = $seo . $seo_link;
}
if ( $prefix )
$seo = $prefix . $seo;
return $seo;
}
public static function menu_delete( $menu_id )
{
global $mdb;
if ( $mdb -> count( 'pp_pages', [ 'menu_id' => (int) $menu_id ] ) )
return false;
return $mdb -> delete( 'pp_menus', [ 'id' => (int) $menu_id ] );
}
public static function menu_details( $menu_id )
{
global $mdb;
return $mdb -> get( 'pp_menus', '*', [ 'id' => (int) $menu_id ] );
}
public static function menu_save( $menu_id, $name, $status )
{
global $mdb;
$status == 'on' ? $status = 1 : $status = 0;
if ( !$menu_id )
{
return $mdb -> insert( 'pp_menus',
[
'name' => $name,
'status' => $status
] );
}
else
{
$mdb -> update( 'pp_menus',
[
'name' => $name,
'status' => $status
], [
'id' => (int) $menu_id
] );
return true;
}
return false;
}
public static function menu_lists()
{
global $mdb;
return $mdb -> select( 'pp_menus', '*', [ 'ORDER' => [ 'id' => 'ASC' ] ] );
}
public static function page_details( $page_id )
{
global $mdb;
$page = $mdb -> get( 'pp_pages', '*', [ 'id' => (int) $page_id ] );
$results = $mdb -> select( 'pp_pages_langs', '*',
[ 'page_id' => (int) $page_id ] );
if ( is_array( $results ) )
foreach ( $results as $row )
$page['languages'][$row['lang_id']] = $row;
$page['layout_id'] = $mdb -> get( 'pp_layouts_pages', 'layout_id',
[ 'page_id' => (int) $page_id ] );
return $page;
}
public static function page_url( $page_id )
{
global $mdb;
$results = $mdb -> query( "SELECT seo_link, title lang_id FROM pp_pages_langs AS ppl, pp_langs AS pl WHERE lang_id = pl.id AND page_id = " . (int) $page_id . " AND seo_link != '' ORDER BY o ASC LIMIT 1" ) -> fetchAll();
if ( !$results[0]['seo_link'] )
{
$title = self::page_title( $article_id );
return 's-' . $page_id . '-' . \S::seo( $title );
}
else
return $results[0]['seo_link'];
}
public static function page_title( $page_id )
{
global $mdb;
$result = $mdb -> select( 'pp_pages_langs',
[ '[><]pp_langs' => [ 'lang_id' => 'id' ] ], 'title',
[ 'AND' => [ 'page_id' => (int) $page_id, 'title[!]' => '' ], 'ORDER' => [ 'o' => 'ASC' ], 'LIMIT' => 1 ] );
return $result[0];
}
public static function page_languages( $page_id )
{
global $mdb;
return $mdb -> select( 'pp_pages_langs', '*',
[ 'AND' => [ 'page_id' => (int) $page_id, 'title[!]' => null ] ] );
}
public static function menu_pages( $menu_id, $parent_id = null )
{
global $mdb;
$results = $mdb -> select( 'pp_pages',
[ 'id', 'menu_id', 'status', 'parent_id', 'start' ],
[ 'AND' => [ 'menu_id' => $menu_id, 'parent_id' => $parent_id ], 'ORDER' => [ 'o' => 'ASC' ] ] );
if ( is_array( $results ) )
foreach ( $results as $row )
{
$row['title'] = self::page_title( $row['id'] );
$row['languages'] = self::page_languages( $row['id'] );
$row['subpages'] = self::menu_pages( $menu_id, $row['id'] );
$pages[] = $row;
}
return $pages;
}
}
?>

Some files were not shown because too many files have changed in this diff Show More