2 $yesno = array('0'=>get_string('no'), '1'=>get_string('yes'));
5 <table cellspacing=
"0" cellpadding=
"5" border=
"0" class=
"boxaligncenter">
7 <th colspan=
"2" scope=
"col">
8 <?php print_string("server_settings", "enrol_database") ?>
12 <td align=
"right">enrol_dbtype:
</td>
15 $dbtypes = array("access","ado_access", "ado", "ado_mssql", "borland_ibase", "csv", "db2", "fbsql", "firebird", "ibase", "informix72", "informix", "mssql", "mssql_n", "mysql", "mysqlt", "oci805", "oci8", "oci8po", "odbc", "odbc_mssql", "odbc_oracle", "oracle", "postgres64", "postgres7", "postgres", "proxy", "sqlanywhere", "sybase", "vfp");
16 foreach ($dbtypes as $dbtype) {
17 $dboptions[$dbtype] = $dbtype;
19 if (!isset($frm->enrol_dbtype
)) {
20 $frm->enrol_dbtype
= 'mysql';
22 choose_from_menu($dboptions, "enrol_dbtype", $frm->enrol_dbtype
, '', '', '');
27 <?php print_string("dbtype","enrol_database") ?>
32 <td align=
"right">enrol_dbhost:
</td>
35 if (!isset($frm->enrol_dbhost
)) {
36 $frm->enrol_dbhost
= '';
39 <input size=
"15" type=
"text" name=
"enrol_dbhost" value=
"<?php p($frm->enrol_dbhost) ?>" />
42 <?php
print_string("dbhost","enrol_database") ?>
47 <td align=
"right">enrol_dbuser:
</td>
49 <input size=
"15" type=
"text" name=
"enrol_dbuser" value=
"<?php echo $frm->enrol_dbuser ?>" />
52 <?php
print_string("dbuser","enrol_database") ?>
57 <td align=
"right">enrol_dbpass:
</td>
59 <input size=
"15" type=
"password" name=
"enrol_dbpass" value=
"<?php echo $frm->enrol_dbpass ?>" />
62 <?php
print_string("dbpass","enrol_database") ?>
67 <td align=
"right">enrol_dbname:
</td>
69 <input size=
"15" type=
"text" name=
"enrol_dbname" value=
"<?php echo $frm->enrol_dbname ?>" />
72 <?php
print_string("dbname","enrol_database") ?>
77 <td align=
"right">enrol_dbtable:
</td>
79 <input size=
"15" type=
"text" name=
"enrol_dbtable" value=
"<?php echo $frm->enrol_dbtable ?>" />
82 <?php
print_string("dbtable","enrol_database") ?>
86 <th colspan=
"2" scope=
"col">
87 <?php print_string("remote_fields_mapping", "enrol_database") ?>
91 <td align=
"right">enrol_localcoursefield:
</td>
93 <input size=
"15" type=
"text" name=
"enrol_localcoursefield" value=
"<?php echo $frm->enrol_localcoursefield ?>" />
96 <?php
print_string("localcoursefield","enrol_database") ?>
101 <td align=
"right">enrol_localuserfield:
</td>
103 <input size=
"15" type=
"text" name=
"enrol_localuserfield" value=
"<?php echo $frm->enrol_localuserfield ?>" />
106 <?php
print_string("localuserfield","enrol_database") ?>
111 <td align=
"right">enrol_db_localrolefield:
</td>
113 <input size=
"15" type=
"text" name=
"enrol_db_localrolefield" value=
"<?php echo $frm->enrol_db_localrolefield ?>" />
116 <?php
print_string("localrolefield","enrol_database") ?>
121 <td align=
"right">enrol_remotecoursefield:
</td>
123 <input size=
"15" type=
"text" name=
"enrol_remotecoursefield" value=
"<?php echo $frm->enrol_remotecoursefield ?>" />
126 <?php
print_string("remotecoursefield","enrol_database") ?>
131 <td align=
"right">enrol_remoteuserfield:
</td>
133 <input size=
"15" type=
"text" name=
"enrol_remoteuserfield" value=
"<?php echo $frm->enrol_remoteuserfield ?>" />
136 <?php
print_string("remoteuserfield","enrol_database") ?>
141 <td align=
"right">enrol_db_remoterolefield:
</td>
143 <input size=
"15" type=
"text" name=
"enrol_db_remoterolefield" value=
"<?php echo $frm->enrol_db_remoterolefield ?>" />
146 <?php
print_string("remoterolefield","enrol_database") ?>
151 <th colspan=
"2" scope=
"col">
152 <?php print_string('roles', 'role') ?>
156 <td align=
"right">enrol_db_defaultcourseroleid:
</td>
159 $sitecontext = get_context_instance(CONTEXT_SYSTEM
, SITEID
);
160 $assignableroles = get_assignable_roles($sitecontext);
161 $assignableroles = array('' => get_string('default')) +
$assignableroles;
163 choose_from_menu($assignableroles, 'enrol_db_defaultcourseroleid', $frm->enrol_db_defaultcourseroleid
, '');
164 if (isset($err['enrol_db_defaultcourseroleid'])) formerr($err['enrol_db_defaultcourseroleid']);
168 <?php print_string("defaultcourseroleid","enrol_database") ?>
173 <th colspan=
"2" scope=
"col">
174 <?php print_string("enrol_database_autocreation_settings", "enrol_database") ?>
178 <td align=
"right">enrol_db_autocreate:
</td>
181 choose_from_menu($yesno, "enrol_db_autocreate", $frm->enrol_db_autocreate
, "");
182 if (isset($err["enrol_db_autocreate"])) formerr($err["enrol_db_autocreate"]);
186 <?php print_string("autocreate","enrol_database") ?>
191 <td align=
"right">enrol_db_category:
</td>
194 $displaylist = array();
195 $parentlist = array();
196 make_categories_list($displaylist, $parentlist);
197 choose_from_menu($displaylist, "enrol_db_category", $frm->enrol_db_category
, "");
200 <?php if (isset($err["enrol_db_category"])) formerr($err["enrol_db_category"]); ?>
202 <?php print_string("category","enrol_database") ?>
207 <td align=
"right">enrol_db_template:
</td>
209 <input name=
"enrol_db_template" type=
"text" size=
"30" value=
"<?php echo $frm->enrol_db_template?>" />
210 <?php
if (isset($err["enrol_db_template"])) formerr($err["enrol_db_template"]); ?>
212 <?php print_string("template","enrol_database") ?>
217 <th colspan=
"2" scope=
"col">
218 <?php print_string("general_options", "enrol_database") ?>
223 <td align=
"right">enrol_db_ignorehiddencourse:
</td>
226 choose_from_menu($yesno, "enrol_db_ignorehiddencourse", $frm->enrol_db_ignorehiddencourse
, "");
227 if (isset($err['enrol_db_ignorehiddencourse'])) {
228 formerr($err['enrol_db_ignorehiddencourse']);
233 <?php print_string('ignorehiddencourse', 'enrol_database' ); ?>
238 <td align=
"right">enrol_db_disableunenrol:
</td>
241 choose_from_menu($yesno, "enrol_db_disableunenrol", $frm->enrol_db_disableunenrol
, "");
242 if (isset($err['enrol_db_disableunenrol'])) {
243 formerr($err['enrol_db_disableunenrol']);
248 <?php print_string('disableunenrol', 'enrol_database' ); ?>