Skip to content

Commit

Permalink
update friendly term for relations
Browse files Browse the repository at this point in the history
  • Loading branch information
Thom Mc committed Apr 20, 2015
1 parent 9062659 commit 3ed63a0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions ItemRelationsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ItemRelationsPlugin extends Omeka_Plugin_AbstractPlugin
'admin_navigation_main',
'api_resources',
);

public function filterApiResources($apiResources)
{
// For the resource URI: /api/your_resources/[:id]
Expand Down Expand Up @@ -71,16 +71,16 @@ public function filterApiResources($apiResources)
'record_type' => 'ItemRelationsVocabulary',
// List of actions available for your resource.
'actions' => array(
'index', // GET request without ID
'index', // GET request without ID
'get', // GET request with ID
'post', // POST request
'put', // PUT request (ID is required)
'delete', // DELETE request (ID is required)
),
),
// List of GET parameters available for your index action.
'index_params' => array('label', 'id', 'name', 'namespace_uri', 'namespace_prefix'),
);

//Added GET only for looking up properties, TODO Post and Put
$apiResources['item_relations_properties'] = array(
// Module associated with your resource.
Expand All @@ -99,7 +99,7 @@ public function filterApiResources($apiResources)
// List of GET parameters available for your index action.
'index_params' => array('label', 'id', 'vocabulary_id'),
);
/*
/*
//Added GET only
$apiResources['autocomplete_item'] = array(
// Module associated with your resource.
Expand Down Expand Up @@ -371,7 +371,7 @@ public function hookAdminItemsSearch()
'formSelectProperties' => get_table_options('ItemRelationsProperty'))
);
}

/**
* Save the item relations after saving an item add/edit form.
*
Expand Down
10 changes: 5 additions & 5 deletions models/ItemRelationsProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class ItemRelationsProperty extends Omeka_Record_AbstractRecord implements Zend_
* @var string
*/
public $friendly_part;

/**
* Human-readable name for the property.
* @var string
* @var string
*/
public $label;

Expand Down Expand Up @@ -66,7 +66,7 @@ public function getText()
&& $this->friendly_part
) {
$text = $this->friendly_part;

} else if ($hasLabel) {
$text = $this->label;
} else {
Expand All @@ -75,8 +75,8 @@ public function getText()

return $text;
}


/**
* Identify records as relating to their ACL resource.
*
Expand Down
4 changes: 2 additions & 2 deletions models/ItemRelationsRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ItemRelationsRelation extends Omeka_Record_AbstractRecord implements Zend
*/
public $object_item_id;
protected function _validate()
{
{
//echo "Validating";
if (empty($this->subject_item_id)) {
$this->addError('subject_item_id', __('Relation requires subject item ID.'));
Expand All @@ -57,7 +57,7 @@ public function getPropertyText()
}
/**
/* Identify ItemRelationsRelation records as relating to the ItemRelationsRelations ACL resource.
*
*
* @return string
*/
public function getResourceId()
Expand Down

0 comments on commit 3ed63a0

Please sign in to comment.