Compare commits
No commits in common. "master" and "v1.2.1" have entirely different histories.
734 changed files with 1843 additions and 47442 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1 +1,3 @@
|
||||||
*~
|
nbproject/
|
||||||
|
.idea/
|
||||||
|
completer.hist
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
image: php:7.0
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- bash ci/docker_install.sh > /dev/null
|
|
||||||
|
|
||||||
stages:
|
|
||||||
- test
|
|
||||||
|
|
||||||
test:
|
|
||||||
script:
|
|
||||||
- phpunit tests/
|
|
191
CHANGELOG.md
191
CHANGELOG.md
|
@ -1,191 +0,0 @@
|
||||||
# Changelog
|
|
||||||
|
|
||||||
- [S] = stable release
|
|
||||||
- [B] = beta release
|
|
||||||
- [D] = development release
|
|
||||||
|
|
||||||
|
|
||||||
- [S] release are always compared to the previous [S] release.
|
|
||||||
|
|
||||||
## Version 1.5.0 (2016-08-03) [S]
|
|
||||||
|
|
||||||
- **[FEATURE]** Ability to only show post excerpts on overview pages
|
|
||||||
- **[FIX]** Fixed twitter username not specified in connfig.yaml
|
|
||||||
- **[FIX]** Fixed wrong OpenGraph meta tags
|
|
||||||
- **[CODE]** Further improved code style
|
|
||||||
- **[CODE]** Added unit tests for Config.php and ArticleGenerator.php
|
|
||||||
- **[NOTE]** If you have own language file, please update them. See also the upgrade guide
|
|
||||||
|
|
||||||
## Version 1.4.4 (2016-06-03) [S]
|
|
||||||
- **[FIX]** Error when trying to create a feed
|
|
||||||
|
|
||||||
## Version 1.4.3 (2016-05-21) [S]
|
|
||||||
- **[FIX]** Missing space in drawer between "Blogs on" and blogname
|
|
||||||
- **[FIX]** Background layer was not removed if drawer was closed
|
|
||||||
- **[FEATURE]** nextDESIGN theme added to delivered themes
|
|
||||||
- **[NOTE]** The update script to 1.4.3 works with 1.4.0, 1.4.1 and 1.4.2
|
|
||||||
|
|
||||||
## Version 1.4.2 (2016-05-18) [S]
|
|
||||||
- [FIX]: Password verification not implemented in RCC login page
|
|
||||||
|
|
||||||
## Version 1.4.1 (2016-05-18) [S]
|
|
||||||
- Switch to HTTP Basic Auth for the RCC API
|
|
||||||
- Store password as hash
|
|
||||||
- Require SSL for using the RCC and the RCC API
|
|
||||||
- [FIX] Drawer "Go back" does not work
|
|
||||||
- [FIX] Missing nodejs dependencies
|
|
||||||
- [FIX] Disqus not completly migrated to new config
|
|
||||||
|
|
||||||
## Version 1.4.0 (2016-05-07) [S]
|
|
||||||
|
|
||||||
- Fix: Feeds contain no text
|
|
||||||
- Switch to YAML as config language
|
|
||||||
- Scripts for
|
|
||||||
- Switching from config.php to config.yaml
|
|
||||||
- Initializing RCC
|
|
||||||
- Initializing Rangitaki
|
|
||||||
- Rangitaki API
|
|
||||||
- Switch from JavaScript to CoffeeScript
|
|
||||||
- Switch from CSS to SASS
|
|
||||||
- Building and minimizing with Gulp
|
|
||||||
- Open links in articles in a new tab
|
|
||||||
- Better code style: PSR-2
|
|
||||||
|
|
||||||
## Version 1.4.0-beta (2016-04-27) [B]
|
|
||||||
|
|
||||||
- Fix: Feeds contain no text
|
|
||||||
- Switch to YAML as config language
|
|
||||||
- Scripts for
|
|
||||||
- Switching from config.php to config.yaml
|
|
||||||
- Initializing RCC
|
|
||||||
- Initializing Rangitaki
|
|
||||||
- Rangitaki API
|
|
||||||
- Switch from JavaScript to CoffeeScript
|
|
||||||
- Switch from CSS to SASS
|
|
||||||
- Building and minimizing with Gulp
|
|
||||||
- Open links in articles in a new tab
|
|
||||||
- Better code style: PSR-2
|
|
||||||
|
|
||||||
|
|
||||||
## Version 1.3.0 (2016-02-16) [S]
|
|
||||||
|
|
||||||
- Respecting do-not-track
|
|
||||||
- Atom feed
|
|
||||||
- Title fix
|
|
||||||
- Switch to composer
|
|
||||||
|
|
||||||
## Version 1.2.1 (2016-01-11) [S]
|
|
||||||
|
|
||||||
- Support for PHP 7
|
|
||||||
|
|
||||||
## Version 1.2.0 (2015-12-24) [S]
|
|
||||||
|
|
||||||
- Pagination: Split your blog posts over several page
|
|
||||||
- JavaScript Extension Support
|
|
||||||
- RCC: Write Posts
|
|
||||||
- RCC: Delete Posts
|
|
||||||
- RCC: Upload Media
|
|
||||||
- RCC: Edit Posts
|
|
||||||
|
|
||||||
## Version 1.1.90 (2015-12-21) [B]
|
|
||||||
|
|
||||||
- BUGFIX: ArticleGenerator error when no tags set
|
|
||||||
- Pagination: Localized strings
|
|
||||||
|
|
||||||
## Version 1.1.2 (2015-12-20) [D]
|
|
||||||
|
|
||||||
- Pagination
|
|
||||||
- Code style imporvements
|
|
||||||
|
|
||||||
## Version 1.1.1 (2015-12-07) [D]
|
|
||||||
|
|
||||||
- BUGFIX: RCC: new post: post title was the blog title
|
|
||||||
- BUGFIX: RCC: new post filename just the date without the time.
|
|
||||||
- Code highlight css themable
|
|
||||||
- JavaScript extension support. Just put your extension into ./extensions/
|
|
||||||
- Link in RCC to go directly to the blog
|
|
||||||
- RCC: Delete posts
|
|
||||||
- RCC: Edit posts
|
|
||||||
|
|
||||||
## Version 1.1.0 (2015-11-22) [D]
|
|
||||||
|
|
||||||
- RCC: Write blog posts
|
|
||||||
- RCC: Media Upload
|
|
||||||
- Drawer: Key listener ('ESC' to close, 'm; to open)
|
|
||||||
- Drawer: Highlight Blogs when hovering
|
|
||||||
- Drawer: 'X' button
|
|
||||||
- Metatags / Title based on subblog and / or article
|
|
||||||
- Update script
|
|
||||||
|
|
||||||
## Version 1.0.0 (2015-08-22) [S]
|
|
||||||
|
|
||||||
- Post writing in Markdown with a few keywords for the title, tags, date and the author (all optional)
|
|
||||||
- Multiple blogs
|
|
||||||
- A Subpages for each article with a comment box (Disqus; can be disabled)
|
|
||||||
- Share buttons (FAB; can be disabled)
|
|
||||||
- Disqus integration (can be disabled)
|
|
||||||
- Fast and easy configuration
|
|
||||||
- Google Analytics (optional)
|
|
||||||
- Twitter and OpenGraph meta tags
|
|
||||||
- Different themes
|
|
||||||
- Easy localization (just 3 (!) strings)
|
|
||||||
- Custom footer
|
|
||||||
- Navigation drawer (can be disabled)
|
|
||||||
- Tags
|
|
||||||
- Set author and date
|
|
||||||
- Mobile-first
|
|
||||||
- Rangitaki Control Center (aka RCC; optional, Read the RCC Documentation)
|
|
||||||
- Online post upload
|
|
||||||
|
|
||||||
## Version 0.9.0 (2015-07-25) [B]
|
|
||||||
|
|
||||||
- BUGFIX: 'Blogs of {BLOG NAME}' always shown (even if there are no other blogs)
|
|
||||||
- pictures in articles not centred
|
|
||||||
- long links longer than article card (especially a problem on mobile devices)
|
|
||||||
- Localization strings are now grouped in one array
|
|
||||||
- Better code (in some parts)
|
|
||||||
|
|
||||||
## Version 0.8.0 (2015-07-14) [B]
|
|
||||||
|
|
||||||
- Bugfixes and other improvements
|
|
||||||
|
|
||||||
## Version 0.7.0 (2015-07-05) [D]
|
|
||||||
|
|
||||||
## Version 0.6.0 (2015-07-03) [D]
|
|
||||||
|
|
||||||
- Localization support. More information will follow soon
|
|
||||||
- Theme support. More information will follow (hopefully) soon
|
|
||||||
- Various improvements (Check the commits for more)
|
|
||||||
|
|
||||||
## Version 0.5.0 (2015-06-16) [D]
|
|
||||||
|
|
||||||
- Improvements to the Rangitaki Control Center (rcc)
|
|
||||||
- Material Design (Blog and rcc)
|
|
||||||
|
|
||||||
## Version 0.4 (2015-06-14) [D]
|
|
||||||
|
|
||||||
- Multiple Blogs
|
|
||||||
- Online post upload (optional)
|
|
||||||
- Tags
|
|
||||||
- Author
|
|
||||||
|
|
||||||
## Version 0.3 (2015-06-11) [D]
|
|
||||||
|
|
||||||
- Portation of all main features of Version 0.2.2
|
|
||||||
- Code highlighting
|
|
||||||
|
|
||||||
*The first release with the name Rangitaki.
|
|
||||||
The following releases are of pBlog.*
|
|
||||||
|
|
||||||
## Version 0.2.2 (2015-05-13) [S]
|
|
||||||
|
|
||||||
- Links are now underlined, when you hover over them
|
|
||||||
- Simplified it to add the disqus comments
|
|
||||||
- Added and configuration option for setting a favicon
|
|
||||||
- Added the option to use Google Analytics
|
|
||||||
|
|
||||||
## Version 0.2.1 / pBlog 2.1 (2015-03-29) [S]
|
|
||||||
|
|
||||||
- Fix problems when creating article links
|
|
||||||
|
|
||||||
TODO: previous releases
|
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2015 - 2016 Marcel Kapfer
|
Copyright (c) 2015 Marcel Kapfer
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
57
README.md
57
README.md
|
@ -1,20 +1,18 @@
|
||||||
# Rangitaki PHP blogging engine
|
# Rangitaki PHP blogging engine
|
||||||
|
|
||||||
[![Join the chat at https://gitter.im/rangitaki/rangitaki](https://badges.gitter.im/canax/view.svg)](https://gitter.im/rangitaki/view?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
||||||
|
|
||||||
Rangitaki is a simple to use and easy to configure blogging engine, written in PHP and it has absolutely no database dependencies.
|
Rangitaki is a simple to use and easy to configure blogging engine, written in PHP and it has absolutely no database dependencies.
|
||||||
|
|
||||||
Tested with PHP version 5.5 until 7.0.
|
Tested with PHP version 5.5 until 7.0.
|
||||||
|
|
||||||
![Rangitaki](https://gitlab.com/mmk2410/rangitaki/raw/master/feature-graphic.png)
|
![Rangitaki](https://marcel-kapfer.de/blog/media/with-name.png)
|
||||||
|
|
||||||
[Wiki](https://gitlab.com/mmk2410/rangitaki/wikis/home)
|
[Website](https://marcel-kapfer.de/rangitaki)
|
||||||
|
|
||||||
[About](https://gitlab.com/mmk2410/rangitaki/wikis/about)
|
[About](https://marcel-kapfer.de/rangitaki/about)
|
||||||
|
|
||||||
[Documentation](https://gitlab.com/mmk2410/rangitaki/wikis/docs)
|
[Documentation](https://marcel-kapfer.de/rangitaki/docs)
|
||||||
|
|
||||||
[Quick Starting Guide](https://gitlab.com/mmk2410/rangitaki/wikis/docs/quickstart)
|
[Quick Starting Guide](https://marcel-kapfer.de/rangitaki/docs/quick)
|
||||||
|
|
||||||
## What is it?
|
## What is it?
|
||||||
|
|
||||||
|
@ -31,7 +29,7 @@ My goal for Rangitaki was (and still is) to create a blogging engine without dat
|
||||||
- Google Analytics (optional)
|
- Google Analytics (optional)
|
||||||
- Twitter and OpenGraph meta tags
|
- Twitter and OpenGraph meta tags
|
||||||
- Different themes
|
- Different themes
|
||||||
- Easy localization (just a few strings)
|
- Easy localization (just 3 (!) strings)
|
||||||
- Custom footer
|
- Custom footer
|
||||||
- Navigation drawer (can be disabled)
|
- Navigation drawer (can be disabled)
|
||||||
- Tags
|
- Tags
|
||||||
|
@ -39,15 +37,15 @@ My goal for Rangitaki was (and still is) to create a blogging engine without dat
|
||||||
- Mobile-first
|
- Mobile-first
|
||||||
- JavaScript Extension Support
|
- JavaScript Extension Support
|
||||||
- Pagination support
|
- Pagination support
|
||||||
- Atom feed generation
|
- Rangitaki Control Center (RCC; optional, read the [RCC Documentation](https://marcel-kapfer.de/rangitaki/docs/rcc))
|
||||||
- Rangitaki Control Center (RCC; optional, read the [RCC Documentation](https://gitlab.com/mmk2410/rangitaki/wikis/docs/rcc)
|
- Online post upload
|
||||||
- Have a look under 'What is that RCC?' in this readme
|
- More will come...
|
||||||
|
|
||||||
## Did you say 'themes'?
|
## Did you say 'themes'?
|
||||||
|
|
||||||
Yes. Rangitaki has a theme support which makes it easy to customize your blog concerning design.
|
Yes. Rangitaki has a theme support which makes it easy to customize your blog concerning design.
|
||||||
|
|
||||||
[Read the theme guide](https://gitlab.com/mmk2410/rangitaki/wikis/docs/themes)
|
[Read the theme guide](https://marcel-kapfer.de/rangitaki/docs/themes)
|
||||||
|
|
||||||
## What is that RCC?
|
## What is that RCC?
|
||||||
|
|
||||||
|
@ -58,34 +56,39 @@ It has the following features:
|
||||||
- Post deleting
|
- Post deleting
|
||||||
- Post editing
|
- Post editing
|
||||||
- Media upload
|
- Media upload
|
||||||
- Atom feed generation
|
|
||||||
|
|
||||||
[Read the RCC documentation](https://gitlab.com/mmk2410/rangitaki/wikis/docs/rcc)
|
[Read the RCC documentation](https://marcel-kapfer.de/rangitaki/docs/rcc)
|
||||||
|
|
||||||
## Used Libraries
|
## Where can I see an example?
|
||||||
|
|
||||||
- For converting the Markdown blog articles into HTML code Rangitaki uses [Parsedown](http://parsedown.org).
|
- Official Rangitaki blog [marcel-kapfer.de/rangitaki/blog](https://marcel-kapfer.de/rangitaki/blog)
|
||||||
- For creating the atom feeds Rangitaki uses [picoFeed](https://github.com/fguillot/picoFeed)
|
|
||||||
|
- My personal blog
|
||||||
|
[marcel-kapfer.de/blog](https://marcel-kapfer.de/blog)
|
||||||
|
|
||||||
|
Would you like to see your Rangitaki blog here? Write me a message at [marcelmichaelkapfer@yahoo.co.nz](mailto:marcelmichaelkapfer@yahoo.co.nz)
|
||||||
|
|
||||||
|
## Used Library
|
||||||
|
|
||||||
|
- For converting the Markdown blog articles into HTML code I use [Parsedown](http://parsedown.org)
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
## Issues, Requests, etc.
|
|
||||||
|
|
||||||
For bug reports, feature requests and all other questions or recommendations feel free to create an issue here at [GitLab](https://gitlab.com/mmk2410/rangitaki/issues).
|
|
||||||
|
|
||||||
## Code
|
|
||||||
|
|
||||||
1. Fork it
|
1. Fork it
|
||||||
2. Create your feature branch (`git checkout -b my-new-feature`)
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
||||||
3. Commit your changes (`git commit -am 'Add some feature'`)
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
||||||
4. Push to the branch (`git push origin my-new-feature`)
|
4. Push to the branch (`git push origin my-new-feature`)
|
||||||
5. Create new merge request
|
5. Create New Pull Request
|
||||||
|
|
||||||
Read also the [contributing documentation](https://gitlab.com/mmk2410/rangitaki/wikis/docs/contribute)
|
Read also the [contributing documentation](https://marcel-kapfer.de/rangitaki/docs/contrib)
|
||||||
|
|
||||||
## Social
|
## Social
|
||||||
|
|
||||||
You can follow me on Twitter or subscribe my blog to receive news about Rangitaki.
|
You can follow my personal Twitter and Google+ account to receive news about the Rangitaki blogging engine.
|
||||||
|
|
||||||
- [Twitter @mmk2410](https://twitter.com/mmk2410)
|
- [Twitter @mmk2410](https://twitter.com/mmk2410)
|
||||||
- [Blog mmk2410.org](https://mmk2410.org/), you can view the current posts about Rangitaki on [this page](https://mmk2410.org/tag/rangitaki/).
|
- [Google+ +MarcelKapfer](https://plus.google.com/+MarcelMichaelKapfer/posts)
|
||||||
|
|
||||||
|
## Trello
|
||||||
|
|
||||||
|
- [Trello Board](https://trello.com/b/7qb5I6EQ/rangitaki)
|
||||||
|
|
|
@ -1,67 +0,0 @@
|
||||||
<?php
|
|
||||||
// Marcel Kapfer (mmk2410)
|
|
||||||
// Script for moving from config.php to config.yaml
|
|
||||||
// License: MIT
|
|
||||||
|
|
||||||
require 'res/php/Config.php';
|
|
||||||
|
|
||||||
require 'config.php';
|
|
||||||
|
|
||||||
use mmk2410\rbe\config\Config as Config;
|
|
||||||
|
|
||||||
if ($bloghome == "yes") {
|
|
||||||
$bloghome = "on";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($blogintro == "yes") {
|
|
||||||
$blogintro = "on";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($sharefab == "yes") {
|
|
||||||
$sharefab = "on";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($rcc == "yes") {
|
|
||||||
$rcc = "on";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($nav_drawer == "yes") {
|
|
||||||
$nav_drawer = "on";
|
|
||||||
}
|
|
||||||
|
|
||||||
$yaml = array(
|
|
||||||
"blog" => array(
|
|
||||||
"title" => $blogtitle,
|
|
||||||
"author" => $blogauthor,
|
|
||||||
"description" => $blogdescription,
|
|
||||||
"home" => $bloghome,
|
|
||||||
"homeurl" => $bloghomeurl,
|
|
||||||
"homename" => $bloghomename,
|
|
||||||
"mainname" => $blogmainname,
|
|
||||||
"intro" => $blogintro,
|
|
||||||
"disqus" => $blogdisqus,
|
|
||||||
"analytics" => $bloganalytics,
|
|
||||||
"footer" => $blogfooter,
|
|
||||||
"url" => $blogurl
|
|
||||||
),
|
|
||||||
"design" => array(
|
|
||||||
"fab" => $sharefab,
|
|
||||||
"drawer" => $nav_drawer,
|
|
||||||
"theme" => $theme,
|
|
||||||
"pagination" => $pagination,
|
|
||||||
"favicon" => $favicon,
|
|
||||||
),
|
|
||||||
"rcc" => array(
|
|
||||||
"rcc" => "off",
|
|
||||||
"api" => "off",
|
|
||||||
),
|
|
||||||
"language" => $language,
|
|
||||||
);
|
|
||||||
|
|
||||||
$config = new Config('config.yaml', 'vendor/autoload.php');
|
|
||||||
|
|
||||||
if ($config->writeConfig($yaml)) {
|
|
||||||
echo "YAML config saved.\nYou can delete the config.php file\n";
|
|
||||||
} else {
|
|
||||||
echo "Failed to save YAML config.";
|
|
||||||
}
|
|
112
bin/init.php
112
bin/init.php
|
@ -1,112 +0,0 @@
|
||||||
<?php
|
|
||||||
// Marcel Kapfer (mmk2410)
|
|
||||||
// PHP script for initializing Rangitaki
|
|
||||||
// MIT License
|
|
||||||
|
|
||||||
error_reporting(0);
|
|
||||||
|
|
||||||
require 'res/php/Config.php';
|
|
||||||
|
|
||||||
use mmk2410\rbe\config\Config as Config;
|
|
||||||
|
|
||||||
$config = new Config('config.yaml', 'vendor/autoload.php');
|
|
||||||
|
|
||||||
if (!file_exists('config.yaml')) {
|
|
||||||
$yaml = array();
|
|
||||||
} else {
|
|
||||||
$yaml = $config->getConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
// blog part
|
|
||||||
$yaml["blog"]["title"] = get("Title of your blog", $yaml["blog"]["title"], "Example Blog");
|
|
||||||
$yaml["blog"]["author"] = get("Your name:", $yaml["blog"]["author"], "John");
|
|
||||||
$yaml["blog"]["description"] = get("A description of your blog:", $yaml["blog"]["description"], "A short description of your blog");
|
|
||||||
$yaml["blog"]["home"] = getBool("Do you have a top site? (on/off)", $yaml["blog"]["home"], "on");
|
|
||||||
if ($yaml["blog"]["home"] == "on") {
|
|
||||||
$yaml["blog"]["homeurl"] = get("Path / Url to home page", $yaml["blog"]["homeurl"], "../");
|
|
||||||
$yaml["blog"]["homename"] = get("Name of your home page", $yaml["blog"]["homename"], "Home");
|
|
||||||
}
|
|
||||||
$yaml["blog"]["mainname"] = get("Name of the main blog (if empty, the blog title will be used)", "");
|
|
||||||
$yaml["blog"]["intro"] = getBool("Do you want a blog intro text? (on/off)", $yaml["blog"]["intro"], "on");
|
|
||||||
$yaml["blog"]["disqus"] = get("Your Disqus shortname (Leave empty to disable)", $yaml["blog"]["disqus"], "");
|
|
||||||
$yaml["blog"]["analytics"] = get("Google Analytics ID (Leave empty to disable)", $yaml["blog"]["analytics"], "");
|
|
||||||
$yaml["blog"]["footer"] = get("The footer of your blog", $yaml["blog"]["footer"], "Example Blog 2016 CC-BY-SA 4.0");
|
|
||||||
|
|
||||||
// design part
|
|
||||||
$yaml["design"]["fab"] = getBool("Would you like to use the share buttons (on/off)", $yaml["design"]["blog"], "on");
|
|
||||||
$yaml["design"]["drawer"] = getBool("Would you like the use the navigation drawer? (on/off)", $yaml["design"]["drawer"], "on");
|
|
||||||
$themes = getDir('./themes');
|
|
||||||
$yaml["design"]["theme"] = get("Which theme would you like to use? (" . $themes . ")", $yaml["design"]["theme"], "material-light");
|
|
||||||
$yaml["design"]["pagination"] =
|
|
||||||
get("Which posts should be displayed on one page (0 to disable)", $yaml["design"]["pagination"], "0");
|
|
||||||
$yaml["design"]["excerpt"] =
|
|
||||||
getBool("Should be overview pages only show a excerpt of the full posts? (on/off)", $yaml["design"]["excerpt"], "off");
|
|
||||||
$yaml["design"]["favicon"] = get("URL to your favicon", $yaml["design"]["favicon"], "https://example.com/fav.ico");
|
|
||||||
|
|
||||||
// rcc
|
|
||||||
$yaml["rcc"]["rcc"] = "off";
|
|
||||||
$yaml["rcc"]["api"] = "off";
|
|
||||||
|
|
||||||
// languages
|
|
||||||
$langs = getDir('./lang');
|
|
||||||
$yaml["language"] = get("Choose a language (" . $langs . ")", $yaml["language"], "en");
|
|
||||||
|
|
||||||
// social media
|
|
||||||
$yaml["social"]["twitter"] = get("Your Twitter username:", $yaml["social"]["twitter"], "");
|
|
||||||
|
|
||||||
$config->writeConfig($yaml);
|
|
||||||
|
|
||||||
function get($question, $value, $default)
|
|
||||||
{
|
|
||||||
if (isset($value) && $value != "") {
|
|
||||||
$input = readline($question . " (" . $value . "): ");
|
|
||||||
if ($input == "") {
|
|
||||||
return $value;
|
|
||||||
} else {
|
|
||||||
return $input;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$input = readline($question . " (" . $default . ")" . ": ");
|
|
||||||
if ($input == "") {
|
|
||||||
return $default;
|
|
||||||
} else {
|
|
||||||
return $input;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getBool($question, $value, $default)
|
|
||||||
{
|
|
||||||
if (isset($value) && $value != "") {
|
|
||||||
$input = "someval";
|
|
||||||
while (!in_array($input, array("on", "off", ""))) {
|
|
||||||
$input = readline($question . " (" . $value . "): ");
|
|
||||||
}
|
|
||||||
if ($input == "") {
|
|
||||||
return $value;
|
|
||||||
} else {
|
|
||||||
return $input;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$input = "";
|
|
||||||
while (!in_array($input, array("on", "off"))) {
|
|
||||||
$input = readline($question . " (" . $default . ")" . ": ");
|
|
||||||
}
|
|
||||||
if ($input == "") {
|
|
||||||
return $default;
|
|
||||||
} else {
|
|
||||||
return $input;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function getDir($path)
|
|
||||||
{
|
|
||||||
$dir = scandir($path, SCANDIR_SORT_DESCENDING);
|
|
||||||
|
|
||||||
unset($dir[sizeof($dir) - 1]);
|
|
||||||
unset($dir[sizeof($dir) - 1]);
|
|
||||||
|
|
||||||
return implode(", ", $dir);
|
|
||||||
}
|
|
|
@ -1,76 +0,0 @@
|
||||||
<?php
|
|
||||||
// Marcel Kapfer (mmk2410)
|
|
||||||
// PHP script for initializing the RCC
|
|
||||||
// License: MIT
|
|
||||||
|
|
||||||
require 'res/php/Config.php';
|
|
||||||
|
|
||||||
use mmk2410\rbe\config\Config as Config;
|
|
||||||
|
|
||||||
echo 'RCC Initializion Script' . "\n";
|
|
||||||
$username = readline("Username: ");
|
|
||||||
|
|
||||||
if ($username == "") {
|
|
||||||
echo "No username given. Aborting...\n";
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
echo 'Password: ';
|
|
||||||
$password = readline("Password: ");
|
|
||||||
|
|
||||||
if ($password == "") {
|
|
||||||
echo "No password given. Aborting...\n";
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
$options = [
|
|
||||||
'cost' => 12
|
|
||||||
];
|
|
||||||
|
|
||||||
$password = password_hash($password, PASSWORD_BCRYPT, $options);
|
|
||||||
|
|
||||||
$username = '$username = "' . $username . '";';
|
|
||||||
$password = '$password = \'' . $password . '\';';
|
|
||||||
|
|
||||||
$file = '<?php' . "\n" . $username . "\n" . $password . "\n";
|
|
||||||
|
|
||||||
if (file_put_contents('./rcc/password.php', $file)) {
|
|
||||||
chmod('./rcc/password.php', 0640);
|
|
||||||
echo "\nPassword successfully saved.\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$config = new Config('config.yaml', 'vendor/autoload.php');
|
|
||||||
|
|
||||||
$yaml = $config->getConfig();
|
|
||||||
|
|
||||||
$rccOn = "";
|
|
||||||
|
|
||||||
while (!(in_array($rccOn, array("y", "Y", "n", "N")))) {
|
|
||||||
$rccOn = readline("Enable RCC: (y/n) ");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (in_array($rccOn, array("y", "Y"))) {
|
|
||||||
$yaml["rcc"]["rcc"] = "on";
|
|
||||||
} else {
|
|
||||||
$yaml["rcc"]["rcc"] = "off";
|
|
||||||
}
|
|
||||||
|
|
||||||
$apiOn = "";
|
|
||||||
|
|
||||||
while (!(in_array($apiOn, array("Y", "y", "n", "N")))) {
|
|
||||||
$apiOn = readline("Enable RCC API: (y/n) ");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (in_array($apiOn, array("y", "Y"))) {
|
|
||||||
$yaml["rcc"]["api"] = "on";
|
|
||||||
} else {
|
|
||||||
$yaml["rcc"]["api"] = "off";
|
|
||||||
}
|
|
||||||
|
|
||||||
$config = new Config('config.yaml', 'vendor/autoload.php');
|
|
||||||
|
|
||||||
if ($config->writeConfig($yaml)) {
|
|
||||||
echo "Changes saved.\n";
|
|
||||||
} else {
|
|
||||||
echo "Failed to save changes.\n";
|
|
||||||
}
|
|
|
@ -1,2 +0,0 @@
|
||||||
%TITLE: Docs
|
|
||||||
%URL: https://mmk2410.org/rangitaki/docs/
|
|
|
@ -2,8 +2,13 @@
|
||||||
|
|
||||||
This is the Blog of the Blog Engine **Rangitaki**
|
This is the Blog of the Blog Engine **Rangitaki**
|
||||||
|
|
||||||
Rangitaki is based on PHP and Markdown. It is easy to install and to configure.
|
Rangitaki is based on PHP, XML and Markdown. It is easy to install and to configure.
|
||||||
|
|
||||||
The latest version of Rangitaki is 1.4.3.
|
The latest Version of the 0.2 series is **0.2.2**
|
||||||
|
|
||||||
You can find the source code on [GitLab](https://gitlab.com/mmk2410/rangitaki).
|
The latest Version of the development stream isn' ready yet.
|
||||||
|
|
||||||
|
|
||||||
|
** !IMPORTANT! Please read [this](index.php?article=About-the-Future-of-pBlog) for more information about the different versions of pBlog.**
|
||||||
|
|
||||||
|
You can find the source code on [GitHub](https://github.com/mmk2410/Rangitaki).
|
|
@ -1,15 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Only install dependencies for Docker
|
|
||||||
[[ ! -e /.dockerenv ]] && [[ ! -e /.dockerinit ]] && exit 0
|
|
||||||
|
|
||||||
set -xe
|
|
||||||
|
|
||||||
# Install git
|
|
||||||
apt-get update -yqq
|
|
||||||
apt-get install git -yqq
|
|
||||||
|
|
||||||
# Install phpunit
|
|
||||||
curl -o /usr/local/bin/phpunit https://phar.phpunit.de/phpunit.phar
|
|
||||||
chmod +x /usr/local/bin/phpunit
|
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
"name": "mmk2410/rangitaki",
|
|
||||||
"description": "A simple PHP blogging engine without any database requirements",
|
|
||||||
"type": "project",
|
|
||||||
"require": {
|
|
||||||
"erusev/parsedown": "^1.6",
|
|
||||||
"fguillot/picofeed": "^0.1.18",
|
|
||||||
"slim/slim": "^3.0",
|
|
||||||
"symfony/yaml": "^3.0",
|
|
||||||
"codeguy/upload": "^1.3"
|
|
||||||
},
|
|
||||||
"license": "MIT License",
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Marcel Kapfer (mmk2410)",
|
|
||||||
"email": "marcelmichaelkapfer@yahoo.co.nz"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"minimum-stability": "stable"
|
|
||||||
}
|
|
496
composer.lock
generated
496
composer.lock
generated
|
@ -1,496 +0,0 @@
|
||||||
{
|
|
||||||
"_readme": [
|
|
||||||
"This file locks the dependencies of your project to a known state",
|
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
|
||||||
"This file is @generated automatically"
|
|
||||||
],
|
|
||||||
"content-hash": "ccdcfdb56ed68253e2388261fbb6d1b3",
|
|
||||||
"packages": [
|
|
||||||
{
|
|
||||||
"name": "codeguy/upload",
|
|
||||||
"version": "1.3.2",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/codeguy/Upload.git",
|
|
||||||
"reference": "6a9e5e1fb58d65346d0e557db2d46fb25efd3e37"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/codeguy/Upload/zipball/6a9e5e1fb58d65346d0e557db2d46fb25efd3e37",
|
|
||||||
"reference": "6a9e5e1fb58d65346d0e557db2d46fb25efd3e37",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"ext-fileinfo": "*",
|
|
||||||
"php": ">=5.3.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "3.7.*"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"psr-0": {
|
|
||||||
"Upload": "src"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Josh Lockhart",
|
|
||||||
"email": "info@joshlockhart.com",
|
|
||||||
"homepage": "http://www.joshlockhart.com/"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Handle file uploads with extensible validation and storage strategies",
|
|
||||||
"homepage": "http://github.com/codeguy/Upload",
|
|
||||||
"keywords": [
|
|
||||||
"file",
|
|
||||||
"upload",
|
|
||||||
"validation"
|
|
||||||
],
|
|
||||||
"time": "2013-07-07T17:01:41+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "container-interop/container-interop",
|
|
||||||
"version": "1.1.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/container-interop/container-interop.git",
|
|
||||||
"reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/container-interop/container-interop/zipball/fc08354828f8fd3245f77a66b9e23a6bca48297e",
|
|
||||||
"reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Interop\\Container\\": "src/Interop/Container/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"description": "Promoting the interoperability of container objects (DIC, SL, etc.)",
|
|
||||||
"time": "2014-12-30T15:22:37+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "erusev/parsedown",
|
|
||||||
"version": "1.6.1",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/erusev/parsedown.git",
|
|
||||||
"reference": "20ff8bbb57205368b4b42d094642a3e52dac85fb"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/erusev/parsedown/zipball/20ff8bbb57205368b4b42d094642a3e52dac85fb",
|
|
||||||
"reference": "20ff8bbb57205368b4b42d094642a3e52dac85fb",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.0"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"psr-0": {
|
|
||||||
"Parsedown": ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Emanuil Rusev",
|
|
||||||
"email": "hello@erusev.com",
|
|
||||||
"homepage": "http://erusev.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Parser for Markdown.",
|
|
||||||
"homepage": "http://parsedown.org",
|
|
||||||
"keywords": [
|
|
||||||
"markdown",
|
|
||||||
"parser"
|
|
||||||
],
|
|
||||||
"time": "2016-11-02T15:56:58+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fguillot/picofeed",
|
|
||||||
"version": "v0.1.28",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/fguillot/picoFeed.git",
|
|
||||||
"reference": "9da506c308bcb40b6fc630f9123466028c03170b"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/fguillot/picoFeed/zipball/9da506c308bcb40b6fc630f9123466028c03170b",
|
|
||||||
"reference": "9da506c308bcb40b6fc630f9123466028c03170b",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"ext-dom": "*",
|
|
||||||
"ext-iconv": "*",
|
|
||||||
"ext-libxml": "*",
|
|
||||||
"ext-simplexml": "*",
|
|
||||||
"ext-xml": "*",
|
|
||||||
"php": ">=5.3.0",
|
|
||||||
"zendframework/zendxml": "^1.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpdocumentor/reflection-docblock": "2.0.4",
|
|
||||||
"phpunit/phpunit": "4.8.26",
|
|
||||||
"symfony/yaml": "2.8.7"
|
|
||||||
},
|
|
||||||
"suggest": {
|
|
||||||
"ext-curl": "PicoFeed will use cURL if present"
|
|
||||||
},
|
|
||||||
"bin": [
|
|
||||||
"picofeed"
|
|
||||||
],
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"psr-0": {
|
|
||||||
"PicoFeed": "lib/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Frédéric Guillot"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Modern library to handle RSS/Atom feeds",
|
|
||||||
"homepage": "https://github.com/fguillot/picoFeed",
|
|
||||||
"time": "2016-12-29T00:06:41+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "nikic/fast-route",
|
|
||||||
"version": "v1.1.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/nikic/FastRoute.git",
|
|
||||||
"reference": "f3dcf5130e634b6123d40727d612ec6aa4f61fb3"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/nikic/FastRoute/zipball/f3dcf5130e634b6123d40727d612ec6aa4f61fb3",
|
|
||||||
"reference": "f3dcf5130e634b6123d40727d612ec6aa4f61fb3",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.4.0"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"FastRoute\\": "src/"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"src/functions.php"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"BSD-3-Clause"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Nikita Popov",
|
|
||||||
"email": "nikic@php.net"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Fast request router for PHP",
|
|
||||||
"keywords": [
|
|
||||||
"router",
|
|
||||||
"routing"
|
|
||||||
],
|
|
||||||
"time": "2016-10-20T17:36:47+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "pimple/pimple",
|
|
||||||
"version": "v3.0.2",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/silexphp/Pimple.git",
|
|
||||||
"reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/silexphp/Pimple/zipball/a30f7d6e57565a2e1a316e1baf2a483f788b258a",
|
|
||||||
"reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.0"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "3.0.x-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-0": {
|
|
||||||
"Pimple": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Fabien Potencier",
|
|
||||||
"email": "fabien@symfony.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Pimple, a simple Dependency Injection Container",
|
|
||||||
"homepage": "http://pimple.sensiolabs.org",
|
|
||||||
"keywords": [
|
|
||||||
"container",
|
|
||||||
"dependency injection"
|
|
||||||
],
|
|
||||||
"time": "2015-09-11T15:10:35+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "psr/http-message",
|
|
||||||
"version": "1.0.1",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/php-fig/http-message.git",
|
|
||||||
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
|
|
||||||
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.0"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "1.0.x-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Psr\\Http\\Message\\": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "PHP-FIG",
|
|
||||||
"homepage": "http://www.php-fig.org/"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Common interface for HTTP messages",
|
|
||||||
"homepage": "https://github.com/php-fig/http-message",
|
|
||||||
"keywords": [
|
|
||||||
"http",
|
|
||||||
"http-message",
|
|
||||||
"psr",
|
|
||||||
"psr-7",
|
|
||||||
"request",
|
|
||||||
"response"
|
|
||||||
],
|
|
||||||
"time": "2016-08-06T14:39:51+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "slim/slim",
|
|
||||||
"version": "3.7.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/slimphp/Slim.git",
|
|
||||||
"reference": "4254e40d81559e35cdf856bcbaca5f3af468b7ef"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/slimphp/Slim/zipball/4254e40d81559e35cdf856bcbaca5f3af468b7ef",
|
|
||||||
"reference": "4254e40d81559e35cdf856bcbaca5f3af468b7ef",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"container-interop/container-interop": "^1.1",
|
|
||||||
"nikic/fast-route": "^1.0",
|
|
||||||
"php": ">=5.5.0",
|
|
||||||
"pimple/pimple": "^3.0",
|
|
||||||
"psr/http-message": "^1.0"
|
|
||||||
},
|
|
||||||
"provide": {
|
|
||||||
"psr/http-message-implementation": "1.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "^4.0",
|
|
||||||
"squizlabs/php_codesniffer": "^2.5"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Slim\\": "Slim"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Rob Allen",
|
|
||||||
"email": "rob@akrabat.com",
|
|
||||||
"homepage": "http://akrabat.com"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Josh Lockhart",
|
|
||||||
"email": "hello@joshlockhart.com",
|
|
||||||
"homepage": "https://joshlockhart.com"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Gabriel Manricks",
|
|
||||||
"email": "gmanricks@me.com",
|
|
||||||
"homepage": "http://gabrielmanricks.com"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Andrew Smith",
|
|
||||||
"email": "a.smith@silentworks.co.uk",
|
|
||||||
"homepage": "http://silentworks.co.uk"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs",
|
|
||||||
"homepage": "https://slimframework.com",
|
|
||||||
"keywords": [
|
|
||||||
"api",
|
|
||||||
"framework",
|
|
||||||
"micro",
|
|
||||||
"router"
|
|
||||||
],
|
|
||||||
"time": "2016-12-20T20:30:47+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "symfony/yaml",
|
|
||||||
"version": "v3.2.1",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/symfony/yaml.git",
|
|
||||||
"reference": "a7095af4b97a0955f85c8989106c249fa649011f"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/symfony/yaml/zipball/a7095af4b97a0955f85c8989106c249fa649011f",
|
|
||||||
"reference": "a7095af4b97a0955f85c8989106c249fa649011f",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.5.9"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"symfony/console": "~2.8|~3.0"
|
|
||||||
},
|
|
||||||
"suggest": {
|
|
||||||
"symfony/console": "For validating YAML files using the lint command"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "3.2-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Symfony\\Component\\Yaml\\": ""
|
|
||||||
},
|
|
||||||
"exclude-from-classmap": [
|
|
||||||
"/Tests/"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Fabien Potencier",
|
|
||||||
"email": "fabien@symfony.com"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Symfony Community",
|
|
||||||
"homepage": "https://symfony.com/contributors"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Symfony Yaml Component",
|
|
||||||
"homepage": "https://symfony.com",
|
|
||||||
"time": "2016-12-10T10:07:06+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "zendframework/zendxml",
|
|
||||||
"version": "1.0.2",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/zendframework/ZendXml.git",
|
|
||||||
"reference": "7b64507bc35d841c9c5802d67f6f87ef8e1a58c9"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/zendframework/ZendXml/zipball/7b64507bc35d841c9c5802d67f6f87ef8e1a58c9",
|
|
||||||
"reference": "7b64507bc35d841c9c5802d67f6f87ef8e1a58c9",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": "^5.3.3 || ^7.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "^3.7 || ^4.0",
|
|
||||||
"squizlabs/php_codesniffer": "^1.5"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "1.0-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-0": {
|
|
||||||
"ZendXml\\": "library/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"BSD-3-Clause"
|
|
||||||
],
|
|
||||||
"description": "Utility library for XML usage, best practices, and security in PHP",
|
|
||||||
"homepage": "http://packages.zendframework.com/",
|
|
||||||
"keywords": [
|
|
||||||
"security",
|
|
||||||
"xml",
|
|
||||||
"zf2"
|
|
||||||
],
|
|
||||||
"time": "2016-02-04T21:02:08+00:00"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"packages-dev": [],
|
|
||||||
"aliases": [],
|
|
||||||
"minimum-stability": "stable",
|
|
||||||
"stability-flags": [],
|
|
||||||
"prefer-stable": false,
|
|
||||||
"prefer-lowest": false,
|
|
||||||
"platform": [],
|
|
||||||
"platform-dev": []
|
|
||||||
}
|
|
84
config.php
Normal file
84
config.php
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* PHP Version 5.6
|
||||||
|
*
|
||||||
|
* Rangitaki Project
|
||||||
|
* This is the configuration file. You can configure here all necessary
|
||||||
|
* (and possible) options without editing the index.php file.
|
||||||
|
* Every line has an description about what you can change here.
|
||||||
|
* Don't delete any strings. You can set your value after the '=' sign
|
||||||
|
* and between the apostrophes.
|
||||||
|
*
|
||||||
|
* Make sure that every line ends with an semicolon (';').
|
||||||
|
*
|
||||||
|
* @category Config
|
||||||
|
* @package Rbe
|
||||||
|
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
|
||||||
|
* @license MIT License
|
||||||
|
* @link http://marcel-kapfer.de/rangitaki
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Blog Title / Set here an individual title of yourblog by replacing
|
||||||
|
// Rangitaki Blog with it.
|
||||||
|
$blogtitle = 'Example Blog';
|
||||||
|
|
||||||
|
// Blog Author - Set here your name
|
||||||
|
$blogauthor = 'John';
|
||||||
|
|
||||||
|
// Blog description
|
||||||
|
$blogdescription = 'A short description of your blog';
|
||||||
|
|
||||||
|
// Home - set yes if you want to link to your homepage and no if not
|
||||||
|
$bloghome = 'yes';
|
||||||
|
|
||||||
|
// Home URL - Set here the url to your main page. Either as a path (e.g. '../')
|
||||||
|
// or as an url (e.g. 'http://github.com')
|
||||||
|
$bloghomeurl = '../';
|
||||||
|
|
||||||
|
// Home name - Set here an individual name for your main page
|
||||||
|
$bloghomename = 'Home';
|
||||||
|
|
||||||
|
// Main Blog name -> Set a specific name for your main blog
|
||||||
|
// This value is empty by default
|
||||||
|
$blogmainname = '';
|
||||||
|
|
||||||
|
// Intro - set yes if you have a blog intro and no if you don't have one
|
||||||
|
$blogintro = 'yes';
|
||||||
|
|
||||||
|
// Disqus - Provide here your Disqus shortname. Leave empty if you don't
|
||||||
|
// want to use it.
|
||||||
|
$blogdisqus = 'rangitaki';
|
||||||
|
|
||||||
|
// Share FAB - this enables or disables the share button
|
||||||
|
$sharefab = 'yes';
|
||||||
|
|
||||||
|
// Google Analytics - Provide here your Google Analytics Tracking-ID. Leave
|
||||||
|
// empty if you don't want to use it.
|
||||||
|
$bloganalytics = '';
|
||||||
|
|
||||||
|
// Footer - set here the text for your footer (e.g. a copyright info). You can
|
||||||
|
// replace the whole text after the '=' with your own one.
|
||||||
|
$blogfooter = 'Rangitaki ' . date("Y") .
|
||||||
|
' <a href="https://github.com/mmk2410/Rangitaki" target="blank">
|
||||||
|
github.com/mmk2410/Rangitaki</a>';
|
||||||
|
|
||||||
|
// This enables the optional rangitaki control center. Please read the
|
||||||
|
// documentation before you enable it.
|
||||||
|
$rcc = 'yes';
|
||||||
|
|
||||||
|
// Here you can disable and enable the navigation menu. Usefull if you have
|
||||||
|
// no subblogs and no home directory
|
||||||
|
$nav_drawer = 'yes';
|
||||||
|
|
||||||
|
// Set here the name of your theme. Read the documentation for more themes
|
||||||
|
$theme = 'material-light';
|
||||||
|
|
||||||
|
// Set here your language. The file must exist in the lang directory
|
||||||
|
$language = "en";
|
||||||
|
|
||||||
|
// pagination: how many articles should be on one page
|
||||||
|
// set to 0 to disable it
|
||||||
|
$pagination = 0;
|
||||||
|
|
||||||
|
// Favicon - Set here the path to your favicon
|
||||||
|
$favicon = "http://example.com/res/img/favicon.png";
|
27
config.yaml
27
config.yaml
|
@ -1,27 +0,0 @@
|
||||||
blog:
|
|
||||||
title: 'Example Blog'
|
|
||||||
author: John
|
|
||||||
description: 'A short description of your blog'
|
|
||||||
home: 'on'
|
|
||||||
homeurl: ../
|
|
||||||
homename: Home
|
|
||||||
mainname: ''
|
|
||||||
intro: 'on'
|
|
||||||
disqus: rangitaki
|
|
||||||
analytics: ''
|
|
||||||
footer: "Rangitaki 2016 <a href=\"https://gitlab.com/mmk2410/rangitaki\" target=\"blank\">\n gitlab.com/mmk2410/rangitaki</a>"
|
|
||||||
url: 'https://example.com/blog/'
|
|
||||||
design:
|
|
||||||
excerpt: "off"
|
|
||||||
fab: 'on'
|
|
||||||
drawer: 'on'
|
|
||||||
theme: material-light
|
|
||||||
pagination: 0
|
|
||||||
excerpt: 'off'
|
|
||||||
favicon: 'http://example.com/res/img/favicon.png'
|
|
||||||
rcc:
|
|
||||||
rcc: 'on'
|
|
||||||
api: 'on'
|
|
||||||
language: en
|
|
||||||
social:
|
|
||||||
twitter: ''
|
|
|
@ -1 +1,11 @@
|
||||||
(function(){var e;e=function(){return console.log("Welcome Developer! \nYou're seeing the output of a\nJavaScript extension for the Rangitaki blogging engine.")},$(document).ready(e())}).call(this);
|
/**
|
||||||
|
* Created by mmk2410 on 12/5/15.
|
||||||
|
*
|
||||||
|
* Example JavaScript file to demonstrate the rangitaki extension support
|
||||||
|
*/
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
console.log("Welcome Developer! \nYou're seeing the output of a javascript extension for the rangitaki blogging engine.")
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).ready(main());
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 63 KiB |
14
feed/.atom
14
feed/.atom
|
@ -1,14 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
|
||||||
<generator uri="https://github.com/fguillot/picoFeed">PicoFeed</generator>
|
|
||||||
<title>Example Blog</title>
|
|
||||||
<id>https://marcel-kapfer.de/rangitaki/blog/</id>
|
|
||||||
<updated>2016-02-16T10:52:47+00:00</updated>
|
|
||||||
<link rel="alternate" type="text/html" href="https://marcel-kapfer.de/rangitaki/blog/"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://marcel-kapfer.de/rangitaki/blog//feed/feed.atom"/>
|
|
||||||
<author>
|
|
||||||
<name>John</name>
|
|
||||||
<email></email>
|
|
||||||
<uri>https://marcel-kapfer.de/rangitaki/blog/</uri>
|
|
||||||
</author>
|
|
||||||
</feed>
|
|
|
@ -1,67 +0,0 @@
|
||||||
###
|
|
||||||
|
|
||||||
2015 - 2016 (c) by Marcel Kapfer (mmk2410)
|
|
||||||
|
|
||||||
Licensed under MIT License
|
|
||||||
|
|
||||||
Rangitaki Gulp File
|
|
||||||
|
|
||||||
###
|
|
||||||
|
|
||||||
gulp = require 'gulp'
|
|
||||||
sass = require 'gulp-sass'
|
|
||||||
sourcemaps = require 'gulp-sourcemaps'
|
|
||||||
minifyCss = require 'gulp-csso'
|
|
||||||
coffee = require 'gulp-coffee'
|
|
||||||
coffeelint = require 'gulp-coffeelint'
|
|
||||||
uglify = require 'gulp-uglify'
|
|
||||||
merge = require 'merge-stream'
|
|
||||||
del = require 'del'
|
|
||||||
size = require 'gulp-size'
|
|
||||||
|
|
||||||
gulp.task 'coffee', ->
|
|
||||||
main = gulp.src './src/coffee/*.coffee'
|
|
||||||
.pipe coffeelint()
|
|
||||||
.pipe coffeelint.reporter()
|
|
||||||
.pipe coffee()
|
|
||||||
.pipe uglify()
|
|
||||||
.pipe gulp.dest './res/js/'
|
|
||||||
|
|
||||||
extensions = gulp.src './src/coffee-extensions/*.coffee'
|
|
||||||
.pipe coffeelint()
|
|
||||||
.pipe coffeelint.reporter()
|
|
||||||
.pipe coffee()
|
|
||||||
.pipe uglify()
|
|
||||||
.pipe gulp.dest './extensions/'
|
|
||||||
|
|
||||||
merge(main, extensions)
|
|
||||||
.pipe size {title: 'Coffee'}
|
|
||||||
|
|
||||||
gulp.task 'sass', ->
|
|
||||||
main = gulp.src './src/sass/*.sass'
|
|
||||||
.pipe sourcemaps.init()
|
|
||||||
.pipe sass {
|
|
||||||
outputStyle: 'compressed'
|
|
||||||
}
|
|
||||||
.pipe sourcemaps.write './'
|
|
||||||
.pipe gulp.dest './res/css/'
|
|
||||||
|
|
||||||
theme = gulp.src './src/sass-themes/*.sass'
|
|
||||||
.pipe sourcemaps.init()
|
|
||||||
.pipe sass {
|
|
||||||
outputStyle: 'compressed'
|
|
||||||
}
|
|
||||||
.pipe sourcemaps.write './'
|
|
||||||
.pipe gulp.dest './themes/'
|
|
||||||
|
|
||||||
merge(theme, main)
|
|
||||||
.pipe size {title: 'SASS'}
|
|
||||||
|
|
||||||
gulp.task 'clean', del.bind null, ['res/css/no-nav.css', 'res/css/rangitaki.css', 'themes/', 'res/js/app.js']
|
|
||||||
|
|
||||||
gulp.task 'init', ['coffee', 'sass']
|
|
||||||
|
|
||||||
gulp.task 'default', ->
|
|
||||||
gulp.watch './src/**/*.sass', ['sass']
|
|
||||||
gulp.watch './src/**/*.coffee', ['coffee']
|
|
||||||
|
|
164
index.php
164
index.php
|
@ -1,11 +1,15 @@
|
||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<!--
|
<!--
|
||||||
Rangitaki Blogging Engine
|
Rangitaki Blogging Engine
|
||||||
Code: https://gitlab.com/mmk2410/rangitaki
|
GitHub: https://github.com/mmk2410/Rangitaki
|
||||||
Issus and Project Management: https://phab.mmk2410.org
|
|
||||||
Web: https://marcel-kapfer.de/rangitaki
|
Web: https://marcel-kapfer.de/rangitaki
|
||||||
2015 - 2016 Marcel Kapfer (mmk2410)
|
Twitter: @Rangitaki
|
||||||
License: MIT
|
Google+: +Rangitaki
|
||||||
|
-->
|
||||||
|
<!--
|
||||||
|
COPYRIGHT (c) 2015 mmk2410
|
||||||
|
|
||||||
|
MIT License
|
||||||
-->
|
-->
|
||||||
<html>
|
<html>
|
||||||
<?php
|
<?php
|
||||||
|
@ -22,22 +26,11 @@
|
||||||
*/
|
*/
|
||||||
// Getting necessary php files
|
// Getting necessary php files
|
||||||
date_default_timezone_set('UTC');
|
date_default_timezone_set('UTC');
|
||||||
require __DIR__ . '/vendor/autoload.php'; // loading composer libs
|
require 'config.php'; // Config file (this must be the first line)
|
||||||
|
require './lang/' . $language . ".php"; // Language file
|
||||||
require './res/php/Config.php';
|
require_once 'res/php/Parsedown.php'; // The soul of the beast: Parsedown
|
||||||
require_once './res/php/BlogListGenerator.php';
|
|
||||||
|
|
||||||
use mmk2410\rbe\config\Config as Config;
|
|
||||||
use mmk2410\rbe\BlogListGenerator\BlogListGenerator as BlogListGenerator;
|
|
||||||
|
|
||||||
$configParser = new Config('config.yaml', 'vendor/autoload.php');
|
|
||||||
|
|
||||||
$config = $configParser->getConfig();
|
|
||||||
|
|
||||||
require './lang/' . $config["language"] . ".php"; // Language file
|
|
||||||
require_once 'res/php/ArticleGenerator.php'; // The article generator
|
require_once 'res/php/ArticleGenerator.php'; // The article generator
|
||||||
|
require_once './res/php/BlogListGenerator.php'; // and the blog list generator
|
||||||
|
|
||||||
// Getting some variables ($_GET and $_SERVER)
|
// Getting some variables ($_GET and $_SERVER)
|
||||||
$getblog = filter_input(INPUT_GET, "blog"); // get the blog variable
|
$getblog = filter_input(INPUT_GET, "blog"); // get the blog variable
|
||||||
$getarticle = filter_input(INPUT_GET, "article"); // get the article variable
|
$getarticle = filter_input(INPUT_GET, "article"); // get the article variable
|
||||||
|
@ -47,16 +40,16 @@ $url = "http://" . filter_input(INPUT_SERVER, "HTTP_HOST") .
|
||||||
$pagenumber = filter_input(INPUT_GET, "page"); // get the pagenumber
|
$pagenumber = filter_input(INPUT_GET, "page"); // get the pagenumber
|
||||||
|
|
||||||
// Pagination algorithm
|
// Pagination algorithm
|
||||||
if ($config["design"]["pagination"] == 0) {
|
if ($pagination == 0) {
|
||||||
$config["design"]["pagination"] = false;
|
$pagination = false;
|
||||||
} else {
|
} else {
|
||||||
// pag_max: the newest post to show on a page
|
// pag_max: the newest post to show on a page
|
||||||
$pag_max = $config["design"]["pagination"] * ( $pagenumber + 1 );
|
$pag_max = $pagination * ( $pagenumber + 1 );
|
||||||
// pag_min: the oldest post to show on a page
|
// pag_min: the oldest post to show on a page
|
||||||
$pag_min = $pag_max - $config["design"]["pagination"];
|
$pag_min = $pag_max - $pagination;
|
||||||
if ($pagenumber > 0) {
|
if ($pagenumber > 0) {
|
||||||
// Disable the blog intro if not on first page
|
// Disable the blog intro if not on first page
|
||||||
$config["blog"]["intro"] = "off";
|
$blogintro = "no";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,10 +70,10 @@ if (isset($getarticle)) {
|
||||||
= ArticleGenerator::getTitle($articlesdir, $getarticle . '.md');
|
= ArticleGenerator::getTitle($articlesdir, $getarticle . '.md');
|
||||||
}
|
}
|
||||||
// Make sure that the entry has a title, because main.md hasn't one
|
// Make sure that the entry has a title, because main.md hasn't one
|
||||||
if (empty($config["blog"]["mainname"])) {
|
if (empty($blogmainname)) {
|
||||||
$blogmaintitle = $config["blog"]["title"];
|
$blogmaintitle = $blogtitle;
|
||||||
} else {
|
} else {
|
||||||
$blogmaintitle = $config["blog"]["mainname"];
|
$blogmaintitle = $blogmainname;
|
||||||
}
|
}
|
||||||
if (isset($getblog)) {
|
if (isset($getblog)) {
|
||||||
$subblogtitle = BlogListGenerator::getName('./blogs/' . $getblog . '.md');
|
$subblogtitle = BlogListGenerator::getName('./blogs/' . $getblog . '.md');
|
||||||
|
@ -93,20 +86,16 @@ if (isset($getarticle)) {
|
||||||
} else {
|
} else {
|
||||||
$hd_subblog_title = $subblogtitle;
|
$hd_subblog_title = $subblogtitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// url of the feed
|
|
||||||
$feedurl = $config["blog"]["url"] . "/feed/" . $blog . ".atom";
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title><?php echo $config["blog"]["title"] . " » " .$hd_subblog_title; ?></title>
|
<title><?php echo $hd_subblog_title; ?></title>
|
||||||
<!--Metatags-->
|
<!--Metatags-->
|
||||||
<meta name="author"
|
<meta name="author"
|
||||||
content="<?php echo $config["blog"]["author"]; // Set the blog author ?>"/>
|
content="<?php echo $blogauthor; // Set the blog author ?>"/>
|
||||||
<meta name="description"
|
<meta name="description"
|
||||||
content="<?php echo $config["blog"]["description"]; // the blog description ?>"/>
|
content="<?php echo $blogdescription; // the blog description ?>"/>
|
||||||
<!-- Meta tag for responsive ui-->
|
<!-- Meta tag for responsive ui-->
|
||||||
<meta name='viewport'
|
<meta name='viewport'
|
||||||
content='width=device-width, initial-scale=1.0,
|
content='width=device-width, initial-scale=1.0,
|
||||||
|
@ -115,35 +104,25 @@ $feedurl = $config["blog"]["url"] . "/feed/" . $blog . ".atom";
|
||||||
<meta property="og:title" content="<?php echo $hd_subblog_title; ?>"/>
|
<meta property="og:title" content="<?php echo $hd_subblog_title; ?>"/>
|
||||||
<meta property="og:type" content="website"/>
|
<meta property="og:type" content="website"/>
|
||||||
<meta property="og:url" content="<?php echo $url; ?>"/>
|
<meta property="og:url" content="<?php echo $url; ?>"/>
|
||||||
<meta property="og:image" content="<?php echo $config['design']['favicon']; ?>"/>
|
<meta property="og:image" content="<?php echo $favicon; ?>"/>
|
||||||
<meta property="og:description" content="<?php echo $config['blog']['description']; ?>"/>
|
<meta property="og:description" content="<?php echo $blogdescription; ?>"/>
|
||||||
|
<meta property="og:locale:alternate" content="<?php echo $lang; ?>"/>
|
||||||
<!-- Twitter meta tags -->
|
<!-- Twitter meta tags -->
|
||||||
<meta name="twitter:card" content="summary"/>
|
<meta name="twitter:card" content="summary"/>
|
||||||
<meta name="twitter:site" content="<?php echo $config['social']['twitter']; ?>"/>
|
<meta name="twitter:site" content="<?php echo $twitter; ?>"/>
|
||||||
<meta name="twitter:title" content="<?php echo $hd_subblog_title; ?>"/>
|
<meta name="twitter:title" content="<?php echo $hd_subblog_title; ?>"/>
|
||||||
<meta name="twitter:description" content="<?php echo $config['blog']['description']; ?>"/>
|
<meta name="twitter:description" content="<?php echo $blogdescription; ?>"/>
|
||||||
<meta name="twitter:image" content="<?php echo $config['design']['favicon']; ?>"/>
|
<meta name="twitter:image" content="<?php echo $favicon; ?>"/>
|
||||||
<meta name="twitter:url" content="<?php echo $url; ?>"/>
|
<meta name="twitter:url" content="<?php echo $url; ?>"/>
|
||||||
<!-- atom feed -->
|
|
||||||
<?php
|
|
||||||
if (file_exists("feed/" . $blog . ".atom")) {
|
|
||||||
?>
|
|
||||||
<link rel='alternate' type='application/atom+xml' title='Atom 0.3' href=
|
|
||||||
'<?php
|
|
||||||
echo $feedurl;
|
|
||||||
?>'>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<!--CSS files-->
|
<!--CSS files-->
|
||||||
<link rel="stylesheet" type="text/css" href="res/css/rangitaki.css"/>
|
<link rel="stylesheet" type="text/css" href="res/css/rangitaki.css"/>
|
||||||
<!-- stylesheet for code highlighting-->
|
<!-- stylesheet for code highlighting-->
|
||||||
<link rel="stylesheet" href="./res/css/github-gist.css">
|
<link rel="stylesheet" href="./res/css/github-gist.css">
|
||||||
<link rel="stylesheet" type="text/css"
|
<link rel="stylesheet" type="text/css"
|
||||||
href="themes/<?php echo $config['design']['theme']; // getting the theme stylesheet?>.css"/>
|
href="themes/<?php echo $theme; // getting the theme stylesheet?>.css"/>
|
||||||
<?php
|
<?php
|
||||||
// Checking if the drawer is enabled
|
// Checking if the drawer is enabled
|
||||||
if ($config["design"]["drawer"] != 'on') {
|
if ($nav_drawer == 'no') {
|
||||||
// Loading additional stylesheet for disabling the drawer?>
|
// Loading additional stylesheet for disabling the drawer?>
|
||||||
<link rel="stylesheet" type="text/css" href="res/css/no-nav.css"/>
|
<link rel="stylesheet" type="text/css" href="res/css/no-nav.css"/>
|
||||||
<?php
|
<?php
|
||||||
|
@ -154,8 +133,8 @@ $feedurl = $config["blog"]["url"] . "/feed/" . $blog . ".atom";
|
||||||
type='text/css'> <!--Font-->
|
type='text/css'> <!--Font-->
|
||||||
<!--Favicons-->
|
<!--Favicons-->
|
||||||
<link rel="shortcut icon" type="image/x-icon"
|
<link rel="shortcut icon" type="image/x-icon"
|
||||||
href="<?php echo $config['design']['favicon']; ?>"/>
|
href="<?php echo $favicon; ?>"/>
|
||||||
<link rel="apple-touch-icon-precomposed" href="<?php echo $config['design']['favicon']; ?>">
|
<link rel="apple-touch-icon-precomposed" href="<?php echo $favicon; ?>">
|
||||||
<!-- JavaScript Pt. 1: HightlightJS (get and load): Code highlighting-->
|
<!-- JavaScript Pt. 1: HightlightJS (get and load): Code highlighting-->
|
||||||
<script src="./res/js/highlight.pack.js"></script>
|
<script src="./res/js/highlight.pack.js"></script>
|
||||||
<script>hljs.initHighlightingOnLoad();</script>
|
<script>hljs.initHighlightingOnLoad();</script>
|
||||||
|
@ -164,7 +143,7 @@ $feedurl = $config["blog"]["url"] . "/feed/" . $blog . ".atom";
|
||||||
<body>
|
<body>
|
||||||
<?php
|
<?php
|
||||||
// Checking if the navigation drawer is enabled. If not -> skip it
|
// Checking if the navigation drawer is enabled. If not -> skip it
|
||||||
if ($config["design"]["drawer"] == "on") {
|
if ($nav_drawer == "yes") {
|
||||||
?>
|
?>
|
||||||
<!--
|
<!--
|
||||||
Darken the background when fading the drawer in. See also the JS file
|
Darken the background when fading the drawer in. See also the JS file
|
||||||
|
@ -185,8 +164,8 @@ if ($config["design"]["drawer"] == "on") {
|
||||||
echo "<section>";
|
echo "<section>";
|
||||||
// 1. Set localized string 2. Set blogtitle
|
// 1. Set localized string 2. Set blogtitle
|
||||||
echo "<div class='nav-item-static'>" .
|
echo "<div class='nav-item-static'>" .
|
||||||
$BLOGLANG['Blogs on'] . " " . $config["blog"]["title"] .
|
$BLOGLANG['Blogs on'] .
|
||||||
":</div>";
|
" $blogtitle:</div>";
|
||||||
// iterating through the blogs/ directory
|
// iterating through the blogs/ directory
|
||||||
foreach ($blogs as $navblog) {
|
foreach ($blogs as $navblog) {
|
||||||
// check if filename is larger than three chars and if the
|
// check if filename is larger than three chars and if the
|
||||||
|
@ -195,10 +174,8 @@ if ($config["design"]["drawer"] == "on") {
|
||||||
if ($getblog == "") { // Run when on main blog
|
if ($getblog == "") { // Run when on main blog
|
||||||
if ($navblog != "main.md") { // excluding main blog
|
if ($navblog != "main.md") { // excluding main blog
|
||||||
// creating navigation item
|
// creating navigation item
|
||||||
echo BlogListGenerator::listBlog(
|
BlogListGenerator::listBlog(
|
||||||
"./blogs/",
|
"./blogs/", $navblog, $blogtitle
|
||||||
$navblog,
|
|
||||||
$config["blog"]["title"]
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -206,10 +183,8 @@ if ($config["design"]["drawer"] == "on") {
|
||||||
// -> this blog will be excluded
|
// -> this blog will be excluded
|
||||||
if ($getblog . ".md" != $navblog) {
|
if ($getblog . ".md" != $navblog) {
|
||||||
// creating navigation item
|
// creating navigation item
|
||||||
echo BlogListGenerator::listBlog(
|
BlogListGenerator::listBlog(
|
||||||
"./blogs/",
|
"./blogs/", $navblog, $blogmaintitle
|
||||||
$navblog,
|
|
||||||
$blogmaintitle
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -220,24 +195,17 @@ if ($config["design"]["drawer"] == "on") {
|
||||||
// If viewing a blog or a tag
|
// If viewing a blog or a tag
|
||||||
?>
|
?>
|
||||||
<!-- Set a back item instead of the blogs. -->
|
<!-- Set a back item instead of the blogs. -->
|
||||||
<a class="nav-item" onclick="history.go(-1);">Go back</a>
|
<a class="nav-item" onclick="goBack()">Go back</a>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
if ($config["blog"]["home"] == "on") { // If a blog home is existend
|
if ($bloghome == "yes") { // If a blog home is existend
|
||||||
?>
|
?>
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
<a class="nav-item" href="<?php echo $config['blog']['homeurl']; ?>">
|
<a class="nav-item" href="<?php echo $bloghomeurl; ?>">
|
||||||
<?php echo $config['blog']['homename']; ?>
|
<?php echo $bloghomename; ?>
|
||||||
</a>
|
</a>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
if (file_exists("feed/" . $blog . ".atom")) { ?>
|
|
||||||
<div class="divider"></div>
|
|
||||||
<a class="nav-item" href=
|
|
||||||
'<?php
|
|
||||||
echo $feedurl;
|
|
||||||
?>'>Feed</a><?php
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
</div> <!-- End of the navigation drawer-->
|
</div> <!-- End of the navigation drawer-->
|
||||||
<?php
|
<?php
|
||||||
|
@ -254,13 +222,13 @@ if ($config["design"]["drawer"] == "on") {
|
||||||
<img src="./res/img/menu.svg" class="nav-img"/>
|
<img src="./res/img/menu.svg" class="nav-img"/>
|
||||||
<!-- Blog title with subblog title and links to each one-->
|
<!-- Blog title with subblog title and links to each one-->
|
||||||
<!-- link to main blog-->
|
<!-- link to main blog-->
|
||||||
<nobr><span class="title"><a href="./"><?php echo $config["blog"]["title"]; ?>
|
<nobr><span class="title"><a href="./"><?php echo $blogtitle; ?>
|
||||||
<?php
|
<?php
|
||||||
if (empty($getblog)) { // if not on a subblog
|
if (empty($getblog)) { // if not on a subblog
|
||||||
if (!empty($config['blog']['mainname'])) {
|
if (!empty($blogmainname)) {
|
||||||
// If you see a › (square) here : This is not a bug,
|
// If you see a › (square) here : This is not a bug,
|
||||||
// but a missing sign in your font
|
// but a missing sign in your font
|
||||||
echo "›" . $config['blog']['mainname'];
|
echo "›" . $blogmainname;
|
||||||
}
|
}
|
||||||
} else { // On subblog: set also a link to the subblog
|
} else { // On subblog: set also a link to the subblog
|
||||||
?>
|
?>
|
||||||
|
@ -284,7 +252,7 @@ if ($config["design"]["drawer"] == "on") {
|
||||||
// Blog Intro text
|
// Blog Intro text
|
||||||
if (file_exists("blogs/$blog.md")
|
if (file_exists("blogs/$blog.md")
|
||||||
&& $getarticle == ""
|
&& $getarticle == ""
|
||||||
&& $config["blog"]["intro"] == "on"
|
&& $blogintro == "yes"
|
||||||
&& $gettag == ""
|
&& $gettag == ""
|
||||||
) {
|
) {
|
||||||
// only shown if not in article or tag view
|
// only shown if not in article or tag view
|
||||||
|
@ -325,11 +293,7 @@ if ($config["design"]["drawer"] == "on") {
|
||||||
if (strlen($article) >= 3 && substr($article, -3) == ".md") {
|
if (strlen($article) >= 3 && substr($article, -3) == ".md") {
|
||||||
// generate the article
|
// generate the article
|
||||||
ArticleGenerator::newArticle(
|
ArticleGenerator::newArticle(
|
||||||
$articlesdir,
|
$articlesdir, $article, $getblog
|
||||||
$article,
|
|
||||||
$getblog,
|
|
||||||
$config["design"]["excerpt"],
|
|
||||||
$BLOGLANG["Read More"]
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -344,39 +308,27 @@ if ($config["design"]["drawer"] == "on") {
|
||||||
// check if the file is a article file
|
// check if the file is a article file
|
||||||
if (strlen($article) >= 3 && substr($article, -3) == ".md") {
|
if (strlen($article) >= 3 && substr($article, -3) == ".md") {
|
||||||
// generate the article
|
// generate the article
|
||||||
if ($config["design"]["pagination"]) {
|
if ($pagination) {
|
||||||
if ($posts_amount < $pag_max && $posts_amount >= $pag_min) {
|
if ($posts_amount < $pag_max && $posts_amount >= $pag_min) {
|
||||||
ArticleGenerator::newArticle(
|
ArticleGenerator::newArticle(
|
||||||
$articlesdir,
|
$articlesdir, $article, $getblog
|
||||||
$article,
|
|
||||||
$getblog,
|
|
||||||
$config["design"]["excerpt"],
|
|
||||||
$BLOGLANG["Read More"]
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ArticleGenerator::newArticle(
|
ArticleGenerator::newArticle(
|
||||||
$articlesdir,
|
$articlesdir, $article, $getblog
|
||||||
$article,
|
|
||||||
$getblog,
|
|
||||||
$config["design"]["excerpt"],
|
|
||||||
$BLOGLANG["Read More"]
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$posts_amount++;
|
$posts_amount++;
|
||||||
}
|
}
|
||||||
if ($config["design"]["pagination"]) {
|
if ($pagination) {
|
||||||
include './res/php/Pagination.php';
|
include './res/php/Pagination.php';
|
||||||
}
|
}
|
||||||
} elseif (isset($getarticle)) { // ARTICLE VIEW
|
} elseif (isset($getarticle)) { // ARTICLE VIEW
|
||||||
// generate the requested article
|
// generate the requested article
|
||||||
ArticleGenerator::newArticle(
|
ArticleGenerator::newArticle(
|
||||||
$articlesdir,
|
$articlesdir, $getarticle . ".md", $getblog
|
||||||
$getarticle . ".md",
|
|
||||||
$getblog,
|
|
||||||
'off',
|
|
||||||
$BLOGLANG["Read More"]
|
|
||||||
);
|
);
|
||||||
include './res/php/Disqus.php'; // include disques
|
include './res/php/Disqus.php'; // include disques
|
||||||
} else { // SOMETHING STRANGE: THIS SHOULDN'T HAPPEN
|
} else { // SOMETHING STRANGE: THIS SHOULDN'T HAPPEN
|
||||||
|
@ -384,16 +336,16 @@ if ($config["design"]["drawer"] == "on") {
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<?php echo $config["blog"]["footer"]; //print the blog footer?>
|
<?php echo $blogfooter; //print the blog footer?>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
// show the fab if it's enabled
|
// show the fab if it's enabled
|
||||||
if ($config["design"]["fab"] == "on") {
|
if ($sharefab == "yes") {
|
||||||
?>
|
?>
|
||||||
<div class="fabmenu">
|
<div class="fabmenu">
|
||||||
<div class="subfab"><!--Email subfab-->
|
<div class="subfab"><!--Email subfab-->
|
||||||
<a href='mailto:?subject=<?php
|
<a href='mailto:?subject=<?php
|
||||||
echo $config["blog"]["title"];
|
echo $blogtitle;
|
||||||
?>&body=<?php
|
?>&body=<?php
|
||||||
echo $BLOGLANG['Check out this blog'];
|
echo $BLOGLANG['Check out this blog'];
|
||||||
?>: <?php
|
?>: <?php
|
||||||
|
@ -422,7 +374,7 @@ if ($config["design"]["drawer"] == "on") {
|
||||||
<a href='https://www.facebook.com/sharer/sharer.php?u=<?php
|
<a href='https://www.facebook.com/sharer/sharer.php?u=<?php
|
||||||
echo $url;
|
echo $url;
|
||||||
?>&t=<?php
|
?>&t=<?php
|
||||||
echo "echo " . $config["blog"]["title"];
|
echo "echo $blogtitle"
|
||||||
?>' target="blank">
|
?>' target="blank">
|
||||||
<img src="./res/img/facebook.svg" class="subfab-img"/>
|
<img src="./res/img/facebook.svg" class="subfab-img"/>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -8,5 +8,4 @@ $BLOGLANG = [
|
||||||
"Check out" => "Schau dir das an:",
|
"Check out" => "Schau dir das an:",
|
||||||
"Next Page" => "Nächste Seite",
|
"Next Page" => "Nächste Seite",
|
||||||
"Previous Page" => "Vorherige Seite",
|
"Previous Page" => "Vorherige Seite",
|
||||||
"Read More" => "Weiterlesen",
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -8,5 +8,4 @@ $BLOGLANG = [
|
||||||
"Check out" => "Check out:",
|
"Check out" => "Check out:",
|
||||||
"Next Page" => "Next Page",
|
"Next Page" => "Next Page",
|
||||||
"Previous Page" => "Previous Page",
|
"Previous Page" => "Previous Page",
|
||||||
"Read More" => "Read More",
|
|
||||||
];
|
];
|
||||||
|
|
37
package.json
37
package.json
|
@ -1,37 +0,0 @@
|
||||||
{
|
|
||||||
"name": "rangitaki",
|
|
||||||
"version": "1.5.0",
|
|
||||||
"description": "A simple PHP blogging engine without any database dependencies",
|
|
||||||
"main": "index.php",
|
|
||||||
"scripts": {
|
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+ssh://git@gitlab.com/mmk2410/rangitaki.git"
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"blogging",
|
|
||||||
"php"
|
|
||||||
],
|
|
||||||
"author": "Marcel Kapfer (mmk2410)",
|
|
||||||
"license": "MIT",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://gitlab.com/mmk2410/rangitaki/issues"
|
|
||||||
},
|
|
||||||
"homepage": "https://gitlab.com/mmk2410/rangitaki#README",
|
|
||||||
"devDependencies": {
|
|
||||||
"coffee-script": "^1.10.0",
|
|
||||||
"del": "^2.2.0",
|
|
||||||
"gulp": "^3.9.1",
|
|
||||||
"gulp-coffee": "^2.3.2",
|
|
||||||
"gulp-coffeelint": "^0.6.0",
|
|
||||||
"gulp-csso": "^2.0.0",
|
|
||||||
"gulp-sass": "^2.3.1",
|
|
||||||
"gulp-size": "^2.1.0",
|
|
||||||
"gulp-sourcemaps": "^2.0.0-alpha",
|
|
||||||
"gulp-uglify": "^1.5.3",
|
|
||||||
"merge-stream": "^1.0.0",
|
|
||||||
"node-sass": "^3.7.0"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
<?php
|
|
||||||
// Marcel Kapfer (mmk2410)
|
|
||||||
// License: MIT License
|
|
||||||
// HTTP Basic Auth for the API
|
|
||||||
|
|
||||||
$basedir = "../../../";
|
|
||||||
|
|
||||||
require '../../ssl.php';
|
|
||||||
|
|
||||||
require '../../password.php';
|
|
||||||
|
|
||||||
if (!isset($_SERVER['PHP_AUTH_USER'])) {
|
|
||||||
header('WWW-Authenticate: Basic realm="RCC API"');
|
|
||||||
header('HTTP/1.1 401 Unauthorized');
|
|
||||||
echo "Access denied to the RCC API!";
|
|
||||||
exit;
|
|
||||||
} elseif ($_SERVER['PHP_AUTH_USER'] != $username ||
|
|
||||||
!password_verify($_SERVER['PHP_AUTH_PW'], $password)) {
|
|
||||||
header('HTTP/1.1 401 Unauthorized');
|
|
||||||
echo "Wrong credentials: Access denied!";
|
|
||||||
exit;
|
|
||||||
}
|
|
|
@ -1,59 +0,0 @@
|
||||||
<?php
|
|
||||||
// Marcel Kapfer (mmk2410)
|
|
||||||
// License: MIT License
|
|
||||||
// api for fetching various lists
|
|
||||||
|
|
||||||
use \Psr\Http\Message\ServerRequestInterface as Request;
|
|
||||||
use \Psr\Http\Message\ResponseInterface as Response;
|
|
||||||
|
|
||||||
require '../../../vendor/autoload.php';
|
|
||||||
require '../../../res/php/Config.php';
|
|
||||||
|
|
||||||
use \mmk2410\rbe\config\Config as Config;
|
|
||||||
|
|
||||||
$config = new Config("../../../config.yaml", '../../../vendor/autoload.php');
|
|
||||||
$settings = $config->getConfig();
|
|
||||||
|
|
||||||
include '../auth/auth.php';
|
|
||||||
|
|
||||||
if ($settings["rcc"]["api"] == "on" && $settings["rcc"]["rcc"] == "on") {
|
|
||||||
$app = new \Slim\App();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* api for get the list of blogs and if $_GET["blog"] is set the list of
|
|
||||||
* blogs posts in that blog
|
|
||||||
*
|
|
||||||
* @param string $_GET["blog"] optional name of the blog
|
|
||||||
*
|
|
||||||
* @return JSON json string containing the blogs / blog posts
|
|
||||||
*/
|
|
||||||
$app->get('/', function (Request $request, Response $response) {
|
|
||||||
$blog = $_GET["blog"];
|
|
||||||
|
|
||||||
|
|
||||||
if (!isset($blog)) {
|
|
||||||
$files = scandir('../../../blogs/', SCANDIR_SORT_DESCENDING);
|
|
||||||
|
|
||||||
unset($files[sizeof($files) - 1]);
|
|
||||||
unset($files[sizeof($files) - 1]);
|
|
||||||
|
|
||||||
$response = $response->withHeader('Content-type', 'application/json');
|
|
||||||
$response = $response->withJson($files, 201);
|
|
||||||
return $response;
|
|
||||||
}
|
|
||||||
|
|
||||||
$path = "../../../articles/" . $blog . "/";
|
|
||||||
|
|
||||||
$files = scandir($path, SCANDIR_SORT_DESCENDING);
|
|
||||||
|
|
||||||
unset($files[sizeof($files) - 1]);
|
|
||||||
unset($files[sizeof($files) - 1]);
|
|
||||||
|
|
||||||
$response = $response->withHeader('Content-type', 'application/json');
|
|
||||||
$response = $response->withJson($files, 201);
|
|
||||||
|
|
||||||
return $response;
|
|
||||||
});
|
|
||||||
|
|
||||||
$app->run();
|
|
||||||
}
|
|
|
@ -1,48 +0,0 @@
|
||||||
<?php
|
|
||||||
// Marcel Kapfer (mmk2410)
|
|
||||||
// License: MIT License
|
|
||||||
// api for uploading files
|
|
||||||
|
|
||||||
use \Psr\Http\Message\ServerRequestInterface as Request;
|
|
||||||
use \Psr\Http\Message\ResponseInterface as Response;
|
|
||||||
|
|
||||||
require '../../../vendor/autoload.php';
|
|
||||||
require '../../../res/php/Config.php';
|
|
||||||
require '../../../res/php/ArticleGenerator.php';
|
|
||||||
|
|
||||||
use \mmk2410\rbe\config\Config as Config;
|
|
||||||
|
|
||||||
$config = new Config("../../../config.yaml", '../../../vendor/autoload.php');
|
|
||||||
$settings = $config->getConfig();
|
|
||||||
|
|
||||||
include '../auth/auth.php';
|
|
||||||
|
|
||||||
if ($settings["rcc"]["api"] == "on" && $settings["rcc"]["rcc"] == "on") {
|
|
||||||
$app = new \Slim\App();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* api for uploading files
|
|
||||||
*
|
|
||||||
* @return JSON json string with status
|
|
||||||
*/
|
|
||||||
$app->post('/', function (Request $request, Response $response) {
|
|
||||||
$storage = new \Upload\Storage\FileSystem('../../../media/');
|
|
||||||
$file = new \Upload\File('file', $storage);
|
|
||||||
|
|
||||||
try {
|
|
||||||
$file->upload();
|
|
||||||
$data = array("code" => 201);
|
|
||||||
$response = $response->withHeader('Content-type', 'application/json');
|
|
||||||
$response = $response->withJson($data, 201);
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
$errors = $file->getErrors();
|
|
||||||
$data = array("code" => 500, "error" => $Errors);
|
|
||||||
$response = $response->withHeader('Content-type', 'application/json');
|
|
||||||
$response = $response->withJson($data, 500);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $response;
|
|
||||||
});
|
|
||||||
|
|
||||||
$app->run();
|
|
||||||
}
|
|
|
@ -1,141 +0,0 @@
|
||||||
<?php
|
|
||||||
// Marcel Kapfer (mmk2410)
|
|
||||||
// License: MIT License
|
|
||||||
// api for accessing blog posts
|
|
||||||
|
|
||||||
use \Psr\Http\Message\ServerRequestInterface as Request;
|
|
||||||
use \Psr\Http\Message\ResponseInterface as Response;
|
|
||||||
|
|
||||||
require '../../../vendor/autoload.php';
|
|
||||||
require '../../../res/php/Config.php';
|
|
||||||
require '../../../res/php/ArticleGenerator.php';
|
|
||||||
|
|
||||||
use \mmk2410\rbe\config\Config as Config;
|
|
||||||
|
|
||||||
$config = new Config("../../../config.yaml", '../../../vendor/autoload.php');
|
|
||||||
$settings = $config->getConfig();
|
|
||||||
|
|
||||||
include '../auth/auth.php';
|
|
||||||
|
|
||||||
if ($settings["rcc"]["api"] == "on" && $settings["rcc"]["rcc"] == "on") {
|
|
||||||
$app = new \Slim\App();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* api for fetching a blog post
|
|
||||||
*
|
|
||||||
* @param string $_GET["blog"] name of the blog
|
|
||||||
* @param string $_GET["post"] filename of the blog post
|
|
||||||
*
|
|
||||||
* @return JSON json string containing the blog post
|
|
||||||
*/
|
|
||||||
$app->get('/', function (Request $request, Response $response) {
|
|
||||||
$blog = $_GET["blog"];
|
|
||||||
$post = $_GET["post"];
|
|
||||||
|
|
||||||
if (!isset($blog) || !isset($post)) {
|
|
||||||
$data = array('code' => 400, 'status' => 'Bad Request', 'error' => 'Not enough arguments');
|
|
||||||
$response = $response->withHeader('Content-type', 'application/json');
|
|
||||||
$response = $response->withJson($data, 400);
|
|
||||||
return $response;
|
|
||||||
}
|
|
||||||
|
|
||||||
$path = "../../../articles/" . $blog . "/";
|
|
||||||
$data =
|
|
||||||
ArticleGenerator::getArray($path, $post);
|
|
||||||
|
|
||||||
$response = $response->withHeader('Content-type', 'application/json');
|
|
||||||
$response = $response->withJson($data, 201);
|
|
||||||
|
|
||||||
return $response;
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* api for changing/creating a blog post
|
|
||||||
*
|
|
||||||
* @param string $_POST["data"] all data
|
|
||||||
*/
|
|
||||||
$app->post('/', function (Request $request, Response $response) {
|
|
||||||
$blog = $_POST["blog"];
|
|
||||||
$post = $_POST["post"];
|
|
||||||
$title = $_POST["title"];
|
|
||||||
$author = $_POST["author"];
|
|
||||||
$date = $_POST["date"];
|
|
||||||
$tags = $_POST["tags"];
|
|
||||||
$text = $_POST["text"];
|
|
||||||
|
|
||||||
if (!isset($blog) || !isset($post) || (!isset($title) && !isset($text))) {
|
|
||||||
$data = array('code' => 400, 'status' => 'Bad Request', 'error' => 'Not enough arguments');
|
|
||||||
$response = $response->withHeader('Content-type', 'application/json');
|
|
||||||
$response = $response->withJson($data, 400);
|
|
||||||
return $response;
|
|
||||||
}
|
|
||||||
|
|
||||||
$text = str_replace('\n', '<br>', $text);
|
|
||||||
|
|
||||||
$md = <<<EOD
|
|
||||||
%TITLE: $title
|
|
||||||
%DATE: $date
|
|
||||||
%AUTHOR: $author
|
|
||||||
%TAGS: $tags
|
|
||||||
|
|
||||||
$text
|
|
||||||
EOD;
|
|
||||||
|
|
||||||
$path = "../../../articles/$blog/$post";
|
|
||||||
if (file_put_contents($path, $md)) {
|
|
||||||
$data = array('code' => 201, 'status' => 'Post created successfully');
|
|
||||||
$response = $response->withHeader('Content-type', 'application/json');
|
|
||||||
$response = $response->withJson($data, 201);
|
|
||||||
} else {
|
|
||||||
$data = array('code' => 500, 'status' => 'Internal server error');
|
|
||||||
$response = $response->withHeader('Content-type', 'application/json');
|
|
||||||
$response = $response->withJson($data, 500);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $response;
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* api for deleting a blog post
|
|
||||||
*
|
|
||||||
* @param string $_GET["blog"] name of the blog
|
|
||||||
* @param string $_GET["post"] filename of the blog post
|
|
||||||
*
|
|
||||||
* @return JSON json string containing the blog post
|
|
||||||
*/
|
|
||||||
$app->delete('/', function (Request $request, Response $response) {
|
|
||||||
$blog = $_GET["blog"];
|
|
||||||
$post = $_GET["post"];
|
|
||||||
|
|
||||||
if (!isset($blog) || !isset($post)) {
|
|
||||||
$data = array('code' => 400, 'status' => 'Bad Request', 'error' => 'Not enough arguments');
|
|
||||||
$response = $response->withHeader('Content-type', 'application/json');
|
|
||||||
$response = $response->withJson($data, 400);
|
|
||||||
return $response;
|
|
||||||
}
|
|
||||||
|
|
||||||
$path = "../../../articles/$blog/$post";
|
|
||||||
|
|
||||||
if (!file_exists($path)) {
|
|
||||||
$data = array('code' => 400, 'status' => 'Bad Request', 'error' => 'No such file');
|
|
||||||
$response = $response->withHeader('Content-type', 'application/json');
|
|
||||||
$response = $response->withJson($data, 400);
|
|
||||||
return $response;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!unlink($path)) {
|
|
||||||
$data = array('code' => 500, 'status' => 'Bad Request', 'error' => 'Internal server error');
|
|
||||||
$response = $response->withHeader('Content-type', 'application/json');
|
|
||||||
$response = $response->withJson($data, 500);
|
|
||||||
return $response;
|
|
||||||
}
|
|
||||||
|
|
||||||
$data = array('code' => 201, 'status' => 'File successfully deleted');
|
|
||||||
$response = $response->withHeader('Content-type', 'application/json');
|
|
||||||
$response = $response->withJson($data, 201);
|
|
||||||
|
|
||||||
return $response;
|
|
||||||
});
|
|
||||||
|
|
||||||
$app->run();
|
|
||||||
}
|
|
|
@ -1,63 +1,37 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* PHP Version 7
|
|
||||||
*
|
|
||||||
* @category Blogging
|
|
||||||
* @package Rcc
|
|
||||||
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
|
|
||||||
* @license MIT License
|
|
||||||
* @link https://mmk2410.org/rangitaki
|
|
||||||
*
|
|
||||||
* Edit page of RCC (Rangitaki Control Center)
|
|
||||||
*
|
|
||||||
* The MIT License
|
|
||||||
*
|
|
||||||
* Copyright 2015 mmk2410.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
date_default_timezone_set('UTC');
|
date_default_timezone_set('UTC');
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
<!--
|
||||||
|
The MIT License
|
||||||
|
|
||||||
|
Copyright 2015 mmk2410.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
-->
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
|
||||||
<title>Rangitaki Control Center</title>
|
<title>Rangitaki Control Center</title>
|
||||||
|
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/>
|
||||||
<meta name="robots" content="nofollow, noindex, noarchive, nosnippet">
|
|
||||||
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0,
|
|
||||||
user-scalable=0" name="viewport"/>
|
|
||||||
|
|
||||||
<meta name="theme-color" content="#383838">
|
|
||||||
<meta name="description" content="Rangitaki Control Center (RCC)">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../res/rcc.css"/>
|
<link rel="stylesheet" href="../res/rcc.css"/>
|
||||||
|
|
||||||
<link href='//fonts.googleapis.com/css?family=Roboto:400,500,700,300,
|
|
||||||
400italic,100,100italic,900' rel='stylesheet'
|
|
||||||
type='text/css'> <!--Font-->
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<a href="../" class="title">Rangitaki Control Center</a>
|
<a href="../" class="title">Rangitaki Control Center</a>
|
||||||
|
@ -66,102 +40,68 @@ date_default_timezone_set('UTC');
|
||||||
<?php
|
<?php
|
||||||
session_start();
|
session_start();
|
||||||
if ($_SESSION['login']) {
|
if ($_SESSION['login']) {
|
||||||
include_once "../../res/php/ArticleGenerator.php";
|
include_once("../../res/php/ArticleGenerator.php");
|
||||||
$directory = "./../../articles/" . $_GET['blog'] . "/";
|
$directory = "./../../articles/" . $_GET['blog'] . "/";
|
||||||
$article = $_GET['post'] . ".md";
|
$article = $_GET['post'] . ".md";
|
||||||
?>
|
?>
|
||||||
<!-- Edit Post -->
|
|
||||||
<section class="card">
|
<section class="card">
|
||||||
|
|
||||||
<div class="headline">Edit Post</div>
|
<div class="headline">Edit Post</div>
|
||||||
|
<p>Title:<br><br><input type="text" class="itextfield"
|
||||||
<p>Title:
|
value="<?php echo ArticleGenerator::getTitle($directory, $article) ?>"
|
||||||
<br><br>
|
name="title"
|
||||||
<input type="text" class="itextfield"
|
id="title"/>
|
||||||
value="<?php
|
|
||||||
echo ArticleGenerator::getTitle($directory, $article);
|
|
||||||
?>" name="title" id="title"/>
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>Date:
|
<p>Date:<br><br><input type="text" class="itextfield"
|
||||||
<br><br>
|
value="<?php echo ArticleGenerator::getDate($directory, $article) ?>" name="date"
|
||||||
<input type="text" class="itextfield"
|
id="date"/>
|
||||||
value="<?php
|
|
||||||
echo ArticleGenerator::getDate($directory, $article);
|
|
||||||
?>" name="date" id="date"/>
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>Author:
|
<p>Author:<br><br><input type="text"
|
||||||
<br><br>
|
value="<?php echo ArticleGenerator::getAuthor($directory, $article) ?>"
|
||||||
<input type="text" class="itextfield"
|
class="itextfield" name="author"
|
||||||
value="<?php
|
id="author"/></p>
|
||||||
echo ArticleGenerator::getAuthor($directory, $article);
|
|
||||||
?>" name="author" id="author"/>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>Tags:
|
<p>Tags:<br><br><input type="text"
|
||||||
<br><br>
|
|
||||||
<input type="text" class="itextfield"
|
|
||||||
value="<?php
|
value="<?php
|
||||||
$tags = "";
|
$tags = "";
|
||||||
foreach (
|
foreach (ArticleGenerator::getTags($directory, $article) as $tag) {
|
||||||
ArticleGenerator::getTags($directory, $article)
|
|
||||||
as $tag) {
|
|
||||||
$tags = $tags . ', ' . $tag;
|
$tags = $tags . ', ' . $tag;
|
||||||
}
|
}
|
||||||
$tags = substr($tags, 2);
|
$tags = substr($tags, 2);
|
||||||
echo $tags;
|
echo $tags;
|
||||||
?>" name="tags" id="tags"/>
|
?>"
|
||||||
</p>
|
class="itextfield" name="tags"
|
||||||
|
id="tags"/></p>
|
||||||
|
|
||||||
<p>Text:</p>
|
<p>Text:</p>
|
||||||
<textarea class="itextarea" name="text" id="text">
|
<textarea class="itextarea" name="text" id="text">
|
||||||
<?php
|
<?php echo ArticleGenerator::getText($directory, $article) ?>
|
||||||
echo ArticleGenerator::getText($directory, $article);
|
|
||||||
?>
|
|
||||||
</textarea>
|
</textarea>
|
||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
<a class="button" id="save_changes">SAVE CHANGES</a>
|
<a class="button" id="save_changes">SAVE CHANGES</a>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Go Back -->
|
|
||||||
<section class="card">
|
<section class="card">
|
||||||
|
|
||||||
<div class="headline">Back</div>
|
<div class="headline">Back</div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Go back to the RCC home. All changes will be lost.
|
Go back to the RCC home. All changes will be lost.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<a class="button" href="../">BACK</a>
|
<a class="button" href="../">BACK</a>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- Access denied -->
|
|
||||||
<section class="card">
|
<section class="card">
|
||||||
|
|
||||||
<div class="headline">Access denied</div>
|
<div class="headline">Access denied</div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The access to this area is not granted. Make sure you're logged
|
The access to this area is not granted. Make sure you're logged in.
|
||||||
in.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<a class="button" href="../">BACK</a>
|
<a class="button" href="../">BACK</a>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var getVariables = <?php echo json_encode($_GET); ?>;
|
var getVariables = <?php echo json_encode($_GET); ?>;
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,148 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* PHP Version 7
|
|
||||||
*
|
|
||||||
* @category Atom_Feed
|
|
||||||
* @package Rcc
|
|
||||||
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
|
|
||||||
* @license MIT License
|
|
||||||
* @link https://gitlab.com/mmk2410/rangitaki
|
|
||||||
*
|
|
||||||
* Feed Generator
|
|
||||||
*
|
|
||||||
* The MIT License
|
|
||||||
*
|
|
||||||
* Copyright 2015 - 2016 (c) mmk2410.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
date_default_timezone_set('UTC');
|
|
||||||
|
|
||||||
require "../../vendor/autoload.php";
|
|
||||||
require "../../res/php/Config.php";
|
|
||||||
require_once "../../res/php/ArticleGenerator.php";
|
|
||||||
use PicoFeed\Syndication\AtomFeedBuilder;
|
|
||||||
use PicoFeed\Syndication\AtomItemBuilder;
|
|
||||||
use \mmk2410\rbe\config\Config as Config;
|
|
||||||
|
|
||||||
$config = new Config('../../config.yaml', '../../vendor/autoload.php');
|
|
||||||
$settings = $config->getConfig();
|
|
||||||
|
|
||||||
include '../ssl.php';
|
|
||||||
|
|
||||||
session_start();
|
|
||||||
|
|
||||||
if ($_SESSION['login']) {
|
|
||||||
$art_dir = "./../../articles/" . $_GET['blog'] . "/";
|
|
||||||
$feed_path = "./../../feed/" . $_GET['blog'] . ".atom";
|
|
||||||
|
|
||||||
if ($_GET['blog'] == "main") {
|
|
||||||
$blogtitle = $settings['blog']['title'];
|
|
||||||
} else {
|
|
||||||
$blogtitl = $settings['blog']['title'] . " - " . ucwords($_GET['blog']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$feedBuilder = AtomFeedBuilder::create()
|
|
||||||
->withTitle($blogtitle)
|
|
||||||
->withAuthor($settings['blog']['author'])
|
|
||||||
->withFeedUrl($settings['blog']['url'] . "/feed/" . $_GET['blog'] . ".atom")
|
|
||||||
->withSiteUrl($settings['blog']['url'])
|
|
||||||
->withDate(new DateTime(date(DATE_ATOM)));
|
|
||||||
|
|
||||||
$articles = scandir($art_dir, 1);
|
|
||||||
|
|
||||||
$amount = 0;
|
|
||||||
|
|
||||||
foreach ($articles as $article) {
|
|
||||||
if (strlen($article) >= 3 && substr($article, -3) == ".md") {
|
|
||||||
if ($amount == 10) {
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
$file = ArticleGenerator::getText($art_dir, $article);
|
|
||||||
$text = Parsedown::instance()
|
|
||||||
->setBreaksEnabled(true)// with linebreaks
|
|
||||||
->text($file);
|
|
||||||
if (new DateTime(date(DATE_ATOM, strtotime($datestring))) != null) {
|
|
||||||
$date = new DateTime(
|
|
||||||
date(
|
|
||||||
DATE_ATOM,
|
|
||||||
strtotime($datestring)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
$date = new DateTime(date(DATE_ATOM));
|
|
||||||
}
|
|
||||||
$date = new DateTime(date(DATE_ATOM));
|
|
||||||
$feedBuilder
|
|
||||||
->withItem(AtomItemBuilder::create($feedBuilder)
|
|
||||||
->withTitle(
|
|
||||||
ArticleGenerator::getTitle($art_dir, $article)
|
|
||||||
)
|
|
||||||
->withUrl(
|
|
||||||
$settings['blog']['url'] . "./?article=" . substr($article, 0, strlen($article) - 3)
|
|
||||||
)
|
|
||||||
->withAuthor(
|
|
||||||
ArticleGenerator::getAuthor($art_dir, $article)
|
|
||||||
)
|
|
||||||
->withPublishedDate(
|
|
||||||
parseDate(ArticleGenerator::getDate($art_dir, $article))
|
|
||||||
)
|
|
||||||
->withUpdatedDate(
|
|
||||||
parseDate(ArticleGenerator::getDate($art_dir, $article))
|
|
||||||
)
|
|
||||||
->withSummary(
|
|
||||||
ArticleGenerator::getSummary($art_dir, $article)
|
|
||||||
)
|
|
||||||
->withContent($text));
|
|
||||||
$amount += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$feed = $feedBuilder->build();
|
|
||||||
|
|
||||||
$file = fopen($feed_path, "w");
|
|
||||||
|
|
||||||
if (fwrite($file, $feed) === false) {
|
|
||||||
echo "-1";
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
fclose($file);
|
|
||||||
|
|
||||||
echo "0";
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseDate($datestring)
|
|
||||||
{
|
|
||||||
$datetime = new DateTime(date(DATE_ATOM));
|
|
||||||
try {
|
|
||||||
$datetime = new DateTime(
|
|
||||||
date(
|
|
||||||
DATE_ATOM,
|
|
||||||
strtotime($datestring)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
} catch (Exception $e) {
|
|
||||||
$datetime = new DateTime(date(DATE_ATOM));
|
|
||||||
}
|
|
||||||
return $datetime;
|
|
||||||
}
|
|
215
rcc/index.php
215
rcc/index.php
|
@ -1,147 +1,87 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* PHP Version 7
|
|
||||||
*
|
|
||||||
* @category Blogging
|
|
||||||
* @package Rcc
|
|
||||||
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
|
|
||||||
* @license MIT License
|
|
||||||
* @link https://mmk2410.org/rangitaki
|
|
||||||
*
|
|
||||||
* Main page of RCC (Rangitaki Control Center)
|
|
||||||
*
|
|
||||||
* The MIT License
|
|
||||||
*
|
|
||||||
* Copyright 2015 mmk2410.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
require '../vendor/autoload.php';
|
|
||||||
require '../res/php/Config.php';
|
|
||||||
require "./../res/php/BlogListGenerator.php";
|
|
||||||
|
|
||||||
use \mmk2410\rbe\config\Config as Config;
|
|
||||||
use mmk2410\rbe\BlogListGenerator\BlogListGenerator as BlogListGenerator;
|
|
||||||
|
|
||||||
$config = new Config("../config.yaml", '../vendor/autoload.php');
|
|
||||||
$settings = $config->getConfig();
|
|
||||||
|
|
||||||
include './ssl.php';
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
<!--
|
||||||
|
The MIT License
|
||||||
|
|
||||||
|
Copyright 2015 mmk2410.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
-->
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
|
||||||
<title>Rangitaki Control Center</title>
|
<title>Rangitaki Control Center</title>
|
||||||
|
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport'/>
|
||||||
<meta name="robots" content="nofollow, noindex, noarchive, nosnippet">
|
|
||||||
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0,
|
|
||||||
user-scalable=0" name="viewport"/>
|
|
||||||
|
|
||||||
<meta name="theme-color" content="#383838">
|
|
||||||
<meta name="description" content="Rangitaki Control Center (RCC)">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="./res/rcc.css"/>
|
<link rel="stylesheet" href="./res/rcc.css"/>
|
||||||
|
|
||||||
<link href='//fonts.googleapis.com/css?family=Roboto:400,500,700,300,
|
|
||||||
400italic,100,100italic,900' rel='stylesheet'
|
|
||||||
type='text/css'> <!--Font-->
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<a href="./" class="title">Rangitaki Control Center</a>
|
<a href="./" class="title">Rangitaki Control Center</a>
|
||||||
<a href="../" class="back">Back to the blog</a>
|
<a href="../" class="back">Back to the blog</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<?php
|
<?php
|
||||||
$config = $settings;
|
require '../config.php';
|
||||||
|
if ($rcc == "yes") {
|
||||||
if ($config["rcc"]["rcc"] == "on") {
|
|
||||||
include 'password.php';
|
include 'password.php';
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
if (isset($_POST['passwd'])) {
|
if (isset($_POST['passwd'])) {
|
||||||
$passwd = $_POST['passwd'];
|
$passwd = $_POST['passwd'];
|
||||||
$_SESSION['passwd'] = $_POST['passwd'];
|
$_SESSION['passwd'] = $_POST['passwd'];
|
||||||
} else if (isset($_SESSION['passwd'])) {
|
} else if (isset($_SESSION['passwd'])) {
|
||||||
$passwd = $_SESSION['passwd'];
|
$passwd = $_SESSION['passwd'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($passwd == "") {
|
if ($passwd == "") {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- Login Card -->
|
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<div class="headline">Log In</div>
|
<div class="headline">Log In</div>
|
||||||
<form action="./" method="post">
|
<form action="./" method="post">
|
||||||
<p>Password:
|
<p>Password:<br><br><input type="password" class="itextfield" name="passwd"/></p>
|
||||||
<br><br>
|
|
||||||
<input type="password" class="itextfield" name="passwd"/>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<input type="Submit" class="button" value="Log in"/>
|
<input type="Submit" class="button" value="Log in"/>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
if (password_verify($passwd, $password)) {
|
if ($passwd == $password) {
|
||||||
$_SESSION['login'] = true;
|
$_SESSION['login'] = true;
|
||||||
|
include_once("./../res/php/BlogListGenerator.php");
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- Post Upload -->
|
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<div class="headline">Post Upload</div>
|
<div class="headline">Post Upload</div>
|
||||||
<form enctype="multipart/form-data" action="uploaded/"
|
<form enctype="multipart/form-data" action="uploaded/" method="POST">
|
||||||
method="POST">
|
|
||||||
|
|
||||||
<select name="blog">
|
<select name="blog">
|
||||||
<?php
|
<?php
|
||||||
$blogs = scandir("../blogs/");
|
$blogs = scandir("../blogs/");
|
||||||
foreach ($blogs as $blog) {
|
foreach ($blogs as $blog) {
|
||||||
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") {
|
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") {
|
||||||
if (BlogListGenerator::getExternalLink($blog, '../') == null) {
|
|
||||||
$blog = substr($blog, 0, -3);
|
$blog = substr($blog, 0, -3);
|
||||||
echo "<option value='$blog'>$blog</option>";
|
echo "<option value='$blog'>$blog</option>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<input type="hidden" name="MAX_FILE_SIZE" value="100000"/>
|
<input type="hidden" name="MAX_FILE_SIZE" value="100000"/>
|
||||||
<input id="" name="userfile" type="file" value="Choose a file"/>
|
<input id="" name="userfile" type="file" value="Choose a file"/>
|
||||||
<br><br>
|
<br>
|
||||||
|
<br>
|
||||||
<input id="button" type="submit" value="Upload" class="button"/>
|
<input id="button" type="submit" value="Upload" class="button"/>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- New Post -->
|
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<div class="headline">New Post</div>
|
<div class="headline">New Post</div>
|
||||||
<form action="newpost/" method="POST">
|
<form action="newpost/" method="POST">
|
||||||
|
@ -151,44 +91,27 @@ if ($config["rcc"]["rcc"] == "on") {
|
||||||
$blogs = scandir("../blogs/");
|
$blogs = scandir("../blogs/");
|
||||||
foreach ($blogs as $blog) {
|
foreach ($blogs as $blog) {
|
||||||
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") {
|
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") {
|
||||||
if (BlogListGenerator::getExternalLink($blog, '../') == null) {
|
|
||||||
$blog = substr($blog, 0, -3);
|
$blog = substr($blog, 0, -3);
|
||||||
echo "<option value='$blog'>$blog</option>";
|
echo "<option value='$blog'>$blog</option>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<p>Title:
|
<p>Title:<br><br><input type="text" class="itextfield" name="title"/></p>
|
||||||
<br><br>
|
|
||||||
<input type="text" class="itextfield" name="title"/>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>Date:
|
<p>Date:<br><br><input type="text" class="itextfield" name="date"/></p>
|
||||||
<br><br>
|
|
||||||
<input type="text" class="itextfield" name="date"/>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>Author:
|
<p>Author:<br><br><input type="text" class="itextfield" name="author"/></p>
|
||||||
<br><br>
|
|
||||||
<input type="text" class="itextfield" name="author"/>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>Tags:
|
<p>Tags:<br><br><input type="text" class="itextfield" name="tags"/></p>
|
||||||
<br><br>
|
|
||||||
<input type="text" class="itextfield" name="tags"/>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>Text:</p>
|
<p>Text:</p>
|
||||||
<textarea class="itextarea" name="text"></textarea>
|
<textarea class="itextarea" name="text"></textarea>
|
||||||
<br><br>
|
<br><br>
|
||||||
<input id="button" type="submit" value="Post"
|
<input id="button" type="submit" value="Post" class="button"/>
|
||||||
class="button"/>
|
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Edit post -->
|
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<div class="headline">Edit post</div>
|
<div class="headline">Edit post</div>
|
||||||
<p>
|
<p>
|
||||||
|
@ -201,19 +124,15 @@ if ($config["rcc"]["rcc"] == "on") {
|
||||||
$blogs = scandir("../blogs/");
|
$blogs = scandir("../blogs/");
|
||||||
foreach ($blogs as $blog) {
|
foreach ($blogs as $blog) {
|
||||||
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") {
|
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") {
|
||||||
if (BlogListGenerator::getExternalLink($blog, '../') == null) {
|
|
||||||
$blog = substr($blog, 0, -3);
|
$blog = substr($blog, 0, -3);
|
||||||
echo "<option value='$blog'>$blog</option>";
|
echo "<option value='$blog'>$blog</option>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
</p>
|
</p>
|
||||||
<a class="button" id="edit_get_posts">GET POSTS</a>
|
<a class="button" id="edit_get_posts">GET POSTS</a>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Delete Post -->
|
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<div class="headline">Delete Post</div>
|
<div class="headline">Delete Post</div>
|
||||||
<p>
|
<p>
|
||||||
|
@ -226,94 +145,55 @@ if ($config["rcc"]["rcc"] == "on") {
|
||||||
$blogs = scandir("../blogs/");
|
$blogs = scandir("../blogs/");
|
||||||
foreach ($blogs as $blog) {
|
foreach ($blogs as $blog) {
|
||||||
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") {
|
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") {
|
||||||
if (BlogListGenerator::getExternalLink($blog, '../') == null) {
|
|
||||||
$blog = substr($blog, 0, -3);
|
$blog = substr($blog, 0, -3);
|
||||||
echo "<option value='$blog'>$blog</option>";
|
echo "<option value='$blog'>$blog</option>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
</p>
|
</p>
|
||||||
<a class="button" id="delete_get_posts">GET POSTS</a>
|
<a class="button" id="delete_get_posts">GET POSTS</a>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Media Upload -->
|
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<div class="headline">Media Upload</div>
|
<div class="headline">Media Upload</div>
|
||||||
<form enctype="multipart/form-data" action="media/" method="POST">
|
<form enctype="multipart/form-data" action="media/" method="POST">
|
||||||
<input type="hidden" name="MAX_FILE_SIZE"
|
<input type="hidden" name="MAX_FILE_SIZE" value="100000000000"/>
|
||||||
value="100000000000"/>
|
|
||||||
<input id="" name="userfile" type="file" value="Choose a file"/>
|
<input id="" name="userfile" type="file" value="Choose a file"/>
|
||||||
<br><br>
|
<br>
|
||||||
|
<br>
|
||||||
<input id="button" type="submit" value="Upload" class="button"/>
|
<input id="button" type="submit" value="Upload" class="button"/>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Atom Feed Generator -->
|
|
||||||
<section class="card">
|
|
||||||
<div class="headline">Atom Feed Generator</div>
|
|
||||||
<p>
|
|
||||||
<select name="blog" id="generate_atom_blog">
|
|
||||||
<?php
|
|
||||||
$blogs = scandir("../blogs/");
|
|
||||||
foreach ($blogs as $blog) {
|
|
||||||
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") {
|
|
||||||
if (BlogListGenerator::getExternalLink($blog, '../') == null) {
|
|
||||||
$blog = substr($blog, 0, -3);
|
|
||||||
echo "<option value='$blog'>$blog</option>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</select>
|
|
||||||
</p>
|
|
||||||
<a class="button" id="generate_atom">GENERATE</a>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- Wrong Password -->
|
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<div class="headline">Wrong Password</div>
|
<div class="headline">Wrong Password</div>
|
||||||
<p>
|
<p>
|
||||||
The entered password was wrong, please try again.
|
Please go back and try again.
|
||||||
</p>
|
</p>
|
||||||
<form action="./" method="post">
|
<a href="./" class="button">GO BACK</a>
|
||||||
<p>Password:
|
|
||||||
<br><br>
|
|
||||||
<input type="password" class="itextfield" name="passwd"/>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<input type="Submit" class="button" value="Log in"/>
|
|
||||||
</form>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- Not enabled -->
|
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<div class="headline">Rangitaki Control Center</div>
|
<div class="headline">Rangitaki Control Center</div>
|
||||||
<p>
|
<p>
|
||||||
The Rangitaki Control Center is disabled. You can enable
|
The Rangitaki Control Center is disabled. You can enable it in your config file. But please read first
|
||||||
it in your config file. But please read first the
|
the documentation.
|
||||||
documentation.
|
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- Back -->
|
|
||||||
<section class="card" id="back-card">
|
<section class="card" id="back-card">
|
||||||
<div class="headline">Back</div>
|
<div class="headline">Back</div>
|
||||||
<p>Go back to your blog.</p>
|
<p>
|
||||||
|
Go back to your blog.
|
||||||
|
</p>
|
||||||
<a href="../" class="button">GO BACK</a>
|
<a href="../" class="button">GO BACK</a>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
@ -321,6 +201,5 @@ if ($config["rcc"]["rcc"] == "on") {
|
||||||
<script src="../res/js/jquery-2.1.4.min.js"></script>
|
<script src="../res/js/jquery-2.1.4.min.js"></script>
|
||||||
<script src="./res/delete.js"></script>
|
<script src="./res/delete.js"></script>
|
||||||
<script src="./res/edit.js"></script>
|
<script src="./res/edit.js"></script>
|
||||||
<script src="./res/atom.js"></script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,72 +1,43 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* PHP Version 7
|
|
||||||
*
|
|
||||||
* @category Blogging
|
|
||||||
* @package Rcc
|
|
||||||
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
|
|
||||||
* @license MIT License
|
|
||||||
* @link https://mmk2410.org/rangitaki
|
|
||||||
*
|
|
||||||
* Media page of RCC (Rangitaki Control Center)
|
|
||||||
*
|
|
||||||
* The MIT License
|
|
||||||
*
|
|
||||||
* Copyright 2015 mmk2410.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
?>
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
<!--
|
||||||
|
The MIT License
|
||||||
|
|
||||||
|
Copyright 2015 mmk2410.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
-->
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
|
||||||
<title>Rangitaki Control Center</title>
|
<title>Rangitaki Control Center</title>
|
||||||
|
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
|
||||||
<meta name="robots" content="nofollow, noindex, noarchive, nosnippet">
|
|
||||||
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0,
|
|
||||||
user-scalable=0" name="viewport"/>
|
|
||||||
|
|
||||||
<meta name="theme-color" content="#383838">
|
|
||||||
<meta name="description" content="Rangitaki Control Center (RCC)">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../res/rcc.css" />
|
<link rel="stylesheet" href="../res/rcc.css" />
|
||||||
|
|
||||||
<link href='//fonts.googleapis.com/css?family=Roboto:400,500,700,300,
|
|
||||||
400italic,100,100italic,900' rel='stylesheet'
|
|
||||||
type='text/css'> <!--Font-->
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<a href="../" class="title">Rangitaki Control Center</a>
|
<a href="../" class="title">Rangitaki Control Center</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
|
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<div class="headline">File Upload</div>
|
<div class="headline">File Upload</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
if($_SESSION['login']) {
|
if($_SESSION['login']) {
|
||||||
if ($_FILES['userfile']['name'] == "") {
|
if ($_FILES['userfile']['name'] == "") {
|
||||||
echo "<p>You have to choose a file!</p>";
|
echo "<p>You have to choose a file!</p>";
|
||||||
|
@ -75,25 +46,14 @@ if ($_SESSION['login']) {
|
||||||
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
|
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
|
||||||
|
|
||||||
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
|
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
|
||||||
echo
|
echo "<p>The post was successfully uploaded and is now published.</p>";
|
||||||
"<p>
|
|
||||||
The post was successfully uploaded and is now published.
|
|
||||||
</p>";
|
|
||||||
} else {
|
} else {
|
||||||
echo
|
echo "<p>During the uploading process an error occured! <br> Error Code:" . ($_FILES['userfile']['error'] . "</p>");
|
||||||
"<p>During the uploading process an error occured! <br>
|
|
||||||
Error Code:"
|
|
||||||
. ($_FILES['userfile']['error'] . "</p>");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
?><a href="../" class="button">GO BACK</a><?php
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<a href="../" class="button">GO BACK</a>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -1,74 +1,46 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* PHP Version 7
|
|
||||||
*
|
|
||||||
* @category Blogging
|
|
||||||
* @package Rcc
|
|
||||||
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
|
|
||||||
* @license MIT License
|
|
||||||
* @link https://mmk2410.org/rangitaki
|
|
||||||
*
|
|
||||||
* Newpost page of RCC (Rangitaki Control Center)
|
|
||||||
*
|
|
||||||
* The MIT License
|
|
||||||
*
|
|
||||||
* Copyright 2015 mmk2410.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
date_default_timezone_set('UTC');
|
date_default_timezone_set('UTC');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
<!--
|
||||||
|
The MIT License
|
||||||
|
|
||||||
|
Copyright 2015 mmk2410.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
-->
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
|
||||||
<title>Rangitaki Control Center</title>
|
<title>Rangitaki Control Center</title>
|
||||||
|
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/>
|
||||||
<meta name="robots" content="nofollow, noindex, noarchive, nosnippet">
|
|
||||||
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0,
|
|
||||||
user-scalable=0" name="viewport"/>
|
|
||||||
|
|
||||||
<meta name="theme-color" content="#383838">
|
|
||||||
<meta name="description" content="Rangitaki Control Center (RCC)">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../res/rcc.css"/>
|
<link rel="stylesheet" href="../res/rcc.css"/>
|
||||||
|
|
||||||
<link href='//fonts.googleapis.com/css?family=Roboto:400,500,700,300,
|
|
||||||
400italic,100,100italic,900' rel='stylesheet'
|
|
||||||
type='text/css'> <!--Font-->
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<a href="../" class="title">Rangitaki Control Center</a>
|
<a href="../" class="title">Rangitaki Control Center</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<div class="headline">New Post</div>
|
<div class="headline">New Post</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
if ($_SESSION['login']) {
|
if ($_SESSION['login']) {
|
||||||
$title = $_POST["title"];
|
$title = $_POST["title"];
|
||||||
$date = $_POST["date"];
|
$date = $_POST["date"];
|
||||||
|
@ -92,14 +64,9 @@ EOD;
|
||||||
} else {
|
} else {
|
||||||
echo "Some error happend, while publishing.";
|
echo "Some error happend, while publishing.";
|
||||||
}
|
}
|
||||||
?>
|
?><a href="../" class="button">GO BACK</a><?php
|
||||||
|
|
||||||
<a href="../" class="button">GO BACK</a>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<?php
|
<?php
|
||||||
$username = "test";
|
// Set here your RCC password
|
||||||
$password = '$2y$12$nHitKTwHqU4GmI3ADVE05eH/723fCNgdQ65kQ53FyZUVVB03BjfCO';
|
$password = "setyourpassword";
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
/**
|
|
||||||
* JavaScript for the ajax request to generate a atom feed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2016 by mmk2410
|
|
||||||
* License: MIT License
|
|
||||||
*/
|
|
||||||
|
|
||||||
function main() {
|
|
||||||
// listener and function for calling the ajax request to create the
|
|
||||||
// requested atom feed
|
|
||||||
$("#generate_atom").click(function () {
|
|
||||||
var selectedBlog = $("#generate_atom_blog").val();
|
|
||||||
$.get("feed/index.php", {
|
|
||||||
blog: selectedBlog
|
|
||||||
}, function (data) {
|
|
||||||
if (data == "0") {
|
|
||||||
alert("Atom feed sucessfully created.");
|
|
||||||
} else {
|
|
||||||
alert("Failed to create atom feed.");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).ready(main());
|
|
|
@ -1,45 +1,30 @@
|
||||||
/**
|
/**
|
||||||
* JavaScript for the ajax request to delete blog post
|
* Created by mmk2410 on 12/6/15.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016 by mmk2410
|
* JavaScript for the functionality to delete blogs
|
||||||
* License: MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
|
|
||||||
// listener and function for recieving the posts of the selected blogs
|
// listener and function for recieving the posts of the selected blogs
|
||||||
$("#delete_get_posts").click(function () {
|
$("#delete_get_posts").click(function () {
|
||||||
|
|
||||||
var selectedBlog = $("#delete_selected_blog").val();
|
var selectedBlog = $("#delete_selected_blog").val();
|
||||||
|
|
||||||
$.get("res/get_posts.php", {
|
$.get("res/get_posts.php", {
|
||||||
blog: selectedBlog
|
blog: selectedBlog
|
||||||
}, function (data) {
|
}, function (data) {
|
||||||
|
|
||||||
$("#delete_select_post").remove();
|
$("#delete_select_post").remove();
|
||||||
$("#delete_select_post_info").remove();
|
$("#delete_select_post_info").remove();
|
||||||
$("#delete_post_button").remove();
|
$("#delete_post_button").remove();
|
||||||
$("#delete_get_posts").after("<p id='delete_select_post'></p>");
|
$("#delete_get_posts").after("<p id='delete_select_post'></p>");
|
||||||
$("#delete_get_posts").after(
|
$("#delete_get_posts").after("<p id='delete_select_post_info'>Now select the post you want to delete. " +
|
||||||
"<p id='delete_select_post_info'>" +
|
"Remember that once a post is deleted it can't be restored.</p>");
|
||||||
"Now select the post you want to delete. " +
|
$("#delete_select_post").append("<select id='delete_selected_post'></select>");
|
||||||
"Remember that once a post is deleted it can't be restored.</p>"
|
|
||||||
);
|
|
||||||
$("#delete_select_post").append(
|
|
||||||
"<select id='delete_selected_post'></select>"
|
|
||||||
);
|
|
||||||
|
|
||||||
$.each($.parseJSON(data), function (index, value) {
|
$.each($.parseJSON(data), function (index, value) {
|
||||||
var post = value.substring(0, value.length - 3);
|
var post = value.substring(0, value.length - 3);
|
||||||
$("#delete_selected_post").append(
|
$("#delete_selected_post").append("<option value='" + post + "'>" + post + "</option>");
|
||||||
"<option value='" + post + "'>" + post + "</option>"
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
$("#delete_select_post").after("<a class='button' id='delete_post_button' " +
|
||||||
$("#delete_select_post").after(
|
"onclick='deletePostButton()'>DELETE POST</a>")
|
||||||
"<a class='button' id='delete_post_button' " +
|
|
||||||
"onclick='deletePostButton()'>DELETE POST</a>"
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -52,12 +37,10 @@ function deletePostButton() {
|
||||||
|
|
||||||
var selectedBlog = $("#delete_selected_blog").val();
|
var selectedBlog = $("#delete_selected_blog").val();
|
||||||
var selectedPost = $("#delete_selected_post").val();
|
var selectedPost = $("#delete_selected_post").val();
|
||||||
|
|
||||||
$.get("res/delete_post.php", {
|
$.get("res/delete_post.php", {
|
||||||
blog: selectedBlog,
|
blog: selectedBlog,
|
||||||
post: selectedPost
|
post: selectedPost
|
||||||
}, function (data) {
|
}, function (data) {
|
||||||
|
|
||||||
$("#delete_select_post").remove();
|
$("#delete_select_post").remove();
|
||||||
$("#delete_select_post_info").remove();
|
$("#delete_select_post_info").remove();
|
||||||
$("#delete_post_button").remove();
|
$("#delete_post_button").remove();
|
||||||
|
@ -68,10 +51,7 @@ function deletePostButton() {
|
||||||
} else if (data == "941") {
|
} else if (data == "941") {
|
||||||
alert("ERROR 941: No blog as get argument given");
|
alert("ERROR 941: No blog as get argument given");
|
||||||
} else if (data == "961") {
|
} else if (data == "961") {
|
||||||
alert(
|
alert("ERROR 961: Error while deleting the file. Check if the web server has the permission to do so.");
|
||||||
"ERROR 961: Error while deleting the file. Check if the" +
|
|
||||||
"web server has the permission to do so."
|
|
||||||
);
|
|
||||||
} else if (data == "0") {
|
} else if (data == "0") {
|
||||||
alert("Post successfully deleted.");
|
alert("Post successfully deleted.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,36 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* PHP Version 7
|
* User: mmk2410
|
||||||
*
|
* Date: 12/6/15
|
||||||
* @category Blogging
|
|
||||||
* @package Rcc
|
|
||||||
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
|
|
||||||
* @license MIT License
|
|
||||||
* @link https://mmk2410.org/rangitaki
|
|
||||||
*
|
|
||||||
* delete post script
|
|
||||||
*
|
|
||||||
* The MIT License
|
|
||||||
*
|
|
||||||
* Copyright 2015 mmk2410.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*
|
*
|
||||||
* Error Codes:
|
* Error Codes:
|
||||||
* 901 No post given as get argument
|
* 901 No post given as get argument
|
||||||
|
@ -38,12 +9,8 @@
|
||||||
* 941 No blog given as get argument
|
* 941 No blog given as get argument
|
||||||
* 961 Error while deleting the post
|
* 961 Error while deleting the post
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$post = $_GET["post"];
|
$post = $_GET["post"];
|
||||||
$blog = $_GET["blog"];
|
$blog = $_GET["blog"];
|
||||||
|
|
||||||
session_start();
|
|
||||||
if ($_SESSION['login']) {
|
|
||||||
if (!isset($post)) {
|
if (!isset($post)) {
|
||||||
echo "901";
|
echo "901";
|
||||||
} else if (!isset($blog)) {
|
} else if (!isset($blog)) {
|
||||||
|
@ -56,6 +23,3 @@ if ($_SESSION['login']) {
|
||||||
}
|
}
|
||||||
echo "961";
|
echo "961";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
|
@ -1,54 +1,41 @@
|
||||||
/**
|
/**
|
||||||
* JavaScript for the ajax request to edit a article
|
* Created by mmk2410 on 12/6/15.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016 by mmk2410
|
* JavaScript for the functionality to delete blogs
|
||||||
* License: MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
|
|
||||||
// listener and function for recieving the posts of the selected blogs
|
// listener and function for recieving the posts of the selected blogs
|
||||||
$("#edit_get_posts").click(function () {
|
$("#edit_get_posts").click(function () {
|
||||||
|
|
||||||
var selectedBlog = $("#edit_selected_blog").val();
|
var selectedBlog = $("#edit_selected_blog").val();
|
||||||
$.get("res/get_posts.php", {
|
$.get("res/get_posts.php", {
|
||||||
blog: selectedBlog
|
blog: selectedBlog
|
||||||
}, function (data) {
|
}, function (data) {
|
||||||
|
|
||||||
$("#edit_select_post").remove();
|
$("#edit_select_post").remove();
|
||||||
$("#edit_select_post_info").remove();
|
$("#edit_select_post_info").remove();
|
||||||
$("#edit_post_button").remove();
|
$("#edit_post_button").remove();
|
||||||
$("#edit_get_posts").after("<p id='edit_select_post'></p>");
|
$("#edit_get_posts").after("<p id='edit_select_post'></p>");
|
||||||
$("#edit_get_posts").after(
|
$("#edit_get_posts").after("<p id='edit_select_post_info'>Now select the post you want to edit.</p>");
|
||||||
"<p id='edit_select_post_info'>" +
|
$("#edit_select_post").append("<select id='edit_selected_post'></select>");
|
||||||
"Now select the post you want to edit.</p>"
|
|
||||||
);
|
|
||||||
$("#edit_select_post").append(
|
|
||||||
"<select id='edit_selected_post'></select>"
|
|
||||||
);
|
|
||||||
$.each($.parseJSON(data), function (index, value) {
|
$.each($.parseJSON(data), function (index, value) {
|
||||||
var post = value.substring(0, value.length - 3);
|
var post = value.substring(0, value.length - 3);
|
||||||
$("#edit_selected_post").append(
|
$("#edit_selected_post").append("<option value='" + post + "'>" + post + "</option>");
|
||||||
"<option value='" + post + "'>" + post + "</option>"
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
$("#edit_select_post").after(
|
$("#edit_select_post").after("<a class='button' id='edit_post_button' " +
|
||||||
"<a class='button' id='edit_post_button' " +
|
"onclick='editPostButton()'>EDIT POST</a>")
|
||||||
"onclick='editPostButton()'>EDIT POST</a>"
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#save_changes").click(function () {
|
$("#save_changes").click(function () {
|
||||||
|
|
||||||
var postTitle = $("#title").val();
|
var postTitle = $("#title").val();
|
||||||
var postDate = $("#date").val();
|
var postDate = $("#date").val();
|
||||||
var postAuthor = $("#author").val();
|
var postAuthor = $("#author").val();
|
||||||
var postTags = $("#tags").val();
|
var postTags = $("#tags").val();
|
||||||
var postText = $("#text").val();
|
var postText = $("#text").val();
|
||||||
|
|
||||||
var file = "../../articles/" + getVariables.blog +
|
var file = "../../articles/" + getVariables['blog'] + "/" + getVariables['post'] + ".md";
|
||||||
"/" + getVariables.post + ".md";
|
console.log(file);
|
||||||
|
|
||||||
$.post("../res/save.php", {
|
$.post("../res/save.php", {
|
||||||
title: postTitle,
|
title: postTitle,
|
||||||
|
|
|
@ -1,44 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* PHP Version 7
|
* User: mmk2410
|
||||||
*
|
* Date: 12/6/15
|
||||||
* @category Blogging
|
|
||||||
* @package Rcc
|
|
||||||
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
|
|
||||||
* @license MIT License
|
|
||||||
* @link https://mmk2410.org/rangitaki
|
|
||||||
*
|
|
||||||
* get post script
|
|
||||||
*
|
|
||||||
* The MIT License
|
|
||||||
*
|
|
||||||
* Copyright 2015 mmk2410.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*
|
*
|
||||||
* Error Codes:
|
* Error Codes:
|
||||||
* 901 No blog given as get argument
|
* 901 No blog given as get argument
|
||||||
* 921 No blog with the given name available
|
* 921 No blog with the given name available
|
||||||
*/
|
*/
|
||||||
|
|
||||||
session_start();
|
|
||||||
if ($_SESSION['login']) {
|
|
||||||
$blog = $_GET["blog"];
|
$blog = $_GET["blog"];
|
||||||
if (!isset($blog)) {
|
if (!isset($blog)) {
|
||||||
echo "901";
|
echo "901";
|
||||||
|
@ -55,4 +23,3 @@ if ($_SESSION['login']) {
|
||||||
}
|
}
|
||||||
print json_encode($posts);
|
print json_encode($posts);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,28 +1,29 @@
|
||||||
/*
|
/*
|
||||||
* RCC cascade style sheet
|
The MIT License
|
||||||
*
|
|
||||||
* Copyright (C) 2015-2016 Marcel Kapfer (mmk2410)
|
Copyright 2015 mmk2410.
|
||||||
* MIT License
|
|
||||||
*
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* The MIT License
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
*
|
in the Software without restriction, including without limitation the rights
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
* in the Software without restriction, including without limitation the rights
|
furnished to do so, subject to the following conditions:
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
The above copyright notice and this permission notice shall be included in
|
||||||
* furnished to do so, subject to the following conditions:
|
all copies or substantial portions of the Software.
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* all copies or substantial portions of the Software.
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
*
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
THE SOFTWARE.
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
*/
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
/*
|
||||||
* THE SOFTWARE.
|
Created on : Jun 14, 2015, 6:13:38 PM
|
||||||
|
Author : mmk2410
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* BODY */
|
/* BODY */
|
||||||
|
@ -37,19 +38,19 @@ body{
|
||||||
.main{
|
.main{
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-left: 0;
|
margin-left: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* HEADER */
|
/* HEADER */
|
||||||
.header{
|
.header{
|
||||||
background-color: #ff4415;
|
background-color: #ff4415;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0px;
|
||||||
right: 0;
|
right: 0px;
|
||||||
left: 0;
|
left: 0px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 64px;
|
height: 64px;
|
||||||
box-shadow: 2px 0 2px 2px rgba(62, 62, 62, 0.45);
|
box-shadow: 2px 0px 2px 2px rgba(62, 62, 62, 0.45);
|
||||||
}
|
}
|
||||||
|
|
||||||
.title{
|
.title{
|
||||||
|
@ -81,7 +82,7 @@ body{
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
box-shadow: 0 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
|
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
|
||||||
margin-bottom: 40px;
|
margin-bottom: 40px;
|
||||||
max-width: 1160px;
|
max-width: 1160px;
|
||||||
}
|
}
|
||||||
|
@ -144,9 +145,9 @@ body{
|
||||||
border-width: 1px;
|
border-width: 1px;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-color: #ff4415;
|
border-color: #ff4415;
|
||||||
-webkit-box-shadow: 0.4px 1px 1.5px 1px #aaa;
|
|
||||||
-moz-box-shadow: 0.4px 1px 1.5px 1px #aaa;
|
|
||||||
box-shadow: 0.4px 1px 1.5px 1px #aaa;
|
box-shadow: 0.4px 1px 1.5px 1px #aaa;
|
||||||
|
-moz-box-shadow: 0.4px 1px 1.5px 1px #aaa;
|
||||||
|
-webkit-box-shadow: 0.4px 1px 1.5px 1px #aaa;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
|
@ -157,10 +158,6 @@ body{
|
||||||
transition-delay: 50ms;
|
transition-delay: 50ms;
|
||||||
transition-duration: 125ms;
|
transition-duration: 125ms;
|
||||||
transition-timing-function: ease;
|
transition-timing-function: ease;
|
||||||
-o-transition-property: box-shadow;
|
|
||||||
-o-transition-delay: 50ms;
|
|
||||||
-o-transition-duration: 125ms;
|
|
||||||
-o-transition-timing-function: ease;
|
|
||||||
-moz-transition-property: box-shadow;
|
-moz-transition-property: box-shadow;
|
||||||
-moz-transition-delay: 50ms;
|
-moz-transition-delay: 50ms;
|
||||||
-moz-transition-duration: 125ms;
|
-moz-transition-duration: 125ms;
|
||||||
|
@ -173,13 +170,12 @@ body{
|
||||||
}
|
}
|
||||||
|
|
||||||
.button:hover, .button:hover {
|
.button:hover, .button:hover {
|
||||||
-webkit-box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa;
|
|
||||||
-moz-box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa;
|
|
||||||
box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa;
|
box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa;
|
||||||
}
|
-moz-box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa;
|
||||||
|
-webkit-box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa; }
|
||||||
|
|
||||||
input.button{
|
input.button{
|
||||||
padding: 0 8px;
|
padding: 0px 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* INPUT FIELD */
|
/* INPUT FIELD */
|
||||||
|
@ -196,10 +192,6 @@ input.button{
|
||||||
transition-delay: 50ms;
|
transition-delay: 50ms;
|
||||||
transition-duration: 125ms;
|
transition-duration: 125ms;
|
||||||
transition-timing-function: ease;
|
transition-timing-function: ease;
|
||||||
-o-transition-property: border-bottom-color;
|
|
||||||
-o-transition-delay: 50ms;
|
|
||||||
-o-transition-duration: 125ms;
|
|
||||||
-o-transition-timing-function: ease;
|
|
||||||
-moz-transition-property: border-bottom-color;
|
-moz-transition-property: border-bottom-color;
|
||||||
-moz-transition-delay: 50ms;
|
-moz-transition-delay: 50ms;
|
||||||
-moz-transition-duration: 125ms;
|
-moz-transition-duration: 125ms;
|
||||||
|
@ -232,10 +224,6 @@ input.button{
|
||||||
transition-delay: 50ms;
|
transition-delay: 50ms;
|
||||||
transition-duration: 125ms;
|
transition-duration: 125ms;
|
||||||
transition-timing-function: ease;
|
transition-timing-function: ease;
|
||||||
-o-transition-property: border-bottom-color;
|
|
||||||
-o-transition-delay: 50ms;
|
|
||||||
-o-transition-duration: 125ms;
|
|
||||||
-o-transition-timing-function: ease;
|
|
||||||
-moz-transition-property: border-bottom-color;
|
-moz-transition-property: border-bottom-color;
|
||||||
-moz-transition-delay: 50ms;
|
-moz-transition-delay: 50ms;
|
||||||
-moz-transition-duration: 125ms;
|
-moz-transition-duration: 125ms;
|
||||||
|
|
|
@ -1,32 +1,20 @@
|
||||||
/**
|
|
||||||
* JavaScript for RCC
|
|
||||||
*
|
|
||||||
* Copyright (c) 2016 by mmk2410
|
|
||||||
* License: MIT License
|
|
||||||
*/
|
|
||||||
|
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
var t = document.getElementsByTagName('textarea')[0];
|
var t = document.getElementsByTagName('textarea')[0];
|
||||||
var offset = !window.opera ? (t.offsetHeight - t.clientHeight) : (
|
var offset = !window.opera ? (t.offsetHeight - t.clientHeight) : (t.offsetHeight + parseInt(window.getComputedStyle(t, null).getPropertyValue('border-top-width')));
|
||||||
t.offsetHeight + parseInt(
|
|
||||||
window.getComputedStyle(t, null).getPropertyValue('border-top-width')
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The following three code clocks are for proper resizing of the input
|
* The following three code clocks are for proper resizing of the input textarea
|
||||||
* textarea
|
|
||||||
*/
|
*/
|
||||||
var resize = function (t) {
|
var resize = function (t) {
|
||||||
t.style.height = 'auto';
|
t.style.height = 'auto';
|
||||||
t.style.height = (t.scrollHeight + offset ) + 'px';
|
t.style.height = (t.scrollHeight + offset ) + 'px';
|
||||||
};
|
}
|
||||||
|
|
||||||
t.addEventListener && t.addEventListener('input', function (event) {
|
t.addEventListener && t.addEventListener('input', function (event) {
|
||||||
resize(t);
|
resize(t);
|
||||||
});
|
});
|
||||||
|
|
||||||
t.attachEvent && t.attachEvent('onkeyup', function () {
|
t['attachEvent'] && t.attachEvent('onkeyup', function () {
|
||||||
resize(t);
|
resize(t);
|
||||||
});
|
});
|
||||||
};
|
}
|
|
@ -1,39 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* PHP Version 7
|
|
||||||
*
|
|
||||||
* @category Blogging
|
|
||||||
* @package Rcc
|
|
||||||
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
|
|
||||||
* @license MIT License
|
|
||||||
* @link https://mmk2410.org/rangitaki
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* The MIT License
|
|
||||||
*
|
|
||||||
* Copyright 2015 mmk2410.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
session_start();
|
|
||||||
if ($_SESSION['login']) {
|
|
||||||
$title = $_POST["title"];
|
$title = $_POST["title"];
|
||||||
$date = $_POST["date"];
|
$date = $_POST["date"];
|
||||||
$author = $_POST["author"];
|
$author = $_POST["author"];
|
||||||
|
@ -55,4 +20,3 @@ EOD;
|
||||||
} else {
|
} else {
|
||||||
echo -1;
|
echo -1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
11
rcc/ssl.php
11
rcc/ssl.php
|
@ -1,11 +0,0 @@
|
||||||
<?php
|
|
||||||
// Marcel Kapfer (mmk2410) / Wilson O'Sullivan
|
|
||||||
// License: MIT License
|
|
||||||
// SSL Verification
|
|
||||||
|
|
||||||
if (isset($settings["rcc"]["debug"]) && $settings["rcc"]["debug"] != "on") {
|
|
||||||
if (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on") {
|
|
||||||
header('HTTP/1.1 400 Bad Request');
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,75 +1,44 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* PHP Version 7
|
|
||||||
*
|
|
||||||
* @category Blogging
|
|
||||||
* @package Rcc
|
|
||||||
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
|
|
||||||
* @license MIT License
|
|
||||||
* @link https://mmk2410.org/rangitaki
|
|
||||||
*
|
|
||||||
* Main page of RCC (Rangitaki Control Center)
|
|
||||||
*
|
|
||||||
* The MIT License
|
|
||||||
*
|
|
||||||
* Copyright 2015 mmk2410.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
?>
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
<!--
|
||||||
|
The MIT License
|
||||||
|
|
||||||
|
Copyright 2015 mmk2410.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
-->
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
|
||||||
<title>Rangitaki Control Center</title>
|
<title>Rangitaki Control Center</title>
|
||||||
|
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
|
||||||
<meta name="robots" content="nofollow, noindex, noarchive, nosnippet">
|
<link rel="stylesheet" href="../res/rcc.css" />
|
||||||
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0,
|
|
||||||
user-scalable=0" name="viewport"/>
|
|
||||||
|
|
||||||
<meta name="theme-color" content="#383838">
|
|
||||||
<meta name="description" content="Rangitaki Control Center (RCC)">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="./res/rcc.css"/>
|
|
||||||
|
|
||||||
<link href='//fonts.googleapis.com/css?family=Roboto:400,500,700,300,
|
|
||||||
400italic,100,100italic,900' rel='stylesheet'
|
|
||||||
type='text/css'> <!--Font-->
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<a href="../" class="title">Rangitaki Control Center</a>
|
<a href="../" class="title">Rangitaki Control Center</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<div class="headline">File Upload</div>
|
<div class="headline">File Upload</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
if($_SESSION['login']) {
|
if($_SESSION['login']) {
|
||||||
|
|
||||||
if ($_FILES['userfile']['name'] == "") {
|
if ($_FILES['userfile']['name'] == "") {
|
||||||
echo "<p>You have to choose a file!</p>";
|
echo "<p>You have to choose a file!</p>";
|
||||||
} else {
|
} else {
|
||||||
|
@ -78,24 +47,14 @@ if ($_SESSION['login']) {
|
||||||
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
|
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
|
||||||
|
|
||||||
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
|
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
|
||||||
echo
|
echo "<p>The post was successfully uploaded and is now published.</p>";
|
||||||
"<p>The post was successfully uploaded and is now
|
|
||||||
published.</p>";
|
|
||||||
} else {
|
} else {
|
||||||
echo
|
echo "<p>During the uploading process an error occured! <br> Error Code:" . ($_FILES['userfile']['error'] . "</p>");
|
||||||
"<p>During the uploading process an error occured! <br>
|
|
||||||
Error Code:"
|
|
||||||
. ($_FILES['userfile']['error'] . "</p>");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
?><a href="../" class="button">GO BACK</a><?php
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<a href="../" class="button">GO BACK</a>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -1,3 +1,57 @@
|
||||||
.nav{display:none}.nav-img{display:none}@media screen and (min-width: 1440px){.header{left:0}.main{margin-left:0;width:100%}}@media screen and (max-width: 720px){.title{left:25px}}
|
/*
|
||||||
|
Rangitaki Project
|
||||||
|
|
||||||
/*# sourceMappingURL=no-nav.css.map */
|
The MIT License
|
||||||
|
|
||||||
|
Copyright 2015 mmk2410.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
Created on : Jun 18, 2015, 7:07:45 PM
|
||||||
|
Author : mmk2410
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
A stylesheet for overriding the default styles if the navigation drawer is disabled
|
||||||
|
*/
|
||||||
|
|
||||||
|
.nav{ /* hide the navigation drawer */
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-img{ /* hide the hamburger icon */
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 1440px) { /* large devices */
|
||||||
|
.header { /* full width */
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main{ /* full width */
|
||||||
|
margin-left: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 720px){ /* small devices */
|
||||||
|
.title{ /* move the title more to the left */
|
||||||
|
left: 25px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
{"version":3,"file":"no-nav.css","sources":["no-nav.sass"],"sourcesContent":["/*\n * Rangitaki Project\n *\n * The MIT License\n *\n * Copyright 2015 mmk2410.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * A stylesheet for overriding the default styles if the navigation drawer is disabled\n */\n\n.nav {\n display: none; }\n\n.nav-img {\n display: none; }\n\n@media screen and (min-width: 1440px) {\n .header {\n left: 0; }\n\n .main {\n margin-left: 0;\n width: 100%; } }\n\n@media screen and (max-width: 720px) {\n\n .title {\n left: 25px; } }\n"],"mappings":"AA4BA,AAAA,IAAI,AAAC,CACD,OAAO,CAAE,IAAK,CAAG,AAErB,AAAA,QAAQ,AAAC,CACL,OAAO,CAAE,IAAK,CAAG,AAErB,MAAM,CAAN,MAAM,MAAM,SAAS,EAAE,MAAM,EACzB,AAAA,OAAO,AAAC,CACJ,IAAI,CAAE,CAAE,CAAG,AAEf,AAAA,KAAK,AAAC,CACF,WAAW,CAAE,CAAE,CACf,KAAK,CAAE,IAAK,CAAG,CAEvB,MAAM,CAAN,MAAM,MAAM,SAAS,EAAE,KAAK,EAExB,AAAA,MAAM,AAAC,CACH,IAAI,CAAE,IAAK,CAAG","names":[]}
|
|
|
@ -1,3 +1,305 @@
|
||||||
body{margin-top:94px}.main{height:100%;margin-left:0}.overlay{opacity:0;position:fixed;top:0;left:0;background-color:black;width:100%;z-index:30;height:100%;display:none}.header{top:0;right:0;left:0;width:100%;height:64px;position:absolute}.title{color:#fff;font-size:23px;text-decoration:none;line-height:64px;vertical-align:middle;left:75px}.title>a{text-decoration:none;color:#fff}.fadeout{position:absolute;height:64px;top:0;right:0;width:40px}.nav-img{height:26px;padding:19px;cursor:pointer}.nav{width:300px;position:fixed;height:100%;top:0;left:-301px;z-index:40}.nav-item,.nav-item-static{text-decoration:none;text-indent:0;display:inline-block;height:48px;vertical-align:middle;width:284px;line-height:48px;padding-left:16px;transition:background-color 125ms ease-in-out 0ms}.nav-close{cursor:pointer}.nav-close-img{height:35px;padding:12px}.nav-item{cursor:pointer}.divider{width:100%}.card{margin-right:auto;margin-left:auto;width:75%;padding:24px;margin-bottom:40px;max-width:1160px}.card a{-moz-hyphens:auto;-epub-hyphens:auto;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;word-wrap:break-word}.headline{display:block;padding-bottom:8px}.card img{max-width:100%;max-height:400px;display:block;margin-left:auto;margin-right:auto}.author{display:block}.readmore{padding:12px 0 25px 0}.fabmenu{position:fixed;bottom:20px;right:20px}.fab{height:60px;width:60px;border-radius:30px;cursor:pointer}.fab-img{width:28px;padding:15px}.subfab{height:45px;width:45px;border-radius:30px;margin-right:auto;margin-left:auto;margin-bottom:25px;display:none}.subfab-img{width:22px;padding:12px}.pag_buttons{margin-right:auto;margin-left:auto;width:calc(75% + 48px);margin-bottom:80px;max-width:1160px;text-align:right}.button{text-decoration:none;color:#fff;line-height:36px;min-width:64px;text-align:center;height:36px;padding:8px;margin-top:4px;margin-bottom:5px;cursor:pointer}.pag_next{margin-left:8px}.footer a{transition:border-bottom-color 150ms ease-in-out 100ms}.footer a:hover{border-bottom-color:#383838}@media screen and (min-width: 1440px){.nav{left:0;padding-top:64px}.nav-close-img{display:none}.nav-close{display:none}.nav-img{display:none}.header{left:300px}.main{margin-left:300px;width:calc(100% - 300px)}}@media screen and (max-width: 720px){.card{width:82%}.pag_buttons{width:calc(82% + 48px)}}
|
/*
|
||||||
|
Rangitaki Project
|
||||||
|
|
||||||
/*# sourceMappingURL=rangitaki.css.map */
|
The MIT License
|
||||||
|
|
||||||
|
Copyright 2015 mmk2410.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
Created on : Jun 14, 2015, 6:13:38 PM
|
||||||
|
Author : mmk2410
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* BODY */
|
||||||
|
|
||||||
|
body{
|
||||||
|
margin-top: 94px; /* Set enough space for the header */
|
||||||
|
}
|
||||||
|
|
||||||
|
.main{ /* main content */
|
||||||
|
height: 100%;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.overlay { /* overlay: used for a darker background when the navigation drawer is open */
|
||||||
|
opacity: 0;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
background-color: black;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 30;
|
||||||
|
height: 100%;
|
||||||
|
display: none; /* because the thing is hidden at the beginning and shown with js */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* HEADER */
|
||||||
|
.header{
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 64px;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title{ /* title in the header */
|
||||||
|
color: #fff;
|
||||||
|
font-size: 23px;
|
||||||
|
text-decoration: none;
|
||||||
|
line-height: 64px;
|
||||||
|
vertical-align: middle;
|
||||||
|
left: 75px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title > a{ /* and a a styling */
|
||||||
|
text-decoration: none;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fadeout{ /* a fadeout if the title is to long */
|
||||||
|
position: absolute;
|
||||||
|
height: 64px;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
width: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-img{ /* the hamburger icon */
|
||||||
|
height: 26px;
|
||||||
|
padding: 19px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* NAV DRAWER */
|
||||||
|
|
||||||
|
.nav{ /* the main object */
|
||||||
|
width: 300px;
|
||||||
|
position: fixed;
|
||||||
|
height: 100%;
|
||||||
|
top: 0;
|
||||||
|
left: -301px;
|
||||||
|
z-index: 40;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item, .nav-item-static{ /* a nav-item */
|
||||||
|
text-decoration: none;
|
||||||
|
text-indent: 0;
|
||||||
|
display: inline-block;
|
||||||
|
height: 48px;
|
||||||
|
vertical-align: middle;
|
||||||
|
width: 284px;
|
||||||
|
line-height: 48px;
|
||||||
|
padding-left: 16px;
|
||||||
|
transition: background-color 125ms ease-in-out 0ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-close {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-close-img{ /* the hamburger icon */
|
||||||
|
height: 35px;
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item{ /* additional setting for clickable nav items */
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.divider{ /* a simple divider with all options. better than <hr> */
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* MAIN */
|
||||||
|
|
||||||
|
.card{ /* just a card */
|
||||||
|
margin-right: auto;
|
||||||
|
margin-left: auto;
|
||||||
|
width: 75%;
|
||||||
|
padding: 24px;
|
||||||
|
margin-bottom: 40px;
|
||||||
|
max-width: 1160px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card a{ /* and another a styling */
|
||||||
|
-moz-hyphens: auto;
|
||||||
|
-epub-hyphens: auto;
|
||||||
|
-ms-hyphens: auto;
|
||||||
|
-webkit-hyphens: auto;
|
||||||
|
hyphens: auto;
|
||||||
|
word-wrap: break-word; /* until here: break long links */
|
||||||
|
}
|
||||||
|
|
||||||
|
.card a:hover{ /* hovered card links; just here to help you create a own theme*/
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.headline{ /* title in a card */
|
||||||
|
display: block;
|
||||||
|
padding-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.card img{ /* image in a card*/
|
||||||
|
max-width: 100%; /* regulate width */
|
||||||
|
max-height: 400px; /* regulate height */
|
||||||
|
display: block; /* centered */
|
||||||
|
margin-left: auto; /* centerd */
|
||||||
|
margin-right: auto; /* centred */
|
||||||
|
}
|
||||||
|
|
||||||
|
.date{ /* possibility to style the date */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.articletext{ /* posibitlity to style the text */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.author{ /* styling for the author */
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag{ /* possibility to style the text */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* FAB */
|
||||||
|
|
||||||
|
.fabmenu{ /* surrounds the complete fab menu */
|
||||||
|
position: fixed;
|
||||||
|
bottom: 20px;
|
||||||
|
right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fab{ /* the main fab (always visible if enabled) */
|
||||||
|
height: 60px;
|
||||||
|
width: 60px;
|
||||||
|
border-radius: 30px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fab-img{ /* fab image for the main fab */
|
||||||
|
width: 28px;
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subfab{ /* a smaller fab in the fab menu */
|
||||||
|
height: 45px;
|
||||||
|
width: 45px;
|
||||||
|
border-radius: 30px;
|
||||||
|
margin-right: auto;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subfab-img{ /* and the image for it */
|
||||||
|
width: 22px;
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* BUTTON */
|
||||||
|
|
||||||
|
.pag_buttons {
|
||||||
|
margin-right: auto;
|
||||||
|
margin-left: auto;
|
||||||
|
width: calc(75% + 48px);
|
||||||
|
margin-bottom: 80px;
|
||||||
|
max-width: 1160px;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
text-decoration: none;
|
||||||
|
color: #fff;
|
||||||
|
line-height: 36px;
|
||||||
|
min-width: 64px;
|
||||||
|
text-align: center;
|
||||||
|
height: 36px;
|
||||||
|
padding: 8px;
|
||||||
|
margin-top: 4px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pag_next{
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* FOOTER */
|
||||||
|
|
||||||
|
.footer{ /* possibility for styling the footer */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.footer a{ /* styling of the footer a */
|
||||||
|
transition: border-bottom-color 150ms ease-in-out 100ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer a:hover{ /* and the hovered one*/
|
||||||
|
border-bottom-color: #383838;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 1440px) { /* make it responsive: large devices */
|
||||||
|
|
||||||
|
.nav{ /* always show navigation bar */
|
||||||
|
left: 0;
|
||||||
|
padding-top: 64px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-close-img {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-close {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-img{ /* always hide navigation bar icon*/
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header{ /* move header to the right */
|
||||||
|
left: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main{ /* move main content to the right and limit its width */
|
||||||
|
margin-left: 300px;
|
||||||
|
width: calc(100% - 300px);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@media screen and (max-width: 720px){ /* make it responsive: small devices */
|
||||||
|
|
||||||
|
.card{ /* wider cards */
|
||||||
|
width: 82%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pag_buttons {
|
||||||
|
width: calc(82% + 48px);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
113
res/js/app.js
113
res/js/app.js
|
@ -1 +1,112 @@
|
||||||
(function(){var n,t,a,e,r;e=function(){var e,i;return e=!1,$(".fabmenu").click(function(){return e?(a(),e=!1):(t(),e=!0)}),i=!1,$(".nav-img, .overlay, .nav-close").click(function(){return i?(n(),i=!1):(r(),i=!0)}),$(document).keyup(function(t){return i&&27===t.which?(n(),i=!1):i||77!==t.which?void 0:(r(),i=!0)}),$(".articletext a").attr("target","_blank")},$(document).ready(e),t=function(){return $(".subfab").fadeIn(125),$(".fab-img").fadeOut(60,function(){return $(".fab-img").attr("src","./res/img/close.svg"),$(".fab-img").fadeIn(60)})},a=function(){return $(".subfab").fadeOut(125),$(".fab-img").fadeOut(60,function(){return $(".fab-img").attr("src","./res/img/share.svg"),$(".fab-img").fadeIn(60)})},r=function(){return $(".nav").animate({left:"0px"},125),$(".overlay").show(),$(".overlay").animate({opacity:"0.4"},125)},n=function(){return $(".nav").animate({left:"-301px"},125),$(".overlay").animate({opacity:"0.0"},125,function(){return $(".overlay").css({display:"none"})})}}).call(this);
|
/*
|
||||||
|
* Rangitaki Project
|
||||||
|
*
|
||||||
|
* The MIT License
|
||||||
|
*
|
||||||
|
* Copyright 2015 mmk2410.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var main = function () { // main function; called below
|
||||||
|
|
||||||
|
var fabActive = false; // fab hidden at begin
|
||||||
|
$('.fabmenu').click( // action on fab click
|
||||||
|
function () {
|
||||||
|
if (!(fabActive)) { // if fab is hidden
|
||||||
|
fabFadeIn(); // fade fab in
|
||||||
|
fabActive = true; // fab = active
|
||||||
|
} else { // if fab is shown
|
||||||
|
fabFadeOut(); // fade fab out
|
||||||
|
fabActive = false; // fab = hidden
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
var navOpen = false; // nav hidden at begin
|
||||||
|
$('.nav-img, .overlay, .nav-close').click( // action on hamburger click
|
||||||
|
function () {
|
||||||
|
if (!(navOpen)) { // if nav is hidden
|
||||||
|
openNav(); // open the nav drawer
|
||||||
|
navOpen = true; // nav = open
|
||||||
|
} else { // if nav is closed
|
||||||
|
closeNav(); // close the nav drawer
|
||||||
|
navOpen = false; // nav = closed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Keyhandling for the navigation drawer.
|
||||||
|
* opens the drawer on 'm' (key code: 77)
|
||||||
|
* closes the drawer on 'Esc' (key code: 27)
|
||||||
|
*/
|
||||||
|
$(document).keyup(function (e) {
|
||||||
|
if (navOpen && (e.which === 27)) {
|
||||||
|
closeNav();
|
||||||
|
navOpen = false;
|
||||||
|
} else if (!(navOpen) && (e.which === 77)) {
|
||||||
|
openNav();
|
||||||
|
navOpen = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
$(document).ready(main); // run if document is loaded
|
||||||
|
|
||||||
|
function goBack() { // go back function
|
||||||
|
history.go(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function fabFadeIn() { // fade fab in
|
||||||
|
$('.subfab').fadeIn(125); // fade subfabs in
|
||||||
|
$('.fab-img').fadeOut( // fade fab share image out
|
||||||
|
60, function callback() {
|
||||||
|
$('.fab-img').attr("src", "./res/img/close.svg"); // change to fab close image
|
||||||
|
}
|
||||||
|
);
|
||||||
|
$('.fab-img').fadeIn(60); // fade fab close image in
|
||||||
|
}
|
||||||
|
|
||||||
|
function fabFadeOut() { // fade fab out
|
||||||
|
$('.subfab').fadeOut(125); // fade subfabs out
|
||||||
|
$('.fab-img').fadeOut( // fade fab close image out
|
||||||
|
60, function callback() {
|
||||||
|
$('.fab-img').attr("src", "./res/img/share.svg"); // change to fab share image
|
||||||
|
}
|
||||||
|
);
|
||||||
|
$('.fab-img').fadeIn(60); // fade fab share image in
|
||||||
|
}
|
||||||
|
|
||||||
|
function openNav() { // fade navigation drawer in
|
||||||
|
$('.nav').animate({"left": "0px"}, 125); // slide in
|
||||||
|
$('.overlay').show(); // set overlay to show ...
|
||||||
|
$('.overlay').animate({"opacity": "0.4"}, 125); // ... and fade to a darker transparent color
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeNav() { // fade navigation drawer out
|
||||||
|
$('.nav').animate({"left": "-301px"}, 125); // slide out
|
||||||
|
$('.overlay').animate(
|
||||||
|
{"opacity": "0.0"}, 125, function () { // fade the overlay to complete transparency
|
||||||
|
$('.overlay').hide(); // hide it then
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
@ -1,15 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/*
|
||||||
* PHP Version 7
|
|
||||||
*
|
|
||||||
* Since there is no initialize function, I recommend to use the short access syntay
|
|
||||||
*
|
|
||||||
* @category Articles
|
|
||||||
* @package RangitakiPHP
|
|
||||||
* @author mmk2410 <marcelmichaelkapfer@yahoo.co.nz>
|
|
||||||
* @license MIT License
|
|
||||||
* @link http://marcel-kapfer.de/rangitaki
|
|
||||||
*
|
|
||||||
* Rangitaki Project
|
* Rangitaki Project
|
||||||
*
|
*
|
||||||
* The MIT License
|
* The MIT License
|
||||||
|
@ -36,8 +26,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The article generator class is a collection of functions for generating the
|
* The article generator class is a collection of functions for generating the article of markdown
|
||||||
* article of markdown
|
|
||||||
*
|
*
|
||||||
* Since there is no initialize function, I recommend to use the short access syntay
|
* Since there is no initialize function, I recommend to use the short access syntay
|
||||||
*
|
*
|
||||||
|
@ -56,10 +45,8 @@ class ArticleGenerator
|
||||||
* @param string $directory The directory where the article files are stored
|
* @param string $directory The directory where the article files are stored
|
||||||
* @param string $articlefile The name of the article file
|
* @param string $articlefile The name of the article file
|
||||||
* @param string $blog The name of the current blog
|
* @param string $blog The name of the current blog
|
||||||
*
|
|
||||||
* @return Null
|
|
||||||
*/
|
*/
|
||||||
function newArticle($directory, $articlefile, $blog, $excerpt, $readmore)
|
function newArticle($directory, $articlefile, $blog)
|
||||||
{
|
{
|
||||||
|
|
||||||
$article = file_get_contents($directory . $articlefile); // get the file
|
$article = file_get_contents($directory . $articlefile); // get the file
|
||||||
|
@ -96,39 +83,12 @@ class ArticleGenerator
|
||||||
|
|
||||||
echo "<div class='articletext'>";
|
echo "<div class='articletext'>";
|
||||||
|
|
||||||
// print only a excerpt of the post
|
|
||||||
// with at least 200 characters if possible.
|
|
||||||
if ( $excerpt == 'on' ) {
|
|
||||||
$emptyline = strpos($article, "\n\n");
|
|
||||||
if ( $emptyline !== false ) {
|
|
||||||
if ( $emptyline < 200) {
|
|
||||||
$emptyline2 = strpos($article, "\n\n", $emptyline);
|
|
||||||
if ( $emptyline2 !== false ) {
|
|
||||||
$article = substr($article, 0, $emptyline2);
|
|
||||||
} else {
|
|
||||||
$article = substr($article, 0, $emptyline);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$article = substr($article, 0, $emptyline);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// correct $excerpt for use in line 127.
|
|
||||||
$excerpt = 'off';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
echo Parsedown::instance()
|
echo Parsedown::instance()
|
||||||
->setBreaksEnabled(true)
|
->setBreaksEnabled(true)
|
||||||
->text($article); // print now the article text as html
|
->text($article); // print now the article text as html
|
||||||
|
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
|
|
||||||
|
|
||||||
if ( $excerpt == 'on' ) {
|
|
||||||
echo "<div class='readmore'><a href='$link'>$readmore</a></div>";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (isset($author)) {
|
if (isset($author)) {
|
||||||
echo "<span class='author'>$author</span>"; // print the author
|
echo "<span class='author'>$author</span>"; // print the author
|
||||||
}
|
}
|
||||||
|
@ -212,31 +172,6 @@ class ArticleGenerator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A function to get a short summary of a text
|
|
||||||
*
|
|
||||||
* @param $directory The directory where the article is stored
|
|
||||||
* @param $articlefile The name of the article file
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
static function getSummary($directory, $articlefile)
|
|
||||||
{
|
|
||||||
$text = ArticleGenerator::getText($directory, $articlefile);
|
|
||||||
|
|
||||||
$pos = stripos($text, "\n\n");
|
|
||||||
|
|
||||||
if ($pos !== false) {
|
|
||||||
$offset = $pos;
|
|
||||||
$pos = stripos($text, ".", $offset);
|
|
||||||
$summary = substr($text, 0, $pos) . ".";
|
|
||||||
return trim($summary);
|
|
||||||
} else {
|
|
||||||
return $text;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A function to get the author of an article
|
* A function to get the author of an article
|
||||||
*
|
*
|
||||||
|
@ -292,50 +227,4 @@ class ArticleGenerator
|
||||||
return $article;
|
return $article;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* A function to get a array of the article
|
|
||||||
*
|
|
||||||
* @param $directory The directory where the article is stored
|
|
||||||
* @param $articlefile The name of the article file
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getArray($directory, $articlefile)
|
|
||||||
{
|
|
||||||
$article = file_get_contents($directory . $articlefile);
|
|
||||||
$title = "";
|
|
||||||
$date = "";
|
|
||||||
$author = "";
|
|
||||||
$tags = array();
|
|
||||||
|
|
||||||
if (substr($article, 0, 6) == "%TITLE") { // get and remove the title
|
|
||||||
$title = substr($article, 8, strpos($article, "\n") - 8);
|
|
||||||
$article = substr($article, strpos($article, "\n") + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (substr($article, 0, 5) == "%DATE") { // get and remove the title
|
|
||||||
$date = substr($article, 7, strpos($article, "\n") - 7);
|
|
||||||
$article = substr($article, strpos($article, "\n") + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (substr($article, 0, 7) == "%AUTHOR") { // get and remove the title
|
|
||||||
$author = substr($article, 9, strpos($article, "\n") - 9);
|
|
||||||
$article = substr($article, strpos($article, "\n") + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (substr($article, 0, 5) == "%TAGS") { // get and remove the tags
|
|
||||||
$tags = substr($article, 7, strpos($article, "\n") - 7); // get the tags
|
|
||||||
$tags = explode(", ", $tags); // split them into an array
|
|
||||||
$article = substr($article, strpos($article, "\n") + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
$data = array(
|
|
||||||
"title" => $title,
|
|
||||||
"date" => $date,
|
|
||||||
"author" => $author,
|
|
||||||
"tags" => $tags,
|
|
||||||
"text" => $article
|
|
||||||
);
|
|
||||||
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* PHP Version 7
|
* PHP Version 5.6
|
||||||
*
|
*
|
||||||
* Rangitaki Project
|
* Rangitaki Project
|
||||||
*
|
*
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
* @license MIT License
|
* @license MIT License
|
||||||
* @link http://marcel-kapfer.de/rangitaki
|
* @link http://marcel-kapfer.de/rangitaki
|
||||||
*/
|
*/
|
||||||
namespace mmk2410\rbe\BlogListGenerator;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The blog list generator class is a collection of functions for generating
|
* The blog list generator class is a collection of functions for generating
|
||||||
|
@ -37,7 +37,7 @@ class BlogListGenerator
|
||||||
*
|
*
|
||||||
* @return None
|
* @return None
|
||||||
*/
|
*/
|
||||||
public function listBlog($directory, $blogname, $blogmaintitle)
|
function listBlog($directory, $blogname, $blogmaintitle)
|
||||||
{
|
{
|
||||||
// get content of the blog file;
|
// get content of the blog file;
|
||||||
$blog = file_get_contents($directory . $blogname);
|
$blog = file_get_contents($directory . $blogname);
|
||||||
|
@ -46,25 +46,18 @@ class BlogListGenerator
|
||||||
// check if the first line includes a title
|
// check if the first line includes a title
|
||||||
if (substr($blog, 0, 6) == "%TITLE") {
|
if (substr($blog, 0, 6) == "%TITLE") {
|
||||||
// grab the title
|
// grab the title
|
||||||
$itemname = substr($blog, 8, strpos($blog, "\n") - 8);
|
$blog = substr($blog, 8, strpos($blog, "\n") - 8);
|
||||||
// if on main blog
|
// if on main blog
|
||||||
if ($itemname == "main") {
|
if ($blog == "main") {
|
||||||
// create a nav item to the main blog
|
// create a nav item to the main blog
|
||||||
$atag = "<a class='nav-item' href='./'>$blogmaintitle</a>";
|
echo "<a class='nav-item' href='./'>$blogmaintitle</a>";
|
||||||
} else {
|
} else {
|
||||||
// create a link to the blog
|
// create a link to the blog
|
||||||
$link = "./?blog=" . substr($blogname, 0, -3);
|
$link = "./?blog=" . substr($blogname, 0, -3);
|
||||||
// create a nav item to the blog
|
// create a nav item to the blog
|
||||||
$atag = "<a class='nav-item' href='$link'>$itemname</a>";
|
echo "<a class='nav-item' href='$link'>$blog</a>";
|
||||||
}
|
}
|
||||||
$blog = substr($blog, strpos($blog, "\n") + 1);
|
|
||||||
}
|
}
|
||||||
// nav item as link to external page
|
|
||||||
if (substr($blog, 0, 4) == "%URL") {
|
|
||||||
$itemurl = substr($blog, 6, strpos($blog, "\n") - 6);
|
|
||||||
$atag = "<a class='nav-item' href='$itemurl'>$itemname</a>";
|
|
||||||
}
|
|
||||||
return $atag;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -74,7 +67,7 @@ class BlogListGenerator
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getName($file)
|
function getName($file)
|
||||||
{
|
{
|
||||||
// get the content of the blog file
|
// get the content of the blog file
|
||||||
$blog = file_get_contents($file);
|
$blog = file_get_contents($file);
|
||||||
|
@ -96,7 +89,7 @@ class BlogListGenerator
|
||||||
*
|
*
|
||||||
* @return int Amount of files
|
* @return int Amount of files
|
||||||
*/
|
*/
|
||||||
public static function getArticleAmount($blog)
|
static function getArticleAmount($blog)
|
||||||
{
|
{
|
||||||
$directory = "./articles/" . $blog . "/";
|
$directory = "./articles/" . $blog . "/";
|
||||||
if (!file_exists($directory)) {
|
if (!file_exists($directory)) {
|
||||||
|
@ -113,25 +106,4 @@ class BlogListGenerator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* A function returning the external linkn of
|
|
||||||
* a blog.
|
|
||||||
*
|
|
||||||
* @param string $blog the blog name
|
|
||||||
* @param string $dir root directory of installation
|
|
||||||
*
|
|
||||||
* @return string link to external page else null
|
|
||||||
*/
|
|
||||||
public function getExternalLink($blog, $dir)
|
|
||||||
{
|
|
||||||
$path = $dir . "/blogs/" . $blog;
|
|
||||||
$blog = file_get_contents($path) . "\n";
|
|
||||||
if (substr($blog, 0, 6) == "%TITLE") {
|
|
||||||
$blog = substr($blog, strpos($blog, "\n") + 1);
|
|
||||||
}
|
|
||||||
if (substr($blog, 0, 4) == "%URL") {
|
|
||||||
return substr($blog, 6, strpos($blog, "\n") - 6);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,74 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* PHP Version 7
|
|
||||||
*
|
|
||||||
* Configuration parser for yaml configuration files
|
|
||||||
*
|
|
||||||
* @category Configuration
|
|
||||||
* @package Rbe
|
|
||||||
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
|
|
||||||
* @license MIT License
|
|
||||||
* @link http://marcel-kapfer.de/rangitaki
|
|
||||||
*/
|
|
||||||
namespace mmk2410\rbe\config;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PHP Version 7
|
|
||||||
*
|
|
||||||
* Configuration parser for yaml configuration files
|
|
||||||
*
|
|
||||||
* @category Configuration
|
|
||||||
* @package Rbe
|
|
||||||
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
|
|
||||||
* @license MIT License
|
|
||||||
* @link http://marcel-kapfer.de/rangitaki
|
|
||||||
*/
|
|
||||||
class Config
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Path to yaml file
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $file;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor for the Config class
|
|
||||||
*
|
|
||||||
* @param $config path to the yaml file
|
|
||||||
* @param $composer path to the composer autoload
|
|
||||||
*/
|
|
||||||
public function __construct($config, $composer)
|
|
||||||
{
|
|
||||||
$this->file = $config;
|
|
||||||
require $composer;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return yaml config as PHP array
|
|
||||||
*
|
|
||||||
* @return config array
|
|
||||||
*/
|
|
||||||
public function getConfig()
|
|
||||||
{
|
|
||||||
$yaml = new \Symfony\Component\Yaml\Parser();
|
|
||||||
return $yaml->parse(file_get_contents($this->file));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Write array into confi*
|
|
||||||
* Write array into config file
|
|
||||||
*
|
|
||||||
* @param array config new config
|
|
||||||
*
|
|
||||||
* @return FALSE if failed to write
|
|
||||||
*/
|
|
||||||
public function writeConfig($config)
|
|
||||||
{
|
|
||||||
$dumper = new \Symfony\Component\Yaml\Dumper();
|
|
||||||
|
|
||||||
$yaml = $dumper->dump($config, 2);
|
|
||||||
|
|
||||||
return file_put_contents($this->file, $yaml);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -22,12 +22,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<?php if ($config['blog']['disqus']) { // check if disqus is enabled ?>
|
<?php if ($blogdisqus) { // check if disqus is enabled ?>
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<div id="disqus_thread"></div>
|
<div id="disqus_thread"></div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
/* * * CONFIGURATION VARIABLES * * */
|
/* * * CONFIGURATION VARIABLES * * */
|
||||||
var disqus_shortname = '<?php echo $config['blog']['disqus']; ?>';
|
var disqus_shortname = '<?php echo $blogdisqus; ?>';
|
||||||
|
|
||||||
/* * * DON'T EDIT BELOW THIS LINE * * */
|
/* * * DON'T EDIT BELOW THIS LINE * * */
|
||||||
(function () {
|
(function () {
|
||||||
|
|
|
@ -26,8 +26,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
if ($config["blog"]["analytics"]) { // check if google analytics is enabled
|
if ($bloganalytics) { // check if google analytics is enabled
|
||||||
if (!($_SERVER['HTTP_DNT'] == 1)) {
|
|
||||||
?>
|
?>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
@ -50,5 +49,4 @@ if ($config["blog"]["analytics"]) { // check if google analytics is enabled
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* PHP Version 7
|
* PHP Version 5
|
||||||
*
|
*
|
||||||
* PHP script for creating the next / prev page links
|
* PHP script for creating the next / prev page links
|
||||||
*
|
*
|
||||||
|
@ -11,17 +11,10 @@
|
||||||
* @link http://marcel-kapfer.de/rangitaki
|
* @link http://marcel-kapfer.de/rangitaki
|
||||||
*/
|
*/
|
||||||
require_once "BlogListGenerator.php";
|
require_once "BlogListGenerator.php";
|
||||||
use mmk2410\rbe\BlogListGenerator\BlogListGenerator as BlogListGenerator;
|
require_once "config.php";
|
||||||
|
require_once "lang/" . $language . ".php";
|
||||||
|
|
||||||
require_once './res/php/Config.php';
|
if ($pagination) {
|
||||||
|
|
||||||
$configParser = new mmk2410\rbe\config\Config('./config.yaml', './vendor/autoload.php');
|
|
||||||
|
|
||||||
$conf = $configParser->getConfig();
|
|
||||||
|
|
||||||
require_once "lang/" . $config["language"] . ".php";
|
|
||||||
|
|
||||||
if ($blog["design"]["pagination"]) {
|
|
||||||
?>
|
?>
|
||||||
<div class="pag_buttons">
|
<div class="pag_buttons">
|
||||||
<?php
|
<?php
|
||||||
|
|
|
@ -278,6 +278,9 @@ class Parsedown
|
||||||
return $markup;
|
return $markup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Allow for plugin extensibility
|
||||||
|
#
|
||||||
protected function isBlockContinuable($Type)
|
protected function isBlockContinuable($Type)
|
||||||
{
|
{
|
||||||
return method_exists($this, 'block'.$Type.'Continue');
|
return method_exists($this, 'block'.$Type.'Continue');
|
||||||
|
@ -515,16 +518,6 @@ class Parsedown
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if($name === 'ol')
|
|
||||||
{
|
|
||||||
$listStart = stristr($matches[0], '.', true);
|
|
||||||
|
|
||||||
if($listStart !== '1')
|
|
||||||
{
|
|
||||||
$Block['element']['attributes'] = array('start' => $listStart);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$Block['li'] = array(
|
$Block['li'] = array(
|
||||||
'name' => 'li',
|
'name' => 'li',
|
||||||
'handler' => 'li',
|
'handler' => 'li',
|
|
@ -1,38 +0,0 @@
|
||||||
###
|
|
||||||
Rangitaki Project
|
|
||||||
|
|
||||||
The MIT License
|
|
||||||
|
|
||||||
Copyright 2015 mmk2410.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
###
|
|
||||||
|
|
||||||
###
|
|
||||||
This is a example JavaScript extension for Rangitaki
|
|
||||||
###
|
|
||||||
|
|
||||||
main = () ->
|
|
||||||
console.log """
|
|
||||||
Welcome Developer! \nYou're seeing the output of a
|
|
||||||
JavaScript extension for the Rangitaki blogging engine.
|
|
||||||
"""
|
|
||||||
|
|
||||||
$(document).ready main()
|
|
||||||
|
|
|
@ -1,87 +0,0 @@
|
||||||
###
|
|
||||||
Rangitaki Project
|
|
||||||
|
|
||||||
The MIT License
|
|
||||||
|
|
||||||
Copyright 2015 mmk2410.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
###
|
|
||||||
|
|
||||||
main = () ->
|
|
||||||
|
|
||||||
# FAB
|
|
||||||
fabActive = false
|
|
||||||
$('.fabmenu').click ->
|
|
||||||
if !fabActive
|
|
||||||
fabFadeIn()
|
|
||||||
fabActive = true
|
|
||||||
else
|
|
||||||
fabFadeOut()
|
|
||||||
fabActive = false
|
|
||||||
|
|
||||||
# Navigation Drawer
|
|
||||||
navOpen = false
|
|
||||||
$('.nav-img, .overlay, .nav-close').click ->
|
|
||||||
if !navOpen
|
|
||||||
openNav()
|
|
||||||
navOpen = true
|
|
||||||
else
|
|
||||||
closeNav()
|
|
||||||
navOpen = false
|
|
||||||
|
|
||||||
###
|
|
||||||
Keyhandling for the navigation drawer.
|
|
||||||
opens the drawer on 'm' (key code: 77)
|
|
||||||
closes the drawer on 'Esc' (key code: 27)
|
|
||||||
###
|
|
||||||
$(document).keyup (e) ->
|
|
||||||
if navOpen and e.which is 27
|
|
||||||
closeNav()
|
|
||||||
navOpen = false
|
|
||||||
else if !navOpen and e.which == 77
|
|
||||||
openNav()
|
|
||||||
navOpen = true
|
|
||||||
|
|
||||||
# Make every link in articles target="_blank"
|
|
||||||
$('.articletext a').attr 'target', '_blank'
|
|
||||||
|
|
||||||
$(document).ready main
|
|
||||||
|
|
||||||
fabFadeIn = () ->
|
|
||||||
$('.subfab').fadeIn 125
|
|
||||||
$('.fab-img').fadeOut 60, ->
|
|
||||||
$('.fab-img').attr "src", "./res/img/close.svg"
|
|
||||||
$('.fab-img').fadeIn 60
|
|
||||||
|
|
||||||
fabFadeOut = () ->
|
|
||||||
$('.subfab').fadeOut 125
|
|
||||||
$('.fab-img').fadeOut 60, ->
|
|
||||||
$('.fab-img').attr "src", "./res/img/share.svg"
|
|
||||||
$('.fab-img').fadeIn 60
|
|
||||||
|
|
||||||
openNav = () ->
|
|
||||||
$('.nav').animate {"left": "0px"}, 125
|
|
||||||
$('.overlay').show()
|
|
||||||
$('.overlay').animate {"opacity": "0.4"}, 125
|
|
||||||
|
|
||||||
closeNav = () ->
|
|
||||||
$('.nav').animate {"left": "-301px"}, 125
|
|
||||||
$('.overlay').animate {"opacity": "0.0"}, 125, ->
|
|
||||||
$('.overlay').css {"display": "none"}
|
|
|
@ -1,179 +0,0 @@
|
||||||
/*
|
|
||||||
* Rangitaki Project
|
|
||||||
*
|
|
||||||
* The MIT License
|
|
||||||
*
|
|
||||||
* Copyright 2015 mmk2410.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
body
|
|
||||||
font-family: "Roboto", sans-serif
|
|
||||||
background: #f6f6f6
|
|
||||||
color: #383838
|
|
||||||
background-image: url(//example.com/res/img/intro.svg)
|
|
||||||
background-size: cover
|
|
||||||
background-attachment: fixed
|
|
||||||
background-position: top center
|
|
||||||
background-repeat: no-repeat
|
|
||||||
|
|
||||||
.header
|
|
||||||
background-color: rgba(0, 0, 0, 0.45)
|
|
||||||
position: fixed
|
|
||||||
|
|
||||||
.title
|
|
||||||
color: #fff
|
|
||||||
position: absolute
|
|
||||||
|
|
||||||
.title > a
|
|
||||||
color: #fff
|
|
||||||
|
|
||||||
.fadeout
|
|
||||||
background: -moz-linear-gradient(left, rgba(30,87,153,0) 0%, rgba(0, 0, 0, 0.45) 100%)
|
|
||||||
background: -webkit-linear-gradient(left, rgba(30,87,153,0) 0%,rgba(0, 0, 0, 0.45) 100%)
|
|
||||||
background: -o-linear-gradient(left, rgba(30,87,153,0) 0%,rgba(0, 0, 0, 0.45) 100%)
|
|
||||||
background: -ms-linear-gradient(left, rgba(30,87,153,0) 0%,rgba(0, 0, 0, 0.45) 100%)
|
|
||||||
background: linear-gradient(to right, rgba(30,87,153,0) 0%,rgba(0, 0, 0, 0.45) 100%)
|
|
||||||
|
|
||||||
.nav
|
|
||||||
background-color: #fff
|
|
||||||
border-right: 1px solid #e0e0e0
|
|
||||||
|
|
||||||
.nav-item, .nav-item-static
|
|
||||||
color: #383838
|
|
||||||
|
|
||||||
.nav-item
|
|
||||||
font-weight: 600
|
|
||||||
|
|
||||||
.nav-item:active
|
|
||||||
background-color: #e2e2e2
|
|
||||||
|
|
||||||
.divider
|
|
||||||
border-bottom: 1px solid #e0e0e0
|
|
||||||
|
|
||||||
.card
|
|
||||||
background: #fff
|
|
||||||
border-radius: 2px
|
|
||||||
box-shadow: 0 1px 1.5px 1.5px rgba(62, 62, 62, 0.3)
|
|
||||||
|
|
||||||
.card a
|
|
||||||
color: #ff4415
|
|
||||||
text-decoration: none
|
|
||||||
border-bottom: 1px solid transparent
|
|
||||||
border-bottom-color: transparent
|
|
||||||
transition: border-bottom-color 150ms ease-in-out 100ms
|
|
||||||
|
|
||||||
.card a:hover
|
|
||||||
border-bottom-color: #ff4415
|
|
||||||
|
|
||||||
.headline
|
|
||||||
font-size: 24px
|
|
||||||
color: #383838!important
|
|
||||||
text-decoration: none
|
|
||||||
border-bottom: none!important
|
|
||||||
|
|
||||||
.headline:hover
|
|
||||||
color: #ff4415!important
|
|
||||||
|
|
||||||
.date
|
|
||||||
font-size: 13px
|
|
||||||
|
|
||||||
.articletext
|
|
||||||
font-size: 14px
|
|
||||||
line-height: 24px
|
|
||||||
|
|
||||||
.author
|
|
||||||
font-size: 13px
|
|
||||||
|
|
||||||
.tag
|
|
||||||
font-size: 13px
|
|
||||||
|
|
||||||
.fab
|
|
||||||
background-color: #ff4415
|
|
||||||
box-shadow: 0 1px 1.5px 1.5px rgba(62, 62, 62, 0.3)
|
|
||||||
|
|
||||||
.subfab
|
|
||||||
background-color: #fff
|
|
||||||
box-shadow: 0 1px 1.5px 1.5px rgba(62, 62, 62, 0.3)
|
|
||||||
|
|
||||||
.button
|
|
||||||
border-width: 1px
|
|
||||||
border-style: solid
|
|
||||||
text-transform: uppercase
|
|
||||||
-webkit-box-shadow: 0 1px 1.5px 1.5px rgba(42, 42, 42, 0.65)
|
|
||||||
-moz-box-shadow: 0 1px 1.5px 1.5px rgba(42, 42, 42, 0.65)
|
|
||||||
box-shadow: 0 1px 1.5px 1.5px rgba(42, 42, 42, 0.65)
|
|
||||||
border-radius: 2px
|
|
||||||
letter-spacing: 0.4px
|
|
||||||
font-weight: 700
|
|
||||||
font-size: 14px
|
|
||||||
transition-property: box-shadow
|
|
||||||
transition-delay: 50ms
|
|
||||||
transition-duration: 125ms
|
|
||||||
transition-timing-function: ease
|
|
||||||
-o-transition-property: box-shadow
|
|
||||||
-o-transition-delay: 50ms
|
|
||||||
-o-transition-duration: 125ms
|
|
||||||
-o-transition-timing-function: ease
|
|
||||||
-moz-transition-property: box-shadow
|
|
||||||
-moz-transition-delay: 50ms
|
|
||||||
-moz-transition-duration: 125ms
|
|
||||||
-moz-transition-timing-function: ease
|
|
||||||
-webkit-transition-property: box-shadow
|
|
||||||
-webkit-transition-delay: 50ms
|
|
||||||
-webkit-transition-duration: 125ms
|
|
||||||
-webkit-transition-timing-function: ease
|
|
||||||
|
|
||||||
.button:hover, .button:hover
|
|
||||||
-webkit-box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85)
|
|
||||||
-moz-box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85)
|
|
||||||
box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85)
|
|
||||||
|
|
||||||
.pag_next
|
|
||||||
background-color: #ff4415
|
|
||||||
border-color: #ff4415
|
|
||||||
|
|
||||||
.pag_prev
|
|
||||||
background-color: #fff
|
|
||||||
border-color: #fff
|
|
||||||
color: #383838
|
|
||||||
|
|
||||||
.footer
|
|
||||||
font-size: 12px
|
|
||||||
text-align: center
|
|
||||||
color: #fff
|
|
||||||
text-shadow: 1px 1px rgba(55, 55, 55, 0.3)
|
|
||||||
|
|
||||||
.footer a
|
|
||||||
color: #fff
|
|
||||||
text-shadow: 1px 1px rgba(175, 175, 175, 0.3)
|
|
||||||
text-decoration: none
|
|
||||||
border-bottom: 1px solid transparent
|
|
||||||
border-bottom-color: transparent
|
|
||||||
|
|
||||||
.footer a:hover
|
|
||||||
border-bottom-color: #fff
|
|
||||||
|
|
||||||
@media screen and (min-width: 1440px)
|
|
||||||
|
|
||||||
.nav
|
|
||||||
background-color: rgba(255, 255, 255, 0.8)
|
|
||||||
|
|
|
@ -1,161 +0,0 @@
|
||||||
/*
|
|
||||||
* Rangitaki Project
|
|
||||||
*
|
|
||||||
* The MIT License
|
|
||||||
*
|
|
||||||
* Copyright 2015 mmk2410.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
body
|
|
||||||
font-family: "Roboto", sans-serif
|
|
||||||
background: #303030
|
|
||||||
color: #fff
|
|
||||||
|
|
||||||
.header
|
|
||||||
background-color: #212121
|
|
||||||
position: fixed
|
|
||||||
box-shadow: 2px 0 2px 2px rgba(32, 32, 32, 0.85)
|
|
||||||
|
|
||||||
.title
|
|
||||||
color: #fff
|
|
||||||
position: absolute
|
|
||||||
> a
|
|
||||||
color: #fff
|
|
||||||
|
|
||||||
.fadeout
|
|
||||||
background: -moz-linear-gradient(left, rgba(30, 87, 153, 0) 0%, #212121 100%)
|
|
||||||
/* FF3.6+
|
|
||||||
background: -webkit-linear-gradient(left, rgba(30, 87, 153, 0) 0%, #212121 100%)
|
|
||||||
/* Chrome10+,Safari5.1+
|
|
||||||
background: -o-linear-gradient(left, rgba(30, 87, 153, 0) 0%, #212121 100%)
|
|
||||||
/* Opera 11.10+
|
|
||||||
background: -ms-linear-gradient(left, rgba(30, 87, 153, 0) 0%, #212121 100%)
|
|
||||||
/* IE10+
|
|
||||||
background: linear-gradient(to right, rgba(30, 87, 153, 0) 0%, #212121 100%)
|
|
||||||
/* W3C
|
|
||||||
|
|
||||||
.nav
|
|
||||||
background-color: #424242
|
|
||||||
border-right: 1px solid #1f1f1f
|
|
||||||
|
|
||||||
.nav-item, .nav-item-static
|
|
||||||
color: #fff
|
|
||||||
|
|
||||||
.nav-item
|
|
||||||
font-weight: 600
|
|
||||||
&:active
|
|
||||||
background-color: #383838
|
|
||||||
|
|
||||||
.divider
|
|
||||||
border-bottom: 1px solid #1f1f1f
|
|
||||||
|
|
||||||
.card
|
|
||||||
background: #424242
|
|
||||||
border-radius: 2px
|
|
||||||
box-shadow: 0 1px 1.5px 1.5px rgba(42, 42, 42, 0.65)
|
|
||||||
a
|
|
||||||
color: #ff4415
|
|
||||||
text-decoration: none
|
|
||||||
border-bottom: 1px solid transparent
|
|
||||||
border-bottom-color: transparent
|
|
||||||
transition: border-bottom-color 150ms ease-in-out 100ms
|
|
||||||
&:hover
|
|
||||||
border-bottom-color: #ff4415
|
|
||||||
|
|
||||||
.headline
|
|
||||||
font-size: 24px
|
|
||||||
color: #fff !important
|
|
||||||
text-decoration: none
|
|
||||||
border-bottom: none !important
|
|
||||||
&:hover
|
|
||||||
color: #ff4415 !important
|
|
||||||
|
|
||||||
.date
|
|
||||||
font-size: 13px
|
|
||||||
|
|
||||||
.articletext
|
|
||||||
font-size: 14px
|
|
||||||
line-height: 24px
|
|
||||||
|
|
||||||
.author, .tag
|
|
||||||
font-size: 13px
|
|
||||||
|
|
||||||
.fab
|
|
||||||
background-color: #ff4415
|
|
||||||
box-shadow: 0 1px 1.5px 1.5px rgba(42, 42, 42, 0.65)
|
|
||||||
|
|
||||||
.subfab
|
|
||||||
background-color: #424242
|
|
||||||
box-shadow: 0 1px 1.5px 1.5px rgba(42, 42, 42, 0.65)
|
|
||||||
|
|
||||||
.button
|
|
||||||
text-transform: uppercase
|
|
||||||
border-width: 1px
|
|
||||||
border-style: solid
|
|
||||||
-webkit-box-shadow: 0 1px 1.5px 1.5px rgba(42, 42, 42, 0.65)
|
|
||||||
-moz-box-shadow: 0 1px 1.5px 1.5px rgba(42, 42, 42, 0.65)
|
|
||||||
box-shadow: 0 1px 1.5px 1.5px rgba(42, 42, 42, 0.65)
|
|
||||||
border-radius: 2px
|
|
||||||
letter-spacing: 0.4px
|
|
||||||
font-weight: 700
|
|
||||||
font-size: 14px
|
|
||||||
transition-property: box-shadow
|
|
||||||
transition-delay: 50ms
|
|
||||||
transition-duration: 125ms
|
|
||||||
transition-timing-function: ease
|
|
||||||
-o-transition-property: box-shadow
|
|
||||||
-o-transition-delay: 50ms
|
|
||||||
-o-transition-duration: 125ms
|
|
||||||
-o-transition-timing-function: ease
|
|
||||||
-moz-transition-property: box-shadow
|
|
||||||
-moz-transition-delay: 50ms
|
|
||||||
-moz-transition-duration: 125ms
|
|
||||||
-moz-transition-timing-function: ease
|
|
||||||
-webkit-transition-property: box-shadow
|
|
||||||
-webkit-transition-delay: 50ms
|
|
||||||
-webkit-transition-duration: 125ms
|
|
||||||
-webkit-transition-timing-function: ease
|
|
||||||
&:hover
|
|
||||||
-webkit-box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85)
|
|
||||||
-moz-box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85)
|
|
||||||
box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85)
|
|
||||||
|
|
||||||
.pag_next
|
|
||||||
background-color: #ff4415
|
|
||||||
border-color: #ff4415
|
|
||||||
|
|
||||||
.pag_prev
|
|
||||||
background-color: #424242
|
|
||||||
border-color: #424242
|
|
||||||
color: #CCCCCC
|
|
||||||
|
|
||||||
.footer
|
|
||||||
font-size: 12px
|
|
||||||
text-align: center
|
|
||||||
color: #fff
|
|
||||||
a
|
|
||||||
color: #fff
|
|
||||||
text-decoration: none
|
|
||||||
border-bottom: 1px solid transparent
|
|
||||||
border-bottom-color: transparent
|
|
||||||
&:hover
|
|
||||||
border-bottom-color: #fff
|
|
|
@ -1,156 +0,0 @@
|
||||||
/*
|
|
||||||
* Rangitaki Project
|
|
||||||
*
|
|
||||||
* The MIT License
|
|
||||||
*
|
|
||||||
* Copyright 2015 mmk2410.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
body
|
|
||||||
font-family: "Roboto", sans-serif
|
|
||||||
background: #f6f6f6
|
|
||||||
color: #383838
|
|
||||||
|
|
||||||
.header
|
|
||||||
background-color: #ff4415
|
|
||||||
position: fixed
|
|
||||||
box-shadow: 2px 0 2px 2px rgba(62, 62, 62, 0.45)
|
|
||||||
|
|
||||||
.title
|
|
||||||
color: #fff
|
|
||||||
position: absolute
|
|
||||||
> a
|
|
||||||
color: #fff
|
|
||||||
|
|
||||||
.fadeout
|
|
||||||
background: -moz-linear-gradient(left, rgba(30, 87, 153, 0) 0%, #ff4415 100%)
|
|
||||||
background: -webkit-linear-gradient(left, rgba(30, 87, 153, 0) 0%, #ff4415 100%)
|
|
||||||
background: -o-linear-gradient(left, rgba(30, 87, 153, 0) 0%, #ff4415 100%)
|
|
||||||
background: -ms-linear-gradient(left, rgba(30, 87, 153, 0) 0%, #ff4415 100%)
|
|
||||||
background: linear-gradient(to right, rgba(30, 87, 153, 0) 0%, #ff4415 100%)
|
|
||||||
/* W3C
|
|
||||||
|
|
||||||
.nav
|
|
||||||
background-color: #fff
|
|
||||||
border-right: 1px solid #e0e0e0
|
|
||||||
|
|
||||||
.nav-item, .nav-item-static
|
|
||||||
color: #383838
|
|
||||||
|
|
||||||
.nav-item
|
|
||||||
font-weight: 600
|
|
||||||
&:hover, &:active
|
|
||||||
background-color: #e2e2e2
|
|
||||||
|
|
||||||
.divider
|
|
||||||
border-bottom: 1px solid #e0e0e0
|
|
||||||
|
|
||||||
.card
|
|
||||||
background: #fff
|
|
||||||
border-radius: 2px
|
|
||||||
box-shadow: 0 1px 1.5px 1.5px rgba(62, 62, 62, 0.3)
|
|
||||||
a
|
|
||||||
color: #ff4415
|
|
||||||
text-decoration: none
|
|
||||||
border-bottom: 1px solid transparent
|
|
||||||
border-bottom-color: transparent
|
|
||||||
transition: border-bottom-color 150ms ease-in-out 100ms
|
|
||||||
&:hover
|
|
||||||
border-bottom-color: #ff4415
|
|
||||||
|
|
||||||
.headline
|
|
||||||
font-size: 24px
|
|
||||||
color: #383838 !important
|
|
||||||
text-decoration: none
|
|
||||||
border-bottom: none !important
|
|
||||||
&:hover
|
|
||||||
color: #ff4415 !important
|
|
||||||
|
|
||||||
.date
|
|
||||||
font-size: 13px
|
|
||||||
|
|
||||||
.articletext
|
|
||||||
font-size: 14px
|
|
||||||
line-height: 24px
|
|
||||||
|
|
||||||
.author, .tag
|
|
||||||
font-size: 13px
|
|
||||||
|
|
||||||
.fab
|
|
||||||
background-color: #ff4415
|
|
||||||
box-shadow: 0 1px 1.5px 1.5px rgba(62, 62, 62, 0.3)
|
|
||||||
|
|
||||||
.subfab
|
|
||||||
background-color: #fff
|
|
||||||
box-shadow: 0 1px 1.5px 1.5px rgba(62, 62, 62, 0.3)
|
|
||||||
|
|
||||||
.button
|
|
||||||
text-transform: uppercase
|
|
||||||
border-width: 1px
|
|
||||||
border-style: solid
|
|
||||||
-webkit-box-shadow: 0.4px 1px 1.5px 1px #aaa
|
|
||||||
-moz-box-shadow: 0.4px 1px 1.5px 1px #aaa
|
|
||||||
box-shadow: 0.4px 1px 1.5px 1px #aaa
|
|
||||||
border-radius: 2px
|
|
||||||
letter-spacing: 0.4px
|
|
||||||
font-weight: 700
|
|
||||||
font-size: 14px
|
|
||||||
transition-property: box-shadow
|
|
||||||
transition-delay: 50ms
|
|
||||||
transition-duration: 125ms
|
|
||||||
transition-timing-function: ease
|
|
||||||
-o-transition-property: box-shadow
|
|
||||||
-o-transition-delay: 50ms
|
|
||||||
-o-transition-duration: 125ms
|
|
||||||
-o-transition-timing-function: ease
|
|
||||||
-moz-transition-property: box-shadow
|
|
||||||
-moz-transition-delay: 50ms
|
|
||||||
-moz-transition-duration: 125ms
|
|
||||||
-moz-transition-timing-function: ease
|
|
||||||
-webkit-transition-property: box-shadow
|
|
||||||
-webkit-transition-delay: 50ms
|
|
||||||
-webkit-transition-duration: 125ms
|
|
||||||
-webkit-transition-timing-function: ease
|
|
||||||
&:hover
|
|
||||||
-webkit-box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa
|
|
||||||
-moz-box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa
|
|
||||||
box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa
|
|
||||||
|
|
||||||
.pag_next
|
|
||||||
background-color: #ff4415
|
|
||||||
border-color: #ff4415
|
|
||||||
|
|
||||||
.pag_prev
|
|
||||||
background-color: #fff
|
|
||||||
border-color: #fff
|
|
||||||
color: #383838
|
|
||||||
|
|
||||||
.footer
|
|
||||||
font-size: 12px
|
|
||||||
text-align: center
|
|
||||||
a
|
|
||||||
color: #383838
|
|
||||||
text-decoration: none
|
|
||||||
border-bottom: 1px solid transparent
|
|
||||||
border-bottom-color: transparent
|
|
||||||
&:hover
|
|
||||||
border-bottom-color: #383838
|
|
|
@ -1,194 +0,0 @@
|
||||||
/*
|
|
||||||
*The MIT License
|
|
||||||
*
|
|
||||||
*Copyright 2015 mmk2410.
|
|
||||||
*
|
|
||||||
*Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
*of this software and associated documentation files (the "Software"), to deal
|
|
||||||
*in the Software without restriction, including without limitation the rights
|
|
||||||
*to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
*copies of the Software, and to permit persons to whom the Software is
|
|
||||||
*furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
*The above copyright notice and this permission notice shall be included in
|
|
||||||
*all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
*THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
*IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
*FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
*AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
*LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
*OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
*THE SOFTWARE.
|
|
||||||
/*
|
|
||||||
* Created on : Jun 18, 2015, 6:39:37 PM
|
|
||||||
* Author : mmk2410
|
|
||||||
|
|
||||||
$font: "Fira Sans", sans-serif
|
|
||||||
|
|
||||||
$background: #f0f0f0
|
|
||||||
$text-color: #383838
|
|
||||||
$primary-color: #4CAF50
|
|
||||||
$header-shadow: rgba(62, 62, 62, 0.45)
|
|
||||||
$white: #FFFFFF
|
|
||||||
$fadeout-color: rgba(30, 87, 153, 0)
|
|
||||||
$border: #e0e0e0
|
|
||||||
$active-color: #e2e2e2
|
|
||||||
$fab-shadow: rgba(62, 62, 62, 0.3)
|
|
||||||
$footer-background: #2D2D2D
|
|
||||||
|
|
||||||
body
|
|
||||||
font-family: $font
|
|
||||||
background: $background
|
|
||||||
color: $text-color
|
|
||||||
margin: 130px 0 0
|
|
||||||
|
|
||||||
::selection, ::-moz-selection
|
|
||||||
color: $background
|
|
||||||
background-color: $primary-color
|
|
||||||
|
|
||||||
.header
|
|
||||||
height: 55px
|
|
||||||
background-color: $primary-color
|
|
||||||
position: fixed
|
|
||||||
box-shadow: 2px 0 2px 2px $header-shadow
|
|
||||||
|
|
||||||
.title
|
|
||||||
line-height: 55px
|
|
||||||
color: $white
|
|
||||||
position: absolute
|
|
||||||
left: 0
|
|
||||||
margin-left: calc(20% + 24px)
|
|
||||||
> a
|
|
||||||
color: $white
|
|
||||||
text-decoration: none
|
|
||||||
|
|
||||||
.fadeout
|
|
||||||
height: 55px
|
|
||||||
background: -moz-linear-gradient(left, $fadeout-color 0%, $primary-color 100%)
|
|
||||||
background: -webkit-linear-gradient(left, $fadeout-color 0%, $primary-color 100%)
|
|
||||||
background: -o-linear-gradient(left, $fadeout-color 0%, $primary-color 100%)
|
|
||||||
background: -ms-linear-gradient(left, $fadeout-color 0%, $primary-color 100%)
|
|
||||||
background: linear-gradient(to right, $fadeout-color 0%, $primary-color 100%)
|
|
||||||
|
|
||||||
.nav-img
|
|
||||||
padding: 14px 19px
|
|
||||||
|
|
||||||
.nav
|
|
||||||
background-color: $white
|
|
||||||
border-right: 1px solid $border
|
|
||||||
|
|
||||||
.nav-item, .nav-item-static
|
|
||||||
color: $text-color
|
|
||||||
|
|
||||||
.nav-item
|
|
||||||
font-weight: 600
|
|
||||||
&:hover
|
|
||||||
color: $primary-color
|
|
||||||
&:active
|
|
||||||
background-color: $active-color
|
|
||||||
|
|
||||||
.divider
|
|
||||||
border-bottom: 1px solid $border
|
|
||||||
|
|
||||||
.card
|
|
||||||
background: none
|
|
||||||
border-radius: 0
|
|
||||||
box-shadow: none
|
|
||||||
margin: 0 20% 100px
|
|
||||||
width: auto
|
|
||||||
a
|
|
||||||
color: $primary-color
|
|
||||||
text-decoration: none
|
|
||||||
border-bottom: 1px solid transparent
|
|
||||||
transition: border-bottom-color 150ms ease-in-out 100ms
|
|
||||||
&:hover
|
|
||||||
border-bottom-color: #4CAF50
|
|
||||||
|
|
||||||
.headline
|
|
||||||
font-size: 30px
|
|
||||||
line-height: 50px
|
|
||||||
color: #383838 !important
|
|
||||||
text-decoration: none
|
|
||||||
border-bottom: none !important
|
|
||||||
&:hover
|
|
||||||
color: #4CAF50 !important
|
|
||||||
|
|
||||||
.date
|
|
||||||
font-size: 13px
|
|
||||||
|
|
||||||
.articletext
|
|
||||||
margin-top: 30px
|
|
||||||
font-size: 16px
|
|
||||||
line-height: 30px
|
|
||||||
|
|
||||||
.author, .tag
|
|
||||||
font-size: 13px
|
|
||||||
|
|
||||||
.fab
|
|
||||||
background-color: $primary-color
|
|
||||||
box-shadow: 0 1px 1.5px 1.5px $fab-shadow
|
|
||||||
|
|
||||||
.subfab
|
|
||||||
background-color: $white
|
|
||||||
box-shadow: 0 1px 1.5px 1.5px $fab-shadow
|
|
||||||
|
|
||||||
.button
|
|
||||||
color: $primary-color
|
|
||||||
border-bottom: 1px solid transparent
|
|
||||||
margin: 0
|
|
||||||
min-width: 0
|
|
||||||
padding: 0
|
|
||||||
line-height: 16px
|
|
||||||
height: 16px
|
|
||||||
transition-property: border-bottom-color
|
|
||||||
transition-delay: 50ms
|
|
||||||
transition-duration: 125ms
|
|
||||||
transition-timing-function: ease
|
|
||||||
-moz-transition-property: border-bottom-color
|
|
||||||
-moz-transition-delay: 50ms
|
|
||||||
-moz-transition-duration: 125ms
|
|
||||||
-moz-transition-timing-function: ease
|
|
||||||
-webkit-transition-property: border-bottom-color
|
|
||||||
-webkit-transition-delay: 50ms
|
|
||||||
-webkit-transition-duration: 125ms
|
|
||||||
-webkit-transition-timing-function: ease
|
|
||||||
&:hover
|
|
||||||
border-bottom-color: $primary-color
|
|
||||||
|
|
||||||
.pag_prev
|
|
||||||
float: left
|
|
||||||
|
|
||||||
.button:last-child
|
|
||||||
float: none
|
|
||||||
|
|
||||||
.footer
|
|
||||||
text-align: center
|
|
||||||
height: 60px
|
|
||||||
background-color: $footer-background
|
|
||||||
line-height: 60px
|
|
||||||
width: 100%
|
|
||||||
color: $white
|
|
||||||
a
|
|
||||||
color: $white
|
|
||||||
text-decoration: none
|
|
||||||
border-bottom: 1px solid transparent
|
|
||||||
&:hover
|
|
||||||
border-bottom-color: $white
|
|
||||||
|
|
||||||
.hljs
|
|
||||||
background: none
|
|
||||||
|
|
||||||
@media screen and (min-width: 1440px)
|
|
||||||
.title
|
|
||||||
margin-left: calc(20% - 40px)
|
|
||||||
.nav
|
|
||||||
padding-top: 55px
|
|
||||||
|
|
||||||
@media screen and (max-width: 800px)
|
|
||||||
body
|
|
||||||
margin-top: 80px
|
|
||||||
.title
|
|
||||||
margin-left: 20%
|
|
||||||
.card
|
|
||||||
margin: 0 5% 100px
|
|
|
@ -1,46 +0,0 @@
|
||||||
/*
|
|
||||||
* Rangitaki Project
|
|
||||||
*
|
|
||||||
* The MIT License
|
|
||||||
*
|
|
||||||
* Copyright 2015 mmk2410.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*
|
|
||||||
* A stylesheet for overriding the default styles if the navigation drawer is disabled
|
|
||||||
*/
|
|
||||||
|
|
||||||
.nav
|
|
||||||
display: none
|
|
||||||
|
|
||||||
.nav-img
|
|
||||||
display: none
|
|
||||||
|
|
||||||
@media screen and (min-width: 1440px)
|
|
||||||
.header
|
|
||||||
left: 0
|
|
||||||
|
|
||||||
.main
|
|
||||||
margin-left: 0
|
|
||||||
width: 100%
|
|
||||||
|
|
||||||
@media screen and (max-width: 720px)
|
|
||||||
|
|
||||||
.title
|
|
||||||
left: 25px
|
|
|
@ -1,252 +0,0 @@
|
||||||
/*
|
|
||||||
* Rangitaki Project
|
|
||||||
*
|
|
||||||
* The MIT License
|
|
||||||
*
|
|
||||||
* Copyright 2015 mmk2410.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*
|
|
||||||
* A stylesheet for overriding the default styles if the navigation drawer is disabled
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* BODY */
|
|
||||||
|
|
||||||
body
|
|
||||||
margin-top: 94px
|
|
||||||
|
|
||||||
.main
|
|
||||||
height: 100%
|
|
||||||
margin-left: 0
|
|
||||||
|
|
||||||
.overlay
|
|
||||||
opacity: 0
|
|
||||||
position: fixed
|
|
||||||
top: 0
|
|
||||||
left: 0
|
|
||||||
background-color: black
|
|
||||||
width: 100%
|
|
||||||
z-index: 30
|
|
||||||
height: 100%
|
|
||||||
display: none
|
|
||||||
|
|
||||||
/* HEADER */
|
|
||||||
.header
|
|
||||||
top: 0
|
|
||||||
right: 0
|
|
||||||
left: 0
|
|
||||||
width: 100%
|
|
||||||
height: 64px
|
|
||||||
position: absolute
|
|
||||||
|
|
||||||
.title
|
|
||||||
color: #fff
|
|
||||||
font-size: 23px
|
|
||||||
text-decoration: none
|
|
||||||
line-height: 64px
|
|
||||||
vertical-align: middle
|
|
||||||
left: 75px
|
|
||||||
|
|
||||||
.title > a
|
|
||||||
text-decoration: none
|
|
||||||
color: #fff
|
|
||||||
|
|
||||||
.fadeout
|
|
||||||
position: absolute
|
|
||||||
height: 64px
|
|
||||||
top: 0
|
|
||||||
right: 0
|
|
||||||
width: 40px
|
|
||||||
|
|
||||||
.nav-img
|
|
||||||
height: 26px
|
|
||||||
padding: 19px
|
|
||||||
cursor: pointer
|
|
||||||
|
|
||||||
/* NAV DRAWER */
|
|
||||||
|
|
||||||
.nav
|
|
||||||
width: 300px
|
|
||||||
position: fixed
|
|
||||||
height: 100%
|
|
||||||
top: 0
|
|
||||||
left: -301px
|
|
||||||
z-index: 40
|
|
||||||
|
|
||||||
.nav-item, .nav-item-static
|
|
||||||
text-decoration: none
|
|
||||||
text-indent: 0
|
|
||||||
display: inline-block
|
|
||||||
height: 48px
|
|
||||||
vertical-align: middle
|
|
||||||
width: 284px
|
|
||||||
line-height: 48px
|
|
||||||
padding-left: 16px
|
|
||||||
transition: background-color 125ms ease-in-out 0ms
|
|
||||||
|
|
||||||
.nav-close
|
|
||||||
cursor: pointer
|
|
||||||
|
|
||||||
.nav-close-img
|
|
||||||
height: 35px
|
|
||||||
padding: 12px
|
|
||||||
|
|
||||||
.nav-item
|
|
||||||
cursor: pointer
|
|
||||||
|
|
||||||
.divider
|
|
||||||
width: 100%
|
|
||||||
|
|
||||||
/* MAIN */
|
|
||||||
|
|
||||||
.card
|
|
||||||
margin-right: auto
|
|
||||||
margin-left: auto
|
|
||||||
width: 75%
|
|
||||||
padding: 24px
|
|
||||||
margin-bottom: 40px
|
|
||||||
max-width: 1160px
|
|
||||||
|
|
||||||
.card a
|
|
||||||
-moz-hyphens: auto
|
|
||||||
-epub-hyphens: auto
|
|
||||||
-ms-hyphens: auto
|
|
||||||
-webkit-hyphens: auto
|
|
||||||
hyphens: auto
|
|
||||||
word-wrap: break-word
|
|
||||||
|
|
||||||
.card a:hover
|
|
||||||
|
|
||||||
.headline
|
|
||||||
display: block
|
|
||||||
padding-bottom: 8px
|
|
||||||
|
|
||||||
.card img
|
|
||||||
max-width: 100%
|
|
||||||
max-height: 400px
|
|
||||||
display: block
|
|
||||||
margin-left: auto
|
|
||||||
margin-right: auto
|
|
||||||
|
|
||||||
.date
|
|
||||||
|
|
||||||
.articletext
|
|
||||||
|
|
||||||
.author
|
|
||||||
display: block
|
|
||||||
|
|
||||||
.tag
|
|
||||||
|
|
||||||
.readmore
|
|
||||||
padding: 12px 0 25px 0
|
|
||||||
|
|
||||||
/* FAB */
|
|
||||||
|
|
||||||
.fabmenu
|
|
||||||
position: fixed
|
|
||||||
bottom: 20px
|
|
||||||
right: 20px
|
|
||||||
|
|
||||||
.fab
|
|
||||||
height: 60px
|
|
||||||
width: 60px
|
|
||||||
border-radius: 30px
|
|
||||||
cursor: pointer
|
|
||||||
|
|
||||||
.fab-img
|
|
||||||
width: 28px
|
|
||||||
padding: 15px
|
|
||||||
|
|
||||||
.subfab
|
|
||||||
height: 45px
|
|
||||||
width: 45px
|
|
||||||
border-radius: 30px
|
|
||||||
margin-right: auto
|
|
||||||
margin-left: auto
|
|
||||||
margin-bottom: 25px
|
|
||||||
display: none
|
|
||||||
|
|
||||||
.subfab-img
|
|
||||||
width: 22px
|
|
||||||
padding: 12px
|
|
||||||
|
|
||||||
/* BUTTON */
|
|
||||||
|
|
||||||
.pag_buttons
|
|
||||||
margin-right: auto
|
|
||||||
margin-left: auto
|
|
||||||
width: calc(75% + 48px)
|
|
||||||
margin-bottom: 80px
|
|
||||||
max-width: 1160px
|
|
||||||
text-align: right
|
|
||||||
|
|
||||||
.button
|
|
||||||
text-decoration: none
|
|
||||||
color: #fff
|
|
||||||
line-height: 36px
|
|
||||||
min-width: 64px
|
|
||||||
text-align: center
|
|
||||||
height: 36px
|
|
||||||
padding: 8px
|
|
||||||
margin-top: 4px
|
|
||||||
margin-bottom: 5px
|
|
||||||
cursor: pointer
|
|
||||||
|
|
||||||
.pag_next
|
|
||||||
margin-left: 8px
|
|
||||||
|
|
||||||
/* FOOTER */
|
|
||||||
|
|
||||||
.footer
|
|
||||||
|
|
||||||
.footer a
|
|
||||||
transition: border-bottom-color 150ms ease-in-out 100ms
|
|
||||||
|
|
||||||
.footer a:hover
|
|
||||||
border-bottom-color: #383838
|
|
||||||
|
|
||||||
@media screen and (min-width: 1440px)
|
|
||||||
|
|
||||||
.nav
|
|
||||||
left: 0
|
|
||||||
padding-top: 64px
|
|
||||||
|
|
||||||
.nav-close-img
|
|
||||||
display: none
|
|
||||||
|
|
||||||
.nav-close
|
|
||||||
display: none
|
|
||||||
|
|
||||||
.nav-img
|
|
||||||
display: none
|
|
||||||
|
|
||||||
.header
|
|
||||||
left: 300px
|
|
||||||
|
|
||||||
.main
|
|
||||||
margin-left: 300px
|
|
||||||
width: calc(100% - 300px)
|
|
||||||
|
|
||||||
@media screen and (max-width: 720px)
|
|
||||||
|
|
||||||
.card
|
|
||||||
width: 82%
|
|
||||||
|
|
||||||
.pag_buttons
|
|
||||||
width: calc(82% + 48px)
|
|
|
@ -1,91 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
require_once 'PHPUnit/Autoload.php';
|
|
||||||
include 'res/php/ArticleGenerator.php';
|
|
||||||
|
|
||||||
class ArticleGeneratorTest extends \PHPUnit_Framework_TestCase
|
|
||||||
{
|
|
||||||
public function testGetArray()
|
|
||||||
{
|
|
||||||
$result = [
|
|
||||||
"title" => "The Rangitaki logo 2",
|
|
||||||
"date" => "24 July 2015",
|
|
||||||
"tags" => array(
|
|
||||||
"design", "artwork", "logo",
|
|
||||||
),
|
|
||||||
"author" => "",
|
|
||||||
"text" => "
|
|
||||||
This is the official Rangitaki logo.
|
|
||||||
|
|
||||||
![The Rangitaki logo](media/example.png)
|
|
||||||
|
|
||||||
It is saved in the example blog directory.
|
|
||||||
",
|
|
||||||
];
|
|
||||||
|
|
||||||
$this->assertEquals(
|
|
||||||
$result,
|
|
||||||
ArticleGenerator::getArray("articles/example/", "2015-07-25-example.md")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testGetText()
|
|
||||||
{
|
|
||||||
$result = "
|
|
||||||
This is the official Rangitaki logo.
|
|
||||||
|
|
||||||
![The Rangitaki logo](media/example.png)
|
|
||||||
|
|
||||||
It is saved in the example blog directory.
|
|
||||||
";
|
|
||||||
$this->assertEquals(
|
|
||||||
$result,
|
|
||||||
ArticleGenerator::getText("articles/example/", "2015-07-25-example.md")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testGetAuthor()
|
|
||||||
{
|
|
||||||
$result = "";
|
|
||||||
$this->assertEquals(
|
|
||||||
$result,
|
|
||||||
ArticleGenerator::getAuthor("articles/example/", "2015-07-25-example.md")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testGetSummary()
|
|
||||||
{
|
|
||||||
$result = "This is the official Rangitaki logo.";
|
|
||||||
$this->assertEquals(
|
|
||||||
$result,
|
|
||||||
ArticleGenerator::getSummary("articles/example/", "2015-07-25-example.md")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testGetTags()
|
|
||||||
{
|
|
||||||
$result = [ "design", "artwork", "logo" ];
|
|
||||||
$this->assertEquals(
|
|
||||||
$result,
|
|
||||||
ArticleGenerator::getTags("articles/example/", "2015-07-25-example.md")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testGetDate()
|
|
||||||
{
|
|
||||||
$result = "24 July 2015";
|
|
||||||
$this->assertEquals(
|
|
||||||
$result,
|
|
||||||
ArticleGenerator::getDate("articles/example/", "2015-07-25-example.md")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testGetTitle()
|
|
||||||
{
|
|
||||||
$result = "The Rangitaki logo 2";
|
|
||||||
$this->assertEquals(
|
|
||||||
$result,
|
|
||||||
ArticleGenerator::getTitle("articles/example/", "2015-07-25-example.md")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
|
||||||
|
|
||||||
require 'res/php/BlogListGenerator.php';
|
|
||||||
use mmk2410\rbe\BlogListGenerator\BlogListGenerator as BlogListGenerator;
|
|
||||||
|
|
||||||
class BlogListGeneratorTest extends TestCase
|
|
||||||
{
|
|
||||||
public function testListBlog()
|
|
||||||
{
|
|
||||||
$this->assertEquals("<a class='nav-item' href='./?blog=example'>Example</a>",
|
|
||||||
BlogListGenerator::listBlog("./blogs/", "example.md", "Example Blog")
|
|
||||||
);
|
|
||||||
$this->assertEquals("<a class='nav-item' href='https://mmk2410.org/rangitaki/docs/'>Docs</a>",
|
|
||||||
BlogListGenerator::listBlog("./blogs/", "external.md", "Example Blog")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testGetName()
|
|
||||||
{
|
|
||||||
$this->assertEquals("Example", BlogListGenerator::getName("blogs/example.md"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testGetArticleAmount()
|
|
||||||
{
|
|
||||||
$this->assertEquals(5, BlogListGenerator::getArticleAmount("example"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testGetExternaleLink()
|
|
||||||
{
|
|
||||||
$this->assertEquals(null,
|
|
||||||
BlogListGenerator::getExternalLink("example.md", '.')
|
|
||||||
);
|
|
||||||
$this->assertEquals("https://mmk2410.org/rangitaki/docs/",
|
|
||||||
BlogListGenerator::getExternalLink("external.md", '.')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,83 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace mmk2410\rbe\tests\config;
|
|
||||||
|
|
||||||
require_once 'PHPUnit/Autoload.php';
|
|
||||||
require 'res/php/Config.php';
|
|
||||||
|
|
||||||
use \mmk2410\rbe\config\Config as Config;
|
|
||||||
|
|
||||||
class ConfigTest extends \PHPUnit_Framework_TestCase
|
|
||||||
{
|
|
||||||
|
|
||||||
public function testGetConfig()
|
|
||||||
{
|
|
||||||
$config = [
|
|
||||||
"blog" => array(
|
|
||||||
"title" => "Example Blog",
|
|
||||||
"author" => "John",
|
|
||||||
"description" => "A short description of your blog",
|
|
||||||
"home" => "on",
|
|
||||||
"homeurl" => "../",
|
|
||||||
"homename" => "Home",
|
|
||||||
"mainname" => "",
|
|
||||||
"intro" => "on",
|
|
||||||
"disqus" => "rangitaki",
|
|
||||||
"analytics" => "",
|
|
||||||
"footer" =>
|
|
||||||
"Rangitaki 2016 <a href=\"https://gitlab.com/mmk2410/rangitaki\" target=\"blank\">\n gitlab.com/mmk2410/rangitaki</a>", "url" => "https://example.com/blog/",
|
|
||||||
),
|
|
||||||
"design" => array(
|
|
||||||
"fab" => "on",
|
|
||||||
"drawer" => "on",
|
|
||||||
"theme" => "material-light",
|
|
||||||
"pagination" => 0,
|
|
||||||
"favicon" => "http://example.com/res/img/favicon.png",
|
|
||||||
),
|
|
||||||
"rcc" => array(
|
|
||||||
"rcc" => "on",
|
|
||||||
"api" => "on",
|
|
||||||
),
|
|
||||||
"language" => "en",
|
|
||||||
];
|
|
||||||
|
|
||||||
$configParser = new Config("./config.yaml", "./vendor/autoload.php");
|
|
||||||
$this->assertEquals($config, $configParser->getConfig());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testWriteReadConfig()
|
|
||||||
{
|
|
||||||
$changedConfig = [
|
|
||||||
"blog" => array(
|
|
||||||
"title" => "Examples Blog",
|
|
||||||
"author" => "Wilson O'Sullivan",
|
|
||||||
"description" => "A long description of your blog",
|
|
||||||
"home" => "on",
|
|
||||||
"homeurl" => "../",
|
|
||||||
"homename" => "Exit",
|
|
||||||
"mainname" => "",
|
|
||||||
"intro" => "on",
|
|
||||||
"disqus" => "",
|
|
||||||
"analytics" => "",
|
|
||||||
"footer" =>
|
|
||||||
"pBlog 1102 <a href=\"https://gitlab.com/mmk2410/rangitaki\" target=\"blank\">
|
|
||||||
\n gitlab.com/mmk2410/rangitaki</a>", "url" => "https://example.com/blog/",
|
|
||||||
),
|
|
||||||
"design" => array(
|
|
||||||
"fab" => "off",
|
|
||||||
"drawer" => "off",
|
|
||||||
"theme" => "material-dark",
|
|
||||||
"pagination" => "-1",
|
|
||||||
"favicon" => "http://sample.com/res/img/favicon.png",
|
|
||||||
),
|
|
||||||
"rcc" => array(
|
|
||||||
"rcc" => "on",
|
|
||||||
"api" => "off",
|
|
||||||
),
|
|
||||||
"language" => "en",
|
|
||||||
];
|
|
||||||
$configParser = new Config("/tmp/config-test.yaml", "./vendor/autoload.php");
|
|
||||||
$configParser->writeConfig($changedConfig);
|
|
||||||
$this->assertEquals($changedConfig, $configParser->getConfig());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,3 +1,207 @@
|
||||||
body{font-family:"Roboto", sans-serif;background:#f6f6f6;color:#383838;background-image:url(//example.com/res/img/intro.svg);background-size:cover;background-attachment:fixed;background-position:top center;background-repeat:no-repeat}.header{background-color:rgba(0,0,0,0.45);position:fixed}.title{color:#fff;position:absolute}.title>a{color:#fff}.fadeout{background:-moz-linear-gradient(left, rgba(30,87,153,0) 0%, rgba(0,0,0,0.45) 100%);background:-webkit-linear-gradient(left, rgba(30,87,153,0) 0%, rgba(0,0,0,0.45) 100%);background:-o-linear-gradient(left, rgba(30,87,153,0) 0%, rgba(0,0,0,0.45) 100%);background:-ms-linear-gradient(left, rgba(30,87,153,0) 0%, rgba(0,0,0,0.45) 100%);background:linear-gradient(to right, rgba(30,87,153,0) 0%, rgba(0,0,0,0.45) 100%)}.nav{background-color:#fff;border-right:1px solid #e0e0e0}.nav-item,.nav-item-static{color:#383838}.nav-item{font-weight:600}.nav-item:active{background-color:#e2e2e2}.divider{border-bottom:1px solid #e0e0e0}.card{background:#fff;border-radius:2px;box-shadow:0 1px 1.5px 1.5px rgba(62,62,62,0.3)}.card a{color:#ff4415;text-decoration:none;border-bottom:1px solid transparent;border-bottom-color:transparent;transition:border-bottom-color 150ms ease-in-out 100ms}.card a:hover{border-bottom-color:#ff4415}.headline{font-size:24px;color:#383838 !important;text-decoration:none;border-bottom:none !important}.headline:hover{color:#ff4415 !important}.date{font-size:13px}.articletext{font-size:14px;line-height:24px}.author{font-size:13px}.tag{font-size:13px}.fab{background-color:#ff4415;box-shadow:0 1px 1.5px 1.5px rgba(62,62,62,0.3)}.subfab{background-color:#fff;box-shadow:0 1px 1.5px 1.5px rgba(62,62,62,0.3)}.button{border-width:1px;border-style:solid;text-transform:uppercase;-webkit-box-shadow:0 1px 1.5px 1.5px rgba(42,42,42,0.65);-moz-box-shadow:0 1px 1.5px 1.5px rgba(42,42,42,0.65);box-shadow:0 1px 1.5px 1.5px rgba(42,42,42,0.65);border-radius:2px;letter-spacing:0.4px;font-weight:700;font-size:14px;transition-property:box-shadow;transition-delay:50ms;transition-duration:125ms;transition-timing-function:ease;-o-transition-property:box-shadow;-o-transition-delay:50ms;-o-transition-duration:125ms;-o-transition-timing-function:ease;-moz-transition-property:box-shadow;-moz-transition-delay:50ms;-moz-transition-duration:125ms;-moz-transition-timing-function:ease;-webkit-transition-property:box-shadow;-webkit-transition-delay:50ms;-webkit-transition-duration:125ms;-webkit-transition-timing-function:ease}.button:hover,.button:hover{-webkit-box-shadow:0.5px 1.8px 2.1px 1.4px rgba(32,32,32,0.85);-moz-box-shadow:0.5px 1.8px 2.1px 1.4px rgba(32,32,32,0.85);box-shadow:0.5px 1.8px 2.1px 1.4px rgba(32,32,32,0.85)}.pag_next{background-color:#ff4415;border-color:#ff4415}.pag_prev{background-color:#fff;border-color:#fff;color:#383838}.footer{font-size:12px;text-align:center;color:#fff;text-shadow:1px 1px rgba(55,55,55,0.3)}.footer a{color:#fff;text-shadow:1px 1px rgba(175,175,175,0.3);text-decoration:none;border-bottom:1px solid transparent;border-bottom-color:transparent}.footer a:hover{border-bottom-color:#fff}@media screen and (min-width: 1440px){.nav{background-color:rgba(255,255,255,0.8)}}
|
/*
|
||||||
|
The MIT License
|
||||||
|
|
||||||
/*# sourceMappingURL=background-img.css.map */
|
Copyright 2015 mmk2410.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
Created on : Jun 18, 2015, 6:39:37 PM
|
||||||
|
Author : mmk2410
|
||||||
|
*/
|
||||||
|
|
||||||
|
body{
|
||||||
|
font-family: "Roboto", sans-serif;
|
||||||
|
background: #f6f6f6;
|
||||||
|
color: #383838;
|
||||||
|
background-image: url(//marcel-kapfer.de/res/img/intro.svg);
|
||||||
|
background-size: cover;
|
||||||
|
background-attachment: fixed;
|
||||||
|
background-position: top center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header{
|
||||||
|
background-color: rgba(0, 0, 0, 0.45);
|
||||||
|
position: fixed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title{
|
||||||
|
color: #fff;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title > a{
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fadeout{
|
||||||
|
background: -moz-linear-gradient(left, rgba(30,87,153,0) 0%, rgba(0, 0, 0, 0.45) 100%); /* FF3.6+ */
|
||||||
|
background: -webkit-linear-gradient(left, rgba(30,87,153,0) 0%,rgba(0, 0, 0, 0.45) 100%); /* Chrome10+,Safari5.1+ */
|
||||||
|
background: -o-linear-gradient(left, rgba(30,87,153,0) 0%,rgba(0, 0, 0, 0.45) 100%); /* Opera 11.10+ */
|
||||||
|
background: -ms-linear-gradient(left, rgba(30,87,153,0) 0%,rgba(0, 0, 0, 0.45) 100%); /* IE10+ */
|
||||||
|
background: linear-gradient(to right, rgba(30,87,153,0) 0%,rgba(0, 0, 0, 0.45) 100%); /* W3C */
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav{
|
||||||
|
background-color: #fff;
|
||||||
|
border-right: 1px solid #e0e0e0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item, .nav-item-static{
|
||||||
|
color: #383838;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item{
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item:active{
|
||||||
|
background-color: #e2e2e2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.divider{
|
||||||
|
border-bottom: 1px solid #e0e0e0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card{
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 2px;
|
||||||
|
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.card a{
|
||||||
|
color: #ff4415;
|
||||||
|
text-decoration: none;
|
||||||
|
border-bottom: 1px solid transparent;
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
transition: border-bottom-color 150ms ease-in-out 100ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card a:hover{
|
||||||
|
border-bottom-color: #ff4415;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headline{
|
||||||
|
font-size: 24px;
|
||||||
|
color: #383838!important;
|
||||||
|
text-decoration: none;
|
||||||
|
border-bottom: none!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headline:hover {
|
||||||
|
color: #ff4415!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date{
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.articletext{
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.author{
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag{
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fab{
|
||||||
|
background-color: #ff4415;
|
||||||
|
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.subfab{
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
text-transform: uppercase;
|
||||||
|
box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
|
||||||
|
-moz-box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
|
||||||
|
-webkit-box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
|
||||||
|
border-radius: 2px;
|
||||||
|
letter-spacing: 0.4px;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 14px;
|
||||||
|
transition-property: box-shadow;
|
||||||
|
transition-delay: 50ms;
|
||||||
|
transition-duration: 125ms;
|
||||||
|
transition-timing-function: ease;
|
||||||
|
-moz-transition-property: box-shadow;
|
||||||
|
-moz-transition-delay: 50ms;
|
||||||
|
-moz-transition-duration: 125ms;
|
||||||
|
-moz-transition-timing-function: ease;
|
||||||
|
-webkit-transition-property: box-shadow;
|
||||||
|
-webkit-transition-delay: 50ms;
|
||||||
|
-webkit-transition-duration: 125ms;
|
||||||
|
-webkit-transition-timing-function: ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button:hover, .button:hover {
|
||||||
|
box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85);
|
||||||
|
-moz-box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85);
|
||||||
|
-webkit-box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pag_next{
|
||||||
|
background-color: #ff4415;
|
||||||
|
border-color: #ff4415;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pag_prev{
|
||||||
|
background-color: #fff;
|
||||||
|
border-color: #fff;
|
||||||
|
color: #383838;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer{
|
||||||
|
font-size: 12px;
|
||||||
|
text-align: center;
|
||||||
|
color: #fff;
|
||||||
|
text-shadow: 1px 1px rgba(55, 55, 55, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer a{
|
||||||
|
color: #fff;
|
||||||
|
text-shadow: 1px 1px rgba(175, 175, 175, 0.3);
|
||||||
|
text-decoration: none;
|
||||||
|
border-bottom: 1px solid transparent;
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer a:hover{
|
||||||
|
border-bottom-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 1440px) {
|
||||||
|
|
||||||
|
.nav{
|
||||||
|
background-color: rgba(255, 255, 255, 0.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,3 +1,193 @@
|
||||||
body{font-family:"Roboto", sans-serif;background:#303030;color:#fff}.header{background-color:#212121;position:fixed;box-shadow:2px 0 2px 2px rgba(32,32,32,0.85)}.title{color:#fff;position:absolute}.title>a{color:#fff}.fadeout{background:-moz-linear-gradient(left, rgba(30,87,153,0) 0%, #212121 100%);background:-webkit-linear-gradient(left, rgba(30,87,153,0) 0%, #212121 100%);background:-o-linear-gradient(left, rgba(30,87,153,0) 0%, #212121 100%);background:-ms-linear-gradient(left, rgba(30,87,153,0) 0%, #212121 100%);background:linear-gradient(to right, rgba(30,87,153,0) 0%, #212121 100%)}.nav{background-color:#424242;border-right:1px solid #1f1f1f}.nav-item,.nav-item-static{color:#fff}.nav-item{font-weight:600}.nav-item:active{background-color:#383838}.divider{border-bottom:1px solid #1f1f1f}.card{background:#424242;border-radius:2px;box-shadow:0 1px 1.5px 1.5px rgba(42,42,42,0.65)}.card a{color:#ff4415;text-decoration:none;border-bottom:1px solid transparent;border-bottom-color:transparent;transition:border-bottom-color 150ms ease-in-out 100ms}.card a:hover{border-bottom-color:#ff4415}.headline{font-size:24px;color:#fff !important;text-decoration:none;border-bottom:none !important}.headline:hover{color:#ff4415 !important}.date{font-size:13px}.articletext{font-size:14px;line-height:24px}.author,.tag{font-size:13px}.fab{background-color:#ff4415;box-shadow:0 1px 1.5px 1.5px rgba(42,42,42,0.65)}.subfab{background-color:#424242;box-shadow:0 1px 1.5px 1.5px rgba(42,42,42,0.65)}.button{text-transform:uppercase;border-width:1px;border-style:solid;-webkit-box-shadow:0 1px 1.5px 1.5px rgba(42,42,42,0.65);-moz-box-shadow:0 1px 1.5px 1.5px rgba(42,42,42,0.65);box-shadow:0 1px 1.5px 1.5px rgba(42,42,42,0.65);border-radius:2px;letter-spacing:0.4px;font-weight:700;font-size:14px;transition-property:box-shadow;transition-delay:50ms;transition-duration:125ms;transition-timing-function:ease;-o-transition-property:box-shadow;-o-transition-delay:50ms;-o-transition-duration:125ms;-o-transition-timing-function:ease;-moz-transition-property:box-shadow;-moz-transition-delay:50ms;-moz-transition-duration:125ms;-moz-transition-timing-function:ease;-webkit-transition-property:box-shadow;-webkit-transition-delay:50ms;-webkit-transition-duration:125ms;-webkit-transition-timing-function:ease}.button:hover{-webkit-box-shadow:0.5px 1.8px 2.1px 1.4px rgba(32,32,32,0.85);-moz-box-shadow:0.5px 1.8px 2.1px 1.4px rgba(32,32,32,0.85);box-shadow:0.5px 1.8px 2.1px 1.4px rgba(32,32,32,0.85)}.pag_next{background-color:#ff4415;border-color:#ff4415}.pag_prev{background-color:#424242;border-color:#424242;color:#CCCCCC}.footer{font-size:12px;text-align:center;color:#fff}.footer a{color:#fff;text-decoration:none;border-bottom:1px solid transparent;border-bottom-color:transparent}.footer a:hover{border-bottom-color:#fff}
|
/*
|
||||||
|
The MIT License
|
||||||
|
|
||||||
/*# sourceMappingURL=material-dark.css.map */
|
Copyright 2015 mmk2410.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
Created on : Jun 18, 2015, 6:39:37 PM
|
||||||
|
Author : mmk2410
|
||||||
|
*/
|
||||||
|
|
||||||
|
body{
|
||||||
|
font-family: "Roboto", sans-serif;
|
||||||
|
background: #303030;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header{
|
||||||
|
background-color: #212121;
|
||||||
|
position: fixed;
|
||||||
|
box-shadow: 2px 0px 2px 2px rgba(32, 32, 32, 0.85);
|
||||||
|
}
|
||||||
|
|
||||||
|
.title{
|
||||||
|
color: #fff;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title > a{
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fadeout{
|
||||||
|
background: -moz-linear-gradient(left, rgba(30,87,153,0) 0%, #212121 100%); /* FF3.6+ */
|
||||||
|
background: -webkit-linear-gradient(left, rgba(30,87,153,0) 0%,#212121 100%); /* Chrome10+,Safari5.1+ */
|
||||||
|
background: -o-linear-gradient(left, rgba(30,87,153,0) 0%,#212121 100%); /* Opera 11.10+ */
|
||||||
|
background: -ms-linear-gradient(left, rgba(30,87,153,0) 0%,#212121 100%); /* IE10+ */
|
||||||
|
background: linear-gradient(to right, rgba(30,87,153,0) 0%,#212121 100%); /* W3C */
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav{
|
||||||
|
background-color: #424242;
|
||||||
|
border-right: 1px solid #1f1f1f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item, .nav-item-static{
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item{
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item:active{
|
||||||
|
background-color: #383838;
|
||||||
|
}
|
||||||
|
|
||||||
|
.divider{
|
||||||
|
border-bottom: 1px solid #1f1f1f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card{
|
||||||
|
background: #424242;
|
||||||
|
border-radius: 2px;
|
||||||
|
box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.card a{
|
||||||
|
color: #ff4415;
|
||||||
|
text-decoration: none;
|
||||||
|
border-bottom: 1px solid transparent;
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
transition: border-bottom-color 150ms ease-in-out 100ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card a:hover{
|
||||||
|
border-bottom-color: #ff4415;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headline{
|
||||||
|
font-size: 24px;
|
||||||
|
color: #fff!important;
|
||||||
|
text-decoration: none;
|
||||||
|
border-bottom: none!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headline:hover {
|
||||||
|
color: #ff4415!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date{
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.articletext{
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.author{
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag{
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fab{
|
||||||
|
background-color: #ff4415;
|
||||||
|
box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
|
||||||
|
}
|
||||||
|
|
||||||
|
.subfab{
|
||||||
|
background-color: #424242;
|
||||||
|
box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
|
||||||
|
}
|
||||||
|
|
||||||
|
.button{
|
||||||
|
text-transform: uppercase;
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
|
||||||
|
-moz-box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
|
||||||
|
-webkit-box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
|
||||||
|
border-radius: 2px;
|
||||||
|
letter-spacing: 0.4px;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 14px;
|
||||||
|
transition-property: box-shadow;
|
||||||
|
transition-delay: 50ms;
|
||||||
|
transition-duration: 125ms;
|
||||||
|
transition-timing-function: ease;
|
||||||
|
-moz-transition-property: box-shadow;
|
||||||
|
-moz-transition-delay: 50ms;
|
||||||
|
-moz-transition-duration: 125ms;
|
||||||
|
-moz-transition-timing-function: ease;
|
||||||
|
-webkit-transition-property: box-shadow;
|
||||||
|
-webkit-transition-delay: 50ms;
|
||||||
|
-webkit-transition-duration: 125ms;
|
||||||
|
-webkit-transition-timing-function: ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button:hover, .button:hover {
|
||||||
|
box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85);
|
||||||
|
-moz-box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85);
|
||||||
|
-webkit-box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pag_next{
|
||||||
|
background-color: #ff4415;
|
||||||
|
border-color: #ff4415;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pag_prev{
|
||||||
|
background-color: #424242;
|
||||||
|
border-color: #424242;
|
||||||
|
color: #CCCCCC;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer{
|
||||||
|
font-size: 12px;
|
||||||
|
text-align: center;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer a{
|
||||||
|
color: #fff;
|
||||||
|
text-decoration: none;
|
||||||
|
border-bottom: 1px solid transparent;
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer a:hover{
|
||||||
|
border-bottom-color: #fff;
|
||||||
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,3 +1,196 @@
|
||||||
body{font-family:"Roboto", sans-serif;background:#f6f6f6;color:#383838}.header{background-color:#ff4415;position:fixed;box-shadow:2px 0 2px 2px rgba(62,62,62,0.45)}.title{color:#fff;position:absolute}.title>a{color:#fff}.fadeout{background:-moz-linear-gradient(left, rgba(30,87,153,0) 0%, #ff4415 100%);background:-webkit-linear-gradient(left, rgba(30,87,153,0) 0%, #ff4415 100%);background:-o-linear-gradient(left, rgba(30,87,153,0) 0%, #ff4415 100%);background:-ms-linear-gradient(left, rgba(30,87,153,0) 0%, #ff4415 100%);background:linear-gradient(to right, rgba(30,87,153,0) 0%, #ff4415 100%)}.nav{background-color:#fff;border-right:1px solid #e0e0e0}.nav-item,.nav-item-static{color:#383838}.nav-item{font-weight:600}.nav-item:hover,.nav-item:active{background-color:#e2e2e2}.divider{border-bottom:1px solid #e0e0e0}.card{background:#fff;border-radius:2px;box-shadow:0 1px 1.5px 1.5px rgba(62,62,62,0.3)}.card a{color:#ff4415;text-decoration:none;border-bottom:1px solid transparent;border-bottom-color:transparent;transition:border-bottom-color 150ms ease-in-out 100ms}.card a:hover{border-bottom-color:#ff4415}.headline{font-size:24px;color:#383838 !important;text-decoration:none;border-bottom:none !important}.headline:hover{color:#ff4415 !important}.date{font-size:13px}.articletext{font-size:14px;line-height:24px}.author,.tag{font-size:13px}.fab{background-color:#ff4415;box-shadow:0 1px 1.5px 1.5px rgba(62,62,62,0.3)}.subfab{background-color:#fff;box-shadow:0 1px 1.5px 1.5px rgba(62,62,62,0.3)}.button{text-transform:uppercase;border-width:1px;border-style:solid;-webkit-box-shadow:0.4px 1px 1.5px 1px #aaa;-moz-box-shadow:0.4px 1px 1.5px 1px #aaa;box-shadow:0.4px 1px 1.5px 1px #aaa;border-radius:2px;letter-spacing:0.4px;font-weight:700;font-size:14px;transition-property:box-shadow;transition-delay:50ms;transition-duration:125ms;transition-timing-function:ease;-o-transition-property:box-shadow;-o-transition-delay:50ms;-o-transition-duration:125ms;-o-transition-timing-function:ease;-moz-transition-property:box-shadow;-moz-transition-delay:50ms;-moz-transition-duration:125ms;-moz-transition-timing-function:ease;-webkit-transition-property:box-shadow;-webkit-transition-delay:50ms;-webkit-transition-duration:125ms;-webkit-transition-timing-function:ease}.button:hover{-webkit-box-shadow:0.5px 1.8px 2.1px 1.4px #aaa;-moz-box-shadow:0.5px 1.8px 2.1px 1.4px #aaa;box-shadow:0.5px 1.8px 2.1px 1.4px #aaa}.pag_next{background-color:#ff4415;border-color:#ff4415}.pag_prev{background-color:#fff;border-color:#fff;color:#383838}.footer{font-size:12px;text-align:center}.footer a{color:#383838;text-decoration:none;border-bottom:1px solid transparent;border-bottom-color:transparent}.footer a:hover{border-bottom-color:#383838}
|
/*
|
||||||
|
The MIT License
|
||||||
|
|
||||||
/*# sourceMappingURL=material-light.css.map */
|
Copyright 2015 mmk2410.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
Created on : Jun 18, 2015, 6:39:37 PM
|
||||||
|
Author : mmk2410
|
||||||
|
*/
|
||||||
|
|
||||||
|
body{
|
||||||
|
font-family: "Roboto", sans-serif;
|
||||||
|
background: #f6f6f6;
|
||||||
|
color: #383838;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header{
|
||||||
|
background-color: #ff4415;
|
||||||
|
position: fixed;
|
||||||
|
box-shadow: 2px 0px 2px 2px rgba(62, 62, 62, 0.45);
|
||||||
|
}
|
||||||
|
|
||||||
|
.title{
|
||||||
|
color: #fff;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title > a{
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fadeout{
|
||||||
|
background: -moz-linear-gradient(left, rgba(30,87,153,0) 0%, #ff4415 100%); /* FF3.6+ */
|
||||||
|
background: -webkit-linear-gradient(left, rgba(30,87,153,0) 0%,#ff4415 100%); /* Chrome10+,Safari5.1+ */
|
||||||
|
background: -o-linear-gradient(left, rgba(30,87,153,0) 0%,#ff4415 100%); /* Opera 11.10+ */
|
||||||
|
background: -ms-linear-gradient(left, rgba(30,87,153,0) 0%,#ff4415 100%); /* IE10+ */
|
||||||
|
background: linear-gradient(to right, rgba(30,87,153,0) 0%,#ff4415 100%); /* W3C */
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav{
|
||||||
|
background-color: #fff;
|
||||||
|
border-right: 1px solid #e0e0e0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item, .nav-item-static{
|
||||||
|
color: #383838;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item{
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item:hover{
|
||||||
|
background-color: #e2e2e2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item:active{
|
||||||
|
background-color: #e2e2e2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.divider{
|
||||||
|
border-bottom: 1px solid #e0e0e0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card{
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 2px;
|
||||||
|
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.card a{
|
||||||
|
color: #ff4415;
|
||||||
|
text-decoration: none;
|
||||||
|
border-bottom: 1px solid transparent;
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
transition: border-bottom-color 150ms ease-in-out 100ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card a:hover{
|
||||||
|
border-bottom-color: #ff4415;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headline{
|
||||||
|
font-size: 24px;
|
||||||
|
color: #383838!important;
|
||||||
|
text-decoration: none;
|
||||||
|
border-bottom: none!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headline:hover {
|
||||||
|
color: #ff4415!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date{
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.articletext{
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.author{
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag{
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fab{
|
||||||
|
background-color: #ff4415;
|
||||||
|
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.subfab{
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
text-transform: uppercase;
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
box-shadow: 0.4px 1px 1.5px 1px #aaa;
|
||||||
|
-moz-box-shadow: 0.4px 1px 1.5px 1px #aaa;
|
||||||
|
-webkit-box-shadow: 0.4px 1px 1.5px 1px #aaa;
|
||||||
|
border-radius: 2px;
|
||||||
|
letter-spacing: 0.4px;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 14px;
|
||||||
|
transition-property: box-shadow;
|
||||||
|
transition-delay: 50ms;
|
||||||
|
transition-duration: 125ms;
|
||||||
|
transition-timing-function: ease;
|
||||||
|
-moz-transition-property: box-shadow;
|
||||||
|
-moz-transition-delay: 50ms;
|
||||||
|
-moz-transition-duration: 125ms;
|
||||||
|
-moz-transition-timing-function: ease;
|
||||||
|
-webkit-transition-property: box-shadow;
|
||||||
|
-webkit-transition-delay: 50ms;
|
||||||
|
-webkit-transition-duration: 125ms;
|
||||||
|
-webkit-transition-timing-function: ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button:hover, .button:hover {
|
||||||
|
box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa;
|
||||||
|
-moz-box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa;
|
||||||
|
-webkit-box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pag_next{
|
||||||
|
background-color: #ff4415;
|
||||||
|
border-color: #ff4415;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pag_prev{
|
||||||
|
background-color: #fff;
|
||||||
|
border-color: #fff;
|
||||||
|
color: #383838;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer{
|
||||||
|
font-size: 12px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer a{
|
||||||
|
color: #383838;
|
||||||
|
text-decoration: none;
|
||||||
|
border-bottom: 1px solid transparent;
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer a:hover{
|
||||||
|
border-bottom-color: #383838;
|
||||||
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,3 +0,0 @@
|
||||||
body{font-family:"Fira Sans",sans-serif;background:#f0f0f0;color:#383838;margin:130px 0 0}::selection,::-moz-selection{color:#f0f0f0;background-color:#4CAF50}.header{height:55px;background-color:#4CAF50;position:fixed;box-shadow:2px 0 2px 2px rgba(62,62,62,0.45)}.title{line-height:55px;color:#fff;position:absolute;left:0;margin-left:calc(20% + 24px)}.title>a{color:#fff;text-decoration:none}.fadeout{height:55px;background:-moz-linear-gradient(left, rgba(30,87,153,0) 0%, #4CAF50 100%);background:-webkit-linear-gradient(left, rgba(30,87,153,0) 0%, #4CAF50 100%);background:-o-linear-gradient(left, rgba(30,87,153,0) 0%, #4CAF50 100%);background:-ms-linear-gradient(left, rgba(30,87,153,0) 0%, #4CAF50 100%);background:linear-gradient(to right, rgba(30,87,153,0) 0%, #4CAF50 100%)}.nav-img{padding:14px 19px}.nav{background-color:#fff;border-right:1px solid #e0e0e0}.nav-item,.nav-item-static{color:#383838}.nav-item{font-weight:600}.nav-item:hover{color:#4CAF50}.nav-item:active{background-color:#e2e2e2}.divider{border-bottom:1px solid #e0e0e0}.card{background:none;border-radius:0;box-shadow:none;margin:0 20% 100px;width:auto}.card a{color:#4CAF50;text-decoration:none;border-bottom:1px solid transparent;transition:border-bottom-color 150ms ease-in-out 100ms}.card a:hover{border-bottom-color:#4CAF50}.headline{font-size:30px;line-height:50px;color:#383838 !important;text-decoration:none;border-bottom:none !important}.headline:hover{color:#4CAF50 !important}.date{font-size:13px}.articletext{margin-top:30px;font-size:16px;line-height:30px}.author,.tag{font-size:13px}.fab{background-color:#4CAF50;box-shadow:0 1px 1.5px 1.5px rgba(62,62,62,0.3)}.subfab{background-color:#fff;box-shadow:0 1px 1.5px 1.5px rgba(62,62,62,0.3)}.button{color:#4CAF50;border-bottom:1px solid transparent;margin:0;min-width:0;padding:0;line-height:16px;height:16px;transition-property:border-bottom-color;transition-delay:50ms;transition-duration:125ms;transition-timing-function:ease;-moz-transition-property:border-bottom-color;-moz-transition-delay:50ms;-moz-transition-duration:125ms;-moz-transition-timing-function:ease;-webkit-transition-property:border-bottom-color;-webkit-transition-delay:50ms;-webkit-transition-duration:125ms;-webkit-transition-timing-function:ease}.button:hover{border-bottom-color:#4CAF50}.pag_prev{float:left}.button:last-child{float:none}.footer{text-align:center;height:60px;background-color:#2D2D2D;line-height:60px;width:100%;color:#fff}.footer a{color:#fff;text-decoration:none;border-bottom:1px solid transparent}.footer a:hover{border-bottom-color:#fff}.hljs{background:none}@media screen and (min-width: 1440px){.title{margin-left:calc(20% - 40px)}.nav{padding-top:55px}}@media screen and (max-width: 800px){body{margin-top:80px}.title{margin-left:20%}.card{margin:0 5% 100px}}
|
|
||||||
|
|
||||||
/*# sourceMappingURL=nextDESIGN.css.map */
|
|
File diff suppressed because one or more lines are too long
|
@ -1,55 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# Update script for Rangitaki from version 1.2.1 to 1.3.0
|
|
||||||
|
|
||||||
version="1.3.0"
|
|
||||||
tmp="./rbe-tmp"
|
|
||||||
new="./rbe-new"
|
|
||||||
conf="./config.php"
|
|
||||||
|
|
||||||
echo "Downloading version $version from GitHub..."
|
|
||||||
mkdir $new
|
|
||||||
cd $new || exit
|
|
||||||
wget -c https://github.com/mmk2410/Rangitaki/archive/v"$version".zip
|
|
||||||
|
|
||||||
echo "Extracting"
|
|
||||||
unzip v"$version".zip
|
|
||||||
rm v"$version".zip
|
|
||||||
mv ./rangitaki-"$version"/* ./
|
|
||||||
rm ./rangitaki-"$version"
|
|
||||||
cd ../ || exit
|
|
||||||
mkdir $tmp
|
|
||||||
|
|
||||||
echo "Updating ressources..."
|
|
||||||
rm -rf ./res/php/
|
|
||||||
mv $new/res/php ./res/
|
|
||||||
|
|
||||||
echo "Updating RCC..."
|
|
||||||
cp ./rcc/password.php $tmp
|
|
||||||
rm -rf ./rcc
|
|
||||||
mv $new/rcc ./
|
|
||||||
rm ./rcc/password.php
|
|
||||||
mv $tmp/password.php ./rcc/
|
|
||||||
|
|
||||||
echo "Updating core..."
|
|
||||||
rm ./index.php
|
|
||||||
mv $new/index.php ./
|
|
||||||
|
|
||||||
echo "Preparing composer..."
|
|
||||||
mv $new/vendor ./
|
|
||||||
mv $new/composer.lock ./
|
|
||||||
mv $new/composer.json ./
|
|
||||||
|
|
||||||
echo "Creating empty feeds directory..."
|
|
||||||
mkdir ./feed
|
|
||||||
|
|
||||||
echo "Cleaning up..."
|
|
||||||
rm -rf $new
|
|
||||||
rm -rf $tmp
|
|
||||||
|
|
||||||
echo "Update config file..."
|
|
||||||
echo "// Blog URL - set here the url of your blog" >> $conf
|
|
||||||
echo -n 'Enter the blog URL:'
|
|
||||||
read -r url
|
|
||||||
echo "\$blogurl = \"$url\";" >> $conf
|
|
||||||
|
|
||||||
echo "Your Rangitaki installation is updated to version $version"
|
|
|
@ -1,80 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# Update script for Rangitaki from version 1.3.0 to 1.4.0
|
|
||||||
|
|
||||||
version="1.4.0"
|
|
||||||
new="./rbe-new"
|
|
||||||
|
|
||||||
echo "Downloading version $version from GitLab..."
|
|
||||||
git clone https://gitlab.com/mmk2410/rangitaki.git "$new"
|
|
||||||
|
|
||||||
if [[ $1 == "--debug" ]]; then
|
|
||||||
cd $new
|
|
||||||
git checkout master
|
|
||||||
cd ../
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Updating ressources..."
|
|
||||||
rm -rf ./res/
|
|
||||||
mv $new/res/ ./
|
|
||||||
|
|
||||||
echo "Updating extensions..."
|
|
||||||
rm ./extensions/example.js
|
|
||||||
mv $new/extensions/* ./extensions/
|
|
||||||
|
|
||||||
echo "Importing binaries..."
|
|
||||||
mv $new/bin/ ./
|
|
||||||
|
|
||||||
echo "Importing source files..."
|
|
||||||
mv $new/src/ ./
|
|
||||||
|
|
||||||
echo "Updating extensions..."
|
|
||||||
rm ./themes/material-light.css
|
|
||||||
rm ./themes/material-dark.css
|
|
||||||
rm ./themes/background-img.css
|
|
||||||
mv $new/themes/* ./themes/
|
|
||||||
|
|
||||||
echo "Updating RCC..."
|
|
||||||
rm -rf ./rcc
|
|
||||||
mv $new/rcc ./
|
|
||||||
rm ./rcc/password.php
|
|
||||||
|
|
||||||
echo "Updating core..."
|
|
||||||
rm ./index.php
|
|
||||||
mv $new/index.php ./
|
|
||||||
|
|
||||||
echo "Preparing composer..."
|
|
||||||
rm -rf ./vendor/
|
|
||||||
rm composer.lock
|
|
||||||
rm composer.json
|
|
||||||
mv $new/vendor ./
|
|
||||||
mv $new/composer.lock ./
|
|
||||||
mv $new/composer.json ./
|
|
||||||
|
|
||||||
echo "Preparing npm..."
|
|
||||||
mv $new/package.json ./
|
|
||||||
|
|
||||||
echo "Updating Changelog..."
|
|
||||||
|
|
||||||
if [ -f ./CHANGELOG.txt ]; then
|
|
||||||
rm CHANGELOG.txt
|
|
||||||
fi
|
|
||||||
|
|
||||||
mv $new/CHANGELOG.md ./
|
|
||||||
|
|
||||||
echo "Preparing gulp..."
|
|
||||||
mv $new/gulpfile.coffee ./
|
|
||||||
|
|
||||||
echo "Cleaning up..."
|
|
||||||
if [[ $1 != "--debug" ]]; then
|
|
||||||
rm -rf $new
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Update config file..."
|
|
||||||
php bin/config.php
|
|
||||||
|
|
||||||
if [ -d "./update-scripts" ]; then
|
|
||||||
echo "Remove obsolete update scripts folder."
|
|
||||||
rm -rf "./update-scripts"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Your Rangitaki installation is updated to version $version"
|
|
|
@ -1,70 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# Update script for Rangitaki from version 1.4.0 to 1.4.1
|
|
||||||
|
|
||||||
version="1.4.1"
|
|
||||||
new="./rbe-new"
|
|
||||||
|
|
||||||
echo -n "Downloading version $version from GitLab... "
|
|
||||||
git clone -q https://gitlab.com/mmk2410/rangitaki.git "$new"
|
|
||||||
|
|
||||||
if [[ $1 == "--debug" ]]; then
|
|
||||||
cd $new
|
|
||||||
git checkout master
|
|
||||||
cd ../
|
|
||||||
fi
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating ressources... "
|
|
||||||
rm -rf ./res/
|
|
||||||
mv $new/res/ ./
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating binaries... "
|
|
||||||
rm -rf ./bin
|
|
||||||
mv $new/bin/ ./
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating source files... "
|
|
||||||
rm -rf ./src
|
|
||||||
mv $new/src/ ./
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating RCC... "
|
|
||||||
rm -rf ./rcc
|
|
||||||
mv $new/rcc ./
|
|
||||||
rm ./rcc/password.php
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating core... "
|
|
||||||
rm ./index.php
|
|
||||||
mv $new/index.php ./
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating npm... "
|
|
||||||
mv $new/package.json ./
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating Changelog... "
|
|
||||||
|
|
||||||
if [ -f ./CHANGELOG.txt ]; then
|
|
||||||
rm CHANGELOG.txt
|
|
||||||
fi
|
|
||||||
|
|
||||||
mv $new/CHANGELOG.md ./
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
if [[ $1 != "--debug" ]]; then
|
|
||||||
echo -n "Cleaning up... "
|
|
||||||
rm -rf $new
|
|
||||||
echo "done"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d "./update-scripts" ]; then
|
|
||||||
echo -n "Remove obsolete update scripts folder... "
|
|
||||||
rm -rf "./update-scripts"
|
|
||||||
echo "done"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "$version" > ./VERSION
|
|
||||||
|
|
||||||
echo "Your Rangitaki installation is updated to version $version"
|
|
|
@ -1,48 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# Update script for Rangitaki from version 1.4.0 to 1.4.1
|
|
||||||
|
|
||||||
version="1.4.2"
|
|
||||||
new="./rbe-new"
|
|
||||||
|
|
||||||
echo -n "Downloading version $version from GitLab... "
|
|
||||||
git clone -q https://gitlab.com/mmk2410/rangitaki.git "$new"
|
|
||||||
|
|
||||||
if [[ $1 == "--debug" ]]; then
|
|
||||||
cd $new
|
|
||||||
git checkout master
|
|
||||||
cd ../
|
|
||||||
fi
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating RCC... "
|
|
||||||
mv ./rcc/password.php ./
|
|
||||||
rm -rf ./rcc
|
|
||||||
mv $new/rcc ./
|
|
||||||
rm ./rcc/password.php
|
|
||||||
mv ./password.php ./rcc/
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating Changelog... "
|
|
||||||
|
|
||||||
if [ -f ./CHANGELOG.txt ]; then
|
|
||||||
rm CHANGELOG.txt
|
|
||||||
fi
|
|
||||||
|
|
||||||
mv $new/CHANGELOG.md ./
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
if [[ $1 != "--debug" ]]; then
|
|
||||||
echo -n "Cleaning up... "
|
|
||||||
rm -rf $new
|
|
||||||
echo "done"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d "./update-scripts" ]; then
|
|
||||||
echo -n "Remove obsolete update scripts folder... "
|
|
||||||
rm -rf "./update-scripts"
|
|
||||||
echo "done"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "$version" > ./VERSION
|
|
||||||
|
|
||||||
echo "Your Rangitaki installation is updated to version $version"
|
|
|
@ -1,78 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# Update script for Rangitaki from version 1.4.2 to 1.4.3
|
|
||||||
# Also works from 1.4.0 to 1.4.3
|
|
||||||
|
|
||||||
version="1.4.3"
|
|
||||||
new="./rbe-new"
|
|
||||||
|
|
||||||
echo -n "Downloading version $version from GitLab... "
|
|
||||||
git clone -q https://gitlab.com/mmk2410/rangitaki.git "$new"
|
|
||||||
|
|
||||||
if [[ $1 == "--debug" ]]; then
|
|
||||||
cd $new
|
|
||||||
git checkout -q master
|
|
||||||
cd ../
|
|
||||||
fi
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating ressources... "
|
|
||||||
rm -rf ./res/
|
|
||||||
mv $new/res/ ./
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating source files... "
|
|
||||||
rm ./src/coffee/app.coffee
|
|
||||||
mv $new/src/coffee/app.coffee ./src/coffee/
|
|
||||||
mv $new/src/sass-themes/nextDESIGN.sass ./src/sass-themes/
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating RCC... "
|
|
||||||
rm -rf ./rcc
|
|
||||||
mv $new/rcc ./
|
|
||||||
rm ./rcc/password.php
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating core... "
|
|
||||||
rm ./index.php
|
|
||||||
mv $new/index.php ./
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating binaries... "
|
|
||||||
rm -rf ./bin
|
|
||||||
mv $new/bin/ ./
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating themes... "
|
|
||||||
rm ./themes/material-light.css*
|
|
||||||
rm ./themes/material-dark.css*
|
|
||||||
rm ./themes/background-img.css*
|
|
||||||
mv $new/themes/* ./themes/
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating npm... "
|
|
||||||
mv $new/package.json ./
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating Changelog... "
|
|
||||||
|
|
||||||
if [ -f ./CHANGELOG.txt ]; then
|
|
||||||
rm CHANGELOG.txt
|
|
||||||
fi
|
|
||||||
|
|
||||||
mv $new/CHANGELOG.md ./
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Cleaning up... "
|
|
||||||
if [[ $1 != "--debug" ]]; then
|
|
||||||
echo -n "Cleaning up... "
|
|
||||||
rm -rf $new
|
|
||||||
echo "done"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d "./update-scripts" ]; then
|
|
||||||
echo -n "Remove obsolete update scripts folder... "
|
|
||||||
rm -rf "./update-scripts"
|
|
||||||
echo "done"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Your Rangitaki installation is updated to version $version"
|
|
|
@ -1,51 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# Update script for Rangitaki from version 1.4.3 to 1.4.4
|
|
||||||
|
|
||||||
version="1.4.4"
|
|
||||||
new="./rbe-new"
|
|
||||||
|
|
||||||
echo -n "Downloading version $version from GitLab... "
|
|
||||||
git clone -q https://gitlab.com/mmk2410/rangitaki.git "$new"
|
|
||||||
|
|
||||||
if [[ $1 == "--debug" ]]; then
|
|
||||||
cd $new
|
|
||||||
git checkout -q master
|
|
||||||
cd ../
|
|
||||||
fi
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating RCC... "
|
|
||||||
mv ./rcc/password.php ./password.php
|
|
||||||
rm -rf ./rcc/
|
|
||||||
mv $new/rcc ./
|
|
||||||
rm ./rcc/password.php
|
|
||||||
mv ./password.php ./rcc/password.php
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating npm... "
|
|
||||||
mv $new/package.json ./
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating Changelog... "
|
|
||||||
|
|
||||||
if [ -f ./CHANGELOG.txt ]; then
|
|
||||||
rm CHANGELOG.txt
|
|
||||||
fi
|
|
||||||
|
|
||||||
mv $new/CHANGELOG.md ./
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Cleaning up... "
|
|
||||||
if [[ $1 != "--debug" ]]; then
|
|
||||||
echo -n "Cleaning up... "
|
|
||||||
rm -rf $new
|
|
||||||
echo "done"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d "./update-scripts" ]; then
|
|
||||||
echo -n "Remove obsolete update scripts folder... "
|
|
||||||
rm -rf "./update-scripts"
|
|
||||||
echo "done"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Your Rangitaki installation is updated to version $version"
|
|
|
@ -1,84 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# Update script for Rangitaki from version 1.4.4 to 1.5.0
|
|
||||||
|
|
||||||
version="1.5.0"
|
|
||||||
new="./rbe-new"
|
|
||||||
|
|
||||||
echo -n "Downloading version $version from GitLab... "
|
|
||||||
git clone -q https://gitlab.com/mmk2410/rangitaki.git "$new"
|
|
||||||
|
|
||||||
if [[ $1 == "--debug" ]]; then
|
|
||||||
cd $new
|
|
||||||
git checkout -q master
|
|
||||||
cd ../
|
|
||||||
fi
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating ressources... "
|
|
||||||
rm -rf ./res/
|
|
||||||
mv $new/res/ ./
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating languages... "
|
|
||||||
rm -rf ./lang/de.php
|
|
||||||
rm -rf ./lang/en.php
|
|
||||||
mv $new/lang/* ./lang/
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating source files... "
|
|
||||||
rm ./src/sass/rangitaki.sass
|
|
||||||
mv $new/src/sass/rangitaki.sass ./src/sass/
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating core... "
|
|
||||||
rm ./index.php
|
|
||||||
mv $new/index.php ./
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating binaries... "
|
|
||||||
rm -rf ./bin
|
|
||||||
mv $new/bin/ ./
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating themes... "
|
|
||||||
rm ./themes/material-light.css*
|
|
||||||
rm ./themes/material-dark.css*
|
|
||||||
rm ./themes/background-img.css*
|
|
||||||
rm ./themes/nextDESIGN.css*
|
|
||||||
mv $new/themes/* ./themes/
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating npm... "
|
|
||||||
mv $new/package.json ./
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n 'Updating config script... '
|
|
||||||
echo "social:" >> ./config.yaml
|
|
||||||
echo " twitter: ''" >> ./config.yaml
|
|
||||||
sed -i "s/design:/design:\n excerpt: 'off'/" config.yaml
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Updating Changelog... "
|
|
||||||
|
|
||||||
if [ -f ./CHANGELOG.txt ]; then
|
|
||||||
rm CHANGELOG.txt
|
|
||||||
fi
|
|
||||||
|
|
||||||
mv $new/CHANGELOG.md ./
|
|
||||||
echo "done"
|
|
||||||
|
|
||||||
echo -n "Cleaning up... "
|
|
||||||
if [[ $1 != "--debug" ]]; then
|
|
||||||
echo -n "Cleaning up... "
|
|
||||||
rm -rf $new
|
|
||||||
echo "done"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d "./update-scripts" ]; then
|
|
||||||
echo -n "Remove obsolete update scripts folder... "
|
|
||||||
rm -rf "./update-scripts"
|
|
||||||
echo "done"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Your Rangitaki installation is updated to version $version"
|
|
||||||
echo "Run php ./bin/init.php to use set the values for the new features."
|
|
7
vendor/autoload.php
vendored
7
vendor/autoload.php
vendored
|
@ -1,7 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
// autoload.php @generated by Composer
|
|
||||||
|
|
||||||
require_once __DIR__ . '/composer/autoload_real.php';
|
|
||||||
|
|
||||||
return ComposerAutoloaderInitd1db2574a85c0ba6f142743249ba228f::getLoader();
|
|
1
vendor/bin/picofeed
vendored
1
vendor/bin/picofeed
vendored
|
@ -1 +0,0 @@
|
||||||
../fguillot/picofeed/picofeed
|
|
19
vendor/codeguy/upload/LICENSE
vendored
19
vendor/codeguy/upload/LICENSE
vendored
|
@ -1,19 +0,0 @@
|
||||||
Copyright (c) 2012 Josh Lockhart
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is furnished
|
|
||||||
to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
75
vendor/codeguy/upload/README.md
vendored
75
vendor/codeguy/upload/README.md
vendored
|
@ -1,75 +0,0 @@
|
||||||
# Upload
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
This component simplifies file validation and uploading. Assume a file is uploaded with this HTML form:
|
|
||||||
|
|
||||||
<form action="" method="POST" enctype="multipart/form-data">
|
|
||||||
<input type="file" name="foo" value=""/>
|
|
||||||
<input type="submit" value="Upload File"/>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
When the HTML form is submitted, the server-side PHP code can validate and upload the file like this:
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$storage = new \Upload\Storage\FileSystem('/path/to/directory');
|
|
||||||
$file = new \Upload\File('foo', $storage);
|
|
||||||
|
|
||||||
// Optionally you can rename the file on upload
|
|
||||||
$new_filename = uniqid();
|
|
||||||
$file->setName($new_filename);
|
|
||||||
|
|
||||||
// Validate file upload
|
|
||||||
// MimeType List => http://www.webmaster-toolkit.com/mime-types.shtml
|
|
||||||
$file->addValidations(array(
|
|
||||||
// Ensure file is of type "image/png"
|
|
||||||
new \Upload\Validation\Mimetype('image/png'),
|
|
||||||
|
|
||||||
// Ensure file is no larger than 5M (use "B", "K", M", or "G")
|
|
||||||
new \Upload\Validation\Size('5M')
|
|
||||||
));
|
|
||||||
|
|
||||||
// Access data about the file that has been uploaded
|
|
||||||
$data = array(
|
|
||||||
'name' => $file->getNameWithExtension(),
|
|
||||||
'extension' => $file->getExtension(),
|
|
||||||
'mime' => $file->getMimetype(),
|
|
||||||
'size' => $file->getSize(),
|
|
||||||
'md5' => $file->getMd5(),
|
|
||||||
'dimensions' => $file->getDimensions()
|
|
||||||
);
|
|
||||||
|
|
||||||
// Try to upload file
|
|
||||||
try {
|
|
||||||
// Success!
|
|
||||||
$file->upload();
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
// Fail!
|
|
||||||
$errors = $file->getErrors();
|
|
||||||
}
|
|
||||||
|
|
||||||
## How to Install
|
|
||||||
|
|
||||||
Install composer in your project:
|
|
||||||
|
|
||||||
curl -s https://getcomposer.org/installer | php
|
|
||||||
|
|
||||||
Create a composer.json file in your project root:
|
|
||||||
|
|
||||||
{
|
|
||||||
"require": {
|
|
||||||
"codeguy/upload": "*"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Install via composer:
|
|
||||||
|
|
||||||
php composer.phar install
|
|
||||||
|
|
||||||
## Author
|
|
||||||
|
|
||||||
[Josh Lockhart](https://github.com/codeguy)
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
MIT Public License
|
|
25
vendor/codeguy/upload/composer.json
vendored
25
vendor/codeguy/upload/composer.json
vendored
|
@ -1,25 +0,0 @@
|
||||||
{
|
|
||||||
"name": "codeguy/upload",
|
|
||||||
"type": "library",
|
|
||||||
"description": "Handle file uploads with extensible validation and storage strategies",
|
|
||||||
"keywords": ["upload", "validation", "file"],
|
|
||||||
"homepage": "http://github.com/codeguy/Upload",
|
|
||||||
"license": "MIT",
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Josh Lockhart",
|
|
||||||
"email": "info@joshlockhart.com",
|
|
||||||
"homepage": "https://github.com/codeguy/"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.0",
|
|
||||||
"ext-fileinfo": "*"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "3.7.*"
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-0": { "Upload": "src" }
|
|
||||||
}
|
|
||||||
}
|
|
21
vendor/codeguy/upload/phpunit.xml
vendored
21
vendor/codeguy/upload/phpunit.xml
vendored
|
@ -1,21 +0,0 @@
|
||||||
<phpunit backupGlobals="true"
|
|
||||||
backupStaticAttributes="false"
|
|
||||||
colors="true"
|
|
||||||
convertErrorsToExceptions="true"
|
|
||||||
convertNoticesToExceptions="true"
|
|
||||||
convertWarningsToExceptions="true"
|
|
||||||
processIsolation="false"
|
|
||||||
stopOnFailure="false"
|
|
||||||
syntaxCheck="false"
|
|
||||||
bootstrap="tests/bootstrap.php">
|
|
||||||
<testsuites>
|
|
||||||
<testsuite name="Upload Test Suite">
|
|
||||||
<directory>./tests/</directory>
|
|
||||||
</testsuite>
|
|
||||||
</testsuites>
|
|
||||||
<filter>
|
|
||||||
<whitelist>
|
|
||||||
<directory>./src/Upload/</directory>
|
|
||||||
</whitelist>
|
|
||||||
</filter>
|
|
||||||
</phpunit>
|
|
77
vendor/codeguy/upload/src/Upload/Autoloader.php
vendored
77
vendor/codeguy/upload/src/Upload/Autoloader.php
vendored
|
@ -1,77 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* Upload
|
|
||||||
*
|
|
||||||
* @author Josh Lockhart <info@joshlockhart.com>
|
|
||||||
* @copyright 2012 Josh Lockhart
|
|
||||||
* @link http://www.joshlockhart.com
|
|
||||||
* @version 1.0.0
|
|
||||||
*
|
|
||||||
* MIT LICENSE
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
* a copy of this software and associated documentation files (the
|
|
||||||
* "Software"), to deal in the Software without restriction, including
|
|
||||||
* without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
* permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
* the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be
|
|
||||||
* included in all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
||||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
namespace Upload;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Autoloader
|
|
||||||
*
|
|
||||||
* This class provides a default PSR-0 autoloader if not using Composer.
|
|
||||||
*
|
|
||||||
* @author Josh Lockhart <info@joshlockhart.com>
|
|
||||||
* @since 1.0.0
|
|
||||||
* @package Upload
|
|
||||||
*/
|
|
||||||
class Autoloader
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* The project's base directory
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
static protected $base;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register autoloader
|
|
||||||
*/
|
|
||||||
static public function register()
|
|
||||||
{
|
|
||||||
self::$base = dirname(__FILE__) . '/../';
|
|
||||||
spl_autoload_register(array(new self, 'autoload'));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Autoload classname
|
|
||||||
* @param string $className The class to load
|
|
||||||
*/
|
|
||||||
static public function autoload($className)
|
|
||||||
{
|
|
||||||
$className = ltrim($className, '\\');
|
|
||||||
$fileName = '';
|
|
||||||
$namespace = '';
|
|
||||||
if ($lastNsPos = strripos($className, '\\')) {
|
|
||||||
$namespace = substr($className, 0, $lastNsPos);
|
|
||||||
$className = substr($className, $lastNsPos + 1);
|
|
||||||
$fileName = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
|
|
||||||
}
|
|
||||||
$fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
|
|
||||||
|
|
||||||
require self::$base . $fileName;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
<?php
|
|
||||||
namespace Upload\Exception;
|
|
||||||
|
|
||||||
class UploadException extends \RuntimeException
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
381
vendor/codeguy/upload/src/Upload/File.php
vendored
381
vendor/codeguy/upload/src/Upload/File.php
vendored
|
@ -1,381 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* Upload
|
|
||||||
*
|
|
||||||
* @author Josh Lockhart <info@joshlockhart.com>
|
|
||||||
* @copyright 2012 Josh Lockhart
|
|
||||||
* @link http://www.joshlockhart.com
|
|
||||||
* @version 1.0.0
|
|
||||||
*
|
|
||||||
* MIT LICENSE
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
* a copy of this software and associated documentation files (the
|
|
||||||
* "Software"), to deal in the Software without restriction, including
|
|
||||||
* without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
* permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
* the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be
|
|
||||||
* included in all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
||||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
namespace Upload;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* File
|
|
||||||
*
|
|
||||||
* This class provides the implementation for an uploaded file. It exposes
|
|
||||||
* common attributes for the uploaded file (e.g. name, extension, media type)
|
|
||||||
* and allows you to attach validations to the file that must pass for the
|
|
||||||
* upload to succeed.
|
|
||||||
*
|
|
||||||
* @author Josh Lockhart <info@joshlockhart.com>
|
|
||||||
* @since 1.0.0
|
|
||||||
* @package Upload
|
|
||||||
*/
|
|
||||||
class File extends \SplFileInfo
|
|
||||||
{
|
|
||||||
/********************************************************************************
|
|
||||||
* Static Properties
|
|
||||||
*******************************************************************************/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Upload error code messages
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected static $errorCodeMessages = array(
|
|
||||||
1 => 'The uploaded file exceeds the upload_max_filesize directive in php.ini',
|
|
||||||
2 => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',
|
|
||||||
3 => 'The uploaded file was only partially uploaded',
|
|
||||||
4 => 'No file was uploaded',
|
|
||||||
6 => 'Missing a temporary folder',
|
|
||||||
7 => 'Failed to write file to disk',
|
|
||||||
8 => 'A PHP extension stopped the file upload'
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Lookup hash to convert file units to bytes
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected static $units = array(
|
|
||||||
'b' => 1,
|
|
||||||
'k' => 1024,
|
|
||||||
'm' => 1048576,
|
|
||||||
'g' => 1073741824
|
|
||||||
);
|
|
||||||
|
|
||||||
/********************************************************************************
|
|
||||||
* Instance Properties
|
|
||||||
*******************************************************************************/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Storage delegate
|
|
||||||
* @var \Upload\Storage\Base
|
|
||||||
*/
|
|
||||||
protected $storage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validations
|
|
||||||
* @var array[\Upload\Validation\Base]
|
|
||||||
*/
|
|
||||||
protected $validations;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validation errors
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $errors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Original file name provided by client (for internal use only)
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $originalName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* File name (without extension)
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* File extension (without leading dot)
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $extension;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* File mimetype (e.g. "image/png")
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $mimetype;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Upload error code (for internal use only)
|
|
||||||
* @var int
|
|
||||||
* @link http://www.php.net/manual/en/features.file-upload.errors.php
|
|
||||||
*/
|
|
||||||
protected $errorCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
* @param string $key The file's key in $_FILES superglobal
|
|
||||||
* @param \Upload\Storage\Base $storage The method with which to store file
|
|
||||||
* @throws \Upload\Exception\UploadException If file uploads are disabled in the php.ini file
|
|
||||||
* @throws \InvalidArgumentException If $_FILES key does not exist
|
|
||||||
*/
|
|
||||||
public function __construct($key, \Upload\Storage\Base $storage)
|
|
||||||
{
|
|
||||||
if (!isset($_FILES[$key])) {
|
|
||||||
throw new \InvalidArgumentException("Cannot find uploaded file identified by key: $key");
|
|
||||||
}
|
|
||||||
$this->storage = $storage;
|
|
||||||
$this->validations = array();
|
|
||||||
$this->errors = array();
|
|
||||||
$this->originalName = $_FILES[$key]['name'];
|
|
||||||
$this->errorCode = $_FILES[$key]['error'];
|
|
||||||
parent::__construct($_FILES[$key]['tmp_name']);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get name
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getName()
|
|
||||||
{
|
|
||||||
if (!isset($this->name)) {
|
|
||||||
$this->name = pathinfo($this->originalName, PATHINFO_FILENAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set name (without extension)
|
|
||||||
* @param string $name
|
|
||||||
* @return \Upload\File Self
|
|
||||||
*/
|
|
||||||
public function setName($name)
|
|
||||||
{
|
|
||||||
$this->name = $name;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get file name with extension
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getNameWithExtension()
|
|
||||||
{
|
|
||||||
return sprintf('%s.%s', $this->getName(), $this->getExtension());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get file extension (without leading dot)
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getExtension()
|
|
||||||
{
|
|
||||||
if (!isset($this->extension)) {
|
|
||||||
$this->extension = strtolower(pathinfo($this->originalName, PATHINFO_EXTENSION));
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->extension;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get mimetype
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getMimetype()
|
|
||||||
{
|
|
||||||
if (!isset($this->mimeType)) {
|
|
||||||
$finfo = new \finfo(FILEINFO_MIME);
|
|
||||||
$mimetype = $finfo->file($this->getPathname());
|
|
||||||
$mimetypeParts = preg_split('/\s*[;,]\s*/', $mimetype);
|
|
||||||
$this->mimetype = strtolower($mimetypeParts[0]);
|
|
||||||
unset($finfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->mimetype;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get md5
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getMd5()
|
|
||||||
{
|
|
||||||
return md5_file($this->getPathname());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get image dimensions
|
|
||||||
* @return array formatted array of dimensions
|
|
||||||
*/
|
|
||||||
public function getDimensions()
|
|
||||||
{
|
|
||||||
list($width, $height) = getimagesize($this->getPathname());
|
|
||||||
return array(
|
|
||||||
'width' => $width,
|
|
||||||
'height' => $height
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/********************************************************************************
|
|
||||||
* Validate
|
|
||||||
*******************************************************************************/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add file validations
|
|
||||||
* @param \Upload\Validation\Base|array[\Upload\Validation\Base] $validations
|
|
||||||
*/
|
|
||||||
public function addValidations($validations)
|
|
||||||
{
|
|
||||||
if (!is_array($validations)) {
|
|
||||||
$validations = array($validations);
|
|
||||||
}
|
|
||||||
foreach ($validations as $validation) {
|
|
||||||
if ($validation instanceof \Upload\Validation\Base) {
|
|
||||||
$this->validations[] = $validation;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get file validations
|
|
||||||
* @return array[\Upload\Validation\Base]
|
|
||||||
*/
|
|
||||||
public function getValidations()
|
|
||||||
{
|
|
||||||
return $this->validations;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validate file
|
|
||||||
* @return bool True if valid, false if invalid
|
|
||||||
*/
|
|
||||||
public function validate()
|
|
||||||
{
|
|
||||||
// Validate is uploaded OK
|
|
||||||
if ($this->isOk() === false) {
|
|
||||||
$this->errors[] = self::$errorCodeMessages[$this->errorCode];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Validate is uploaded file
|
|
||||||
if ($this->isUploadedFile() === false) {
|
|
||||||
$this->errors[] = 'The uploaded file was not sent with a POST request';
|
|
||||||
}
|
|
||||||
|
|
||||||
// User validations
|
|
||||||
foreach ($this->validations as $validation) {
|
|
||||||
if ($validation->validate($this) === false) {
|
|
||||||
$this->errors[] = $validation->getMessage();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return empty($this->errors);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get file validation errors
|
|
||||||
* @return array[String]
|
|
||||||
*/
|
|
||||||
public function getErrors()
|
|
||||||
{
|
|
||||||
return $this->errors;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add file validation error
|
|
||||||
* @param string
|
|
||||||
* @return \Upload\File Self
|
|
||||||
*/
|
|
||||||
public function addError($error)
|
|
||||||
{
|
|
||||||
$this->errors[] = $error;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/********************************************************************************
|
|
||||||
* Upload
|
|
||||||
*******************************************************************************/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Upload file (delegated to storage object)
|
|
||||||
* @param string $newName Give the file it a new name
|
|
||||||
* @return bool
|
|
||||||
* @throws \Upload\Exception\UploadException If file does not validate
|
|
||||||
*/
|
|
||||||
public function upload($newName = null)
|
|
||||||
{
|
|
||||||
if ($this->validate() === false) {
|
|
||||||
throw new \Upload\Exception\UploadException('File validation failed');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update the name, leaving out the extension
|
|
||||||
if (is_string($newName)) {
|
|
||||||
$this->name = pathinfo($newName, PATHINFO_FILENAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->storage->upload($this, $newName);
|
|
||||||
}
|
|
||||||
|
|
||||||
/********************************************************************************
|
|
||||||
* Helpers
|
|
||||||
*******************************************************************************/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Is this file uploaded with a POST request?
|
|
||||||
*
|
|
||||||
* This is a separate method so that it can be stubbed in unit tests to avoid
|
|
||||||
* the hard dependency on the `is_uploaded_file` function.
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function isUploadedFile()
|
|
||||||
{
|
|
||||||
return is_uploaded_file($this->getPathname());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Is this file OK?
|
|
||||||
*
|
|
||||||
* This method inspects the upload error code to see if the upload was
|
|
||||||
* successful or if it failed for a variety of reasons.
|
|
||||||
*
|
|
||||||
* @link http://www.php.net/manual/en/features.file-upload.errors.php
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function isOk()
|
|
||||||
{
|
|
||||||
return ($this->errorCode === UPLOAD_ERR_OK);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert human readable file size (e.g. "10K" or "3M") into bytes
|
|
||||||
* @param string $input
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
public static function humanReadableToBytes($input)
|
|
||||||
{
|
|
||||||
$number = (int)$input;
|
|
||||||
$unit = strtolower(substr($input, -1));
|
|
||||||
if (isset(self::$units[$unit])) {
|
|
||||||
$number = $number * self::$units[$unit];
|
|
||||||
}
|
|
||||||
|
|
||||||
return $number;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* Upload
|
|
||||||
*
|
|
||||||
* @author Josh Lockhart <info@joshlockhart.com>
|
|
||||||
* @copyright 2012 Josh Lockhart
|
|
||||||
* @link http://www.joshlockhart.com
|
|
||||||
* @version 1.0.0
|
|
||||||
*
|
|
||||||
* MIT LICENSE
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
* a copy of this software and associated documentation files (the
|
|
||||||
* "Software"), to deal in the Software without restriction, including
|
|
||||||
* without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
* permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
* the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be
|
|
||||||
* included in all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
||||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
namespace Upload\Storage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Upload Storage Base
|
|
||||||
*
|
|
||||||
* This class defines the interface that must be implemented by each
|
|
||||||
* concrete Upload storage subclass.
|
|
||||||
*
|
|
||||||
* @author Josh Lockhart <info@joshlockhart.com>
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
abstract class Base
|
|
||||||
{
|
|
||||||
abstract public function upload(\Upload\File $file, $newName = null);
|
|
||||||
}
|
|
|
@ -1,114 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* Upload
|
|
||||||
*
|
|
||||||
* @author Josh Lockhart <info@joshlockhart.com>
|
|
||||||
* @copyright 2012 Josh Lockhart
|
|
||||||
* @link http://www.joshlockhart.com
|
|
||||||
* @version 1.0.0
|
|
||||||
*
|
|
||||||
* MIT LICENSE
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
* a copy of this software and associated documentation files (the
|
|
||||||
* "Software"), to deal in the Software without restriction, including
|
|
||||||
* without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
* permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
* the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be
|
|
||||||
* included in all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
||||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
namespace Upload\Storage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* FileSystem Storage
|
|
||||||
*
|
|
||||||
* This class uploads files to a designated directory on the filesystem.
|
|
||||||
*
|
|
||||||
* @author Josh Lockhart <info@joshlockhart.com>
|
|
||||||
* @since 1.0.0
|
|
||||||
* @package Upload
|
|
||||||
*/
|
|
||||||
class FileSystem extends \Upload\Storage\Base
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Upload directory
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $directory;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Overwrite existing files?
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
protected $overwrite;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
* @param string $directory Relative or absolute path to upload directory
|
|
||||||
* @param bool $overwrite Should this overwrite existing files?
|
|
||||||
* @throws \InvalidArgumentException If directory does not exist
|
|
||||||
* @throws \InvalidArgumentException If directory is not writable
|
|
||||||
*/
|
|
||||||
public function __construct($directory, $overwrite = false)
|
|
||||||
{
|
|
||||||
if (!is_dir($directory)) {
|
|
||||||
throw new \InvalidArgumentException('Directory does not exist');
|
|
||||||
}
|
|
||||||
if (!is_writable($directory)) {
|
|
||||||
throw new \InvalidArgumentException('Directory is not writable');
|
|
||||||
}
|
|
||||||
$this->directory = rtrim($directory, '/') . DIRECTORY_SEPARATOR;
|
|
||||||
$this->overwrite = $overwrite;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Upload
|
|
||||||
* @param \Upload\File $file The file object to upload
|
|
||||||
* @param string $newName Give the file it a new name
|
|
||||||
* @return bool
|
|
||||||
* @throws \RuntimeException If overwrite is false and file already exists
|
|
||||||
*/
|
|
||||||
public function upload(\Upload\File $file, $newName = null)
|
|
||||||
{
|
|
||||||
if (is_string($newName)) {
|
|
||||||
$fileName = strpos($newName, '.') ? $newName : $newName.'.'.$file->getExtension();
|
|
||||||
|
|
||||||
} else {
|
|
||||||
$fileName = $file->getNameWithExtension();
|
|
||||||
}
|
|
||||||
|
|
||||||
$newFile = $this->directory . $fileName;
|
|
||||||
if ($this->overwrite === false && file_exists($newFile)) {
|
|
||||||
$file->addError('File already exists');
|
|
||||||
throw new \Upload\Exception\UploadException('File already exists');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->moveUploadedFile($file->getPathname(), $newFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Move uploaded file
|
|
||||||
*
|
|
||||||
* This method allows us to stub this method in unit tests to avoid
|
|
||||||
* hard dependency on the `move_uploaded_file` function.
|
|
||||||
*
|
|
||||||
* @param string $source The source file
|
|
||||||
* @param string $destination The destination file
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
protected function moveUploadedFile($source, $destination)
|
|
||||||
{
|
|
||||||
return move_uploaded_file($source, $destination);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,75 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* Upload
|
|
||||||
*
|
|
||||||
* @author Josh Lockhart <info@joshlockhart.com>
|
|
||||||
* @copyright 2012 Josh Lockhart
|
|
||||||
* @link http://www.joshlockhart.com
|
|
||||||
* @version 1.0.0
|
|
||||||
*
|
|
||||||
* MIT LICENSE
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
* a copy of this software and associated documentation files (the
|
|
||||||
* "Software"), to deal in the Software without restriction, including
|
|
||||||
* without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
* permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
* the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be
|
|
||||||
* included in all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
||||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
namespace Upload\Validation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Upload Validation Base
|
|
||||||
*
|
|
||||||
* This class provides the common implementation and abstract interface
|
|
||||||
* for all concrete Upload validation subclasses.
|
|
||||||
*
|
|
||||||
* @author Josh Lockhart <info@joshlockhart.com>
|
|
||||||
* @since 1.0.0
|
|
||||||
* @package Upload
|
|
||||||
*/
|
|
||||||
abstract class Base
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* The error message for this validation
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $message;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set error message
|
|
||||||
* @param string $message
|
|
||||||
*/
|
|
||||||
public function setMessage($message)
|
|
||||||
{
|
|
||||||
$this->message = $message;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get error message
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getMessage()
|
|
||||||
{
|
|
||||||
return $this->message;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validate file
|
|
||||||
* @param \Upload\File $file
|
|
||||||
* @return bool True if file is valid, false if file is not valid
|
|
||||||
*/
|
|
||||||
abstract public function validate(\Upload\File $file);
|
|
||||||
}
|
|
|
@ -1,95 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* Upload
|
|
||||||
*
|
|
||||||
* @author Josh Lockhart <info@joshlockhart.com>
|
|
||||||
* @copyright 2012 Josh Lockhart
|
|
||||||
* @link http://www.joshlockhart.com
|
|
||||||
* @version 1.0.0
|
|
||||||
*
|
|
||||||
* MIT LICENSE
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
* a copy of this software and associated documentation files (the
|
|
||||||
* "Software"), to deal in the Software without restriction, including
|
|
||||||
* without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
* permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
* the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be
|
|
||||||
* included in all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
||||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
namespace Upload\Validation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validate File Extension
|
|
||||||
*
|
|
||||||
* This class validates an uploads file extension. It takes file extension with out dot
|
|
||||||
* or array of extensions. For example: 'png' or array('jpg', 'png', 'gif').
|
|
||||||
*
|
|
||||||
* WARING! Validation only by file extension not very secure.
|
|
||||||
*
|
|
||||||
* @author Alex Kucherenko <kucherenko.email@gmail.com>
|
|
||||||
* @package Upload
|
|
||||||
*/
|
|
||||||
class Extension extends \Upload\Validation\Base
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Array of cceptable file extensions without leading dots
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $allowedExtensions;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Error message
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $message = 'Invalid file extension. Must be one of: %s';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
*
|
|
||||||
* @param string|array $allowedExtensions Allowed file extensions
|
|
||||||
* @example new \Upload\Validation\Extension(array('png','jpg','gif'))
|
|
||||||
* @example new \Upload\Validation\Extension('png')
|
|
||||||
*/
|
|
||||||
public function __construct($allowedExtensions)
|
|
||||||
{
|
|
||||||
if (is_string($allowedExtensions)) {
|
|
||||||
$allowedExtensions = array($allowedExtensions);
|
|
||||||
}
|
|
||||||
|
|
||||||
array_filter($allowedExtensions, function ($val) {
|
|
||||||
return strtolower($val);
|
|
||||||
});
|
|
||||||
|
|
||||||
$this->allowedExtensions = $allowedExtensions;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validate
|
|
||||||
* @param \Upload\File $file
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function validate(\Upload\File $file)
|
|
||||||
{
|
|
||||||
$fileExtension = strtolower($file->getExtension());
|
|
||||||
$isValid = true;
|
|
||||||
|
|
||||||
if (!in_array($fileExtension, $this->allowedExtensions)) {
|
|
||||||
$this->setMessage(sprintf($this->message, implode(', ', $this->allowedExtensions)));
|
|
||||||
$isValid = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $isValid;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,77 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* Upload
|
|
||||||
*
|
|
||||||
* @author Josh Lockhart <info@joshlockhart.com>
|
|
||||||
* @copyright 2012 Josh Lockhart
|
|
||||||
* @link http://www.joshlockhart.com
|
|
||||||
* @version 1.0.0
|
|
||||||
*
|
|
||||||
* MIT LICENSE
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
* a copy of this software and associated documentation files (the
|
|
||||||
* "Software"), to deal in the Software without restriction, including
|
|
||||||
* without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
* permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
* the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be
|
|
||||||
* included in all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
||||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
namespace Upload\Validation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validate Upload Media Type
|
|
||||||
*
|
|
||||||
* This class validates an upload's media type (e.g. "image/png").
|
|
||||||
*
|
|
||||||
* @author Josh Lockhart <info@joshlockhart.com>
|
|
||||||
* @since 1.0.0
|
|
||||||
* @package Upload
|
|
||||||
*/
|
|
||||||
class Mimetype extends \Upload\Validation\Base
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Valid media types
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $mimetypes;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Error message
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $message = 'Invalid mimetype';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
* @param array $mimetypes Array of valid mimetypes
|
|
||||||
*/
|
|
||||||
public function __construct($mimetypes)
|
|
||||||
{
|
|
||||||
if (!is_array($mimetypes)) {
|
|
||||||
$mimetypes = array($mimetypes);
|
|
||||||
}
|
|
||||||
$this->mimetypes = $mimetypes;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validate
|
|
||||||
* @param \Upload\File $file
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function validate(\Upload\File $file)
|
|
||||||
{
|
|
||||||
return in_array($file->getMimetype(), $this->mimetypes);
|
|
||||||
}
|
|
||||||
}
|
|
104
vendor/codeguy/upload/src/Upload/Validation/Size.php
vendored
104
vendor/codeguy/upload/src/Upload/Validation/Size.php
vendored
|
@ -1,104 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* Upload
|
|
||||||
*
|
|
||||||
* @author Josh Lockhart <info@joshlockhart.com>
|
|
||||||
* @copyright 2012 Josh Lockhart
|
|
||||||
* @link http://www.joshlockhart.com
|
|
||||||
* @version 1.0.0
|
|
||||||
*
|
|
||||||
* MIT LICENSE
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
* a copy of this software and associated documentation files (the
|
|
||||||
* "Software"), to deal in the Software without restriction, including
|
|
||||||
* without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
* permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
* the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be
|
|
||||||
* included in all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
||||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
namespace Upload\Validation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validate Upload File Size
|
|
||||||
*
|
|
||||||
* This class validates an uploads file size using maximum and (optionally)
|
|
||||||
* minimum file size bounds (inclusive). Specify acceptable file sizes
|
|
||||||
* as an integer (in bytes) or as a human-readable string (e.g. "5MB").
|
|
||||||
*
|
|
||||||
* @author Josh Lockhart <info@joshlockhart.com>
|
|
||||||
* @since 1.0.0
|
|
||||||
* @package Upload
|
|
||||||
*/
|
|
||||||
class Size extends \Upload\Validation\Base
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Minimum acceptable file size (bytes)
|
|
||||||
* @var int
|
|
||||||
*/
|
|
||||||
protected $minSize;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Maximum acceptable file size (bytes)
|
|
||||||
* @var int
|
|
||||||
*/
|
|
||||||
protected $maxSize;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Error message
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $message = 'Invalid file size';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
* @param int $maxSize Maximum acceptable file size in bytes (inclusive)
|
|
||||||
* @param int $minSize Minimum acceptable file size in bytes (inclusive)
|
|
||||||
*/
|
|
||||||
public function __construct($maxSize, $minSize = 0)
|
|
||||||
{
|
|
||||||
if (is_string($maxSize)) {
|
|
||||||
$maxSize = \Upload\File::humanReadableToBytes($maxSize);
|
|
||||||
}
|
|
||||||
$this->maxSize = $maxSize;
|
|
||||||
|
|
||||||
if (is_string($minSize)) {
|
|
||||||
$minSize = \Upload\File::humanReadableToBytes($minSize);
|
|
||||||
}
|
|
||||||
$this->minSize = $minSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validate
|
|
||||||
* @param \Upload\File $file
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function validate(\Upload\File $file)
|
|
||||||
{
|
|
||||||
$fileSize = $file->getSize();
|
|
||||||
$isValid = true;
|
|
||||||
|
|
||||||
if ($fileSize < $this->minSize) {
|
|
||||||
$this->setMessage('File size is too small');
|
|
||||||
$isValid = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($fileSize > $this->maxSize) {
|
|
||||||
$this->setMessage('File size is too large');
|
|
||||||
$isValid = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $isValid;
|
|
||||||
}
|
|
||||||
}
|
|
176
vendor/codeguy/upload/tests/FileTest.php
vendored
176
vendor/codeguy/upload/tests/FileTest.php
vendored
|
@ -1,176 +0,0 @@
|
||||||
<?php
|
|
||||||
class FileTest extends PHPUnit_Framework_TestCase
|
|
||||||
{
|
|
||||||
protected $assetsDirectory;
|
|
||||||
|
|
||||||
protected $storage;
|
|
||||||
|
|
||||||
/********************************************************************************
|
|
||||||
* Setup
|
|
||||||
*******************************************************************************/
|
|
||||||
|
|
||||||
public function setUp()
|
|
||||||
{
|
|
||||||
$this->assetsDirectory = dirname(__FILE__) . '/assets';
|
|
||||||
$_FILES['foo'] = array(
|
|
||||||
'name' => 'foo.txt',
|
|
||||||
'tmp_name' => $this->assetsDirectory . '/foo.txt',
|
|
||||||
'error' => UPLOAD_ERR_OK
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getNewFile()
|
|
||||||
{
|
|
||||||
if (is_null($this->storage)) {
|
|
||||||
// Prepare storage
|
|
||||||
$this->storage = $this->getMock(
|
|
||||||
'\Upload\Storage\FileSystem',
|
|
||||||
array('upload'),
|
|
||||||
array($this->assetsDirectory)
|
|
||||||
);
|
|
||||||
$this->storage->expects($this->any())
|
|
||||||
->method('upload')
|
|
||||||
->will($this->returnValue(true));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prepare file
|
|
||||||
$file = $this->getMock(
|
|
||||||
'\Upload\File',
|
|
||||||
array('isUploadedFile'),
|
|
||||||
array('foo', $this->storage)
|
|
||||||
);
|
|
||||||
$file->expects($this->any())
|
|
||||||
->method('isUploadedFile')
|
|
||||||
->will($this->returnValue(true));
|
|
||||||
|
|
||||||
return $file;
|
|
||||||
}
|
|
||||||
|
|
||||||
/********************************************************************************
|
|
||||||
* Tests
|
|
||||||
*******************************************************************************/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException \InvalidArgumentException
|
|
||||||
*/
|
|
||||||
public function testConstructionWithInvalidKey()
|
|
||||||
{
|
|
||||||
$file = new \Upload\File('bar', new \Upload\Storage\FileSystem($this->assetsDirectory));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testGetName()
|
|
||||||
{
|
|
||||||
$file = $this->getNewFile();
|
|
||||||
$this->assertEquals('foo', $file->getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testGetNameWithExtension()
|
|
||||||
{
|
|
||||||
$file = $this->getNewFile();
|
|
||||||
$this->assertEquals('foo.txt', $file->getNameWithExtension());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testGetNameWithExtensionUsingCustomName()
|
|
||||||
{
|
|
||||||
$file = $this->getNewFile();
|
|
||||||
$file->setName('bar');
|
|
||||||
$this->assertEquals('bar.txt', $file->getNameWithExtension());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testGetMimetype()
|
|
||||||
{
|
|
||||||
$file = $this->getNewFile();
|
|
||||||
$this->assertEquals('text/plain', $file->getMimetype());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testAddValidationErrors()
|
|
||||||
{
|
|
||||||
$file = $this->getNewFile();
|
|
||||||
$file->addError('Error');
|
|
||||||
$this->assertEquals(1, count($file->getErrors()));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testIsValidIfNoValidations()
|
|
||||||
{
|
|
||||||
$file = $this->getNewFile();
|
|
||||||
$this->assertEmpty($file->getErrors());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testWillUploadIfNoValidations()
|
|
||||||
{
|
|
||||||
$file = $this->getNewFile();
|
|
||||||
$this->assertTrue($file->upload());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testAddValidations()
|
|
||||||
{
|
|
||||||
$file = $this->getNewFile();
|
|
||||||
$file->addValidations(new \Upload\Validation\Mimetype(array(
|
|
||||||
'text/plain'
|
|
||||||
)));
|
|
||||||
$this->assertEquals(1, count($file->getValidations()));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testWillUploadWithPassingValidations()
|
|
||||||
{
|
|
||||||
$file = $this->getNewFile();
|
|
||||||
$file->addValidations(new \Upload\Validation\Mimetype(array(
|
|
||||||
'text/plain'
|
|
||||||
)));
|
|
||||||
$this->assertTrue($file->upload());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException \Upload\Exception\UploadException
|
|
||||||
*/
|
|
||||||
public function testWillNotUploadWithFailingValidations()
|
|
||||||
{
|
|
||||||
$file = $this->getNewFile();
|
|
||||||
$file->addValidations(new \Upload\Validation\Mimetype(array(
|
|
||||||
'image/png'
|
|
||||||
)));
|
|
||||||
$file->upload();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testPopulatesErrorsWithFailingValidations()
|
|
||||||
{
|
|
||||||
$file = $this->getNewFile();
|
|
||||||
$file->addValidations(new \Upload\Validation\Mimetype(array(
|
|
||||||
'image/png'
|
|
||||||
)));
|
|
||||||
try {
|
|
||||||
$file->upload();
|
|
||||||
} catch(\Upload\Exception\UploadException $e) {
|
|
||||||
$this->assertEquals(1, count($file->getErrors()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testValidationFailsIfUploadErrorCode()
|
|
||||||
{
|
|
||||||
$_FILES['foo']['error'] = 4;
|
|
||||||
$file = $this->getNewFile();
|
|
||||||
$this->assertFalse($file->validate());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testValidationFailsIfNotUploadedFile()
|
|
||||||
{
|
|
||||||
$file = $this->getMock(
|
|
||||||
'\Upload\File',
|
|
||||||
array('isUploadedFile'),
|
|
||||||
array('foo', new \Upload\Storage\FileSystem($this->assetsDirectory))
|
|
||||||
);
|
|
||||||
$file->expects($this->any())
|
|
||||||
->method('isUploadedFile')
|
|
||||||
->will($this->returnValue(false));
|
|
||||||
$this->assertFalse($file->validate());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testParsesHumanFriendlyFileSizes()
|
|
||||||
{
|
|
||||||
$this->assertEquals(100, \Upload\File::humanReadableToBytes('100'));
|
|
||||||
$this->assertEquals(102400, \Upload\File::humanReadableToBytes('100K'));
|
|
||||||
$this->assertEquals(104857600, \Upload\File::humanReadableToBytes('100M'));
|
|
||||||
$this->assertEquals(107374182400, \Upload\File::humanReadableToBytes('100G'));
|
|
||||||
$this->assertEquals(100, \Upload\File::humanReadableToBytes('100F')); // <-- Unrecognized. Assume bytes.
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,79 +0,0 @@
|
||||||
<?php
|
|
||||||
class FileSystemTest extends PHPUnit_Framework_TestCase
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Setup (each test)
|
|
||||||
*/
|
|
||||||
public function setUp()
|
|
||||||
{
|
|
||||||
// Path to test assets
|
|
||||||
$this->assetsDirectory = dirname(__DIR__) . '/assets';
|
|
||||||
|
|
||||||
// Reset $_FILES superglobal
|
|
||||||
$_FILES['foo'] = array(
|
|
||||||
'name' => 'foo.txt',
|
|
||||||
'tmp_name' => $this->assetsDirectory . '/foo.txt',
|
|
||||||
'error' => 0
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testInstantiationWithValidDirectory()
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
$storage = $this->getMock(
|
|
||||||
'\Upload\Storage\FileSystem',
|
|
||||||
array('upload'),
|
|
||||||
array($this->assetsDirectory)
|
|
||||||
);
|
|
||||||
} catch(\InvalidArgumentException $e) {
|
|
||||||
$this->fail('Unexpected argument thrown during instantiation with valid directory');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException \InvalidArgumentException
|
|
||||||
*/
|
|
||||||
public function testInstantiationWithInvalidDirectory()
|
|
||||||
{
|
|
||||||
$storage = $this->getMock(
|
|
||||||
'\Upload\Storage\FileSystem',
|
|
||||||
array('upload'),
|
|
||||||
array('/foo')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test won't overwrite existing file
|
|
||||||
* @expectedException \RuntimeException
|
|
||||||
*/
|
|
||||||
public function testWillNotOverwriteFile()
|
|
||||||
{
|
|
||||||
$storage = new \Upload\Storage\FileSystem($this->assetsDirectory, false);
|
|
||||||
$file = new \Upload\File('foo', $storage);
|
|
||||||
$file->upload();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test will overwrite existing file
|
|
||||||
*/
|
|
||||||
public function testWillOverwriteFile()
|
|
||||||
{
|
|
||||||
$storage = $this->getMock(
|
|
||||||
'\Upload\Storage\FileSystem',
|
|
||||||
array('moveUploadedFile'),
|
|
||||||
array($this->assetsDirectory, true)
|
|
||||||
);
|
|
||||||
$storage->expects($this->any())
|
|
||||||
->method('moveUploadedFile')
|
|
||||||
->will($this->returnValue(true));
|
|
||||||
$file = $this->getMock(
|
|
||||||
'\Upload\File',
|
|
||||||
array('isUploadedFile'),
|
|
||||||
array('foo', $storage)
|
|
||||||
);
|
|
||||||
$file->expects($this->any())
|
|
||||||
->method('isUploadedFile')
|
|
||||||
->will($this->returnValue(true));
|
|
||||||
$this->assertTrue($file->upload());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,43 +0,0 @@
|
||||||
<?php
|
|
||||||
class ExtensionTest extends PHPUnit_Framework_TestCase
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Setup (each test)
|
|
||||||
*/
|
|
||||||
public function setUp()
|
|
||||||
{
|
|
||||||
// Path to test assets
|
|
||||||
$this->assetsDirectory = dirname(__DIR__) . '/assets';
|
|
||||||
|
|
||||||
// Create stubbed storage instance
|
|
||||||
$this->storage = $this->getMock(
|
|
||||||
'\Upload\Storage\FileSystem',
|
|
||||||
array('upload'),
|
|
||||||
array($this->assetsDirectory)
|
|
||||||
);
|
|
||||||
$this->storage->expects($this->any())
|
|
||||||
->method('upload')
|
|
||||||
->will($this->returnValue(true));
|
|
||||||
|
|
||||||
// Reset $_FILES superglobal
|
|
||||||
$_FILES['foo'] = array(
|
|
||||||
'name' => 'foo.txt',
|
|
||||||
'tmp_name' => $this->assetsDirectory . '/foo.txt',
|
|
||||||
'error' => 0
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testValidExtension()
|
|
||||||
{
|
|
||||||
$file = new \Upload\File('foo', $this->storage);
|
|
||||||
$validation = new \Upload\Validation\Extension('txt');
|
|
||||||
$this->assertTrue($validation->validate($file));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testInvalidExtension()
|
|
||||||
{
|
|
||||||
$file = new \Upload\File('foo', $this->storage);
|
|
||||||
$validation = new \Upload\Validation\Extension('csv');
|
|
||||||
$this->assertFalse($validation->validate($file));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,47 +0,0 @@
|
||||||
<?php
|
|
||||||
class MimetypeTest extends PHPUnit_Framework_TestCase
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Setup (each test)
|
|
||||||
*/
|
|
||||||
public function setUp()
|
|
||||||
{
|
|
||||||
// Path to test assets
|
|
||||||
$this->assetsDirectory = dirname(__DIR__) . '/assets';
|
|
||||||
|
|
||||||
// Create stubbed storage instance
|
|
||||||
$this->storage = $this->getMock(
|
|
||||||
'\Upload\Storage\FileSystem',
|
|
||||||
array('upload'),
|
|
||||||
array($this->assetsDirectory)
|
|
||||||
);
|
|
||||||
$this->storage->expects($this->any())
|
|
||||||
->method('upload')
|
|
||||||
->will($this->returnValue(true));
|
|
||||||
|
|
||||||
// Reset $_FILES superglobal
|
|
||||||
$_FILES['foo'] = array(
|
|
||||||
'name' => 'foo.txt',
|
|
||||||
'tmp_name' => $this->assetsDirectory . '/foo.txt',
|
|
||||||
'error' => 0
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testValidMimetype()
|
|
||||||
{
|
|
||||||
$file = new \Upload\File('foo', $this->storage);
|
|
||||||
$validation = new \Upload\Validation\Mimetype(array(
|
|
||||||
'text/plain'
|
|
||||||
));
|
|
||||||
$this->assertTrue($validation->validate($file));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testInvalidMimetype()
|
|
||||||
{
|
|
||||||
$file = new \Upload\File('foo', $this->storage);
|
|
||||||
$validation = new \Upload\Validation\Mimetype(array(
|
|
||||||
'image/png'
|
|
||||||
));
|
|
||||||
$this->assertFalse($validation->validate($file));
|
|
||||||
}
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show more
Reference in a new issue