demo basic working as expected
This commit is contained in:
parent
b22c617b7f
commit
02a8bc9965
@ -2,7 +2,7 @@
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_page','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_start','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_blog','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_about','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_impressum','');
|
||||
|
||||
|
||||
|
||||
0
demo_basic/page/default_about/css/default_about.css
Normal file
0
demo_basic/page/default_about/css/default_about.css
Normal file
11
demo_basic/page/default_about/default_about.php
Normal file
11
demo_basic/page/default_about/default_about.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
class default_about extends SYSTEM\PAGE\Page {
|
||||
public static function js(){
|
||||
return array( \SYSTEM\WEBPATH(new PPAGE(),'default_about/js/default_about.js'));}
|
||||
public static function css(){
|
||||
return array( \SYSTEM\WEBPATH(new PPAGE(),'default_about/css/default_about.css'));}
|
||||
public function html(){
|
||||
$vars = \SYSTEM\PAGE\text::tag('example');
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_about/tpl/default_about.tpl'), $vars);
|
||||
}
|
||||
}
|
||||
2
demo_basic/page/default_about/js/default_about.js
Normal file
2
demo_basic/page/default_about/js/default_about.js
Normal file
@ -0,0 +1,2 @@
|
||||
function init_about(){
|
||||
}
|
||||
3
demo_basic/page/default_about/tpl/default_about.tpl
Normal file
3
demo_basic/page/default_about/tpl/default_about.tpl
Normal file
@ -0,0 +1,3 @@
|
||||
<div>
|
||||
${basic_example}
|
||||
</div>
|
||||
@ -1,16 +0,0 @@
|
||||
.menu_btn {
|
||||
margin-right: 20px;
|
||||
padding: 10px;
|
||||
max-width: 100px;
|
||||
text-decoration: none;
|
||||
color: white;
|
||||
border: #666666 1px solid;
|
||||
background: #666666;
|
||||
}
|
||||
|
||||
.menu_btn:hover{
|
||||
background: #cc3333;
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@ -1,70 +0,0 @@
|
||||
<?php
|
||||
class default_blog extends SYSTEM\PAGE\Page {
|
||||
private $tag = NULL;
|
||||
private $id = NULL;
|
||||
public function __construct($tag,$id) {
|
||||
$this->tag = $tag;
|
||||
$this->id = $id;
|
||||
}
|
||||
public static function js(){
|
||||
return array( \SYSTEM\WEBPATH(new PPAGE(),'default_blog/js/default_blog.js'));
|
||||
}
|
||||
public static function css(){
|
||||
return array( \SYSTEM\WEBPATH(new PPAGE(),'default_blog/css/default_blog.css'));}
|
||||
|
||||
private static function time_elapsed_string($ptime){
|
||||
$etime = time() - $ptime;
|
||||
if ($etime < 1){
|
||||
return '0 seconds';}
|
||||
|
||||
$a = array( 12 * 30 * 24 * 60 * 60 => 'Jahr(en)',
|
||||
30 * 24 * 60 * 60 => 'Monat(en)',
|
||||
24 * 60 * 60 => 'Tag(en)',
|
||||
60 * 60 => 'Stunde(n)',
|
||||
60 => 'Minute(n)',
|
||||
1 => 'Sekunden');
|
||||
|
||||
foreach ($a as $secs => $str){
|
||||
$d = $etime / $secs;
|
||||
if ($d >= 1){
|
||||
$r = round($d);
|
||||
return $r . ' ' . $str . ($r > 1 ? '' : '') . ' ';}
|
||||
}
|
||||
}
|
||||
|
||||
public static function get_content($default,$tag = null,$id = null){
|
||||
if($id){
|
||||
$text = \DBD\MRECHEL_GET_TEXT_ID::Q1(array($id));
|
||||
$text['published'] = date_format(new DateTime($text['time_edit']), 'd.m.Y H:i');
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_blog/tpl/article.tpl'), $text);
|
||||
} elseif($tag) {
|
||||
$result = '';
|
||||
$texts = \DBD\MRECHEL_GET_TEXT_TAG::QQ(array($tag));
|
||||
while($row = $texts->next()){
|
||||
$row['ago'] = self::time_elapsed_string(strtotime($row['time_edit']));
|
||||
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_blog/tpl/article_bulletin.tpl'), $row);}
|
||||
return $result;
|
||||
}
|
||||
//new \SYSTEM\LOG\WARNING('No Text found on id: '.$id.' tag: '.$tag);
|
||||
$text = \DBD\MRECHEL_GET_TEXT_ID::Q1(array($default));
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_blog/tpl/article.tpl'), $text);
|
||||
|
||||
}
|
||||
public static function get_menu($menu){
|
||||
$result = '';
|
||||
$texts = \DBD\MRECHEL_GET_TEXT_TAG::QQ(array($menu));
|
||||
while($row = $texts->next()){
|
||||
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_blog/tpl/menu.tpl'), $row);}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function html(){
|
||||
$vars = array();
|
||||
$vars['blog_menu'] = $this->get_menu('blog_menu');
|
||||
$vars['blog_content'] = self::get_content('mrechel_default_blog',$this->tag,$this->id);
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('mrechel'),
|
||||
\SYSTEM\PAGE\text::tag('webcraft'),
|
||||
\SYSTEM\PAGE\text::tag('blog'));
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_blog/tpl/default_blog.tpl'), $vars);
|
||||
}
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
function init_blog(){
|
||||
twttr.widgets.load();
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
<div style="border: #666666 solid 3px; padding: 10px; margin-top: 20px; margin-bottom: 10px;">
|
||||
<p style="float: right;">Eingestellt am ${published} Uhr</p>
|
||||
<h3>${id}</h3>
|
||||
<br>
|
||||
${text}
|
||||
|
||||
</div>
|
||||
<!--twitter-->
|
||||
<a href="https://twitter.com/share" class="twitter-share-button" data-via="MichaelaRechel">Tweet</a>
|
||||
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
|
||||
<!--facebook-->
|
||||
<div class="fb-share-button" data-href="http://mojotrollz.eu/web2/test/mrechel/#!blog;tag.dummy;id.${id}" data-layout="button_count"></div>
|
||||
|
||||
<a href="#!blog;tag.blog" style="float: right;">Zurück zum Blog</a>
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
<div style="border-bottom: #666666 1px solid; margin-top: 20px; max-height: 220px; overflow-x: hidden">
|
||||
<a href="#!blog;tag.dummy;id.${id}">
|
||||
<table style="width: 90%;">
|
||||
<tr>
|
||||
<td style="padding: 10px;">
|
||||
<a href="#!blog;tag.dummy;id.${id}"><p>${id}</p></a>
|
||||
</td>
|
||||
<td style="text-align: right;">
|
||||
<p>Eingestellt vor ${ago}</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=" padding: 10px;">
|
||||
${text}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
<div id="blog_main">
|
||||
Themen: ${blog_menu}
|
||||
<hr>
|
||||
${blog_content}
|
||||
</div>
|
||||
@ -1,3 +0,0 @@
|
||||
<a class="menu_btn" href="#!blog;tag.${text}">${text}</a>
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
class default_impressum extends \SYSTEM\PAGE\Page {
|
||||
public function html(){
|
||||
$vars = array();
|
||||
$vars['impressum'] = \SYSTEM\PAGE\text::get('impressum');
|
||||
$vars['impressum'] = \SYSTEM\PAGE\text::get('webcraft_imprint');
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_impressum/tpl/impressum.tpl'), $vars);
|
||||
}
|
||||
public static function js(){
|
||||
|
||||
@ -1,3 +1,2 @@
|
||||
function init_impressum(){
|
||||
$('#modal_text').modal('show');
|
||||
}
|
||||
@ -1,4 +1,6 @@
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#headbanner_frame {
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
$(document).ready(function() {
|
||||
new SYSTEM('./api.php',1,'start');
|
||||
$('#impressum').click(function(){
|
||||
$('#modal_text').modal('show');});
|
||||
});
|
||||
@ -2,24 +2,15 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="Herzlich Willkommen bei Michaela Rechel - Fachkunde und Verkaufstraining für Bäckereien. Lesen Sie hier über mein Programm oder durchstöbern Sie meinen Blog nach den neuesten Trends in der Backbranche.">
|
||||
<meta name="keywords" content="Bäckerei, Backen, Verkaufstraining, Seminare, Fortbilung, Hygiene">
|
||||
<meta name="author" content="Webcraft-Media.de">
|
||||
<meta name="fragment" content="!start">
|
||||
<title>michaela rechel</title>
|
||||
<meta name="description" content="${meta_description}">
|
||||
<meta name="keywords" content="${meta_keywords}">
|
||||
<meta name="author" content="${meta_author}">
|
||||
<title>${meta_title}</title>
|
||||
${css}
|
||||
${js}
|
||||
<link rel="shortcut icon" href="./api.php?call=files&cat=img&id=favicon.png" type="image/x-icon" />
|
||||
</head>
|
||||
<body style="background: #cccccc; padding-top: 10px;">
|
||||
<div id="fb-root"></div>
|
||||
<script>(function(d, s, id) {
|
||||
var js, fjs = d.getElementsByTagName(s)[0];
|
||||
if (d.getElementById(id)) return;
|
||||
js = d.createElement(s); js.id = id;
|
||||
js.src = "//connect.facebook.net/de_DE/sdk.js#xfbml=1&version=v2.3";
|
||||
fjs.parentNode.insertBefore(js, fjs);
|
||||
}(document, 'script', 'facebook-jssdk'));</script>
|
||||
<div class="modal fade" id="modal_text" style="" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
@ -30,43 +21,15 @@
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
<div id="headbanner_frame">
|
||||
<div id="headbanner" style="background: url(./api.php?call=files&cat=img&id=head.jpg)no-repeat; background-size: cover;">
|
||||
${mrechel_contact}
|
||||
</div>
|
||||
</div>
|
||||
<div id="menu">
|
||||
<div id="menu_content">
|
||||
<a href="#!start">${menu_start}</a>  -
|
||||
<a href="#!product_1">${menu_product_1}</a> -
|
||||
<a href="#!product_2">${menu_product_2}</a> -
|
||||
<a href="#!about">${menu_about}</a> -
|
||||
<a href="#!blog;tag.blog">${menu_blog}</a>
|
||||
<a href="#!start">${menu_start}</a>
|
||||
<a href="#!about">${menu_about}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="content"></div>
|
||||
<div style="position: fixed; right: 100px; bottom: 50px; padding: 30px; text-align: center;">
|
||||
<div class="fb-like" data-href="https://www.facebook.com/pages/Michaela-Rechel-Beratung-und-Seminare-f%C3%BCr-B%C3%A4ckereien/1495333794045545?fref=ts" data-layout="box_count" data-action="like" data-show-faces="true" data-share="false"></div>
|
||||
<br>
|
||||
<br>
|
||||
<div data-type="xing/share" data-counter="top" data-lang="de"></div>
|
||||
<script>
|
||||
;(function (d, s) {
|
||||
var x = d.createElement(s),
|
||||
s = d.getElementsByTagName(s)[0];
|
||||
x.src = "https://www.xing-share.com/plugins/share.js";
|
||||
s.parentNode.insertBefore(x, s);
|
||||
})(document, "script");
|
||||
</script>
|
||||
<br>
|
||||
<br>
|
||||
<div><a href="https://twitter.com/share" class="twitter-share-button" data-via="MichaelaRechel" data-size="large">Tweet</a></div>
|
||||
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
<a href="#!start(impressum)" id="impressum">Impressum</a>
|
||||
<a href="#!impressum" id="impressum">${menu_imprint}</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,21 +1,12 @@
|
||||
<?php
|
||||
class default_start extends SYSTEM\PAGE\Page {
|
||||
private $tag = NULL;
|
||||
private $id = NULL;
|
||||
public function __construct($tag,$id) {
|
||||
$this->tag = $tag;
|
||||
$this->id = $id;
|
||||
}
|
||||
public static function js(){
|
||||
return array( \SYSTEM\WEBPATH(new PPAGE(),'default_start/js/default_start.js'));
|
||||
}
|
||||
return array( \SYSTEM\WEBPATH(new PPAGE(),'default_start/js/default_start.js'));}
|
||||
public static function css(){
|
||||
return array( \SYSTEM\WEBPATH(new PPAGE(),'default_start/css/default_start.css'));}
|
||||
|
||||
|
||||
public function html(){
|
||||
$vars = array();
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('demo_basic'));
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_start/tpl/default_start.tpl'), $vars);
|
||||
}
|
||||
}
|
||||
$vars = array();
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('demo_basic'));
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_start/tpl/default_start.tpl'), $vars);
|
||||
}
|
||||
}
|
||||
@ -8,12 +8,12 @@ class page_demo_basic extends \SYSTEM\API\api_default {
|
||||
public static function default_page($_escaped_fragment_ = null){
|
||||
return (new default_page())->html($_escaped_fragment_);}
|
||||
|
||||
public static function page_start($tag = null, $id = null){
|
||||
return (new default_start($tag,$id))->html();}
|
||||
public static function page_start(){
|
||||
return (new default_start())->html();}
|
||||
|
||||
public static function page_blog($tag = null, $id = null){
|
||||
return (new default_blog($tag,$id))->html();}
|
||||
public static function page_about(){
|
||||
return (new default_about())->html();}
|
||||
|
||||
public static function page_impressum(){
|
||||
return (new default_impressum(''))->html();}
|
||||
return (new default_impressum())->html();}
|
||||
}
|
||||
@ -3,8 +3,8 @@ namespace SQL;
|
||||
class DATA_DEMO_BASIC extends \SYSTEM\DB\QI {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function files_mysql(){
|
||||
return array( \SYSTEM\SERVERPATH(new \PSQL(),'/mysql/system_page.sql')/*,
|
||||
\SYSTEM\SERVERPATH(new \PSQL(),'/mysql/system_api.sql'),
|
||||
return array( \SYSTEM\SERVERPATH(new \PSQL(),'/mysql/system_page.sql'),
|
||||
\SYSTEM\SERVERPATH(new \PSQL(),'/mysql/webcraft_imprint.sql')/*,
|
||||
\SYSTEM\SERVERPATH(new \PSQL(),'/mysql/system_text.sql'),
|
||||
\SYSTEM\SERVERPATH(new \PSQL(),'/mysql/system_cron.sql')*/);
|
||||
}
|
||||
|
||||
@ -1,14 +0,0 @@
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (200, 0, 2, 11, 'newserver', 'address', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (205, 0, 2, 11, 'vote', 'server', 'INT');
|
||||
|
||||
-- SAIMOD
|
||||
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5011, 42, 2, 5000, 'visible', 'visible', 'INT');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5010, 42, 2, 5000, 'visible', 'id', 'INT');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5008, 42, 2, 5000, 'del', 'id', 'INT');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5005, 42, 2, 5000, 'save', 'description', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5004, 42, 2, 5000, 'save', 'version', 'INT');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5003, 42, 2, 5000, 'save', 'url', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5002, 42, 2, 5000, 'save', 'name', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5001, 42, 2, 5000, 'save', 'id', 'INT');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5000, 42, 0, 0, '_SAI_saimod_mojotrollz_servers', 'action', NULL);
|
||||
@ -1 +0,0 @@
|
||||
INSERT INTO `system_cron` (`class`, `min`, `hour`, `day`, `day_week`, `month`, `last_run`, `status`) VALUES ('cron_calculate_votes', 0, 0, 1, 0, 0, NULL, 0);
|
||||
@ -1,2 +1,3 @@
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (10, 1, 'start', 'start', -1, 0, 0, '#content', './?page=start', 'init_start', 'default_start');
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (15, 1, 'impressum', 'impressum', -1, 0, 0, '#content', './?page=impressum', 'init_impressum', 'default_impressum');
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (15, 1, 'impressum', 'impressum', -1, 0, 0, '#content', './?page=impressum', 'init_impressum', 'default_impressum');
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (20, 1, 'about', 'about', -1, 0, 0, '#content', './?page=about', 'init_about', 'default_about');
|
||||
File diff suppressed because one or more lines are too long
3
demo_basic/sql/mysql/webcraft_imprint.sql
Normal file
3
demo_basic/sql/mysql/webcraft_imprint.sql
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user