diff --git a/src/classes/api/endpoints/class-tainacan-rest-items-controller.php b/src/classes/api/endpoints/class-tainacan-rest-items-controller.php index be2cb4e40..1fb8abe6a 100644 --- a/src/classes/api/endpoints/class-tainacan-rest-items-controller.php +++ b/src/classes/api/endpoints/class-tainacan-rest-items-controller.php @@ -885,7 +885,7 @@ class REST_Items_Controller extends REST_Controller { } - private function submission_item_metadada ( \Tainacan\Entities\Item_Metadata_Entity &$item_metadata, $request) { + private function submission_item_metadata ( \Tainacan\Entities\Item_Metadata_Entity &$item_metadata, $request) { $collection_id = $item_metadata->get_item()->get_collection_id(); $item = $item_metadata->get_item(); $collection = $this->collections_repository->fetch($collection_id); @@ -1002,7 +1002,7 @@ class REST_Items_Controller extends REST_Controller { $metadatum_child = $this->metadatum_repository->fetch( $child['metadatum_id'] ); $item_metadata_child = new Entities\Item_Metadata_Entity($item, $metadatum_child, null, $parent_meta_id); $item_metadata_child->set_value($child_value); - $item_metadata_child = $this->submission_item_metadada($item_metadata_child, $request); + $item_metadata_child = $this->submission_item_metadata($item_metadata_child, $request); if ($item_metadata_child instanceof \WP_REST_Response) { return $item_metadata_child; } @@ -1024,7 +1024,7 @@ class REST_Items_Controller extends REST_Controller { $metadatum_child = $this->metadatum_repository->fetch( $child['metadatum_id'] ); $item_metadata_child = new Entities\Item_Metadata_Entity($item, $metadatum_child, null, $parent_meta_id); $item_metadata_child->set_value($child_value); - $item_metadata_child = $this->submission_item_metadada($item_metadata_child, $request); + $item_metadata_child = $this->submission_item_metadata($item_metadata_child, $request); if ($item_metadata_child instanceof \WP_REST_Response) { return $item_metadata_child; } @@ -1046,7 +1046,7 @@ class REST_Items_Controller extends REST_Controller { } else { $item_metadata->set_value( is_array($value) ? implode(' ', $value) : $value); } - $item_metadata = $this->submission_item_metadada($item_metadata, $request); + $item_metadata = $this->submission_item_metadata($item_metadata, $request); if ($item_metadata instanceof \WP_REST_Response) { return $item_metadata; } @@ -1061,7 +1061,7 @@ class REST_Items_Controller extends REST_Controller { } else { $item_metadata->set_value( is_array($value) ? implode(' ', $value) : $value); } - $item_metadata = $this->submission_item_metadada($item_metadata, $request); + $item_metadata = $this->submission_item_metadata($item_metadata, $request); if ($item_metadata instanceof \WP_REST_Response) { return $item_metadata; } diff --git a/src/classes/generic-background-process/class-tainacan-bulk-edit-process.php b/src/classes/generic-background-process/class-tainacan-bulk-edit-process.php index 5c8221ec0..a6bbcba2a 100644 --- a/src/classes/generic-background-process/class-tainacan-bulk-edit-process.php +++ b/src/classes/generic-background-process/class-tainacan-bulk-edit-process.php @@ -23,8 +23,8 @@ class Bulk_Edit_Process extends Generic_Process { $this->item_metadata_repository = \Tainacan\Repositories\Item_Metadata::get_instance(); $this->steps = [ [ - 'name' => __('Bulk edit control metadada', 'tainacan'), - 'progress_label' => __('Creating bulk edit control metadada', 'tainacan'), + 'name' => __('Bulk edit control metadata', 'tainacan'), + 'progress_label' => __('Creating bulk edit control metadata', 'tainacan'), 'callback' => 'add_control_metadata' ],[ 'name' => __('Bulk edit', 'tainacan'), @@ -310,7 +310,7 @@ class Bulk_Edit_Process extends Generic_Process { $unique = !$compoundItem->is_multiple(); $compoundValue = $compoundItem->get_value(); if ( $unique && !empty($compoundValue) ) { - $key = array_keys($compoundValue)[0]; // get the first metadata ID, if the argument metadata does not exist + $key = array_keys($compoundValue)[0]; // get the first metadata ID, if the argument metadata does not exist $parent_meta_id = $compoundValue[$key]->get_parent_meta_id(); return $parent_meta_id; } // elseif ((is_array($compoundValue) && sizeof($compoundValue) > 0)) @@ -359,10 +359,10 @@ class Bulk_Edit_Process extends Generic_Process { return $this->save_item_metadata($item_metadata, $item); } else { $metadatum_from = $this->metadatum_repository->fetch($metadatum_id_from); - if ( $metadatum_from->get_metadata_type() == $metadatum->get_metadata_type() && + if ( $metadatum_from->get_metadata_type() == $metadatum->get_metadata_type() && ( $metadatum_from->is_multiple() == false || $metadatum_from->is_multiple() == $metadatum->is_multiple() ) ) { $item_metadata_from = new Entities\Item_Metadata_Entity( $item, $metadatum_from ); - + $value = $item_metadata_from->get_value(); if ( $metadatum->get_metadata_type_object()->get_primitive_type() == 'term' ) { if ( $metadatum_from->is_multiple() ) { @@ -379,7 +379,7 @@ class Bulk_Edit_Process extends Generic_Process { return $this->save_item_metadata($item_metadata, $item); } } - + $this->add_error_log( __('Not possible to copy metadata values of different types', 'tainacan') ); return false; } @@ -445,7 +445,7 @@ class Bulk_Edit_Process extends Generic_Process { $metadatum = $item_metadata->get_metadatum(); if($metadatum->get_id() == $metadatum_id) { $values = is_array($item_metadata->get_value()) ? $item_metadata->get_value() : [$item_metadata->get_value()]; - + if ( $metadatum->get_metadata_type_object()->get_primitive_type() == 'term' ) { $new_term = is_string($new_value) ? $new_value : \Tainacan\Repositories\Terms::get_instance()->fetch($new_value, $metadatum->get_metadata_type_object()->get_taxonomy()); $values = array_map( function ($term) use ($old_value, $new_term) { @@ -453,7 +453,7 @@ class Bulk_Edit_Process extends Generic_Process { ($term == $old_value ? $new_term : $term) : ($term->get_id() == $old_value ? $new_term : $term); }, $values ); - + $item_metadata->set_value( $metadatum->is_multiple() ? $values : $new_term ); return $this->save_item_metadata($item_metadata, $item); } else { diff --git a/src/classes/importer/class-tainacan-importer-handler.php b/src/classes/importer/class-tainacan-importer-handler.php index 33767e069..555918c84 100644 --- a/src/classes/importer/class-tainacan-importer-handler.php +++ b/src/classes/importer/class-tainacan-importer-handler.php @@ -1,13 +1,13 @@ -bg_importer = new Background_Importer(); add_action('init', array(&$this, 'init')); @@ -23,7 +23,7 @@ class Importer_Handler { 'manual_collection' => true, 'manual_mapping' => true, ]); - + $this->register_importer([ 'name' => 'Test', 'description' => __('Create 2 test colletions with random items', 'tainacan'), @@ -61,8 +61,8 @@ class Importer_Handler { ]); $this->register_importer([ - 'name' => 'Youtube (Experimental)', - 'description' => __('Import items from an Youtube URL', 'tainacan'), + 'name' => 'YouTube (Experimental)', + 'description' => __('Import items from an YouTube URL', 'tainacan'), 'slug' => 'youtube_importer', 'class_name' => '\Tainacan\Importer\Youtube_Importer', 'manual_collection' => true, @@ -71,7 +71,7 @@ class Importer_Handler { $this->register_importer([ 'name' => 'Flickr (Experimental)', - 'description' => __('Import items from an Flickr URL', 'tainacan'), + 'description' => __('Import items from a Flickr URL', 'tainacan'), 'slug' => 'flickr_importer', 'class_name' => '\Tainacan\Importer\Flickr_Importer', 'manual_collection' => true, @@ -87,53 +87,53 @@ class Importer_Handler { global $TAINACAN_BASE_URL; wp_enqueue_script('import_term_csv_script', $TAINACAN_BASE_URL . '/classes/importer/term-importer/js/term.js', false, TAINACAN_VERSION, true); } - + function add_to_queue(\Tainacan\Importer\Importer $importer_object) { $data = $importer_object->_to_Array(true); $importer = $this->get_importer_by_object($importer_object); - + // Translators: The name of the importer process. E.g. CSV Importer, Legacy Tainacan Importer $importer_name = sprintf( __('%s Importer', 'tainacan'), $importer['name'] ); - + $bg_process = $this->bg_importer->data($data)->set_name($importer_name)->save(); if ( is_wp_error($bg_process->dispatch()) ) { return false; } return $bg_process; - + } /** * Register Importer - * - * - * + * + * + * * @param array $importer { * Required. Array or string of arguments describing the importer - * + * * @type string $name The name of the importer. e.g. 'Example Importer' * @type string $slug A unique slug for the importer. e.g. 'This is an example importer description' * @type string $description The importer description. e.g. 'example-importer' * @type string $class_name The Importer Class. e.g. '\Tainacan\Importer\Test_Importer' - * @type bool $manual_mapping Wether Tainacan must present the user with an interface to manually map + * @type bool $manual_mapping Wether Tainacan must present the user with an interface to manually map * the metadata from the source to the target collection. * - * If set to true, Importer Class must implement the method + * If set to true, Importer Class must implement the method * get_source_metadata() to return the metadatum found in the source. - * + * * Note that this will only work when importing items to one single collection. - * + * * @type bool $manual_collection Wether Tainacan will let the user choose a destination collection. * - * If set to true, the API endpoints will handle Collection creation and will assign it to + * If set to true, the API endpoints will handle Collection creation and will assign it to * the importer object using add_collection() method. - * - * Otherwise, the child importer class must create the collections and add them to the collections property also + * + * Otherwise, the child importer class must create the collections and add them to the collections property also * using add_collection() - * + * */ public function register_importer(array $importer) { - + $defaults = [ 'manual_mapping' => false, 'manual_collection' => true @@ -144,7 +144,7 @@ class Importer_Handler { if (!isset($attrs['slug']) || !isset($attrs['class_name']) || !isset($attrs['name'])) { return false; } - + $this->registered_importers[$importer['slug']] = $attrs; return true; @@ -185,7 +185,7 @@ class Importer_Handler { } return false; } - + /** * Save importer instance to the database * @param Tainacan\Importer\Importer $importer The Importer object @@ -194,7 +194,7 @@ class Importer_Handler { public function save_importer_instance(\Tainacan\Importer\Importer $importer) { update_option('tnc_transient_' . $importer->get_id(), $importer, false); } - + /** * Retrieves an Importer instance from the database based on its session_id * @param string $session_id The Importer ID @@ -204,7 +204,7 @@ class Importer_Handler { $importer = get_option('tnc_transient_' . $session_id); return $importer; } - + /** * Deletes this importer instance from the database * @param Tainacan\Importer\Importer $importer The Importer object @@ -213,8 +213,8 @@ class Importer_Handler { public function delete_importer_instance(\Tainacan\Importer\Importer $importer) { return delete_option('tnc_transient_' . $importer->get_id()); } - - + + } global $Tainacan_Importer_Handler; diff --git a/src/readme.txt b/src/readme.txt index 5089245ea..c4c3be2e9 100644 --- a/src/readme.txt +++ b/src/readme.txt @@ -10,81 +10,81 @@ License URI: http://www.gnu.org/licenses/gpl-3.0.html Tainacan is an open-source, powerful and flexible digital repository platform for WordPress. With all the tools of a professional repository platform, you can manage and publish your digital collections as easily as posting to your blog. It is versatile and can be used to create a digital collection, a digital library or a digital repository for your institutional or personal collection. - + == Description == - -[Tainacan](https://tainacan.org/) is an [open-source](https://github.com/tainacan/tainacan), powerful and flexible digital repository platform for WordPress. Manage and publish your digital collections just as easily as you post to your blog, having all the tools of a professional repository platform. It can be used for the creation of a digital collection, a digital library or a digital repository for your institutional or personal collection. + +[Tainacan](https://tainacan.org/) is an [open-source](https://github.com/tainacan/tainacan), powerful and flexible digital repository platform for WordPress. Manage and publish your digital collections just as easily as you post to your blog, having all the tools of a professional repository platform. It can be used for the creation of a digital collection, a digital library or a digital repository for your institutional or personal collection. Tainacan aims to facilitate the activities of organizing, documenting, disseminating and displaying digital objects based on simple and accessible principles of digital curation. The plugin integrates with the Wordpress block engine, making it easy to reuse objects for different and varied uses. - + = Features = - + * "Metadata and Filters": Use a metadata standard or choose whatever set of metadata you want to describe the items in your collections. Also, choose which metadata will be used as a filter when browsing collections. - + * "Faceted Search". Browse your collection (and let the public browse it) using a faceted search interface with the filters you have chosen. - + * "Manage Taxonomies": Manage vocabularies that can be used across all your collections. - + * "Themes": The Tainacan plugin has its own default theme, which helps you to showcase your collections in a beautiful and effective manner. But it can also work with any WordPress theme, so interface developers can easily add Tainacan specific features to an existing theme. - + * "API and Interoperability": Tainacan implements a RESTful API (read and write) to allow other applications to interact with your repository. That way, you can expose your collection in different formats, such as JSON, JsonLD, OAI-PMH and others. If your collection has a specific set of metadata, you can map this metadata to match the patterns you want to use. - + * "Gutenberg blocks": Tell stories with your collections. Tainacan offers you several Gutenberg blocks so you can present your collections to the public in many different ways! - + == Getting Started == - + After installation, you will see a new menu item in your admin panel called "Tainacan". Click on it to open the Tainacan admin interface. - + To get an overview of the main concepts of Tainacan, please visit [this page](https://tainacan.github.io/tainacan-wiki/#/general-concepts). - + = Create a collection = - + Click "New Collection" to create a new collection, use a mapping standard or import it using one of our importers. - + = Configure your collection = - + Navigate to the top menu to set your collection up. Create the metadata that items in this collection will have, and choose, from these metadata, which ones are going to be used as a filter. - + = Add items = - + Back to the "Items" screen, click "Add new" to create a new item. - + = Manage and browse your collection = - + Through this admin interface you can manage your collection and browse its item using the faceted search interface or advanced search interface. - + If you want to visit your collections in the public side of your site, using your current theme, visit http://your-site/collections and you will get the list of your collections. - + = Set up Taxonomies = - + You can also have metadata as taxonomies, which you can configure with a set of hierarchical terms of your own vocabulary. - + = Add links to your menu = - -Edit your menu and links directly to your collections. Click "Screen options" at the top of the Menu edition page and enable "Collections". - + +Edit your menu and links directly to your collections. Click "Screen options" at the top of the Edit Menu page and enable "Collections". + If you want to add a link to the list of collections, click "View all" tab on the Collections box on the left, and then add the first item named "Collections" to the menu. - + = Faceted search in your theme = - -To have a fully-featured faceted search in your theme, you can either make it compatible with a few templates or use our Faceted Search Block. - + +To have a fully-featured faceted search in your theme, you can either make it compatible with a few templates or use our Faceted Search Block. + == Installation == - + Upload the files to the plugins directory and activate it. You can also install and activate directly from the admin panel. - + If you have Imagick installed in your server, Tainacan will be able to automatically generate a thumbnail from your PDF files. This is desired but not required. - + == Find out more == - + * Visit our official website: [https://tainacan.org/](https://tainacan.org/) * Contribute to the source code: [https://github.com/tainacan/tainacan](https://github.com/tainacan/tainacan) * Check our documentation Wiki: [https://wiki.tainacan.org/](https://wiki.tainacan.org/) - + == Screenshots == - + 1. Manage your repository 2. Set up your collection 3. Choose the metadata and filters for your collection diff --git a/src/views/admin/components/edition/term-edition-form.vue b/src/views/admin/components/edition/term-edition-form.vue index e9dcbe655..67764ab6b 100644 --- a/src/views/admin/components/edition/term-edition-form.vue +++ b/src/views/admin/components/edition/term-edition-form.vue @@ -12,7 +12,7 @@ :is="isModal ? 'header' : 'div'" class="tainacan-page-title" :class="{ 'tainacan-modal-title': isModal }"> -