示例#1
0
     echo " <option value='" . htmlspecialchars($USER->username) . "' " . ($searchUser == $USER->username ? " selected='selected'" : '') . ">" . get_string('search_by_self', ANNOTATION_STRINGS) . "</option>\n";
 }
 //			echo " <option value='*teachers'".('*teachers'==$searchBy?" selected='selected'":'').'>'.get_string( 'search_by_teachers', ANNOTATION_STRINGS )."</option>\n";
 //			echo " <option value='*students'".('*students'==$searchBy?" selected='selected'":'').'>'.get_string( 'search_by_students', ANNOTATION_STRINGS )."</option>\n";
 echo "</select>\n";
 echo "<label for='search-text'>" . get_string('search_text', ANNOTATION_STRINGS) . "</label>\n";
 echo "<input type='text' id='search-text' name='q' value='" . htmlspecialchars($searchQuery) . "'/>\n";
 echo "<input type='submit' value='" . get_string('go') . "'/>\n";
 echo "<input type='hidden' name='url' value='" . htmlspecialchars($summaryUrl) . "'/>\n";
 echo "</fieldset>\n";
 echo "</form>";
 // If this page is an error, explain what it's about
 if ('range-mismatch' == $errorPage) {
     echo "<p class='error'><em class='range-error'>!</em>" . get_string('summary_range_error', ANNOTATION_STRINGS) . "</p>\n";
 }
 echo "<p id='query'>" . get_string('prompt_search_desc', ANNOTATION_STRINGS) . ' ' . htmlspecialchars($query->desc(null)) . ":</p>\n";
 $curSection = null;
 $curSectionType = null;
 $curUser = null;
 $curUrl = null;
 // make sure some records came back
 if (null != $annotations) {
     echo "<table cellspacing='0' class='annotations'>";
     foreach ($annotations as $annotation) {
         // Display a heading for each new URL
         if ($annotation->section_type != $curSectionType || $annotation->section_url != $curSection) {
             if ($curSection != null) {
                 echo "</tbody>\n";
             }
             echo "<thead><tr><th colspan='{$nCols}'>";
             $a->section_type = htmlspecialchars($annotation->section_type);