Exemple #1
0
 public function output($action = "", $view = "public")
 {
     // public vs. admin
     parent::establishView($view);
     // Get librarians associated with this guide
     $querier = new Querier();
     $qs = "SELECT p.pluslet_id, p.title, p.body, ps.pcolumn, p.type, p.extra\n\t\t\t\tFROM pluslet p INNER JOIN pluslet_section ps\n\t\t\t\tON p.pluslet_id = ps.pluslet_id\n\t\t\t\tINNER JOIN section sec\n\t\t\t\tON ps.section_id = sec.section_id\n\t\t\t\tINNER JOIN tab t\n\t\t\t\tON sec.tab_id = t.tab_id\n\t\t\t\tINNER JOIN subject s\n\t\t\t\tON t.subject_id = s.subject_id\n\t\t\t\tWHERE s.subject_id = '{$this->_subject_id}'\n\t\t\t\tAND p.pluslet_id != '{$this->_pluslet_id}'\n\t\t\t\tORDER BY ps.prow ASC";
     //print $qs;
     $tocArray = $querier->query($qs);
     if ($tocArray) {
         $total_rows = count($tocArray);
         $num_per_row = ceil($total_rows / 3);
         $row_count = 1;
         foreach ($tocArray as $value) {
             if ($row_count == "1" or $row_count == 1 + $num_per_row or $row_count == 1 + $num_per_row + $num_per_row) {
                 $this->_body .= "<div class=\"toc\">";
             }
             $this->_body .= "<a href=\"#box-{$value['0']}\" class=\"smaller\" id=\"boxid-{$value['0']}\">{$value['1']}</a><br />\n";
             if ($row_count == $num_per_row or $row_count == $num_per_row * 2 or $row_count == $total_rows) {
                 $this->_body .= "</div>\n";
             }
             $row_count++;
         }
         $this->_body .= "";
     } else {
         $this->_body = _("There are no contents for this guide yet!");
     }
     parent::assemblePluslet();
     return $this->_pluslet;
 }
Exemple #2
0
 public function __construct($pluslet_id, $flag = "", $subject_id, $isclone = "")
 {
     parent::__construct($pluslet_id, $flag, $subject_id, $isclone = "");
     $this->db = new Querier();
     $this->_id = $pluslet_id;
     $this->_type = "Clone";
 }
Exemple #3
0
    public function output($action = "", $view = "public")
    {
        // public vs. admin
        parent::establishView($view);
        // example form action:  http://icarus.ithaca.edu/cgi-bin/Pwebrecon.cgi?
        $this->_body = '
            <form action="" method="get" name="querybox" id="querybox">
            <strong>Search for</strong>
            <input type="hidden" value="local" name="DB" />
            <input maxlength="800" size="25" name="Search_Arg" class="search_smaller" />
            <input type="hidden" value="all of these" name="BOOL1" />
            <strong>in </strong>
            <select name="Search_Code" class="search_smaller">
            <option value="CMD*">Keyword (use and/or)</option>
            <option value="FT*">Keyword Anywhere</option>
            <option value="TALL">Title (omit initial a, an, the)</option>

            <option value="JALL">Journal Title (omit initial a, an, the)</option>
            <option value="NAME_">Author (last name, first name)</option>
            <option value="AUTH_">Author/Composer (sorted by title)</option>
            <option value="SUBJ_">Subject (person, place, thing)</option>
            <option value="CALL_">Call Number</option>
            </select>
            <input type="hidden" value="1" name="HIST" />
            <input type="hidden" name="HIST" value="1" />
            <input name="SUBMIT" type="submit" value="Go!" class="search_smaller" />
            <input type="hidden" value="25" name="CNT" />
            </form>
            ';
        parent::assemblePluslet();
        return $this->_pluslet;
    }
Exemple #4
0
 public function __construct($pluslet_id, $flag = "", $subject_id, $isclone = 0)
 {
     parent::__construct($pluslet_id, $flag, $subject_id, $isclone);
     $this->_type = "Experts";
     $this->_pluslet_bonus_classes = "type-experts";
     $this->db = new Querier();
 }
Exemple #5
0
 public function output($action = "", $view = "public")
 {
     global $PublicPath;
     global $CpanelPath;
     // public vs. admin
     parent::establishView($view);
     // Get librarians associated with this guide
     $querier = new Querier();
     $qs = "SELECT f.faq_id, question, answer from faq f, faq_subject fs WHERE f.faq_id = fs.faq_id and fs.subject_id = " . $this->_subject_id . " ORDER BY question";
     //print $qs;
     $faqArray = $querier->query($qs);
     if ($faqArray) {
         $this->_body = "<ul>";
         foreach ($faqArray as $value) {
             $short_q = Truncate($value["question"], 150, '');
             $this->_body .= "<li><a target=\"_blank\" href=\"{$PublicPath}" . "faq.php?faq_id={$value['0']}\">{$short_q}</a></li>\n";
         }
         $this->_body .= "</ul>";
     } else {
         $this->_body = "<p class=\"faq-alert\">" . _("There are no FAQs linked for this guide") . "</p>";
         if ($view == "admin") {
             $this->_body = "<p class=\"faq-alert\">" . _("There are no FAQs linked for this guide") . "</p>\n                            <p><i class=\"fa fa-plus-square\"></i> <a href=\"../faq/faq.php?faq_id=&amp;wintype=pop\" class=\"showmedium-reloader\">" . _("Add New FAQ") . "</a></p>";
         }
     }
     parent::assemblePluslet();
     return $this->_pluslet;
 }
Exemple #6
0
 public function output($action = "", $view = "public")
 {
     global $title_input_size;
     // Public vs. Private
     parent::establishView($view);
     if ($action == "edit") {
         if ($this->_pluslet_id) {
             $this->_pluslet_id_field = "pluslet-" . $this->_pluslet_id;
             $this->_pluslet_name_field = "";
             $this->_title = "<input type=\"text\" class=\"required_field\" id=\"pluslet-update-title-{$this->_pluslet_id}\" value=\"{$this->_title}\" size=\"{$title_input_size}\" />";
         } else {
             $new_id = rand(10000, 100000);
             $this->_pluslet_bonus_classes = "unsortable";
             $this->_pluslet_id_field = $new_id;
             $this->_pluslet_name_field = "new-pluslet-Heading";
             $this->_title = "<input type=\"text\" class=\"required_field\" id=\"pluslet-new-title-{$new_id}\" name=\"new_pluslet_title\" value=\"{$this->_title}\" size=\"{$title_input_size}\" />";
         }
         global $title_input_size;
         // alter size based on column
         parent::startPluslet();
         print $this->_body;
         parent::finishPluslet();
         return;
     } else {
         parent::assemblePluslet();
         return $this->_pluslet;
     }
 }
 public function __construct($pluslet_id, $flag = "", $subject_id, $isclone = 0)
 {
     parent::__construct($pluslet_id, $flag, $subject_id, $isclone);
     $this->_subject_id = $subject_id;
     $this->_type = "CollectionList";
     $this->_pluslet_bonus_classes = "type-collectionlist";
     $this->db = new Querier();
 }
Exemple #8
0
 public function output($action = "", $view)
 {
     global $CKPath;
     global $CKBasePath;
     parent::establishView($view);
     if ($action == "edit") {
         // make an editable body and title type
         global $title_input_size;
         // alter size based on column
         //
         //////////////////////
         // New or Existing?
         //////////////////////
         if ($this->_pluslet_id) {
             $this->_pluslet_id_field = "pluslet-" . $this->_pluslet_id;
             $this->_pluslet_bonus_classes = "basic-pluslet";
             $this->_pluslet_name_field = "";
             $clean_title = addslashes(htmlentities($this->_title));
             $this->_title = "<input type=\"text\" class=\"edit-input\" id=\"pluslet-update-title-{$this->_pluslet_id}\" value=\"{$clean_title}\" size=\"{$title_input_size}\" />";
             $this_instance = "pluslet-update-body-{$this->_pluslet_id}";
         } else {
             $new_id = rand(10000, 100000);
             $this->_pluslet_bonus_classes = "unsortable basic-pluslet";
             $this->_pluslet_id_field = $new_id;
             $this->_pluslet_name_field = "new-pluslet-Basic";
             $this->_title = "<input type=\"text\" class=\"edit-input\" id=\"pluslet-new-title-{$new_id}\" name=\"new_pluslet_title\" value=\"{$this->_title}\" size=\"{$title_input_size}\" />";
             $this_instance = "pluslet-new-body-{$new_id}";
         }
         include $CKPath;
         global $BaseURL;
         $oCKeditor = new CKEditor($CKBasePath);
         $oCKeditor->timestamp = time();
         //$oCKeditor->config['ToolbarStartExpanded'] = true;
         $config['toolbar'] = 'SubsPlus_Narrow';
         $config['height'] = '300';
         $config['filebrowserUploadUrl'] = $BaseURL . "ckeditor/php/uploader.php";
         // Create and output object
         print parent::startPluslet();
         $this->_body = $oCKeditor->editor($this_instance, $this->_body, $config);
         print parent::finishPluslet();
         return;
     } else {
         // notitle hack
         if (!isset($this->_hide_titlebar)) {
             if (trim($this->_title) == "notitle") {
                 $this->_hide_titlebar = 1;
             } else {
                 $this->_hide_titlebar = 0;
             }
         }
         // Look for tokens, tokenize
         parent::tokenizeText();
         parent::assemblePluslet($this->_hide_titlebar);
         return $this->_pluslet;
     }
 }
 public function __construct($pluslet_id, $flag = "", $subject_id, $isclone = 0)
 {
     parent::__construct($pluslet_id, $flag, $subject_id, $isclone);
     $this->_type = "GuideEditorList";
     $this->_pluslet_id = $pluslet_id;
     $this->_subject_id = $subject_id;
     $this->_isclone = $isclone;
     global $tel_prefix;
     $this->tel_prefix = $tel_prefix;
 }
Exemple #10
0
 public function output($action = "", $view = "public")
 {
     global $title_input_size;
     // alter size based on column
     // Get pluslets associated with this
     $querier = new Querier();
     $qs = "SELECT p.pluslet_id AS id, p.title, p.body, ps.pcolumn, p.type, p.extra,t.tab_index AS parent_id, t.label AS name\n\t\t\tFROM pluslet p INNER JOIN pluslet_section ps\n\t\t\tON p.pluslet_id = ps.pluslet_id\n\t\t\tINNER JOIN section sec\n\t\t\tON ps.section_id = sec.section_id\n\t\t\tINNER JOIN tab t\n\t\t\tON sec.tab_id = t.tab_id\n\t\t\tINNER JOIN subject s\n\t\t\tON t.subject_id = s.subject_id\n\t\t\tWHERE s.subject_id = '{$this->_subject_id}'\n\t\t\tAND p.type != 'TOC'\n\t\t\tORDER BY t.tab_index, ps.pcolumn, ps.prow ASC";
     //print $qs;
     $this->_tocArray = $querier->query($qs);
     // public vs. admin
     parent::establishView($view);
     if ($this->_extra != "") {
         $jobj = json_decode($this->_extra);
         $this->_ticked_items = explode(',', $jobj->{'ticked'});
     }
     if ($action == "edit") {
         //////////////////////
         // New or Existing?
         //////////////////////
         if ($this->_pluslet_id) {
             $this->_current_id = $this->_pluslet_id;
             $this->_pluslet_bonus_classes = "type-toc ";
             $this->_pluslet_id_field = "pluslet-" . $this->_pluslet_id;
             $this->_pluslet_name_field = "";
             $this->_title = "<input type=\"text\" class=\"\" id=\"pluslet-update-title-{$this->_current_id}\" value=\"{$this->_title}\" size=\"{$title_input_size}\" />";
             $this_instance = "pluslet-update-body-{$this->_pluslet_id}";
         } else {
             $new_id = rand(10000, 100000);
             $this->_current_id = $new_id;
             $this->_pluslet_bonus_classes = "type-toc unsortable no_overflow";
             $this->_pluslet_id_field = $new_id;
             $this->_pluslet_name_field = "new-pluslet-TOC";
             $this->_title = "<input type=\"text\" class=\"\" id=\"pluslet-new-title-{$new_id}\" name=\"new_pluslet_title\" value=\"" . "Table of Contents" . "\" size=\"{$title_input_size}\" />";
             $this_instance = "pluslet-new-body-{$new_id}";
         }
         self::generateTOC($action);
         parent::startPluslet();
         print $this->_body;
         parent::finishPluslet();
         return;
     } else {
         // Note we hide the Feed parameters in the name field
         self::generateTOC($action);
         // notitle hack
         if (!isset($this->_hide_titlebar)) {
             if (trim($this->_title) == "notitle") {
                 $this->_hide_titlebar = 1;
             } else {
                 $this->_hide_titlebar = 0;
             }
         }
         parent::assemblePluslet($this->_hide_titlebar);
         return $this->_pluslet;
     }
 }
Exemple #11
0
 public function __construct($pluslet_id, $flag = "", $subject_id, $isclone = 0)
 {
     parent::__construct($pluslet_id, $flag, $subject_id, $isclone);
     $this->_subject_id = $subject_id;
     $this->_type = "Related";
     $this->_pluslet_bonus_classes = "type-relguide";
     $this->_isclone = $isclone;
     if (isset($pluslet_id)) {
         $this->_pluslet_id = $pluslet_id;
     }
     $this->db = new Querier();
 }
Exemple #12
0
 public function output($action = "", $view = "public")
 {
     global $IconPath;
     global $all_ctags;
     // public vs. admin
     parent::establishView($view);
     // Add restriction icon to beginning of array (if not present)
     if (!in_array("restricted", $all_ctags)) {
         array_unshift($all_ctags, "restricted");
     }
     // Output the icons via showIcons function
     $this->_body .= "<p class=\"smaller\" style=\"margin-left: 5px;\">";
     $this->_body .= showIcons($all_ctags, 1);
     $this->_body .= "</p>";
     parent::assemblePluslet();
     return $this->_pluslet;
 }
Exemple #13
0
 public function __construct($pluslet_id, $flag = "", $subject_id, $isclone = 0)
 {
     parent::__construct($pluslet_id, $flag, $subject_id, $isclone);
     $this->_type = "Card";
     $this->_pluslet_bonus_classes = "type-card";
     if ($this->_extra != "") {
         $this->_extra = json_decode($this->_extra, true);
     }
     $querier = new Querier();
     if ($this->_pluslet_id != '') {
         $qry = "SELECT title FROM pluslet WHERE pluslet_id = {$this->_pluslet_id}";
         $qry_result = $querier->query($qry);
         $this->_card_title = $qry_result;
     } else {
         $this->_card_title = "";
     }
 }
    public function output($action = "", $view = "public")
    {
        // public vs. admin
        parent::establishView($view);
        // example form action:  http://icarus.ithaca.edu/cgi-bin/Pwebrecon.cgi?
        $this->_body = '<div class="needs-js">JavaScript disabled or chat unavailable.</div>
<!-- Place this script as near to the end of your BODY as possible. -->
<script type="text/javascript">
  (function() {
    var x = document.createElement("script"); x.type = "text/javascript"; x.async = true;
    x.src = (document.location.protocol === "https:" ? "https://" : "http://") + "us.libraryh3lp.com/js/libraryh3lp.js?5452";
    var y = document.getElementsByTagName("script")[0]; y.parentNode.insertBefore(x, y);
  })();
</script>
            ';
        parent::assemblePluslet();
        return $this->_pluslet;
    }
 public function output($action = "", $view = "public")
 {
     // public vs. admin
     parent::establishView($view);
     // example form action:  http://icarus.ithaca.edu/cgi-bin/Pwebrecon.cgi?
     $this->_body = '
         <form action="http://walter.drew.edu/solr/keyword.php" method="get" name="querybox" id="querybox">
           <strong>Search Library Catalog:</strong><br>
         <input type="text" name="box1" size="25" value="" onchange="document.summon.q.value=document.walter.box1.value;document.worldcat.q.value=document.walter.box1.value;document.gScholar.q.value=document.walter.box1.value;">
         <input type="submit" value="Search">
         <input type="hidden" name="box1is" value="anywhere">
         <input type="hidden" name="pubYear" value="pubYear">
         <input type="hidden" name="whatitis" value="whatitis">
         <input type="hidden" name="whereitsat" value="whereitsat">
         </form>
         ';
     parent::assemblePluslet();
     return $this->_pluslet;
 }
Exemple #16
0
 public function output($action = "", $view = "public")
 {
     global $tel_prefix;
     // public vs. admin
     parent::establishView($view);
     // Get librarians associated with this guide
     $querier = new Querier();
     $qs = "SELECT lname, fname, email, tel, title from staff s, staff_subject ss WHERE s.staff_id = ss.staff_id and ss.subject_id = " . $this->_subject_id . " ORDER BY lname, fname";
     //print $qs;
     $staffArray = $querier->query($qs);
     foreach ($staffArray as $value) {
         // get username from email
         $truncated_email = explode("@", $value[2]);
         $staff_picture = $this->_relative_asset_path . "users/_" . $truncated_email[0] . "/headshot.jpg";
         // Output Picture and Contact Info
         $this->_body .= "\n        <div class=\"subjectSpecialistPlusletOld\">\n          <div class=\"staff-image\"><img src=\"{$staff_picture}\" alt=\"Picture: {$value['1']} {$value['0']}\"  class=\"staff_photo2\" /></div>\n          <div class=\"staff-content\"><p><a href=\"mailto:{$value['2']}\">{$value['1']} {$value['0']}</a><br />{$value['4']}<br />\n             Tel: {$tel_prefix} {$value['3']}</p></div>\n        </div>\n";
     }
     parent::assemblePluslet();
     return $this->_pluslet;
 }
 public function __construct($pluslet_id, $flag = "", $subject_id, $isclone = 0)
 {
     parent::__construct($pluslet_id, $flag, $subject_id, $isclone);
     $this->_type = "SubjectSpecialist";
     global $tel_prefix;
     $this->tel_prefix = $tel_prefix;
     $this->_subject_id = $subject_id;
     $this->_pluslet_id = $pluslet_id;
     //set title if exists
     global $default_subject_specialist_heading;
     if (isset($this->_title) && !empty($this->_title)) {
         $title = $this->_title;
     } else {
         $this->_title = $default_subject_specialist_heading;
     }
     // Get librarians associated with this guide
     $this->_editors = $this->getGuideEditors($this->_subject_id);
     $this->_data_array = json_decode($this->_extra, true);
     $this->_array_keys = array('Name', 'Photo', 'Title', 'Email', 'Phone', 'Facebook', 'Twitter', 'Pinterest', 'Instagram');
 }
Exemple #18
0
 public function output($action = "", $view = "public")
 {
     global $PublicPath;
     // public vs. admin
     parent::establishView($view);
     // Get librarians associated with this guide
     $querier = new Querier();
     $qs = "SELECT f.faq_id, question, answer from faq f, faq_subject fs WHERE f.faq_id = fs.faq_id and fs.subject_id = " . $this->_subject_id . " ORDER BY question";
     //print $qs;
     $faqArray = $querier->query($qs);
     if ($faqArray) {
         $this->_body = "<ul>";
         foreach ($faqArray as $value) {
             $short_q = Truncate($value[question], 150, '');
             $this->_body .= "<li><a target=\"_blank\" href=\"{$PublicPath}" . "faq.php?faq_id={$value['0']}\">{$short_q}</a></li>\n";
         }
         $this->_body .= "</ul>";
     } else {
         $this->_body = _("There are no FAQs linked for this guide");
     }
     parent::assemblePluslet();
     return $this->_pluslet;
 }
 public function __construct($pluslet_id, $flag = "", $subject_id, $isclone = 0)
 {
     parent::__construct($pluslet_id, $flag, $subject_id, $isclone);
     $this->_type = "ArticlesPlus";
     $this->_pluslet_bonus_classes = "type-articleplus";
 }
Exemple #20
0
 public function output($action = "", $view = "public")
 {
     // public vs. admin
     parent::establishView($view);
     if ($this->_extra != "") {
         $jobj = json_decode($this->_extra);
         $feed_type = $jobj->{'feed_type'};
         $num_items = $jobj->{'num_items'};
         $show_desc = $jobj->{'show_desc'};
         $show_feed = $jobj->{'show_feed'};
         if ($num_items == "") {
             $num_items = 5;
         }
         // need to pass something along
     } else {
         $feed_type = "";
         $num_items = 5;
         $show_desc = "";
         $show_feed = "";
     }
     if ($action == "edit") {
         global $title_input_size;
         // alter size based on column
         //////////////////////
         // New or Existing?
         //////////////////////
         if ($this->_pluslet_id) {
             $current_id = $this->_pluslet_id;
             $this->_pluslet_id_field = "pluslet-" . $this->_pluslet_id;
             $this->_pluslet_name_field = "";
             $this->_title = "<input type=\"text\" class=\"\" id=\"pluslet-update-title-{$this->_pluslet_id}\" value=\"{$this->_title}\" size=\"{$title_input_size}\" />";
             $this_instance = "pluslet-update-body-{$this->_pluslet_id}";
         } else {
             $new_id = rand(10000, 100000);
             $current_id = $new_id;
             $this->_pluslet_bonus_classes = "unsortable";
             $this->_pluslet_id_field = $new_id;
             $this->_pluslet_name_field = "new-pluslet-Feed";
             $this->_title = "<input type=\"text\" class=\"\" id=\"pluslet-new-title-{$new_id}\" name=\"new_pluslet_title\" value=\"{$this->_title}\" size=\"{$title_input_size}\" />";
             $this_instance = "pluslet-new-body-{$new_id}";
         }
         // some translations . . .
         $vYes = _("Yes");
         $vNo = _("No");
         $vRss1 = _("Display");
         $vRss2 = _("items<br />Show descriptions?");
         // Generate our dropdown
         $dd_name = "feed_type-{$current_id}";
         $dd_array = array("RSS", "Delicious", "Tumblr");
         $typeMe = new Dropdown($dd_name, $dd_array, $feed_type);
         $feed_type_dd = $typeMe->display();
         $this->_body = "<br /><input type=\"text\" name=\"{$this_instance}\" class=\"required_field\" value=\"{$this->_body}\" size=\"{$title_input_size}\" />\n            {$feed_type_dd}\n            <br />\n            " . _("You can enter a URL to an RSS feed or use your username for Delicious or Tumblr.");
         $this->_body .= "\n\n            <p style=\"font-size: 11px;padding-top: 3px;\">\n            {$vRss1} <input type=\"text\" name=\"displaynum-{$current_id}\" value=\"{$num_items}\" size=\"1\" />\n            {$vRss2} <input name=\"showdesc-{$current_id}\" type=\"radio\" value=\"1\"";
         if ($show_desc == 1) {
             $this->_body .= " checked=\"checked\"";
         }
         $this->_body .= "> {$vYes} <input name=\"showdesc-{$current_id}\" type=\"radio\" value=\"0\" ";
         if ($show_desc == 0) {
             $this->_body .= " checked=\"checked\"";
         }
         $this->_body .= " /> {$vNo}<br />\n    Show feed source? <input name=\"showfeed-{$current_id}\" type=\"radio\" value=\"1\"";
         if ($show_feed == 1) {
             $this->_body .= " checked=\"checked\"";
         }
         $this->_body .= "> {$vYes} <input name=\"showfeed-{$current_id}\" type=\"radio\" value=\"0\" ";
         if ($show_feed == 0) {
             $this->_body .= " checked=\"checked\"";
         }
         $this->_body .= " /> {$vNo}</p>\n<div>\n";
         parent::startPluslet();
         print $this->_body;
         parent::finishPluslet();
         return;
     } else {
         // Note we hide the Feed parameters in the name field
         $vRSSLoading = _("Loading ...");
         $feed = trim($this->_body);
         $this->_body = "<p class=\"find_feed\" name=\"{$feed}|{$num_items}|{$show_desc}|{$show_feed}|{$feed_type}\">{$vRSSLoading}</p>";
         // notitle hack
         if (!isset($this->_hide_titlebar)) {
             if (trim($this->_title) == "notitle") {
                 $this->_hide_titlebar = 1;
             } else {
                 $this->_hide_titlebar = 0;
             }
         }
         parent::assemblePluslet($this->_hide_titlebar);
         return $this->_pluslet;
     }
 }
Exemple #21
0
 public function __construct($pluslet_id, $flag = "", $subject_id, $isclone = 0)
 {
     parent::__construct($pluslet_id, $flag, $subject_id, $isclone);
     $this->_type = "Catalog";
     $this->_pluslet_bonus_classes = "type-catalog";
 }
 public function __construct($pluslet_id, $flag = "", $subject_id, $isclone = 0)
 {
     parent::__construct($pluslet_id, $flag, $subject_id, $isclone);
     $this->_type = "GoogleBooks";
     $this->_pluslet_bonus_classes = "type-googlebooks";
 }
 public function __construct($pluslet_id, $flag = "", $subject_id, $isclone = 0)
 {
     parent::__construct($pluslet_id, $flag, $subject_id, $isclone);
     $this->_type = "GuideSearch";
     $this->_pluslet_bonus_classes = "type-guidesearch";
 }
Exemple #24
0
 public function __construct($pluslet_id, $flag = "", $subject_id, $isclone = 0)
 {
     parent::__construct($pluslet_id, $flag, $subject_id, $isclone);
     $this->_type = "HTML5Video";
 }
Exemple #25
0
 public function output($action = "", $view = "public")
 {
     // public vs. admin
     parent::establishView($view);
     global $proxyURL;
     global $check_this;
     global $IconPath;
     global $all_ctags;
     $last_source_id = "";
     /////////////////////////
     // Create TOC
     /////////////////////////
     $TOC = self::createTOC();
     $this->_body = $TOC;
     $db = new Querier();
     // Display all items for a subject, as tagged in Records tab
     $q = "select title, description, location, source, source.source_id, restrictions, location.format,\n\t\trestrictions_id, title.title_id, location.access_restrictions, rank.subject_id,\n\t\trank.title_id, location.helpguide, display_note, ctags, description_override, call_number\n\t\tFROM title, restrictions, location, location_title, source, rank\n\t\tWHERE title.title_id = location_title.title_id and location.location_id = location_title.location_id\n\t\tAND restrictions_id = access_restrictions and rank.subject_id = '{$this->_subject_id}' and rank.title_id = title.title_id\n\t\tAND source.source_id = rank.source_id\n        ORDER BY source.rs asc, source.source, rank.rank asc, title.title, format";
     //print $q;
     $r = $db->query($q);
     // set up some row colours
     $row_count = 0;
     $colour1 = "oddrow";
     $colour2 = "evenrow";
     $results = "";
     // init
     foreach ($r as $myrow) {
         $label = $myrow["title"];
         $url = $myrow["location"];
         $restrictions = $myrow["restrictions_id"];
         $display_note = $myrow["display_note"];
         // Use description override if it exists
         if ($myrow["description_override"] != "") {
             $blurb = $myrow["description_override"];
         } else {
             $blurb = $myrow["description"];
         }
         if ($restrictions == 2 or $restrictions == 3) {
             // Check if it is restricted to local students
             $rest_icons = "restricted";
             $final_url = $proxyURL . $myrow[2];
             //$rest_icons = "<img src=\"$IconPath/lock.png\" width=\"16\" height=\"16\" border=\"0\" alt=\"Available to Students, Faculty and Staff\" title=\"Available to Students, Faculty and Staff\" /> ";
         } else {
             $rest_icons = "";
             $final_url = $myrow[2];
             //$rest_icons = "<img src=\"$IconPath/lock_unlock.png\" width=\"16\" height=\"16\" border=\"0\" alt=\"Unrestricted Resource\" title=\"Unrestricted Resource\" /> ";
         }
         // Generate our icons, comparing current ctags to the master list (in config.php)
         $pub_icons = "";
         $current_ctags = explode("|", $myrow["ctags"]);
         // add our $rest_icons info to this array at the beginning
         array_unshift($current_ctags, $rest_icons);
         $pub_icons = showIcons($current_ctags);
         //Check if there is a display note
         if ($display_note == NULL) {
             $display_note_text = "";
         } else {
             $display_note_text = "<strong>note: </strong>{$display_note}";
         }
         $row_colour = $row_count % 2 ? $colour1 : $colour2;
         // Do we need a subdivision header?
         $this_source_id = $myrow[4];
         if ($this_source_id != $last_source_id) {
             $results .= "<p class=\"leftcolheader\"><a name=\"{$myrow['4']}\"></a>{$myrow['3']}</p>\n\n";
             $last_source_id = $this_source_id;
             $res_class = "dbresults no-border";
         } else {
             $res_class = "dbresults";
         }
         // clean up blurb
         $blurb = stripslashes($blurb) . "<br />";
         // let's set our targets
         $target = targetBlanker();
         // Display results
         switch ($myrow["format"]) {
             case "1":
                 // web
                 $first_line = "<a style=\"text-decoration: underline\" href=\"{$final_url}\" {$target}>{$label}</a> {$pub_icons}<br />";
                 break;
             case "2":
                 // print
                 $first_line = "<em>{$label}</em><br /><strong>" . _("Print Location:") . "</strong> {$final_url} {$pub_icons}<br />";
                 if ($myrow["8"] == $last_title_id) {
                     $blurb = "";
                     $res_class = "dbresults-inset";
                 }
                 break;
             case "3":
                 // print with url
                 $first_line = "<em>{$label}</em><br /><strong>" . _("Print Location:") . "</strong>\n                    <a style=\"text-decoration: underline\" href=\"{$final_url}\" {$target}>" . $myrow["call_number"] . "</a> {$pub_icons}<br />";
                 if ($myrow["8"] == $last_title_id) {
                     $blurb = "";
                     $res_class = "dbresults-inset";
                 }
                 break;
         }
         $results .= "<div class=\"{$res_class}\">\n                {$first_line}\n                {$blurb}\n                {$display_note_text}\n            </div>";
         $last_title_id = $myrow["8"];
         $row_count++;
         // Add 1 to the row count, for the "even/odd" row striping
     }
     $this->_body .= $results;
     parent::assemblePluslet();
     return $this->_pluslet;
 }