From 5e94b72a78469f66869bee967ac67b718702af5c Mon Sep 17 00:00:00 2001 From: John Eismeier Date: Mon, 8 Oct 2018 04:41:14 -0400 Subject: [PATCH] fix some typos --- source/Reference/api/extending.rst | 22 +++++++++---------- source/Reference/api/requests.rst | 6 ++--- .../libraries/Omeka/Test/Helper/Plugin.rst | 2 +- source/Tutorials/representativeFiles.rst | 2 +- source/Tutorials/understandingFilters.rst | 2 +- .../Tutorials/understandingFormElements.rst | 14 ++++++------ 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/source/Reference/api/extending.rst b/source/Reference/api/extending.rst index 2c0d086d..da518253 100644 --- a/source/Reference/api/extending.rst +++ b/source/Reference/api/extending.rst @@ -21,7 +21,7 @@ well. In your plugin class, register your resource using the // For the resource URI: /api/your_resources/[:id] $apiResources['your_resources'] = array( // Module associated with your resource. - 'module' => 'your-plugin-name', + 'module' => 'your-plugin-name', // Controller associated with your resource. 'controller' => 'your-resource-controller', // Type of record associated with your resource. @@ -33,9 +33,9 @@ well. In your plugin class, register your resource using the '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('foo', 'bar'), + 'index_params' => array('foo', 'bar'), ); return $apiResources; } @@ -73,13 +73,13 @@ YourPlugin/models/Api/YourRecordType.php: { // Return a PHP array, representing the passed record. } - + // Set data to a record during a POST request. public function setPostData(Omeka_Record_AbstractRecord $record, $data) { // Set properties directly to a new record. } - + // Set data to a record during a PUT request. public function setPutData(Omeka_Record_AbstractRecord $record, $data) { @@ -144,7 +144,7 @@ should protect unauthorized API users from viewing non-public records: { $select = parent::getSelect(); $permissions = new Omeka_Db_Select_PublicPermissions('YourPlugin_YourRecords'); - // Where "your_records" is the table alias, "owner_column" is the user column to check against, + // Where "your_records" is the table alias, "owner_column" is the user column to check against, // and "public_column" is the permissions column to check against. $permissions->apply($select, 'your_records', 'owner_column', 'public_column'); return $select; @@ -165,7 +165,7 @@ You can extend the representations of existing resources by using the public function filterApiExtendItems($extend, $args) { $item = $args['record']; - + // For one resource: $resourceId = $this->_db->getTable('YourResource')->findByItemId($item->id); $extend['your_resources'] = array( @@ -173,14 +173,14 @@ You can extend the representations of existing resources by using the 'url' => Omeka_Record_Api_AbstractRecordAdapter::getResourceUrl("/your_resources/{$resourceId->id}"), 'resource' => 'your_resources', ); - + // Or, for multiple resources: $extend['your_resources'] = array( 'count' => 10, 'url' => Omeka_Record_Api_AbstractRecordAdapter::getResourceUrl("/your_resources?item={$item->id}"), 'resource' => 'your_resources', ); - + return $extend; } @@ -188,7 +188,7 @@ Note that the API enforces a pattern when extending a resource: - ``id`` and ``url`` for a one-to-one relationship - ``count`` and ``url`` for a one-to-many relationship -- ``resource`` is recommeded but not required +- ``resource`` is recommended but not required -All other keys pass through as custom data that may be used for the client's +All other keys pass through as custom data that may be used for the client's convenience. diff --git a/source/Reference/api/requests.rst b/source/Reference/api/requests.rst index 11f39876..1f27b902 100644 --- a/source/Reference/api/requests.rst +++ b/source/Reference/api/requests.rst @@ -12,7 +12,7 @@ Endpoint URL Pagination ---------- -For index requests using the defualt controller, pagination is set in +For index requests using the default controller, pagination is set in the response's ``Link`` header: :: @@ -37,8 +37,8 @@ is essentially identical to a ``GET`` response of the same resource. This makes it possible to, for example, ``GET`` an item, modify the representation directly and ``POST`` or ``PUT`` it back to Omeka. -Some servers do not accept ``PUT`` or ``DELETE`` requests. For compatibility -we've added support for the ``X-HTTP-Method-Override`` header, which you can use +Some servers do not accept ``PUT`` or ``DELETE`` requests. For compatibility +we've added support for the ``X-HTTP-Method-Override`` header, which you can use to declare an unsupported HTTP method. :: diff --git a/source/Reference/libraries/Omeka/Test/Helper/Plugin.rst b/source/Reference/libraries/Omeka/Test/Helper/Plugin.rst index 8a3a9326..87f65be9 100644 --- a/source/Reference/libraries/Omeka/Test/Helper/Plugin.rst +++ b/source/Reference/libraries/Omeka/Test/Helper/Plugin.rst @@ -79,7 +79,7 @@ Package: :doc:`Test\\Helper ` Lazy-loading for helper properties. When a property is not set, attempts to load a default through standard - Omeka global state. If this state is unavailable or undesireable, + Omeka global state. If this state is unavailable or undesirable, use the set*() methods before calling any of the other public methods of this class. diff --git a/source/Tutorials/representativeFiles.rst b/source/Tutorials/representativeFiles.rst index 59eb28ed..b5d3465c 100644 --- a/source/Tutorials/representativeFiles.rst +++ b/source/Tutorials/representativeFiles.rst @@ -15,7 +15,7 @@ functionality that depends on File records by choosing a "representative" file. Omeka uses this functionality in the views for some records like Collections and Files, and also in the search results page. -Themes and plugins can use a new helper funtion to display thumbnails for +Themes and plugins can use a new helper function to display thumbnails for records with representative files, and plugins can also select and expose representatives for their own records. diff --git a/source/Tutorials/understandingFilters.rst b/source/Tutorials/understandingFilters.rst index 3f5c88c8..aa592f4a 100644 --- a/source/Tutorials/understandingFilters.rst +++ b/source/Tutorials/understandingFilters.rst @@ -15,7 +15,7 @@ Filter Basics Filters work similarly to hooks, but are focused on modifying data rather than simply executing code or producing output in some particular place. -Filter functions always recieve two parameters. +Filter functions always receive two parameters. The first parameter is always the value being filtered. The documentation page for a filter will describe this parameter under the heading "Value." diff --git a/source/Tutorials/understandingFormElements.rst b/source/Tutorials/understandingFormElements.rst index 9d9ad036..d7123562 100644 --- a/source/Tutorials/understandingFormElements.rst +++ b/source/Tutorials/understandingFormElements.rst @@ -11,16 +11,16 @@ The basic structure is to use the ``addElement()`` method, with three parameters ``string`` $element A string name for the form element. Typical examples are: button, captcha, checkbox, file, multicheckbox, multiselect, radio, select, submit, text, textarea. - + An element object can also be passed in here. In this (rare) case, the other two parameters are usually unnecessary ``string`` $name The name attribute for the form element - + ``array`` $options Additional options for the form element. ``label``, ``description``, and ``required`` are the most common options. HTML attributes such as ``rows`` and ``cols`` can also appear here, as well as ``class`` - - In more complex examples, an array of ``validators`` can also be passed here + + In more complex examples, an array of ``validators`` can also be passed here ******** Examples @@ -33,11 +33,11 @@ Examples 'description' => __('My record description'), 'rows' => 10 )); - + $form->addElement('text', 'user_email', array( 'label' => __('Email'), - 'description' => __("Prefered email address of the person submitting the record"), - 'validators' => array('EmailAddress'), + 'description' => __("Preferred email address of the person submitting the record"), + 'validators' => array('EmailAddress'), 'required' => true ));