Example #1
1
 public function outputForm($wintype = "")
 {
     global $wysiwyg_desc;
     global $CKPath;
     global $CKBasePath;
     global $IconPath;
     global $PublicPath;
     global $guide_types;
     $action = htmlentities($_SERVER['PHP_SELF']) . "?faq_id=" . $this->_faq_id;
     if ($wintype != "") {
         $action .= "&wintype=pop";
     }
     $faq_title_line = _("Edit FAQ") . " <span class=\"smallgrey\">{$this->_faq_id}</span>\n        <div style=\"float: right; margin-left: 2em;font-size: 12px;\"><a href=\"" . $PublicPath . "faq.php?faq_id={$this->_faq_id}\" target=\"_blank\">" . _("see live") . "</a></div>";
     echo "\n<form action=\"" . $action . "\" method=\"post\" id=\"new_record\" class=\"pure-form pure-form-stacked\" accept-charset=\"UTF-8\">\n<input type=\"hidden\" name=\"faq_id\" value=\"" . $this->_faq_id . "\" />\n<div class=\"pure-g\">\n  <div class=\"pure-u-2-3\">\n    <div class=\"pluslet\">\n      <div class=\"titlebar\">\n        <div class=\"titlebar_text\">{$faq_title_line}</div>\n        <div class=\"titlebar_options\"></div>\n      </div>\n      <div class=\"pluslet_body\">\n\n<label for=\"question\">" . _("Question") . "</label>\n<textarea name=\"question\" rows=\"4\" cols=\"50\" class=\"required_field\">" . stripslashes($this->_question) . "</textarea>\n\n<label for=\"answer\">" . _("Answer") . "</label>";
     if ($wysiwyg_desc == 1) {
         include $CKPath;
         global $BaseURL;
         // Create and output object
         $oCKeditor = new CKEditor($CKBasePath);
         $oCKeditor->timestamp = time();
         $config['toolbar'] = 'SubsPlus_Narrow';
         // Default shows a much larger set of toolbar options
         $config['filebrowserUploadUrl'] = $BaseURL . "ckeditor/php/uploader.php";
         echo $oCKeditor->editor('answer', $this->_answer, $config);
     } else {
         echo "<textarea name=\"answer\" rows=\"4\" cols=\"70\">" . stripslashes($this->_answer) . "</textarea>";
     }
     echo "\n<label for=\"keywords\">" . _("Keywords (comma separated please)") . "</label>\n<input type=\"text\" name=\"keywords\"  size=\"40\" value=\"" . $this->_keywords . "\" />\n</div>\n</div>\n</div>\n<!-- right hand column -->    ";
     $last_mod = _("Last modified: ") . lastModded("faq", $this->_faq_id);
     $title_save_box = "<div id=\"last_edited\">{$last_mod}</div>";
     echo "<div class=\"pure-u-1-3\">\n    <div class=\"pluslet\">\n      <div class=\"titlebar\">\n        <div class=\"titlebar_text\">{$title_save_box}</div>\n        <div class=\"titlebar_options\"></div>\n      </div>\n      <div class=\"pluslet_body\">\n\t\t<input type=\"submit\" name=\"submit_record\" class=\"button pure-button pure-button-primary save-button\" value=\"" . _("Save Now") . "\" />";
     // if a) it's not a new record, and  b) we're an admin or c) we are listed as a librarian for this guide, show delete button
     if ($this->_faq_id != "") {
         if (isset($_SESSION["admin"]) && $_SESSION["admin"] == "1") {
             echo "<input type=\"submit\" name=\"delete_record\" class=\"button pure-button pure-button-warning delete-button\" value=\"" . _("Delete Forever!") . "\" />";
         } else {
             echo "<input type=\"submit\" name=\"recommend_delete\" class=\"button pure-button pure-button-warning\" value=\"" . _("Recommend Delete") . "\" />";
         }
     }
     echo "</div></div>";
     /////////////////
     // Collections
     /////////////////
     // All collections in array
     $querier4 = new Querier();
     $q4 = "SELECT faqpage_id, name FROM faqpage ORDER BY name";
     $this->_all_collections = $querier4->query($q4);
     $collection_list = "";
     if ($this->_collections == FALSE) {
         // No results
         $collection_list = "";
     } else {
         // loop through results
         foreach ($this->_collections as $value) {
             $collection_list .= self::outputCollection($value);
         }
     }
     $collection_string = "";
     //get our string
     if ($this->_all_collections) {
         foreach ($this->_all_collections as $value) {
             $collection_string .= "<option value=\"{$value['0']}\">{$value['1']}</option>";
         }
     } else {
         $collection_string = "";
     }
     /////////////////
     // Subjects
     /////////////////
     $subject_list = "";
     if ($this->_subjects == FALSE) {
         // No results
         $subject_list = "";
     } else {
         // loop through results
         foreach ($this->_subjects as $value) {
             $subject_list .= self::outputSubject($value);
         }
     }
     $subject_string = getSubBoxes('', 50);
     echo "\n    <div class=\"pluslet\">\n      <div class=\"titlebar\">\n        <div class=\"titlebar_text\">" . _("Relevant Subjects") . "</div>\n        <div class=\"titlebar_options\"></div>\n      </div>\n      <div class=\"pluslet_body\">\n\n        <select name=\"subject_id[]\"><option value=\"\">-- " . _("Select") . " --</option>\n            {$subject_string}\n        </select>\n\t     <div id=\"subject_list\">{$subject_list}</div> <!-- subjects inserted here -->\n       <br />\n        </div></div>\n\n    <div class=\"pluslet\">\n      <div class=\"titlebar\">\n        <div class=\"titlebar_text\">" . _("Relevant Collections") . "</div>\n        <div class=\"titlebar_options\"></div>\n      </div>\n      <div class=\"pluslet_body\">\n\n        <select name=\"collection_id[]\"><option value=\"\">-- " . _("Select") . " --</option>\n            {$collection_string}\n        </select>\n        <div id=\"collection_list\">{$collection_list}</div> <!-- subjects inserted here -->\n        <br />\n    </div></div>\n    </form>";
 }
Example #2
0
 public function outputForm($wintype = "")
 {
     global $wysiwyg_desc;
     global $CKPath;
     global $CKBasePath;
     global $IconPath;
     $action = htmlentities($_SERVER['PHP_SELF']) . "?record_id=" . $this->_record_id;
     if ($wintype != "") {
         $action .= "&wintype=pop";
     }
     // set up
     print "<div class=\"pure-g\">";
     echo "\n  \t<form action=\"" . $action . "\" method=\"post\" id=\"new_record\" accept-charset=\"UTF-8\" class=\"pure-form pure-form-stacked\">\n  \t<input type=\"hidden\" name=\"title_id\" value=\"" . $this->_record_id . "\" />\n  \t<div class=\"pure-u-1-3\">\n  \t<div class=\"pluslet\">\n    <div class=\"titlebar\">\n      <div class=\"titlebar_text\">" . _("Record") . "</div>\n      <div class=\"titlebar_options\"></div>\n    </div>\n    <div class=\"pluslet_body\">\n        <label for=\"prefix\">" . _("Prefix") . "</label>\n      \t<input type=\"text\" name=\"prefix\" id=\"prefix\" class=\"pure-input-1-4\" value=\"" . $this->_prefix . "\" />\n\n        <label for=\"record_title\">" . _("Record Title") . "</label>\n        <input type=\"text\" name=\"title\" id=\"record_title\" class=\"pure-input-1 required_field\" value=\"" . $this->_title . "\" />\n\n  \t<label for=\"alternate_record_title\">" . _("Alternate Title") . "</label>\n  \t<input type=\"text\" name=\"alternate_title\" id=\"alternate_record_title\" class=\"pure-input-1\" value=\"" . $this->_alternate_title . "\" />\n\n  \t<label for=\"description\">" . _("Description") . "</label>\n\n  \t";
     if ($wysiwyg_desc == 1) {
         include $CKPath;
         global $BaseURL;
         // Create and output object
         $oCKeditor = new CKEditor($CKBasePath);
         $oCKeditor->timestamp = time();
         $config['toolbar'] = 'Basic';
         // Default shows a much larger set of toolbar options
         $config['filebrowserUploadUrl'] = $BaseURL . "ckeditor/php/uploader.php";
         $oCKeditor->editor('description', $this->_description, $config);
         echo "<br />";
     } else {
         echo "<textarea name=\"description\" id=\"description\" rows=\"4\" cols=\"70\">" . stripslashes($this->_description) . "</textarea>";
     }
     echo "</div></div>";
     // end pluslet_body, end pluslet
     print "</div>";
     // end 1/3 grid
     print "<div class=\"pure-u-1-3\">";
     // Loop through locations
     self::buildLocation();
     $add_loc = "<div class=\"add_location\"><button src=\"{$IconPath}/list-add.png\" alt=\"add new location\"  class=\"pure-button pure-button-success\" border=\"0\" /> Add another location</div>";
     print $add_loc;
     echo "</div>\n\t<!-- right hand column -->";
     print "<div class=\"pure-u-1-3\">";
     $content = "\n\t<input type=\"submit\" name=\"submit_record\" class=\"pure-button pure-button-primary\" value=\"" . _("Save Record Now") . "\" />";
     // if it's not a new record, and we're authorized, show delete button
     if ($this->_record_id != "") {
         if (isset($_SESSION["eresource_mgr"]) && $_SESSION["eresource_mgr"] == "1") {
             $content .= " <input type=\"submit\" name=\"delete_record\" class=\"pure-button delete_button pure-button-warning\" value=\"" . _("Delete Forever!") . "\" />";
         } else {
             $content .= " <input type=\"submit\" name=\"recommend_delete\" class=\"pure-button pure-button-warning\" value=\"" . _("Recommend Delete") . "\" />";
         }
     }
     // get edit history
     $last_mod = _("Last modified: ") . lastModded("record", $this->_record_id);
     $title = "<div id=\"last_edited\">{$last_mod}</div>";
     makePluslet($title, $content, "no_overflow");
     /////////////////
     // Default Source
     /////////////////
     $source_icon = $IconPath . "/usb_on-26.png";
     $querierSource = new Querier();
     $qSource = "select source_id, source from source order by source";
     $defsourceArray = $querierSource->query($qSource);
     // let's not have an undefined offset
     if (!isset($this->_def_source[0][0])) {
         $this->_def_source[0][0] = "";
     }
     $sourceMe = new Dropdown("default_source_id", $defsourceArray, $this->_def_source[0][0]);
     $source_string = $sourceMe->display();
     echo "<div class=\"pluslet\">\n    <div class=\"titlebar\">\n      <div class=\"titlebar_text\"><img src=\"{$source_icon}\" class=\"icon_smaller\" /> " . _("Default Source Type") . "</div>\n      <div class=\"titlebar_options\"></div>\n    </div>\n    <div class=\"pluslet_body\">\n\n\t{$source_string}\n\t</div></div>";
     // end pluslet_body, end pluslet
     /////////////////
     // Subjects
     /////////////////
     $subject_list = "";
     if ($this->_subjects == FALSE) {
         // No results
         $subject_list = "";
     } else {
         // loop through results
         foreach ($this->_subjects as $value) {
             $subject_list .= self::outputSubject($value);
         }
     }
     if (isset($_SESSION["eresource_mgr"]) && $_SESSION["eresource_mgr"] == "1") {
         $subject_string = getSubBoxes('', 50, 1);
     } else {
         $subject_string = getSubBoxes('', 50);
     }
     echo "\n  <div class=\"pluslet no_overflow\">\n    <div class=\"titlebar\">\n      <div class=\"titlebar_text\">" . _("Subjects") . "</div>\n      <div class=\"titlebar_options\"></div>\n    </div>\n    <div class=\"pluslet_body\">\n\n\t<select name=\"subject_id[]\"><option value=\"\">" . _("-- Select --") . "</option>\n\t{$subject_string}\n\t</select>\n\t<div id=\"subject_list\">{$subject_list}</div> <!-- subjects inserted here -->\n\t</div>\n\n\n\t</div>";
     $this->outputRelatedPluslets();
     print "</div></form>";
 }
Example #3
0
            $file_list .= $tr . "<td><a class=\"showmedium\" href=\"{$linky}\">{$shortName}</a></td><td>{$fileSizeKb} kb</td><td>{$owner}</td><td>";
            foreach ($guides as $gid => $full) {
                $file_list .= "<a href='" . $CpanelPath . "guides/guide.php?subject_id=" . $gid . "'>" . $full . "</a><br />";
            }
            $file_list .= "</td>\n            <td><a id=\"delete-{$rowcount}\" name=\"file-{$rowcount}-{$location_hint}-" . urlencode($shortName) . "\"><i class=\"fa fa-trash fa-lg\" alt=\"" . _("Delete Item") . "\"></i></a></td></tr>";
        }
        $rowcount++;
    }
} else {
    $file_list .= "<tr><td colspan=\"5\">" . _("No files found.") . "</td></tr>";
}
$file_list .= '</table>';
///////////
// Record mgr
/////////////
$subs_option_boxes = getSubBoxes("", "", 1);
$dropdown_intro_text = _("Please check with the guide's owner before modifying");
$all_guides .= "\n<form method=\"get\" action=\"manage_items.php\" name=\"form\">\n<select name=\"subject_id\" size=\"1\">\n<option value=\"\">" . _("-- Choose Guide --") . "</option>\n{$subs_option_boxes}\n</select>\n<br /><br />\n<input type=\"submit\" name=\"submit\" value=\"" . _("Submit") . "\" />\n</form>";
$manage_all_box = "<p>" . _("Use this to organize which items are associated with a record, and thus displayed in 'All Items by Source' box.") . "</p>\n{$all_guides}\n<br />\n<p><i class=\"fa fa-pencil fa-lg\" alt=\"" . _("Edit icon") . "\"></i> " . _("Note: You can also do this in a guide, by clicking on the pencil icon for an 'All Items by Source' box.") . "</p>\n<div id=\"test_url\"></div>";
// Uploads Box //
$uploads_box = "<p>" . _("Highlighted items are orphans.  Pity the orphans!") . "</p>";
// Allow admin to see all
if (isset($_SESSION["admin"]) && $_SESSION["admin"] == 1) {
    $uploads_box .= "<p>" . _("Admin Tip: add ?view=all to this page's URL to see all users' items.") . "</p>";
}
$uploads_box .= "<br />{$file_list}";
// Print out //
print "\n<div class=\"pure-g\">\n  <div class=\"pure-u-1-2\">  \n  ";
makePluslet(_("Manage your Uploads"), $uploads_box, "no_overflow");
print "</div>";
// close pure-u-
Example #4
0
 *   @date mar 2011
 */
use SubjectsPlus\Control\Querier;
$subcat = "guides";
$page_title = "Modify Guides in SubjectsPlus";
include "../includes/config.php";
include "../includes/header.php";
$gear_alt = _("Edit Guide Metadata");
$eye_alt = _("View Guide on Public Site");
$linkie_alt = _("Check Guide Links");
$view_alt = _("View Guide on Public Site");
try {
} catch (Exception $e) {
    echo $e;
}
$subs_option_boxes = getSubBoxes("guide.php?subject_id=", "", 1);
$dropdown_intro_text = _("Please check with the guide's owner before modifying");
$all_guides = "\n<form method=\"post\" action=\"index.php\" name=\"form\">\n<select name=\"item\" id=\"guides\" size=\"1\" onChange=\"window.location=this.options[selectedIndex].value\">\n<option value=\"\">" . _("-- Choose Guide --") . "</option>\n{$subs_option_boxes}\n</select>\n</form>";
// Get all subjects associated with the person
$my_subs_query = "SELECT subject.subject_id, subject, subject.active, shortform, type\nFROM `subject`, staff_subject, staff\nWHERE staff.staff_id = staff_subject.staff_id\nAND staff_subject.subject_id = subject.subject_id\nAND staff.staff_id = '{$_SESSION['staff_id']}'\nORDER BY subject";
$my_subs_result = $db->query($my_subs_query);
$num_rows = count($my_subs_result);
if ($num_rows > 0) {
    $myguides = "";
    $row_count = 0;
    $colour1 = "#fff";
    $colour2 = "#F6E3E7";
    $colour3 = "highlight";
    foreach ($my_subs_result as $myrow1) {
        $mysubs_id = $myrow1[0];
        $mysubs_name = stripslashes($myrow1[1]);