コード例 #1
1
ファイル: FAQ.php プロジェクト: kenirwin/SubjectsPlus
 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>";
 }
コード例 #2
0
ファイル: tb_bits.php プロジェクト: johnwinsor/SubjectsPlus
function genTalkBacks($tbArray, $show_response = 1)
{
    global $IconPath;
    $row_count1 = 0;
    $row_count2 = 0;
    $colour1 = "evenrow";
    $colour2 = "oddrow";
    $tb_answer = "";
    foreach ($tbArray as $value) {
        $row_colour = $row_count2 % 2 ? $colour1 : $colour2;
        if ($value[2]) {
            $q_from = $value[2];
        } else {
            $q_from = _("Anonymous");
        }
        if (isset($show_response) && $show_response == 0) {
            $first_div_width = "90%";
            $last_mod_tb = "";
        } else {
            $first_div_width = "45%";
            $short_answer = stripslashes(htmlspecialchars_decode(TruncByWord($value["answer"], 15)));
            $last_mod_tb = lastModded("talkback", $value["talkback_id"], 0, 1);
        }
        $short_question = Truncate($value["question"], 200);
        if ($last_mod_tb) {
            $mod_line = _("--") . $last_mod_tb;
        } else {
            $mod_line = "";
        }
        $tb_answer .= "\n            <div style=\"clear: both; float: left;  padding: 3px 5px; width: 98%;\" class=\"striper {$row_colour}\">\n                <div style=\"float: left; width: 32px; max-width: 5%;\"><a class=\"showcustom\" style=\"color: #333;\" href=\"talkback.php?talkback_id={$value['0']}&amp;wintype=pop\"><i class=\"fa fa-pencil fa-lg\" alt=\"" . _("Edit") . "\"></i></a></div>\n                <div style=\"float: left; width: {$first_div_width};\">\n                 <strong>Q:</strong> {$short_question} <span style=\"color: #666; font-size: 10px;\">({$q_from}, {$value['date_formatted']})</span>\n                </div>";
        if (isset($show_response) && $show_response == 1) {
            $tb_answer .= "<div style=\"float: left; width: 45%; margin-left: 4%;\">\n                 <strong>A:</strong> {$short_answer} <span style=\"color: #666; font-size: 10px;\">{$mod_line}</span>\n                </div>\n            ";
        }
        $tb_answer .= "</div>";
        $row_count2++;
    }
    return $tb_answer;
}
コード例 #3
0
ファイル: Staff.php プロジェクト: johnwinsor/SubjectsPlus
 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>";
 }
コード例 #4
0
ファイル: index.php プロジェクト: johnwinsor/SubjectsPlus
    $limit = "";
}
$querierVid = new Querier();
$qVid = "SELECT video_id, title, description, source, foreign_id, duration, date, display, vtags\n\tFROM video\n\tORDER BY video_id DESC\n\t{$limit}";
$vidArray = $querierVid->query($qVid);
$row_count1 = 0;
$row_count2 = 0;
$colour1 = "evenrow";
$colour2 = "oddrow";
$vid_list = "";
if ($vidArray) {
    foreach ($vidArray as $value) {
        $row_colour1 = $row_count1 % 2 ? $colour1 : $colour2;
        $short_title = Truncate($value["title"], 200);
        $short_desc = stripslashes(htmlspecialchars_decode(TruncByWord($value["description"], 15)));
        $last_revised_line = lastModded("video", $value[0]);
        if ($value[7] != "1") {
            $activity = " <span style=\"color: #666;\">* " . _("unpublished") . "</span>";
        } else {
            $activity = "";
        }
        $vid_list .= "\n            <div style=\"clear: both; float: left;  padding: 3px 5px; width: 98%;\" class=\"striper {$row_colour1}\">\n                <div style=\"pluslet_body\">\n                <a  class=\"showmedium\" href=\"video.php?video_id={$value['0']}&amp;wintype=pop\"><i class=\"fa fa-pencil fa-lg\" alt=\"" . _("Edit") . "\"></i></a>\n                &nbsp; &nbsp;<a href=\"" . $VideoPath . "?video_id={$value['0']}\" target=\"_blank\"><i class=\"fa fa-eye fa-lg\" alt=\"" . _("View") . "\"></i></a>\n                </div>\n                <div style=\"float: left; width: 90%;\">\n                 {$short_title} <span style=\"color: #666; font-size: 10px;\">({$last_revised_line})</span> {$activity}\n                </div>\n            </div>";
        $row_count1++;
    }
} else {
    $vid_list = "<p>" . _("No Videos yet.  Grab your camera.") . "</p>";
}
$ingest_body_text = "<a href=\"ingest.php\">" . _("FIND VIDEOS") . "</a>";
$add_metadata_text = "<a href=\"video.php\">" . _("ENTER VIDEO") . "</a>";
$about_videos_text = "<p><i class=\"fa fa-pencil fa-lg\" alt=\"" . _("Edit") . "\"></i> = " . _("Edit") . "</p>\n    <p><i class=\"fa fa-eye fa-lg\" alt=\"" . _("View") . "\"></i> = " . _("View Video on Public Site") . "</p>";
print "<br />\n\n<div class=\"pure-g\">\n  <div class=\"pure-u-2-3\">  \n\n    <div class=\"pluslet no_overflow\" id=\"answered\">\n    <div class=\"titlebar\">" . _("Collected Videos") . "</div>\n    <p class=\"pluslet_body\"><strong>{$row_count1} " . _("Videos visible") . "</strong> ";
コード例 #5
0
ファイル: Guide.php プロジェクト: johnwinsor/SubjectsPlus
 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 ($wintype == "pop") {
         $copy_guide = "";
     } else {
         $copy_guide = "<a href='guide_copy.php'>" . _("Copy an Existing Guide") . "</a>";
     }
     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\t\t\t\t{$copy_guide}\n\t\t\t<label for=\"record_title\">" . _("Guide Title") . "</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;
     ////////////////////////////
     // 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        <br style=\"clear: both;\" />\n        <span class=\"smaller\">* " . _("Parent guides allow you to create a hierarchy") . "</span>\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("guide", $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%' AND active = '1' 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");
     ////////////////
     // Thumbnail Option
     ////////////////
     $thumbnail_box = _("If you want to associate a thumbnail image with this guide, put a file called [shortform].jpg in assets/images/guide_thumbs/ on the server.");
     $thumbnail_box .= "<p>" . _("E.g., musichistory.jpg, if your shortform is \"musichistory\".");
     $thumbnail_box .= "<p>" . _("Note that this is NOT required, and might NOT be implemented in your version of SubjectsPlus.");
     makePluslet(_("Thumbnail (VERY optional)"), $thumbnail_box, "no_overflow");
     echo "</div>\n</form>";
 }
コード例 #6
0
ファイル: Record.php プロジェクト: kenirwin/SubjectsPlus
 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>";
 }
コード例 #7
0
ファイル: index.php プロジェクト: kenirwin/SubjectsPlus
    $limit = "LIMIT 0,10";
}
$querierFAQ = new Querier();
$qFAQ = "SELECT faq_id, question, answer, keywords\n\tFROM faq\n\tORDER BY faq_id DESC\n\t{$limit}";
$faqArray = $querierFAQ->query($qFAQ);
$row_count1 = 0;
$row_count2 = 0;
$colour1 = "evenrow";
$colour2 = "oddrow";
$faq_list = "";
if ($faqArray) {
    foreach ($faqArray as $value) {
        $row_colour1 = $row_count1 % 2 ? $colour1 : $colour2;
        $short_question = Truncate($value["question"], 200);
        $short_answer = stripslashes(htmlspecialchars_decode(TruncByWord($value["answer"], 15)));
        $last_revised_line = lastModded("faq", $value[0]);
        // Answered FAQs
        $faq_list .= "\n            <div class=\"striper faq_wrapper {$row_colour1}\">\n                <div class=\"faq_tools\">\n                <a href=\"faq.php?faq_id={$value['0']}&amp;wintype=pop\" class=\"showmedium-reloader\"><img src=\"{$IconPath}/pencil.png\" alt=\"edit\" width=\"16\" height=\"16\" /></a>\n                &nbsp; &nbsp;<a href=\"" . $FAQPath . "?faq_id={$value['0']}\" target=\"_blank\"><img src=\"{$IconPath}/eye.png\" alt=\"edit\" width=\"16\" height=\"16\" /></a>\n                </div>\n                <div class=\"faq_question\">\n                 {$short_question} <span class=\"faq-short-question\">({$last_revised_line})</span>\n                </div>\n            </div>";
        $row_count1++;
    }
} else {
    $faq_list = "<p>" . _("No FAQs yet.  Why not dream one up?") . "</p>";
}
$faq_body = "<p><strong>{$row_count1} " . _("FAQs visible");
if (!isset($limit) || $limit != "all") {
    $faq_body .= " (<a href=\"index.php?limit=all\">" . _("See All") . "</a>)";
}
$faq_body .= "</strong></p>" . $faq_list;
?>
<div class="pure-g">
  <div class="pure-u-2-3">  
コード例 #8
0
    public function outputMetadataForm($wintype = "")
    {
        global $wysiwyg_desc;
        global $IconPath;
        global $guide_types;
        global $arcviveYes;
        global $archiveNo;
        global $archiveSelected;
        global $guide_headers;
        global $use_disciplines;
        $archiveMe = "";
        //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\n\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\n\n            ";
        /////////////////////
        // Archive checkboxes
        /////////////////////
        $archiveMe = "<label for=\"archive\">" . _("Archive") . "</label>\n         <input type=\"radio\" name=\"archive\" id=\"archive\" class=\"pure-input-1-4\"  value=1\"";
        if ($this->_archive == 1) {
            $archiveMe .= ' checked="checked"';
        }
        $archiveMe .= " /> " . _("Yes") . " <br />\n        <input type=\"radio\" name=\"archive\" id=\"archive\" class=\"pure-input-1-4\"  value=0\"";
        if ($this->_archive == 0) {
            $archiveMe .= ' checked="checked"';
        }
        $archiveMe .= " /> " . _("No");
        print $archiveMe;
        /////////////////////
        // Guide types dropdown
        /////////////////////
        echo "<label for=\"type\">" . _("Type of Guide") . "</label>";
        $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>";
    }
コード例 #9
0
ファイル: Talkback.php プロジェクト: johnwinsor/SubjectsPlus
 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");
 }
コード例 #10
0
ファイル: StaffBrief.php プロジェクト: kenirwin/SubjectsPlus
 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>";
 }
コード例 #11
0
ファイル: Video.php プロジェクト: kenirwin/SubjectsPlus
 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>";
 }
コード例 #12
0
ファイル: index.php プロジェクト: kenirwin/SubjectsPlus
function genTalkBacks($tbArray, $show_response = 1)
{
    global $IconPath;
    $row_count1 = 0;
    $row_count2 = 0;
    $colour1 = "evenrow";
    $colour2 = "oddrow";
    $tb_answer = "";
    if (!is_array($tbArray)) {
        return "<strong>" . _("Alas, there are no items with this tag.") . "</strong>";
    }
    foreach ($tbArray as $key => $value) {
        $tb_tagger = "";
        $row_colour = $row_count2 % 2 ? $colour1 : $colour2;
        if ($value[2]) {
            $q_from = $value[2];
        } else {
            $q_from = _("Anonymous");
        }
        if ($value["answer"] == '') {
            $row_colour = "tb_highlight";
        }
        //show tag even if answer is not empty
        $tb_tagger = "<span class=\"ctag-on\">" . $value["tbtags"] . "</span>";
        if (isset($show_response) && $show_response == 0) {
            $first_div_width = "90%";
            $last_mod_tb = "";
        } else {
            $first_div_width = "45%";
            $short_answer = stripslashes(htmlspecialchars_decode(TruncByWord($value["answer"], 15)));
            $last_mod_tb = lastModded("talkback", $value["talkback_id"], 0, 1);
        }
        $short_question = Truncate($value["question"], 200);
        if ($last_mod_tb) {
            $mod_line = _("--") . $last_mod_tb;
        } else {
            $mod_line = "";
        }
        $tb_answer .= "\n            <div style=\"clear: both; float: left;  padding: 3px 5px; width: 98%;\" class=\"striper {$row_colour}\">\n                <div style=\"float: left; width: 32px; max-width: 5%;\"><a class=\"showmedium-reloader\" style=\"color: #333;\" href=\"talkback.php?talkback_id={$value['0']}&amp;wintype=pop\"><img src=\"{$IconPath}/pencil.png\" alt=\"edit\" width=\"16\" height=\"16\" /></a></div>\n                <div style=\"float: left; width: {$first_div_width};\">\n                 {$tb_tagger}<strong>Q:</strong> {$short_question} <span style=\"color: #666; font-size: 10px;\">({$q_from}, {$value['date_formatted']})</span>\n                </div>";
        if (isset($show_response) && $show_response == 1) {
            $tb_answer .= "<div style=\"float: left; width: 45%; margin-left: 4%;\">\n                 <strong>A:</strong> {$short_answer} <span style=\"color: #666; font-size: 10px;\">{$mod_line}</span>\n                </div>\n            ";
        }
        $tb_answer .= "</div>";
        $row_count2++;
    }
    return $tb_answer;
}