Procházet zdrojové kódy

Initial Commit

pull-requests/1/merge
Marcel Völkel před 7 roky
revize
c76369b6c8
41 změnil soubory, kde provedl 1236 přidání a 0 odebrání
  1. 7
    0
      .gitignore
  2. 40
    0
      Application/Config/config.php.new
  3. 3
    0
      Application/Config/router.php
  4. 7
    0
      Application/Data/download.php
  5. 7
    0
      Application/Data/index.php
  6. 64
    0
      Application/scf/Additionals/Carousel.php
  7. 56
    0
      Application/scf/Additionals/Download.php
  8. 104
    0
      Application/scf/Core/DI.php
  9. 126
    0
      Application/scf/Core/Database.php
  10. 79
    0
      Application/scf/Core/System.php
  11. 47
    0
      Application/scf/Core/Templates.php
  12. 3
    0
      Application/templates/sternenkindsaga/errorpages/404.tpl
  13. 22
    0
      Application/templates/sternenkindsaga/footer.tpl
  14. 9
    0
      Application/templates/sternenkindsaga/header.tpl
  15. 20
    0
      Application/templates/sternenkindsaga/html/htmlHead.tpl
  16. 35
    0
      Application/templates/sternenkindsaga/index.tpl
  17. 26
    0
      Application/templates/sternenkindsaga/misc/carousel.tpl
  18. 9
    0
      Application/templates/sternenkindsaga/misc/facebook.tpl
  19. 12
    0
      Application/templates/sternenkindsaga/misc/mediaLinks.tpl
  20. 34
    0
      autoload.php
  21. 48
    0
      bootstrap.php
  22. 8
    0
      composer.json
  23. 280
    0
      composer.lock
  24. 1
    0
      version
  25. 3
    0
      web/.htaccess
  26. 152
    0
      web/Styles/css/sks-v2.css
  27. binární
      web/Styles/images/bg.png
  28. binární
      web/Styles/images/favicon.png
  29. binární
      web/Styles/images/sks-background.png
  30. binární
      web/Styles/images/sksbanner.gif
  31. binární
      web/Styles/images/skslp-bg.jpg
  32. binární
      web/Styles/sks-screens/1.png
  33. binární
      web/Styles/sks-screens/2.png
  34. binární
      web/Styles/sks-screens/3.png
  35. binární
      web/Styles/sks-screens/4.png
  36. binární
      web/Styles/sks-screens/5.png
  37. binární
      web/Styles/sks-screens/6.png
  38. binární
      web/Styles/sks-screens/7.png
  39. 25
    0
      web/index.php
  40. 4
    0
      web/lib/jquery.js
  41. 5
    0
      web/lib/sks.js

+ 7
- 0
.gitignore Zobrazit soubor

@@ -0,0 +1,7 @@
1
+# Created by .ignore support plugin (hsz.mobi)
2
+.idea
3
+vendor
4
+Application/Config/config.php
5
+Application/Caches/templates_c/
6
+web/lib/bootstrap
7
+git-rev.sh

+ 40
- 0
Application/Config/config.php.new Zobrazit soubor

@@ -0,0 +1,40 @@
1
+<?php
2
+###############################################
3
+###            G-CMS Community Framework        ###
4
+###			  (c) by Marcel Völkel			###
5
+###			http://www.scav-media.com		###
6
+###############################################
7
+
8
+/*
9
+ * MAIN CONFIGURATION
10
+ * MYSQL VERBINDUNGSDATEN UND ANDERER SCHNICKSCHNACK
11
+ */
12
+
13
+##DATABASE EXTENSION
14
+$config['dbext']        = 'mysql';
15
+
16
+##Mysql HOST Name
17
+$config['server']        = 'localhost';
18
+
19
+##MySQL Benutzer
20
+$config['mysqluser']	= 'dbuser';
21
+
22
+##MySQL Kennwort
23
+$config['mysqlpass']	= 'dbpassword';
24
+
25
+##MySQL Datenbankname
26
+$config['mysqldbname']    = 'dbname';
27
+
28
+
29
+/**
30
+ * Technical COntact Information
31
+ */
32
+$config['techmail'] 	= 'techmail';
33
+
34
+/**
35
+ * DEBUG
36
+ * if $config['debug'] = 1; then the Debug operations are on and Stacktraced Error Messages will be visible
37
+ * if $config['debug'] = 0; then the Debug Messages are off and no errors will be visible. But you can enable them via URL Parameter ?debug=1
38
+ * Parameter ?debug=1 has the same effect as the setting in the Config file.
39
+ */
40
+$config['debug'] = 1;

+ 3
- 0
Application/Config/router.php Zobrazit soubor

@@ -0,0 +1,3 @@
1
+<?php
2
+$router->map('GET', '/', ROOT . DS . APP . '/Data/index.php', 'homePage');
3
+$router->map('GET', '/download/[*:trailing]', ROOT . DS . APP . '/Data/download.php', 'downloadLink');

+ 7
- 0
Application/Data/download.php Zobrazit soubor

@@ -0,0 +1,7 @@
1
+<?php
2
+
3
+/**
4
+ *  Download page for Downloads
5
+ */
6
+//TODO: Create Download Logic with Download Class in scf/Additionals/Download.php
7
+var_dump($match);

+ 7
- 0
Application/Data/index.php Zobrazit soubor

@@ -0,0 +1,7 @@
1
+<?php
2
+
3
+/**
4
+ *  Index page for Template pares of Landingpage
5
+ */
6
+
7
+$tpl->display("index.tpl");

+ 64
- 0
Application/scf/Additionals/Carousel.php Zobrazit soubor

@@ -0,0 +1,64 @@
1
+<?php
2
+
3
+namespace SCF\Additionals;
4
+
5
+class Carousel
6
+{
7
+
8
+    /**
9
+     * @var array
10
+     */
11
+    private $picArray = [];
12
+
13
+    /**
14
+     * @var string
15
+     */
16
+    private $picDirectory;
17
+
18
+    /**
19
+     * Carousel constructor.
20
+     * @param $directory
21
+     */
22
+    public function __construct($directory)
23
+    {
24
+        $this->picDirectory = $directory;
25
+        $this->setPicArray();
26
+    }
27
+
28
+    /**
29
+     * SET PICTURE ARRAY
30
+     */
31
+    public function setPicArray()
32
+    {
33
+        $this->picArray = $this->scanDirForFiles();
34
+    }
35
+
36
+    /**
37
+     * @return array $this->picArray
38
+     */
39
+    public function getPicArray()
40
+    {
41
+        return $this->picArray;
42
+    }
43
+
44
+    /**
45
+     * @return array $tempArray
46
+     */
47
+    private function scanDirForFiles()
48
+    {
49
+        $tempArray = [];
50
+        $dir = $this->picDirectory;
51
+        if ($handle = opendir($dir)) {
52
+            $shortDir = strstr($dir, 'Styles');
53
+            while (($file = readdir($handle)) !== false) {
54
+                if (!in_array($file, array(".", "..")) && !is_dir($dir . $file)) {
55
+                    $tempArray[] = $shortDir . $file;
56
+                }
57
+
58
+            }
59
+        }
60
+
61
+        return $tempArray;
62
+
63
+    }
64
+}

+ 56
- 0
Application/scf/Additionals/Download.php Zobrazit soubor

@@ -0,0 +1,56 @@
1
+<?php
2
+
3
+namespace SCF\Additionals;
4
+
5
+class Download
6
+{
7
+
8
+    /**
9
+     * @var string
10
+     */
11
+    private $absolutePath;
12
+
13
+    /**
14
+     * @var string
15
+     */
16
+    private $fileName;
17
+
18
+    public function __construct()
19
+    {
20
+
21
+    }
22
+
23
+    /**
24
+     * @param string $fileName
25
+     */
26
+    public function setFileName($fileName)
27
+    {
28
+        $this->fileName = $fileName;
29
+    }
30
+
31
+    /**
32
+     * @return string
33
+     */
34
+    public function getFileName()
35
+    {
36
+        return $this->fileName;
37
+    }
38
+
39
+    /**
40
+     * @return string
41
+     */
42
+    public function getAbsolutePath()
43
+    {
44
+        return $this->absolutePath;
45
+    }
46
+
47
+    /**
48
+     * @param string $absolutePath
49
+     */
50
+    public function setAbsolutePath($absolutePath)
51
+    {
52
+        $this->absolutePath = $absolutePath;
53
+    }
54
+
55
+//TODO: Finishing Download Class to generate correct Downloads for Page!
56
+}

+ 104
- 0
Application/scf/Core/DI.php Zobrazit soubor

@@ -0,0 +1,104 @@
1
+<?php
2
+
3
+namespace SCF\Core;
4
+
5
+class DI {
6
+    /**
7
+     * @var $instance
8
+     */
9
+    private static $instance;
10
+
11
+    /**
12
+     * @var array $container
13
+     */
14
+    private $container = [];
15
+
16
+    /**
17
+     * DI constructor.
18
+     */
19
+    private function __construct()
20
+    {
21
+
22
+    }
23
+
24
+    /**
25
+     *
26
+     */
27
+    private function __clone()
28
+    {
29
+
30
+    }
31
+
32
+    /**
33
+     * @return DI
34
+     */
35
+    public static function getInstance()
36
+    {
37
+        if(self::$instance === null) {
38
+            self::$instance = new self();
39
+        }
40
+
41
+        return self::$instance;
42
+    }
43
+
44
+    /**
45
+     * @param $name
46
+     * @param $classDefinition
47
+     * @param bool $shared
48
+     */
49
+    public function set($name, $classDefinition, $shared = false)
50
+    {
51
+        $this->container[$name] = (object)['def' => $classDefinition, 'shared' => $shared, 'instance' => null];
52
+    }
53
+
54
+    /**
55
+     * @param $name
56
+     * @return mixed
57
+     */
58
+    public function get($name)
59
+    {
60
+        if(!isset($this->container[$name])) {
61
+            throw new \RuntimeException('Angeforderter Service '. $name .' nicht definiert');
62
+        }
63
+
64
+        $service = $this->container[$name];
65
+
66
+        if(!$service->shared) {
67
+            return $this->createInstance($service->def, false);
68
+        }
69
+
70
+        if($service->instance === null) {
71
+            $service->instance = $this->createInstance($service->def, true);
72
+        }
73
+
74
+        return $service->instance;
75
+    }
76
+
77
+    /**
78
+     * @param $definition
79
+     * @param $shared
80
+     * @return mixed
81
+     */
82
+    private function createInstance($definition, $shared)
83
+    {
84
+        if(is_callable($definition)) {
85
+            return $definition();
86
+        }
87
+
88
+        if(is_string($definition)) {
89
+            return new $definition;
90
+        }
91
+
92
+        if(is_object($definition)) {
93
+            if($shared) {
94
+                return $definition;
95
+            } else {
96
+                return new $definition;
97
+            }
98
+        }
99
+
100
+        throw new  \RuntimeException('Malformed service definition!');
101
+    }
102
+
103
+}
104
+

+ 126
- 0
Application/scf/Core/Database.php Zobrazit soubor

@@ -0,0 +1,126 @@
1
+<?php
2
+
3
+namespace SCF\Core;
4
+
5
+use PDO;
6
+use PDOException;
7
+
8
+class Database {
9
+    /**
10
+     * @var null|PDO
11
+     */
12
+    private $db = NULL;
13
+
14
+    /**
15
+     * @var
16
+     */
17
+    private $stmt;
18
+
19
+    /**
20
+     * @var string
21
+     */
22
+    private $error;
23
+
24
+    /**
25
+     * Database constructor.
26
+     * @param $dbext
27
+     * @param $dbhost
28
+     * @param $dbuser
29
+     * @param $dbpass
30
+     * @param $dbname
31
+     */
32
+    public function __construct($dbext, $dbhost, $dbuser, $dbpass, $dbname)
33
+    {
34
+        $dsn = $dbext.':dbname='.$dbname.';host='.$dbhost.';charset=utf8';
35
+
36
+        $options = [
37
+            PDO::ATTR_PERSISTENT => true,
38
+            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
39
+        ];
40
+
41
+        try {
42
+            $this->db = new PDO($dsn, $dbuser, $dbpass, $options);
43
+        }
44
+        catch (PDOException $e) {
45
+            $this->error = $e->getMessage();
46
+        }
47
+    }
48
+
49
+    /**
50
+     * @param $query
51
+     */
52
+    public function query($query)
53
+    {
54
+        $this->stmt = $this->db->prepare($query);
55
+    }
56
+
57
+    /**
58
+     * @param $param
59
+     * @param $value
60
+     * @param null $type
61
+     */
62
+    public function bind($param, $value, $type = null)
63
+    {
64
+        if(is_null($type)) {
65
+            switch(true) {
66
+                case is_int($value):
67
+                    $type = PDO::PARAM_INT;
68
+                    break;
69
+                case is_bool($value):
70
+                    $type = PDO::PARAM_BOOL;
71
+                    break;
72
+                case is_null($value):
73
+                    $type = PDO::PARAM_NULL;
74
+                    break;
75
+                default:
76
+                    $type = PDO::PARAM_STR;
77
+            }
78
+        }
79
+
80
+        $this->stmt->bindValue($param,$value,$type);
81
+    }
82
+
83
+    /**
84
+     * @return mixed
85
+     */
86
+    public function execute()
87
+    {
88
+        return $this->stmt->execute();
89
+    }
90
+
91
+    /**
92
+     * @return mixed
93
+     */
94
+    public function fetchArray()
95
+    {
96
+        $this->execute();
97
+        return $this->stmt->fetchAll(PDO::FETCH_ASSOC);
98
+    }
99
+
100
+    /**
101
+     * @return mixed
102
+     */
103
+    public function single()
104
+    {
105
+        $this->execute();
106
+        return $this->stmt->fetch(PDO::FETCH_ASSOC);
107
+    }
108
+
109
+    /**
110
+     * @return mixed
111
+     */
112
+    public function rowCount()
113
+    {
114
+        return $this->stmt->rowCount();
115
+    }
116
+
117
+    /**
118
+     * @return mixed
119
+     */
120
+    public function lastInsertId()
121
+    {
122
+        return $this->stmt->lastInsertId();
123
+    }
124
+
125
+
126
+}

+ 79
- 0
Application/scf/Core/System.php Zobrazit soubor

@@ -0,0 +1,79 @@
1
+<?php
2
+
3
+namespace SCF\Core;
4
+
5
+
6
+class System {
7
+
8
+    /**
9
+     * @var \SCF\Core\Database
10
+     */
11
+    private $_db;
12
+
13
+    /**
14
+     * @var array
15
+     */
16
+    private $system = [];
17
+
18
+    /**
19
+     * System constructor.
20
+     * @param \SCF\Core\Database $db
21
+     */
22
+    public function __construct(Database $db)
23
+    {
24
+        $this->_db = $db;
25
+        $this->getSettings();
26
+    }
27
+
28
+    /**
29
+     * Collect settings from Database
30
+     */
31
+    private function getSettings()
32
+    {
33
+        $this->_db->query("SELECT * FROM sks_core_settings");
34
+        $this->createSettings($this->_db->fetchArray());
35
+
36
+    }
37
+
38
+    /**
39
+     * Returns vardump of all Settings in $this->system
40
+     */
41
+    public function sysAll()
42
+    {
43
+        return var_dump($this->system);
44
+
45
+    }
46
+
47
+    /**
48
+     * @param $dbArray
49
+     */
50
+    private function createSettings($dbArray)
51
+    {
52
+        foreach ($dbArray as $item)
53
+        {
54
+            $this->system[$item['setting']] = $item['value'];
55
+        }
56
+    }
57
+
58
+    /**
59
+     * @param $value
60
+     * @return string
61
+     */
62
+    public function getValue($value)
63
+    {
64
+        if(!$this->system[$value]) {
65
+            return $value . ' is not Defined';
66
+        }
67
+
68
+        return $this->system[$value];
69
+    }
70
+
71
+    /**
72
+     * @return mixed
73
+     */
74
+    public function getVersion()
75
+    {
76
+        $cmsversion = explode('|', $this->system['cms_vers']);
77
+        return $cmsversion[0];
78
+    }
79
+}

+ 47
- 0
Application/scf/Core/Templates.php Zobrazit soubor

@@ -0,0 +1,47 @@
1
+<?php
2
+
3
+namespace SCF\Core;
4
+
5
+use Smarty;
6
+use AltoRouter;
7
+
8
+
9
+class Templates extends Smarty
10
+{
11
+
12
+    /**
13
+     * @var AltoRouter
14
+     */
15
+    private $_router;
16
+
17
+    /**
18
+     * @var System
19
+     */
20
+    private $_settings;
21
+
22
+    /**
23
+     * Templates constructor.
24
+     * @param System $settings
25
+     * @param AltoRouter $router
26
+     */
27
+    public function __construct(System $settings, AltoRouter $router)
28
+    {
29
+        parent::__construct();
30
+
31
+
32
+        $this->_settings = $settings;
33
+        $this->_router = $router;
34
+
35
+        $this->setTemplateDir(ROOT . DS . APP . '/Templates/sternenkindsaga/');
36
+        $this->setCompileDir(ROOT . DS . APP . '/Caches/templates_c/');
37
+        $this->setConfigDir(ROOT . DS . APP . '/Caches/configs/');
38
+        $this->setCacheDir(ROOT . DS . APP . '/Caches/cache/');
39
+
40
+
41
+        $this->assign('router', $this->_router);
42
+        $this->assign('path', ROOT . DS . APP);
43
+        $this->assign('settings', $this->_settings);
44
+
45
+
46
+    }
47
+}

+ 3
- 0
Application/templates/sternenkindsaga/errorpages/404.tpl Zobrazit soubor

@@ -0,0 +1,3 @@
1
+{include file="header.tpl"}
2
+
3
+{include file="footer.tpl"}

+ 22
- 0
Application/templates/sternenkindsaga/footer.tpl Zobrazit soubor

@@ -0,0 +1,22 @@
1
+</div>
2
+
3
+
4
+<footer>
5
+    <div class="container">
6
+        <div class="row">
7
+            <div class="col-xs-6">
8
+                {$settings->getValue('lp_copyright_text')}
9
+            </div>
10
+            <div class="col-xs-6">
11
+                {include file="misc/mediaLinks.tpl"}
12
+                <div class="version">Page {fetch file="../version"}</div>
13
+            </div>
14
+        </div>
15
+    </div>
16
+
17
+</footer>
18
+<script src="lib/jquery.js"></script>
19
+<script src="lib/bootstrap/js/bootstrap.js"></script>
20
+<script src="lib/sks.js"></script>
21
+</body>
22
+</html>

+ 9
- 0
Application/templates/sternenkindsaga/header.tpl Zobrazit soubor

@@ -0,0 +1,9 @@
1
+{include file="html/htmlHead.tpl"}
2
+<body>
3
+{include file="misc/facebook.tpl"}
4
+<header>
5
+    <img src="Styles/images/sksbanner.gif" class="img-responsive" alt="Sternenkind Saga Logo">
6
+</header>
7
+
8
+<div class="container sks-margin-bottom">
9
+

+ 20
- 0
Application/templates/sternenkindsaga/html/htmlHead.tpl Zobrazit soubor

@@ -0,0 +1,20 @@
1
+<!doctype html>
2
+
3
+<html lang="en">
4
+<head>
5
+    <title>{$settings->getValue("sitename")}</title>
6
+    <meta charset="utf-8">
7
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
8
+    <meta name="viewport" content="width=device-width, initial-scale=1">
9
+
10
+    <base href="{$settings->getValue("siteaddr")}">
11
+    <!--[if IE]></base><![endif]-->
12
+    <meta name="description" content="Description default here">
13
+    <link rel="stylesheet" href="lib/bootstrap/css/bootstrap.css">
14
+    <link rel="stylesheet" href="lib/bootstrap/css/bootstrap-theme.css">
15
+    <link rel="stylesheet" href="Styles/css/sks-v2.css">
16
+
17
+    <!--[if lt IE 9]>
18
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script>
19
+    <![endif]-->
20
+</head>

+ 35
- 0
Application/templates/sternenkindsaga/index.tpl Zobrazit soubor

@@ -0,0 +1,35 @@
1
+{include file="header.tpl"}
2
+<div class="row row-width">
3
+    <div class="col-sm-7 less-padding sks-bottom-spacer">
4
+        <div class="sks-box">
5
+            <strong>{$settings->getValue('lp_teaser_text_headline')}</strong>
6
+            {$settings->getValue('lp_teaser_text')|nl2br}
7
+        </div>
8
+
9
+    </div>
10
+    <div class="row">
11
+        <div class="col-sm-5 sks-bottom-spacer">
12
+            <div class="sks-box">
13
+                {include file="misc/carousel.tpl"}
14
+                <b> Erwecke jetzt das Sternenkind in dir!</b>
15
+                <button class="sks-download-button" id="sks-dl-button">Download</button>
16
+            </div>
17
+        </div>
18
+        <div class="col-sm-5 sks-bottom-spacer">
19
+            <div class="sks-box">
20
+                <strong>{$settings->getValue('sks_additional_files')}</strong><br/>
21
+                {$settings->getValue('sks_eu_patch')}
22
+            </div>
23
+        </div>
24
+        <div class="col-sm-5">
25
+            <div class="sks-box">
26
+                <strong>{$settings->getValue('sks_social_media')}</strong><br/>
27
+                {$settings->getValue('sks_forum_link')}<br/>
28
+                {$settings->getValue('sks_facebook_link')}<br/>
29
+                {$settings->getValue('sks_homepage_link')}<br/>
30
+            </div>
31
+        </div>
32
+    </div>
33
+
34
+</div>
35
+{include file="footer.tpl"}

+ 26
- 0
Application/templates/sternenkindsaga/misc/carousel.tpl Zobrazit soubor

@@ -0,0 +1,26 @@
1
+<div id="sks-screenshot-carousel" class="carousel slide" data-ride="carousel">
2
+
3
+    <ol class="carousel-indicators indicator-padding">
4
+        {assign var="array" value=$sksscreens|count}
5
+        {for $counter=0 to $array}
6
+            <li data-target="#sks-screenshot-carousel" data-slide-to="{$counter}"
7
+                {if $counter == 0}class="active"{/if}></li>
8
+        {/for}
9
+    </ol>
10
+
11
+    <div class="carousel-inner sks-screen-res" role="listbox">
12
+        {foreach item=pic from=$sksscreens name=listScreenshots}
13
+            <div class="item {if $smarty.foreach.listScreenshots.iteration == 1}active{/if}">
14
+                <img src="{$pic}" alt="SKS Screen {$smarty.foreach.listScreenshots.iteration}">
15
+            </div>
16
+        {/foreach}
17
+    </div>
18
+    <a class="left carousel-control" href="#sks-screenshot-carousel" role="button" data-slide="prev">
19
+        <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
20
+        <span class="sr-only">Previous</span>
21
+    </a>
22
+    <a class="right carousel-control" href="#sks-screenshot-carousel" role="button" data-slide="next">
23
+        <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
24
+        <span class="sr-only">Next</span>
25
+    </a>
26
+</div>

+ 9
- 0
Application/templates/sternenkindsaga/misc/facebook.tpl Zobrazit soubor

@@ -0,0 +1,9 @@
1
+<div id="fb-root"></div>
2
+<script>(function (d, s, id) {
3
+        var js, fjs = d.getElementsByTagName(s)[0];
4
+        if (d.getElementById(id)) return;
5
+        js = d.createElement(s);
6
+        js.id = id;
7
+        js.src = "//connect.facebook.net/de_DE/sdk.js#xfbml=1&appId=252675068082919&version=v2.0";
8
+        fjs.parentNode.insertBefore(js, fjs);
9
+    }(document, 'script', 'facebook-jssdk'));</script>

+ 12
- 0
Application/templates/sternenkindsaga/misc/mediaLinks.tpl Zobrazit soubor

@@ -0,0 +1,12 @@
1
+<div class="btn-group dropup mediaLinks">
2
+    <button class="btn btn-success btn-xs dropdown-toggle" type="button" id="linkArea" data-toggle="dropdown"
3
+            aria-haspopup="true" aria-expanded="false">
4
+        Media Links
5
+        <span class="caret"></span>
6
+    </button>
7
+    <ul class="dropdown-menu dropdown-menu-right sks-dropdown" aria-labelledby="linkArea">
8
+        <li>{$settings->getValue('sks_forum_link')}</li>
9
+        <li>{$settings->getValue('sks_facebook_link')}</li>
10
+        <li>{$settings->getValue('sks_homepage_link')}</li>
11
+    </ul>
12
+</div>

+ 34
- 0
autoload.php Zobrazit soubor

@@ -0,0 +1,34 @@
1
+<?php
2
+/**
3
+ * @param string $class The fully-qualified class name.
4
+ * @return void
5
+ */
6
+spl_autoload_register(function ($class) {
7
+
8
+    // project-specific namespace prefix
9
+    $prefix = 'SCF\\';
10
+
11
+    // base directory for the namespace prefix
12
+    $base_dir = __DIR__ . '/Application/scf/';
13
+
14
+    // does the class use the namespace prefix?
15
+    $len = strlen($prefix);
16
+    if (strncmp($prefix, $class, $len) !== 0) {
17
+        // no, move to the next registered autoloader
18
+        return;
19
+    }
20
+
21
+    // get the relative class name
22
+    $relative_class = substr($class, $len);
23
+
24
+    // replace the namespace prefix with the base directory, replace namespace
25
+    // separators with directory separators in the relative class name, append
26
+    // with .php
27
+    $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
28
+
29
+    // if the file exists, require it
30
+    if (file_exists($file)) {
31
+        require $file;
32
+    }
33
+
34
+});

+ 48
- 0
bootstrap.php Zobrazit soubor

@@ -0,0 +1,48 @@
1
+<?php
2
+
3
+define('DS', '/');
4
+define('ROOT', __DIR__);
5
+define('APP','Application');
6
+define('VEND', ROOT."/vendor");
7
+
8
+/**
9
+ * Load autoloaders and Config files
10
+ */
11
+require_once ROOT."/autoload.php";
12
+require_once VEND."/autoload.php";
13
+require_once ROOT.DS.APP."/Config/config.php";
14
+
15
+use Symfony\Component\Debug\Debug;
16
+use SCF\Core\DI;
17
+use SCF\Core\Database;
18
+use SCF\Core\System;
19
+use SCF\Core\Templates;
20
+
21
+/**
22
+ * CREATE SYMLINK FOR BOOTSTRAP FOLDER IF NOT EXISTS!
23
+ */
24
+if(!is_link(__DIR__."/web/lib/bootstrap")) {
25
+    symlink(__DIR__."/vendor/twbs/bootstrap/dist", __DIR__."/web/lib/bootstrap");
26
+}
27
+
28
+/**
29
+ * Check if Debug is Enabled and enabdle or disable Error Reporting
30
+ */
31
+if($config['debug'] == 1 || $_GET['debug'] == 1) {
32
+    error_reporting(E_ALL & ~E_NOTICE);
33
+    Debug::enable(E_ALL & ~E_NOTICE);
34
+}
35
+else {
36
+    error_reporting(0);
37
+    Debug::enable(0);
38
+}
39
+
40
+$di = DI::getInstance();
41
+$di->set('db', new Database($config['dbext'], $config['server'], $config['mysqluser'], $config['mysqlpass'], $config['mysqldbname']), true);
42
+$di->set('router', 'AltoRouter', true);
43
+
44
+$settings = new System(DI::getInstance()->get('db'));
45
+
46
+$router = DI::getInstance()->get('router');
47
+
48
+$tpl = new Templates($settings,$router);

+ 8
- 0
composer.json Zobrazit soubor

@@ -0,0 +1,8 @@
1
+{
2
+    "require": {
3
+        "smarty/smarty": "^3.1",
4
+        "altorouter/altorouter": "^1.2",
5
+        "symfony/debug": "^4.0",
6
+        "twbs/bootstrap": "^3.3"
7
+    }
8
+}

+ 280
- 0
composer.lock Zobrazit soubor

@@ -0,0 +1,280 @@
1
+{
2
+    "_readme": [
3
+        "This file locks the dependencies of your project to a known state",
4
+        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5
+        "This file is @generated automatically"
6
+    ],
7
+    "content-hash": "f2d61491375dfee1980ffd91f147a685",
8
+    "packages": [
9
+        {
10
+            "name": "altorouter/altorouter",
11
+            "version": "v1.2.0",
12
+            "source": {
13
+                "type": "git",
14
+                "url": "https://github.com/dannyvankooten/AltoRouter.git",
15
+                "reference": "39c50092470128c12284d332bb57f306bb5b58e4"
16
+            },
17
+            "dist": {
18
+                "type": "zip",
19
+                "url": "https://api.github.com/repos/dannyvankooten/AltoRouter/zipball/39c50092470128c12284d332bb57f306bb5b58e4",
20
+                "reference": "39c50092470128c12284d332bb57f306bb5b58e4",
21
+                "shasum": ""
22
+            },
23
+            "require": {
24
+                "php": ">=5.3.0"
25
+            },
26
+            "require-dev": {
27
+                "codeclimate/php-test-reporter": "dev-master",
28
+                "phpunit/phpunit": "4.5.*"
29
+            },
30
+            "type": "library",
31
+            "autoload": {
32
+                "classmap": [
33
+                    "AltoRouter.php"
34
+                ]
35
+            },
36
+            "notification-url": "https://packagist.org/downloads/",
37
+            "license": [
38
+                "MIT"
39
+            ],
40
+            "authors": [
41
+                {
42
+                    "name": "Danny van Kooten",
43
+                    "email": "dannyvankooten@gmail.com",
44
+                    "homepage": "http://dannyvankooten.com/"
45
+                },
46
+                {
47
+                    "name": "Koen Punt",
48
+                    "homepage": "https://github.com/koenpunt"
49
+                },
50
+                {
51
+                    "name": "niahoo",
52
+                    "homepage": "https://github.com/niahoo"
53
+                }
54
+            ],
55
+            "description": "A lightning fast router for PHP",
56
+            "homepage": "https://github.com/dannyvankooten/AltoRouter",
57
+            "keywords": [
58
+                "lightweight",
59
+                "router",
60
+                "routing"
61
+            ],
62
+            "time": "2015-11-30T00:47:43+00:00"
63
+        },
64
+        {
65
+            "name": "psr/log",
66
+            "version": "1.0.2",
67
+            "source": {
68
+                "type": "git",
69
+                "url": "https://github.com/php-fig/log.git",
70
+                "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
71
+            },
72
+            "dist": {
73
+                "type": "zip",
74
+                "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
75
+                "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
76
+                "shasum": ""
77
+            },
78
+            "require": {
79
+                "php": ">=5.3.0"
80
+            },
81
+            "type": "library",
82
+            "extra": {
83
+                "branch-alias": {
84
+                    "dev-master": "1.0.x-dev"
85
+                }
86
+            },
87
+            "autoload": {
88
+                "psr-4": {
89
+                    "Psr\\Log\\": "Psr/Log/"
90
+                }
91
+            },
92
+            "notification-url": "https://packagist.org/downloads/",
93
+            "license": [
94
+                "MIT"
95
+            ],
96
+            "authors": [
97
+                {
98
+                    "name": "PHP-FIG",
99
+                    "homepage": "http://www.php-fig.org/"
100
+                }
101
+            ],
102
+            "description": "Common interface for logging libraries",
103
+            "homepage": "https://github.com/php-fig/log",
104
+            "keywords": [
105
+                "log",
106
+                "psr",
107
+                "psr-3"
108
+            ],
109
+            "time": "2016-10-10T12:19:37+00:00"
110
+        },
111
+        {
112
+            "name": "smarty/smarty",
113
+            "version": "v3.1.31",
114
+            "source": {
115
+                "type": "git",
116
+                "url": "https://github.com/smarty-php/smarty.git",
117
+                "reference": "c7d42e4a327c402897dd587871434888fde1e7a9"
118
+            },
119
+            "dist": {
120
+                "type": "zip",
121
+                "url": "https://api.github.com/repos/smarty-php/smarty/zipball/c7d42e4a327c402897dd587871434888fde1e7a9",
122
+                "reference": "c7d42e4a327c402897dd587871434888fde1e7a9",
123
+                "shasum": ""
124
+            },
125
+            "require": {
126
+                "php": ">=5.2"
127
+            },
128
+            "type": "library",
129
+            "extra": {
130
+                "branch-alias": {
131
+                    "dev-master": "3.1.x-dev"
132
+                }
133
+            },
134
+            "autoload": {
135
+                "files": [
136
+                    "libs/bootstrap.php"
137
+                ]
138
+            },
139
+            "notification-url": "https://packagist.org/downloads/",
140
+            "license": [
141
+                "LGPL-3.0"
142
+            ],
143
+            "authors": [
144
+                {
145
+                    "name": "Monte Ohrt",
146
+                    "email": "monte@ohrt.com"
147
+                },
148
+                {
149
+                    "name": "Uwe Tews",
150
+                    "email": "uwe.tews@googlemail.com"
151
+                },
152
+                {
153
+                    "name": "Rodney Rehm",
154
+                    "email": "rodney.rehm@medialize.de"
155
+                }
156
+            ],
157
+            "description": "Smarty - the compiling PHP template engine",
158
+            "homepage": "http://www.smarty.net",
159
+            "keywords": [
160
+                "templating"
161
+            ],
162
+            "time": "2016-12-14T21:57:25+00:00"
163
+        },
164
+        {
165
+            "name": "symfony/debug",
166
+            "version": "v4.0.0",
167
+            "source": {
168
+                "type": "git",
169
+                "url": "https://github.com/symfony/debug.git",
170
+                "reference": "26a15dab86c3820473716be4f846eac774ad4ad9"
171
+            },
172
+            "dist": {
173
+                "type": "zip",
174
+                "url": "https://api.github.com/repos/symfony/debug/zipball/26a15dab86c3820473716be4f846eac774ad4ad9",
175
+                "reference": "26a15dab86c3820473716be4f846eac774ad4ad9",
176
+                "shasum": ""
177
+            },
178
+            "require": {
179
+                "php": "^7.1.3",
180
+                "psr/log": "~1.0"
181
+            },
182
+            "conflict": {
183
+                "symfony/http-kernel": "<3.4"
184
+            },
185
+            "require-dev": {
186
+                "symfony/http-kernel": "~3.4|~4.0"
187
+            },
188
+            "type": "library",
189
+            "extra": {
190
+                "branch-alias": {
191
+                    "dev-master": "4.0-dev"
192
+                }
193
+            },
194
+            "autoload": {
195
+                "psr-4": {
196
+                    "Symfony\\Component\\Debug\\": ""
197
+                },
198
+                "exclude-from-classmap": [
199
+                    "/Tests/"
200
+                ]
201
+            },
202
+            "notification-url": "https://packagist.org/downloads/",
203
+            "license": [
204
+                "MIT"
205
+            ],
206
+            "authors": [
207
+                {
208
+                    "name": "Fabien Potencier",
209
+                    "email": "fabien@symfony.com"
210
+                },
211
+                {
212
+                    "name": "Symfony Community",
213
+                    "homepage": "https://symfony.com/contributors"
214
+                }
215
+            ],
216
+            "description": "Symfony Debug Component",
217
+            "homepage": "https://symfony.com",
218
+            "time": "2017-11-21T09:27:49+00:00"
219
+        },
220
+        {
221
+            "name": "twbs/bootstrap",
222
+            "version": "v3.3.7",
223
+            "source": {
224
+                "type": "git",
225
+                "url": "https://github.com/twbs/bootstrap.git",
226
+                "reference": "0b9c4a4007c44201dce9a6cc1a38407005c26c86"
227
+            },
228
+            "dist": {
229
+                "type": "zip",
230
+                "url": "https://api.github.com/repos/twbs/bootstrap/zipball/0b9c4a4007c44201dce9a6cc1a38407005c26c86",
231
+                "reference": "0b9c4a4007c44201dce9a6cc1a38407005c26c86",
232
+                "shasum": ""
233
+            },
234
+            "replace": {
235
+                "twitter/bootstrap": "self.version"
236
+            },
237
+            "type": "library",
238
+            "extra": {
239
+                "branch-alias": {
240
+                    "dev-master": "3.3.x-dev"
241
+                }
242
+            },
243
+            "notification-url": "https://packagist.org/downloads/",
244
+            "license": [
245
+                "MIT"
246
+            ],
247
+            "authors": [
248
+                {
249
+                    "name": "Jacob Thornton",
250
+                    "email": "jacobthornton@gmail.com"
251
+                },
252
+                {
253
+                    "name": "Mark Otto",
254
+                    "email": "markdotto@gmail.com"
255
+                }
256
+            ],
257
+            "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.",
258
+            "homepage": "http://getbootstrap.com",
259
+            "keywords": [
260
+                "JS",
261
+                "css",
262
+                "framework",
263
+                "front-end",
264
+                "less",
265
+                "mobile-first",
266
+                "responsive",
267
+                "web"
268
+            ],
269
+            "time": "2016-07-25T15:51:55+00:00"
270
+        }
271
+    ],
272
+    "packages-dev": [],
273
+    "aliases": [],
274
+    "minimum-stability": "stable",
275
+    "stability-flags": [],
276
+    "prefer-stable": false,
277
+    "prefer-lowest": false,
278
+    "platform": [],
279
+    "platform-dev": []
280
+}

+ 1
- 0
version Zobrazit soubor

@@ -0,0 +1 @@
1
+v1.1.2

+ 3
- 0
web/.htaccess Zobrazit soubor

@@ -0,0 +1,3 @@
1
+RewriteEngine on
2
+RewriteCond %{REQUEST_FILENAME} !-f
3
+RewriteRule . index.php [L]

+ 152
- 0
web/Styles/css/sks-v2.css Zobrazit soubor

@@ -0,0 +1,152 @@
1
+body {
2
+
3
+    background-size: 100% auto;
4
+    color: #e79b1f;
5
+    font: 11px/160% "Verdana";
6
+}
7
+
8
+header {
9
+    max-width: 800px;
10
+    margin: 20px auto 0px auto;
11
+    box-shadow: 0px 5px 10px #000;
12
+}
13
+
14
+footer {
15
+    position: fixed;
16
+    bottom: 0;
17
+    left: 0;
18
+    right: 0;
19
+    height: 120px;
20
+    border-top: 2px solid #e79b1f;
21
+    background: url("../images/bg.png");
22
+    background-position: top left;
23
+    box-shadow: 0px -5px 10px #000000;
24
+}
25
+
26
+a {
27
+    color: #f5c87e;
28
+    text-decoration: underline;
29
+    font-size: 0.9em;
30
+    font-weight: bold;
31
+}
32
+
33
+a:hover {
34
+
35
+    color: #e79b1f;
36
+    text-decoration: underline;
37
+    font-size: 0.9em;
38
+    font-weight: bold;
39
+}
40
+
41
+.mediaLinks {
42
+    margin: 10px auto 0px auto;
43
+    float: right;
44
+}
45
+
46
+.version {
47
+    clear: both;
48
+    float: right;
49
+    margin-top: 15px;
50
+}
51
+
52
+.row-width {
53
+    border: 1px solid #ffffff;
54
+    width: 95%;
55
+    max-width: 800px;
56
+    margin: 20px auto 10px auto;
57
+}
58
+
59
+.less-padding {
60
+    padding-left: 0;
61
+    padding-right: 0;
62
+}
63
+
64
+.carousel-indicators {
65
+    margin-bottom: -10px;
66
+}
67
+
68
+.sks-dropdown {
69
+    background: linear-gradient(#1f1a16, #4d3c32);
70
+    border: 1px solid #e79b1f;
71
+}
72
+
73
+.sks-dropdown li a {
74
+    color: #f5c87e;
75
+    text-decoration: none;
76
+}
77
+
78
+.sks-dropdown li a:hover {
79
+    color: #e79b1f;
80
+    background: transparent;
81
+    text-decoration: underline;
82
+}
83
+
84
+.sks-margin-bottom {
85
+    margin-bottom: 25%;
86
+}
87
+
88
+.sks-max-width {
89
+    max-width: 320px;
90
+    margin: 0 auto 0 auto;
91
+}
92
+
93
+.sks-box {
94
+    border: 2px solid #e79b1f;
95
+    background: linear-gradient(#1f1a16, #4d3c32);
96
+    padding: 10px;
97
+
98
+    box-shadow: 0px 5px 10px #000000;
99
+    -webkit-border-radius: 5px;
100
+    -moz-border-radius: 5px;
101
+    border-radius: 5px;
102
+}
103
+
104
+.sks-bottom-spacer {
105
+    margin-bottom: 15px;
106
+}
107
+
108
+.sks-screens {
109
+    margin: 2px auto 10px auto;
110
+}
111
+
112
+.sks-download-button {
113
+    background: url("../images/sks-background.png") repeat;
114
+    border: 2px solid #e79b1f;
115
+    width: 100%;
116
+    height: 50px;
117
+    font-size: 3.5em;
118
+    color: #e79b1f;
119
+    cursor: pointer;
120
+    margin: 5px auto 5px auto;
121
+    box-shadow: 0 5px 10px #000000;
122
+}
123
+
124
+@media only screen and (min-device-width: 375px) {
125
+    body {
126
+        background: #cfcfcf url('../images/sks-background.png') repeat;
127
+    }
128
+
129
+    header {
130
+        width: 95%;
131
+    }
132
+
133
+    footer {
134
+        height: 72px;
135
+        font-size: 100%;
136
+    }
137
+}
138
+
139
+@media only screen and (min-device-width: 1024px) {
140
+
141
+    body {
142
+        background: #cfcfcf url('../images/skslp-bg.jpg');
143
+        background-position: center;
144
+        background-size: cover;
145
+    }
146
+
147
+    header {
148
+        width: 100%;
149
+    }
150
+
151
+}
152
+

binární
web/Styles/images/bg.png Zobrazit soubor


binární
web/Styles/images/favicon.png Zobrazit soubor


binární
web/Styles/images/sks-background.png Zobrazit soubor


binární
web/Styles/images/sksbanner.gif Zobrazit soubor


binární
web/Styles/images/skslp-bg.jpg Zobrazit soubor


binární
web/Styles/sks-screens/1.png Zobrazit soubor


binární
web/Styles/sks-screens/2.png Zobrazit soubor


binární
web/Styles/sks-screens/3.png Zobrazit soubor


binární
web/Styles/sks-screens/4.png Zobrazit soubor


binární
web/Styles/sks-screens/5.png Zobrazit soubor


binární
web/Styles/sks-screens/6.png Zobrazit soubor


binární
web/Styles/sks-screens/7.png Zobrazit soubor


+ 25
- 0
web/index.php Zobrazit soubor

@@ -0,0 +1,25 @@
1
+<?php
2
+require_once '../bootstrap.php';
3
+
4
+use SCF\Additionals\Carousel;
5
+
6
+$c = new Carousel(ROOT . DS . 'web/Styles/sks-screens' . DS);
7
+
8
+/**
9
+ * AltoRouter INCLUSION
10
+ */
11
+require_once ROOT.DS.APP."/Config/router.php";
12
+
13
+$tpl->assign('sksscreens', $c->getPicArray());
14
+$match = $router->match();
15
+
16
+if($match === false) {
17
+    $tpl->display('errorpages/404.tpl');
18
+}
19
+else {
20
+    try {
21
+        require $match['target'];
22
+    } catch(Exception $e) {
23
+        return $e->getMessage();
24
+    }
25
+}

+ 4
- 0
web/lib/jquery.js
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 5
- 0
web/lib/sks.js Zobrazit soubor

@@ -0,0 +1,5 @@
1
+$(document).ready(function () {
2
+    $(".carousel").carousel({
3
+        interval: 2000
4
+    });
5
+});

Načítá se…
Zrušit
Uložit