From ff32e499745367b816d10f25e63ff3328214c32f Mon Sep 17 00:00:00 2001 From: Damien Lallement Date: Mon, 13 Aug 2012 10:45:23 +0000 Subject: - Import moonmoon - Create repo per langs --- common/admin/administration.php | 42 +++++++ common/admin/changepassword.php | 10 ++ common/admin/default.css | 232 +++++++++++++++++++++++++++++++++++++ common/admin/img/button-add.png | Bin 0 -> 244 bytes common/admin/img/button-delete.png | Bin 0 -> 201 bytes common/admin/img/button-h.png | Bin 0 -> 212 bytes common/admin/img/button.png | Bin 0 -> 212 bytes common/admin/img/h3.png | Bin 0 -> 212 bytes common/admin/img/moonmoon.png | Bin 0 -> 564 bytes common/admin/img/nav-admin.png | Bin 0 -> 1519 bytes common/admin/img/nav-feed.png | Bin 0 -> 1090 bytes common/admin/inc/auth.inc.php | 11 ++ common/admin/inc/pwd.inc.php | 1 + common/admin/index.php | 136 ++++++++++++++++++++++ common/admin/login.php | 34 ++++++ common/admin/logout.php | 5 + common/admin/purgecache.php | 21 ++++ common/admin/subscriptions.php | 64 ++++++++++ common/admin/template.php | 53 +++++++++ 19 files changed, 609 insertions(+) create mode 100755 common/admin/administration.php create mode 100644 common/admin/changepassword.php create mode 100755 common/admin/default.css create mode 100644 common/admin/img/button-add.png create mode 100644 common/admin/img/button-delete.png create mode 100644 common/admin/img/button-h.png create mode 100644 common/admin/img/button.png create mode 100644 common/admin/img/h3.png create mode 100644 common/admin/img/moonmoon.png create mode 100644 common/admin/img/nav-admin.png create mode 100644 common/admin/img/nav-feed.png create mode 100644 common/admin/inc/auth.inc.php create mode 100644 common/admin/inc/pwd.inc.php create mode 100755 common/admin/index.php create mode 100755 common/admin/login.php create mode 100644 common/admin/logout.php create mode 100644 common/admin/purgecache.php create mode 100755 common/admin/subscriptions.php create mode 100755 common/admin/template.php (limited to 'common/admin') diff --git a/common/admin/administration.php b/common/admin/administration.php new file mode 100755 index 0000000..1202e91 --- /dev/null +++ b/common/admin/administration.php @@ -0,0 +1,42 @@ +getPeople(); +$page_id = 'admin-admin'; +$header_extra = <<<"HTML" + + +HTML; + +$page_content = <<<"FRAGMENT" + +
+

{$l10n->getString('Clear cache')}

+
+

+

{$l10n->getString('Clearing the cache will make moonmoon reload all feeds.')}

+
+
+ +
+

{$l10n->getString('Change administrator password')}

+
+

+
+
+ +FRAGMENT; + +$footer_extra = ''; +$admin_access = 1; +require_once dirname(__FILE__) . '/template.php'; diff --git a/common/admin/changepassword.php b/common/admin/changepassword.php new file mode 100644 index 0000000..1fa505e --- /dev/null +++ b/common/admin/changepassword.php @@ -0,0 +1,10 @@ +'; + file_put_contents(dirname(__FILE__).'/inc/pwd.inc.php', $out); + die("Password changed. Login"); +} else { + die('Can not change password'); +} diff --git a/common/admin/default.css b/common/admin/default.css new file mode 100755 index 0000000..fcba3f4 --- /dev/null +++ b/common/admin/default.css @@ -0,0 +1,232 @@ +html, body{ + margin: 0; + padding: 0; +} +html{ + font-size: 62.5%; +} +body{ + background: #FFF; + color: #333; + font: 1.1em/1.6em "Lucida Grande", Tahoma, Arial, sans-serif; +} + + +fieldset{ + border: 0; + padding: 0; + margin: 1em 0; +} +input.text{ + border: 1px solid #BBB; + padding: 4px; +} +input.submit{ + font-size: 1em; + padding: 4px; + background: #D1D1D1 url(img/button.png) repeat-x left center; + border: 1px solid #FFF; + border-bottom: 1px solid #CECECE; + border-right: 1px solid #CECECE; + cursor: pointer; +} +input.submit:hover{ + background: #D1D1D1 url(img/button-h.png) repeat-x left center; + color: #000; + border: 1px solid #FFF; + border-bottom: 1px solid #C6C6C6; + border-right: 1px solid #C6C6C6; +} +input.delete{ + margin-left: 1em; +} +input.delete:hover{ + background: #ffabab url(img/button-delete.png) repeat-x left center; + color: #C00; + border: 1px solid #FCC; + border-bottom: 1px solid #F99; + border-right: 1px solid #F99; +} +input.add{ + font-weight: bold; +} +input.add:hover{ + background: #65a5e1 url(img/button-add.png) repeat-x left center; + color: #20466a; + border: 1px solid #a6c7e5; + border-bottom: 1px solid #4f90cd; + border-right: 1px solid #4f90cd; +} +p.help{ + font-size: 0.8em; + color: #999; + margin: 0; +} + +#page{ +} + + header{ + background: #E0E0E0 url(img/moonmoon.png) no-repeat right center; + border-top: 5px solid #D0D0D0; + margin: 0; + padding: 10px; + } + header h1{ + display: none; + margin: 0 0 0 20px; + padding: 0; + height: 14px; + width: 95px; + background: transparent url(img/moonmoon.png) no-repeat left center; + + overflow: hidden; + text-indent: -1000em; + } + header p{ + margin: 0 0 0 20px; + padding: 0; + } + header p a{ + color: #AAA; + } + header p a:hover{ + color: #111; + } + + + nav ul{ + margin: 20px 30px; + padding: 0; + list-style: none; + } + nav ul:after {content: "."; display: block; height: 0; clear: both; visibility: hidden; } + nav ul {display: inline-table;} + /* Hides from IE-mac \*/ + * html nav ul {height: 1%;} + nav ul {display: block;} + /* End hide from IE-mac */ + + nav ul li{ + display: block; + float: left; + } + nav ul li a{ + display: block; + border: 1px solid #DDD; + padding: 8px 8px 8px 36px; + margin-right: 8px; + text-decoration: none; + color: #666; + background-repeat: no-repeat; + background-position: 6px center; + } + nav ul li a:hover, + body#admin-feed #nav-feed a, + body#admin-admin #nav-admin a { + background-color: #f0f2f6; + border-color: #AAA; + color: #111; + } + #nav-feed a{ + background-image: url(img/nav-feed.png); + } + #nav-admin a{ + background-image: url(img/nav-admin.png); + } + + #content{ + margin: 20px 30px; + } + + .widget{ + margin: 20px 0; + } + .widget h3{ + background: #3e4350 url(img/h3.png) repeat-x left center; + color: #FFF; + text-transform: uppercase; + margin: 0; + padding: 10px; + } + .widget form{ + padding: 10px; + border: 1px solid #EEE; + border-top: 0; + } + + #feedmanage p.select{ + margin: 3px 0; + } + #feedmanage p.action span.count{ + float: right; + padding-right: 10px; + font-size: 1.3em; + } + #feedmanage table{ + width: 99%; + border-collapse: collapse; + border: 1px solid #f0f2f6; + } + #feedmanage thead th{ + background: #f0f2f6; + text-align: left; + padding: 6px; + } + #feedmanage thead span{ + display: none; + } + #feedmanage tr{ + border-bottom: 1px solid #e8ebf1; + } + #feedmanage tr.even td{ + background: #f0f2f6; + width: auto; + } + #feedmanage .text{ + background: transparent; + border: 1px solid #FFF; + width: 90%; + } + #feedmanage tr.even td .text{ + border: 1px solid #f0f2f6; + } + #feedmanage tr td input.text:focus{ + background: #FFF; + border: 1px solid #4392b7; + } + + #feedmanage tr.selected td{ + background: #ffabab; + background: #4392b7; + color: #FFF; + } + #feedmanage tr.selected td .text{ + color: #FFF; + border: 1px solid #4392b7; + } + #feedmanage tr td input.text:focus{ + background: #FFF; + color: #000; + border: 1px solid #4392b7; + } + +/* Login form +*******************************************************************************/ +form.login { + width: 400px; + margin: 0 auto; +} +form.login fieldset { + border: 1px solid #CCC; + text-align: center; +} + +p.logout { + float: right; + margin: 20px 30px 0 0; +} + p.logout a { + padding: 8px; + display: block; + } diff --git a/common/admin/img/button-add.png b/common/admin/img/button-add.png new file mode 100644 index 0000000..859364a Binary files /dev/null and b/common/admin/img/button-add.png differ diff --git a/common/admin/img/button-delete.png b/common/admin/img/button-delete.png new file mode 100644 index 0000000..7bfebc2 Binary files /dev/null and b/common/admin/img/button-delete.png differ diff --git a/common/admin/img/button-h.png b/common/admin/img/button-h.png new file mode 100644 index 0000000..0a43a6a Binary files /dev/null and b/common/admin/img/button-h.png differ diff --git a/common/admin/img/button.png b/common/admin/img/button.png new file mode 100644 index 0000000..fad6ccc Binary files /dev/null and b/common/admin/img/button.png differ diff --git a/common/admin/img/h3.png b/common/admin/img/h3.png new file mode 100644 index 0000000..0c86748 Binary files /dev/null and b/common/admin/img/h3.png differ diff --git a/common/admin/img/moonmoon.png b/common/admin/img/moonmoon.png new file mode 100644 index 0000000..26cc8f4 Binary files /dev/null and b/common/admin/img/moonmoon.png differ diff --git a/common/admin/img/nav-admin.png b/common/admin/img/nav-admin.png new file mode 100644 index 0000000..3077a54 Binary files /dev/null and b/common/admin/img/nav-admin.png differ diff --git a/common/admin/img/nav-feed.png b/common/admin/img/nav-feed.png new file mode 100644 index 0000000..00c896b Binary files /dev/null and b/common/admin/img/nav-feed.png differ diff --git a/common/admin/inc/auth.inc.php b/common/admin/inc/auth.inc.php new file mode 100644 index 0000000..d21467b --- /dev/null +++ b/common/admin/inc/auth.inc.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/common/admin/inc/pwd.inc.php b/common/admin/inc/pwd.inc.php new file mode 100644 index 0000000..10d9225 --- /dev/null +++ b/common/admin/inc/pwd.inc.php @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/common/admin/index.php b/common/admin/index.php new file mode 100755 index 0000000..28f7198 --- /dev/null +++ b/common/admin/index.php @@ -0,0 +1,136 @@ +loadOpml(dirname(__FILE__) . '/../custom/people.opml')) { + $Planet->loadFeeds(); + $items = $Planet->getItems(); +} + +$everyone = $Planet->getPeople(); +$count_feeds = count($everyone); +$page_id = 'admin-feed'; +$footer_extra = << + var allCheckboxes = function(status){ + var form = document.getElementById('feedmanage'); + var selectboxes = form.getElementsByTagName('input'); + for (var i=0; i +FRAGMENT; + +ob_start(); +?> + +
+

+
+
+ + + +
+

+
+
+ +
+

+
+

+ + + +

+

,

+ + + + + + + + + + + + + + + + + + + + + +
+ get_items(); + if (count($items) > 0) { + echo $items[0]->get_date(); + } else { + echo _g('Not in cache'); + } + ?> +
+
+
+ +
+

+ + + +

+
+ +FRAGMENT; + +$footer_extra = << + + + +FRAGMENT; + +$page_id = 'admin-login'; +$admin_access = 0; + +require_once dirname(__FILE__) . '/template.php'; diff --git a/common/admin/logout.php b/common/admin/logout.php new file mode 100644 index 0000000..6dd32aa --- /dev/null +++ b/common/admin/logout.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/common/admin/purgecache.php b/common/admin/purgecache.php new file mode 100644 index 0000000..a5af5cf --- /dev/null +++ b/common/admin/purgecache.php @@ -0,0 +1,21 @@ +getName() === '') { + $PlanetConfig->setName($oldOpml->getTitle()); + } + $oldOpml = OpmlManager::load(dirname(__FILE__).'/../custom/people.opml'); + $newOpml = new opml(); + $newOpml->title = $PlanetConfig->getName(); + + // Remove slashes if needed + if (get_magic_quotes_gpc() && isset($_POST['opml'])) { + array_walk_recursive($_POST['opml'], 'removeSlashes'); + } + // Delete/Save feeds + if (isset($_POST['delete']) || isset($_POST['save'])){ + foreach ($_POST['opml'] as $person){ + if (isset($_POST['delete'])) { + //delete mode, check if to be deleted + if (!isset($person['delete'])){ + $newOpml->entries[] = $person; + } + } else { + $newOpml->entries[] = $person; + } + } + } + + // Add feed + if (isset($_POST['add'])){ + if ('http://' != $_POST['url']) { + //autodiscover feed + $feed = new SimplePie(); + $feed->enable_cache(false); + $feed->set_feed_url($_POST['url']); + $feed->init(); + $feed->handle_content_type(); + $person['name'] = $feed->get_title(); + $person['website'] = $feed->get_permalink(); + $person['feed'] = $feed->feed_url; + + $oldOpml->entries[] = $person; + } + $newOpml->entries = $oldOpml->entries; + } + + // Backup old OPML + OpmlManager::backup(dirname(__FILE__).'/../custom/people.opml'); + + // Save new OPML + OpmlManager::save($newOpml, dirname(__FILE__).'/../custom/people.opml'); +} +header("Location: index.php"); +die(); diff --git a/common/admin/template.php b/common/admin/template.php new file mode 100755 index 0000000..7818bef --- /dev/null +++ b/common/admin/template.php @@ -0,0 +1,53 @@ + + + + + + + +<?php + echo _g('Administration') . ' — '; + printf(_g('moonmoon %s', '%s is the version number for moonmoon, this string appears as the tab title in the admin panel'), $moon_version); +?> + + + + + + + + + +
+
+

moonmoon

+

+
+ + + +

+ + + + + + +
+ + + +
+
+ + + + + -- cgit v1.2.1