Skip to content

Commit

Permalink
Added readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-KM committed Jun 2, 2014
1 parent 1d17600 commit b47451e
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 10 deletions.
20 changes: 10 additions & 10 deletions ContributionPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ public function setUp()
if(plugin_is_active('UserProfiles')) {
$this->_hooks[] = 'user_profiles_user_page';
}

if(! is_admin_theme()) {
//dig up all the elements being used, and add their ElementForm hook
$elementsTable = $this->_db->getTable('Element');
$select = $elementsTable->getSelect();

$select->join(array('contribution_type_elements' => $this->_db->ContributionTypeElement),
'element_id = elements.id', array());
$elements = $elementsTable->fetchObjects($select);
Expand Down Expand Up @@ -469,7 +469,7 @@ private function _createDefaultContributionTypes()
$imageType->display_name = 'Image';
$imageType->file_permissions = 'Required';
$imageType->save();

$descriptionElement = new ContributionTypeElement;
$descriptionElement->type_id = $imageType->id;
$dcDescriptionElement = $elementTable->findByElementSetNameAndElementName('Dublin Core', 'Description');
Expand All @@ -490,7 +490,7 @@ public function hookBeforeSaveItem($args)
if($contributionItem) {
if(!$contributionItem->public && $item->public) {
$item->public = false;
Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger')->addMessage("Cannot override contributor's desire to leave contribution private", 'error');
Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger')->addMessage(__("Cannot override contributor's desire to leave contribution private"), 'error');
}
}
}
Expand All @@ -509,8 +509,8 @@ public function hookUserProfilesUserPage($args)
{
$user = $args['user'];
$contributionCount = $this->_db->getTable('ContributionContributedItem')->count(array('contributor'=>$user->id));
if($contributionCount !=0) {
echo "<a href='" . url('contribution/contributors/show/id/' . $user->id) . "'>Contributed Items ($contributionCount)";
if ($contributionCount != 0) {
echo "<a href='" . url('contribution/contributors/show/id/' . $user->id) . "'>" . __('Contributed Items (%d)', $contributionCount) . '</a>';
}
}

Expand Down Expand Up @@ -615,10 +615,10 @@ public function getOptions()
{
return $this->_options;
}

/**
* Remove the form controls
*
*
* @param array $components
* @param array $args
* @return NULL
Expand All @@ -630,13 +630,13 @@ public function elementInputFilter($components, $args)
$type = $view->type;
$contributionElement = $this->_db->getTable('ContributionTypeElement')->findByElementAndType($element, $type);
if($contributionElement->long_text == 0) {
$components['input'] = $view->formText($args['input_name_stem'] . '[text]', $args['value']);
$components['input'] = $view->formText($args['input_name_stem'] . '[text]', $args['value']);
}
$components['form_controls'] = null;
$components['html_checkbox'] = null;
return $components;
}

/**
* Replace the prompt and remove the add input button
* @param array $components
Expand Down
87 changes: 87 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
Contribution (plugin for Omeka)
===============================


Summary
-------

This plugin for [Omeka] provides a way to collect stories, images, or other
files from the public and manage those contributions in your Omeka archive as
items. The form can also automatically add a reCAPTCHA box at the bottom of each
form to prevent spam-bots from spamming your website.

For more information, see the [Contribution presentation] on [Omeka] and the
[update] done for Omeka 2.


Installation
------------

Contribution depends on the [Guest User] plugin. You will need to install it
before you can install [Contribution].

Uncompress files and rename plugin folder "Contribution".

Then install it like any other Omeka plugin.

Settings are not on the plugin page, but at https://www.example.com/admin/contribution/index.


Warning
-------

Use it at your own risk.

It's always recommended to backup your files and database so you can roll back
if needed.


Troubleshooting
---------------

See online issues on [Contribution issues] page on GitHub.


License
-------

This plugin is published under [GNU/GPL].

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.

You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.


Contact
-------

Current maintainers:

* Roy Rosenzweig Center for History and New Media


Copyright
---------

* Copyright Roy Rosenzweig Center for History and New Media, 2010-2013
* Copyright Daniel Berthereau, 2014 (improvements, see [Daniel-KM])


[Omeka]: https://omeka.org
[Contribution presentation]: http://omeka.org/codex/Plugins/Contribution
[update]: http://omeka.org/codex/Plugins/Contribution_2.0
[Contribution]: https://github.com/Omeka/plugin-Contribution
[Contribution issues]: https://github.com/Omeka/plugin-Contribution/issues
[Guest User]: https://github.com/Omeka/plugin-GuestUser
[GNU/GPL]: https://www.gnu.org/licenses/gpl-3.0.html "GNU/GPL v3"
[Daniel-KM]: https://github.com/Daniel-KM "Daniel Berthereau"

0 comments on commit b47451e

Please sign in to comment.