Skip to content

Commit

Permalink
overall cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
GaziYucel committed May 21, 2024
1 parent a2235b5 commit 69ad269
Show file tree
Hide file tree
Showing 13 changed files with 179 additions and 232 deletions.
98 changes: 31 additions & 67 deletions assets/css/backend.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,112 +9,79 @@
* @brief Backend stylesheet for the plugin.
*/

input[name="citationsStructured"] {
display: none;
}

#citationManager .pkpForm {
border: 0 !important;
#citationManager > div {
margin-bottom: 10px;
}

#citationManager .pkpFormGroup {
padding: 0 !important;
}

#citationManager .header table {
width: 100%;
#citationManager input[name="citationsStructured"] {
display: none;
}

.citationManager-ScrollableDiv {
#citationManager .content {
height: 500px;
overflow-x: hidden;
overflow-y: auto;
border: 1px solid #bbb;
margin-top: 5px;
}

.citationManager-ScrollableDivEmpty {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
}

.citationManager-ScrollableDivLoading {
height: 100%;
display: grid;
align-content: center;
#citationManager .content > span {
display: inline-block;
padding-top: 200px;
width: 100%;
text-align: center;
}

.citationManager-ScrollableDivLoading > .pkpSpinner {
}

.citationManager-ScrollableDivLoading > .pkpSpinner::before {
#citationManager .content > .pkpSpinner::before {
width: 100px;
height: 100px;
-webkit-animation-duration: .8s;
animation-duration: .8s;
}

.citationManager-ScrollableDivLoading img {
align-self: center;
margin: 0 auto;
}

.citationManager-ScrollableDivValue {
}

.citationManager-ScrollableDiv table {
#citationManager .content > table {
border-collapse: collapse;
width: 100%;
}

.citationManager-ScrollableDiv tr:nth-child(even) {
#citationManager .content > table tr:nth-child(even) {
background-color: #f6f6f6;
}

.citationManager-ScrollableDiv th {
background-color: #eee;
position: sticky;
position: -webkit-sticky;
top: 0;
z-index: 2;
}

.citationManager-ScrollableDiv-nr {
#citationManager .content .column-nr {
width: 2%;
text-align: center;
}

.citationManager-ScrollableDiv-parts .pkpButton {
#citationManager .content .column-parts .pkpButton {
line-height: 25px;
height: 25px;
}

.citationManager-ScrollableDiv-actions {
#citationManager .content .column-actions {
width: 6%;
text-align: center;
vertical-align: top;
}

.citationManager-ScrollableDiv-actions a {
#citationManager .content .column-actions a {
width: 34px;
height: 34px;
margin-top: 10px;
}

.citationManager-Row {
#citationManager .content table tr {
border-bottom: 1px solid #eee;
}

.citationManager-Row div {
#citationManager .content table tr td div {
line-height: 1.65rem;
}

.citationManager-RawText {
#citationManager .content .citationRaw {
font-size: 12px;
line-height: 14px;
padding: 3px 0;
padding: 5px;
border: 1px dotted #ccc;
}

Expand All @@ -124,18 +91,6 @@ input[name="citationsStructured"] {
line-height: 20px;
}

.citationManager-Input {
}

.citationManager-CitationsDebug {
width: 100%;
height: 100px;
background-color: #000;
color: #fff;
overflow-x: hidden;
overflow-y: auto;
}

.citationManager-Disabled {
pointer-events: none;
cursor: default;
Expand All @@ -149,3 +104,12 @@ input[name="citationsStructured"] {
.citationManager-AlignRight {
text-align: end !important;
}

/* OJS elements */
#citationManager .pkpFormGroup {
padding: 0;
}

#citationManager .header table {
width: 100%;
}
2 changes: 1 addition & 1 deletion classes/External/OpenAlex/Inbound.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function execute(): bool
$countCitations = count($citations);
for ($i = 0; $i < $countCitations; $i++) {
/* @var CitationModel $citation */
$citation = ClassHelper::getClassWithValuesAssigned(new CitationModel(), $citations[$i]);
$citation = ClassHelper::getClassWithValuesAssigned(new CitationModel(), (array)$citations[$i]);

if ($citation->isProcessed || empty($citation->doi) || !empty($citation->openAlexId))
continue;
Expand Down
4 changes: 2 additions & 2 deletions classes/External/OpenCitations/Outbound.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ private function getCitationsCsv(array $citations): string
foreach ($citations as $citationRow) {

/* @var CitationModel $citation */
$citation = ClassHelper::getClassWithValuesAssigned(new CitationModel(), $citationRow);
$citation = ClassHelper::getClassWithValuesAssigned(new CitationModel(), (array)$citationRow);
$workMetaData = new WorkMetaData();

if (!empty($citation->doi)) $workMetaData->id .= 'doi:' . Doi::removePrefix($citation->doi) . ' ';
Expand Down Expand Up @@ -264,7 +264,7 @@ private function getRelationsCsv(Publication $publication, Issue $issue, array $
foreach ($citations as $index => $citationRow) {

/* @var CitationModel $citation22 */
$citation = ClassHelper::getClassWithValuesAssigned(new CitationModel(), $citationRow);
$citation = ClassHelper::getClassWithValuesAssigned(new CitationModel(), (array)$citationRow);

$workCitingCited = new WorkCitingCited();

Expand Down
2 changes: 1 addition & 1 deletion classes/External/Orcid/Inbound.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function execute(): bool
continue;

/** @var CitationModel $citation */
$citation = ClassHelper::getClassWithValuesAssigned(new CitationModel(), $citations[$i]);
$citation = ClassHelper::getClassWithValuesAssigned(new CitationModel(), (array)$citations[$i]);

$countAuthors = count($citation->authors);
for ($j = 0; $j < $countAuthors; $j++) {
Expand Down
2 changes: 1 addition & 1 deletion classes/External/Wikidata/Inbound.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function execute(): bool
$countCitations = count($citations);
for ($i = 0; $i < $countCitations; $i++) {
/* @var CitationModel $citation */
$citation = ClassHelper::getClassWithValuesAssigned(new CitationModel(), $citations[$i]);
$citation = ClassHelper::getClassWithValuesAssigned(new CitationModel(), (array)$citations[$i]);

if (!empty($citation->wikidataId) || empty($citation->doi)) continue;

Expand Down
2 changes: 1 addition & 1 deletion classes/External/Wikidata/Outbound.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function execute(): bool
$countCitations = count($citations);
for ($i = 0; $i < $countCitations; $i++) {
/* @var CitationModel $citation */
$citation = Classhelper::getClassWithValuesAssigned(new CitationModel(), $citations[$i]);
$citation = Classhelper::getClassWithValuesAssigned(new CitationModel(), (array)$citations[$i]);

if ($citation->isProcessed && empty($citation->wikidataId))
$citation->wikidataId = $this->processCitedArticle($locale, $citation);
Expand Down
2 changes: 1 addition & 1 deletion locale/de/locale.po
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ msgstr "Löschen"
msgid "plugins.generic.citationManager.clear.question"
msgstr "Die strukturierten Zitationen werden entfernt, wenn Sie auf OK klicken. Sind Sie sich sicher?"

msgid "plugins.generic.citationManager.citations.empty.description"
msgid "plugins.generic.citationManager.citations.info.description"
msgstr "Es sind keine strukturierten Zitationen vorhanden. Bitte klicken Sie auf den oben stehenden "
"Button \"Verarbeiten\", um die Zitationen zu strukturieren und anzureichern."

Expand Down
2 changes: 1 addition & 1 deletion locale/en/locale.po
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ msgstr "Clear"
msgid "plugins.generic.citationManager.clear.question"
msgstr "The current parsed citations will be removed if you click OK. Are you sure?"

msgid "plugins.generic.citationManager.citations.empty.description"
msgid "plugins.generic.citationManager.citations.info.description"
msgstr "Parsed citations are empty. Please use the button above to parse and enrich the citations."

msgid "plugins.generic.citationManager.wizard.label"
Expand Down
2 changes: 1 addition & 1 deletion locale/es/locale.po
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ msgstr "Clear"
msgid "plugins.generic.citationManager.clear.question"
msgstr "The current parsed citations will be removed if you click OK. Are you sure?"

msgid "plugins.generic.citationManager.citations.empty.description"
msgid "plugins.generic.citationManager.citations.info.description"
msgstr "Parsed citations are empty. Please use the button above to parse and enrich the citations."

msgid "plugins.generic.citationManager.wizard.label"
Expand Down
2 changes: 1 addition & 1 deletion locale/fr/locale.po
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ msgstr "Clear"
msgid "plugins.generic.citationManager.clear.question"
msgstr "The current parsed citations will be removed if you click OK. Are you sure?"

msgid "plugins.generic.citationManager.citations.empty.description"
msgid "plugins.generic.citationManager.citations.info.description"
msgstr "Parsed citations are empty. Please use the button above to parse and enrich the citations."

msgid "plugins.generic.citationManager.wizard.label"
Expand Down
2 changes: 1 addition & 1 deletion locale/nl/locale.po
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ msgstr "Clear"
msgid "plugins.generic.citationManager.clear.question"
msgstr "The current parsed citations will be removed if you click OK. Are you sure?"

msgid "plugins.generic.citationManager.citations.empty.description"
msgid "plugins.generic.citationManager.citations.info.description"
msgstr "Parsed citations are empty. Please use the button above to parse and enrich the citations."

msgid "plugins.generic.citationManager.wizard.label"
Expand Down
2 changes: 1 addition & 1 deletion locale/tr/locale.po
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ msgstr "Clear"
msgid "plugins.generic.citationManager.clear.question"
msgstr "The current parsed citations will be removed if you click OK. Are you sure?"

msgid "plugins.generic.citationManager.citations.empty.description"
msgid "plugins.generic.citationManager.citations.info.description"
msgstr "Parsed citations are empty. Please use the button above to parse and enrich the citations."

msgid "plugins.generic.citationManager.wizard.label"
Expand Down
Loading

0 comments on commit 69ad269

Please sign in to comment.