Skip to content

Commit

Permalink
cleanup unused code; refactoring (minor)
Browse files Browse the repository at this point in the history
  • Loading branch information
GaziYucel committed Mar 4, 2024
1 parent 560a4ce commit a25dc5e
Show file tree
Hide file tree
Showing 7 changed files with 145 additions and 232 deletions.
2 changes: 1 addition & 1 deletion CitationManagerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class CitationManagerPlugin extends GenericPlugin
/** @var string Key for structured citations saved in publications */
public const CITATION_MANAGER_CITATIONS_STRUCTURED = CITATION_MANAGER_PLUGIN_NAME . '_CitationsStructured';
/** @var string Key used for the form used in workflow and submission wizard */
public const CITATION_MANAGER_STRUCTURED_CITATIONS_FORM = CITATION_MANAGER_PLUGIN_NAME . '_StructuredCitationsForm';
public const CITATION_MANAGER_CITATIONS_STRUCTURED_FORM = CITATION_MANAGER_PLUGIN_NAME . '_CitationsStructuredFrom';
/** @var string Wikidata username */
public const CITATION_MANAGER_WIKIDATA_USERNAME = CITATION_MANAGER_PLUGIN_NAME . '_Wikidata_Username';
/** @var string Wikidata password */
Expand Down
8 changes: 1 addition & 7 deletions assets/css/backend.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,10 @@
* @brief Backend stylesheet for the plugin.
*/

input[name="CitationManagerPlugin_CitationsStructured"],
input[name="CitationManagerPlugin_MetadataJournal"],
input[name="CitationManagerPlugin_MetadataPublication"]{
input[name="CitationManagerPlugin_CitationsStructured"]{
display: none;
}

.citationManager-Outline {
border: 1px solid #ccc;
}

#citationManager .pkpForm {
border: 0 !important;
}
Expand Down
7 changes: 6 additions & 1 deletion assets/css/frontend.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,29 @@

.citationManager-Button {
display: inline-block;
color: #ffffff;
text-decoration: none;
padding: 0 .5em;
line-height: 20px;
font-weight: normal;
-webkit-box-shadow: unset;
box-shadow: unset;
}

.citationManager-Button span {
display: block;
}

.citationManager-ButtonGreen {
color: #ffffff;
background-color: #60a917;
}

.citationManager-ButtonGrey {
color: #ffffff;
background-color: #cccccc;
}

.citationManager-ButtonRed {
color: #ffffff;
background-color: #00ffff;
}
7 changes: 0 additions & 7 deletions classes/Db/PluginSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@ public function addToSchemaPublication(string $hookName, array $args): bool
'validation' => ['nullable']
];

$schema->properties->{CitationManagerPlugin::CITATION_MANAGER_METADATA_JOURNAL} = (object)[
'type' => 'string',
'multilingual' => false,
'apiSummary' => true,
'validation' => ['nullable']
];

return false;
}

Expand Down
16 changes: 0 additions & 16 deletions classes/Workflow/WorkflowForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,5 @@ public function __construct(string $id,
'isMultilingual' => false,
'value' => $pluginDao->getCitations($publicationId)
]));

$this->addField(new FieldText(
CitationManagerPlugin::CITATION_MANAGER_METADATA_PUBLICATION, [
'label' => '',
'description' => '',
'isMultilingual' => false,
'value' => $pluginDao->getMetadataPublication($publicationId)
]));

$this->addField(new FieldText(
CitationManagerPlugin::CITATION_MANAGER_METADATA_JOURNAL, [
'label' => '',
'description' => '',
'isMultilingual' => false,
'value' => $pluginDao->getMetadataJournal(Application::get()->getRequest()->getContext()->getId())
]));
}
}
4 changes: 2 additions & 2 deletions classes/Workflow/WorkflowTab.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ public function execute(string $hookName, array $args): void
array_keys($locales), $locales);

$form = new WorkflowForm(
CitationManagerPlugin::CITATION_MANAGER_STRUCTURED_CITATIONS_FORM,
CitationManagerPlugin::CITATION_MANAGER_CITATIONS_STRUCTURED_FORM,
'PUT',
$apiBaseUrl . 'submissions/' . $submissionId . '/publications/' . $publicationId,
$locales);

$state = $templateMgr->getTemplateVars('state');
$state['components'][CitationManagerPlugin::CITATION_MANAGER_STRUCTURED_CITATIONS_FORM] = $form->getConfig();
$state['components'][CitationManagerPlugin::CITATION_MANAGER_CITATIONS_STRUCTURED_FORM] = $form->getConfig();
$templateMgr->assign('state', $state);

$pluginDao = new PluginDAO();
Expand Down
Loading

0 comments on commit a25dc5e

Please sign in to comment.