mirror of
https://github.com/moodle/moodle.git
synced 2025-04-05 00:12:42 +02:00
MDL-63653 tool_xmldb: style form elements
This commit is contained in:
parent
dccda6546b
commit
3a7117bb5b
@ -125,7 +125,9 @@ class edit_field extends XMLDBAction {
|
||||
$o.= ' <tr valign="top"><td><label for="name" accesskey="n">Name:</label></td><td colspan="2"><input name="name" type="text" size="'.xmldb_field::NAME_MAX_LENGTH.'" maxlength="'.xmldb_field::NAME_MAX_LENGTH.'" id="name" value="' . s($field->getName()) . '" /></td></tr>';
|
||||
}
|
||||
// XMLDB field comment
|
||||
$o.= ' <tr valign="top"><td><label for="comment" accesskey="c">Comment:</label></td><td colspan="2"><textarea name="comment" rows="3" cols="80" id="comment">' . s($field->getComment()) . '</textarea></td></tr>';
|
||||
$o .= ' <tr valign="top"><td><label for="comment" accesskey="c">Comment:</label></td><td colspan="2">
|
||||
<textarea name="comment" rows="3" cols="80" id="comment" class="form-control">' .
|
||||
s($field->getComment()) . '</textarea></td></tr>';
|
||||
// xmldb_field Type
|
||||
$typeoptions = array (XMLDB_TYPE_INTEGER => $field->getXMLDBTypeName(XMLDB_TYPE_INTEGER),
|
||||
XMLDB_TYPE_NUMBER => $field->getXMLDBTypeName(XMLDB_TYPE_NUMBER),
|
||||
@ -167,7 +169,8 @@ class edit_field extends XMLDBAction {
|
||||
$o.= ' <tr valign="top"><td><label for="default" accesskey="d">Default:</label></td>';
|
||||
$o.= ' <td colspan="2"><input type="text" name="default" size="30" maxlength="80" id="default" value="' . s($field->getDefault()) . '" /></td></tr>';
|
||||
// Change button
|
||||
$o.= ' <tr valign="top"><td> </td><td colspan="2"><input type="submit" value="' .$this->str['change'] . '" /></td></tr>';
|
||||
$o .= ' <tr valign="top"><td> </td><td colspan="2"><input type="submit" value="' . $this->str['change'] .
|
||||
'" class="btn btn-secondary" /></td></tr>';
|
||||
$o.= ' </table>';
|
||||
$o.= '</div></form>';
|
||||
// Calculate the buttons
|
||||
|
@ -115,7 +115,9 @@ class edit_index extends XMLDBAction {
|
||||
}
|
||||
$o.= ' <tr valign="top"><td><label for="name" accesskey="n">Name:</label></td><td colspan="2"><input name="name" type="text" size="'.xmldb_field::NAME_MAX_LENGTH.'" id="name"' . $disabled . ' value="' . s($index->getName()) . '" /></td></tr>';
|
||||
// XMLDB key comment
|
||||
$o.= ' <tr valign="top"><td><label for="comment" accesskey="c">Comment:</label></td><td colspan="2"><textarea name="comment" rows="3" cols="80" id="comment">' . s($index->getComment()) . '</textarea></td></tr>';
|
||||
$o .= ' <tr valign="top"><td><label for="comment" accesskey="c">Comment:</label></td><td colspan="2">
|
||||
<textarea name="comment" rows="3" cols="80" id="comment" class="form-control">' .
|
||||
s($index->getComment()) . '</textarea></td></tr>';
|
||||
// xmldb_index Type
|
||||
$typeoptions = array (0 => 'not unique',
|
||||
1 => 'unique');
|
||||
@ -129,7 +131,8 @@ class edit_index extends XMLDBAction {
|
||||
$o.= ' <tr valign="top"><td><label for="hints" accesskey="h">Hints:</label></td>';
|
||||
$o.= ' <td colspan="2"><input name="hints" type="text" size="40" maxlength="80" id="hints" value="' . s(implode(', ', $index->getHints())) . '" /></td></tr>';
|
||||
// Change button
|
||||
$o.= ' <tr valign="top"><td> </td><td colspan="2"><input type="submit" value="' .$this->str['change'] . '" /></td></tr>';
|
||||
$o .= ' <tr valign="top"><td> </td><td colspan="2"><input type="submit" value="' .
|
||||
$this->str['change'] . '" class="btn btn-secondary"/></td></tr>';
|
||||
$o.= ' </table>';
|
||||
$o.= '</div></form>';
|
||||
// Calculate the buttons
|
||||
|
@ -115,7 +115,9 @@ class edit_key extends XMLDBAction {
|
||||
}
|
||||
$o.= ' <tr valign="top"><td><label for="name" accesskey="n">Name:</label></td><td colspan="2"><input name="name" type="text" size="'.xmldb_field::NAME_MAX_LENGTH.'" id="name"' . $disabled . ' value="' . s($key->getName()) . '" /></td></tr>';
|
||||
// XMLDB key comment
|
||||
$o.= ' <tr valign="top"><td><label for="comment" accesskey="c">Comment:</label></td><td colspan="2"><textarea name="comment" rows="3" cols="80" id="comment">' . s($key->getComment()) . '</textarea></td></tr>';
|
||||
$o .= ' <tr valign="top"><td><label for="comment" accesskey="c">Comment:</label></td><td colspan="2">
|
||||
<textarea name="comment" rows="3" cols="80" id="comment" class="form-control">' .
|
||||
s($key->getComment()) . '</textarea></td></tr>';
|
||||
// xmldb_key Type
|
||||
$typeoptions = array (XMLDB_KEY_PRIMARY => $key->getXMLDBKeyName(XMLDB_KEY_PRIMARY),
|
||||
XMLDB_KEY_UNIQUE => $key->getXMLDBKeyName(XMLDB_KEY_UNIQUE),
|
||||
@ -139,7 +141,8 @@ class edit_key extends XMLDBAction {
|
||||
$o.= ' <tr valign="top"><td><label for="reffields" accesskey="t">Reffields:</label></td>';
|
||||
$o.= ' <td colspan="2"><input name="reffields" type="text" size="40" maxlength="80" id="reffields" value="' . s(implode(', ', $key->getRefFields())) . '" /></td></tr>';
|
||||
// Change button
|
||||
$o.= ' <tr valign="top"><td> </td><td colspan="2"><input type="submit" value="' .$this->str['change'] . '" /></td></tr>';
|
||||
$o .= ' <tr valign="top"><td> </td><td colspan="2"><input type="submit" value="' .
|
||||
$this->str['change'] . '" class="btn btn-secondary"/></td></tr>';
|
||||
$o.= ' </table>';
|
||||
$o.= '</div></form>';
|
||||
// Calculate the buttons
|
||||
|
@ -132,8 +132,11 @@ class edit_table extends XMLDBAction {
|
||||
} else {
|
||||
$o.= ' <tr valign="top"><td><label for="name" accesskey="p">Name:</label></td><td><input name="name" type="text" size="'.xmldb_table::NAME_MAX_LENGTH.'" maxlength="'.xmldb_table::NAME_MAX_LENGTH.'" id="name" value="' . s($table->getName()) . '" /></td></tr>';
|
||||
}
|
||||
$o.= ' <tr valign="top"><td><label for="comment" accesskey="c">Comment:</label></td><td><textarea name="comment" rows="3" cols="80" id="comment">' . s($table->getComment()) . '</textarea></td></tr>';
|
||||
$o.= ' <tr valign="top"><td> </td><td><input type="submit" value="' .$this->str['change'] . '" /></td></tr>';
|
||||
$o .= ' <tr valign="top"><td><label for="comment" accesskey="c">Comment:</label></td><td>
|
||||
<textarea name="comment" rows="3" cols="80" id="comment" class="form-control">' .
|
||||
s($table->getComment()) . '</textarea></td></tr>';
|
||||
$o .= ' <tr valign="top"><td> </td><td><input type="submit" value="' . $this->str['change'] .
|
||||
'" class="btn btn-secondary"/></td></tr>';
|
||||
$o.= ' </table>';
|
||||
$o.= '</div></form>';
|
||||
// Calculate the pending changes / save message
|
||||
|
@ -119,8 +119,11 @@ class edit_xml_file extends XMLDBAction {
|
||||
$o .= ' <table id="formelements">';
|
||||
$o.= ' <tr valign="top"><td>Path:</td><td>' . s($structure->getPath()) . '</td></tr>';
|
||||
$o.= ' <tr valign="top"><td>Version:</td><td>' . s($structure->getVersion()) . '</td></tr>';
|
||||
$o.= ' <tr valign="top"><td><label for="comment" accesskey="c">Comment:</label></td><td><textarea name="comment" rows="3" cols="80" id="comment">' . $structure->getComment() . '</textarea></td></tr>';
|
||||
$o.= ' <tr><td> </td><td><input type="submit" value="' .$this->str['change'] . '" /></td></tr>';
|
||||
$o .= ' <tr valign="top"><td><label for="comment" accesskey="c">Comment:</label></td><td>
|
||||
<textarea name="comment" rows="3" cols="80" id="comment" class="form-control">' .
|
||||
$structure->getComment() . '</textarea></td></tr>';
|
||||
$o .= ' <tr><td> </td><td><input type="submit" value="' . $this->str['change'] .
|
||||
'"class="btn btn-secondary" /></td></tr>';
|
||||
$o.= ' </table>';
|
||||
$o.= '</div></form>';
|
||||
// Calculate the pending changes / save message
|
||||
|
@ -114,7 +114,7 @@ class view_reserved_words extends XMLDBAction {
|
||||
// The textarea showing all the reserved words
|
||||
$o.= ' <table id="formelements" class="boxaligncenter" cellpadding="5">';
|
||||
$o.= ' <tr><td align="center">' . $this->str['listreservedwords'].'</td></tr>';
|
||||
$o.= ' <tr><td><textarea cols="80" rows="32">';
|
||||
$o .= ' <tr><td><textarea cols="80" rows="32" class="form-control">';
|
||||
$o.= s(implode(', ', array_keys($reserved_words)));
|
||||
$o.= '</textarea></td></tr>';
|
||||
$o.= ' </table>';
|
||||
|
@ -119,7 +119,7 @@ class view_structure_php extends XMLDBAction {
|
||||
$o.= ' </table>';
|
||||
$o.= '</div></form>';
|
||||
$o.= ' <table id="phpcode" class="boxaligncenter" cellpadding="5">';
|
||||
$o.= ' <tr><td><textarea cols="80" rows="32">';
|
||||
$o .= ' <tr><td><textarea cols="80" rows="32" class="form-control">';
|
||||
// Based on current params, call the needed function
|
||||
switch ($commandparam) {
|
||||
case 'create_table':
|
||||
|
@ -86,7 +86,7 @@ class view_structure_sql extends XMLDBAction {
|
||||
$o = $b;
|
||||
|
||||
$o.= ' <table id="formelements" class="boxaligncenter" cellpadding="5">';
|
||||
$o.= ' <tr><td><textarea cols="80" rows="32">';
|
||||
$o .= ' <tr><td><textarea cols="80" rows="32" class="form-control">';
|
||||
// Get an array of statements
|
||||
if ($starr = $DB->get_manager()->generator->getCreateStructureSQL($structure)) {
|
||||
$starr = $dbman->generator->getEndedStatements($starr);
|
||||
|
@ -169,7 +169,7 @@ class view_table_php extends XMLDBAction {
|
||||
$o.= '</div></form>';
|
||||
|
||||
$o.= ' <table id="phpcode" class="boxaligncenter" cellpadding="5">';
|
||||
$o.= ' <tr><td><textarea cols="80" rows="32">';
|
||||
$o .= ' <tr><td><textarea cols="80" rows="32" class="form-control">';
|
||||
// Check we have selected some field/key/index from the popup
|
||||
if ($fieldkeyindexparam == 'fieldshead' || $fieldkeyindexparam == 'keyshead' || $fieldkeyindexparam == 'indexeshead') {
|
||||
$o.= s($this->str['selectonefieldkeyindex']);
|
||||
|
@ -93,7 +93,7 @@ class view_table_sql extends XMLDBAction {
|
||||
$o = $b;
|
||||
|
||||
$o.= ' <table id="formelements" class="boxaligncenter" cellpadding="5">';
|
||||
$o.= ' <tr><td><textarea cols="80" rows="32">';
|
||||
$o .= ' <tr><td><textarea cols="80" rows="32" class="form-control">';
|
||||
|
||||
// Get an array of statements
|
||||
if ($starr = $DB->get_manager()->generator->getCreateTableSQL($table)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user