Plugin Directory

Changeset 2464386


Ignore:
Timestamp:
01/28/2021 03:50:19 PM (5 years ago)
Author:
frier
Message:

2021-01-28 update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • books-papers/trunk/books-n-papers.php

    r2462202 r2464386  
    33Plugin Name: Books & Papers
    44Plugin URI:
    5 Version: 0.20210125
     5Version: 0.20210128
    66Author: Research in Theory of Magnetism Department of Taras Shevchenko National University of Kyiv
    77Author_URI: http://ritm.knu.ua/
     
    680680                $j_option_values = $j_option_values . "<option label=\"(Internal)\" value=\"$journal->journal\"></option>";
    681681            }
     682            $data = $wpdb->get_results("SELECT * FROM " . $this->dbTags . " ORDER BY tag ASC"); //queries tag data from db
     683            $t_option_values = ""; //presets datalist inner content
     684            foreach($data as $tag) //fills datalist inner content
     685            {
     686                $t_option_values = $t_option_values . "<option label=\'(Internal)\' value=\'$tag->tag\'></option>";
     687            }
    682688            $newAuthors = "<script>window.onload = function () { document.getElementById('bibInputs').innerHTML = 'Next Authors were added: "; //presets function that shows which new authors were imported
    683689        }catch (Exception $e) {}
     
    692698            } else
    693699            {
    694                 echo "<script>window.onload = function() { if(document.getElementById(\"loadAnimWrapper\")){ document.getElementById(\"loadAnimWrapper\").style = \"display:none;\"; }; document.getElementById('importDoiSubmit').innerHTML = '';document.getElementById('importDoiSubmit').style = 'display:none';document.getElementById('doiInputHide').innerHTML = '';document.getElementById('doiInputFields').innerHTML = '" . $this->bridge->handleDOIData($result, $j_option_values, $option_values) . "';doiFillDataFields();}</script>";
     700                echo "<script>window.onload = function() { if(document.getElementById(\"loadAnimWrapper\")){ document.getElementById(\"loadAnimWrapper\").style = \"display:none;\"; }; document.getElementById('importDoiSubmit').innerHTML = '';document.getElementById('importDoiSubmit').style = 'display:none';document.getElementById('doiInputHide').innerHTML = '';document.getElementById('doiInputFields').innerHTML = '" . $this->bridge->handleDOIData($result, $j_option_values, $t_option_values, $option_values) . "';doiFillDataFields();}</script>";
    695701            }
    696702        }
     
    728734                    { //relates every author with article
    729735                        $this->bridge->addArticleAuthor($this->bridge->checkAuthor(sanitize_text_field($_POST["author" . $k])), $art_id);
     736                    }
     737                }
     738                if(isset($_POST["tag"]))
     739                { //relates tags with article
     740                    $this->bridge->addArticleTag($this->bridge->checkTag(sanitize_text_field($_POST["tag"])), $art_id);
     741                }
     742                for($k = 0; $k <= 20; $k++)
     743                {
     744                    if(isset($_POST["tag" . $k]))
     745                    { //relates tags with article
     746                        print_r("tag found : " . $_POST["tag" . $k]);
     747                        print_r("    check : " . $this->bridge->checkTag(sanitize_text_field($_POST["tag" . $k])) . "   \n");
     748                        $this->bridge->addArticleTag($this->bridge->checkTag(sanitize_text_field($_POST["tag" . $k])), $art_id);
    730749                    }
    731750                }
Note: See TracChangeset for help on using the changeset viewer.