From 8264d3530034d02ca21116524360aeedf8a90b16 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Fri, 21 Feb 2020 13:34:22 -0300 Subject: [PATCH] Removes 'render' functions of the metadata type classes, as it is not used anymore. --- .../compound/class-tainacan-compound.php | 14 -------------- .../class-tainacan-core-description.php | 14 -------------- .../core-title/class-tainacan-core-title.php | 14 -------------- .../metadata-types/date/class-tainacan-date.php | 13 ------------- .../class-tainacan-metadata-type.php | 2 -- .../numeric/class-tainacan-numeric.php | 13 ------------- .../relationship/class-tainacan-relationship.php | 14 -------------- .../selectbox/class-tainacan-selectbox.php | 14 -------------- .../taxonomy/class-tainacan-taxonomy.php | 15 --------------- .../metadata-types/text/class-tainacan-text.php | 12 ------------ .../textarea/class-tainacan-textarea.php | 13 ------------- 11 files changed, 138 deletions(-) diff --git a/src/views/admin/components/metadata-types/compound/class-tainacan-compound.php b/src/views/admin/components/metadata-types/compound/class-tainacan-compound.php index 66a18f54c..91d478796 100644 --- a/src/views/admin/components/metadata-types/compound/class-tainacan-compound.php +++ b/src/views/admin/components/metadata-types/compound/class-tainacan-compound.php @@ -19,20 +19,6 @@ class Compound extends Metadata_Type { $this->set_component('tainacan-compound'); } - /** - * @param $itemMetadata \Tainacan\Entities\Item_Metadata_Entity The instace of the entity itemMetadata - * @return string - */ - - public function render( $itemMetadata ){ - return 'get_value() ).'\' - name="'.$itemMetadata->get_metadatum()->get_name().'">'; - } - /** * generate the metadata for this metadatum type */ diff --git a/src/views/admin/components/metadata-types/core-description/class-tainacan-core-description.php b/src/views/admin/components/metadata-types/core-description/class-tainacan-core-description.php index 8544d92a5..5d951be76 100644 --- a/src/views/admin/components/metadata-types/core-description/class-tainacan-core-description.php +++ b/src/views/admin/components/metadata-types/core-description/class-tainacan-core-description.php @@ -23,20 +23,6 @@ class Core_Description extends Metadata_Type { $this->set_description( __('The "Core Description" is a compulsory metadata automatically created for all collections by default. This is the main description displayed in items lists and where the basic research tools will do their searches.', 'tainacan') ); } - /** - * @param $itemMetadata \Tainacan\Entities\Item_Metadata_Entity The instace of the entity itemMetadata - * @return string - */ - - public function render( $itemMetadata ){ - return 'get_value() ).'\' - name="'.$itemMetadata->get_metadatum()->get_name().'">'; - } - /** * generate the metadata for this metadatum type */ diff --git a/src/views/admin/components/metadata-types/core-title/class-tainacan-core-title.php b/src/views/admin/components/metadata-types/core-title/class-tainacan-core-title.php index e0c2ba997..c313750d8 100644 --- a/src/views/admin/components/metadata-types/core-title/class-tainacan-core-title.php +++ b/src/views/admin/components/metadata-types/core-title/class-tainacan-core-title.php @@ -23,20 +23,6 @@ class Core_Title extends Metadata_Type { $this->set_description( __('The "Core Title" is a compulsory metadata automatically created for all collections by default. It is the main metadatum of the item and where the basic research tools will do their searches.', 'tainacan') ); } - /** - * @param $itemMetadata \Tainacan\Entities\Item_Metadata_Entity The instace of the entity itemMetadata - * @return string - */ - - public function render( $itemMetadata ){ - return 'get_value() ).'\' - name="'.$itemMetadata->get_metadatum()->get_name().'">'; - } - /** * generate the metadata for this metadatum type */ diff --git a/src/views/admin/components/metadata-types/date/class-tainacan-date.php b/src/views/admin/components/metadata-types/date/class-tainacan-date.php index 6946822b9..ca6642093 100644 --- a/src/views/admin/components/metadata-types/date/class-tainacan-date.php +++ b/src/views/admin/components/metadata-types/date/class-tainacan-date.php @@ -27,19 +27,6 @@ class Date extends Metadata_Type { '); } - /** - * @param $itemMetadata \Tainacan\Entities\Item_Metadata_Entity The instace of the entity itemMetadata - * @return string - */ - - public function render( $itemMetadata ){ - return 'get_value() ).'\' - name="'.$itemMetadata->get_metadatum()->get_name().'">'; - } - - public function validate( Item_Metadata_Entity $item_metadata) { $value = $item_metadata->get_value(); $format = 'Y-m-d'; diff --git a/src/views/admin/components/metadata-types/metadata-type/class-tainacan-metadata-type.php b/src/views/admin/components/metadata-types/metadata-type/class-tainacan-metadata-type.php index 9504cb511..17097283d 100644 --- a/src/views/admin/components/metadata-types/metadata-type/class-tainacan-metadata-type.php +++ b/src/views/admin/components/metadata-types/metadata-type/class-tainacan-metadata-type.php @@ -89,8 +89,6 @@ abstract class Metadata_Type { * @var string */ private $preview_template; - - abstract function render( $itemMetadata ); public function __construct(){ diff --git a/src/views/admin/components/metadata-types/numeric/class-tainacan-numeric.php b/src/views/admin/components/metadata-types/numeric/class-tainacan-numeric.php index 2112aa130..4ad0584e7 100644 --- a/src/views/admin/components/metadata-types/numeric/class-tainacan-numeric.php +++ b/src/views/admin/components/metadata-types/numeric/class-tainacan-numeric.php @@ -37,17 +37,4 @@ class Numeric extends Metadata_Type { ] ]; } - - /** - * @param $itemMetadata \Tainacan\Entities\Item_Metadata_Entity The instace of the entity itemMetadata - * @return string - */ - - public function render( $itemMetadata ){ - return 'get_value() ).'\' - name="'.$itemMetadata->get_metadatum()->get_name().'">'; - } } \ No newline at end of file diff --git a/src/views/admin/components/metadata-types/relationship/class-tainacan-relationship.php b/src/views/admin/components/metadata-types/relationship/class-tainacan-relationship.php index 698d5d88a..5e6498289 100644 --- a/src/views/admin/components/metadata-types/relationship/class-tainacan-relationship.php +++ b/src/views/admin/components/metadata-types/relationship/class-tainacan-relationship.php @@ -65,20 +65,6 @@ class Relationship extends Metadata_Type { ] ]; } - - /** - * @param $itemMetadata \Tainacan\Entities\Item_Metadata_Entity The instace of the entity itemMetadata - * @return string - */ - - public function render( $itemMetadata ){ - return 'get_value() ).'\' - name="'.$itemMetadata->get_metadatum()->get_name().'">'; - } public function validate_options(\Tainacan\Entities\Metadatum $metadatum) { if ( !in_array($metadatum->get_status(), apply_filters('tainacan-status-require-validation', ['publish','future','private'])) ) diff --git a/src/views/admin/components/metadata-types/selectbox/class-tainacan-selectbox.php b/src/views/admin/components/metadata-types/selectbox/class-tainacan-selectbox.php index 69bafe381..3c7e16548 100644 --- a/src/views/admin/components/metadata-types/selectbox/class-tainacan-selectbox.php +++ b/src/views/admin/components/metadata-types/selectbox/class-tainacan-selectbox.php @@ -41,20 +41,6 @@ class Selectbox extends Metadata_Type { ] ]; } - /** - * @param $itemMetadata \Tainacan\Entities\Item_Metadata_Entity The instace of the entity itemMetadata - * @return string - */ - - public function render( $itemMetadata ){ - $options = $this->get_option('options'); - return 'get_value() ).'\' - name="'.$itemMetadata->get_metadatum()->get_name().'">'; - } /** * @param \Tainacan\Entities\Metadatum $metadatum diff --git a/src/views/admin/components/metadata-types/taxonomy/class-tainacan-taxonomy.php b/src/views/admin/components/metadata-types/taxonomy/class-tainacan-taxonomy.php index cb2bec569..ad2501324 100644 --- a/src/views/admin/components/metadata-types/taxonomy/class-tainacan-taxonomy.php +++ b/src/views/admin/components/metadata-types/taxonomy/class-tainacan-taxonomy.php @@ -93,21 +93,6 @@ class Taxonomy extends Metadata_Type { ]; } - /** - * @param $itemMetadata Item_Metadata_Entity The instace of the entity itemMetadata - * @return string - */ - - public function render( $itemMetadata ){ - $options = ( isset( $this->get_options()['options'] ) ) ? $this->get_options()['options'] : ''; - return 'get_value() ).'\' - name="'.$itemMetadata->get_metadatum()->get_name().'">'; - } - public function validate_options( Metadatum $metadatum) { if ( !in_array($metadatum->get_status(), apply_filters('tainacan-status-require-validation', ['publish','future','private'])) ) diff --git a/src/views/admin/components/metadata-types/text/class-tainacan-text.php b/src/views/admin/components/metadata-types/text/class-tainacan-text.php index 552da64a7..9f577c15d 100644 --- a/src/views/admin/components/metadata-types/text/class-tainacan-text.php +++ b/src/views/admin/components/metadata-types/text/class-tainacan-text.php @@ -25,18 +25,6 @@ class Text extends Metadata_Type { '); } - - /** - * @param $itemMetadata \Tainacan\Entities\Item_Metadata_Entity The instace of the entity itemMetadata - * @return string - */ - - public function render( $itemMetadata ){ - return 'get_value() ).'\' - name="'.$itemMetadata->get_metadatum()->get_name().'">'; - } /** * Get the value as a HTML string with links diff --git a/src/views/admin/components/metadata-types/textarea/class-tainacan-textarea.php b/src/views/admin/components/metadata-types/textarea/class-tainacan-textarea.php index a71d7f549..40b3590fb 100644 --- a/src/views/admin/components/metadata-types/textarea/class-tainacan-textarea.php +++ b/src/views/admin/components/metadata-types/textarea/class-tainacan-textarea.php @@ -26,19 +26,6 @@ class Textarea extends Metadata_Type { '); } - - /** - * @param $itemMetadata \Tainacan\Entities\Item_Metadata_Entity The instace of the entity itemMetadata - * @return string - */ - - public function render( $itemMetadata ) { - return 'get_value() ).'\' - name="'.$itemMetadata->get_metadatum()->get_name().'">'; - } public function get_multivalue_prefix() { return '

';