Browse Source

Merge pull request #150 from Kanti/master

Better Password storing via password_verify (PHP 5.3 compatible)
pull/152/head
Kanti 10 years ago
parent
commit
3b917dbe42
115 changed files with 4955 additions and 7810 deletions
  1. +2
    -2
      cache/installedVersion.json
  2. +19
    -18
      composer.json
  3. +67
    -21
      composer.lock
  4. +39
    -12
      system/admin/admin.php
  5. +74
    -74
      system/admin/editor/css/editor.css
  6. +332
    -316
      system/admin/editor/js/Markdown.Converter.js
  7. +75
    -49
      system/admin/editor/js/Markdown.Editor.js
  8. +1
    -1
      system/admin/editor/js/Markdown.Sanitizer.js
  9. +2
    -2
      system/admin/editor/js/local/Markdown.local.fr.js
  10. +17
    -10
      system/admin/editor/package.json
  11. +13
    -12
      system/admin/views/404.html.php
  12. +37
    -20
      system/admin/views/add-page.html.php
  13. +50
    -23
      system/admin/views/add-post.html.php
  14. +11
    -12
      system/admin/views/backup-start.html.php
  15. +12
    -12
      system/admin/views/backup.html.php
  16. +4
    -4
      system/admin/views/clear-cache.html.php
  17. +1
    -0
      system/admin/views/config.html.php
  18. +15
    -15
      system/admin/views/delete-page.html.php
  19. +33
    -35
      system/admin/views/delete-post.html.php
  20. +53
    -43
      system/admin/views/edit-page.html.php
  21. +77
    -62
      system/admin/views/edit-post.html.php
  22. +42
    -33
      system/admin/views/edit-profile.html.php
  23. +10
    -6
      system/admin/views/import.html.php
  24. +51
    -47
      system/admin/views/layout.html.php
  25. +25
    -15
      system/admin/views/login.html.php
  26. +2
    -2
      system/admin/views/main.html.php
  27. +49
    -39
      system/admin/views/posts-list.html.php
  28. +5
    -3
      system/admin/views/updated-to.html.php
  29. +47
    -38
      system/admin/views/user-posts.html.php
  30. +19
    -19
      system/htmly.php
  31. +4
    -3
      system/includes/dispatch.php
  32. +1
    -1
      system/includes/functions.php
  33. +1
    -0
      system/includes/opml.php
  34. +5
    -5
      system/includes/session.php
  35. +122
    -111
      system/plugins/lightbox/css/lightbox.css
  36. +267
    -1
      system/plugins/lightbox/js/lightbox-2.6.min.js
  37. +6
    -6
      system/resources/htmly.js
  38. +1
    -1
      system/vendor/autoload.php
  39. +26
    -0
      system/vendor/composer/ClassLoader.php
  40. +3
    -4
      system/vendor/composer/autoload_classmap.php
  41. +1
    -0
      system/vendor/composer/autoload_files.php
  42. +1
    -1
      system/vendor/composer/autoload_psr4.php
  43. +5
    -5
      system/vendor/composer/autoload_real.php
  44. +89
    -42
      system/vendor/composer/installed.json
  45. +7
    -0
      system/vendor/kanti/hub-updater/.gitattributes
  46. +1
    -0
      system/vendor/kanti/hub-updater/.updateignore
  47. +0
    -39
      system/vendor/kanti/hub-updater/CacheOneFile.php
  48. +0
    -12
      system/vendor/kanti/hub-updater/HelperClass.php
  49. +122
    -0
      system/vendor/kanti/hub-updater/README.md
  50. +15
    -7
      system/vendor/kanti/hub-updater/composer.json
  51. +974
    -0
      system/vendor/kanti/hub-updater/composer.lock
  52. +5
    -0
      system/vendor/kanti/hub-updater/example.php
  53. +29
    -0
      system/vendor/kanti/hub-updater/example2.php
  54. +58
    -0
      system/vendor/kanti/hub-updater/src/CacheOneFile.php
  55. +28
    -0
      system/vendor/kanti/hub-updater/src/HelperClass.php
  56. +13
    -2
      system/vendor/kanti/hub-updater/src/HubUpdater.php
  57. +0
    -0
      system/vendor/kanti/hub-updater/src/ca_bundle.crt
  58. +73
    -0
      system/vendor/kanti/hub-updater/tests/CacheOneFileTest.php
  59. +54
    -0
      system/vendor/kanti/hub-updater/tests/HelperClassTest.php
  60. +1
    -0
      system/vendor/kanti/hub-updater/tests/asserts/testfile.txt
  61. +9
    -0
      system/vendor/kanti/hub-updater/tests/bootstrap.php
  62. +29
    -0
      system/vendor/kanti/hub-updater/tests/phpunit.xml
  63. +0
    -36
      system/vendor/michelf/php-markdown/License.md
  64. +0
    -10
      system/vendor/michelf/php-markdown/Michelf/Markdown.inc.php
  65. +0
    -3117
      system/vendor/michelf/php-markdown/Michelf/Markdown.php
  66. +0
    -11
      system/vendor/michelf/php-markdown/Michelf/MarkdownExtra.inc.php
  67. +0
    -38
      system/vendor/michelf/php-markdown/Michelf/MarkdownExtra.php
  68. +0
    -9
      system/vendor/michelf/php-markdown/Michelf/MarkdownInterface.inc.php
  69. +0
    -37
      system/vendor/michelf/php-markdown/Michelf/MarkdownInterface.php
  70. +0
    -305
      system/vendor/michelf/php-markdown/Readme.md
  71. +0
    -31
      system/vendor/michelf/php-markdown/Readme.php
  72. +0
    -31
      system/vendor/michelf/php-markdown/composer.json
  73. +0
    -11
      system/vendor/suin/php-rss-writer/.travis.yml
  74. +0
    -96
      system/vendor/suin/php-rss-writer/README.md
  75. +0
    -189
      system/vendor/suin/php-rss-writer/Source/Suin/RSSWriter/Channel.php
  76. +0
    -91
      system/vendor/suin/php-rss-writer/Source/Suin/RSSWriter/ChannelInterface.php
  77. +0
    -54
      system/vendor/suin/php-rss-writer/Source/Suin/RSSWriter/Feed.php
  78. +0
    -27
      system/vendor/suin/php-rss-writer/Source/Suin/RSSWriter/FeedInterface.php
  79. +0
    -169
      system/vendor/suin/php-rss-writer/Source/Suin/RSSWriter/Item.php
  80. +0
    -75
      system/vendor/suin/php-rss-writer/Source/Suin/RSSWriter/ItemInterface.php
  81. +0
    -16
      system/vendor/suin/php-rss-writer/Source/Suin/RSSWriter/SimpleXMLElement.php
  82. +0
    -8
      system/vendor/suin/php-rss-writer/Tests/Bootstrap.php
  83. +0
    -28
      system/vendor/suin/php-rss-writer/Tests/README.md
  84. +0
    -252
      system/vendor/suin/php-rss-writer/Tests/Suin/RSSWriter/ChannelTest.php
  85. +0
    -96
      system/vendor/suin/php-rss-writer/Tests/Suin/RSSWriter/FeedTest.php
  86. +0
    -200
      system/vendor/suin/php-rss-writer/Tests/Suin/RSSWriter/ItemTest.php
  87. +0
    -12
      system/vendor/suin/php-rss-writer/Tests/composer.json
  88. +0
    -42
      system/vendor/suin/php-rss-writer/Tests/phpunit.xml.dist
  89. +0
    -20
      system/vendor/suin/php-rss-writer/composer.json
  90. +0
    -35
      system/vendor/suin/php-rss-writer/example.php
  91. +16
    -15
      themes/clean/404-search.html.php
  92. +13
    -12
      themes/clean/404.html.php
  93. +509
    -487
      themes/clean/css/style.css
  94. +38
    -33
      themes/clean/layout.html.php
  95. +62
    -57
      themes/clean/main.html.php
  96. +68
    -53
      themes/clean/post.html.php
  97. +44
    -40
      themes/clean/profile.html.php
  98. +12
    -8
      themes/clean/static.html.php
  99. +16
    -15
      themes/default/404-search.html.php
  100. +13
    -12
      themes/default/404.html.php

+ 2
- 2
cache/installedVersion.json View File

@ -1,4 +1,4 @@
{
"id": 782014,
"tag_name": "v2.5.1"
"id": 782014,
"tag_name": "v2.5.1"
}

+ 19
- 18
composer.json View File

@ -1,20 +1,21 @@
{
"config": {
"vendor-dir": "system/vendor/",
"optimize-autoloader": true
},
"require": {
"michelf/php-markdown": "~1.4",
"suin/php-rss-writer": "~1",
"kanti/hub-updater": "~0.3"
},
"autoload": {
"files": [
"system/includes/dispatch.php",
"system/includes/functions.php",
"system/admin/admin.php",
"system/includes/session.php",
"system/includes/opml.php"
]
}
"config": {
"vendor-dir": "system/vendor/",
"optimize-autoloader": true
},
"require": {
"michelf/php-markdown": "~1.4",
"suin/php-rss-writer": "~1",
"kanti/hub-updater": "~0.3",
"ircmaxell/password-compat": "~1.0"
},
"autoload": {
"files": [
"system/includes/dispatch.php",
"system/includes/functions.php",
"system/admin/admin.php",
"system/includes/session.php",
"system/includes/opml.php"
]
}
}

+ 67
- 21
composer.lock View File

@ -4,32 +4,77 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "93444ef16e9607df09bdc196135e9946",
"hash": "3e80d2a8e4920ba6151c05a19f1f8b9e",
"packages": [
{
"name": "ircmaxell/password-compat",
"version": "v1.0.4",
"source": {
"type": "git",
"url": "https://github.com/ircmaxell/password_compat.git",
"reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c",
"reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c",
"shasum": ""
},
"require-dev": {
"phpunit/phpunit": "4.*"
},
"type": "library",
"autoload": {
"files": [
"lib/password.php"
]
},
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Anthony Ferrara",
"email": "ircmaxell@php.net",
"homepage": "http://blog.ircmaxell.com"
}
],
"description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash",
"homepage": "https://github.com/ircmaxell/password_compat",
"keywords": [
"hashing",
"password"
],
"time": "2014-11-20 16:49:30"
},
{
"name": "kanti/hub-updater",
"version": "v0.3.1",
"version": "v0.4",
"source": {
"type": "git",
"url": "https://github.com/Kanti/hub-updater.git",
"reference": "105bf291983b1323c5916092cc4e170bf987b00c"
"reference": "81dae71f2b3ccd0e3425579ac932a8c6b7b58c5d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Kanti/hub-updater/zipball/105bf291983b1323c5916092cc4e170bf987b00c",
"reference": "105bf291983b1323c5916092cc4e170bf987b00c",
"url": "https://api.github.com/repos/Kanti/hub-updater/zipball/81dae71f2b3ccd0e3425579ac932a8c6b7b58c5d",
"reference": "81dae71f2b3ccd0e3425579ac932a8c6b7b58c5d",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "~4.6@dev"
},
"type": "library",
"autoload": {
"psr-4": {
"Kanti\\": ""
"Kanti\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"GPL-2.0"
],
@ -42,20 +87,20 @@
}
],
"description": "Simple Github Updater for Web Projects",
"time": "2014-12-27 13:59:09"
"time": "2015-02-03 09:53:58"
},
{
"name": "michelf/php-markdown",
"version": "1.4.1",
"version": "1.5.0",
"source": {
"type": "git",
"url": "https://github.com/michelf/php-markdown.git",
"reference": "de9a19c7bf352d41cc99ed86c3c0ef17e87394b6"
"reference": "e1aabe18173231ebcefc90e615565742fc1c7fd9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/michelf/php-markdown/zipball/de9a19c7bf352d41cc99ed86c3c0ef17e87394b6",
"reference": "de9a19c7bf352d41cc99ed86c3c0ef17e87394b6",
"url": "https://api.github.com/repos/michelf/php-markdown/zipball/e1aabe18173231ebcefc90e615565742fc1c7fd9",
"reference": "e1aabe18173231ebcefc90e615565742fc1c7fd9",
"shasum": ""
},
"require": {
@ -72,28 +117,28 @@
"Michelf": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "John Gruber",
"homepage": "http://daringfireball.net/"
},
{
"name": "Michel Fortin",
"email": "michel.fortin@michelf.ca",
"homepage": "http://michelf.ca/",
"homepage": "https://michelf.ca/",
"role": "Developer"
},
{
"name": "John Gruber",
"homepage": "http://daringfireball.net/"
}
],
"description": "PHP Markdown",
"homepage": "http://michelf.ca/projects/php-markdown/",
"homepage": "https://michelf.ca/projects/php-markdown/",
"keywords": [
"markdown"
],
"time": "2014-05-05 02:43:50"
"time": "2015-03-01 12:03:08"
},
{
"name": "suin/php-rss-writer",
@ -118,7 +163,7 @@
"Suin\\RSSWriter": "Source"
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -146,6 +191,7 @@
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}

+ 39
- 12
system/admin/admin.php View File

@ -13,15 +13,27 @@ function user($key, $user = null)
}
}
function create_user($userName, $password)
function update_user($userName, $password, $role)
{
$file = 'config/users/' . $userName . '.ini';
if (file_exists($file)) {
file_put_contents($file, "password = " . password_hash($password, PASSWORD_DEFAULT) . "\n" .
"encryption = password_hash\n" .
"role = " . $role . "\n");
return true;
}
return false;
}
function create_user($userName, $password, $role = "user")
{
$file = 'config/users/' . $userName . '.ini';
if (file_exists($file)) {
return false;
} else {
file_put_contents($file, "password = " . hash("sha512", $password) . "\n" .
"encryption = sha512\n" .
"role = user\n");
file_put_contents($file, "password = " . password_hash($password, PASSWORD_DEFAULT) . "\n" .
"encryption = password_hash\n" .
"role = " . $role . "\n");
return true;
}
}
@ -30,22 +42,37 @@ function create_user($userName, $password)
function session($user, $pass)
{
$user_file = 'config/users/' . $user . '.ini';
if (!file_exists($user_file)) {
return $str = '<li>Username not found in our record.</li>';
}
$user_enc = user('encryption', $user);
$user_pass = user('password', $user);
$password = (strlen($user_enc) > 0 && $user_enc !== 'clear' && $user_enc !== 'none') ? hash($user_enc, $pass) : $pass;
$user_role = user('role', $user);
if (file_exists($user_file)) {
if ($password === $user_pass) {
if ($user_enc == "password_hash") {
if (password_verify($pass, $user_pass)) {
if (password_needs_rehash($user_pass, PASSWORD_DEFAULT)) {
update_user($user, $pass, $user_role);
}
$_SESSION[config("site.url")]['user'] = $user;
header('location: admin');
} else {
return $str = '<li>Your username and password mismatch.</li>';
}
} else if (old_password_verify($pass, $user_enc, $user_pass)) {
update_user($user, $pass, $user_role);
$_SESSION[config("site.url")]['user'] = $user;
header('location: admin');
} else {
return $str = '<li>Username not found in our record.</li>';
return $str = '<li>Your username and password mismatch.</li>';
}
}
function old_password_verify($pass, $user_enc, $user_pass)
{
$password = (strlen($user_enc) > 0 && $user_enc !== 'clear' && $user_enc !== 'none') ? hash($user_enc, $pass) : $pass;
return ($password === $user_pass);
}
// Clean URLs
function remove_accent($str)
{
@ -68,7 +95,7 @@ function edit_post($title, $tag, $url, $content, $oldfile, $destination = null,
$post_title = $title;
$post_fi = $fi;
$post_vid = str_replace(["http://", "https://", "www.", "youtube", ".com", "/watch?v=", "/embed/"], "", $vid);
$post_vid = str_replace(array("http://", "https://", "www.", "youtube", ".com", "/watch?v=", "/embed/"), "", $vid);
$post_tag = preg_replace(array('/[^a-zA-Z0-9,.\-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($tag));
$post_url = strtolower(preg_replace(array('/[^a-zA-Z0-9 \-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($url)));
if ($description !== null) {
@ -161,7 +188,7 @@ function add_post($title, $tag, $url, $content, $user, $description = null, $fi,
$post_date = date('Y-m-d-H-i-s');
$post_title = $title;
$post_fi = $fi;
$post_vid = str_replace(["http://", "https://", "www.", "youtube", ".com", "/watch?v=", "/embed/"], "", $vid);
$post_vid = str_replace(array("http://", "https://", "www.", "youtube", ".com", "/watch?v=", "/embed/"), "", $vid);
$post_tag = preg_replace(array('/[^a-zA-Z0-9,.\-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($tag));
$post_url = strtolower(preg_replace(array('/[^a-zA-Z0-9 \-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($url)));
if ($description !== null) {


+ 74
- 74
system/admin/editor/css/editor.css View File

@ -1,59 +1,59 @@
body {
body {
font-family: Georgia, sans-serif;
}
blockquote {
border-left: 2px dotted #888;
padding-left: 5px;
background: #F6F7F9;
border-left: 2px dotted #888;
padding-left: 5px;
background: #F6F7F9;
}
.wmd-panel{
width: 44%;
float:left;
padding-right:20px;
.wmd-panel {
width: 44%;
float: left;
padding-right: 20px;
}
.wmd-button-bar {
background-color: #F6F7F9;
padding: 5px 0;
margin-bottom:10px;
width: 100%;
border: 1px solid #CFDAE5;
display:block;
float:left;
background-color: #F6F7F9;
padding: 5px 0;
margin-bottom: 10px;
width: 100%;
border: 1px solid #CFDAE5;
display: block;
float: left;
}
.wmd-button-bar:hover {
border: 1px solid #CCCCCC;
border: 1px solid #CCCCCC;
}
.wmd-input {
min-height: 300px;
width: 96%;
padding: 2%;
.wmd-input {
min-height: 300px;
width: 96%;
padding: 2%;
}
.wmd-preview {
background-color: #E4EBF1;
width: 46%;
float:left;
padding:2%;
.wmd-preview {
background-color: #E4EBF1;
width: 46%;
float: left;
padding: 2%;
}
.wmd-button-row {
position: relative;
margin: 0px;
padding: 0px;
position: relative;
margin: 0px;
padding: 0px;
}
.wmd-spacer{
width: 1px;
height: 20px;
background-color: Silver;
list-style: none;
float:left;
margin: 0.25em 5px;
.wmd-spacer {
width: 1px;
height: 20px;
background-color: Silver;
list-style: none;
float: left;
margin: 0.25em 5px;
}
.wmd-button {
@ -63,7 +63,7 @@ blockquote {
padding-right: 5px;
list-style: none;
cursor: pointer;
float:left;
float: left;
}
.wmd-button > span {
@ -75,74 +75,74 @@ blockquote {
display: inline-block;
}
.wmd-spacer1{
.wmd-spacer1 {
left: 50px;
}
.wmd-spacer2{
.wmd-spacer2 {
left: 175px;
}
.wmd-spacer3{
.wmd-spacer3 {
left: 300px;
}
.wmd-prompt-background{
background-color: Black;
.wmd-prompt-background {
background-color: Black;
}
.wmd-prompt-dialog{
border: 1px solid #999999;
background-color: #F5F5F5;
.wmd-prompt-dialog {
border: 1px solid #999999;
background-color: #F5F5F5;
}
.wmd-prompt-dialog > div {
font-size: 0.8em;
font-family: arial, helvetica, sans-serif;
font-size: 0.8em;
font-family: arial, helvetica, sans-serif;
}
.wmd-prompt-dialog > form > input[type="text"] {
border: 1px solid #999999;
color: black;
border: 1px solid #999999;
color: black;
}
.wmd-prompt-dialog > form > input[type="button"]{
border: 1px solid #888888;
font-family: trebuchet MS, helvetica, sans-serif;
font-size: 0.8em;
font-weight: bold;
.wmd-prompt-dialog > form > input[type="button"] {
border: 1px solid #888888;
font-family: trebuchet MS, helvetica, sans-serif;
font-size: 0.8em;
font-weight: bold;
}
pre {
margin: 1em 0;
overflow: auto;
background: #F1F1FF;
margin: 1em 0;
overflow: auto;
background: #F1F1FF;
}
pre code {
color: #333333;
display: block;
font-family: Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,serif;
font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;
font-size: 14px;
padding: 5px 10px;
}
@media all and (max-width: 980px) {
.nav {
width: 100%;
padding: 2%;
}
.wmd-panel, .wmd-preview {
width: 96%;
float:left;
padding:2%;
}
pre {
white-space: pre-wrap;
word-wrap:break-word;
}
.nav {
width: 100%;
padding: 2%;
}
.wmd-panel, .wmd-preview {
width: 96%;
float: left;
padding: 2%;
}
pre {
white-space: pre-wrap;
word-wrap: break-word;
}
}

+ 332
- 316
system/admin/editor/js/Markdown.Converter.js View File

@ -4,7 +4,7 @@ if (typeof exports === "object" && typeof require === "function") // we're in a
Markdown = exports;
else
Markdown = {};
// The following text is included for historical reasons, but should
// be taken with a pinch of salt; it's not all true anymore.
@ -52,10 +52,16 @@ else
(function () {
function identity(x) { return x; }
function returnFalse(x) { return false; }
function identity(x) {
return x;
}
function returnFalse(x) {
return false;
}
function HookCollection() { }
function HookCollection() {
}
HookCollection.prototype = {
@ -95,7 +101,9 @@ else
// http://meta.stackoverflow.com/questions/64655/strange-wmd-bug
// (granted, switching from Array() to Object() alone would have left only __proto__
// to be a problem)
function SaveHash() { }
function SaveHash() {
}
SaveHash.prototype = {
set: function (key, value) {
this["s_" + key] = value;
@ -107,26 +115,26 @@ else
Markdown.Converter = function () {
var pluginHooks = this.hooks = new HookCollection();
// given a URL that was encountered by itself (without markup), should return the link text that's to be given to this link
pluginHooks.addNoop("plainLinkText");
// called with the orignal text as given to makeHtml. The result of this plugin hook is the actual markdown source that will be cooked
pluginHooks.addNoop("preConversion");
// called with the text once all normalizations have been completed (tabs to spaces, line endings, etc.), but before any conversions have
pluginHooks.addNoop("postNormalization");
// Called with the text before / after creating block elements like code blocks and lists. Note that this is called recursively
// with inner content, e.g. it's called with the full text, and then only with the content of a blockquote. The inner
// call will receive outdented text.
pluginHooks.addNoop("preBlockGamut");
pluginHooks.addNoop("postBlockGamut");
// called with the text of a single block element before / after the span-level conversions (bold, code spans, etc.) have been made
pluginHooks.addNoop("preSpanGamut");
pluginHooks.addNoop("postSpanGamut");
// called with the final cooked HTML code. The result of this plugin hook is the actual output of makeHtml
pluginHooks.addNoop("postConversion");
@ -156,7 +164,7 @@ else
// Don't do that.
if (g_urls)
throw new Error("Recursive call to converter.makeHtml");
// Create the private state objects.
g_urls = new SaveHash();
g_titles = new SaveHash();
@ -191,7 +199,7 @@ else
// match consecutive blank lines with /\n+/ instead of something
// contorted like /[ \t]*\n+/ .
text = text.replace(/^[ \t]+$/mg, "");
text = pluginHooks.postNormalization(text);
// Turn block-level HTML blocks into hash entries
@ -226,27 +234,27 @@ else
// Link defs are in the form: ^[id]: url "optional title"
/*
text = text.replace(/
^[ ]{0,3}\[(.+)\]: // id = $1 attacklab: g_tab_width - 1
[ \t]*
\n? // maybe *one* newline
[ \t]*
<?(\S+?)>? // url = $2
(?=\s|$) // lookahead for whitespace instead of the lookbehind removed below
[ \t]*
\n? // maybe one newline
[ \t]*
( // (potential) title = $3
(\n*) // any lines skipped = $4 attacklab: lookbehind removed
[ \t]+
["(]
(.+?) // title = $5
[")]
[ \t]*
)? // title is optional
(?:\n+|$)
/gm, function(){...});
*/
text = text.replace(/
^[ ]{0,3}\[(.+)\]: // id = $1 attacklab: g_tab_width - 1
[ \t]*
\n? // maybe *one* newline
[ \t]*
<?(\S+?)>? // url = $2
(?=\s|$) // lookahead for whitespace instead of the lookbehind removed below
[ \t]*
\n? // maybe one newline
[ \t]*
( // (potential) title = $3
(\n*) // any lines skipped = $4 attacklab: lookbehind removed
[ \t]+
["(]
(.+?) // title = $5
[")]
[ \t]*
)? // title is optional
(?:\n+|$)
/gm, function(){...});
*/
text = text.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm,
function (wholeMatch, m1, m2, m3, m4, m5) {
@ -294,19 +302,19 @@ else
// attacklab: This regex can be expensive when it fails.
/*
text = text.replace(/
( // save in $1
^ // start of line (with /m)
<($block_tags_a) // start tag = $2
\b // word break
// attacklab: hack around khtml/pcre bug...
[^\r]*?\n // any number of lines, minimally matching
</\2> // the matching end tag
[ \t]* // trailing spaces/tabs
(?=\n+) // followed by a newline
) // attacklab: there are sentinel newlines at end of document
/gm,function(){...}};
*/
text = text.replace(/
( // save in $1
^ // start of line (with /m)
<($block_tags_a) // start tag = $2
\b // word break
// attacklab: hack around khtml/pcre bug...
[^\r]*?\n // any number of lines, minimally matching
</\2> // the matching end tag
[ \t]* // trailing spaces/tabs
(?=\n+) // followed by a newline
) // attacklab: there are sentinel newlines at end of document
/gm,function(){...}};
*/
text = text.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm, hashElement);
//
@ -314,76 +322,76 @@ else
//
/*
text = text.replace(/
( // save in $1
^ // start of line (with /m)
<($block_tags_b) // start tag = $2
\b // word break
// attacklab: hack around khtml/pcre bug...
[^\r]*? // any number of lines, minimally matching
.*</\2> // the matching end tag
[ \t]* // trailing spaces/tabs
(?=\n+) // followed by a newline
) // attacklab: there are sentinel newlines at end of document
/gm,function(){...}};
*/
text = text.replace(/
( // save in $1
^ // start of line (with /m)
<($block_tags_b) // start tag = $2
\b // word break
// attacklab: hack around khtml/pcre bug...
[^\r]*? // any number of lines, minimally matching
.*</\2> // the matching end tag
[ \t]* // trailing spaces/tabs
(?=\n+) // followed by a newline
) // attacklab: there are sentinel newlines at end of document
/gm,function(){...}};
*/
text = text.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm, hashElement);
// Special case just for <hr />. It was easier to make a special case than
// to make the other regex more complicated.
/*
text = text.replace(/
\n // Starting after a blank line
[ ]{0,3}
( // save in $1
(<(hr) // start tag = $2
\b // word break
([^<>])*?
\/?>) // the matching end tag
[ \t]*
(?=\n{2,}) // followed by a blank line
)
/g,hashElement);
*/
text = text.replace(/
\n // Starting after a blank line
[ ]{0,3}
( // save in $1
(<(hr) // start tag = $2
\b // word break
([^<>])*?
\/?>) // the matching end tag
[ \t]*
(?=\n{2,}) // followed by a blank line
)
/g,hashElement);
*/
text = text.replace(/\n[ ]{0,3}((<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g, hashElement);
// Special case for standalone HTML comments:
/*
text = text.replace(/
\n\n // Starting after a blank line
[ ]{0,3} // attacklab: g_tab_width - 1
( // save in $1
<!
(--(?:|(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--) // see http://www.w3.org/TR/html-markup/syntax.html#comments and http://meta.stackoverflow.com/q/95256
>
[ \t]*
(?=\n{2,}) // followed by a blank line
)
/g,hashElement);
*/
text = text.replace(/
\n\n // Starting after a blank line
[ ]{0,3} // attacklab: g_tab_width - 1
( // save in $1
<!
(--(?:|(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--) // see http://www.w3.org/TR/html-markup/syntax.html#comments and http://meta.stackoverflow.com/q/95256
>
[ \t]*
(?=\n{2,}) // followed by a blank line
)
/g,hashElement);
*/
text = text.replace(/\n\n[ ]{0,3}(<!(--(?:|(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>[ \t]*(?=\n{2,}))/g, hashElement);
// PHP and ASP-style processor instructions (<?...?> and <%...%>)
/*
text = text.replace(/
(?:
\n\n // Starting after a blank line
)
( // save in $1
[ ]{0,3} // attacklab: g_tab_width - 1
(?:
<([?%]) // $2
[^\r]*?
\2>
)
[ \t]*
(?=\n{2,}) // followed by a blank line
)
/g,hashElement);
*/
text = text.replace(/
(?:
\n\n // Starting after a blank line
)
( // save in $1
[ ]{0,3} // attacklab: g_tab_width - 1
(?:
<([?%]) // $2
[^\r]*?
\2>
)
[ \t]*
(?=\n{2,}) // followed by a blank line
)
/g,hashElement);
*/
text = text.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g, hashElement);
return text;
@ -403,17 +411,19 @@ else
return blockText;
}
var blockGamutHookCallback = function (t) { return _RunBlockGamut(t); }
var blockGamutHookCallback = function (t) {
return _RunBlockGamut(t);
}
function _RunBlockGamut(text, doNotUnhash) {
//
// These are all the transformations that form block-level
// tags like paragraphs, headers, and list items.
//
text = pluginHooks.preBlockGamut(text, blockGamutHookCallback);
text = _DoHeaders(text);
// Do Horizontal Rules:
@ -425,7 +435,7 @@ else
text = _DoLists(text);
text = _DoCodeBlocks(text);
text = _DoBlockQuotes(text);
text = pluginHooks.postBlockGamut(text, blockGamutHookCallback);
// We already ran _HashHTMLBlocks() before, in Markdown(), but that
@ -445,7 +455,7 @@ else
//
text = pluginHooks.preSpanGamut(text);
text = _DoCodeSpans(text);
text = _EscapeSpecialCharsWithinTagAttributes(text);
text = _EncodeBackslashEscapes(text);
@ -459,15 +469,15 @@ else
// Must come after _DoAnchors(), because you can use < and >
// delimiters in inline links like [this](<url>).
text = _DoAutoLinks(text);
text = text.replace(/~P/g, "://"); // put in place to prevent autolinking; reset now
text = _EncodeAmpsAndAngles(text);
text = _DoItalicsAndBold(text);
// Do hard breaks:
text = text.replace(/ +\n/g, " <br>\n");
text = pluginHooks.postSpanGamut(text);
return text;
@ -504,28 +514,28 @@ else
//
/*
text = text.replace(/
( // wrap whole match in $1
\[
(
(?:
\[[^\]]*\] // allow brackets nested one level
|
[^\[] // or anything else
)*
)
\]
[ ]? // one optional space
(?:\n[ ]*)? // one optional newline followed by spaces
\[
(.*?) // id = $3
\]
)
()()()() // pad remaining backreferences
/g, writeAnchorTag);
*/
text = text.replace(/
( // wrap whole match in $1
\[
(
(?:
\[[^\]]*\] // allow brackets nested one level
|
[^\[] // or anything else
)*
)
\]
[ ]? // one optional space
(?:\n[ ]*)? // one optional newline followed by spaces
\[
(.*?) // id = $3
\]
)
()()()() // pad remaining backreferences
/g, writeAnchorTag);
*/
text = text.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g, writeAnchorTag);
//
@ -533,38 +543,38 @@ else
//
/*
text = text.replace(/
( // wrap whole match in $1
\[
(
(?:
\[[^\]]*\] // allow brackets nested one level
|
[^\[\]] // or anything else
)*
)
\]
\( // literal paren
[ \t]*
() // no id, so leave $3 empty
<?( // href = $4
(?:
\([^)]*\) // allow one level of (correctly nested) parens (think MSDN)
|
[^()\s]
)*?
)>?
[ \t]*
( // $5
(['"]) // quote char = $6
(.*?) // Title = $7
\6 // matching quote
[ \t]* // ignore any spaces/tabs between closing quote and )
)? // title is optional
\)
)
/g, writeAnchorTag);
*/
text = text.replace(/
( // wrap whole match in $1
\[
(
(?:
\[[^\]]*\] // allow brackets nested one level
|
[^\[\]] // or anything else
)*
)
\]
\( // literal paren
[ \t]*
() // no id, so leave $3 empty
<?( // href = $4
(?:
\([^)]*\) // allow one level of (correctly nested) parens (think MSDN)
|
[^()\s]
)*?
)>?
[ \t]*
( // $5
(['"]) // quote char = $6
(.*?) // Title = $7
\6 // matching quote
[ \t]* // ignore any spaces/tabs between closing quote and )
)? // title is optional
\)
)
/g, writeAnchorTag);
*/
text = text.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?((?:\([^)]*\)|[^()\s])*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g, writeAnchorTag);
@ -575,15 +585,15 @@ else
//
/*
text = text.replace(/
( // wrap whole match in $1
\[
([^\[\]]+) // link text = $2; can't contain '[' or ']'
\]
)
()()()()() // pad rest of backreferences
/g, writeAnchorTag);
*/
text = text.replace(/
( // wrap whole match in $1
\[
([^\[\]]+) // link text = $2; can't contain '[' or ']'
\]
)
()()()()() // pad rest of backreferences
/g, writeAnchorTag);
*/
text = text.replace(/(\[([^\[\]]+)\])()()()()()/g, writeAnchorTag);
return text;
@ -644,22 +654,22 @@ else
//
/*
text = text.replace(/
( // wrap whole match in $1
!\[
(.*?) // alt text = $2
\]
[ ]? // one optional space
(?:\n[ ]*)? // one optional newline followed by spaces
\[
(.*?) // id = $3
\]
)
()()()() // pad rest of backreferences
/g, writeImageTag);
*/
text = text.replace(/
( // wrap whole match in $1
!\[
(.*?) // alt text = $2
\]
[ ]? // one optional space
(?:\n[ ]*)? // one optional newline followed by spaces
\[
(.*?) // id = $3
\]
)
()()()() // pad rest of backreferences
/g, writeImageTag);
*/
text = text.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g, writeImageTag);
//
@ -667,32 +677,32 @@ else
// Don't forget: encode * and _
/*
text = text.replace(/
( // wrap whole match in $1
!\[
(.*?) // alt text = $2
\]
\s? // One optional whitespace character
\( // literal paren
[ \t]*
() // no id, so leave $3 empty
<?(\S+?)>? // src url = $4
[ \t]*
( // $5
(['"]) // quote char = $6
(.*?) // title = $7
\6 // matching quote
[ \t]*
)? // title is optional
\)
)
/g, writeImageTag);
*/
text = text.replace(/
( // wrap whole match in $1
!\[
(.*?) // alt text = $2
\]
\s? // One optional whitespace character
\( // literal paren
[ \t]*
() // no id, so leave $3 empty
<?(\S+?)>? // src url = $4
[ \t]*
( // $5
(['"]) // quote char = $6
(.*?) // title = $7
\6 // matching quote
[ \t]*
)? // title is optional
\)
)
/g, writeImageTag);
*/
text = text.replace(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g, writeImageTag);
return text;
}
function attributeEncode(text) {
// unconditionally replace angle brackets here -- what ends up in an attribute (e.g. alt or title)
// never makes sense to have verbatim HTML in it (and the sanitizer would totally break it)
@ -725,7 +735,7 @@ else
return whole_match;
}
}
alt_text = escapeCharacters(attributeEncode(alt_text), "*_[]()");
url = escapeCharacters(url, "*_");
var result = "<img src=\"" + url + "\" alt=\"" + alt_text + "\"";
@ -754,11 +764,15 @@ else
// --------
//
text = text.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm,
function (wholeMatch, m1) { return "<h1>" + _RunSpanGamut(m1) + "</h1>\n\n"; }
function (wholeMatch, m1) {
return "<h1>" + _RunSpanGamut(m1) + "</h1>\n\n";
}
);
text = text.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,
function (matchFound, m1) { return "<h2>" + _RunSpanGamut(m1) + "</h2>\n\n"; }
function (matchFound, m1) {
return "<h2>" + _RunSpanGamut(m1) + "</h2>\n\n";
}
);
// atx-style headers:
@ -770,15 +784,15 @@ else
//
/*
text = text.replace(/
^(\#{1,6}) // $1 = string of #'s
[ \t]*
(.+?) // $2 = Header text
[ \t]*
\#* // optional closing #'s (not counted)
\n+
/gm, function() {...});
*/
text = text.replace(/
^(\#{1,6}) // $1 = string of #'s
[ \t]*
(.+?) // $2 = Header text
[ \t]*
\#* // optional closing #'s (not counted)
\n+
/gm, function() {...});
*/
text = text.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,
function (wholeMatch, m1, m2) {
@ -802,27 +816,27 @@ else
// Re-usable pattern to match any entirel ul or ol list:
/*
var whole_list = /
( // $1 = whole list
( // $2
[ ]{0,3} // attacklab: g_tab_width - 1
([*+-]|\d+[.]) // $3 = first list item marker
[ \t]+
)
[^\r]+?
( // $4
~0 // sentinel for workaround; should be $
|
\n{2,}
(?=\S)
(?! // Negative lookahead for another list item marker
[ \t]*
(?:[*+-]|\d+[.])[ \t]+
)
)
)
/g
*/
var whole_list = /
( // $1 = whole list
( // $2
[ ]{0,3} // attacklab: g_tab_width - 1
([*+-]|\d+[.]) // $3 = first list item marker
[ \t]+
)
[^\r]+?
( // $4
~0 // sentinel for workaround; should be $
|
\n{2,}
(?=\S)
(?! // Negative lookahead for another list item marker
[ \t]*
(?:[*+-]|\d+[.])[ \t]+
)
)
)
/g
*/
var whole_list = /^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;
if (g_list_level) {
@ -859,7 +873,7 @@ else
return text;
}
var _listItemMarkers = { ol: "\\d+[.]", ul: "[*+-]" };
var _listItemMarkers = {ol: "\\d+[.]", ul: "[*+-]"};
function _ProcessListItems(list_str, list_type, isInsideParagraphlessListItem) {
//
@ -908,19 +922,19 @@ else
//
// We changed this to behave identical to MarkdownSharp. This is the constructed RegEx,
// with {MARKER} being one of \d+[.] or [*+-], depending on list_type:
/*
list_str = list_str.replace(/
(^[ \t]*) // leading whitespace = $1
({MARKER}) [ \t]+ // list marker = $2
([^\r]+? // list item text = $3
(\n+)
)
(?=
(~0 | \2 ({MARKER}) [ \t]+)
)
/gm, function(){...});
*/
list_str = list_str.replace(/
(^[ \t]*) // leading whitespace = $1
({MARKER}) [ \t]+ // list marker = $2
([^\r]+? // list item text = $3
(\n+)
)
(?=
(~0 | \2 ({MARKER}) [ \t]+)
)
/gm, function(){...});
*/
var marker = _listItemMarkers[list_type];
var re = new RegExp("(^[ \\t]*)(" + marker + ")[ \\t]+([^\\r]+?(\\n+))(?=(~0|\\1(" + marker + ")[ \\t]+))", "gm");
@ -960,17 +974,17 @@ else
//
/*
text = text.replace(/
(?:\n\n|^)
( // $1 = the code block -- one or more lines, starting with a space/tab
(?:
(?:[ ]{4}|\t) // Lines must start with a tab or a tab-width of spaces - attacklab: g_tab_width
.*\n+
)+
)
(\n*[ ]{0,3}[^ \t\n]|(?=~0)) // attacklab: g_tab_width
/g ,function(){...});
*/
text = text.replace(/
(?:\n\n|^)
( // $1 = the code block -- one or more lines, starting with a space/tab
(?:
(?:[ ]{4}|\t) // Lines must start with a tab or a tab-width of spaces - attacklab: g_tab_width
.*\n+
)+
)
(\n*[ ]{0,3}[^ \t\n]|(?=~0)) // attacklab: g_tab_width
/g ,function(){...});
*/
// attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug
text += "~0";
@ -1029,17 +1043,17 @@ else
//
/*
text = text.replace(/
(^|[^\\]) // Character before opening ` can't be a backslash
(`+) // $2 = Opening run of `
( // $3 = The code block
[^\r]*?
[^`] // attacklab: work around lack of lookbehind
)
\2 // Matching closer
(?!`)
/gm, function(){...});
*/
text = text.replace(/
(^|[^\\]) // Character before opening ` can't be a backslash
(`+) // $2 = Opening run of `
( // $3 = The code block
[^\r]*?
[^`] // attacklab: work around lack of lookbehind
)
\2 // Matching closer
(?!`)
/gm, function(){...});
*/
text = text.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,
function (wholeMatch, m1, m2, m3, m4) {
@ -1089,10 +1103,10 @@ else
// <strong> must go first:
text = text.replace(/([\W_]|^)(\*\*|__)(?=\S)([^\r]*?\S[\*_]*)\2([\W_]|$)/g,
"$1<strong>$3</strong>$4");
"$1<strong>$3</strong>$4");
text = text.replace(/([\W_]|^)(\*|_)(?=\S)([^\r\*_]*?\S)\2([\W_]|$)/g,
"$1<em>$3</em>$4");
"$1<em>$3</em>$4");
return text;
}
@ -1100,17 +1114,17 @@ else
function _DoBlockQuotes(text) {
/*
text = text.replace(/
( // Wrap whole match in $1
(
^[ \t]*>[ \t]? // '>' at the start of a line
.+\n // rest of the first line
(.+\n)* // subsequent consecutive lines
\n* // blanks
)+
)
/gm, function(){...});
*/
text = text.replace(/
( // Wrap whole match in $1
(
^[ \t]*>[ \t]? // '>' at the start of a line
.+\n // rest of the first line
(.+\n)* // subsequent consecutive lines
\n* // blanks
)+
)
/gm, function(){...});
*/
text = text.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,
function (wholeMatch, m1) {
@ -1130,7 +1144,7 @@ else
bq = bq.replace(/(^|\n)/g, "$1 ");
// These leading spaces screw with <pre> content, so we need to fix that:
bq = bq.replace(
/(\s*<pre>[^\r]+?<\/pre>)/gm,
/(\s*<pre>[^\r]+?<\/pre>)/gm,
function (wholeMatch, m1) {
var pre = m1;
// attacklab: hack around Konqueror 3.5.4 bug:
@ -1157,7 +1171,7 @@ else
var grafs = text.split(/\n{2,}/g);
var grafsOut = [];
var markerRe = /~K(\d+)K/;
//
@ -1272,7 +1286,7 @@ else
}
return "<" + protocol + link + ">" + tail;
}
function _DoAutoLinks(text) {
// note that at this point, all other URL in the text are already hyperlinked as <a href=""></a>
@ -1285,31 +1299,33 @@ else
text = text.replace(autoLinkRegex, handleTrailingParens);
// autolink anything like <http://example.com>
var replacer = function (wholematch, m1) { return "<a href=\"" + m1 + "\">" + pluginHooks.plainLinkText(m1) + "</a>"; }
var replacer = function (wholematch, m1) {
return "<a href=\"" + m1 + "\">" + pluginHooks.plainLinkText(m1) + "</a>";
}
text = text.replace(/<((https?|ftp):[^'">\s]+)>/gi, replacer);
// Email addresses: <address@domain.foo>
/*
text = text.replace(/
<
(?:mailto:)?
(
[-.\w]+
\@
[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+
)
>
/gi, _DoAutoLinks_callback());
*/
text = text.replace(/
<
(?:mailto:)?
(
[-.\w]+
\@
[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+
)
>
/gi, _DoAutoLinks_callback());
*/
/* disabling email autolinking, since we don't do that on the server, either
text = text.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,
function(wholeMatch,m1) {
return _EncodeEmailAddress( _UnescapeSpecialChars(m1) );
}
);
*/
text = text.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,
function(wholeMatch,m1) {
return _EncodeEmailAddress( _UnescapeSpecialChars(m1) );
}
);
*/
return text;
}
@ -1347,8 +1363,8 @@ else
return text;
var spaces = [" ", " ", " ", " "],
skew = 0,
v;
skew = 0,
v;
return text.replace(/[\n\t]/g, function (match, offset) {
if (match === "\n") {


+ 75
- 49
system/admin/editor/js/Markdown.Editor.js View File

@ -8,7 +8,7 @@
doc = window.document,
re = window.RegExp,
nav = window.navigator,
SETTINGS = { lineLength: 72 },
SETTINGS = {lineLength: 72},
// Used to work around some browser bugs where we can't use feature testing.
uaSniffed = {
@ -90,29 +90,34 @@
// - run() actually starts the editor; should be called after all necessary plugins are registered. Calling this more than once is a no-op.
// - refreshPreview() forces the preview to be updated. This method is only available after run() was called.
Markdown.Editor = function (markdownConverter, idPostfix, options) {
options = options || {};
if (typeof options.handler === "function") { //backwards compatible behavior
options = { helpButton: options };
options = {helpButton: options};
}
options.strings = options.strings || {};
if (options.helpButton) {
options.strings.help = options.strings.help || options.helpButton.title;
}
var getString = function (identifier) { return options.strings[identifier] || defaultsStrings[identifier]; }
var getString = function (identifier) {
return options.strings[identifier] || defaultsStrings[identifier];
}
idPostfix = idPostfix || "";
var hooks = this.hooks = new Markdown.HookCollection();
hooks.addNoop("onPreviewRefresh"); // called with no arguments after the preview has been refreshed
hooks.addNoop("postBlockquoteCreation"); // called with the user's selection *after* the blockquote was created; should return the actual to-be-inserted text
hooks.addFalse("insertImageDialog"); /* called with one parameter: a callback to be called with the URL of the image. If the application creates
* its own image insertion dialog, this hook should return true, and the callback should be called with the chosen
* image url (or null if the user cancelled). If this hook returns false, the default dialog will be used.
*/
hooks.addFalse("insertImageDialog");
/* called with one parameter: a callback to be called with the URL of the image. If the application creates
* its own image insertion dialog, this hook should return true, and the callback should be called with the chosen
* image url (or null if the user cancelled). If this hook returns false, the default dialog will be used.
*/
this.getConverter = function () { return markdownConverter; }
this.getConverter = function () {
return markdownConverter;
}
var that = this,
panels;
@ -123,7 +128,9 @@
panels = new PanelCollection(idPostfix);
var commandManager = new CommandManager(hooks, getString);
var previewManager = new PreviewManager(markdownConverter, panels, function () { hooks.onPreviewRefresh(); });
var previewManager = new PreviewManager(markdownConverter, panels, function () {
hooks.onPreviewRefresh();
});
var undoManager, uiManager;
if (!/\?noundo/.test(doc.location.href)) {
@ -142,7 +149,9 @@
uiManager = new UIManager(idPostfix, panels, undoManager, previewManager, commandManager, options.helpButton, getString);
uiManager.setUndoRedoButtonStates();
var forceRefresh = that.refreshPreview = function () { previewManager.refresh(true); };
var forceRefresh = that.refreshPreview = function () {
previewManager.refresh(true);
};
forceRefresh();
};
@ -151,7 +160,8 @@
// before: contains all the text in the input box BEFORE the selection.
// after: contains all the text in the input box AFTER the selection.
function Chunks() { }
function Chunks() {
}
// startRegex: a regular expression to find the start tag
// endRegex: a regular expresssion to find the end tag
@ -208,8 +218,14 @@
if (remove) {
beforeReplacer = afterReplacer = "";
} else {
beforeReplacer = function (s) { that.before += s; return ""; }
afterReplacer = function (s) { that.after = s + that.after; return ""; }
beforeReplacer = function (s) {
that.before += s;
return "";
}
afterReplacer = function (s) {
that.after = s + that.after;
return "";
}
}
this.selection = this.selection.replace(/^(\s*)/, beforeReplacer).replace(/(\s*)$/, afterReplacer);
@ -847,14 +863,12 @@
if (window.innerHeight) {
result = window.pageYOffset;
}
else
if (doc.documentElement && doc.documentElement.scrollTop) {
result = doc.documentElement.scrollTop;
}
else
if (doc.body) {
result = doc.body.scrollTop;
}
else if (doc.documentElement && doc.documentElement.scrollTop) {
result = doc.documentElement.scrollTop;
}
else if (doc.body) {
result = doc.body.scrollTop;
}
return result;
};
@ -1023,9 +1037,9 @@
var background = doc.createElement("div"),
style = background.style;
background.className = "wmd-prompt-background";
style.position = "absolute";
style.top = "0";
@ -1107,7 +1121,6 @@
};
// Create the text input box form/window.
var createDialog = function () {
@ -1128,7 +1141,9 @@
// The web form container for the text box and buttons.
var form = doc.createElement("form"),
style = form.style;
form.onsubmit = function () { return close(false); };
form.onsubmit = function () {
return close(false);
};
style.padding = "0";
style.margin = "0";
style.cssFloat = "left";
@ -1150,7 +1165,9 @@
// The ok button
var okButton = doc.createElement("input");
okButton.type = "button";
okButton.onclick = function () { return close(false); };
okButton.onclick = function () {
return close(false);
};
okButton.value = "OK";
style = okButton.style;
style.margin = "10px";
@ -1161,7 +1178,9 @@
// The cancel button
var cancelButton = doc.createElement("input");
cancelButton.type = "button";
cancelButton.onclick = function () { return close(true); };
cancelButton.onclick = function () {
return close(true);
};
cancelButton.value = "Cancel";
style = cancelButton.style;
style.margin = "10px";
@ -1415,14 +1434,17 @@
}
else {
image.style.backgroundPosition = button.XShift + " " + disabledYShift;
button.onmouseover = button.onmouseout = button.onclick = function () { };
button.onmouseover = button.onmouseout = button.onclick = function () {
};
}
}
function bindCommand(method) {
if (typeof method === "string")
method = commandManager[method];
return function () { method.apply(commandManager, arguments); }
return function () {
method.apply(commandManager, arguments);
}
}
function makeSpritedButtonRow() {
@ -1484,14 +1506,18 @@
buttons.hr = makeButton("wmd-hr-button", getString("hr"), "-180px", bindCommand("doHorizontalRule"));
makeSpacer(3);
buttons.undo = makeButton("wmd-undo-button", getString("undo"), "-200px", null);
buttons.undo.execute = function (manager) { if (manager) manager.undo(); };
buttons.undo.execute = function (manager) {
if (manager) manager.undo();
};
var redoTitle = /win/.test(nav.platform.toLowerCase()) ?
getString("redo") :
getString("redomac"); // mac and other non-Windows platforms
buttons.redo = makeButton("wmd-redo-button", redoTitle, "-220px", null);
buttons.redo.execute = function (manager) { if (manager) manager.redo(); };
buttons.redo.execute = function (manager) {
if (manager) manager.redo();
};
if (helpOptions) {
var helpButton = document.createElement("li");
@ -1716,7 +1742,7 @@
}
else {
// We're moving start and end tag back into the selection, since (as we're in the else block) we're not
// *removing* a link, but *adding* one, so whatever findTags() found is now back to being part of the
// link text. linkEnteredCallback takes care of escaping any brackets.
@ -1754,7 +1780,7 @@
// would mean a zero-width match at the start. Since zero-width matches advance the string position,
// the first bracket could then not act as the "not a backslash" for the second.
chunk.selection = (" " + chunk.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g, "$1\\").substr(1);
var linkDef = " [999]: " + properlyEncoded(link);
var num = that.addLinkDef(chunk, linkDef);
@ -1796,7 +1822,7 @@
chunk.before = chunk.before.replace(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]*\n$/, "\n\n");
chunk.before = chunk.before.replace(/(\n|^)[ ]{0,3}>[ \t]*\n$/, "\n\n");
chunk.before = chunk.before.replace(/(\n|^)[ \t]+\n$/, "\n\n");
// There's no selection, end the cursor wasn't at the end of the line:
// The user wants to split the current list item / code line / blockquote line
// (for the latter it doesn't really matter) in two. Temporarily select the
@ -1824,7 +1850,7 @@
commandMgr.doCode(chunk);
}
}
if (fakeSelection) {
chunk.after = chunk.selection + chunk.after;
chunk.selection = "";
@ -1853,15 +1879,15 @@
// text *directly before* the selection already was a blockquote:
/*
if (chunk.before) {
chunk.before = chunk.before.replace(/\n?$/, "\n");
}
chunk.before = chunk.before.replace(/(((\n|^)(\n[ \t]*)*>(.+\n)*.*)+(\n[ \t]*)*$)/,
function (totalMatch) {
chunk.startTag = totalMatch;
return "";
});
*/
if (chunk.before) {
chunk.before = chunk.before.replace(/\n?$/, "\n");
}
chunk.before = chunk.before.replace(/(((\n|^)(\n[ \t]*)*>(.+\n)*.*)+(\n[ \t]*)*$)/,
function (totalMatch) {
chunk.startTag = totalMatch;
return "";
});
*/
// This comes down to:
// Go backwards as many lines a possible, such that each line
@ -1968,10 +1994,10 @@
if (!/\n/.test(chunk.selection)) {
chunk.selection = chunk.selection.replace(/^(> *)/,
function (wholeMatch, blanks) {
chunk.startTag += blanks;
return "";
});
function (wholeMatch, blanks) {
chunk.startTag += blanks;
return "";
});
}
};


+ 1
- 1
system/admin/editor/js/Markdown.Sanitizer.js View File

@ -7,7 +7,7 @@
output = window.Markdown;
Converter = output.Converter;
}
output.getSanitizingConverter = function () {
var converter = new Converter();
converter.hooks.chain("postConversion", sanitizeHtml);


+ 2
- 2
system/admin/editor/js/local/Markdown.local.fr.js View File

@ -3,8 +3,8 @@
// var myConverter = new Markdown.Editor(myConverter, null, { strings: Markdown.local.fr });
(function () {
Markdown.local = Markdown.local || {};
Markdown.local.fr = {
Markdown.local = Markdown.local || {};
Markdown.local.fr = {
bold: "Gras <strong> Ctrl+B",
boldexample: "texte en gras",


+ 17
- 10
system/admin/editor/package.json View File

@ -1,12 +1,19 @@
{
"name": "pagedown",
"version": "1.1.0",
"description": "markdown converter, based on showdown",
"repository": { "type": "hg", "url": "https://code.google.com/p/pagedown/" },
"keywords": ["markdown"],
"license": "MIT",
"files": ["Markdown.Converter.js", "Markdown.Sanitizer.js", "node-pagedown.js"],
"main": "node-pagedown.js",
"bugs": "http://code.google.com/p/pagedown/issues/list",
"homepage": "http://code.google.com/p/pagedown/wiki/PageDown"
"name": "pagedown",
"version": "1.1.0",
"description": "markdown converter, based on showdown",
"repository": {
"type": "hg",
"url": "https://code.google.com/p/pagedown/"
},
"keywords": ["markdown"],
"license": "MIT",
"files": [
"Markdown.Converter.js",
"Markdown.Sanitizer.js",
"node-pagedown.js"
],
"main": "node-pagedown.js",
"bugs": "http://code.google.com/p/pagedown/issues/list",
"homepage": "http://code.google.com/p/pagedown/wiki/PageDown"
}

+ 13
- 12
system/admin/views/404.html.php View File

@ -1,19 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no" />
<title>404 Not Found - <?php echo blog_title() ?></title>
<link href="<?php echo site_url() ?>themes/default/css/style.css" rel="stylesheet" />
<!-- Include the Open Sans font -->
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no"/>
<title>404 Not Found - <?php echo blog_title() ?></title>
<link href="<?php echo site_url() ?>themes/default/css/style.css" rel="stylesheet"/>
<!-- Include the Open Sans font -->
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="center message">
<h1>This page doesn't exist!</h1>
<p>Would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
</div>
<div class="center message">
<h1>This page doesn't exist!</h1>
<p>Would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
</div>
</body>
</html>

+ 37
- 20
system/admin/views/add-page.html.php View File

@ -1,30 +1,47 @@
<link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css" />
<link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Converter.js"></script>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Sanitizer.js"></script>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Editor.js"></script>
<?php if (isset($error)) { ?>
<div class="error-message"><?php echo $error ?></div>
<?php } ?>
<div class="error-message"><?php echo $error ?></div>
<?php } ?>
<div class="wmd-panel">
<form method="POST">
Title <span class="required">*</span><br><input type="text" class="text <?php if (isset($postTitle)) { if (empty($postTitle)) { echo 'error';}} ?>" name="title" value="<?php if (isset($postTitle)) { echo $postTitle;} ?>"/><br><br>
Url (optional)<br><input type="text" class="text" name="url" value="<?php if (isset($postUrl)) { echo $postUrl;} ?>"/><br>
<span class="help">If the url leave empty we will use the page title.</span><br><br>
Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) { echo $p->description;} ?></textarea>
<br>
<div id="wmd-button-bar" class="wmd-button-bar"></div>
<textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { if (empty($postContent)) { echo 'error';}} ?>" name="content" cols="20" rows="10"><?php if (isset($postContent)) { echo $postContent;} ?></textarea><br/>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf()?>">
<input type="submit" name="submit" class="submit" value="Publish"/>
</form>
<form method="POST">
Title <span class="required">*</span><br><input type="text" class="text <?php if (isset($postTitle)) {
if (empty($postTitle)) {
echo 'error';
}
} ?>" name="title" value="<?php if (isset($postTitle)) {
echo $postTitle;
} ?>"/><br><br>
Url (optional)<br><input type="text" class="text" name="url" value="<?php if (isset($postUrl)) {
echo $postUrl;
} ?>"/><br>
<span class="help">If the url leave empty we will use the page title.</span><br><br>
Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) {
echo $p->description;
} ?></textarea>
<br>
<div id="wmd-button-bar" class="wmd-button-bar"></div>
<textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) {
if (empty($postContent)) {
echo 'error';
}
} ?>" name="content" cols="20" rows="10"><?php if (isset($postContent)) {
echo $postContent;
} ?></textarea><br/>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
<input type="submit" name="submit" class="submit" value="Publish"/>
</form>
</div>
<div id="wmd-preview" class="wmd-panel wmd-preview"></div>
<script type="text/javascript">
(function () {
var converter = new Markdown.Converter();
(function () {
var converter = new Markdown.Converter();
var editor = new Markdown.Editor(converter);
var editor = new Markdown.Editor(converter);
editor.run();
})();
editor.run();
})();
</script>

+ 50
- 23
system/admin/views/add-post.html.php View File

@ -1,33 +1,60 @@
<link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css" />
<link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Converter.js"></script>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Sanitizer.js"></script>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Editor.js"></script>
<?php if (isset($error)) { ?>
<div class="error-message"><?php echo $error ?></div>
<?php } ?>
<div class="error-message"><?php echo $error ?></div>
<?php } ?>
<div class="wmd-panel">
<form method="POST">
Title <span class="required">*</span> <br><input type="text" class="text <?php if (isset($postTitle)) { if (empty($postTitle)) { echo 'error';}} ?>" name="title" value="<?php if (isset($postTitle)) { echo $postTitle;} ?>"/><br><br>
Tag <span class="required">*</span> <br><input type="text" class="text <?php if (isset($postTag)) { if (empty($postTag)) { echo 'error';}} ?>" name="tag" value="<?php if (isset($postTag)) { echo $postTag;} ?>"/><br><br>
Url (optional)<br><input type="text" class="text" name="url" value="<?php if (isset($postUrl)) { echo $postUrl;} ?>"/><br>
<span class="help">If the url leave empty we will use the post title.</span><br><br>
Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) { echo $p->description;} ?></textarea>
<br><br>
Featured Image (optional)<br><input type="text" class="text" name="fi" value="<?php if (isset($postFi)) { echo $postFi;} ?>"/><br><br>
Embed Youtube Video (optional)<br><input type="text" class="text" name="vid" value="<?php if (isset($postVid)) { echo $postVid;} ?>"/><br><br>
<div id="wmd-button-bar" class="wmd-button-bar"></div>
<textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { if (empty($postContent)) { echo 'error';}} ?>" name="content" cols="20" rows="10"><?php if (isset($postContent)) { echo $postContent;} ?></textarea><br/>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf()?>">
<input type="submit" name="submit" class="submit" value="Publish"/>
</form>
<form method="POST">
Title <span class="required">*</span> <br><input type="text" class="text <?php if (isset($postTitle)) {
if (empty($postTitle)) {
echo 'error';
}
} ?>" name="title" value="<?php if (isset($postTitle)) {
echo $postTitle;
} ?>"/><br><br>
Tag <span class="required">*</span> <br><input type="text" class="text <?php if (isset($postTag)) {
if (empty($postTag)) {
echo 'error';
}
} ?>" name="tag" value="<?php if (isset($postTag)) {
echo $postTag;
} ?>"/><br><br>
Url (optional)<br><input type="text" class="text" name="url" value="<?php if (isset($postUrl)) {
echo $postUrl;
} ?>"/><br>
<span class="help">If the url leave empty we will use the post title.</span><br><br>
Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) {
echo $p->description;
} ?></textarea>
<br><br>
Featured Image (optional)<br><input type="text" class="text" name="fi" value="<?php if (isset($postFi)) {
echo $postFi;
} ?>"/><br><br>
Embed Youtube Video (optional)<br><input type="text" class="text" name="vid" value="<?php if (isset($postVid)) {
echo $postVid;
} ?>"/><br><br>
<div id="wmd-button-bar" class="wmd-button-bar"></div>
<textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) {
if (empty($postContent)) {
echo 'error';
}
} ?>" name="content" cols="20" rows="10"><?php if (isset($postContent)) {
echo $postContent;
} ?></textarea><br/>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
<input type="submit" name="submit" class="submit" value="Publish"/>
</form>
</div>
<div id="wmd-preview" class="wmd-panel wmd-preview"></div>
<script type="text/javascript">
(function () {
var converter = new Markdown.Converter();
(function () {
var converter = new Markdown.Converter();
var editor = new Markdown.Editor(converter);
var editor = new Markdown.Editor(converter);
editor.run();
})();
editor.run();
})();
</script>

+ 11
- 12
system/admin/views/backup-start.html.php View File

@ -2,23 +2,22 @@
$title = config('blog.title');
$name = preg_replace('/[^A-Za-z0-9 ,.-]/u', '', strtolower($title));
$name = str_replace(' ', '-',$name);
$name = str_replace('--', '-',$name);
$name = str_replace('--', '-',$name);
$name = str_replace(' ', '-', $name);
$name = str_replace('--', '-', $name);
$name = str_replace('--', '-', $name);
$name = rtrim(ltrim($name, ' \,\.\-'), ' \,\.\-');
$timestamp = date('Y-m-d-H-i-s');
$dir = 'backup';
if(is_dir($dir)) {
Zip('content/', 'backup/' . $name . '_' . $timestamp . '.zip', true);
}
else {
mkdir($dir, 0777, true);
Zip('content/', 'backup/' . $name . '_' . $timestamp . '.zip', true);
if (is_dir($dir)) {
Zip('content/', 'backup/' . $name . '_' . $timestamp . '.zip', true);
} else {
mkdir($dir, 0777, true);
Zip('content/', 'backup/' . $name . '_' . $timestamp . '.zip', true);
}
$redirect = site_url() . 'admin/backup';
header("Location: $redirect");
?>
header("Location: $redirect");
?>

+ 12
- 12
system/admin/views/backup.html.php View File

@ -1,15 +1,15 @@
<?php
if(login()) {
if(isset($_GET['file'])) {
$file = $_GET['file'];
<?php
if (login()) {
if (isset($_GET['file'])) {
$file = $_GET['file'];
if(!empty($file)) {
unlink($file);
}
}
}
if (!empty($file)) {
unlink($file);
}
}
}
?>
<a href="<?php echo site_url() ?>admin/backup-start">Create backup</a>
<h2>Your backups</h2>
<a href="<?php echo site_url() ?>admin/backup-start">Create backup</a>
<h2>Your backups</h2>
<?php echo get_backup_files() ?>

+ 4
- 4
system/admin/views/clear-cache.html.php View File

@ -2,11 +2,11 @@
rebuilt_cache('all');
foreach(glob('cache/page/*.cache', GLOB_NOSORT) as $file) {
unlink($file);
foreach (glob('cache/page/*.cache', GLOB_NOSORT) as $file) {
unlink($file);
}
echo 'All cache has been deleted!';
?>
?>

+ 1
- 0
system/admin/views/config.html.php View File

@ -32,6 +32,7 @@
return "0";
return (string)$value;
}
foreach ($array as $key => $value) {
echo '<tr>';
echo '<td><label for="' . $key . '">' . $key . '</label></td>';


+ 15
- 15
system/admin/views/delete-page.html.php View File

@ -1,25 +1,25 @@
<?php
if (isset($_GET['destination'])) {
$destination = $_GET['destination'];
}
$url = $p->file;
if (isset($_GET['destination'])) {
$destination = $_GET['destination'];
}
$url = $p->file;
$dir = substr($url, 0, strrpos($url, '/'));
$oldurl = str_replace($dir . '/', '', $url);
$oldmd = str_replace('.md', '', $oldurl);
$dir = substr($url, 0, strrpos($url, '/'));
$oldurl = str_replace($dir . '/', '', $url);
$oldmd = str_replace('.md', '', $oldurl);
$post = $p->url;
$post = $p->url;
if (isset($destination)) {
if (isset($destination)) {
if ($destination == 'post') {
$back = $post;
} else {
$back = site_url() . $destination;
}
if ($destination == 'post') {
$back = $post;
} else {
$back = site_url();
$back = site_url() . $destination;
}
} else {
$back = site_url();
}
?>
<p>Are you sure want to delete <strong><?php echo $p->title; ?></strong>?</p>
<form method="POST">


+ 33
- 35
system/admin/views/delete-post.html.php View File

@ -1,40 +1,38 @@
<?php
if(isset($_GET['destination'])) {
$destination = $_GET['destination'];
}
$url = $p->file;
$oldurl = explode('_', $url);
$oldtag = $oldurl[1];
$oldmd = str_replace('.md','',$oldurl[2]);
if (isset($_GET['destination'])) {
$destination = $_GET['destination'];
}
$url = $p->file;
$oldurl = explode('_', $url);
$oldtag = $oldurl[1];
$oldmd = str_replace('.md', '', $oldurl[2]);
$replaced = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/';
$dt = str_replace($replaced, '', $oldurl[0]);
$t = str_replace('-', '', $dt);
$time = new DateTime($t);
$timestamp = $time->format("Y-m-d");
// The post date
$postdate = strtotime($timestamp);
// The post URL
$post = site_url() . date('Y/m', $postdate) . '/' . $oldmd;
if (isset($destination)) {
if ($destination == 'post') {
$back = $post;
} else {
$back = site_url() . $destination;
}
} else {
$back = site_url();
}
$replaced = substr($oldurl[0], 0,strrpos($oldurl[0], '/')) . '/';
$dt = str_replace($replaced,'',$oldurl[0]);
$t = str_replace('-','',$dt);
$time = new DateTime($t);
$timestamp= $time->format("Y-m-d");
// The post date
$postdate = strtotime($timestamp);
// The post URL
$post = site_url().date('Y/m', $postdate).'/'.$oldmd;
if(isset($destination)) {
if($destination == 'post') {
$back = $post;
}
else {
$back = site_url() . $destination;
}
}
else {
$back = site_url();
}
?>
<?php echo '<p>Are you sure want to delete <strong>' . $p->title . '</strong>?</p>';?>
<?php echo '<p>Are you sure want to delete <strong>' . $p->title . '</strong>?</p>'; ?>
<form method="POST">
<input type="hidden" name="file" value="<?php echo $p->file ?>"/><br>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf()?>">
<input type="submit" name="submit" value="Delete"/>
<span><a href="<?php echo $back ?>">Cancel</a></span>
<input type="hidden" name="file" value="<?php echo $p->file ?>"/><br>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
<input type="submit" name="submit" value="Delete"/>
<span><a href="<?php echo $back ?>">Cancel</a></span>
</form>

+ 53
- 43
system/admin/views/edit-page.html.php View File

@ -1,56 +1,66 @@
<?php
if(isset($p->file)) {
$url = $p->file;
}
else {
$url = $oldfile;
}
$content = file_get_contents($url);
$oldtitle = get_content_tag('t',$content,'Untitled');
$oldcontent = remove_html_comments($content);
if(isset($_GET['destination'])) {
$destination = $_GET['destination'];
}
else {
$destination = 'admin';
}
$dir = substr($url, 0, strrpos($url, '/'));
$oldurl = str_replace($dir . '/','',$url);
$oldmd = str_replace('.md','',$oldurl);
$delete = $p->url . '/delete?destination=' . $destination;
if (isset($p->file)) {
$url = $p->file;
} else {
$url = $oldfile;
}
$content = file_get_contents($url);
$oldtitle = get_content_tag('t', $content, 'Untitled');
$oldcontent = remove_html_comments($content);
if (isset($_GET['destination'])) {
$destination = $_GET['destination'];
} else {
$destination = 'admin';
}
$dir = substr($url, 0, strrpos($url, '/'));
$oldurl = str_replace($dir . '/', '', $url);
$oldmd = str_replace('.md', '', $oldurl);
$delete = $p->url . '/delete?destination=' . $destination;
?>
<link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css" />
<link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Converter.js"></script>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Sanitizer.js"></script>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Editor.js"></script>
<?php if (isset($error)) { ?>
<div class="error-message"><?php echo $error ?></div>
<?php } ?>
<div class="error-message"><?php echo $error ?></div>
<?php } ?>
<div class="wmd-panel">
<form method="POST">
Title <span class="required">*</span><br><input type="text" name="title" class="text <?php if (isset($postTitle)) { if (empty($postTitle)) { echo 'error';}} ?>" value="<?php echo $oldtitle?>"/><br><br>
Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br>
<span class="help">If the url leave empty we will use the page title.</span><br><br>
Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) { echo $p->description;} ?></textarea>
<br><br>
<div id="wmd-button-bar" class="wmd-button-bar"></div>
<textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { if (empty($postContent)) { echo 'error';}} ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br>
<input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf()?>">
<input type="submit" name="submit" class="submit" value="Save"/> <a href="<?php echo $delete?>">Delete</a>
</form>
<form method="POST">
Title <span class="required">*</span><br><input type="text" name="title"
class="text <?php if (isset($postTitle)) {
if (empty($postTitle)) {
echo 'error';
}
} ?>" value="<?php echo $oldtitle ?>"/><br><br>
Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br>
<span class="help">If the url leave empty we will use the page title.</span><br><br>
Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) {
echo $p->description;
} ?></textarea>
<br><br>
<div id="wmd-button-bar" class="wmd-button-bar"></div>
<textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) {
if (empty($postContent)) {
echo 'error';
}
} ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br>
<input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
<input type="submit" name="submit" class="submit" value="Save"/> <a href="<?php echo $delete ?>">Delete</a>
</form>
</div>
<div id="wmd-preview" class="wmd-panel wmd-preview"></div>
<script type="text/javascript">
(function () {
var converter = new Markdown.Converter();
(function () {
var converter = new Markdown.Converter();
var editor = new Markdown.Editor(converter);
var editor = new Markdown.Editor(converter);
editor.run();
})();
editor.run();
})();
</script>

+ 77
- 62
system/admin/views/edit-post.html.php View File

@ -1,75 +1,90 @@
<?php
if(isset($p->file)) {
$url = $p->file;
}
else {
$url = $oldfile;
}
if (isset($p->file)) {
$url = $p->file;
} else {
$url = $oldfile;
}
$content = file_get_contents($url);
$oldtitle = get_content_tag('t', $content, 'Untitled');
$oldfi = get_content_tag('fi', $content);
$oldvid = get_content_tag('vid', $content);
$oldcontent = remove_html_comments($content);
$dir = substr($url, 0, strrpos($url, '/'));
$oldurl = explode('_', $url);
$oldtag = $oldurl[1];
$oldmd = str_replace('.md', '', $oldurl[2]);
if (isset($_GET['destination'])) {
$destination = $_GET['destination'];
} else {
$destination = 'admin';
}
$replaced = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/';
$dt = str_replace($replaced, '', $oldurl[0]);
$t = str_replace('-', '', $dt);
$time = new DateTime($t);
$timestamp = $time->format("Y-m-d");
// The post date
$postdate = strtotime($timestamp);
// The post URL
$delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destination=' . $destination;
$content = file_get_contents($url);
$oldtitle = get_content_tag('t',$content,'Untitled');
$oldfi = get_content_tag('fi',$content);
$oldvid = get_content_tag('vid',$content);
$oldcontent = remove_html_comments($content);
$dir = substr($url, 0, strrpos($url, '/'));
$oldurl = explode('_', $url);
$oldtag = $oldurl[1];
$oldmd = str_replace('.md','',$oldurl[2]);
if(isset($_GET['destination'])) {
$destination = $_GET['destination'];
}
else {
$destination = 'admin';
}
$replaced = substr($oldurl[0], 0,strrpos($oldurl[0], '/')) . '/';
$dt = str_replace($replaced,'',$oldurl[0]);
$t = str_replace('-','',$dt);
$time = new DateTime($t);
$timestamp= $time->format("Y-m-d");
// The post date
$postdate = strtotime($timestamp);
// The post URL
$delete= site_url().date('Y/m', $postdate).'/'.$oldmd . '/delete?destination=' . $destination;
?>
<link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css" />
<link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Converter.js"></script>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Sanitizer.js"></script>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Editor.js"></script>
<?php if (isset($error)) { ?>
<div class="error-message"><?php echo $error ?></div>
<?php } ?>
<div class="error-message"><?php echo $error ?></div>
<?php } ?>
<div class="wmd-panel">
<form method="POST">
Title <span class="required">*</span> <br><input type="text" name="title" class="text <?php if (isset($postTitle)) { if (empty($postTitle)) { echo 'error';}} ?>" value="<?php echo $oldtitle?>"/><br><br>
Tag <span class="required">*</span> <br><input type="text" name="tag" class="text <?php if (isset($postTag)) { if (empty($postTag)) { echo 'error';}} ?>" value="<?php echo $oldtag?>"/><br><br>
Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br>
<span class="help">If the url leave empty we will use the post title.</span><br><br>
Date Time<br><input type="date" name="date" class="text" value="<?php echo $timestamp; ?>"><br><input type="time" name="time" class="text" value="<?php echo $time->format('H:i'); ?>"><br><br>
Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) { echo $p->description;} ?></textarea>
<br><br>
Featured Image (optional)<br><input type="text" class="text" name="fi" value="<?php echo $oldfi?>"/><br><br>
Embed Youtube Video (optional)<br><input type="text" class="text" name="vid" value="<?php echo $oldvid?>"/><br><br>
<div id="wmd-button-bar" class="wmd-button-bar"></div>
<textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { if (empty($postContent)) { echo 'error';}} ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br>
<input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf()?>">
<input type="submit" name="submit" class="submit" value="Save"/> <a href="<?php echo $delete?>">Delete</a>
</form>
<form method="POST">
Title <span class="required">*</span> <br><input type="text" name="title"
class="text <?php if (isset($postTitle)) {
if (empty($postTitle)) {
echo 'error';
}
} ?>" value="<?php echo $oldtitle ?>"/><br><br>
Tag <span class="required">*</span> <br><input type="text" name="tag" class="text <?php if (isset($postTag)) {
if (empty($postTag)) {
echo 'error';
}
} ?>" value="<?php echo $oldtag ?>"/><br><br>
Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br>
<span class="help">If the url leave empty we will use the post title.</span><br><br>
Date Time<br><input type="date" name="date" class="text" value="<?php echo $timestamp; ?>"><br><input
type="time" name="time" class="text" value="<?php echo $time->format('H:i'); ?>"><br><br>
Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) {
echo $p->description;
} ?></textarea>
<br><br>
Featured Image (optional)<br><input type="text" class="text" name="fi" value="<?php echo $oldfi ?>"/><br><br>
Embed Youtube Video (optional)<br><input type="text" class="text" name="vid" value="<?php echo $oldvid ?>"/><br><br>
<div id="wmd-button-bar" class="wmd-button-bar"></div>
<textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) {
if (empty($postContent)) {
echo 'error';
}
} ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br>
<input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
<input type="submit" name="submit" class="submit" value="Save"/> <a href="<?php echo $delete ?>">Delete</a>
</form>
</div>
<div id="wmd-preview" class="wmd-panel wmd-preview"></div>
<script type="text/javascript">
(function () {
var converter = new Markdown.Converter();
(function () {
var converter = new Markdown.Converter();
var editor = new Markdown.Editor(converter);
var editor = new Markdown.Editor(converter);
editor.run();
})();
editor.run();
})();
</script>

+ 42
- 33
system/admin/views/edit-profile.html.php View File

@ -1,47 +1,56 @@
<?php
if(isset($_SESSION[config("site.url")]['user'])) {
$user = $_SESSION[config("site.url")]['user'];
}
$filename = 'content/' . $user . '/author.md';
if(file_exists($filename)) {
$content = file_get_contents($filename);
$oldtitle = get_content_tag('t',$content,'user');
$oldcontent = remove_html_comments($content);
}
else {
$oldtitle = $user;
$oldcontent = 'Just another HTMLy user.';
}
if (isset($_SESSION[config("site.url")]['user'])) {
$user = $_SESSION[config("site.url")]['user'];
}
$filename = 'content/' . $user . '/author.md';
if (file_exists($filename)) {
$content = file_get_contents($filename);
$oldtitle = get_content_tag('t', $content, 'user');
$oldcontent = remove_html_comments($content);
} else {
$oldtitle = $user;
$oldcontent = 'Just another HTMLy user.';
}
?>
<link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css" />
<link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Converter.js"></script>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Sanitizer.js"></script>
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Editor.js"></script>
<?php if (isset($error)) { ?>
<div class="error-message"><?php echo $error ?></div>
<?php } ?>
<div class="error-message"><?php echo $error ?></div>
<?php } ?>
<div class="wmd-panel">
<form method="POST">
Title <span class="required">*</span> <br><input type="text" name="title" class="text <?php if (isset($postTitle)) { if (empty($postTitle)) { echo 'error';}} ?>" value="<?php echo $oldtitle?>"/><br><br>
<br>
<div id="wmd-button-bar" class="wmd-button-bar"></div>
<textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { if (empty($postContent)) { echo 'error';}} ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf()?>">
<input type="submit" name="submit" class="submit" value="Save"/>
</form>
<form method="POST">
Title <span class="required">*</span> <br><input type="text" name="title"
class="text <?php if (isset($postTitle)) {
if (empty($postTitle)) {
echo 'error';
}
} ?>" value="<?php echo $oldtitle ?>"/><br><br>
<br>
<div id="wmd-button-bar" class="wmd-button-bar"></div>
<textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) {
if (empty($postContent)) {
echo 'error';
}
} ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
<input type="submit" name="submit" class="submit" value="Save"/>
</form>
</div>
<div id="wmd-preview" class="wmd-panel wmd-preview"></div>
<script type="text/javascript">
(function () {
var converter = new Markdown.Converter();
(function () {
var converter = new Markdown.Converter();
var editor = new Markdown.Editor(converter);
var editor = new Markdown.Editor(converter);
editor.run();
})();
editor.run();
})();
</script>

+ 10
- 6
system/admin/views/import.html.php View File

@ -1,11 +1,15 @@
<?php if (isset($error)) { ?>
<div class="error-message"><?php echo $error?></div>
<?php } ?>
<div class="error-message"><?php echo $error ?></div>
<?php } ?>
<h1>Import RSS Feed 2.0</h1>
<p>By using this importer you are agree if the feed is yours, or at least you have the authority to publish it.</p>
<form method="POST">
Feed Url <span class="required">*</span> <br><input type="url" class="text <?php if (isset($url)) { if (empty($url)) { echo 'error';}} ?>" name="url"/><br><br>
Add source link (optional) <input type="checkbox" class="checkbox" name="credit" value="yes"/><br><br>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf()?>">
<input type="submit" name="submit" class="submit" value="Import"/>
Feed Url <span class="required">*</span> <br><input type="url" class="text <?php if (isset($url)) {
if (empty($url)) {
echo 'error';
}
} ?>" name="url"/><br><br>
Add source link (optional) <input type="checkbox" class="checkbox" name="credit" value="yes"/><br><br>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
<input type="submit" name="submit" class="submit" value="Import"/>
</form>

+ 51
- 47
system/admin/views/layout.html.php View File

@ -1,54 +1,58 @@
<!DOCTYPE html>
<html>
<head>
<?php echo $head_contents ?>
<link href="<?php echo site_url() ?>themes/default/css/style.css" rel="stylesheet" />
<link href='//fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<?php if (publisher()):?><link href="<?php echo publisher() ?>" rel="publisher" /><?php endif;?>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<?php echo $head_contents ?>
<link href="<?php echo site_url() ?>themes/default/css/style.css" rel="stylesheet"/>
<link href='//fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<?php if (publisher()): ?>
<link href="<?php echo publisher() ?>" rel="publisher" /><?php endif; ?>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body class="admin <?php echo $bodyclass; ?>" itemscope="itemscope" itemtype="http://schema.org/Blog">
<div class="hide">
<meta content="<?php echo blog_title() ?>" itemprop="name"/>
<meta content="<?php echo blog_description() ?>" itemprop="description"/>
</div>
<?php if(login()) { toolbar();} ?>
<div id="outer-wrapper">
<div id="menu-wrapper">
<div class="container">
<nav id="menu">
<?php echo menu() ?>
<?php echo search() ?>
</nav>
</div>
</div>
<div id="header-wrapper">
<div class="container">
<header id="header">
<section id="branding">
<h1 class="blog-title"><a href="<?php echo site_url() ?>"><?php echo blog_title() ?></a></h1>
<div class="blog-tagline"><p><?php echo blog_tagline() ?></p></div>
</section>
</header>
</div>
</div>
<div id="content-wrapper">
<div class="container">
<section id="content">
<?php echo content()?>
</section>
</div>
</div>
<div id="footer-wrapper">
<div class="container">
<footer id="footer">
<div class="copyright"><?php echo copyright() ?></div>
</footer>
</div>
</div>
</div>
<?php if (analytics()):?><?php echo analytics() ?><?php endif;?>
<div class="hide">
<meta content="<?php echo blog_title() ?>" itemprop="name"/>
<meta content="<?php echo blog_description() ?>" itemprop="description"/>
</div>
<?php if (login()) {
toolbar();
} ?>
<div id="outer-wrapper">
<div id="menu-wrapper">
<div class="container">
<nav id="menu">
<?php echo menu() ?>
<?php echo search() ?>
</nav>
</div>
</div>
<div id="header-wrapper">
<div class="container">
<header id="header">
<section id="branding">
<h1 class="blog-title"><a href="<?php echo site_url() ?>"><?php echo blog_title() ?></a></h1>
<div class="blog-tagline"><p><?php echo blog_tagline() ?></p></div>
</section>
</header>
</div>
</div>
<div id="content-wrapper">
<div class="container">
<section id="content">
<?php echo content() ?>
</section>
</div>
</div>
<div id="footer-wrapper">
<div class="container">
<footer id="footer">
<div class="copyright"><?php echo copyright() ?></div>
</footer>
</div>
</div>
</div>
<?php if (analytics()): ?><?php echo analytics() ?><?php endif; ?>
</body>
</html>

+ 25
- 15
system/admin/views/login.html.php View File

@ -1,19 +1,29 @@
<?php if (isset($error)) { ?>
<div class="error-message"><?php echo $error?></div>
<?php } ?>
<?php if(!login()) {?>
<h1>Login</h1>
<form method="POST" action="login">
User <span class="required">*</span> <br>
<input type="text" class="<?php if (isset($username)) { if (empty($username)) { echo 'error';}} ?>" name="user"/><br><br>
Password <span class="required">*</span> <br>
<input type="password" class="<?php if (isset($password)) { if (empty($password)) { echo 'error';}} ?>" name="password"/><br><br>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf()?>">
<?php if(config("google.reCaptcha")):?>
<div class="error-message"><?php echo $error ?></div>
<?php } ?>
<?php if (!login()) { ?>
<h1>Login</h1>
<form method="POST" action="login">
User <span class="required">*</span> <br>
<input type="text" class="<?php if (isset($username)) {
if (empty($username)) {
echo 'error';
}
} ?>" name="user"/><br><br>
Password <span class="required">*</span> <br>
<input type="password" class="<?php if (isset($password)) {
if (empty($password)) {
echo 'error';
}
} ?>" name="password"/><br><br>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
<?php if (config("google.reCaptcha")): ?>
<script src='https://www.google.com/recaptcha/api.js'></script>
<div class="g-recaptcha" data-sitekey="<?php echo config("google.reCaptcha.public"); ?>"></div>
<br/>
<?php endif;?>
<input type="submit" name="submit" value="Login"/>
</form>
<?php } else {header('location: admin');} ?>
<?php endif; ?>
<input type="submit" name="submit" value="Login"/>
</form>
<?php } else {
header('location: admin');
} ?>

+ 2
- 2
system/admin/views/main.html.php View File

@ -1,5 +1,5 @@
<?php
<?php
echo '<h2>Your recent posts</h2>';
get_recent_posts();
get_recent_posts();
echo '<h2>Static pages</h2>';
get_recent_pages(); ?>

+ 49
- 39
system/admin/views/posts-list.html.php View File

@ -1,39 +1,49 @@
<h2 class="post-index"><?php echo $heading?></h2>
<?php if(!empty($posts)) {?>
<table class="post-list">
<tr class="head"><th>Title</th><th>Published</th><?php if(config("views.counter") == "true"):?><th>Views</th><?php endif;?><th>Author</th><th>Tag</th><th>Operations</th></tr>
<?php $i = 0; $len = count($posts);?>
<?php foreach($posts as $p):?>
<?php
if ($i == 0) {
$class = 'item first';
}
elseif ($i == $len - 1) {
$class = 'item last';
}
else {
$class = 'item';
}
$i++;
?>
<tr class="<?php echo $class ?>">
<td><a target="_blank" href="<?php echo $p->url ?>"><?php echo $p->title ?></a></td>
<td><?php echo date('d F Y', $p->date) ?></td>
<?php if(config("views.counter") == "true"):?><td><?php echo $p->views ?></td><?php endif;?>
<td><a target="_blank" href="<?php echo $p->authorurl ?>"><?php echo $p->author ?></a></td>
<td><?php echo $p->tag ?></td>
<td><a href="<?php echo $p->url ?>/edit?destination=admin/posts">Edit</a> <a href="<?php echo $p->url ?>/delete?destination=admin/posts">Delete</a></td>
</tr>
<?php endforeach;?>
</table>
<?php if (!empty($pagination['prev']) || !empty($pagination['next'])):?>
<div class="pager">
<?php if (!empty($pagination['prev'])):?>
<span><a href="?page=<?php echo $page-1?>" class="pagination-arrow newer" rel="prev">Newer</a></span>
<?php endif;?>
<?php if (!empty($pagination['next'])):?>
<span><a href="?page=<?php echo $page+1?>" class="pagination-arrow older" rel="next">Older</a></span>
<?php endif;?>
</div>
<?php endif;?>
<?php } else { echo 'No posts found!'; }?>
<h2 class="post-index"><?php echo $heading ?></h2>
<?php if (!empty($posts)) { ?>
<table class="post-list">
<tr class="head">
<th>Title</th>
<th>Published</th><?php if (config("views.counter") == "true"): ?>
<th>Views</th><?php endif; ?>
<th>Author</th>
<th>Tag</th>
<th>Operations</th>
</tr>
<?php $i = 0;
$len = count($posts); ?>
<?php foreach ($posts as $p): ?>
<?php
if ($i == 0) {
$class = 'item first';
} elseif ($i == $len - 1) {
$class = 'item last';
} else {
$class = 'item';
}
$i++;
?>
<tr class="<?php echo $class ?>">
<td><a target="_blank" href="<?php echo $p->url ?>"><?php echo $p->title ?></a></td>
<td><?php echo date('d F Y', $p->date) ?></td>
<?php if (config("views.counter") == "true"): ?>
<td><?php echo $p->views ?></td><?php endif; ?>
<td><a target="_blank" href="<?php echo $p->authorurl ?>"><?php echo $p->author ?></a></td>
<td><?php echo $p->tag ?></td>
<td><a href="<?php echo $p->url ?>/edit?destination=admin/posts">Edit</a> <a
href="<?php echo $p->url ?>/delete?destination=admin/posts">Delete</a></td>
</tr>
<?php endforeach; ?>
</table>
<?php if (!empty($pagination['prev']) || !empty($pagination['next'])): ?>
<div class="pager">
<?php if (!empty($pagination['prev'])): ?>
<span><a href="?page=<?php echo $page - 1 ?>" class="pagination-arrow newer" rel="prev">Newer</a></span>
<?php endif; ?>
<?php if (!empty($pagination['next'])): ?>
<span><a href="?page=<?php echo $page + 1 ?>" class="pagination-arrow older" rel="next">Older</a></span>
<?php endif; ?>
</div>
<?php endif; ?>
<?php } else {
echo 'No posts found!';
} ?>

+ 5
- 3
system/admin/views/updated-to.html.php View File

@ -1,6 +1,8 @@
<h3>Updated to<h3>
<h2>[<?php echo $info['tag_name'];?>] <?php echo $info['name']; ?></h2>
<p><?php echo \Michelf\MarkdownExtra::defaultTransform($info['body']);?></p>
<h3>Updated to
<h3>
<h2>[<?php echo $info['tag_name']; ?>] <?php echo $info['name']; ?></h2>
<p><?php echo \Michelf\MarkdownExtra::defaultTransform($info['body']); ?></p>
<?php
require_once "system/upgrade/run.php";

+ 47
- 38
system/admin/views/user-posts.html.php View File

@ -1,38 +1,47 @@
<h2 class="post-index"><?php echo $heading?></h2>
<?php if(!empty($posts)) {?>
<table class="post-list">
<tr class="head"><th>Title</th><th>Published</th><?php if(config("views.counter") == "true"):?><th>Views</th><?php endif; ?><th>Tag</th><th>Operations</th></tr>
<?php $i = 0; $len = count($posts);?>
<?php foreach($posts as $p):?>
<?php
if ($i == 0) {
$class = 'item first';
}
elseif ($i == $len - 1) {
$class = 'item last';
}
else {
$class = 'item';
}
$i++;
?>
<tr class="<?php echo $class ?>">
<td><a target="_blank" href="<?php echo $p->url ?>"><?php echo $p->title ?></a></td>
<td><?php echo date('d F Y', $p->date) ?></td>
<?php if(config("views.counter") == "true"):?><td><?php echo $p->views ?></td><?php endif;?>
<td><?php echo $p->tag ?></td>
<td><a href="<?php echo $p->url ?>/edit?destination=admin/mine">Edit</a> <a href="<?php echo $p->url ?>/delete?destination=admin/mine">Delete</a></td>
</tr>
<?php endforeach;?>
</table>
<?php if (!empty($pagination['prev']) || !empty($pagination['next'])):?>
<div class="pager">
<?php if (!empty($pagination['prev'])):?>
<span><a href="?page=<?php echo $page-1?>" class="pagination-arrow newer" rel="prev">Newer</a></span>
<?php endif;?>
<?php if (!empty($pagination['next'])):?>
<span><a href="?page=<?php echo $page+1?>" class="pagination-arrow older" rel="next">Older</a></span>
<?php endif;?>
</div>
<?php endif;?>
<?php } else { echo 'No posts found!'; }?>
<h2 class="post-index"><?php echo $heading ?></h2>
<?php if (!empty($posts)) { ?>
<table class="post-list">
<tr class="head">
<th>Title</th>
<th>Published</th><?php if (config("views.counter") == "true"): ?>
<th>Views</th><?php endif; ?>
<th>Tag</th>
<th>Operations</th>
</tr>
<?php $i = 0;
$len = count($posts); ?>
<?php foreach ($posts as $p): ?>
<?php
if ($i == 0) {
$class = 'item first';
} elseif ($i == $len - 1) {
$class = 'item last';
} else {
$class = 'item';
}
$i++;
?>
<tr class="<?php echo $class ?>">
<td><a target="_blank" href="<?php echo $p->url ?>"><?php echo $p->title ?></a></td>
<td><?php echo date('d F Y', $p->date) ?></td>
<?php if (config("views.counter") == "true"): ?>
<td><?php echo $p->views ?></td><?php endif; ?>
<td><?php echo $p->tag ?></td>
<td><a href="<?php echo $p->url ?>/edit?destination=admin/mine">Edit</a> <a
href="<?php echo $p->url ?>/delete?destination=admin/mine">Delete</a></td>
</tr>
<?php endforeach; ?>
</table>
<?php if (!empty($pagination['prev']) || !empty($pagination['next'])): ?>
<div class="pager">
<?php if (!empty($pagination['prev'])): ?>
<span><a href="?page=<?php echo $page - 1 ?>" class="pagination-arrow newer" rel="prev">Newer</a></span>
<?php endif; ?>
<?php if (!empty($pagination['next'])): ?>
<span><a href="?page=<?php echo $page + 1 ?>" class="pagination-arrow older" rel="next">Older</a></span>
<?php endif; ?>
</div>
<?php endif; ?>
<?php } else {
echo 'No posts found!';
} ?>

+ 19
- 19
system/htmly.php View File

@ -5,7 +5,7 @@ date_default_timezone_set('Asia/Jakarta');
// Load the configuration file
config('source', $config_file);
if(config('timezone')) {
if (config('timezone')) {
date_default_timezone_set(config('timezone'));
}
@ -18,7 +18,7 @@ get('/index', function () {
}
$page = from($_GET, 'page');
$page = $page ? (int) $page : 1;
$page = $page ? (int)$page : 1;
$perpage = config('posts.perpage');
$posts = get_posts(null, $page, $perpage);
@ -89,7 +89,7 @@ post('/login', function () {
if (!$proper) {
$message['error'] .= '<li>CSRF Token not correct.</li>';
}
if(!$captcha) {
if (!$captcha) {
$message['error'] .= '<li>reCaptcha not correct.</li>';
}
@ -344,12 +344,12 @@ post('/:year/:month/:name/edit', function () {
$date = from($_REQUEST, 'date');
$time = from($_REQUEST, 'time');
$dateTime = null;
if($date !== null && $time !== null) {
if ($date !== null && $time !== null) {
$dateTime = $date . ' ' . $time;
}
if ($proper && !empty($title) && !empty($tag) && !empty($content)) {
if(empty($url)) {
if (empty($url)) {
$url = $title;
}
edit_post($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $fi, $vid);
@ -442,7 +442,7 @@ get('/author/:profile', function ($profile) {
}
$page = from($_GET, 'page');
$page = $page ? (int) $page : 1;
$page = $page ? (int)$page : 1;
$perpage = config('profile.perpage');
$posts = get_profile($profile, $page, $perpage);
@ -545,7 +545,7 @@ get('/admin/posts', function () {
config('views.root', 'system/admin/views');
$page = from($_GET, 'page');
$page = $page ? (int) $page : 1;
$page = $page ? (int)$page : 1;
$perpage = 20;
$posts = get_posts(null, $page, $perpage);
@ -603,7 +603,7 @@ get('/admin/mine', function () {
$profile = $_SESSION[config("site.url")]['user'];
$page = from($_GET, 'page');
$page = $page ? (int) $page : 1;
$page = $page ? (int)$page : 1;
$perpage = config('profile.perpage');
$posts = get_profile($profile, $page, $perpage);
@ -1087,12 +1087,12 @@ post('/admin/config', function () {
$new_config = array();
$new_Keys = array();
if(!empty($newKey)){
if (!empty($newKey)) {
$new_Keys[$newKey] = $newValue;
}
foreach($_POST as $name => $value){
if(substr($name,0,8) == "-config-"){
$name = str_replace("_", ".",substr($name,8));
foreach ($_POST as $name => $value) {
if (substr($name, 0, 8) == "-config-") {
$name = str_replace("_", ".", substr($name, 8));
$new_config[$name] = $value;
}
}
@ -1163,7 +1163,7 @@ get('/tag/:tag', function ($tag) {
}
$page = from($_GET, 'page');
$page = $page ? (int) $page : 1;
$page = $page ? (int)$page : 1;
$perpage = config('tag.perpage');
$posts = get_tag($tag, $page, $perpage, false);
@ -1193,7 +1193,7 @@ get('/archive/:req', function ($req) {
}
$page = from($_GET, 'page');
$page = $page ? (int) $page : 1;
$page = $page ? (int)$page : 1;
$perpage = config('archive.perpage');
$posts = get_archive($req, $page, $perpage);
@ -1239,7 +1239,7 @@ get('/search/:keyword', function ($keyword) {
}
$page = from($_GET, 'page');
$page = $page ? (int) $page : 1;
$page = $page ? (int)$page : 1;
$perpage = config('search.perpage');
$posts = get_keyword($keyword, $page, $perpage);
@ -1268,7 +1268,7 @@ get('/api/json', function () {
header('Content-type: application/json');
$page = from($_GET, 'page');
$page = $page ? (int) $page : 1;
$page = $page ? (int)$page : 1;
$perpage = config('json.count');
echo generate_json(get_posts(null, $page, $perpage));
@ -1296,9 +1296,9 @@ get('/admin/update/now/:csrf', function ($CSRF) {
$proper = is_csrf_proper($CSRF);
$updater = new \Kanti\HubUpdater(array(
'name' => 'danpros/htmly',
'prerelease' => !!config("prerelease"),
));
'name' => 'danpros/htmly',
'prerelease' => !!config("prerelease"),
));
if (login() && $proper && $updater->able()) {
$updater->update();
config('views.root', 'system/admin/views');


+ 4
- 3
system/includes/dispatch.php View File

@ -52,18 +52,19 @@ function config($key, $value = null)
$_config[$key] = $value;
}
function save_config($data = array(),$new = array()){
function save_config($data = array(), $new = array())
{
global $config_file;
$string = file_get_contents($config_file) . "\n";
foreach ($data as $word => $value) {
$value = str_replace('"','\"',$value);
$value = str_replace('"', '\"', $value);
$string = preg_replace("/^" . $word . " = .+$/m", $word . ' = "' . $value . '"', $string);
}
$string = rtrim($string);
foreach ($new as $word => $value) {
$value = str_replace('"','\"',$value);
$value = str_replace('"', '\"', $value);
$string .= "\n" . $word . ' = "' . $value . '"' . "\n";
}
$string = rtrim($string);


+ 1
- 1
system/includes/functions.php View File

@ -244,7 +244,7 @@ function get_posts($posts, $page = 1, $perpage = 0)
// Extract the title and body
$post->title = get_content_tag('t', $content, 'Untitled: ' . date('l jS \of F Y', $post->date));
$post->feature = get_content_tag('fi', $content);
$post->video = get_content_tag('vid', $content);
$post->video = get_content_tag('vid', $content);
// Get the contents and convert it to HTML
$post->body = MarkdownExtra::defaultTransform(remove_html_comments($content));


+ 1
- 0
system/includes/opml.php View File

@ -1,4 +1,5 @@
<?php
class opml
{
private $data;


+ 5
- 5
system/includes/session.php View File

@ -4,10 +4,10 @@ session_start();
function login()
{
if(isset($_SESSION[config("site.url")]['user']) && !empty($_SESSION[config("site.url")]['user'])) {
return true;
} else {
return false;
}
if (isset($_SESSION[config("site.url")]['user']) && !empty($_SESSION[config("site.url")]['user'])) {
return true;
} else {
return false;
}
}

+ 122
- 111
system/plugins/lightbox/css/lightbox.css View File

@ -1,207 +1,218 @@
/* line 7, ../sass/lightbox.sass */
body:after {
content: url(../img/close.png) url(../img/loading.gif) url(../img/prev.png) url(../img/next.png);
display: none;
content: url(../img/close.png) url(../img/loading.gif) url(../img/prev.png) url(../img/next.png);
display: none;
}
/* line 11, ../sass/lightbox.sass */
.lightboxOverlay {
position: absolute;
top: 0;
left: 0;
z-index: 9999;
background-color: black;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
opacity: 0.8;
display: none;
position: absolute;
top: 0;
left: 0;
z-index: 9999;
background-color: black;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
opacity: 0.8;
display: none;
}
/* line 20, ../sass/lightbox.sass */
.lightbox {
position: absolute;
left: 0;
width: 100%;
z-index: 10000;
text-align: center;
line-height: 0;
font-weight: normal;
position: absolute;
left: 0;
width: 100%;
z-index: 10000;
text-align: center;
line-height: 0;
font-weight: normal;
}
/* line 28, ../sass/lightbox.sass */
.lightbox .lb-image {
display: block;
height: auto;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
-ms-border-radius: 3px;
-o-border-radius: 3px;
border-radius: 3px;
display: block;
height: auto;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
-ms-border-radius: 3px;
-o-border-radius: 3px;
border-radius: 3px;
}
/* line 32, ../sass/lightbox.sass */
.lightbox a img {
border: none;
border: none;
}
/* line 35, ../sass/lightbox.sass */
.lb-outerContainer {
position: relative;
background-color: white;
*zoom: 1;
width: 250px;
height: 250px;
margin: 0 auto;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
-o-border-radius: 4px;
border-radius: 4px;
position: relative;
background-color: white;
*zoom: 1;
width: 250px;
height: 250px;
margin: 0 auto;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
-o-border-radius: 4px;
border-radius: 4px;
}
/* line 38, ../../../../.rvm/gems/ruby-1.9.3-p392/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */
.lb-outerContainer:after {
content: "";
display: table;
clear: both;
content: "";
display: table;
clear: both;
}
/* line 44, ../sass/lightbox.sass */
.lb-container {
padding: 4px;
padding: 4px;
}
/* line 47, ../sass/lightbox.sass */
.lb-loader {
position: absolute;
top: 43%;
left: 0%;
height: 25%;
width: 100%;
text-align: center;
line-height: 0;
position: absolute;
top: 43%;
left: 0%;
height: 25%;
width: 100%;
text-align: center;
line-height: 0;
}
/* line 56, ../sass/lightbox.sass */
.lb-cancel {
display: block;
width: 32px;
height: 32px;
margin: 0 auto;
background: url(../img/loading.gif) no-repeat;
display: block;
width: 32px;
height: 32px;
margin: 0 auto;
background: url(../img/loading.gif) no-repeat;
}
/* line 63, ../sass/lightbox.sass */
.lb-nav {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: 10;
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: 10;
}
/* line 71, ../sass/lightbox.sass */
.lb-container > .nav {
left: 0;
left: 0;
}
/* line 74, ../sass/lightbox.sass */
.lb-nav a {
outline: none;
outline: none;
}
/* line 77, ../sass/lightbox.sass */
.lb-prev, .lb-next {
width: 49%;
height: 100%;
cursor: pointer;
/* Trick IE into showing hover */
display: block;
width: 49%;
height: 100%;
cursor: pointer;
/* Trick IE into showing hover */
display: block;
}
/* line 84, ../sass/lightbox.sass */
.lb-prev {
left: 0;
float: left;
left: 0;
float: left;
}
/* line 87, ../sass/lightbox.sass */
.lb-prev:hover {
background: url(../img/prev.png) left 48% no-repeat;
background: url(../img/prev.png) left 48% no-repeat;
}
/* line 90, ../sass/lightbox.sass */
.lb-next {
right: 0;
float: right;
right: 0;
float: right;
}
/* line 93, ../sass/lightbox.sass */
.lb-next:hover {
background: url(../img/next.png) right 48% no-repeat;
background: url(../img/next.png) right 48% no-repeat;
}
/* line 96, ../sass/lightbox.sass */
.lb-dataContainer {
margin: 0 auto;
padding-top: 5px;
*zoom: 1;
width: 100%;
-moz-border-radius-bottomleft: 4px;
-webkit-border-bottom-left-radius: 4px;
border-bottom-left-radius: 4px;
-moz-border-radius-bottomright: 4px;
-webkit-border-bottom-right-radius: 4px;
border-bottom-right-radius: 4px;
margin: 0 auto;
padding-top: 5px;
*zoom: 1;
width: 100%;
-moz-border-radius-bottomleft: 4px;
-webkit-border-bottom-left-radius: 4px;
border-bottom-left-radius: 4px;
-moz-border-radius-bottomright: 4px;
-webkit-border-bottom-right-radius: 4px;
border-bottom-right-radius: 4px;
}
/* line 38, ../../../../.rvm/gems/ruby-1.9.3-p392/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */
.lb-dataContainer:after {
content: "";
display: table;
clear: both;
content: "";
display: table;
clear: both;
}
/* line 103, ../sass/lightbox.sass */
.lb-data {
padding: 0 4px;
color: #bbbbbb;
padding: 0 4px;
color: #bbbbbb;
}
/* line 106, ../sass/lightbox.sass */
.lb-data .lb-details {
width: 85%;
float: left;
text-align: left;
line-height: 1.1em;
width: 85%;
float: left;
text-align: left;
line-height: 1.1em;
}
/* line 111, ../sass/lightbox.sass */
.lb-data .lb-caption {
font-size: 13px;
font-weight: bold;
line-height: 1em;
font-size: 13px;
font-weight: bold;
line-height: 1em;
}
/* line 115, ../sass/lightbox.sass */
.lb-data .lb-number {
display: block;
clear: left;
padding-bottom: 1em;
font-size: 12px;
color: #999999;
display: block;
clear: left;
padding-bottom: 1em;
font-size: 12px;
color: #999999;
}
/* line 121, ../sass/lightbox.sass */
.lb-data .lb-close {
display: block;
float: right;
width: 30px;
height: 30px;
background: url(../img/close.png) top right no-repeat;
text-align: right;
outline: none;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70);
opacity: 0.7;
display: block;
float: right;
width: 30px;
height: 30px;
background: url(../img/close.png) top right no-repeat;
text-align: right;
outline: none;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70);
opacity: 0.7;
}
/* line 130, ../sass/lightbox.sass */
.lb-data .lb-close:hover {
cursor: pointer;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
opacity: 1;
cursor: pointer;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
opacity: 1;
}
/* fix image preview */
.lb-image {
max-width: inherit!important;
max-width: inherit !important;
}

+ 267
- 1
system/plugins/lightbox/js/lightbox-2.6.min.js
File diff suppressed because it is too large
View File


+ 6
- 6
system/resources/htmly.js View File

@ -1,10 +1,10 @@
(function ($) {
$(document).ready(function() {
$('.teaser-body img, .post-body img').each(function() {
var currentImage = $(this);
currentImage.wrap("<a class='img-wrap' title='" + currentImage.attr("alt") + "' data-lightbox='lightbox' href='" + currentImage.attr("src") + "'></a>");
});
});
$(document).ready(function () {
$('.teaser-body img, .post-body img').each(function () {
var currentImage = $(this);
currentImage.wrap("<a class='img-wrap' title='" + currentImage.attr("alt") + "' data-lightbox='lightbox' href='" + currentImage.attr("src") + "'></a>");
});
});
})(jQuery);

+ 1
- 1
system/vendor/autoload.php View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit202d771b98d07410d9e52c5a90cbc9e1::getLoader();
return ComposerAutoloaderInitf198a7e8b1b11fe318ca9933d34f115b::getLoader();

+ 26
- 0
system/vendor/composer/ClassLoader.php View File

@ -54,6 +54,8 @@ class ClassLoader
private $useIncludePath = false;
private $classMap = array();
private $classMapAuthoritative = false;
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
@ -248,6 +250,27 @@ class ClassLoader
return $this->useIncludePath;
}
/**
* Turns off searching the prefix and fallback directories for classes
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
$this->classMapAuthoritative = $classMapAuthoritative;
}
/**
* Should class lookup fail if not found in the current class map?
*
* @return bool
*/
public function isClassMapAuthoritative()
{
return $this->classMapAuthoritative;
}
/**
* Registers this instance as an autoloader.
*
@ -299,6 +322,9 @@ class ClassLoader
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ($this->classMapAuthoritative) {
return false;
}
$file = $this->findFileWithExtension($class, '.php');


+ 3
- 4
system/vendor/composer/autoload_classmap.php View File

@ -6,13 +6,12 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname(dirname($vendorDir));
return array(
'Kanti\\CacheOneFile' => $vendorDir . '/kanti/hub-updater/CacheOneFile.php',
'Kanti\\HelperClass' => $vendorDir . '/kanti/hub-updater/HelperClass.php',
'Kanti\\HubUpdater' => $vendorDir . '/kanti/hub-updater/HubUpdater.php',
'Kanti\\CacheOneFile' => $vendorDir . '/kanti/hub-updater/src/CacheOneFile.php',
'Kanti\\HelperClass' => $vendorDir . '/kanti/hub-updater/src/HelperClass.php',
'Kanti\\HubUpdater' => $vendorDir . '/kanti/hub-updater/src/HubUpdater.php',
'Michelf\\Markdown' => $vendorDir . '/michelf/php-markdown/Michelf/Markdown.php',
'Michelf\\MarkdownExtra' => $vendorDir . '/michelf/php-markdown/Michelf/MarkdownExtra.php',
'Michelf\\MarkdownInterface' => $vendorDir . '/michelf/php-markdown/Michelf/MarkdownInterface.php',
'Michelf\\_MarkdownExtra_TmpImpl' => $vendorDir . '/michelf/php-markdown/Michelf/Markdown.php',
'Suin\\RSSWriter\\Channel' => $vendorDir . '/suin/php-rss-writer/Source/Suin/RSSWriter/Channel.php',
'Suin\\RSSWriter\\ChannelInterface' => $vendorDir . '/suin/php-rss-writer/Source/Suin/RSSWriter/ChannelInterface.php',
'Suin\\RSSWriter\\Feed' => $vendorDir . '/suin/php-rss-writer/Source/Suin/RSSWriter/Feed.php',


+ 1
- 0
system/vendor/composer/autoload_files.php View File

@ -6,6 +6,7 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname(dirname($vendorDir));
return array(
$vendorDir . '/ircmaxell/password-compat/lib/password.php',
$baseDir . '/system/includes/dispatch.php',
$baseDir . '/system/includes/functions.php',
$baseDir . '/system/admin/admin.php',


+ 1
- 1
system/vendor/composer/autoload_psr4.php View File

@ -6,5 +6,5 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname(dirname($vendorDir));
return array(
'Kanti\\' => array($vendorDir . '/kanti/hub-updater'),
'Kanti\\' => array($vendorDir . '/kanti/hub-updater/src'),
);

+ 5
- 5
system/vendor/composer/autoload_real.php View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit202d771b98d07410d9e52c5a90cbc9e1
class ComposerAutoloaderInitf198a7e8b1b11fe318ca9933d34f115b
{
private static $loader;
@ -19,9 +19,9 @@ class ComposerAutoloaderInit202d771b98d07410d9e52c5a90cbc9e1
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit202d771b98d07410d9e52c5a90cbc9e1', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitf198a7e8b1b11fe318ca9933d34f115b', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit202d771b98d07410d9e52c5a90cbc9e1', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitf198a7e8b1b11fe318ca9933d34f115b', 'loadClassLoader'));
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
@ -42,14 +42,14 @@ class ComposerAutoloaderInit202d771b98d07410d9e52c5a90cbc9e1
$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $file) {
composerRequire202d771b98d07410d9e52c5a90cbc9e1($file);
composerRequiref198a7e8b1b11fe318ca9933d34f115b($file);
}
return $loader;
}
}
function composerRequire202d771b98d07410d9e52c5a90cbc9e1($file)
function composerRequiref198a7e8b1b11fe318ca9933d34f115b($file)
{
require $file;
}

+ 89
- 42
system/vendor/composer/installed.json View File

@ -1,4 +1,57 @@
[
{
"name": "michelf/php-markdown",
"version": "1.5.0",
"version_normalized": "1.5.0.0",
"source": {
"type": "git",
"url": "https://github.com/michelf/php-markdown.git",
"reference": "e1aabe18173231ebcefc90e615565742fc1c7fd9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/michelf/php-markdown/zipball/e1aabe18173231ebcefc90e615565742fc1c7fd9",
"reference": "e1aabe18173231ebcefc90e615565742fc1c7fd9",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"time": "2015-03-01 12:03:08",
"type": "library",
"extra": {
"branch-alias": {
"dev-lib": "1.4.x-dev"
}
},
"installation-source": "source",
"autoload": {
"psr-0": {
"Michelf": ""
}
},
"notification-url": "http://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "John Gruber",
"homepage": "http://daringfireball.net/"
},
{
"name": "Michel Fortin",
"email": "michel.fortin@michelf.ca",
"homepage": "https://michelf.ca/",
"role": "Developer"
}
],
"description": "PHP Markdown",
"homepage": "https://michelf.ca/projects/php-markdown/",
"keywords": [
"markdown"
]
},
{
"name": "suin/php-rss-writer",
"version": "1.3",
@ -19,13 +72,13 @@
},
"time": "2014-03-12 06:05:28",
"type": "library",
"installation-source": "dist",
"installation-source": "source",
"autoload": {
"psr-0": {
"Suin\\RSSWriter": "Source"
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -48,31 +101,34 @@
},
{
"name": "kanti/hub-updater",
"version": "v0.3.1",
"version_normalized": "0.3.1.0",
"version": "v0.4",
"version_normalized": "0.4.0.0",
"source": {
"type": "git",
"url": "https://github.com/Kanti/hub-updater.git",
"reference": "105bf291983b1323c5916092cc4e170bf987b00c"
"reference": "81dae71f2b3ccd0e3425579ac932a8c6b7b58c5d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Kanti/hub-updater/zipball/105bf291983b1323c5916092cc4e170bf987b00c",
"reference": "105bf291983b1323c5916092cc4e170bf987b00c",
"url": "https://api.github.com/repos/Kanti/hub-updater/zipball/81dae71f2b3ccd0e3425579ac932a8c6b7b58c5d",
"reference": "81dae71f2b3ccd0e3425579ac932a8c6b7b58c5d",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"time": "2014-12-27 13:59:09",
"require-dev": {
"phpunit/phpunit": "~4.6@dev"
},
"time": "2015-02-03 09:53:58",
"type": "library",
"installation-source": "dist",
"installation-source": "source",
"autoload": {
"psr-4": {
"Kanti\\": ""
"Kanti\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"GPL-2.0"
],
@ -87,56 +143,47 @@
"description": "Simple Github Updater for Web Projects"
},
{
"name": "michelf/php-markdown",
"version": "1.4.1",
"version_normalized": "1.4.1.0",
"name": "ircmaxell/password-compat",
"version": "v1.0.4",
"version_normalized": "1.0.4.0",
"source": {
"type": "git",
"url": "https://github.com/michelf/php-markdown.git",
"reference": "de9a19c7bf352d41cc99ed86c3c0ef17e87394b6"
"url": "https://github.com/ircmaxell/password_compat.git",
"reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/michelf/php-markdown/zipball/de9a19c7bf352d41cc99ed86c3c0ef17e87394b6",
"reference": "de9a19c7bf352d41cc99ed86c3c0ef17e87394b6",
"url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c",
"reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
"require-dev": {
"phpunit/phpunit": "4.*"
},
"time": "2014-05-05 02:43:50",
"time": "2014-11-20 16:49:30",
"type": "library",
"extra": {
"branch-alias": {
"dev-lib": "1.4.x-dev"
}
},
"installation-source": "source",
"autoload": {
"psr-0": {
"Michelf": ""
}
"files": [
"lib/password.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
"MIT"
],
"authors": [
{
"name": "Michel Fortin",
"email": "michel.fortin@michelf.ca",
"homepage": "http://michelf.ca/",
"role": "Developer"
},
{
"name": "John Gruber",
"homepage": "http://daringfireball.net/"
"name": "Anthony Ferrara",
"email": "ircmaxell@php.net",
"homepage": "http://blog.ircmaxell.com"
}
],
"description": "PHP Markdown",
"homepage": "http://michelf.ca/projects/php-markdown/",
"description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash",
"homepage": "https://github.com/ircmaxell/password_compat",
"keywords": [
"markdown"
"hashing",
"password"
]
}
]

+ 7
- 0
system/vendor/kanti/hub-updater/.gitattributes View File

@ -0,0 +1,7 @@
.gitattributes export-ignore
.gitignore export-ignore
example.php export-ignore
example2.php export-ignore
.updateignore export-ignore
README.md export-ignore
tests export-ignore

+ 1
- 0
system/vendor/kanti/hub-updater/.updateignore View File

@ -0,0 +1 @@
README.md

+ 0
- 39
system/vendor/kanti/hub-updater/CacheOneFile.php View File

@ -1,39 +0,0 @@
<?php
namespace Kanti;
class CacheOneFile
{
protected $fileName = "";
protected $holdTime = 43200; //12h
public function __construct($fileName, $holdTime = 43200)
{
$this->fileName = $fileName;
$this->holdTime = $holdTime;
}
public function is()
{
if (! HelperClass::fileExists($this->fileName)) {
return false;
}
if (filemtime($this->fileName) < ( time() - $this->holdTime )) {
unlink($this->fileName);
return false;
}
return true;
}
public function get()
{
return file_get_contents($this->fileName);
}
public function set($content)
{
file_put_contents($this->fileName, $content);
}
}

+ 0
- 12
system/vendor/kanti/hub-updater/HelperClass.php View File

@ -1,12 +0,0 @@
<?php
namespace Kanti;
class HelperClass{
static public function fileExists($file){
return file_exists(dirname($_SERVER["SCRIPT_FILENAME"]) . "/" . $file);
}
static public function isInPhar() {
return substr(__FILE__,0,7) === "phar://";
}
}

+ 122
- 0
system/vendor/kanti/hub-updater/README.md View File

@ -0,0 +1,122 @@
#HubUpdater
![https://github.com/Kanti/hub-updater/releases/latest](https://img.shields.io/github/release/kanti/hub-updater.svg?style=flat-square) ![https://packagist.org/packages/kanti/hub-updater](https://img.shields.io/packagist/dt/kanti/hub-updater.svg?style=flat-square)
Simple Github Updater for Web Projects [PHP]
## is HubUpdater for me? [Checklist]
- [ ] I have an little product/projekt on github. (~ <=30MB)
- [ ] it can run PHP and uses [composer](https://getcomposer.org/)s autoloader
- [ ] I want my users to update my Product with one click
## check for an update [simple]
```php
<?php
require 'vendor/autoload.php';
$updater = new \Kanti\HubUpdater('kanti/test');
$updater->update();
```
## how to provide an update?
- Go to your Repository on github.com &#x2023;&#x2023;
- click on the ``releases`` tab &#x2023;&#x2023;
- click on ``Draft a new release`` &#x2023;&#x2023;
- Enter your release details &#x2023;&#x2023;
- click on ``Publish release`` &#x2023;&#x2023;
- now you can use HubUpdater to update to the newest version.
- _note: <sub>The timestamp of the release is used. NOT the version number!!</sub>_
## install via composer
The recommended way to install hub-updater is through
[Composer](http://getcomposer.org).
```bash
# Install Composer
curl -sS https://getcomposer.org/installer | php
```
Next, run the Composer command to install the latest stable version of HubUpdater:
```bash
composer require kanti/hub-updater ~0.3
```
After installing, you need to require Composer's autoloader:
```php
<?php
require 'vendor/autoload.php';
```
## settings
```php
$settings = array(
"settingsKey" => 'value',
);
new \Kanti\HubUpdater($settings);
```
|setting|description|default|
|---|---|---|
|name|the name your Repository has |**must be set**|
|branch|the branch you like to watch. |``master``|
|cache|the directory you like to put the cache stuff |``./cache/``|
|save|the directory you like to put the content of the zip |``./``|
|prerelease|would you like to download the prereleases? |``false``|
|cacheFile|name of the InformationCacheFile(in cacheDir)|``downloadInfo.json``|
|holdTime|time(seconds) the Cached-Information will be used|``43200``|
|versionFile|name of the InstalledVersionInformation is safed(in cacheDir)|``installedVersion.json``|
|zipFile|name of the temporary zip file(in cacheDir)|``tmpZipFile.zip``|
|updateignore|name of the updateignore file(in root of project)|``.updateignore``|
|exceptions|if true, will ``throw new \Exception`` on failure|``false``|
## Check for an update [complete]
```php
<?php
require 'vendor/autoload.php';
$updater = new \Kanti\HubUpdater(array(
"cacheFile" => "downloadInfo.json",//name of the InformationCacheFile(in cacheDir)
"holdTime" => 43200,//time(seconds) the Cached-Information will be used
"versionFile" => "installedVersion.json",//name of the InstalledVersionInformation is safed(in cacheDir)
"zipFile" => "tmpZipFile.zip",//name of the temporary zip file(in cacheDir)
"updateignore" => ".updateignore",//name of the updateignore file(in root of project)
"name" => 'kanti/test',//Repository to watch
"branch" => 'master',//wich branch to watch
"cache" => 'cache/',//were to put the caching stuff
"save" => 'save/',//there to put the downloaded Version[default ./]
"prerelease" => true,//accept prereleases?
"exceptions" => true,//if true, will throw new \Exception on failure
));
if ($updater->able()) {
if (isset($_GET['update'])) {
$updater->update();
echo '<p>updated :)</p>';
} else {
echo '<a href="?update">Update Me</a>'; //only update if they klick this link
}
} else {
echo '<p>uptodate :)</p>';
}
```
## the .updateignore file
### syntax:
put a file in one line and it will not be updated. _note <sub>put the .updateignore in your projects root directory</sub>_
```
.htaccess
favicon.ico
there/the/config.ini/is.ini
```
## Thanks:
- ca_bundle.crt form [bagder/ca-bundle](https://github.com/bagder/ca-bundle)

+ 15
- 7
system/vendor/kanti/hub-updater/composer.json View File

@ -13,15 +13,23 @@
"support": {
"forum": "https://github.com/Kanti/hub-updater/issues",
"issues": "https://github.com/Kanti/hub-updater/issues",
"source": "https://github.com/Kanti/hub-updater"
"source": "https://github.com/Kanti/hub-updater"
},
"minimum-stability": "dev",
"require": {
"php": ">=5.3.0"
},
"autoload": {
"psr-4": {
"Kanti\\": ""
}
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "~4.6@dev"
},
"autoload": {
"psr-4": {
"Kanti\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Kanti\\Test\\": "tests"
}
}
}

+ 974
- 0
system/vendor/kanti/hub-updater/composer.lock View File

@ -0,0 +1,974 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "b8e4efa9ea29bd0bab50ed2191d4b9cb",
"packages": [],
"packages-dev": [
{
"name": "doctrine/instantiator",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
"reference": "3d9669e597439e8d205baf315efb757038fb4dea"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/3d9669e597439e8d205baf315efb757038fb4dea",
"reference": "3d9669e597439e8d205baf315efb757038fb4dea",
"shasum": ""
},
"require": {
"php": ">=5.3,<8.0-DEV"
},
"require-dev": {
"athletic/athletic": "~0.1.8",
"ext-pdo": "*",
"ext-phar": "*",
"phpunit/phpunit": "~4.0",
"squizlabs/php_codesniffer": "~2.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com",
"homepage": "http://ocramius.github.com/"
}
],
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
"homepage": "https://github.com/doctrine/instantiator",
"keywords": [
"constructor",
"instantiate"
],
"time": "2015-01-16 19:29:51"
},
{
"name": "phpdocumentor/reflection-docblock",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "fd0ac2007401505fb596fdfb859ec4e103d69e55"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/fd0ac2007401505fb596fdfb859ec4e103d69e55",
"reference": "fd0ac2007401505fb596fdfb859ec4e103d69e55",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"suggest": {
"dflydev/markdown": "~1.0",
"erusev/parsedown": "~1.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-0": {
"phpDocumentor": [
"src/"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mike van Riel",
"email": "mike.vanriel@naenius.com"
}
],
"time": "2014-09-02 14:26:20"
},
{
"name": "phpspec/prophecy",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "d647e27524f9f7edc37baf63a114b52f5975808f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/d647e27524f9f7edc37baf63a114b52f5975808f",
"reference": "d647e27524f9f7edc37baf63a114b52f5975808f",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.2",
"phpdocumentor/reflection-docblock": "~2.0",
"sebastian/comparator": "~1.1"
},
"require-dev": {
"phpspec/phpspec": "~2.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3.x-dev"
}
},
"autoload": {
"psr-0": {
"Prophecy\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com",
"homepage": "http://everzet.com"
},
{
"name": "Marcello Duarte",
"email": "marcello.duarte@gmail.com"
}
],
"description": "Highly opinionated mocking framework for PHP 5.3+",
"homepage": "https://github.com/phpspec/prophecy",
"keywords": [
"Double",
"Dummy",
"fake",
"mock",
"spy",
"stub"
],
"time": "2015-01-26 10:50:16"
},
{
"name": "phpunit/php-code-coverage",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "34cc484af1ca149188d0d9e91412191e398e0b67"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/34cc484af1ca149188d0d9e91412191e398e0b67",
"reference": "34cc484af1ca149188d0d9e91412191e398e0b67",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"phpunit/php-file-iterator": "~1.3",
"phpunit/php-text-template": "~1.2",
"phpunit/php-token-stream": "~1.3",
"sebastian/environment": "~1.0",
"sebastian/version": "~1.0"
},
"require-dev": {
"ext-xdebug": ">=2.1.4",
"phpunit/phpunit": "~4"
},
"suggest": {
"ext-dom": "*",
"ext-xdebug": ">=2.2.1",
"ext-xmlwriter": "*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
"homepage": "https://github.com/sebastianbergmann/php-code-coverage",
"keywords": [
"coverage",
"testing",
"xunit"
],
"time": "2015-01-24 10:06:35"
},
{
"name": "phpunit/php-file-iterator",
"version": "1.3.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
"reference": "acd690379117b042d1c8af1fafd61bde001bf6bb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb",
"reference": "acd690379117b042d1c8af1fafd61bde001bf6bb",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"autoload": {
"classmap": [
"File/"
]
},
"notification-url": "https://packagist.org/downloads/",
"include-path": [
""
],
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"description": "FilterIterator implementation that filters files based on a list of suffixes.",
"homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
"keywords": [
"filesystem",
"iterator"
],
"time": "2013-10-10 15:34:57"
},
{
"name": "phpunit/php-text-template",
"version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git",
"reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
"reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"autoload": {
"classmap": [
"Text/"
]
},
"notification-url": "https://packagist.org/downloads/",
"include-path": [
""
],
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"description": "Simple template engine.",
"homepage": "https://github.com/sebastianbergmann/php-text-template/",
"keywords": [
"template"
],
"time": "2014-01-30 17:20:04"
},
{
"name": "phpunit/php-timer",
"version": "1.0.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
"reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
"reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"autoload": {
"classmap": [
"PHP/"
]
},
"notification-url": "https://packagist.org/downloads/",
"include-path": [
""
],
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"description": "Utility class for timing",
"homepage": "https://github.com/sebastianbergmann/php-timer/",
"keywords": [
"timer"
],
"time": "2013-08-02 07:42:54"
},
{
"name": "phpunit/php-token-stream",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
"reference": "db32c18eba00b121c145575fcbcd4d4d24e6db74"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/db32c18eba00b121c145575fcbcd4d4d24e6db74",
"reference": "db32c18eba00b121c145575fcbcd4d4d24e6db74",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Wrapper around PHP's tokenizer extension.",
"homepage": "https://github.com/sebastianbergmann/php-token-stream/",
"keywords": [
"tokenizer"
],
"time": "2015-01-17 09:51:32"
},
{
"name": "phpunit/phpunit",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "e85198bbce24ea11075ce8bdfc2cfffb818aae8c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e85198bbce24ea11075ce8bdfc2cfffb818aae8c",
"reference": "e85198bbce24ea11075ce8bdfc2cfffb818aae8c",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-json": "*",
"ext-pcre": "*",
"ext-reflection": "*",
"ext-spl": "*",
"php": ">=5.3.3",
"phpspec/prophecy": "~1.3.1",
"phpunit/php-code-coverage": "~2.0",
"phpunit/php-file-iterator": "~1.3",
"phpunit/php-text-template": "~1.2",
"phpunit/php-timer": "~1.0",
"phpunit/phpunit-mock-objects": "~2.3",
"sebastian/comparator": "~1.1",
"sebastian/diff": "~1.2",
"sebastian/environment": "~1.2",
"sebastian/exporter": "~1.2",
"sebastian/global-state": "~1.0",
"sebastian/version": "~1.0",
"symfony/yaml": "~2.1|~3.0"
},
"suggest": {
"phpunit/php-invoker": "~1.1"
},
"bin": [
"phpunit"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.6.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
}
],
"description": "The PHP Unit Testing framework.",
"homepage": "https://phpunit.de/",
"keywords": [
"phpunit",
"testing",
"xunit"
],
"time": "2015-01-27 07:32:25"
},
{
"name": "phpunit/phpunit-mock-objects",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
"reference": "b752b41e3fead4feee99f3a2f2972cef517abb8b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/b752b41e3fead4feee99f3a2f2972cef517abb8b",
"reference": "b752b41e3fead4feee99f3a2f2972cef517abb8b",
"shasum": ""
},
"require": {
"doctrine/instantiator": "~1.0,>=1.0.2",
"php": ">=5.3.3",
"phpunit/php-text-template": "~1.2"
},
"require-dev": {
"phpunit/phpunit": "4.4.*@dev"
},
"suggest": {
"ext-soap": "*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.4.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"description": "Mock Object library for PHPUnit",
"homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
"keywords": [
"mock",
"xunit"
],
"time": "2015-01-18 10:44:19"
},
{
"name": "sebastian/comparator",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "6a1e846331bb3cc1a305168125d047fb86260e3d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/6a1e846331bb3cc1a305168125d047fb86260e3d",
"reference": "6a1e846331bb3cc1a305168125d047fb86260e3d",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"sebastian/diff": "~1.1",
"sebastian/exporter": "~1.0"
},
"require-dev": {
"phpunit/phpunit": "~4.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
},
{
"name": "Volker Dusch",
"email": "github@wallbash.com"
},
{
"name": "Bernhard Schussek",
"email": "bschussek@2bepublished.at"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Provides the functionality to compare PHP values for equality",
"homepage": "http://www.github.com/sebastianbergmann/comparator",
"keywords": [
"comparator",
"compare",
"equality"
],
"time": "2015-01-05 16:29:00"
},
{
"name": "sebastian/diff",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
"reference": "6dc90302a4cdf8486c221a0ad3a4da53859fcfa5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/6dc90302a4cdf8486c221a0ad3a4da53859fcfa5",
"reference": "6dc90302a4cdf8486c221a0ad3a4da53859fcfa5",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Kore Nordmann",
"email": "mail@kore-nordmann.de"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Diff implementation",
"homepage": "http://www.github.com/sebastianbergmann/diff",
"keywords": [
"diff"
],
"time": "2015-01-01 09:20:29"
},
{
"name": "sebastian/environment",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
"reference": "5a8c7d31914337b69923db26c4221b81ff5a196e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5a8c7d31914337b69923db26c4221b81ff5a196e",
"reference": "5a8c7d31914337b69923db26c4221b81ff5a196e",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Provides functionality to handle HHVM/PHP environments",
"homepage": "http://www.github.com/sebastianbergmann/environment",
"keywords": [
"Xdebug",
"environment",
"hhvm"
],
"time": "2015-01-01 10:01:08"
},
{
"name": "sebastian/exporter",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
"reference": "84839970d05254c73cde183a721c7af13aede943"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/84839970d05254c73cde183a721c7af13aede943",
"reference": "84839970d05254c73cde183a721c7af13aede943",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"sebastian/recursion-context": "~1.0"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
},
{
"name": "Volker Dusch",
"email": "github@wallbash.com"
},
{
"name": "Bernhard Schussek",
"email": "bschussek@2bepublished.at"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
},
{
"name": "Adam Harvey",
"email": "aharvey@php.net"
}
],
"description": "Provides the functionality to export PHP variables for visualization",
"homepage": "http://www.github.com/sebastianbergmann/exporter",
"keywords": [
"export",
"exporter"
],
"time": "2015-01-27 07:23:06"
},
{
"name": "sebastian/global-state",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git",
"reference": "007c441df427cf0e175372fcbb9d196bce7eb743"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/007c441df427cf0e175372fcbb9d196bce7eb743",
"reference": "007c441df427cf0e175372fcbb9d196bce7eb743",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.2"
},
"suggest": {
"ext-uopz": "*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Snapshotting of global state",
"homepage": "http://www.github.com/sebastianbergmann/global-state",
"keywords": [
"global state"
],
"time": "2015-01-20 04:09:31"
},
{
"name": "sebastian/recursion-context",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
"reference": "3989662bbb30a29d20d9faa04a846af79b276252"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/3989662bbb30a29d20d9faa04a846af79b276252",
"reference": "3989662bbb30a29d20d9faa04a846af79b276252",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
},
{
"name": "Adam Harvey",
"email": "aharvey@php.net"
}
],
"description": "Provides functionality to recursively process PHP variables",
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
"time": "2015-01-24 09:48:32"
},
{
"name": "sebastian/version",
"version": "1.0.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/version.git",
"reference": "a77d9123f8e809db3fbdea15038c27a95da4058b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/version/zipball/a77d9123f8e809db3fbdea15038c27a95da4058b",
"reference": "a77d9123f8e809db3fbdea15038c27a95da4058b",
"shasum": ""
},
"type": "library",
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
}
],
"description": "Library that helps with managing the version number of Git-hosted PHP projects",
"homepage": "https://github.com/sebastianbergmann/version",
"time": "2014-12-15 14:25:24"
},
{
"name": "symfony/yaml",
"version": "dev-master",
"target-dir": "Symfony/Component/Yaml",
"source": {
"type": "git",
"url": "https://github.com/symfony/Yaml.git",
"reference": "13ef40ee1437582f86fa805445363d0c694dae3a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Yaml/zipball/13ef40ee1437582f86fa805445363d0c694dae3a",
"reference": "13ef40ee1437582f86fa805445363d0c694dae3a",
"shasum": ""
},
"require": {
"php": ">=5.5.9"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"autoload": {
"psr-0": {
"Symfony\\Component\\Yaml\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "Symfony Yaml Component",
"homepage": "http://symfony.com",
"time": "2015-01-25 04:42:01"
}
],
"aliases": [],
"minimum-stability": "dev",
"stability-flags": {
"phpunit/phpunit": 20
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=5.3.0"
},
"platform-dev": []
}

+ 5
- 0
system/vendor/kanti/hub-updater/example.php View File

@ -0,0 +1,5 @@
<?php
require 'vendor/autoload.php';
$updater = new \Kanti\HubUpdater('kanti/test');
$updater->update();

+ 29
- 0
system/vendor/kanti/hub-updater/example2.php View File

@ -0,0 +1,29 @@
<?php
require 'vendor/autoload.php';
$updater = new \Kanti\HubUpdater(array(
"cacheFile" => "downloadInfo.json",//name of the InformationCacheFile(in cacheDir)
"holdTime" => 43200,//time(seconds) the Cached-Information will be used
"versionFile" => "installedVersion.json",//name of the InstalledVersionInformation is safed(in cacheDir)
"zipFile" => "tmpZipFile.zip",//name of the temporary zip file(in cacheDir)
"updateignore" => ".updateignore",//name of the updateignore file(in root of project)
"name" => 'kanti/test',//Repository to watch
"branch" => 'master',//wich branch to watch
"cache" => 'cache/',//were to put the caching stuff
"save" => 'save/',//there to put the downloaded Version[default ./]
"prerelease" => true,//accept prereleases?
"exceptions" => true,//if true, will throw new \Exception on failure
));
if ($updater->able()) {
if (isset($_GET['update'])) {
$updater->update();
echo '<p>updated :)</p>';
} else {
echo '<a href="?update">Update Me</a>'; //only update if they klick this link
}
} else {
echo '<p>uptodate :)</p>';
}

+ 58
- 0
system/vendor/kanti/hub-updater/src/CacheOneFile.php View File

@ -0,0 +1,58 @@
<?php
namespace Kanti;
class CacheOneFile
{
protected $fileName = "";
protected $holdTime = 43200; //12h
public function __construct($fileName, $holdTime = 43200)
{
$this->fileName = $fileName;
$this->holdTime = $holdTime;
}
public function is()
{
if (!HelperClass::fileExists($this->fileName)) {
return false;
}
clearstatcache();
if (filemtime($this->fileName) < (time() - $this->holdTime)) {
unlink($this->fileName);
return false;
}
return true;
}
protected function file_force_contents()
{
$args = func_get_args();
$path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $args[0]);
$parts = explode(DIRECTORY_SEPARATOR, $path);
array_pop($parts);
$directory = '';
foreach ($parts as $part):
$check_path = $directory . $part;
if (is_dir($check_path . DIRECTORY_SEPARATOR) === FALSE) {
mkdir($check_path, 0755);
}
$directory = $check_path . DIRECTORY_SEPARATOR;
endforeach;
call_user_func_array('file_put_contents', $args);
}
public function get()
{
return file_get_contents($this->fileName);
}
public function set($content)
{
$this->file_force_contents($this->fileName, $content);
}
}

+ 28
- 0
system/vendor/kanti/hub-updater/src/HelperClass.php View File

@ -0,0 +1,28 @@
<?php
namespace Kanti;
class HelperClass
{
protected static function isAbsolutePath($path)
{
return ('/' == $path[0] || '\\' == $path[0] || (strlen($path) > 3 && ctype_alpha($path[0]) && $path[1] == ':' &&
('\\' == $path[2] || '/' == $path[2])));
}
public static function fileExists($file)
{
if (is_bool($file) || is_array($file)) {
throw new \InvalidArgumentException;
}
if(strlen($file) >= 3 && static::isAbsolutePath($file)){
return file_exists($file);
}
return file_exists(dirname($_SERVER["SCRIPT_FILENAME"]) . "/" . $file);
}
static public function isInPhar()
{
return substr(__FILE__, 0, 7) === "phar://";
}
}

system/vendor/kanti/hub-updater/HubUpdater.php → system/vendor/kanti/hub-updater/src/HubUpdater.php View File

@ -28,11 +28,14 @@ class HubUpdater
{
//options
if (is_array($option)) {
if (!isset($option['name'])) {
if (!isset($option['name']) || empty($option['name'])) {
throw new \Exception('No Name in Option Set');
}
$this->options = $option + $this->options;
} elseif (is_string($option)) {
if(empty($option)){
throw new \Exception('No Name Set');
}
$this->options['name'] = $option;
} else {
throw new \Exception('No Option Set');
@ -65,7 +68,8 @@ class HubUpdater
$this->streamContext = stream_context_create(
array(
'http' => array(
'header' => "User-Agent: Awesome-Update-My-Self-" . $this->options['name'] . "\r\nAccept: application/vnd.github.v3+json\r\n",
'header' => "User-Agent: Awesome-Update-My-Self-" . $this->options['name'] . "\r\n"
. "Accept: application/vnd.github.v3+json\r\n",
),
'ssl' => array(
'cafile' => $caBundleDir . '/ca_bundle.crt',
@ -288,6 +292,13 @@ class HubUpdater
$this->newestInfo = $release;
break;
}
if (!isset($this->newestInfo)) {
if ($this->options["exceptions"]) {
throw new \Exception("no suitable release found");
} else {
return array();
}
}
return $this->newestInfo;
}
}

system/vendor/kanti/hub-updater/ca_bundle.crt → system/vendor/kanti/hub-updater/src/ca_bundle.crt View File


+ 73
- 0
system/vendor/kanti/hub-updater/tests/CacheOneFileTest.php View File

@ -0,0 +1,73 @@
<?php
/**
* Created by PhpStorm.
* User: Matthias
* Date: 27.01.2015
* Time: 08:55
*/
namespace Kanti\Test;
use Kanti\CacheOneFile;
class CacheOneFileTest extends \PHPUnit_Framework_TestCase
{
private $invalidContent = [
true,
false,
array('content'),
];
private $validContent = [
'',
'a',
'ab',
'abc',
1,
12,
123,
];
public function testIs()
{
$fileName = __DIR__ . "/asserts/testfile.txt";
$time = 60*60;//1h
if(file_exists($fileName)){
unlink($fileName);
}
$cache = new CacheOneFile($fileName,$time);
if($cache->is()){
$this->fail("is not set");
}
touch($fileName);
if(! $cache->is()){
$this->fail("could not set");
}
touch($fileName,0);
if($cache->is()){
$this->fail("does not reset");
}
}
public function testGet(){
$fileName = __DIR__ . "/asserts/testfile.txt";
$time = 60*60;//1h
$cache = new CacheOneFile($fileName,$time);
foreach ($this->validContent as $value) {
$cache->set($value);
if($cache->get() !== (string)$value){
$this->fail("get set dosen't match for value{" . print_r($value,true) . "}");
}
}
unlink($fileName);
foreach ($this->invalidContent as $value) {
$cache->set($value);
if($cache->get() === $value){
$this->fail("get set does match for value{" . print_r($value,true) . "}");
}
}
}
}

+ 54
- 0
system/vendor/kanti/hub-updater/tests/HelperClassTest.php View File

@ -0,0 +1,54 @@
<?php
/**
* Created by PhpStorm.
* User: Matthias
* Date: 27.01.2015
* Time: 08:41
*/
namespace Kanti\Test;
use Kanti\HelperClass;
class HelperClassTest extends \PHPUnit_Framework_TestCase {
private $invalidFileNames = [
true,
false,
array('array'),
];
private $validFileNames = [
'',
'a',
'ab',
'abc',
1,
12,
123,
];
public function testStaticFileExists()
{
foreach ($this->invalidFileNames as $value) {
try {
HelperClass::fileExists($value);
} catch (\InvalidArgumentException $e) {
// Good, we got an exception!
continue;
}
$this->fail('Expected exception not raised on value: "' . $value . '".');
}
foreach ($this->validFileNames as $value) {
HelperClass::fileExists($value);
}
}
public function testIsInPhar(){
if(HelperClass::isInPhar()){
$this->fail("unit test is in phar?");
}
}
}

+ 1
- 0
system/vendor/kanti/hub-updater/tests/asserts/testfile.txt View File

@ -0,0 +1 @@
content

+ 9
- 0
system/vendor/kanti/hub-updater/tests/bootstrap.php View File

@ -0,0 +1,9 @@
<?php
ini_set('error_reporting', E_ALL); // or error_reporting(E_ALL);
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
$_SERVER['SCRIPT_FILENAME'] = dirname(__DIR__) . "\index.php";
chdir(dirname(__DIR__));
require_once __DIR__ . "/../vendor/autoload.php";

+ 29
- 0
system/vendor/kanti/hub-updater/tests/phpunit.xml View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="bootstrap.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Hub-Updater Test Suite">
<directory>./</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">../src/</directory>
</whitelist>
</filter>
<logging>
<log type="tap" target="../build/report.tap"/>
<log type="junit" target="../build/report.junit.xml"/>
<log type="coverage-html" target="../build/coverage" charset="UTF-8" yui="true" highlight="true"/>
<log type="coverage-text" target="../build/coverage.txt"/>
<log type="coverage-clover" target="../build/logs/clover.xml"/>
</logging>
</phpunit>

+ 0
- 36
system/vendor/michelf/php-markdown/License.md View File

@ -1,36 +0,0 @@
PHP Markdown Lib
Copyright (c) 2004-2014 Michel Fortin
<http://michelf.ca/>
All rights reserved.
Based on Markdown
Copyright (c) 2003-2006 John Gruber
<http://daringfireball.net/>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name "Markdown" nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
This software is provided by the copyright holders and contributors "as
is" and any express or implied warranties, including, but not limited
to, the implied warranties of merchantability and fitness for a
particular purpose are disclaimed. In no event shall the copyright owner
or contributors be liable for any direct, indirect, incidental, special,
exemplary, or consequential damages (including, but not limited to,
procurement of substitute goods or services; loss of use, data, or
profits; or business interruption) however caused and on any theory of
liability, whether in contract, strict liability, or tort (including
negligence or otherwise) arising in any way out of the use of this
software, even if advised of the possibility of such damage.

+ 0
- 10
system/vendor/michelf/php-markdown/Michelf/Markdown.inc.php View File

@ -1,10 +0,0 @@
<?php
# Use this file if you cannot use class autoloading. It will include all the
# files needed for the Markdown parser.
#
# Take a look at the PSR-0-compatible class autoloading implementation
# in the Readme.php file if you want a simple autoloader setup.
require_once dirname(__FILE__) . '/MarkdownInterface.php';
require_once dirname(__FILE__) . '/Markdown.php';

+ 0
- 3117
system/vendor/michelf/php-markdown/Michelf/Markdown.php
File diff suppressed because it is too large
View File


+ 0
- 11
system/vendor/michelf/php-markdown/Michelf/MarkdownExtra.inc.php View File

@ -1,11 +0,0 @@
<?php
# Use this file if you cannot use class autoloading. It will include all the
# files needed for the MarkdownExtra parser.
#
# Take a look at the PSR-0-compatible class autoloading implementation
# in the Readme.php file if you want a simple autoloader setup.
require_once dirname(__FILE__) . '/MarkdownInterface.php';
require_once dirname(__FILE__) . '/Markdown.php';
require_once dirname(__FILE__) . '/MarkdownExtra.php';

+ 0
- 38
system/vendor/michelf/php-markdown/Michelf/MarkdownExtra.php View File

@ -1,38 +0,0 @@
<?php
#
# Markdown Extra - A text-to-HTML conversion tool for web writers
#
# PHP Markdown Extra
# Copyright (c) 2004-2014 Michel Fortin
# <http://michelf.com/projects/php-markdown/>
#
# Original Markdown
# Copyright (c) 2004-2006 John Gruber
# <http://daringfireball.net/projects/markdown/>
#
namespace Michelf;
# Just force Michelf/Markdown.php to load. This is needed to load
# the temporary implementation class. See below for details.
\Michelf\Markdown::MARKDOWNLIB_VERSION;
#
# Markdown Extra Parser Class
#
# Note: Currently the implementation resides in the temporary class
# \Michelf\MarkdownExtra_TmpImpl (in the same file as \Michelf\Markdown).
# This makes it easier to propagate the changes between the three different
# packaging styles of PHP Markdown. Once this issue is resolved, the
# _MarkdownExtra_TmpImpl will disappear and this one will contain the code.
#
class MarkdownExtra extends \Michelf\_MarkdownExtra_TmpImpl {
### Parser Implementation ###
# Temporarily, the implemenation is in the _MarkdownExtra_TmpImpl class.
# See note above.
}

+ 0
- 9
system/vendor/michelf/php-markdown/Michelf/MarkdownInterface.inc.php View File

@ -1,9 +0,0 @@
<?php
# Use this file if you cannot use class autoloading. It will include all the
# files needed for the MarkdownInterface interface.
#
# Take a look at the PSR-0-compatible class autoloading implementation
# in the Readme.php file if you want a simple autoloader setup.
require_once dirname(__FILE__) . '/MarkdownInterface.php';

+ 0
- 37
system/vendor/michelf/php-markdown/Michelf/MarkdownInterface.php View File

@ -1,37 +0,0 @@
<?php
#
# Markdown - A text-to-HTML conversion tool for web writers
#
# PHP Markdown
# Copyright (c) 2004-2014 Michel Fortin
# <http://michelf.com/projects/php-markdown/>
#
# Original Markdown
# Copyright (c) 2004-2006 John Gruber
# <http://daringfireball.net/projects/markdown/>
#
namespace Michelf;
#
# Markdown Parser Interface
#
interface MarkdownInterface {
#
# Initialize the parser and return the result of its transform method.
# This will work fine for derived classes too.
#
public static function defaultTransform($text);
#
# Main function. Performs some preprocessing on the input text
# and pass it through the document gamut.
#
public function transform($text);
}
?>

+ 0
- 305
system/vendor/michelf/php-markdown/Readme.md View File

@ -1,305 +0,0 @@
PHP Markdown
============
PHP Markdown Lib 1.4.1 - 4 May 2013
by Michel Fortin
<http://michelf.ca/>
based on Markdown by John Gruber
<http://daringfireball.net/>
Introduction
------------
This is a library package that includes the PHP Markdown parser and its
sibling PHP Markdown Extra with additional features.
Markdown is a text-to-HTML conversion tool for web writers. Markdown
allows you to write using an easy-to-read, easy-to-write plain text
format, then convert it to structurally valid XHTML (or HTML).
"Markdown" is actually two things: a plain text markup syntax, and a
software tool, originally written in Perl, that converts the plain text
markup to HTML. PHP Markdown is a port to PHP of the original Markdown
program by John Gruber.
* [Full documentation of the Markdown syntax](<http://daringfireball.net/projects/markdown/>)
- Daring Fireball (John Gruber)
* [Markdown Extra syntax additions](<http://michelf.ca/projects/php-markdown/extra/>)
- Michel Fortin
Requirement
-----------
This library package requires PHP 5.3 or later.
Note: The older plugin/library hybrid package for PHP Markdown and
PHP Markdown Extra is still maintained and will work with PHP 4.0.5 and later.
Before PHP 5.3.7, pcre.backtrack_limit defaults to 100 000, which is too small
in many situations. You might need to set it to higher values. Later PHP
releases defaults to 1 000 000, which is usually fine.
Usage
-----
This library package is meant to be used with class autoloading. For autoloading
to work, your project needs have setup a PSR-0-compatible autoloader. See the
included Readme.php file for a minimal autoloader setup. (If you cannot use
autoloading, see below.)
With class autoloading in place, putting the 'Michelf' folder in your
include path should be enough for this to work:
use \Michelf\Markdown;
$my_html = Markdown::defaultTransform($my_text);
Markdown Extra syntax is also available the same way:
use \Michelf\MarkdownExtra;
$my_html = MarkdownExtra::defaultTransform($my_text);
If you wish to use PHP Markdown with another text filter function
built to parse HTML, you should filter the text *after* the `transform`
function call. This is an example with [PHP SmartyPants][psp]:
use \Michelf\Markdown, \Michelf\SmartyPants;
$my_html = Markdown::defaultTransform($my_text);
$my_html = SmartyPants::defaultTransform($my_html);
All these examples are using the static `defaultTransform` static function
found inside the parser class. If you want to customize the parser
configuration, you can also instantiate it directly and change some
configuration variables:
use \Michelf\MarkdownExtra;
$parser = new MarkdownExtra;
$parser->fn_id_prefix = "post22-";
$my_html = $parser->transform($my_text);
To learn more, see the full list of [configuration variables].
[configuration variables]: http://michelf.ca/projects/php-markdown/configuration/
### Usage without an autoloader
If you cannot use class autoloading, you can still use `include` or `require`
to access the parser. To load the `\Michelf\Markdown` parser, do it this way:
require_once 'Michelf/Markdown.inc.php';
Or, if you need the `\Michelf\MarkdownExtra` parser:
require_once 'Michelf/MarkdownExtra.inc.php';
While the plain `.php` files depend on autoloading to work correctly, using the
`.inc.php` files instead will eagerly load the dependencies that would be
loaded on demand if you were using autoloading.
Public API and Versioning Policy
---------------------------------
Version numbers are of the form *major*.*minor*.*patch*.
The public API of PHP Markdown consist of the two parser classes `Markdown`
and `MarkdownExtra`, their constructors, the `transform` and `defaultTransform`
functions and their configuration variables. The public API is stable for
a given major version number. It might get additions when the minor version
number increments.
**Protected members are not considered public API.** This is unconventional
and deserves an explanation. Incrementing the major version number every time
the underlying implementation of something changes is going to give
nonessential version numbers for the vast majority of people who just use the
parser. Protected members are meant to create parser subclasses that behave in
different ways. Very few people create parser subclasses. I don't want to
discourage it by making everything private, but at the same time I can't
guarantee any stable hook between versions if you use protected members.
**Syntax changes** will increment the minor number for new features, and the
patch number for small corrections. A *new feature* is something that needs a
change in the syntax documentation. Note that since PHP Markdown Lib includes
two parsers, a syntax change for either of them will increment the minor
number. Also note that there is nothing perfectly backward-compatible with the
Markdown syntax: all inputs are always valid, so new features always replace
something that was previously legal, although generally nonsensical to do.
Bugs
----
To file bug reports please send email to:
<michel.fortin@michelf.ca>
Please include with your report: (1) the example input; (2) the output you
expected; (3) the output PHP Markdown actually produced.
If you have a problem where Markdown gives you an empty result, first check
that the backtrack limit is not too low by running `php --info | grep pcre`.
See Installation and Requirement above for details.
Development and Testing
-----------------------
Pull requests for fixing bugs are welcome. Proposed new features are
going meticulously reviewed -- taking into account backward compatibility,
potential side effects, and future extensibility -- before deciding on
acceptance or rejection.
If you make a pull request that includes changes to the parser please add
tests for what is being changed to [MDTest][] and make a pull request there
too.
[MDTest]: https://github.com/michelf/mdtest/
Donations
---------
If you wish to make a donation that will help me devote more time to
PHP Markdown, please visit [michelf.ca/donate] or send Bitcoin to
[1HiuX34czvVPPdhXbUAsAu7pZcesniDCGH].
[michelf.ca/donate]: https://michelf.ca/donate/#!Thanks%20for%20PHP%20Markdown
[1HiuX34czvVPPdhXbUAsAu7pZcesniDCGH]: bitcoin:1HiuX34czvVPPdhXbUAsAu7pZcesniDCGH
Version History
---------------
PHP Markdown Lib 1.4.1 (4 May 2014)
* The HTML block parser will now treat `<figure>` as a block-level element
(as it should) and no longer wrap it in `<p>` or parse it's content with
the as Markdown syntax (although with Extra you can use `markdown="1"`
if you wish to use the Markdown syntax inside it).
* The content of `<style>` elements will now be left alone, its content
won't be interpreted as Markdown.
* Corrected an bug where some inline links with spaces in them would not
work even when surounded with angle brackets:
[link](<s p a c e s>)
* Fixed an issue where email addresses with quotes in them would not always
have the quotes escaped in the link attribute, causing broken links (and
invalid HTML).
* Fixed the case were a link definition following a footnote definition would
be swallowed by the footnote unless it was separated by a blank line.
PHP Markdown Lib 1.4.0 (29 Nov 2013)
* Added support for the `tel:` URL scheme in automatic links.
<tel:+1-111-111-1111>
It gets converted to this (note the `tel:` prefix becomes invisible):
<a href="tel:+1-111-111-1111">+1-111-111-1111</a>
* Added backtick fenced code blocks to MarkdownExtra, originally from
Github-Flavored Markdown.
* Added an interface called MarkdownInterface implemented by both
the Markdown and MarkdownExtra parsers. You can use the interface if
you want to create a mockup parser object for unit testing.
* For those of you who cannot use class autoloading, you can now
include `Michelf/Markdown.inc.php` or `Michelf/MarkdownExtra.inc.php` (note
the `.inc.php` extension) to automatically include other files required
by the parser.
PHP Markdown Lib 1.3 (11 Apr 2013)
This is the first release of PHP Markdown Lib. This package requires PHP
version 5.3 or later and is designed to work with PSR-0 autoloading and,
optionally with Composer. Here is a list of the changes since
PHP Markdown Extra 1.2.6:
* Plugin interface for WordPress and other systems is no longer present in
the Lib package. The classic package is still available if you need it:
<http://michelf.ca/projects/php-markdown/classic/>
* Added `public` and `protected` protection attributes, plus a section about
what is "public API" and what isn't in the Readme file.
* Changed HTML output for footnotes: now instead of adding `rel` and `rev`
attributes, footnotes links have the class name `footnote-ref` and
backlinks `footnote-backref`.
* Fixed some regular expressions to make PCRE not shout warnings about POSIX
collation classes (dependent on your version of PCRE).
* Added optional class and id attributes to images and links using the same
syntax as for headers:
[link](url){#id .class}
![img](url){#id .class}
It work too for reference-style links and images. In this case you need
to put those attributes at the reference definition:
[link][linkref] or [linkref]
![img][linkref]
[linkref]: url "optional title" {#id .class}
* Fixed a PHP notice message triggered when some table column separator
markers are missing on the separator line below column headers.
* Fixed a small mistake that could cause the parser to retain an invalid
state related to parsing links across multiple runs. This was never
observed (that I know of), but it's still worth fixing.
Copyright and License
---------------------
PHP Markdown Lib
Copyright (c) 2004-2014 Michel Fortin
<http://michelf.ca/>
All rights reserved.
Based on Markdown
Copyright (c) 2003-2005 John Gruber
<http://daringfireball.net/>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the
distribution.
* Neither the name "Markdown" nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
This software is provided by the copyright holders and contributors "as
is" and any express or implied warranties, including, but not limited
to, the implied warranties of merchantability and fitness for a
particular purpose are disclaimed. In no event shall the copyright owner
or contributors be liable for any direct, indirect, incidental, special,
exemplary, or consequential damages (including, but not limited to,
procurement of substitute goods or services; loss of use, data, or
profits; or business interruption) however caused and on any theory of
liability, whether in contract, strict liability, or tort (including
negligence or otherwise) arising in any way out of the use of this
software, even if advised of the possibility of such damage.

+ 0
- 31
system/vendor/michelf/php-markdown/Readme.php View File

@ -1,31 +0,0 @@
<?php
# This file passes the content of the Readme.md file in the same directory
# through the Markdown filter. You can adapt this sample code in any way
# you like.
# Install PSR-0-compatible class autoloader
spl_autoload_register(function($class){
require preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\')).'.php';
});
# Get Markdown class
use \Michelf\Markdown;
# Read file and pass content through the Markdown parser
$text = file_get_contents('Readme.md');
$html = Markdown::defaultTransform($text);
?>
<!DOCTYPE html>
<html>
<head>
<title>PHP Markdown Lib - Readme</title>
</head>
<body>
<?php
# Put HTML content in the document
echo $html;
?>
</body>
</html>

+ 0
- 31
system/vendor/michelf/php-markdown/composer.json View File

@ -1,31 +0,0 @@
{
"name": "michelf/php-markdown",
"type": "library",
"description": "PHP Markdown",
"homepage": "http://michelf.ca/projects/php-markdown/",
"keywords": ["markdown"],
"license": "BSD-3-Clause",
"authors": [
{
"name": "Michel Fortin",
"email": "michel.fortin@michelf.ca",
"homepage": "http://michelf.ca/",
"role": "Developer"
},
{
"name": "John Gruber",
"homepage": "http://daringfireball.net/"
}
],
"require": {
"php": ">=5.3.0"
},
"autoload": {
"psr-0": { "Michelf": "" }
},
"extra": {
"branch-alias": {
"dev-lib": "1.4.x-dev"
}
}
}

+ 0
- 11
system/vendor/suin/php-rss-writer/.travis.yml View File

@ -1,11 +0,0 @@
language: php
php:
- 5.3
- 5.4
before_script:
- cd Tests
- wget http://getcomposer.org/composer.phar
- php composer.phar install
script: ./phpunit --coverage-text --configuration phpunit.xml.dist

+ 0
- 96
system/vendor/suin/php-rss-writer/README.md View File

@ -1,96 +0,0 @@
# \Suin\RSSWriter
`\Suin\RSSWriter` is yet another simple RSS writer library for PHP 5.3 or later. This component is Licensed under MIT license.
This library can also be used to publish Podcasts.
The build status of the current master branch is tracked by Travis CI: [![Build Status](https://secure.travis-ci.org/suin/php-rss-writer.png?branch=master)](http://travis-ci.org/suin/php-rss-writer)
Implementation:
```php
<?php
$feed = new Feed();
$channel = new Channel();
$channel
->title("Channel Title")
->description("Channel Description")
->url('http://blog.example.com')
->appendTo($feed);
// RSS item
$item = new Item();
$item
->title("Blog Entry Title")
->description("<div>Blog body</div>")
->url('http://blog.example.com/2012/08/21/blog-entry/')
->appendTo($channel);
// Podcast item
$item = new Item();
$item
->title("Some Podcast Entry")
->description("<div>Podcast body</div>")
->url('http://podcast.example.com/2012/08/21/podcast-entry/')
->enclosure('http://link-to-audio-file.com/2013/08/21/podcast.mp3', 4889, 'audio/mpeg')
->appendTo($channel);
echo $feed;
```
Output:
```xml
<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>Channel Title</title>
<link>http://blog.example.com</link>
<description>Channel Description</description>
<item>
<title>Blog Entry Title</title>
<link>http://blog.example.com/2012/08/21/blog-entry/</link>
<description>&lt;div&gt;Blog body&lt;/div&gt;</description>
</item>
</channel>
</rss>
```
## Installation
You can install via Composer.
At first create `composer.json` file:
```json
{
"require": {
"suin/php-rss-writer": ">=1.0"
}
}
```
Run composer to install.
```
$ composer install
```
Finally, include `vendor/autoload.php` in your product.
```
require_once 'vendor/autoload.php';
```
## How to Use
`example.php` is an example usage of RSSWriter.
If you want to know APIs, please see `FeedInterface`, `ChannelInterface` and `ItemInterface`.
## License
MIT license

+ 0
- 189
system/vendor/suin/php-rss-writer/Source/Suin/RSSWriter/Channel.php View File

@ -1,189 +0,0 @@
<?php
namespace Suin\RSSWriter;
use \Suin\RSSWriter\SimpleXMLElement;
class Channel implements \Suin\RSSWriter\ChannelInterface
{
/** @var string */
protected $title;
/** @var string */
protected $url;
/** @var string */
protected $description;
/** @var string */
protected $language;
/** @var string */
protected $copyright;
/** @var int */
protected $pubDate;
/** @var int */
protected $lastBuildDate;
/** @var int */
protected $ttl;
/** @var \Suin\RSSWriter\ItemInterface[] */
protected $items = array();
/**
* Set channel title
* @param string $title
* @return $this
*/
public function title($title)
{
$this->title = $title;
return $this;
}
/**
* Set channel URL
* @param string $url
* @return $this
*/
public function url($url)
{
$this->url = $url;
return $this;
}
/**
* Set channel description
* @param string $description
* @return $this
*/
public function description($description)
{
$this->description = $description;
return $this;
}
/**
* Set ISO639 language code
*
* The language the channel is written in. This allows aggregators to group all
* Italian language sites, for example, on a single page. A list of allowable
* values for this element, as provided by Netscape, is here. You may also use
* values defined by the W3C.
*
* @param string $language
* @return $this
*/
public function language($language)
{
$this->language = $language;
return $this;
}
/**
* Set channel copyright
* @param string $copyright
* @return $this
*/
public function copyright($copyright)
{
$this->copyright = $copyright;
return $this;
}
/**
* Set channel published date
* @param int $pubDate Unix timestamp
* @return $this
*/
public function pubDate($pubDate)
{
$this->pubDate = $pubDate;
return $this;
}
/**
* Set channel last build date
* @param int $lastBuildDate Unix timestamp
* @return $this
*/
public function lastBuildDate($lastBuildDate)
{
$this->lastBuildDate = $lastBuildDate;
return $this;
}
/**
* Set channel ttl (minutes)
* @param int $ttl
* @return $this
*/
public function ttl($ttl)
{
$this->ttl = $ttl;
return $this;
}
/**
* Add item object
* @param \Suin\RSSWriter\ItemInterface $item
* @return $this
*/
public function addItem(ItemInterface $item)
{
$this->items[] = $item;
return $this;
}
/**
* Append to feed
* @param \Suin\RSSWriter\FeedInterface $feed
* @return $this
*/
public function appendTo(FeedInterface $feed)
{
$feed->addChannel($this);
return $this;
}
/**
* Return XML object
* @return \Suin\RSSWriter\SimpleXMLElement
*/
public function asXML()
{
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><channel></channel>', LIBXML_NOERROR|LIBXML_ERR_NONE|LIBXML_ERR_FATAL);
$xml->addChild('title', $this->title);
$xml->addChild('link', $this->url);
$xml->addChild('description', $this->description);
if ( $this->language !== null )
{
$xml->addChild('language', $this->language);
}
if ( $this->copyright !== null )
{
$xml->addChild('copyright', $this->copyright);
}
if ( $this->pubDate !== null )
{
$xml->addChild('pubDate', date(DATE_RSS, $this->pubDate));
}
if ( $this->lastBuildDate !== null )
{
$xml->addChild('lastBuildDate', date(DATE_RSS, $this->lastBuildDate));
}
if ( $this->ttl !== null )
{
$xml->addChild('ttl', $this->ttl);
}
foreach ( $this->items as $item )
{
$toDom = dom_import_simplexml($xml);
$fromDom = dom_import_simplexml($item->asXML());
$toDom->appendChild($toDom->ownerDocument->importNode($fromDom, true));
}
return $xml;
}
}

+ 0
- 91
system/vendor/suin/php-rss-writer/Source/Suin/RSSWriter/ChannelInterface.php View File

@ -1,91 +0,0 @@
<?php
namespace Suin\RSSWriter;
use \Suin\RSSWriter\FeedInterface;
use \Suin\RSSWriter\ItemInterface;
interface ChannelInterface
{
/**
* Set channel title
* @param string $title
* @return $this
*/
public function title($title);
/**
* Set channel URL
* @param string $url
* @return $this
*/
public function url($url);
/**
* Set channel description
* @param string $description
* @return $this
*/
public function description($description);
/**
* Set ISO639 language code
*
* The language the channel is written in. This allows aggregators to group all
* Italian language sites, for example, on a single page. A list of allowable
* values for this element, as provided by Netscape, is here. You may also use
* values defined by the W3C.
*
* @param string $language
* @return $this
*/
public function language($language);
/**
* Set channel copyright
* @param string $copyright
* @return $this
*/
public function copyright($copyright);
/**
* Set channel published date
* @param int $pubDate Unix timestamp
* @return $this
*/
public function pubDate($pubDate);
/**
* Set channel last build date
* @param int $lastBuildDate Unix timestamp
* @return $this
*/
public function lastBuildDate($lastBuildDate);
/**
* Set channel ttl (minutes)
* @param int $ttl
* @return $this
*/
public function ttl($ttl);
/**
* Add item object
* @param \Suin\RSSWriter\ItemInterface $item
* @return $this
*/
public function addItem(ItemInterface $item);
/**
* Append to feed
* @param \Suin\RSSWriter\FeedInterface $feed
* @return $this
*/
public function appendTo(FeedInterface $feed);
/**
* Return XML object
* @return \Suin\RSSWriter\SimpleXMLElement
*/
public function asXML();
}

+ 0
- 54
system/vendor/suin/php-rss-writer/Source/Suin/RSSWriter/Feed.php View File

@ -1,54 +0,0 @@
<?php
namespace Suin\RSSWriter;
use \DOMDocument;
use \Suin\RSSWriter\ChannelInterface;
use \Suin\RSSWriter\SimpleXMLElement;
class Feed implements \Suin\RSSWriter\FeedInterface
{
/** @var \Suin\RSSWriter\ChannelInterface[] */
protected $channels = array();
/**
* Add channel
* @param \Suin\RSSWriter\ChannelInterface $channel
* @return $this
*/
public function addChannel(ChannelInterface $channel)
{
$this->channels[] = $channel;
return $this;
}
/**
* Render XML
* @return string
*/
public function render()
{
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><rss version="2.0" />', LIBXML_NOERROR|LIBXML_ERR_NONE|LIBXML_ERR_FATAL);
foreach ( $this->channels as $channel )
{
$toDom = dom_import_simplexml($xml);
$fromDom = dom_import_simplexml($channel->asXML());
$toDom->appendChild($toDom->ownerDocument->importNode($fromDom, true));
}
$dom = new DOMDocument('1.0', 'UTF-8');
$dom->appendChild($dom->importNode(dom_import_simplexml($xml), true));
$dom->formatOutput = true;
return $dom->saveXML();
}
/**
* Render XML
* @return string
*/
public function __toString()
{
return $this->render();
}
}

+ 0
- 27
system/vendor/suin/php-rss-writer/Source/Suin/RSSWriter/FeedInterface.php View File

@ -1,27 +0,0 @@
<?php
namespace Suin\RSSWriter;
use \Suin\RSSWriter\ChannelInterface;
interface FeedInterface
{
/**
* Add channel
* @param \Suin\RSSWriter\ChannelInterface $channel
* @return $thisJ
*/
public function addChannel(ChannelInterface $channel);
/**
* Render XML
* @return string
*/
public function render();
/**
* Render XML
* @return string
*/
public function __toString();
}

+ 0
- 169
system/vendor/suin/php-rss-writer/Source/Suin/RSSWriter/Item.php View File

@ -1,169 +0,0 @@
<?php
namespace Suin\RSSWriter;
use \Suin\RSSWriter\SimpleXMLElement;
class Item implements \Suin\RSSWriter\ItemInterface
{
/** @var string */
protected $title;
/** @var string */
protected $url;
/** @var string */
protected $description;
/** @var array */
protected $categories = array();
/** @var string */
protected $guid;
/** @var bool */
protected $isPermalink;
/** @var int */
protected $pubDate;
/** @var array */
protected $enclosure;
/**
* Set item title
* @param string $title
* @return $this
*/
public function title($title)
{
$this->title = $title;
return $this;
}
/**
* Set item URL
* @param string $url
* @return $this
*/
public function url($url)
{
$this->url = $url;
return $this;
}
/**
* Set item description
* @param string $description
* @return $this
*/
public function description($description)
{
$this->description = $description;
return $this;
}
/**
* Set item category
* @param string $name Category name
* @param string $domain Category URL
* @return $this
*/
public function category($name, $domain = null)
{
$this->categories[] = array($name, $domain);
return $this;
}
/**
* Set GUID
* @param string $guid
* @param bool $isPermalink
* @return $this
*/
public function guid($guid, $isPermalink = false)
{
$this->guid = $guid;
$this->isPermalink = $isPermalink;
return $this;
}
/**
* Set published date
* @param int $pubDate Unix timestamp
* @return $this
*/
public function pubDate($pubDate)
{
$this->pubDate = $pubDate;
return $this;
}
/**
* Set enclosure
* @param var $url Url to media file
* @param int $length Length in bytes of the media file
* @param var $type Media type, default is audio/mpeg
* @return $this
*/
public function enclosure($url, $length = 0, $type = 'audio/mpeg')
{
$this->enclosure = array('url' => $url, 'length' => $length, 'type' => $type);
return $this;
}
/**
* Append item to the channel
* @param \Suin\RSSWriter\ChannelInterface $channel
* @return $this
*/
public function appendTo(ChannelInterface $channel)
{
$channel->addItem($this);
return $this;
}
/**
* Return XML object
* @return \Suin\RSSWriter\SimpleXMLElement
*/
public function asXML()
{
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><item></item>', LIBXML_NOERROR|LIBXML_ERR_NONE|LIBXML_ERR_FATAL);
$xml->addChild('title', $this->title);
$xml->addChild('link', $this->url);
$xml->addChild('description', $this->description);
foreach ( $this->categories as $category )
{
$element = $xml->addChild('category', $category[0]);
if ( isset($category[1]) )
{
$element->addAttribute('domain', $category[1]);
}
}
if ( $this->guid )
{
$guid = $xml->addChild('guid', $this->guid);
if ( $this->isPermalink )
{
$guid->addAttribute('isPermaLink', 'true');
}
}
if ( $this->pubDate !== null )
{
$xml->addChild('pubDate', date(DATE_RSS, $this->pubDate));
}
if (is_array($this->enclosure) && (count($this->enclosure) == 3))
{
$element = $xml->addChild('enclosure');
$element->addAttribute('url', $this->enclosure['url']);
$element->addAttribute('type', $this->enclosure['type']);
if ($this->enclosure['length'])
{
$element->addAttribute('length', $this->enclosure['length']);
}
}
return $xml;
}
}

+ 0
- 75
system/vendor/suin/php-rss-writer/Source/Suin/RSSWriter/ItemInterface.php View File

@ -1,75 +0,0 @@
<?php
namespace Suin\RSSWriter;
use \Suin\RSSWriter\ChannelInterface;
use \Suin\RSSWriter\SimpleXMLElement;
interface ItemInterface
{
/**
* Set item title
* @param string $title
* @return $this
*/
public function title($title);
/**
* Set item URL
* @param string $url
* @return $this
*/
public function url($url);
/**
* Set item description
* @param string $description
* @return $this
*/
public function description($description);
/**
* Set item category
* @param string $name Category name
* @param string $domain Category URL
* @return $this
*/
public function category($name, $domain = null);
/**
* Set GUID
* @param string $guid
* @param bool $isPermalink
* @return $this
*/
public function guid($guid, $isPermalink = false);
/**
* Set published date
* @param int $pubDate Unix timestamp
* @return $this
*/
public function pubDate($pubDate);
/**
* Set enclosure
* @param var $url Url to media file
* @param int $length Length in bytes of the media file
* @param var $type Media type, default is audio/mpeg
* @return $this
*/
public function enclosure($url, $length = 0, $type = 'audio/mpeg');
/**
* Append item to the channel
* @param \Suin\RSSWriter\ChannelInterface $channel
* @return $this
*/
public function appendTo(ChannelInterface $channel);
/**
* Return XML object
* @return \Suin\RSSWriter\SimpleXMLElement
*/
public function asXML();
}

+ 0
- 16
system/vendor/suin/php-rss-writer/Source/Suin/RSSWriter/SimpleXMLElement.php View File

@ -1,16 +0,0 @@
<?php
namespace Suin\RSSWriter;
class SimpleXMLElement extends \SimpleXMLElement
{
public function addChild($name, $value = null, $namespace = null)
{
if ( $value !== null and is_string($value) === true )
{
$value = str_replace('&', '&amp;', $value);
}
return parent::addChild($name, $value, $namespace);
}
}

+ 0
- 8
system/vendor/suin/php-rss-writer/Tests/Bootstrap.php View File

@ -1,8 +0,0 @@
<?php
// For composer
require_once 'Vendor/autoload.php';
// Load test target classes
spl_autoload_register(function($c) { @include_once strtr($c, '\\_', '//').'.php'; });
set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__DIR__).'/Source');

+ 0
- 28
system/vendor/suin/php-rss-writer/Tests/README.md View File

@ -1,28 +0,0 @@
# How to Test
## Installation
Install [composer](https://github.com/composer/composer) to your ~/bin:
```sh
$ curl -s http://getcomposer.org/installer | php
```
Run composer and install depending packages:
```sh
$ composer.phar install
```
## Executing Tests
Run phpunit:
```sh
$ ./phpunit
```
## View Reports
If you want to see code coverages, open Coverage/index.html.

+ 0
- 252
system/vendor/suin/php-rss-writer/Tests/Suin/RSSWriter/ChannelTest.php View File

@ -1,252 +0,0 @@
<?php
namespace Suin\RSSWriter;
class ChannelTest extends \XoopsUnit\TestCase
{
private $itemInterface = '\Suin\RSSWriter\ItemInterface';
private $feedInterface = '\Suin\RSSWriter\FeedInterface';
public function testTitle()
{
$title = uniqid();
$channel = new Channel();
$this->assertSame($channel, $channel->title($title));
$this->assertAttributeSame($title, 'title', $channel);
}
public function testUrl()
{
$url = uniqid();
$channel = new Channel();
$this->assertSame($channel, $channel->url($url));
$this->assertAttributeSame($url, 'url', $channel);
}
public function testDescription()
{
$description = uniqid();
$channel = new Channel();
$this->assertSame($channel, $channel->description($description));
$this->assertAttributeSame($description, 'description', $channel);
}
public function testLanguage()
{
$language = uniqid();
$channel = new Channel();
$this->assertSame($channel, $channel->language($language));
$this->assertAttributeSame($language, 'language', $channel);
}
public function testCopyright()
{
$copyright = uniqid();
$channel = new Channel();
$this->assertSame($channel, $channel->copyright($copyright));
$this->assertAttributeSame($copyright, 'copyright', $channel);
}
public function testPubDate()
{
$pubDate = mt_rand(0, 9999999);
$channel = new Channel();
$this->assertSame($channel, $channel->pubDate($pubDate));
$this->assertAttributeSame($pubDate, 'pubDate', $channel);
}
public function testLastBuildDate()
{
$lastBuildDate = mt_rand(0, 9999999);
$channel = new Channel();
$this->assertSame($channel, $channel->lastBuildDate($lastBuildDate));
$this->assertAttributeSame($lastBuildDate, 'lastBuildDate', $channel);
}
public function testTtl()
{
$ttl = mt_rand(0, 99999999);
$channel = new Channel();
$this->assertSame($channel, $channel->ttl($ttl));
$this->assertAttributeSame($ttl, 'ttl', $channel);
}
public function testAddItem()
{
$item = $this->getMock($this->itemInterface);
$channel = new Channel();
$this->assertSame($channel, $channel->addItem($item));
$this->assertAttributeSame(array($item), 'items', $channel);
}
public function testAppendTo()
{
$channel = new Channel();
$feed = $this->getMock($this->feedInterface);
$feed->expects($this->once())->method('addChannel')->with($channel);
$this->assertSame($channel, $channel->appendTo($feed));
}
/**
* @param $expect
* @param array $data
* @dataProvider dataForAsXML
*/
public function testAsXML($expect, array $data)
{
$data = (object) $data;
$channel = new Channel();
foreach ( $data as $key => $value )
{
$this->reveal($channel)->attr($key, $value);
}
$this->assertXmlStringEqualsXmlString($expect, $channel->asXML()->asXML());
}
public static function dataForAsXML()
{
$now = time();
$nowString = date(DATE_RSS, $now);
return array(
array(
"
<channel>
<title>GoUpstate.com News Headlines</title>
<link>http://www.goupstate.com/</link>
<description>The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.</description>
</channel>
",
array(
'title' => "GoUpstate.com News Headlines",
'url' => 'http://www.goupstate.com/',
'description' => "The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.",
)
),
array(
"
<channel>
<title>GoUpstate.com News Headlines</title>
<link>http://www.goupstate.com/</link>
<description>The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.</description>
<language>en-us</language>
</channel>
",
array(
'title' => "GoUpstate.com News Headlines",
'url' => 'http://www.goupstate.com/',
'description' => "The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.",
'language' => 'en-us',
)
),
array(
"
<channel>
<title>GoUpstate.com News Headlines</title>
<link>http://www.goupstate.com/</link>
<description>The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.</description>
<pubDate>{$nowString}</pubDate>
</channel>
",
array(
'title' => "GoUpstate.com News Headlines",
'url' => 'http://www.goupstate.com/',
'description' => "The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.",
'pubDate' => $now,
)
),
array(
"
<channel>
<title>GoUpstate.com News Headlines</title>
<link>http://www.goupstate.com/</link>
<description>The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.</description>
<lastBuildDate>{$nowString}</lastBuildDate>
</channel>
",
array(
'title' => "GoUpstate.com News Headlines",
'url' => 'http://www.goupstate.com/',
'description' => "The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.",
'lastBuildDate' => $now,
)
),
array(
"
<channel>
<title>GoUpstate.com News Headlines</title>
<link>http://www.goupstate.com/</link>
<description>The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.</description>
<ttl>60</ttl>
</channel>
",
array(
'title' => "GoUpstate.com News Headlines",
'url' => 'http://www.goupstate.com/',
'description' => "The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.",
'ttl' => 60,
)
),
array(
"
<channel>
<title>GoUpstate.com News Headlines</title>
<link>http://www.goupstate.com/</link>
<description>The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.</description>
<copyright>Copyright 2002, Spartanburg Herald-Journal</copyright>
</channel>
",
array(
'title' => "GoUpstate.com News Headlines",
'url' => 'http://www.goupstate.com/',
'description' => "The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.",
'copyright' => "Copyright 2002, Spartanburg Herald-Journal",
)
),
);
}
public function testAppendTo_with_items()
{
$channel = new Channel();
$xml1 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><item><title>item1</title></item>');
$xml2 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><item><title>item2</title></item>');
$xml3 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><item><title>item3</title></item>');
$item1 = $this->getMock($this->itemInterface);
$item1->expects($this->once())->method('asXML')->will($this->returnValue($xml1));
$item2= $this->getMock($this->itemInterface);
$item2->expects($this->once())->method('asXML')->will($this->returnValue($xml2));
$item3 = $this->getMock($this->itemInterface);
$item3->expects($this->once())->method('asXML')->will($this->returnValue($xml3));
$this->reveal($channel)
->attr('title', "GoUpstate.com News Headlines")
->attr('url', 'http://www.goupstate.com/')
->attr('description', "The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.")
->attr('items', array($item1, $item2, $item3));
$expect = '<?xml version="1.0" encoding="UTF-8" ?>
<channel>
<title>GoUpstate.com News Headlines</title>
<link>http://www.goupstate.com/</link>
<description>The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.</description>
<item>
<title>item1</title>
</item>
<item>
<title>item2</title>
</item>
<item>
<title>item3</title>
</item>
</channel>
';
$this->assertXmlStringEqualsXmlString($expect, $channel->asXML()->asXML());
}
}

+ 0
- 96
system/vendor/suin/php-rss-writer/Tests/Suin/RSSWriter/FeedTest.php View File

@ -1,96 +0,0 @@
<?php
namespace Suin\RSSWriter;
use \Mockery;
class FeedTest extends \XoopsUnit\TestCase
{
private $channelInterface = '\Suin\RSSWriter\ChannelInterface';
public function testAddChannel()
{
$channel = Mockery::mock($this->channelInterface);
$feed = new Feed();
$this->assertSame($feed, $feed->addChannel($channel));
$this->assertAttributeSame(array($channel), 'channels', $feed);
}
public function testRender()
{
$feed = new Feed();
$xml1 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><channel><title>channel1</title></channel>');
$xml2 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><channel><title>channel2</title></channel>');
$xml3 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><channel><title>channel3</title></channel>');
$channel1 = $this->getMock($this->channelInterface);
$channel1->expects($this->once())->method('asXML')->will($this->returnValue($xml1));
$channel2 = $this->getMock($this->channelInterface);
$channel2->expects($this->once())->method('asXML')->will($this->returnValue($xml2));
$channel3 = $this->getMock($this->channelInterface);
$channel3->expects($this->once())->method('asXML')->will($this->returnValue($xml3));
$this->reveal($feed)->attr('channels', array($channel1, $channel2, $channel3));
$expect = '<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel><title>channel1</title></channel>
<channel><title>channel2</title></channel>
<channel><title>channel3</title></channel>
</rss>
';
$this->assertXmlStringEqualsXmlString($expect, $feed->render());
}
public function testRender_with_japanese()
{
$feed = new Feed();
$xml1 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><channel><title>日本語1</title></channel>');
$xml2 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><channel><title>日本語2</title></channel>');
$xml3 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><channel><title>日本語3</title></channel>');
$channel1 = $this->getMock($this->channelInterface);
$channel1->expects($this->once())->method('asXML')->will($this->returnValue($xml1));
$channel2 = $this->getMock($this->channelInterface);
$channel2->expects($this->once())->method('asXML')->will($this->returnValue($xml2));
$channel3 = $this->getMock($this->channelInterface);
$channel3->expects($this->once())->method('asXML')->will($this->returnValue($xml3));
$this->reveal($feed)->attr('channels', array($channel1, $channel2, $channel3));
$expect = <<< 'XML'
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>日本語1</title>
</channel>
<channel>
<title>日本語2</title>
</channel>
<channel>
<title>日本語3</title>
</channel>
</rss>
XML;
$this->assertSame($expect, $feed->render());
}
public function test__toString()
{
$feed = new Feed();
$xml1 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><channel><title>channel1</title></channel>');
$xml2 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><channel><title>channel2</title></channel>');
$xml3 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><channel><title>channel3</title></channel>');
$channel1 = $this->getMock($this->channelInterface);
$channel1->expects($this->once())->method('asXML')->will($this->returnValue($xml1));
$channel2 = $this->getMock($this->channelInterface);
$channel2->expects($this->once())->method('asXML')->will($this->returnValue($xml2));
$channel3 = $this->getMock($this->channelInterface);
$channel3->expects($this->once())->method('asXML')->will($this->returnValue($xml3));
$this->reveal($feed)->attr('channels', array($channel1, $channel2, $channel3));
$expect = '<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel><title>channel1</title></channel>
<channel><title>channel2</title></channel>
<channel><title>channel3</title></channel>
</rss>
';
$this->assertXmlStringEqualsXmlString($expect, $feed);
}
}

+ 0
- 200
system/vendor/suin/php-rss-writer/Tests/Suin/RSSWriter/ItemTest.php View File

@ -1,200 +0,0 @@
<?php
namespace Suin\RSSWriter;
class ItemTest extends \XoopsUnit\TestCase
{
private $channelInterface = '\Suin\RSSWriter\ChannelInterface';
public function testTitle()
{
$title = uniqid();
$item = new Item();
$this->assertSame($item, $item->title($title));
$this->assertAttributeSame($title, 'title', $item);
}
public function testUrl()
{
$url = uniqid();
$item = new Item();
$this->assertSame($item, $item->url($url));
$this->assertAttributeSame($url, 'url', $item);
}
public function testDescription()
{
$description = uniqid();
$item = new Item();
$this->assertSame($item, $item->description($description));
$this->assertAttributeSame($description, 'description', $item);
}
public function testCategory()
{
$category = uniqid();
$item = new Item();
$this->assertSame($item, $item->category($category));
$this->assertAttributeSame(array(
array($category, null),
), 'categories', $item);
}
public function testCategory_with_domain()
{
$category = uniqid();
$domain = uniqid();
$item = new Item();
$this->assertSame($item, $item->category($category, $domain));
$this->assertAttributeSame(array(
array($category, $domain),
), 'categories', $item);
}
public function testGuid()
{
$guid = uniqid();
$item = new Item();
$this->assertSame($item, $item->guid($guid));
$this->assertAttributeSame($guid, 'guid', $item);
}
public function testGuid_with_permalink()
{
$item = new Item();
$item->guid('guid', true);
$this->assertAttributeSame(true, 'isPermalink', $item);
$item->guid('guid', false);
$this->assertAttributeSame(false, 'isPermalink', $item);
$item->guid('guid'); // default
$this->assertAttributeSame(false, 'isPermalink', $item);
}
public function testPubDate()
{
$pubDate = mt_rand(1000000, 9999999);
$item = new Item();
$this->assertSame($item, $item->pubDate($pubDate));
$this->assertAttributeSame($pubDate, 'pubDate', $item);
}
public function testAppendTo()
{
$item = new Item();
$channel = $this->getMock($this->channelInterface);
$channel->expects($this->once())->method('addItem')->with($item);
$this->assertSame($item, $item->appendTo($channel));
}
public function testEnclosure()
{
$url = uniqid();
$enclosure = array('url' => $url, 'length' => 0, 'type' => 'audio/mpeg');
$item = new Item();
$this->assertSame($item, $item->enclosure($url));
$this->assertAttributeSame($enclosure, 'enclosure', $item);
}
public function testAsXML()
{
$now = time();
$nowString = date(DATE_RSS, $now);
$data = array(
'title' => "Venice Film Festival Tries to Quit Sinking",
'url' => 'http://nytimes.com/2004/12/07FEST.html',
'description' => "Some of the most heated chatter at the Venice Film Festival this week was about the way that the arrival of the stars at the Palazzo del Cinema was being staged.",
'categories' => array(
array("Grateful Dead", null),
array("MSFT", 'http://www.fool.com/cusips'),
),
'guid' => "http://inessential.com/2002/09/01.php#a2",
'isPermalink' => true,
'pubDate' => $now,
'enclosure' => array(
'url' => 'http://link-to-audio-file.com/test.mp3',
'length' => 4992,
'type' => 'audio/mpeg')
);
$item = new Item();
foreach ( $data as $key => $value )
{
$this->reveal($item)->attr($key, $value);
}
$expect ="
<item>
<title>{$data['title']}</title>
<link>{$data['url']}</link>
<description>{$data['description']}</description>
<category>{$data['categories'][0][0]}</category>
<category domain=\"{$data['categories'][1][1]}\">{$data['categories'][1][0]}</category>
<guid isPermaLink=\"true\">{$data['guid']}</guid>
<pubDate>{$nowString}</pubDate>
<enclosure url=\"{$data['enclosure']['url']}\" length=\"{$data['enclosure']['length']}\" type=\"{$data['enclosure']['type']}\"/>
</item>
";
$this->assertXmlStringEqualsXmlString($expect, $item->asXML()->asXML());
}
public function testAsXML_test_Japanese()
{
$now = time();
$nowString = date(DATE_RSS, $now);
$data = array(
'title' => "Venice Film Festival",
'url' => 'http://nytimes.com/2004/12/07FEST.html',
'description' => "Some of the most heated chatter at the Venice Film Festival this week was about the way that the arrival of the stars at the Palazzo del Cinema was being staged.",
);
$item = new Item();
foreach ( $data as $key => $value )
{
$this->reveal($item)->attr($key, $value);
}
$expect = "
<item>
<title>{$data['title']}</title>
<link>{$data['url']}</link>
<description>{$data['description']}</description>
</item>
";
$this->assertXmlStringEqualsXmlString($expect, $item->asXML()->asXML());
}
public function test_with_amp()
{
$item = new Item();
$item
->title('test&test')
->url('url&url')
->description('desc&desc');
$expect = '<?xml version="1.0" encoding="UTF-8"?>
<item><title>test&amp;test</title><link>url&amp;url</link><description>desc&amp;desc</description></item>
';
$this->assertSame($expect, $item->asXML()->asXML());
}
public function test_fail_safe_against_invalid_string()
{
$item = new Item();
$item
->title("test\0test")
->url("url\0test")
->description("desc\0desc");
$expect = '<?xml version="1.0" encoding="UTF-8"?>
<item><title>test</title><link>url</link><description>desc</description></item>
';
$this->assertSame($expect, $item->asXML()->asXML());
}
}

+ 0
- 12
system/vendor/suin/php-rss-writer/Tests/composer.json View File

@ -1,12 +0,0 @@
{
"config": {
"bin-dir": ".",
"vendor-dir": "Vendor"
},
"require": {
"php": ">=5.3.2",
"EHER/PHPUnit": ">=1.6",
"suin/xoopsunit": ">=1.2",
"mockery/mockery": ">=0.7.2"
}
}

+ 0
- 42
system/vendor/suin/php-rss-writer/Tests/phpunit.xml.dist View File

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap="Bootstrap.php"
processIsolation="false"
verbose="true"
strict="false"
colors="true">
<testsuites>
<testsuite name="PHPUnit">
<directory>Suin</directory>
</testsuite>
</testsuites>
<logging>
<log
type="coverage-html"
target="Coverage"
charset="UTF-8"
yui="true"
highlight="false"
lowUpperBound="35"
highLowerBound="70" />
<!-- <log type="coverage-text" target="php://stdout" lowUpperBound="35" highLowerBound="70" /> -->
</logging>
<filter>
<whitelist>
<directory suffix=".php">../Source</directory>
<!-- <file>/path/to/file</file> -->
<exclude>
<file>../Public/index.php</file>
<directory suffix="Interface.php">../Source</directory>
</exclude>
</whitelist>
<blacklist>
<directory suffix=".php" group="PHPUNIT">../Vendor</directory>
</blacklist>
</filter>
<listeners>
<listener class="\Mockery\Adapter\Phpunit\TestListener" file="Vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php" />
</listeners>
</phpunit>

+ 0
- 20
system/vendor/suin/php-rss-writer/composer.json View File

@ -1,20 +0,0 @@
{
"name": "suin/php-rss-writer",
"type": "library",
"description": "Yet another simple RSS writer library for PHP 5.3 or later.",
"keywords": ["rss", "generator", "writer", "feed"],
"homepage": "https://github.com/suin/php-rss-writer",
"license": "MIT",
"authors": [
{
"name": "Hidehito Nozawa aka Suin",
"email": "suinyeze@gmail.com"
}
],
"require": {
"php": ">=5.3.0"
},
"autoload": {
"psr-0": { "Suin\\RSSWriter": "Source" }
}
}

+ 0
- 35
system/vendor/suin/php-rss-writer/example.php View File

@ -1,35 +0,0 @@
<?php
// Load test target classes
spl_autoload_register(function($c) { @include_once strtr($c, '\\_', '//').'.php'; });
set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__.'/Source');
use \Suin\RSSWriter\Feed;
use \Suin\RSSWriter\Channel;
use \Suin\RSSWriter\Item;
$feed = new Feed();
$channel = new Channel();
$channel
->title("Channel Title")
->description("Channel Description")
->url('http://blog.example.com')
->language('en-US')
->copyright('Copyright 2012, Foo Bar')
->pubDate(strtotime('Tue, 21 Aug 2012 19:50:37 +0900'))
->lastBuildDate(strtotime('Tue, 21 Aug 2012 19:50:37 +0900'))
->ttl(60)
->appendTo($feed);
$item = new Item();
$item
->title("Blog Entry Title")
->description("<div>Blog body</div>")
->url('http://blog.example.com/2012/08/21/blog-entry/')
->pubDate(strtotime('Tue, 21 Aug 2012 19:50:37 +0900'))
->guid('http://blog.example.com/2012/08/21/blog-entry/', true)
->appendTo($channel);
echo $feed; // or echo $feed->render();

+ 16
- 15
themes/clean/404-search.html.php View File

@ -1,22 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no" />
<title>Search results not found! - <?php echo blog_title() ?></title>
<link href="<?php echo site_url() ?>themes/clean/css/style.css" rel="stylesheet" />
<!-- Include the Open Sans font -->
<link href="//fonts.googleapis.com/css?family=Open+Sans+Condensed:700&subset=latin,cyrillic-ext" rel="stylesheet" />
<link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no"/>
<title>Search results not found! - <?php echo blog_title() ?></title>
<link href="<?php echo site_url() ?>themes/clean/css/style.css" rel="stylesheet"/>
<!-- Include the Open Sans font -->
<link href="//fonts.googleapis.com/css?family=Open+Sans+Condensed:700&subset=latin,cyrillic-ext" rel="stylesheet"/>
</head>
<body>
<div class="center message">
<h1>Search results not found!</h1>
<div class="search">
<?php echo search() ?>
</div>
<p>Please search again, or would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
</div>
<div class="center message">
<h1>Search results not found!</h1>
<div class="search">
<?php echo search() ?>
</div>
<p>Please search again, or would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
</div>
</body>
</html>

+ 13
- 12
themes/clean/404.html.php View File

@ -1,19 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no" />
<title>404 Not Found - <?php echo blog_title() ?></title>
<link href="<?php echo site_url() ?>themes/clean/css/style.css" rel="stylesheet" />
<!-- Include the Open Sans font -->
<link href="//fonts.googleapis.com/css?family=Open+Sans+Condensed:700&subset=latin,cyrillic-ext" rel="stylesheet" />
<link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no"/>
<title>404 Not Found - <?php echo blog_title() ?></title>
<link href="<?php echo site_url() ?>themes/clean/css/style.css" rel="stylesheet"/>
<!-- Include the Open Sans font -->
<link href="//fonts.googleapis.com/css?family=Open+Sans+Condensed:700&subset=latin,cyrillic-ext" rel="stylesheet"/>
</head>
<body>
<div class="center message">
<h1>This page doesn't exist!</h1>
<p>Would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
</div>
<div class="center message">
<h1>This page doesn't exist!</h1>
<p>Would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
</div>
</body>
</html>

+ 509
- 487
themes/clean/css/style.css
File diff suppressed because it is too large
View File


+ 38
- 33
themes/clean/layout.html.php View File

@ -1,40 +1,45 @@
<!DOCTYPE html>
<html>
<head>
<?php echo $head_contents ?>
<link href="<?php echo site_url() ?>themes/clean/css/style.css" rel="stylesheet" />
<link href="//fonts.googleapis.com/css?family=Open+Sans+Condensed:700&subset=latin,cyrillic-ext" rel="stylesheet" />
<?php if (publisher()):?><link href="<?php echo publisher() ?>" rel="publisher" /><?php endif;?>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<?php echo $head_contents ?>
<link href="<?php echo site_url() ?>themes/clean/css/style.css" rel="stylesheet"/>
<link href="//fonts.googleapis.com/css?family=Open+Sans+Condensed:700&subset=latin,cyrillic-ext" rel="stylesheet"/>
<?php if (publisher()): ?>
<link href="<?php echo publisher() ?>" rel="publisher" /><?php endif; ?>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body class="<?php echo $bodyclass; ?>" itemscope="itemscope" itemtype="http://schema.org/Blog">
<div class="hide">
<meta content="<?php echo blog_title() ?>" itemprop="name"/>
<meta content="<?php echo blog_description() ?>" itemprop="description"/>
</div>
<?php if(facebook()) { echo facebook();} ?>
<?php if(login()) { toolbar();} ?>
<aside>
<?php if(is_index()) {?>
<h1 class="blog-title"><a rel="home" href="<?php echo site_url() ?>"><?php echo blog_title() ?></a></h1>
<?php } else {?>
<h2 class="blog-title"><a rel="home" href="<?php echo site_url() ?>"><?php echo blog_title() ?></a></h2>
<?php } ?>
<div class="search">
<?php echo search() ?>
</div>
<div class="social"><?php echo social() ?></div>
<div class="menu"><?php echo menu() ?></div>
<div class="recent"><h3>Recent Posts</h3><?php echo recent() ?></div>
<div class="archive"><?php echo archive_list()?></div>
<div class="tagcloud"><?php echo tag_cloud()?></div>
<div class="copyright"><?php echo copyright() ?></div>
</aside>
<section id="content">
<?php echo content()?>
</section>
<?php if (analytics()):?><?php echo analytics() ?><?php endif;?>
<div class="hide">
<meta content="<?php echo blog_title() ?>" itemprop="name"/>
<meta content="<?php echo blog_description() ?>" itemprop="description"/>
</div>
<?php if (facebook()) {
echo facebook();
} ?>
<?php if (login()) {
toolbar();
} ?>
<aside>
<?php if (is_index()) { ?>
<h1 class="blog-title"><a rel="home" href="<?php echo site_url() ?>"><?php echo blog_title() ?></a></h1>
<?php } else { ?>
<h2 class="blog-title"><a rel="home" href="<?php echo site_url() ?>"><?php echo blog_title() ?></a></h2>
<?php } ?>
<div class="search">
<?php echo search() ?>
</div>
<div class="social"><?php echo social() ?></div>
<div class="menu"><?php echo menu() ?></div>
<div class="recent"><h3>Recent Posts</h3><?php echo recent() ?></div>
<div class="archive"><?php echo archive_list() ?></div>
<div class="tagcloud"><?php echo tag_cloud() ?></div>
<div class="copyright"><?php echo copyright() ?></div>
</aside>
<section id="content">
<?php echo content() ?>
</section>
<?php if (analytics()): ?><?php echo analytics() ?><?php endif; ?>
</body>
</html>

+ 62
- 57
themes/clean/main.html.php View File

@ -1,58 +1,63 @@
<?php if (!empty($breadcrumb)):?><div class="breadcrumb"><?php echo $breadcrumb ?></div><?php endif;?>
<?php $i = 0; $len = count($posts);?>
<?php foreach($posts as $p):?>
<?php
if ($i == 0) {
$class = 'post first';
}
elseif ($i == $len - 1) {
$class = 'post last';
}
else {
$class = 'post';
}
$i++;
?>
<div class="<?php echo $class ?>" itemprop="blogPost" itemscope="itemscope" itemtype="http://schema.org/BlogPosting">
<div class="main">
<h2 class="title-index" itemprop="name"><a href="<?php echo $p->url?>"><?php echo $p->title ?></a></h2>
<div class="date">
<?php if (!empty($p->feature)){?>
<div class="featured-image">
<a href="<?php echo $p->url?>"><img src="<?php echo $p->feature; ?>" alt="<?php echo $p->title ?>"/></a>
<?php if (!empty($breadcrumb)): ?>
<div class="breadcrumb"><?php echo $breadcrumb ?></div><?php endif; ?>
<?php $i = 0;
$len = count($posts); ?>
<?php foreach ($posts as $p): ?>
<?php
if ($i == 0) {
$class = 'post first';
} elseif ($i == $len - 1) {
$class = 'post last';
} else {
$class = 'post';
}
$i++;
?>
<div class="<?php echo $class ?>" itemprop="blogPost" itemscope="itemscope"
itemtype="http://schema.org/BlogPosting">
<div class="main">
<h2 class="title-index" itemprop="name"><a href="<?php echo $p->url ?>"><?php echo $p->title ?></a></h2>
<div class="date">
<?php if (!empty($p->feature)) { ?>
<div class="featured-image">
<a href="<?php echo $p->url ?>"><img src="<?php echo $p->feature; ?>"
alt="<?php echo $p->title ?>"/></a>
</div>
<?php } ?>
<?php if (!empty($p->video)) { ?>
<div class="featured-video">
<iframe src="https://www.youtube.com/embed/<?php echo $p->video; ?>" width="560" height="315"
frameborder="0" allowfullscreen></iframe>
</div>
<?php } ?>
<span itemprop="datePublished"><?php echo date('d F Y', $p->date) ?></span> - Posted in
<span itemprop="articleSection"><?php echo $p->tag ?></span> by
<span itemprop="author"><a href="<?php echo $p->authorurl ?>"><?php echo $p->author ?></a></span>
<?php
if (disqus_count()) { ?> - <span><a href="<?php echo $p->url ?>#disqus_thread">Comments</a></span>
<?php } elseif (facebook()) { ?> -
<a href="<?php echo $p->url ?>#comments"><span><fb:comments-count
href=<?php echo $p->url ?>></fb:comments-count> Comments</span></a>
<?php } ?>
</div>
<div class="teaser-body" itemprop="articleBody">
<?php echo get_thumbnail($p->body) ?>
<?php echo get_teaser($p->body, $p->url) ?>
</div>
</div>
<?php }?>
<?php if (!empty($p->video)){?>
<div class="featured-video">
<iframe src="https://www.youtube.com/embed/<?php echo $p->video; ?>" width="560" height="315" frameborder="0" allowfullscreen></iframe>
</div>
<?php }?>
<span itemprop="datePublished"><?php echo date('d F Y', $p->date)?></span> - Posted in
<span itemprop="articleSection"><?php echo $p->tag ?></span> by
<span itemprop="author"><a href="<?php echo $p->authorurl ?>"><?php echo $p->author ?></a></span>
<?php
if (disqus_count()) {?> - <span><a href="<?php echo $p->url?>#disqus_thread">Comments</a></span>
<?php } elseif (facebook()){ ?> -
<a href="<?php echo $p->url ?>#comments"><span><fb:comments-count href=<?php echo $p->url ?>></fb:comments-count> Comments</span></a>
<?php } ?>
</div>
<div class="teaser-body" itemprop="articleBody">
<?php echo get_thumbnail($p->body)?>
<?php echo get_teaser($p->body, $p->url)?>
</div>
</div>
</div>
<?php endforeach;?>
<?php if (!empty($pagination['prev']) || !empty($pagination['next'])):?>
<div class="pager">
<?php if (!empty($pagination['prev'])):?>
<span><a href="?page=<?php echo $page-1?>" class="pagination-arrow newer" rel="prev">Newer</a></span>
<?php endif;?>
<?php if (!empty($pagination['next'])):?>
<span><a href="?page=<?php echo $page+1?>" class="pagination-arrow older" rel="next">Older</a></span>
<?php endif;?>
</div>
<?php endif;?>
<?php if (disqus_count()):?>
<?php echo disqus_count() ?>
<?php endif;?>
</div>
<?php endforeach; ?>
<?php if (!empty($pagination['prev']) || !empty($pagination['next'])): ?>
<div class="pager">
<?php if (!empty($pagination['prev'])): ?>
<span><a href="?page=<?php echo $page - 1 ?>" class="pagination-arrow newer" rel="prev">Newer</a></span>
<?php endif; ?>
<?php if (!empty($pagination['next'])): ?>
<span><a href="?page=<?php echo $page + 1 ?>" class="pagination-arrow older" rel="next">Older</a></span>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if (disqus_count()): ?>
<?php echo disqus_count() ?>
<?php endif; ?>

+ 68
- 53
themes/clean/post.html.php View File

@ -1,58 +1,73 @@
<?php if (!empty($breadcrumb)):?><div class="breadcrumb" xmlns:v="http://rdf.data-vocabulary.org/#"><?php echo $breadcrumb ?></div><?php endif;?>
<?php if(login()) { echo tab($p);} ?>
<?php if (!empty($breadcrumb)): ?>
<div class="breadcrumb" xmlns:v="http://rdf.data-vocabulary.org/#"><?php echo $breadcrumb ?></div><?php endif; ?>
<?php if (login()) {
echo tab($p);
} ?>
<div class="post" itemprop="blogPost" itemscope="itemscope" itemtype="http://schema.org/BlogPosting">
<div class="main">
<a name="more"></a>
<h1 class="title-post" itemprop="name"><?php echo $p->title ?></h1>
<div class="date">
<?php if (!empty($p->feature)){?>
<div class="featured-image">
<a href="<?php echo $p->url?>"><img src="<?php echo $p->feature; ?>" alt="<?php echo $p->title ?>"/></a>
<div class="main">
<a name="more"></a>
<h1 class="title-post" itemprop="name"><?php echo $p->title ?></h1>
<div class="date">
<?php if (!empty($p->feature)) { ?>
<div class="featured-image">
<a href="<?php echo $p->url ?>"><img src="<?php echo $p->feature; ?>"
alt="<?php echo $p->title ?>"/></a>
</div>
<?php } ?>
<?php if (!empty($p->video)) { ?>
<div class="featured-video">
<iframe src="https://www.youtube.com/embed/<?php echo $p->video; ?>" width="560" height="315"
frameborder="0" allowfullscreen></iframe>
</div>
<?php } ?>
<span itemprop="datePublished"><a href="<?php echo $p->archive ?>"
title="Show all posts made on this day"><?php echo date('d F Y', $p->date) ?></a></span>
- Posted in
<span itemprop="articleSection"><?php echo $p->tag ?></span> by
<span itemprop="author"><a href="<?php echo $p->authorurl ?>"><?php echo $p->author ?></a></span> -
<span><a href="<?php echo $p->url ?>" rel="permalink">Permalink</a></span>
</div>
<div class="post-body" itemprop="articleBody">
<?php echo $p->body; ?>
</div>
<?php }?>
<?php if (!empty($p->video)){?>
<div class="featured-video">
<iframe src="https://www.youtube.com/embed/<?php echo $p->video; ?>" width="560" height="315" frameborder="0" allowfullscreen></iframe>
</div>
<div class="separator">&rarr;</div>
<div class="share-box">
<?php echo $authorinfo ?>
<div class="share">
<h4>Share this post</h4>
<a class="twitter" target="_blank"
href="https://twitter.com/share?url=<?php echo $p->url ?>&text=<?php echo $p->title ?>">Twitter</a>
<a class="facebook" target="_blank"
href="https://www.facebook.com/sharer.php?u=<?php echo $p->url ?>&t=<?php echo $p->title ?>">Facebook</a>
<a class="googleplus" target="_blank"
href="https://plus.google.com/share?url=<?php echo $p->url ?>">Google+</a>
</div>
<?php }?>
<span itemprop="datePublished"><a href="<?php echo $p->archive ?>" title="Show all posts made on this day"><?php echo date('d F Y', $p->date)?></a></span> - Posted in
<span itemprop="articleSection"><?php echo $p->tag ?></span> by
<span itemprop="author"><a href="<?php echo $p->authorurl ?>"><?php echo $p->author ?></a></span> -
<span><a href="<?php echo $p->url ?>" rel="permalink">Permalink</a></span>
</div>
<div class="post-body" itemprop="articleBody">
<?php echo $p->body; ?>
</div>
</div>
<div class="separator">&rarr;</div>
<div class="share-box">
<?php echo $authorinfo ?>
<div class="share">
<h4>Share this post</h4>
<a class="twitter" target="_blank" href="https://twitter.com/share?url=<?php echo $p->url ?>&text=<?php echo $p->title?>">Twitter</a>
<a class="facebook" target="_blank" href="https://www.facebook.com/sharer.php?u=<?php echo $p->url ?>&t=<?php echo $p->title?>">Facebook</a>
<a class="googleplus" target="_blank" href="https://plus.google.com/share?url=<?php echo $p->url ?>">Google+</a>
</div>
</div>
<?php echo get_related($p->tag)?>
<div id="comments" class="comments border">
<?php if (facebook()):?>
<div class="fb-comments" data-href="<?php echo $p->url ?>" data-numposts="<?php echo config('fb.num') ?>" data-colorscheme="<?php echo config('fb.color') ?>"></div>
<?php endif;?>
<?php if (disqus()):?>
<div id="disqus_thread"></div>
<?php endif;?>
</div>
<div class="postnav">
<?php if (!empty($next)):?>
<span><a href="<?php echo ($next['url']);?>" class="pagination-arrow newer" rel="next"><?php echo ($next['title']);?></a></span>
<?php endif;?>
</div>
<?php echo get_related($p->tag) ?>
<div id="comments" class="comments border">
<?php if (facebook()): ?>
<div class="fb-comments" data-href="<?php echo $p->url ?>" data-numposts="<?php echo config('fb.num') ?>"
data-colorscheme="<?php echo config('fb.color') ?>"></div>
<?php endif; ?>
<?php if (disqus()): ?>
<div id="disqus_thread"></div>
<?php endif; ?>
</div>
<div class="postnav">
<?php if (!empty($next)): ?>
<span><a href="<?php echo($next['url']); ?>" class="pagination-arrow newer"
rel="next"><?php echo($next['title']); ?></a></span>
<?php endif; ?>
<?php if (!empty($prev)):?>
<span><a href="<?php echo ($prev['url']); ?>" class="pagination-arrow older" rel="prev"><?php echo ($prev['title']); ?></a></span>
<?php endif;?>
</div>
<?php if (disqus()):?>
<?php echo disqus($p->title, $p->url) ?>
<?php endif;?>
<?php if (!empty($prev)): ?>
<span><a href="<?php echo($prev['url']); ?>" class="pagination-arrow older"
rel="prev"><?php echo($prev['title']); ?></a></span>
<?php endif; ?>
</div>
<?php if (disqus()): ?>
<?php echo disqus($p->title, $p->url) ?>
<?php endif; ?>
</div>

+ 44
- 40
themes/clean/profile.html.php View File

@ -1,40 +1,44 @@
<?php if (!empty($breadcrumb)):?><div class="breadcrumb"><?php echo $breadcrumb ?></div><?php endif;?>
<div class="profile-wrapper" itemprop="accountablePerson" itemscope="itemscope">
<div class="profile" itemtype="http://schema.org/Person" itemscope="itemscope" itemprop="Person">
<h1 class="title-post" itemprop="name"><?php echo $name ?></h1>
<div class="bio" itemprop="description"><?php echo $bio ?></div>
</div>
</div>
<h2 class="post-index">Posts by this author</h2>
<?php if(!empty($posts)) {?>
<ul class="post-list">
<?php $i = 0; $len = count($posts);?>
<?php foreach($posts as $p):?>
<?php
if ($i == 0) {
$class = 'item first';
}
elseif ($i == $len - 1) {
$class = 'item last';
}
else {
$class = 'item';
}
$i++;
?>
<li class="<?php echo $class;?>">
<span><a href="<?php echo $p->url?>"><?php echo $p->title ?></a></span> on <span><?php echo date('d F Y', $p->date)?></span> - Posted in <span><?php echo $p->tag ?></span>
</li>
<?php endforeach;?>
</ul>
<?php if (!empty($pagination['prev']) || !empty($pagination['next'])):?>
<div class="pager">
<?php if (!empty($pagination['prev'])):?>
<span><a href="?page=<?php echo $page-1?>" class="pagination-arrow newer" rel="prev">Newer</a></span>
<?php endif;?>
<?php if (!empty($pagination['next'])):?>
<span><a href="?page=<?php echo $page+1?>" class="pagination-arrow older" rel="next">Older</a></span>
<?php endif;?>
</div>
<?php endif;?>
<?php } else { echo 'No posts found!'; }?>
<?php if (!empty($breadcrumb)): ?>
<div class="breadcrumb"><?php echo $breadcrumb ?></div><?php endif; ?>
<div class="profile-wrapper" itemprop="accountablePerson" itemscope="itemscope">
<div class="profile" itemtype="http://schema.org/Person" itemscope="itemscope" itemprop="Person">
<h1 class="title-post" itemprop="name"><?php echo $name ?></h1>
<div class="bio" itemprop="description"><?php echo $bio ?></div>
</div>
</div>
<h2 class="post-index">Posts by this author</h2>
<?php if (!empty($posts)) { ?>
<ul class="post-list">
<?php $i = 0;
$len = count($posts); ?>
<?php foreach ($posts as $p): ?>
<?php
if ($i == 0) {
$class = 'item first';
} elseif ($i == $len - 1) {
$class = 'item last';
} else {
$class = 'item';
}
$i++;
?>
<li class="<?php echo $class; ?>">
<span><a href="<?php echo $p->url ?>"><?php echo $p->title ?></a></span> on
<span><?php echo date('d F Y', $p->date) ?></span> - Posted in <span><?php echo $p->tag ?></span>
</li>
<?php endforeach; ?>
</ul>
<?php if (!empty($pagination['prev']) || !empty($pagination['next'])): ?>
<div class="pager">
<?php if (!empty($pagination['prev'])): ?>
<span><a href="?page=<?php echo $page - 1 ?>" class="pagination-arrow newer" rel="prev">Newer</a></span>
<?php endif; ?>
<?php if (!empty($pagination['next'])): ?>
<span><a href="?page=<?php echo $page + 1 ?>" class="pagination-arrow older" rel="next">Older</a></span>
<?php endif; ?>
</div>
<?php endif; ?>
<?php } else {
echo 'No posts found!';
} ?>

+ 12
- 8
themes/clean/static.html.php View File

@ -1,10 +1,14 @@
<?php if (!empty($breadcrumb)):?><div class="breadcrumb" xmlns:v="http://rdf.data-vocabulary.org/#"><?php echo $breadcrumb ?></div><?php endif;?>
<?php if(login()) { echo tab($p);} ?>
<?php if (!empty($breadcrumb)): ?>
<div class="breadcrumb" xmlns:v="http://rdf.data-vocabulary.org/#"><?php echo $breadcrumb ?></div><?php endif; ?>
<?php if (login()) {
echo tab($p);
} ?>
<div class="post" itemprop="blogPost" itemscope="itemscope" itemtype="http://schema.org/BlogPosting">
<div class="main">
<h1 class="title-post" itemprop="name"><?php echo $p->title ?></h1>
<div class="post-body" itemprop="articleBody">
<?php echo $p->body; ?>
</div>
</div>
<div class="main">
<h1 class="title-post" itemprop="name"><?php echo $p->title ?></h1>
<div class="post-body" itemprop="articleBody">
<?php echo $p->body; ?>
</div>
</div>
</div>

+ 16
- 15
themes/default/404-search.html.php View File

@ -1,22 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no" />
<title>Search results not found! - <?php echo blog_title() ?></title>
<link href="<?php echo site_url() ?>themes/default/css/style.css" rel="stylesheet" />
<!-- Include the Open Sans font -->
<link href='//fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no"/>
<title>Search results not found! - <?php echo blog_title() ?></title>
<link href="<?php echo site_url() ?>themes/default/css/style.css" rel="stylesheet"/>
<!-- Include the Open Sans font -->
<link href='//fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="center message">
<h1>Search results not found!</h1>
<div class="search-404">
<?php echo search() ?>
</div>
<p>Please search again, or would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
</div>
<div class="center message">
<h1>Search results not found!</h1>
<div class="search-404">
<?php echo search() ?>
</div>
<p>Please search again, or would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
</div>
</body>
</html>

+ 13
- 12
themes/default/404.html.php View File

@ -1,19 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no" />
<title>404 Not Found - <?php echo blog_title() ?></title>
<link href="<?php echo site_url() ?>themes/default/css/style.css" rel="stylesheet" />
<!-- Include the Open Sans font -->
<link href='//fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no"/>
<title>404 Not Found - <?php echo blog_title() ?></title>
<link href="<?php echo site_url() ?>themes/default/css/style.css" rel="stylesheet"/>
<!-- Include the Open Sans font -->
<link href='//fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="center message">
<h1>This page doesn't exist!</h1>
<p>Would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
</div>
<div class="center message">
<h1>This page doesn't exist!</h1>
<p>Would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
</div>
</body>
</html>

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

Loading…
Cancel
Save