Ejemplo n.º 1
0
</p>
        <fieldset name="user-profiles">
        <?php 
        foreach ($profileType->Elements as $element) {
            echo $this->profileElementForm($element, $profile);
        }
        ?>
        </fieldset>
        </div>
        <?php 
    }
    ?>

<?php 
    //if the contribution type is type_id==3 then this is a Video (via YouTube) contribution (check the database contribution_types for the ID's)
    if ($contributionTypeElement->type_id == 3) {
        get_specific_plugin_hook_output('YouTubeImport', 'import_form', array('view' => $this, 'item' => $item, 'type' => $type));
        $youtubeFormElements = $this->form->getElements();
        //remove elements not needed for the public contribution form
        unset($youtubeFormElements['youtube-import-submit']);
        unset($youtubeFormElements['youtubeuserrole']);
        unset($youtubeFormElements['youtubepublic']);
        unset($youtubeFormElements['youtubecollection']);
        foreach ($youtubeFormElements as $element) {
            echo $element->__toString();
        }
    }
    ?>

<?php 
}
Ejemplo n.º 2
0
} else {
    ?>
        <p><?php 
    echo __("There are currently no items within this collection.");
    ?>
</p>
    <?php 
}
?>
</div><!-- end collection-items -->

<?php 
fire_plugin_hook('public_collections_show', array('view' => $this, 'collection' => $collection));
?>

<aside id="sidebar">

    <div id="sidebar-collection-metadata" class="element">
        <?php 
echo all_element_texts('collection');
?>
    </div>
    <div id="sidebar-comments" class="element">
        <?php 
echo get_specific_plugin_hook_output('Commenting', 'public_comments_show', array('view' => $this));
?>
    </div>
</aside>

<?php 
echo foot();
Ejemplo n.º 3
0
 /**
  * Action to uninstall a plugin
  *
  * @return void
  */
 public function uninstallAction()
 {
     if (!$this->getRequest()->isPost()) {
         return $this->_forward('method-not-allowed', 'error');
     }
     $this->_helper->redirector('index');
     $plugin = $this->_getPluginByName();
     if (!$plugin) {
         return;
     }
     // Check to see if the plugin exists and is installed.
     if (!$plugin->isInstalled()) {
         $this->_helper->flashMessenger(__("The plugin could not be found in the '%s' directory!", $plugin->getDirectoryName()), 'error');
         return;
     }
     $csrf = new Omeka_Form_SessionCsrf();
     // Confirm the uninstall.
     if (!$this->_getParam('confirm')) {
         if ($this->_getParam('uninstall-confirm')) {
             $this->_helper->flashMessenger(__("You must confirm the uninstall before proceeding."), 'error');
         }
         // Call the append to uninstall message hook for the specific
         // plugin, if it exists.
         $message = get_specific_plugin_hook_output($plugin, 'uninstall_message');
         $this->view->assign(compact('plugin', 'message', 'csrf'));
         // Cancel the redirect here.
         $this->getResponse()->clearHeader('Location')->setHttpResponseCode(200);
         $this->render('confirm-uninstall');
     } else {
         if (!$csrf->isValid($_POST)) {
             $this->_helper->_flashMessenger(__('There was an error on the form. Please try again.'), 'error');
             return;
         }
         // Attempt to uninstall the plugin.
         try {
             $this->_pluginInstaller->uninstall($plugin);
             $this->_helper->flashMessenger(__("The %s plugin was successfully uninstalled!", $plugin->getDirectoryName()), 'success');
         } catch (Omeka_Plugin_Installer_Exception $e) {
             $this->_helper->flashMessenger(__("The following error occurred while uninstalling the %s plugin: ", $plugin->getDirectoryName()) . $e->getMessage(), 'error');
         } catch (Omeka_Plugin_Loader_Exception $e) {
             $this->_helper->flashMessenger(__("The following error occurred while uninstalling the %s plugin: ", $plugin->getDirectoryName()) . $e->getMessage(), 'error');
         }
     }
 }
Ejemplo n.º 4
0
                <br>
								<br>
                <h6><span class="fa fa-pencil"></span> Citation</h6>
                <?php 
echo metadata('item', 'citation', array('no_escape' => true));
?>
                <hr>
                <?php 
echo get_specific_plugin_hook_output('Corrections', 'public_items_show', array('view' => $this, 'item' => $item));
?>
				<hr>
            </div>

        </div>
		<?php 
echo get_specific_plugin_hook_output('Geolocation', 'public_items_show', array('view' => $this, 'item' => $item));
?>
		<hr>
        <h6>Item data</h6>
        <p>Metadata for this item is available in the following formats:
        <?php 
echo output_format_list(false, ' | ');
?>
</p>
		<hr>
        <?php 
$url = current_url();
$pos = strpos($url, 'exhibits');
if (!$pos) {
    ?>
        <nav>
 /**
  * Handle the POST for adding an item via the public form.
  *
  * Validate and save the contribution to the database.  Save the ID of the
  * new item to the session.  Redirect to the consent form.
  *
  * If validation fails, render the Contribution form again with errors.
  *
  * @param array $post POST array
  * @return bool
  */
 protected function _processForm($post)
 {
     if (!empty($post)) {
         //for the "Simple" configuration, look for the user if exists by email. Log them in.
         //If not, create the user and log them in.
         $user = current_user();
         $simple = get_option('contribution_simple');
         if (!$user && $simple) {
             $user = $this->_helper->db->getTable('User')->findByEmail($post['contribution_simple_email']);
         }
         // if still not a user, need to create one based on the email address
         if (!$user) {
             $user = $this->_createNewGuestUser($post);
             if ($user->hasErrors()) {
                 $errors = $user->getErrors()->get();
                 //since we're creating the username with name, only show name errors
                 //unset($errors['name']);
                 unset($errors['username']);
                 foreach ($errors as $error) {
                     $this->_helper->flashMessenger($error, 'error');
                 }
                 return false;
             }
         }
         // The final form submit was not pressed.
         if (!isset($post['form-submit'])) {
             return false;
         }
         if (!$this->_validateContribution($post)) {
             return false;
         }
         $contributionTypeId = trim($post['contribution_type']);
         if ($contributionTypeId !== "" && is_numeric($contributionTypeId)) {
             $contributionType = get_db()->getTable('ContributionType')->find($contributionTypeId);
             $itemTypeId = $contributionType->getItemType()->id;
         } else {
             $this->_helper->flashMessenger(__('You must select a type for your contribution.'), 'error');
             return false;
         }
         /************************************************************
          *REVISIONS
          * Ver        Date       Author          Description
          * --------  ----------  --------------  ----------------------
          * 1.0       09/02/2015  mrs175          1. added check for form public box, and added plugin option which is currently unused
          ************************************************************/
         // the item is public if the contributedItemPublic plugin option (in hook beforeSaveItem in ContributionPlugin.php is set to true
         // and if the "Publish my contribution on the web" box is checked
         $itemMetadata = array('public' => get_option('contributedItemPublic') and $post['contribution-public'] === '1', 'featured' => false, 'item_type_id' => $itemTypeId, 'tags' => $post['contribution_form_tags']);
         $collectionId = get_option('contribution_collection_id');
         if (!empty($collectionId) && is_numeric($collectionId)) {
             $itemMetadata['collection_id'] = (int) $collectionId;
         }
         $fileMetadata = $this->_processFileUpload($contributionType);
         // This is a hack to allow the file upload job to succeed
         // even with the synchronous job dispatcher.
         if ($acl = get_acl()) {
             $acl->allow(null, 'Items', 'showNotPublic');
             $acl->allow(null, 'Collections', 'showNotPublic');
         }
         try {
             //in case we're doing Simple, create and save the Item so the owner is set, then update with the data
             $item = new Item();
             $item->setOwner($user);
             //$item->save();
             $item = update_item($item, $itemMetadata, array(), $fileMetadata);
         } catch (Omeka_Validator_Exception $e) {
             $this->flashValidatonErrors($e);
             return false;
         } catch (Omeka_File_Ingest_InvalidException $e) {
             // Copying this cruddy hack
             if (strstr($e->getMessage(), "'contributed_file'")) {
                 $this->_helper->flashMessenger("You must upload a file when making a {$contributionType->display_name} contribution.", 'error');
             } else {
                 $this->_helper->flashMessenger($e->getMessage());
             }
             return false;
         } catch (Exception $e) {
             $this->_helper->flashMessenger($e->getMessage());
             return false;
         }
         /************************************************************
          *REVISIONS
          * Ver        Date       Author          Description
          * --------  ----------  --------------  ----------------------
          * 1.0       09/02/2015  mrs175          1. user cannot submit anonymously, and added conditionals for youtube video contributions
          ************************************************************/
         $post['contribution-anonymous'] = '0';
         if ($contributionType->item_type_id == 3) {
             $this->_addElementTextsToItem($item, $post['Elements']);
             get_specific_plugin_hook_output('YouTubeImport', 'process_contribution_form', array('item' => $item));
         } else {
             $post['Elements'] = $_POST['Elements'];
             $this->_addElementTextsToItem($item, $post['Elements']);
             $item->save();
         }
         if (!isset($_POST['youtubeURLValid']) || 1 == intval(trim($_POST['youtubeURLValid']))) {
             //if not simple and the profile doesn't process, send back false for the error
             $this->_processUserProfile($post, $user);
             $this->_linkItemToContributedItem($item, $contributor, $post);
             //$this->_sendEmailNotifications($user, $item);
             return true;
         } else {
             $item->delete();
             $this->_helper->flashMessenger(__('Please check the youtube link you entered. If you have entered the correct link then this video is either not public or not viewable outside Youtube.com'), 'error');
             return false;
         }
     }
     return false;
 }