Exemplo n.º 1
0
    /**
     * sp_LinkChecker::displayHTMLForm() - display link checker form depending on type
     *
     * @param string $lstrType
     * @return void
     */
    public function displayHTMLForm($lstrType = "")
    {
        if ($lstrType == "") {
            return;
        }
        global $AssetPath;
        if (isset($_GET['wintype']) && $_GET['wintype'] == 'pop') {
            ?>
			<div id="maincontent">
			<?php 
        }
        ?>

		<div class="pure-g">
  			<div class="pure-u-2-3">

  			    <div class="pluslet">
			      <div class="titlebar">
			        <div class="titlebar_text"><?php 
        print _("Link Checker");
        ?>
</div>
			        <div class="titlebar_options"></div>
			      </div>
			      <div class="pluslet_body">
		<?php 
        if ($lstrType == 'record') {
            ?>
			<span class="record_label"><?php 
            print _("Records");
            ?>
: (<em style="font-style: italic; font-size: smaller;"><?php 
            echo _("This may take a while. Be patient.");
            ?>
</em>)</span><br />
				<form method="post">
					<input type="submit" class="button" name="LinkCheckRecords" value="<?php 
            print _("Check Links In Records");
            ?>
" />
			<?php 
        }
        if ($lstrType == 'subject') {
            ?>
			<span class="record_label"><?php 
            print _("Select Guide");
            ?>
:</span><br />
				<form method="post">
			<?php 
            if ($_SESSION['admin'] == 1) {
                $from = 'subject';
                $where = '';
            } else {
                $from = 'subject, staff_subject';
                $where = "WHERE subject.subject_id = staff_subject.subject_id " . "AND staff_subject.staff_id = {$_SESSION['staff_id']}";
            }
            $guide_select = "SELECT subject, subject.subject_id FROM {$from} {$where} ORDER BY subject ASC";
            $db = new Querier();
            $guide_result = $db->query($guide_select);
            $guide_list = array();
            foreach ($guide_result as $guide_data) {
                $guide_list[] = array($guide_data['subject_id'], $guide_data['subject']);
            }
            $lintCurrentSubjectID = isset($_REQUEST['subject_id']) ? $_REQUEST['subject_id'] : '';
            $lobjDropDown = new Dropdown('subject_id', $guide_list, $lintCurrentSubjectID, "50");
            echo $lobjDropDown->display();
            ?>
					
					<input type="submit" class="button pure-button pure-button-primary" value="<?php 
            print _("Check Links In Guide");
            ?>
" />
			<?php 
        }
        ?>
				</form>
      </div>
    </div>
  </div>


  <div class="pure-u-1-3">
    <div class="pluslet">
      <div class="titlebar">
        <div class="titlebar_text"><?php 
        print _("Legend");
        ?>
</div>
        <div class="titlebar_options"></div>
      </div>
      <div class="pluslet_body">
				<i class="fa fa-check" title="<?php 
        print _("Image: OK");
        ?>
\"></i> = <?php 
        print _("Link is good!");
        ?>
<br /><br />
				<i class="fa fa-exclamation-triangle" title="<?php 
        print _("Image: Uh oh");
        ?>
\"></i> = <?php 
        print _("<i>Possible</i> problem with link; click on link to open in new window.");
        ?>
<br />
			</div>

			    </div>
  </div>
		<?php 
    }
Exemplo n.º 2
0
 public function outputForm($wintype = "")
 {
     global $wysiwyg_desc;
     global $CKPath;
     global $CKBasePath;
     global $IconPath;
     global $all_ptags;
     global $tel_prefix;
     global $omit_user_columns;
     global $require_user_columns;
     global $use_shibboleth;
     ///////////////
     // Departments
     ///////////////
     $querierDept = new Querier();
     $qDept = "select department_id, name from department order by name";
     $deptArray = $querierDept->query($qDept);
     // create department dropdown
     $deptMe = new Dropdown("department_id[]", $deptArray, $this->_department_id, "", "", "", "multi");
     $this->_departments = $deptMe->display();
     ///////////////
     // User Types
     ///////////////
     $querierUserType = new Querier();
     $qUserType = "select user_type_id, user_type from user_type order by user_type_id";
     $userTypeArray = $querierUserType->query($qUserType);
     // create type dropdown
     $typeMe = new Dropdown("user_type_id", $userTypeArray, $this->_user_type_id);
     $this->_user_types = $typeMe->display();
     ///////////////
     // Supervisor
     ///////////////
     $querierSupervisor = new Querier();
     $qSupervisor = "select staff_id, CONCAT( fname, ' ', lname ) AS fullname FROM staff WHERE ptags LIKE '%supervisor%' AND active = '1' ORDER BY lname";
     $supervisorArray = $querierSupervisor->query($qSupervisor);
     // create type dropdown
     $superviseMe = new Dropdown("supervisor_id", $supervisorArray, $this->_supervisor_id, '', '* External Supervisor');
     $this->_supervisors = $superviseMe->display();
     ///////////////
     // Active User?
     ///////////////
     $activeArray = array('0' => array('0', 'No'), '1' => array('1', 'Yes'));
     // create type dropdown
     $activateMe = new Dropdown("active", $activeArray, $this->_active);
     $this->_active_or_not = $activateMe->display();
     //////////////
     // Telephone setup
     /////////////
     if ($tel_prefix != "") {
         $tel_line = "<input type=\"text\" readonly=\"readonly\" size=\"4\" value=\"{$tel_prefix}\" name=\"unedit_tel_prefix\" /><input type=\"text\" name=\"tel\" id=\"tel\" size=\"10\" class=\"";
         if (in_array(_('tel'), $require_user_columns)) {
             $tel_line .= 'required_field';
         }
         $tel_line .= "\" value=\"" . $this->_tel . "\" />";
     } else {
         $tel_line = "<input type=\"text\" name=\"tel\" id=\"tel\" size=\"15\" class=\"";
         if (in_array(_('tel'), $require_user_columns)) {
             $tel_line .= 'required_field';
         }
         $tel_line .= "\" value=\"" . $this->_tel . "\" />";
     }
     //////////////////
     // Photo
     ////////////
     $headshot = self::getHeadshot($this->_email, "medium");
     if ($this->_staff_id != "") {
         $headshot .= "<div class=\"setStaffPhotoWarning\">" . _("Note: Save changes before updating photo!") . "</div><div><p>&nbsp;&nbsp;<a href=\"../includes/set_picture.php?staff_id={$this->_staff_id}\" id=\"load_photo\">" . _("Click to update photo") . "</a></p></div>";
     } else {
         $headshot .= "<div class=\"setStaffPhotoWarning\"><p>" . _("You can change the photo after saving.") . "</p></div>";
     }
     //////////////////
     // Social Media //
     //////////////////
     //$socialMedia  = self::outputSocialMediaForm();
     /////////////
     // Start the form
     /////////////
     $action = htmlentities($_SERVER['PHP_SELF']) . "?staff_id=" . $this->_staff_id;
     if ($wintype != "") {
         $action .= "&wintype=pop";
     }
     // set up
     print "<div class=\"pure-g\">";
     //see which"Staff Member" columns and whether "Personal Information" section or "Emergency Contact" section are omitted
     // added by dgonzalez
     $isFnameOmitted = in_array(_("fname"), $omit_user_columns);
     $isLnameOmitted = in_array(_("lname"), $omit_user_columns);
     $isTitleOmitted = in_array(_("title"), $omit_user_columns);
     $isPositionNumOmitted = in_array(_("position_number"), $omit_user_columns);
     $isClassificationOmitted = in_array(_("classification"), $omit_user_columns);
     $isDepartmentOmitted = in_array(_("department"), $omit_user_columns);
     $isPriorityOmitted = in_array(_("priority"), $omit_user_columns);
     $isSupervisorOmitted = in_array(_("supervisor"), $omit_user_columns);
     $isTelephoneOmitted = in_array(_("tel"), $omit_user_columns);
     $isdFaxOmitted = in_array(_("fax"), $omit_user_columns);
     $isIntercomOmitted = in_array(_("intercom"), $omit_user_columns);
     $isUserTypeOmitted = in_array(_("user_type"), $omit_user_columns);
     $isRoomNumOmitted = in_array(_("room_number"), $omit_user_columns);
     $isPersonalOmitted = in_array(_("personal_information"), $omit_user_columns);
     $isEmergencyContactOmitted = in_array(_("emergency_contact"), $omit_user_columns);
     // start form
     print "<form action=\"" . $action . "\" method=\"post\" id=\"new_record\" accept-charset=\"UTF-8\" class=\"pure-form pure-form-stacked\">\n<input type=\"hidden\" name=\"staff_id\" value=\"" . $this->_staff_id . "\" />\n<div class=\"pure-u-1-3\">\n<div class=\"pluslet no_overflow\">\n    <div class=\"titlebar\">\n      <div class=\"titlebar_text\">" . _("Staff Member") . "</div>\n      <div class=\"titlebar_options\"></div>\n    </div>\n    <div class=\"pluslet_body\">";
     //based on omitted columns write out html
     // added by dgonzalez
     if ($isFnameOmitted) {
         echo "<input type=\"hidden\" name=\"fname\" id=\"fname\" value=\"" . $this->_fname . "\" />";
     } else {
         print "<div style=\"float: left; margin-right: 1em;\"><label for=\"fname\">" . _("First Name") . "</label>\n    \t<input type=\"text\" name=\"fname\" id=\"fname\" class=\"pure-input-1\" value=\"" . $this->_fname . "\" /></div>";
     }
     if ($isLnameOmitted) {
         echo "<input type=\"hidden\" name=\"lname\" id=\"lname\" value=\"" . $this->_lname . "\" /><br style=\"clear:both;\"/>";
     } else {
         print "<div style=\"float: left;\"><label for=\"lname\">" . _("Last Name") . "</label>\n\t    <input type=\"text\" name=\"lname\" id=\"lname\" class=\"pure-input-1\" value=\"" . $this->_lname . "\" /></div>\n\t    <br style=\"clear:both;\"/>";
     }
     if ($isTitleOmitted) {
         echo "<input type=\"hidden\" name=\"title\" id=\"title\" value=\"" . $this->_title . "\" />";
     } else {
         print "<div style=\"float: left; margin-right: 1em;\"><label for=\"title\">" . _("Position Title") . "</label>\n    <input type=\"text\" name=\"title\" id=\"title\" class=\"pure-input-1";
         if (in_array(_('title'), $require_user_columns)) {
             echo 'required_field';
         }
         print "\" value=\"" . $this->_title . "\" /></div>";
     }
     if ($isPositionNumOmitted) {
         echo "<input type=\"hidden\" name=\"position_number\" id=\"position_number\" value=\"" . $this->_position_number . "\" />";
     } else {
         print "<div style=\"float: left;\"><label for=\"position_number\">" . _("Position #") . "</label>\n    <input type=\"text\" name=\"position_number\" id=\"position_number\" class=\"pure-input-1-4";
         if (in_array(_('position_number'), $require_user_columns)) {
             echo 'required_field';
         }
         print "\" value=\"" . $this->_position_number . "\" /></div>";
     }
     if (!($isTitleOmitted && $isPositionNumOmitted)) {
         echo "<br class=\"clear-both\"/><br />";
     }
     if ($isClassificationOmitted) {
         echo "<input type=\"hidden\" name=\"job_classification\" id=\"job_classification\" value=\"" . $this->_job_classification . "\" />";
     } else {
         print "<label for=\"job_classification\">" . _("Job Classification") . "</label>\n    <input type=\"text\" name=\"job_classification\" id=\"job_classification\" class=\"pure-input-2-3";
         if (in_array(_('job_classification'), $require_user_columns)) {
             echo 'required_field';
         }
         print "\" value=\"" . $this->_job_classification . "\" />";
     }
     if ($isDepartmentOmitted) {
         echo "<input type=\"hidden\" name=\"department_id\" id=\"department_id\" value=\"\" />";
     } else {
         echo "\n<div style=\"float: left; margin-right: 1em;\"><label for=\"department_id\">" . _("Department") . "</label>\n{$this->_departments}\n</div>";
     }
     if ($isPriorityOmitted) {
         echo "<input type=\"hidden\" name=\"staff_sort\" id=\"staff_sort\" value=\"" . $this->_staff_sort . "\" />";
     } else {
         echo "<div style=\"float: left;\"><label for=\"staff_sort\">" . _("Display Priority") . "</label>\n\n    <input type=\"text\" name=\"staff_sort\" id=\"staff_sort\" class=\"pure-input-1-4";
         if (in_array(_('priority'), $require_user_columns)) {
             echo 'required_field';
         }
         print "\" value=\"" . $this->_staff_sort . "\" /></div>";
     }
     if (!($isDepartmentOmitted && $isPriorityOmitted)) {
         echo "<br class=\"clear-both\" /><br />";
     }
     if ($isSupervisorOmitted) {
         echo "<input type=\"hidden\" id=\"supervisor_id\" name=\"supervisor_id\" value=\"\" />";
     } else {
         echo "\n<label for=\"supervisor\">" . _("Supervisor") . "</label>\n{$this->_supervisors}\n";
     }
     if ($isTelephoneOmitted) {
         echo "<input id=\"tel\" type=\"hidden\" value=\"" . $this->_tel . "\" name=\"tel\">";
     } else {
         print "<div style=\"float: left; margin-right: 1em;\"><label for=\"tel\">" . _("Telephone") . "</label>\n    {$tel_line}\n    </div>";
     }
     if ($isdFaxOmitted) {
         echo "<input type=\"hidden\" name=\"fax\" id=\"fax\" value=\"" . $this->_fax . "\" />";
     } else {
         print "<div style=\"float: left;margin-right: 1em;\"><label for=\"fax\">" . _("FAX") . "</label>\n    <input type=\"text\" name=\"fax\" id=\"fax\" class=\"pure-input-1";
         if (in_array(_('fax'), $require_user_columns)) {
             echo 'required_field';
         }
         print "\" value=\"" . $this->_fax . "\" /></div>";
     }
     if ($isIntercomOmitted) {
         echo "<input type=\"hidden\" name=\"intercom\" id=\"intercom\" value=\"" . $this->_intercom . "\" />";
     } else {
         print "<div style=\"float: left; margin-right: 1em;\"><label for=\"intercom\">" . _("Intercom") . "</label>\n    <input type=\"text\" name=\"intercom\" id=\"intercom\" class=\"pure-input-1-4";
         if (in_array(_('priority'), $require_user_columns)) {
             echo 'required_field';
         }
         print "\" value=\"" . $this->_intercom . "\" /></div>";
     }
     if ($isRoomNumOmitted) {
         echo "<input type=\"hidden\" name=\"room_number\" id=\"room_number\" value=\"" . $this->_room_number . "\" />";
     } else {
         print "<div style=\"float: left;\"><label for=\"room_number\">" . _("Room #") . "</label>\n    <input type=\"text\" name=\"room_number\" id=\"room_number\" class=\"pure-input-1-3";
         if (in_array(_('priority'), $require_user_columns)) {
             echo 'required_field';
         }
         print "\" value=\"" . $this->_room_number . "\" /></div>";
     }
     if (!($isTelephoneOmitted && $isdFaxOmitted && $isIntercomOmitted && $isRoomNumOmitted)) {
         echo "<br class=\"clear-both\"/><br />";
     }
     print "<label for=\"email\">" . _("Email (This is the username for logging in to SubjectsPlus)") . "</label>\n    <input type=\"text\" name=\"email\" id=\"email\" class=\"pure-input-1 required_field\" value=\"" . $this->_email . "\" />";
     if ($isUserTypeOmitted) {
         echo "<input type=\"hidden\" name=\"user_type_id\" id=\"user_type_id\" value=\"1\" />";
     } else {
         echo "<div style=\"float: left; margin-right: 1em;\"><label for=\"user_type\">" . _("User Type") . "</label>\n\t      {$this->_user_types}\n\t      </div>";
     }
     echo "\n    <div style=\"float: left; margin-right: 1em;\"><label for=\"active\">" . _("Active User?") . "</label>\n    {$this->_active_or_not}\n    </div>\n    <br style=\"clear: both;\" /><br /></div></div>";
     if ($isPersonalOmitted) {
         echo "<input type=\"hidden\" name=\"street_address\" id=\"street_address\" value=\"" . $this->_street_address . "\" />\n";
         echo "<input type=\"hidden\" name=\"city\" id=\"city\" value=\"" . $this->_city . "\" />\n";
         echo "<input type=\"hidden\" name=\"state\" id=\"state\" value=\"" . $this->_state . "\" />\n";
         echo "<input type=\"hidden\" name=\"zip\" id=\"zip\" value=\"" . $this->_zip . "\" />\n";
         echo "<input type=\"hidden\" name=\"home_phone\" id=\"home_phone\" value=\"" . $this->_home_phone . "\" />\n";
         echo "<input type=\"hidden\" name=\"cell_phone\" id=\"cell_phone\" value=\"" . $this->_cell_phone . "\" />\n";
         echo "<input type=\"hidden\" name=\"lat_long\" id=\"lat_long\"value=\"" . $this->_lat_long . "\" />\n";
     } else {
         self::outputPersonalInfoForm();
         self::outputLatLongForm();
     }
     if ($isEmergencyContactOmitted) {
         echo "<input type=\"hidden\" name=\"emergency_contact_name\" id=\"emergency_contact_name\" value=\"" . $this->_emergency_contact_name . "\" />";
         echo "<input type=\"hidden\" name=\"emergency_contact_relation\" id=\"emergency_contact_relation\" value=\"" . $this->_emergency_contact_relation . "\" />\n";
         echo "<input type=\"hidden\" name=\"emergency_contact_phone\" id=\"emergency_contact_phone\" value=\"" . $this->_emergency_contact_phone . "\" />\n";
     } else {
         self::outputEmergencyInfoForm();
     }
     echo "</div><div class=\"pure-u-1-3\">";
     makePluslet(_("Photo"), $headshot, "no_overflow");
     $socialMediaForm = self::outputSocialMediaForm();
     makePluslet(_("Social Media"), $socialMediaForm, "no_overflow");
     print "<div class=\"pluslet\">\n    <div class=\"titlebar\">\n      <div class=\"titlebar_text\">" . _("Staff Member") . "</div>\n      <div class=\"titlebar_options\"></div>\n    </div>\n    <div class=\"pluslet_body\">\n<p>" . _("Please only include professional details.") . "</p><br />";
     self::outputBioForm();
     print "</div>";
     // end pluslet body
     print "</div>";
     // end pluslet
     print "</div>";
     // end pure 1-3
     print "<div class=\"pure-u-1-3\">";
     // Get our permission tags, or ptags
     $current_ptags = explode("|", $this->_ptags);
     $our_ptags = "";
     foreach ($all_ptags as $value) {
         if (in_array($value, $current_ptags)) {
             $our_ptags .= " <span class=\"ctag-on\">{$value}</span> ";
         } else {
             $our_ptags .= " <span class=\"ctag-off\">{$value}</span> ";
         }
     }
     $our_ptags .= "<input type=\"hidden\" name=\"ptags\" value=\"{$this->_ptags}\" /><br class=\"clear-both\" /><p style=\"font-size: smaller\">";
     $our_ptags .= _("Select which parts of SubjectsPlus this user may access.\n                <br /><strong>records</strong> allows access to both the Record and Guide tabs.\n                <br /><strong>eresource_mgr</strong> allows the user to see all the information about a Record (and delete it), and quickly see all guides.\n                <br /><strong>admin</strong> allows access to the overall admin of the site.\n                <br /><strong>librarian</strong> means user shows up in lists of librarians.\n                <br /><strong>supervisor</strong> means user shows up in list of supervisors\n                <br /><strong>view_map</strong> lets user see the map of where everyone lives.  Probably only for muckymucks.");
     makePluslet("Permissions", $our_ptags, "no_overflow");
     ///////////////
     // Password
     ///////////////
     $make_pwd_box = "false";
     $our_password = "";
     $pwd_text_1 = "<p  ><a href=\"../includes/set_password.php?staff_id=" . $this->_staff_id . "\" id=\"reset_password\">" . _("The password is hidden.  Reset?") . "</a></p>";
     $pwd_text_2 = "<input type=\"password\" name=\"password\" size=\"20\" class=\"required_field\" /><br />\n    <p style=\"font-size: smaller\">Pasword must have a special character, a letter, a number, and at least 6 characters.</p>\n    <p style=\"font-size: smaller\">The password is stored as a hash in the database, but unless you have SSL travels clear text across the internet.</p>";
     // Don't show this box if they have shibboleth turned on
     //$use_shibboleth = ""; // for testing purposes, to set this without blowing things up
     if (!isset($use_shibboleth)) {
         // show password, but determine which text to use
         if ($this->_staff_id != "") {
             $our_password = $pwd_text_1;
         } else {
             $our_password = $pwd_text_2;
         }
         $make_pwd_box = "true";
     } else {
         // maybe show password
         if ($use_shibboleth == TRUE) {
             //don't show password
         } else {
             // show password, but determine which text to use
             if ($this->_staff_id != "") {
                 $our_password = $pwd_text_1;
             } else {
                 $our_password = $pwd_text_2;
             }
             $make_pwd_box = "true";
         }
     }
     if ($make_pwd_box == "true") {
         makePluslet("Password", $our_password, "no_overflow");
     }
     ///////////////
     // Save/Delete Buttons
     /////////////////
     $our_buttons = "<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->_staff_id != "") {
         $our_buttons .= " <input style=\"margin-left: 1em;\" type=\"submit\" name=\"delete_record\" class=\"pure-button delete_button pure-button-warning\" value=\"" . _("Delete Forever!") . "\" />";
     }
     // get edit history
     $last_mod = _("Last modified: ") . lastModded("staff", $this->_staff_id);
     $our_buttons .= "<div id=\"last_edited\">{$last_mod}</div>";
     makePluslet("Save Changes", $our_buttons, "no_overflow");
     print "</div></div>\n</form>";
 }
Exemplo n.º 3
0
 public function outputForm($wintype = "")
 {
     global $wysiwyg_desc;
     global $CKPath;
     global $CKBasePath;
     global $IconPath;
     global $guide_types;
     global $all_tbtags;
     global $all_cattags;
     //print "<pre>";print_r($this->_staffers); print "</pre>";
     $action = htmlentities($_SERVER['PHP_SELF']) . "?talkback_id=" . $this->_talkback_id;
     if ($wintype != "") {
         $action .= "&wintype=pop";
     }
     $tb_title_line = _("Edit TalkBack");
     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=\"talkback_id\" value=\"" . $this->_talkback_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\">{$tb_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=\"a_from\">" . _("Question By") . "</label>\n<input type=\"text\" name=\"q_from\" size=\"20\" class=\"required_field\" value=\"" . $this->_q_from . "\">\n\n<label for=\"answer\">" . _("Answer") . "</label>";
     if ($wysiwyg_desc == 1) {
         include $CKPath;
         global $BaseURL;
         $oCKeditor = new CKEditor($CKBasePath);
         $oCKeditor->timestamp = time();
         $config['toolbar'] = 'SubsPlus_Narrow';
         // Default shows a much larger set of toolbar options
         $config['height'] = '200';
         $config['filebrowserUploadUrl'] = $BaseURL . "ckeditor/php/uploader.php";
         echo $oCKeditor->editor('answer', $this->_answer, $config);
         echo "<br />";
     } else {
         echo "<textarea name=\"answer\" rows=\"3\" cols=\"70\">" . stripslashes($this->_answer) . "</textarea>";
     }
     /////////////////////
     // Answer By
     /////////////////////
     $qStaff = "select staff_id, CONCAT(fname, ' ', lname) as fullname FROM staff WHERE ptags LIKE '%talkback%' ORDER BY lname, fname";
     $querierStaff = new Querier();
     $staffArray = $querierStaff->query($qStaff);
     // put in a default user
     if ($this->_a_from == "") {
         $selected_user = $_SESSION["staff_id"];
     } else {
         $selected_user = $this->_a_from;
     }
     $staffMe = new Dropdown("a_from", $staffArray, $selected_user, "50", "--Select--");
     $staff_string = $staffMe->display();
     $answerer = "<label=\"record_label\"></label>\n            {$staff_string}\n        ";
     /////////////////////
     // Is Live
     ////////////////////
     $is_live = "<label=\"display\"></label>\n<input name=\"display\" type=\"radio\" value=\"1\"";
     if ($this->_display == 1) {
         $is_live .= " checked=\"checked\"";
     }
     $is_live .= " /> " . _("Yes") . " &nbsp;&nbsp;&nbsp; <input name=\"display\" type=\"radio\" value=\"0\"";
     if ($this->_display == 0) {
         $is_live .= " checked=\"checked\"";
     }
     $is_live .= " /> " . _("No") . "\n<br class=\"clear-both\" /><br />";
     /////////////////////
     // tbtags
     ////////////////////
     $tb_tags = "<input type=\"hidden\" name=\"tbtags\" value=\"" . $this->_tbtags . "\" />\n\t\t\t<label=\"record_label\"></label>";
     $current_tbtags = explode("|", $this->_tbtags);
     $tag_count = 0;
     // added because if you have a lot of ctags, it just stretches the div forever
     foreach ($all_tbtags as $key => $value) {
         if ($tag_count == 3) {
             $tb_tags .= "<br />";
             $tag_count = 0;
         }
         if (in_array($key, $current_tbtags)) {
             $tb_tags .= "<span class=\"ctag-on\">{$key}</span>";
         } else {
             $tb_tags .= "<span class=\"ctag-off\">{$key}</span>";
         }
         $tag_count++;
     }
     /////////////////////
     // cattags
     ////////////////////
     $cat_tags = "<input type=\"hidden\" class=\"cattag-data\" name=\"cattags\" value=\"" . $this->_cattags . "\" />\n\t\t\t<label=\"record_label\"></label>";
     $current_cattags = explode("|", $this->_cattags);
     $tag_count = 0;
     // added because if you have a lot of ctags, it just stretches the div forever
     foreach ($all_cattags as $key => $value) {
         if ($tag_count == 3) {
             $cat_tags .= "<br />";
             $tag_count = 0;
         }
         if (in_array($value, $current_cattags)) {
             $cat_tags .= "<span class=\"ctag-on\">{$value}</span>";
         } else {
             $cat_tags .= "<span class=\"ctag-off\">{$value}</span>";
         }
         $tag_count++;
     }
     echo "\n\n</div>\n</div>\n</div>\n<!-- right hand column -->";
     $last_mod = _("Last modified: ") . lastModded("talkback", $this->_talkback_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    <input type=\"submit\" name=\"submit_record\" class=\"button pure-button pure-button-primary\" 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->_talkback_id != "") {
         if (isset($_SESSION["admin"]) && $_SESSION["admin"] == "1") {
             echo "<input type=\"submit\" name=\"delete_record\" class=\"button pure-button delete_button  pure-button-warning\" value=\"" . _("Delete Forever!") . "\" />";
         }
     }
     echo "</div></div>";
     makePluslet(_("Answered By"), $answerer, "no_overflow");
     makePluslet(_("Is this comment live?"), $is_live, "no_overflow");
     makePluslet(_("Site Tags (relevant library sites)"), $tb_tags, "no_overflow");
     makePluslet(_("Topic Tags (relevant topics)"), $cat_tags, "no_overflow");
 }
Exemplo n.º 4
0
 public function outputForm($wintype = "")
 {
     global $wysiwyg_desc;
     global $CKPath;
     global $CKBasePath;
     global $IconPath;
     global $all_ptags;
     global $tel_prefix;
     ///////////////
     // Departments
     ///////////////
     $querierDept = new Querier();
     $qDept = "select department_id, name from department order by name";
     $deptArray = $querierDept->query($qDept);
     // create department dropdown
     $deptMe = new Dropdown("department_id", $deptArray, $this->_department_id);
     $this->_departments = $deptMe->display();
     ///////////////
     // User Types
     ///////////////
     $querierUserType = new Querier();
     $qUserType = "select user_type_id, user_type from user_type order by user_type_id";
     $userTypeArray = $querierUserType->query($qUserType);
     // create type dropdown
     $typeMe = new Dropdown("user_type_id", $userTypeArray, $this->_user_type_id);
     $this->_user_types = $typeMe->display();
     ///////////////
     // Active User?
     ///////////////
     $activeArray = array('0' => array('0', 'No'), '1' => array('1', 'Yes'));
     // create type dropdown
     $activateMe = new Dropdown("active", $activeArray, $this->_active);
     $this->_active_or_not = $activateMe->display();
     //////////////
     // Telephone setup
     /////////////
     if ($tel_prefix != "") {
         $tel_line = "<input type=\"text\" readonly=\"readonly\" size=\"8\" value=\"{$tel_prefix}\" name=\"unedit_tel_prefix\" /><input type=\"text\" name=\"tel\" id=\"tel\" size=\"5\" class=\"required_field\" value=\"" . $this->_tel . "\" />";
     } else {
         $tel_line = "<input type=\"text\" name=\"tel\" id=\"tel\" size=\"10\" class=\"required_field\" value=\"" . $this->_tel . "\" />";
     }
     //////////////////
     // Photo
     ////////////
     $headshot = self::getHeadshot($this->_email, "medium");
     if ($this->_staff_id != "") {
         $headshot .= "<p><a href=\"../includes/set_picture.php?staff_id={$this->_staff_id}\" id=\"load_photo\">" . _("Click to update photo") . "</a></p>";
     } else {
         $headshot .= "<p>" . _("You can change the photo after saving.") . "</p>";
     }
     /////////////
     // Start the form
     /////////////
     $action = htmlentities($_SERVER['PHP_SELF']) . "?staff_id=" . $this->_staff_id;
     if ($wintype != "") {
         $action .= "&wintype=pop";
     }
     echo "\n<form action=\"" . $action . "\" method=\"post\" id=\"new_record\" accept-charset=\"UTF-8\">\n<input type=\"hidden\" name=\"staff_id\" value=\"" . $this->_staff_id . "\" />\n<div style=\"float: left; margin-right: 20px;\">\n<div class=\"box\">\n        <h2 class=\"bw_head\">" . _("Staff Member") . "</h2>\n\n<div class=\"float-left\">\n<span class=\"record_label\">" . _("First Name ") . "</span><br />\n<input type=\"text\" name=\"fname\" id=\"fname\" size=\"30\" class=\"required_field\" value=\"" . $this->_fname . "\" />\n</div>\n<div class=\"float-left\">\n<span class=\"record_label\">" . _("Last Name ") . "</span><br />\n<input type=\"text\" name=\"lname\" id=\"lname\" size=\"30\" class=\"required_field\" value=\"" . $this->_lname . "\" />\n</div>\n<br class=\"clear-both\"/><br />\n<span class=\"record_label\">" . _("Title") . "</span><br />\n<input type=\"text\" name=\"title\" id=\"title\" size=\"50\" class=\"required_field\" value=\"" . $this->_title . "\" />\n<br /><br />\n<div class=\"float-left\">\n<span class=\"record_label\">" . _("Department") . "</span><br />\n{$this->_departments}\n</div>\n<div style=\"float: left;margin-left: 10px;\">\n<span class=\"record_label\">" . _("Show First in Dept List?") . "</span><br />\n<input type=\"text\" name=\"staff_sort\" id=\"staff_sort\" size=\"2\" class=\"required_field\" value=\"" . $this->_staff_sort . "\" />\n</div>\n<br class=\"clear-both\" /><br />\n<span class=\"record_label\">" . _("Telephone") . "</span><br />\n{$tel_line}\n<br /><br />\n<span class=\"record_label\">" . _("Email (This is the username for logging in to SubjectsPlus)") . "</span><br />\n<input type=\"text\" name=\"email\" id=\"email\" size=\"40\" class=\"required_field\" value=\"" . $this->_email . "\" />\n<br /><br />\n<div class=\"float-left\">\n<span class=\"record_label\">" . _("User Type") . "</span><br />\n{$this->_user_types}\n</div>\n<div style=\"float: left;margin-left: 20px;\">\n<span class=\"record_label\">" . _("Active User?") . "</span><br />\n{$this->_active_or_not}\n</div>\n<br /><br />\n</div>\n        <div class=\"box no_overflow\">\n<h2 class=\"bw_head\">" . _("Photo") . "</h2>\n\n{$headshot}\n</div>\n        <div class=\"box no_overflow\">\n<h2 class=\"bw_head\">" . _("Biographical Details") . "</h2>\n\n<p>" . _("Please only include professional details.") . "</p><br />";
     self::outputBioForm();
     echo "\n<br />\n</div>\n</div>\n<!-- right hand column -->\n<div style=\"float: left; max-width: 400px;\">\n        <div class=\"box\">\n<h2 class=\"bw_head\">" . _("Permissions") . "</h2>\n\n";
     // Get our permission tags, or ptags
     $current_ptags = explode("|", $this->_ptags);
     foreach ($all_ptags as $value) {
         if (in_array($value, $current_ptags)) {
             echo "<span class=\"ctag-on\">{$value}</span>";
         } else {
             echo " <span class=\"ctag-off\">{$value}</span>";
         }
     }
     echo "<input type=\"hidden\" name=\"ptags\" value=\"{$this->_ptags}\" /><br class=\"clear-both\" /><p style=\"font-size: smaller\">Select which parts of SubjectsPlus this user may access.\n                <br /><strong>records</strong> allows access to both the Record and Guide tabs.\n                <br /><strong>eresource_mgr</strong> allows the user to see all the information about a Record (and delete it), and quickly see all guides.\n                <br /><strong>admin</strong> allows access to the overall admin of the site.\n                <br /><strong>NOFUN</strong> means user can't modify other peoples' guides, or view records</p>\n</div>\n        \t<div class=\"box\">\n\t<h2 class=\"bw_head\">" . _("Password") . "</h2>";
     if ($this->_staff_id != "") {
         echo "<p  ><a href=\"../includes/set_password.php?staff_id=" . $this->_staff_id . "\" id=\"reset_password\">" . _("The password is hidden.  Reset?") . "</a></p>";
     } else {
         echo "<input type=\"password\" name=\"password\" size=\"20\" class=\"required_field\" /><br />\n\t\t<p style=\"font-size: smaller\">The password is stored as a hash in the database, but unless you have SSL travels clear text across the internet.</p>";
     }
     echo "\n\t</div>\n        <div id=\"record_buttons\" class=\"box\">\n\t<h2 class=\"bw_head\">" . _("Save") . "</h2>\n\t\n\t\t<input type=\"submit\" name=\"submit_record\" class=\"button save_button\" value=\"" . _("Save Record Now") . "\" />";
     // if it's not a new record, and we're authorized, show delete button
     if ($this->_staff_id != "") {
         echo "<input type=\"submit\" name=\"delete_record\" class=\"delete_button\" value=\"" . _("Delete Forever!") . "\" />";
     }
     // get edit history
     $last_mod = _("Last modified: ") . lastModded("staff", $this->_staff_id);
     echo "<div id=\"last_edited\">{$last_mod}</div>\n\n</div>\n</form>";
 }
Exemplo n.º 5
0
 public function outputForm($wintype = "")
 {
     global $wysiwyg_desc;
     global $CKPath;
     global $CKBasePath;
     global $IconPath;
     global $AssetPath;
     global $guide_types;
     global $video_storage_types;
     global $all_vtags;
     //print "<pre>";print_r($this->_staffers); print "</pre>";
     $action = htmlentities($_SERVER['PHP_SELF']) . "?video_id=" . $this->_video_id;
     if ($wintype != "") {
         $action .= "&wintype=pop";
     }
     $vid_title_line = _("Edit Video Info");
     echo "\n<form action=\"" . $action . "\" method=\"post\" id=\"new_record\" accept-charset=\"UTF-8\">\n<input type=\"hidden\" name=\"video_id\" value=\"" . $this->_video_id . "\" />\n<div style=\"float: left; margin-right: 20px;\">\n      <div class=\"box\">\n<h2 class=\"bw_head\">{$vid_title_line}</h2>\n\n<span class=\"record_label\">" . _("title") . "</span><br />\n<textarea name=\"title\" rows=\"2\" cols=\"50\">" . stripslashes($this->_title) . "</textarea>\n<br /><br />\n<span class=\"record_label\">" . _("description") . "</span><br />";
     if ($wysiwyg_desc == 1) {
         include $CKPath;
         global $BaseURL;
         $oCKeditor = new CKEditor($CKBasePath);
         $oCKeditor->timestamp = time();
         $config['toolbar'] = 'Basic';
         // Default shows a much larger set of toolbar options
         $config['height'] = '100';
         $config['filebrowserUploadUrl'] = $BaseURL . "ckeditor/php/uploader.php";
         echo $oCKeditor->editor('description', $this->_description, $config);
         echo "<br />";
     } else {
         echo "<textarea name=\"description\" rows=\"4\" cols=\"70\">" . stripslashes($this->_description) . "</textarea>";
     }
     // Generate our dropdown
     $guideMe = new Dropdown("source", $video_storage_types, $this->_source, "50");
     $guide_string = $guideMe->display();
     echo "<br /><br />\n<span class=\"record_label\">" . _("video file storage location") . "</span><br />\n{$guide_string}\n  <br /><br />\n<span class=\"record_label\">" . _("foreign ID") . "</span><br />\n<input name=\"foreign_id\" value=\"" . stripslashes($this->_foreign_id) . "\" size=\"15\" />\n  <br />\n  <span class=\"smaller\">* " . "Enter the embed code id for youtube or vimeo" . "</span><br /><br />\n  <span class=\"record_label\">" . _("duration in seconds") . "</span><br />\n<input name=\"duration\" value=\"" . stripslashes($this->_duration) . "\" size=\"5\" />\n  <br /><br />";
     /////////////////////
     // Tags
     ////////////////////
     echo "<input type=\"hidden\" name=\"vtags\" value=\"" . $this->_vtags . "\" />\n\t\t\t<span class=\"record_label\">vtags: </span> ";
     $current_vtags = explode("|", $this->_vtags);
     $tag_count = 0;
     // added because if you have a lot of ctags, it just stretches the div forever
     $vid_tags = "";
     foreach ($all_vtags as $value) {
         if ($tag_count == 5) {
             $vid_tags .= "<br />";
             $tag_count = 0;
         }
         if (in_array($value, $current_vtags)) {
             $vid_tags .= "<span class=\"ctag-on\">{$value}</span>";
         } else {
             $vid_tags .= "<span class=\"ctag-off\">{$value}</span>";
         }
         $tag_count++;
     }
     print $vid_tags;
     /////////////////////
     // Is Live
     ////////////////////
     $is_live = "<span class=\"record_label\">" . _("Live?") . "</span><br />\n<input name=\"display\" type=\"radio\" value=\"1\"";
     if ($this->_display == 1) {
         $is_live .= " checked=\"checked\"";
     }
     $is_live .= " /> " . _("Yes") . " &nbsp;&nbsp;&nbsp; <input name=\"display\" type=\"radio\" value=\"0\"";
     if ($this->_display == 0) {
         $is_live .= " checked=\"checked\"";
     }
     $is_live .= " /> " . _("No") . "\n<br class=\"clear-both\" /><br />";
     /////////////////////
     // Thumbnail
     ////////////////////
     $this->_vid_loc = $AssetPath . "images/video_thumbs/" . $this->_video_id . "_medium.jpg";
     $thumbnail = "<img src=\"" . $this->_vid_loc . "\" alt=\"" . _("Thumbnail") . "\" />";
     if ($this->_video_id != "") {
         $thumbnail .= "<p><a href=\"../includes/set_image.php?video_id={$this->_video_id}\" id=\"load_photo\">" . _("Click to update thumbnail") . "</a></p>";
     } else {
         $thumbnail .= "<p>" . _("You can change the thumbnail after saving.") . "</p>";
     }
     echo "\n\n</div>\n      <div class=\"box no_overflow\">\n<h2 class=\"bw_head\">" . _("Thumbnail (Medium)") . "</h2>\n\n{$thumbnail}\n</div>\n</div>\n<!-- right hand column -->\n<div style=\"float: left;min-width: 50px;\">\n\t<div id=\"record_buttons\" class=\"box\">\n\t\t<input type=\"submit\" name=\"submit_record\" class=\"button 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->_video_id != "") {
         if ($_SESSION["admin"] == "1" || $_SESSION["eresource_mgr"] == "1") {
             echo "<input type=\"submit\" name=\"delete_record\" class=\"delete_button\" value=\"" . _("Delete Forever!") . "\">";
         }
         // get edit history
         $last_mod = _("Last modified: ") . lastModded("video", $this->_video_id);
         echo "<div id=\"last_edited\">{$last_mod}</div>\n";
     }
     echo "</div>\n            <div class=\"box\">\n            <span class=\"record_label\">" . _("create date") . "</span><br />\n            <input type=\"text\" name=\"date\" value=\"" . $this->_date . "\" /> <br />\n            <span class=\"smaller\">" . "YYYY-MM-DD" . "</span>\n            <br /><br />\n            {$is_live}\n            </div>\n            </form>";
 }
Exemplo n.º 6
0
    public function outputMetadataForm($wintype = "")
    {
        global $wysiwyg_desc;
        global $IconPath;
        global $guide_types;
        global $guide_headers;
        global $use_disciplines;
        //print "<pre>";print_r($this->_staffers); print "</pre>";
        $action = htmlentities($_SERVER['PHP_SELF']) . "?subject_id=" . $this->_subject_id;
        if ($wintype != "") {
            $action .= "&wintype=pop";
        }
        if ($this->_subject_id) {
            $guide_title_line = _("Edit Existing Guide Metadata");
        } else {
            $guide_title_line = _("Create New Guide");
        }
        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=\"subject_id\" value=\"" . $this->_subject_id . "\" />\n            <div class=\"pure-g\">\n              <div class=\"pure-u-1-2\">\n                <div class=\"pluslet\">\n                    <div class=\"titlebar\">\n                      <div class=\"titlebar_text\">{$guide_title_line}</div>\n                      <div class=\"titlebar_options\"></div>\n                    </div>\n                <div class=\"pluslet_body\">\n\n            <label for=\"record_title\">" . _("Guide") . "</label>\n            <input type=\"text\" name=\"subject\" id=\"record_title\" class=\"pure-input-1-2 required_field\" value=\"" . $this->_subject . "\">\n\n            <label for=\"record_shortform\">" . _("Short Form") . "</label>\n            <input type=\"text\" name=\"shortform\" id=\"record_shortform\" size=\"20\" class=\"pure-input-1-4 required_field\" value=\"" . $this->_shortform . "\">\n\n            <span class=\"smaller\">* " . _("Short label that shows up in URL--don't use spaces, ampersands, etc.") . "</span>\n\n            <label for=\"type\">" . _("Type of Guide") . "</label>\n            ";
        /////////////////////
        // Guide types dropdown
        /////////////////////
        $guideMe = new Dropdown("type", $guide_types, $this->_type, "50");
        $guide_string = $guideMe->display();
        echo $guide_string;
        echo "<label for=\"header\">" . _("Header Type") . "</label>";
        /////////////////////
        // Header switcher dropdown
        /////////////////////
        $headerMe = new Dropdown("header", $guide_headers, $this->_header, "50");
        $header_string = $headerMe->display();
        echo $header_string;
        echo "<span class=\"smaller\">* " . _("If you're not sure, stick with default") . "</span>";
        /////////////////////
        // Is Live
        ////////////////////
        $is_live = "<label for=\"active\">" . _("Visibility") . "</label>\n    <input name=\"active\" type=\"radio\" value=\"1\"";
        if ($this->_active == 1) {
            $is_live .= " checked=\"checked\"";
        }
        $is_live .= " /> " . _("Public:  Everyone can see") . " <br />\n        <input name=\"active\" type=\"radio\" value=\"0\"";
        if ($this->_active == 0) {
            $is_live .= " checked=\"checked\"";
        }
        $is_live .= " /> " . _("Hidden:  Not listed, but visible if you have the URL") . " <br />\n        <input name=\"active\" type=\"radio\" value=\"2\"";
        if ($this->_active == 2) {
            $is_live .= " checked=\"checked\"";
        }
        $is_live .= " /> " . _("Suppressed:  Must be logged in to SP to view");
        print $is_live;
        /////////
        // Department dropdown
        ////////
        $querier = new Querier();
        $dept_query = "SELECT department_id, name FROM department;";
        $deptArray = $querier->query($dept_query);
        $current_dept = new Querier();
        $current_dept_query = "SELECT DISTINCT subject.subject, subject.subject_id, department.name, department.department_id, subject_department.date\n            FROM subject_department\n            JOIN subject ON subject.subject_id = subject_department.id_subject\n            JOIN department ON department.department_id = subject_department.id_department\n            WHERE subject.subject_id = '{$this->_subject_id}'\n            ORDER BY date DESC\n            LIMIT 1";
        $current_dept_array = $current_dept->query($current_dept_query);
        print "\n        </div>\n        </div>\n        <div class=\"pluslet\">\n        \n                    <div class=\"titlebar\">\n                      <div class=\"titlebar_text\">" . _("Associations/Listings (optional)") . "</div>\n                      <div class=\"titlebar_options\"></div>\n                    </div>\n                <div class=\"pluslet_body\">\n                <span class=\"smaller\"> " . _("<strong>Department</strong> lets you group guides to provide a separate listing for a group of guides, say, Special Collections.  \n                <br /><strong>Parent Guide</strong> allows you to build a hierarchy for display.") . "</span>";
        ?>

            <label for="department"> Department </label>


            <select name="department">

<?php 
        if ($current_dept_array) {
            foreach ($current_dept_array as $dept) {
                echo "<option value='" . $dept["department_id"] . "'>" . $dept["name"] . "</option>";
            }
        } else {
            print "<option value='0'>--none--</option>";
            foreach ($deptArray as $dept) {
                echo "<option value='" . $dept["department_id"] . "'>" . $dept["name"] . "</option>";
            }
        }
        ?>

            </select>
            
        <?php 
        ////////////////////////////
        // Parenthood
        ///////////////////////////
        $parents_list = "";
        if ($this->_parents == FALSE) {
            // No results
            $parents_list = "";
        } else {
            // loop through results
            foreach ($this->_parents as $value) {
                $parents_list .= self::outputParents($value);
            }
        }
        ////////
        // Parent dropdown
        ////////
        $querier = new Querier();
        $subject_query = "SELECT subject_id, subject FROM subject WHERE subject_id != '{$this->_subject_id}'";
        $subjectArray = $querier->query($subject_query);
        $parentMe = new Dropdown("parent_id[]", $subjectArray, "", "50", "--Select--");
        $parent_string = $parentMe->display();
        $parenthood = "{$parent_string} <div id=\"parent_list\">{$parents_list}</div> <!-- parent guides inserted here -->";
        // this is for legacy reasons, methinks
        if (isset($main_col_size)) {
        } else {
            $main_col_size = null;
        }
        $screen_layout = "<input type=\"hidden\" id=\"extra\" name=\"extra[maincol]\" value=\"{$main_col_size}\" />";
        echo "\n        <label for=\"parent\">" . _("Parent Guides") . "</label>\n        {$parenthood}\n\n        {$screen_layout}\n    </div>\n    </div>\n    </div>\n    <!-- right hand column -->\n    <div class=\"pure-u-1-2\">";
        $content = "<input type=\"submit\" name=\"submit_record\"  class=\"pure-button pure-button-primary save-guide\" 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
        // make sure they're allowed to delete
        if ($this->_subject_id != "") {
            if (in_array($_SESSION["staff_id"], $this->_ok_staff) || $_SESSION["admin"] == 1) {
                $content .= " <input type=\"submit\" name=\"delete_record\" class=\"pure-button delete_button pure-button-warning delete-guide\" value=\"" . _("Delete Forever!") . "\" />";
            }
        }
        // get edit history
        $last_mod = _("Last modified: ") . lastModded("record", $this->_subject_id);
        $title = "<div id=\"last_edited\">{$last_mod}</div>";
        makePluslet($title, $content, "no_overflow");
        /////////////////
        // Staffers
        /////////////////
        $staffer_list = "";
        if ($this->_staffers == FALSE) {
            // No results
            $staffer_list = "";
        } else {
            // loop through results
            foreach ($this->_staffers as $value) {
                $staffer_list .= self::outputStaff($value);
            }
        }
        $qStaff = "select staff_id, CONCAT(fname, ' ', lname) as fullname FROM staff WHERE ptags LIKE '%records%' ORDER BY lname, fname";
        $querierStaff = new Querier();
        $staffArray = $querierStaff->query($qStaff);
        $staffMe = new Dropdown("staff_id[]", $staffArray, "", "50", "--Select--");
        $staff_string = $staffMe->display();
        /////////////////
        // Disciplines
        /////////////////
        if ($use_disciplines == TRUE) {
            $discipliner_list = "";
            if ($this->_discipliners == FALSE) {
                // No results
                $discipliner_list = "";
            } else {
                // loop through results
                foreach ($this->_discipliners as $value) {
                    $discipliner_list .= self::outputDisciplines($value);
                }
            }
            $qDiscipline = "select discipline_id, discipline FROM discipline ORDER BY discipline";
            $querierDiscipline = new Querier();
            $disciplineArray = $querierStaff->query($qDiscipline);
            $disciplineMe = new Dropdown("discipline_id[]", $disciplineArray, "", "50", "--Select--");
            $discipline_string = $disciplineMe->display();
        }
        $staff_box = "{$staff_string} <div id=\"item_list\">{$staffer_list}</div> <!-- staff inserted here -->";
        makePluslet(_("Staff"), $staff_box, "no_overflow");
        //////////////
        // Metadata
        //////////////
        $metadata_box = "\n        <label for=\"description\">" . _("Description") . "</label>\n        <textarea name=\"description\" id=\"record_description\" class=\"\" cols=\"35\" rows=\"2\">" . $this->_description . "</textarea>\n\n        <label for=\"keywords\">" . _("Keywords (separate with commas)") . "</label>\n        <input type=\"text\" name=\"keywords\" id=\"record_keywords\" size=\"40\" class=\"\" value=\"" . $this->_keywords . "\">\n        <label for=\"record_label\">" . _("Redirect Url (for non-SubjectsPlus content)") . "</label>\n        <input type=\"text\" name=\"redirect_url\" id=\"record_redirect_url\" size=\"40\" class=\"\" value=\"" . $this->_redirect_url . "\">\n        ";
        if ($use_disciplines == TRUE) {
            $metadata_box .= "<label for=\"discipline_list\">" . _("Parent Disciplines") . "</span><br />\n        {$discipline_string}\n        <div id=\"discipline_list\">{$discipliner_list}</div> <!-- disciplines inserted here -->\n        </div>";
        }
        makePluslet(_("Metadata (optional)"), $metadata_box, "no_overflow");
        echo "</div>\n</form>";
    }
Exemplo n.º 7
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;
     }
 }