File: edit.html

package info (click to toggle)
moodle 1.4.4.dfsg.1-3sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 57,876 kB
  • ctags: 29,496
  • sloc: php: 271,617; sql: 5,084; xml: 702; perl: 638; sh: 403; java: 283; makefile: 42; pascal: 21
file content (192 lines) | stat: -rw-r--r-- 6,742 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<form name="form" method="post" action="edit.php" enctype="multipart/form-data">
<table border="0" cellpadding="5">
<?php
if (isset($errors)) {
?>
    <tr valign=top>
        <td colspan=2 align=center><strong><font color=red><?php p($errors) ?></font></strong>
        </td>
    </tr>
<?php
}
?>
<tr valign=top>
<td colspan=2>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="5">
        <tr>
          <td width="150" align=right><p><b><?php echo get_string("concept","glossary") ?>:</b></p></td>
          <td><input type="text" name="concept" size=30 value="<?php p(clean_text($newentry->concept)) ?>"></td>
        </tr>
        <tr>
          <td align="right"><p><b><?php echo get_string("categories","glossary") ?>:</b></p></td>
          <td valign="top">
    <?php
        $categories = get_records("glossary_categories","glossaryid",$glossary->id,'name ASC');
        echo "<select size=\"5\" name=\"categories[]\" multiple=\"yes\">";
        echo "<option value=\"0\">" . get_string("notcategorised","glossary") . "</option>";

        if ( $categories ) {
            foreach ( $categories as $category ) {
                echo "  <option ";
                if (isset($newentry->id)) {
                    if ( record_exists("glossary_entries_categories","entryid",$newentry->id,"categoryid",$category->id) ) {
                        echo "selected " ;
                    }
                }
                echo "value=\"$category->id\">".clean_text($category->name)."</option>\n";
            }
        }
        echo "</select>\n";
    ?>
          </td>
        </tr>
      </table></td>
    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="5">
        <tr>
          <td valign="top" align=right><p><b>
            <?php
              echo get_string("aliases","glossary");
              echo ':<br />';
              helpbutton("aliases", strip_tags(get_string("aliases", "glossary")), "glossary");
            ?></b></p>
          </td>
          <td valign="top">
             <textarea rows="2" name="aliases" cols="20"><?php p(clean_text($newentry->aliases)) ?></textarea>
          </td>
        </tr>
        <tr>
          <td colspan="2">
<?php
    if ( !$glossary->usedynalink ) {
      echo '<input type="hidden" name=usedynalink value="0">';
      echo '<input type="hidden" name=casesensitive value="0">';
      echo '<input type="hidden" name=fullmatch value="0">';
    } else {
        echo '<script>var items = [\'casesensitive\',\'fullmatch\'];</script>';

        if (!empty($newentry->usedynalink)) {
            $selected = "checked";
        } else {
            $selected = "";
        }
        echo '<input type="checkbox" name="usedynalink" value=1 ' . $selected . ' onclick="return lockoptions(\'form\',\'usedynalink\', items)"> ';
        echo '<font size="-1">';
        print_string("entryusedynalink","glossary");
        echo '</font>';
        echo helpbutton("usedynalinkentry", strip_tags(get_string("usedynalink", "glossary")), "glossary");
        echo '<br />';

        if (!empty($newentry->casesensitive)) {
            $selected = "checked";
        } else {
            $selected = "";
        }
        echo '<input type="checkbox" name="casesensitive" value=1 ' . $selected . '> ';
        echo '<font size="-1">';
        print_string("casesensitive","glossary");
        echo '</font>';
        echo helpbutton("casesensitive", strip_tags(get_string("casesensitive", "glossary")), "glossary");
        echo '<br />';


        if (!empty($newentry->fullmatch)) {
            $selected = "checked";
        } else {
            $selected = "";
        }
        echo '<input type="checkbox" name="fullmatch" value=1 ' . $selected . '> ';
        echo '<font size="-1">';
        print_string("fullmatch","glossary");
        echo '</font>';
        echo helpbutton("fullmatch", strip_tags(get_string("fullmatch", "glossary")), "glossary");
        echo '<br />';
    }
?>
          </td>
        </tr>
      </table></td>
  </tr>
</table>
</td>
</tr>
<tr valign="top">
    <td align=right><p><b>
     <?php print_string("definition", "glossary"); ?>:
     </b></p></td>
    <td align="left" rowspan="2">
    <?php print_textarea($usehtmleditor, 25, 65, 630, 400, "text", $newentry->definition); ?>
    </td>
</tr>
<tr valign="top">
    <td align="right" valign="center" nowrap>

    <font SIZE="1">
     <?php
        helpbutton("writing", get_string("helpwriting"), "moodle", true, true);
        echo "<br />";
        if ($usehtmleditor) {
           helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
        } else {
           emoticonhelpbutton("form", "text");
        }
      ?>
     <br />
     </font>

    </td>
</tr>
<tr valign=top>
    <td align=right><p><b><?php print_string("formattexttype"); ?>:</b></p></td>
    <td>
    <?php
        if ($usehtmleditor) {   /// Trying this out for a while
            print_string('formathtml');
            echo '<input type="hidden" name="format" value="'.FORMAT_HTML.'">';
        } else {
            if (!isset($newentry->format)) {
                $newentry->format = $defaultformat;
            }
            choose_from_menu(format_text_menu(), "format", $newentry->format, "");
        }
        helpbutton("textformat", get_string("helpformatting"));
     ?>
    </td>
</tr>

<tr valign=top>
    <td align=right><p><b><?php print_string("attachment", "glossary") ?>:<br />(<?php print_string("optional") ?>)&nbsp;</b></p></td>
    <td>
    <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo get_max_upload_file_size($CFG->maxbytes, $course->maxbytes) ?>">
    <input type="file" name="attachment" size=40>
    <?php
       helpbutton("attachment", get_string("attachment", "glossary"), "glossary");
       print_string("maxsize", "", display_size(get_max_upload_file_size($CFG->maxbytes, $course->maxbytes)));
    ?>
    </td>
</tr>
<tr>
<td colspan=2>
    <p align=center>
    <?php if (isset($newentry->id)) {
        echo "<input type=\"hidden\" name=e value=\"$newentry->id\">";
      }
  ?>

  <input type="hidden" name=husedynalink value="1">
  <input type="hidden" name=hcasesensitive value="0">
  <input type="hidden" name=hfullmatch value="1">

  <input type="hidden" name=id value="<?php p($cm->id) ?>">
  <input type="hidden" name=mode value="<?php p($mode) ?>">
  <input type="hidden" name=hook value="<?php p($hook) ?>">
  <input type="hidden" name=confirm value="1">

  <input type="submit" value="<?php print_string("savechanges") ?>">
  <input type="reset" value="<?php print_string("revert") ?>">
  </P>
</td>
</tr>
</table>
</form>