aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2012-07-16 22:15:58 -0400
committerCash Costello <cash.costello@gmail.com>2012-07-16 22:15:58 -0400
commit6c9b6a031c6d8a8474bc5e7a1717a5ae3bee1535 (patch)
tree21eec1f05deefefa54aa5b0f03c5ab7aa4360297
parent2e0cc0343715adec8a0843750016f89acc3c2394 (diff)
parent037eacc4a5015dc048c4fff080349aa96a9b918e (diff)
downloadelgg-6c9b6a031c6d8a8474bc5e7a1717a5ae3bee1535.tar.gz
elgg-6c9b6a031c6d8a8474bc5e7a1717a5ae3bee1535.tar.bz2
Merge pull request #304 from sembrestels/donate-manifest
Code, Report issue and Donate links in manifest
-rw-r--r--documentation/info/manifest.xml3
-rw-r--r--engine/classes/ElggPluginManifest.php28
-rw-r--r--engine/classes/ElggPluginManifestParser18.php11
-rw-r--r--engine/tests/api/plugins.php18
-rw-r--r--engine/tests/test_files/plugin_18/manifest.xml3
-rw-r--r--languages/en.php3
-rw-r--r--mod/developers/manifest.xml1
-rw-r--r--mod/messages/manifest.xml2
-rw-r--r--views/default/css/admin.php3
-rw-r--r--views/default/object/plugin/full.php28
10 files changed, 91 insertions, 9 deletions
diff --git a/documentation/info/manifest.xml b/documentation/info/manifest.xml
index baa6cc3fa..494158481 100644
--- a/documentation/info/manifest.xml
+++ b/documentation/info/manifest.xml
@@ -6,6 +6,9 @@
<blurb>A concise description.</blurb>
<description>This is a longer, more interesting description of my plugin, its features, and other important information.</description>
<website>http://www.elgg.org/</website>
+ <repository>https://github.com/Elgg/Elgg</repository>
+ <bugtracker>http://trac.elgg.org</bugtracker>
+ <donations>http://elgg.org/supporter.php</donations>
<copyright>(C) Elgg 2011</copyright>
<license>GNU General Public License version 2</license>
diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php
index 6b3932b32..a4f5bb95d 100644
--- a/engine/classes/ElggPluginManifest.php
+++ b/engine/classes/ElggPluginManifest.php
@@ -264,7 +264,7 @@ class ElggPluginManifest {
/**
* Returns the license
*
- * @return sting
+ * @return string
*/
public function getLicense() {
// license vs licence. Use license.
@@ -276,6 +276,32 @@ class ElggPluginManifest {
}
}
+ /**
+ * Returns the repository url
+ *
+ * @return string
+ */
+ public function getRepositoryURL() {
+ return $this->parser->getAttribute('repository');
+ }
+
+ /**
+ * Returns the bug tracker page
+ *
+ * @return string
+ */
+ public function getBugTrackerURL() {
+ return $this->parser->getAttribute('bugtracker');
+ }
+
+ /**
+ * Returns the donations page
+ *
+ * @return string
+ */
+ public function getDonationsPageURL() {
+ return $this->parser->getAttribute('donations');
+ }
/**
* Returns the version of the plugin.
diff --git a/engine/classes/ElggPluginManifestParser18.php b/engine/classes/ElggPluginManifestParser18.php
index 554e28c02..3b753f17b 100644
--- a/engine/classes/ElggPluginManifestParser18.php
+++ b/engine/classes/ElggPluginManifestParser18.php
@@ -13,10 +13,10 @@ class ElggPluginManifestParser18 extends ElggPluginManifestParser {
* @var array
*/
protected $validAttributes = array(
- 'name', 'author', 'version', 'blurb', 'description',
- 'website', 'copyright', 'license', 'requires', 'suggests',
- 'screenshot', 'category', 'conflicts', 'provides',
- 'activate_on_install'
+ 'name', 'author', 'version', 'blurb', 'description','website',
+ 'repository', 'bugtracker', 'donations', 'copyright', 'license',
+ 'requires', 'suggests', 'conflicts', 'provides',
+ 'screenshot', 'category', 'activate_on_install'
);
/**
@@ -46,6 +46,9 @@ class ElggPluginManifestParser18 extends ElggPluginManifestParser {
case 'website':
case 'copyright':
case 'license':
+ case 'repository':
+ case 'bugtracker':
+ case 'donations':
case 'activate_on_install':
$parsed[$element->name] = $element->content;
break;
diff --git a/engine/tests/api/plugins.php b/engine/tests/api/plugins.php
index 8ecb0a46c..114f3991b 100644
--- a/engine/tests/api/plugins.php
+++ b/engine/tests/api/plugins.php
@@ -68,6 +68,9 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest {
'blurb' => 'A concise description.',
'description' => 'A longer, more interesting description.',
'website' => 'http://www.elgg.org/',
+ 'repository' => 'https://github.com/Elgg/Elgg',
+ 'bugtracker' => 'http://trac.elgg.org',
+ 'donations' => 'http://elgg.org/supporter.php',
'copyright' => '(C) Elgg Foundation 2011',
'license' => 'GNU General Public License version 2',
@@ -164,6 +167,21 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest {
$this->assertEqual($this->manifest18->getWebsite(), 'http://www.elgg.org/');
$this->assertEqual($this->manifest17->getWebsite(), 'http://www.elgg.org/');
}
+
+ public function testElggPluginManifestGetRepository() {
+ $this->assertEqual($this->manifest18->getRepositoryURL(), 'https://github.com/Elgg/Elgg');
+ $this->assertEqual($this->manifest17->getRepositoryURL(), '');
+ }
+
+ public function testElggPluginManifestGetBugtracker() {
+ $this->assertEqual($this->manifest18->getBugTrackerURL(), 'http://trac.elgg.org');
+ $this->assertEqual($this->manifest17->getBugTrackerURL(), '');
+ }
+
+ public function testElggPluginManifestGetDonationsPage() {
+ $this->assertEqual($this->manifest18->getDonationsPageURL(), 'http://elgg.org/supporter.php');
+ $this->assertEqual($this->manifest17->getDonationsPageURL(), '');
+ }
public function testElggPluginManifestGetCopyright() {
$this->assertEqual($this->manifest18->getCopyright(), '(C) Elgg Foundation 2011');
diff --git a/engine/tests/test_files/plugin_18/manifest.xml b/engine/tests/test_files/plugin_18/manifest.xml
index 9654b6422..5d788616a 100644
--- a/engine/tests/test_files/plugin_18/manifest.xml
+++ b/engine/tests/test_files/plugin_18/manifest.xml
@@ -6,6 +6,9 @@
<blurb>A concise description.</blurb>
<description>A longer, more interesting description.</description>
<website>http://www.elgg.org/</website>
+ <repository>https://github.com/Elgg/Elgg</repository>
+ <bugtracker>http://trac.elgg.org</bugtracker>
+ <donations>http://elgg.org/supporter.php</donations>
<copyright>(C) Elgg Foundation 2011</copyright>
<license>GNU General Public License version 2</license>
diff --git a/languages/en.php b/languages/en.php
index 01b4d5d6b..bb5376a44 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -688,6 +688,9 @@ $english = array(
'admin:plugins:label:categories' => 'Categories',
'admin:plugins:label:licence' => "Licence",
'admin:plugins:label:website' => "URL",
+ 'admin:plugins:label:repository' => "Code",
+ 'admin:plugins:label:bugtracker' => "Report issue",
+ 'admin:plugins:label:donate' => "Donate",
'admin:plugins:label:moreinfo' => 'more info',
'admin:plugins:label:version' => 'Version',
'admin:plugins:label:location' => 'Location',
diff --git a/mod/developers/manifest.xml b/mod/developers/manifest.xml
index 93a12945d..e31998872 100644
--- a/mod/developers/manifest.xml
+++ b/mod/developers/manifest.xml
@@ -8,6 +8,7 @@
<blurb>Developer tools for Elgg</blurb>
<description>A set of tools for writing plugins and themes. It is recommended that you have this plugin at the top of the plugin list.</description>
<website>http://www.elgg.org/</website>
+ <bugtracker>http://trac.elgg.org</bugtracker>
<copyright>See COPYRIGHT.txt</copyright>
<license>GNU General Public License version 2</license>
diff --git a/mod/messages/manifest.xml b/mod/messages/manifest.xml
index 73a58d9d4..6e3462901 100644
--- a/mod/messages/manifest.xml
+++ b/mod/messages/manifest.xml
@@ -6,8 +6,8 @@
<category>bundled</category>
<category>communication</category>
<description>Elgg internal messages plugin. This plugin lets user send each other messages.</description>
- <copyright>See COPYRIGHT.txt</copyright>
<website>http://www.elgg.org/</website>
+ <copyright>See COPYRIGHT.txt</copyright>
<license>GNU General Public License version 2</license>
<requires>
<type>elgg_release</type>
diff --git a/views/default/css/admin.php b/views/default/css/admin.php
index 6f9ed643e..b996e5636 100644
--- a/views/default/css/admin.php
+++ b/views/default/css/admin.php
@@ -1460,7 +1460,8 @@ a.elgg-widget-collapsed:before {
padding: 5px 10px;
margin: 4px 0;
}
-ul.elgg-plugin-categories, ul.elgg-plugin-categories > li {
+ul.elgg-plugin-categories, ul.elgg-plugin-categories > li,
+ul.elgg-plugin-resources, ul.elgg-plugin-resources > li {
display: inline;
}
.elgg-plugin-category-bundled {
diff --git a/views/default/object/plugin/full.php b/views/default/object/plugin/full.php
index db0a52416..2de65b555 100644
--- a/views/default/object/plugin/full.php
+++ b/views/default/object/plugin/full.php
@@ -172,6 +172,26 @@ $website = elgg_view('output/url', array(
'is_trusted' => true,
));
+$resources = array(
+ 'repository' => $plugin->getManifest()->getRepositoryURL(),
+ 'bugtracker' => $plugin->getManifest()->getBugTrackerURL(),
+ 'donate' => $plugin->getManifest()->getDonationsPageURL(),
+);
+
+$resources_html = "<ul class=\"elgg-plugin-resources\">";
+foreach ($resources as $id => $href) {
+ if ($href) {
+ $resources_html .= "<li class=\"prm\">";
+ $resources_html .= elgg_view('output/url', array(
+ 'href' => $href,
+ 'text' => elgg_echo("admin:plugins:label:$id"),
+ 'is_trusted' => true,
+ ));
+ $resources_html .= "</li>";
+ }
+}
+$resources_html .= "</ul>";
+
$copyright = elgg_view('output/text', array('value' => $plugin->getManifest()->getCopyright()));
$license = elgg_view('output/text', array('value' => $plugin->getManifest()->getLicense()));
@@ -242,7 +262,11 @@ if (elgg_view_exists($settings_view_old) || elgg_view_exists($settings_view_new)
<div><?php echo $description; ?></div>
<p><?php echo $author . ' - ' . $website; ?></p>
- <?php echo $docs; ?>
+
+ <?php
+ echo $resources_html;
+ echo $docs;
+ ?>
<div class="pts">
<?php
@@ -281,4 +305,4 @@ if (elgg_view_exists($settings_view_old) || elgg_view_exists($settings_view_new)
?>
</div>
</div>
-</div> \ No newline at end of file
+</div>