/** * Get HTML for properties items * * @param string $section name of config section in * $GLOBALS['cfg'][$section] for plugin * @param string $plugin_name unique plugin name * @param OptionsPropertyItem $propertyItem Property item * * @return string */ function PMA_getHtmlForProperty($section, $plugin_name, $propertyItem) { $ret = null; $property_class = get_class($propertyItem); switch ($property_class) { case 'PMA\\libraries\\properties\\options\\items\\BoolPropertyItem': $ret .= '<li>' . "\n"; $ret .= '<input type="checkbox" name="' . $plugin_name . '_' . $propertyItem->getName() . '"' . ' value="something" id="checkbox_' . $plugin_name . '_' . $propertyItem->getName() . '"' . ' ' . PMA_pluginCheckboxCheck($section, $plugin_name . '_' . $propertyItem->getName()); if ($propertyItem->getForce() != null) { // Same code is also few lines lower, update both if needed $ret .= ' onclick="if (!this.checked && ' . '(!document.getElementById(\'checkbox_' . $plugin_name . '_' . $propertyItem->getForce() . '\') ' . '|| !document.getElementById(\'checkbox_' . $plugin_name . '_' . $propertyItem->getForce() . '\').checked)) ' . 'return false; else return true;"'; } $ret .= ' />'; $ret .= '<label for="checkbox_' . $plugin_name . '_' . $propertyItem->getName() . '">' . PMA_getString($propertyItem->getText()) . '</label>'; break; case 'PMA\\libraries\\properties\\options\\items\\DocPropertyItem': echo 'PMA\\libraries\\properties\\options\\items\\DocPropertyItem'; break; case 'PMA\\libraries\\properties\\options\\items\\HiddenPropertyItem': $ret .= '<li><input type="hidden" name="' . $plugin_name . '_' . $propertyItem->getName() . '"' . ' value="' . PMA_pluginGetDefault($section, $plugin_name . '_' . $propertyItem->getName()) . '"' . ' /></li>'; break; case 'PMA\\libraries\\properties\\options\\items\\MessageOnlyPropertyItem': $ret .= '<li>' . "\n"; $ret .= '<p>' . PMA_getString($propertyItem->getText()) . '</p>'; break; case 'PMA\\libraries\\properties\\options\\items\\RadioPropertyItem': $default = PMA_pluginGetDefault($section, $plugin_name . '_' . $propertyItem->getName()); foreach ($propertyItem->getValues() as $key => $val) { $ret .= '<li><input type="radio" name="' . $plugin_name . '_' . $propertyItem->getName() . '" value="' . $key . '" id="radio_' . $plugin_name . '_' . $propertyItem->getName() . '_' . $key . '"'; if ($key == $default) { $ret .= ' checked="checked"'; } $ret .= ' />' . '<label for="radio_' . $plugin_name . '_' . $propertyItem->getName() . '_' . $key . '">' . PMA_getString($val) . '</label></li>'; } break; case 'PMA\\libraries\\properties\\options\\items\\SelectPropertyItem': $ret .= '<li>' . "\n"; $ret .= '<label for="select_' . $plugin_name . '_' . $propertyItem->getName() . '" class="desc">' . PMA_getString($propertyItem->getText()) . '</label>'; $ret .= '<select name="' . $plugin_name . '_' . $propertyItem->getName() . '"' . ' id="select_' . $plugin_name . '_' . $propertyItem->getName() . '">'; $default = PMA_pluginGetDefault($section, $plugin_name . '_' . $propertyItem->getName()); foreach ($propertyItem->getValues() as $key => $val) { $ret .= '<option value="' . $key . '"'; if ($key == $default) { $ret .= ' selected="selected"'; } $ret .= '>' . PMA_getString($val) . '</option>'; } $ret .= '</select>'; break; case 'PMA\\libraries\\properties\\options\\items\\TextPropertyItem': case 'PMA\\libraries\\properties\\options\\items\\NumberPropertyItem': $ret .= '<li>' . "\n"; $ret .= '<label for="text_' . $plugin_name . '_' . $propertyItem->getName() . '" class="desc">' . PMA_getString($propertyItem->getText()) . '</label>'; $ret .= '<input type="text" name="' . $plugin_name . '_' . $propertyItem->getName() . '"' . ' value="' . PMA_pluginGetDefault($section, $plugin_name . '_' . $propertyItem->getName()) . '"' . ' id="text_' . $plugin_name . '_' . $propertyItem->getName() . '"' . ($propertyItem->getSize() != null ? ' size="' . $propertyItem->getSize() . '"' : '') . ($propertyItem->getLen() != null ? ' maxlength="' . $propertyItem->getLen() . '"' : '') . ' />'; break; default: break; } return $ret; }
/** * Prints Html For Display Import options : Partial Import * * @param String $timeout_passed timeout passed * @param String $offset timeout offset * * @return string */ function PMA_getHtmlForImportOptionsPartialImport($timeout_passed, $offset) { $html = ' <div class="importoptions">'; $html .= ' <h3>' . __('Partial import:') . '</h3>'; if (isset($timeout_passed) && $timeout_passed) { $html .= '<div class="formelementrow">' . "\n"; $html .= '<input type="hidden" name="skip" value="' . $offset . '" />'; $html .= sprintf(__('Previous import timed out, after resubmitting ' . 'will continue from position %d.'), $offset); $html .= '</div>' . "\n"; } $html .= ' <div class="formelementrow">'; $html .= ' <input type="checkbox" name="allow_interrupt" value="yes"'; $html .= ' id="checkbox_allow_interrupt" ' . PMA_pluginCheckboxCheck('Import', 'allow_interrupt') . '/>'; $html .= ' <label for="checkbox_allow_interrupt">' . __('Allow the interruption of an import in case the script detects ' . 'it is close to the PHP timeout limit. <i>(This might be a good way' . ' to import large files, however it can break transactions.)</i>') . '</label><br />'; $html .= ' </div>'; if (!(isset($timeout_passed) && $timeout_passed)) { $html .= ' <div class="formelementrow">'; $html .= ' <label for="text_skip_queries">' . __('Skip this number of queries (for SQL) or lines (for other ' . 'formats), starting from the first one:') . '</label>'; $html .= ' <input type="number" name="skip_queries" value="' . PMA_pluginGetDefault('Import', 'skip_queries') . '" id="text_skip_queries" min="0" />'; $html .= ' </div>'; } else { // If timeout has passed, // do not show the Skip dialog to avoid the risk of someone // entering a value here that would interfere with "skip" $html .= ' <input type="hidden" name="skip_queries" value="' . PMA_pluginGetDefault('Import', 'skip_queries') . '" id="text_skip_queries" />'; } $html .= ' </div>'; return $html; }
echo __('Partial Import:'); ?> </h3> <?php if (isset($timeout_passed) && $timeout_passed) { echo '<div class="formelementrow">' . "\n"; echo '<input type="hidden" name="skip" value="' . $offset . '" />'; echo sprintf(__('Previous import timed out, after resubmitting will continue from position %d.'), $offset) . ''; echo '</div>' . "\n"; } ?> <div class="formelementrow"> <input type="checkbox" name="allow_interrupt" value="yes" id="checkbox_allow_interrupt" <?php echo PMA_pluginCheckboxCheck('Import', 'allow_interrupt'); ?> /> <label for="checkbox_allow_interrupt"><?php echo __('Allow the interruption of an import in case the script detects it is close to the PHP timeout limit. <i>(This might be good way to import large files, however it can break transactions.)</i>'); ?> </label><br /> </div> <?php if (!(isset($timeout_passed) && $timeout_passed)) { ?> <div class="formelementrow"> <label for="text_skip_queries"><?php echo __('Number of rows to skip, starting from the first row:'); ?>
/** * string PMA_pluginGetOneOption(string $section, string $plugin_name, string $id, array &$opt) * * returns single option in a table row * * @uses PMA_getString() * @uses PMA_pluginCheckboxCheck() * @uses PMA_pluginGetDefault() * @param string $section name of config section in * $GLOBALS['cfg'][$section] for plugin * @param string $plugin_name unique plugin name * @param string $id option id * @param array &$opt plugin option details * @return string table row with option */ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt) { $ret = "\n"; if ($opt['type'] == 'bool') { $ret .= '<div class="formelementrow">' . "\n"; $ret .= '<input type="checkbox" name="' . $plugin_name . '_' . $opt['name'] . '"' . ' value="something" id="checkbox_' . $plugin_name . '_' . $opt['name'] . '"' . ' ' . PMA_pluginCheckboxCheck($section, $plugin_name . '_' . $opt['name']); if (isset($opt['force'])) { /* Same code is also few lines lower, update both if needed */ $ret .= ' onclick="if (!this.checked && ' . '(!document.getElementById(\'checkbox_' . $plugin_name . '_' . $opt['force'] . '\') ' . '|| !document.getElementById(\'checkbox_' . $plugin_name . '_' . $opt['force'] . '\').checked)) ' . 'return false; else return true;"'; } $ret .= ' />'; $ret .= '<label for="checkbox_' . $plugin_name . '_' . $opt['name'] . '">' . PMA_getString($opt['text']) . '</label>'; $ret .= '</div>' . "\n"; } elseif ($opt['type'] == 'text') { $ret .= '<div class="formelementrow">' . "\n"; $ret .= '<label for="text_' . $plugin_name . '_' . $opt['name'] . '" class="desc">' . PMA_getString($opt['text']) . '</label>'; $ret .= '<input type="text" name="' . $plugin_name . '_' . $opt['name'] . '"' . ' value="' . PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']) . '"' . ' id="text_' . $plugin_name . '_' . $opt['name'] . '"' . (isset($opt['size']) ? ' size="' . $opt['size'] . '"' : '') . (isset($opt['len']) ? ' maxlength="' . $opt['len'] . '"' : '') . ' />'; $ret .= '</div>' . "\n"; } elseif ($opt['type'] == 'message_only') { $ret .= '<div class="formelementrow">' . "\n"; $ret .= '<label for="text_' . $plugin_name . '_' . $opt['name'] . '" class="desc">' . PMA_getString($opt['text']) . '</label>'; $ret .= '</div>' . "\n"; } elseif ($opt['type'] == 'select') { $ret .= '<div class="formelementrow">' . "\n"; $ret .= '<label for="select_' . $plugin_name . '_' . $opt['name'] . '" class="desc">' . PMA_getString($opt['text']) . '</label>'; $ret .= '<select name="' . $plugin_name . '_' . $opt['name'] . '"' . ' id="select_' . $plugin_name . '_' . $opt['name'] . '">'; $default = PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']); foreach ($opt['values'] as $key => $val) { $ret .= '<option name="' . $key . '"'; if ($key == $default) { $ret .= ' selected="selected"'; } $ret .= '>' . PMA_getString($val) . '</option>'; } $ret .= '</select>'; $ret .= '</div>' . "\n"; } elseif ($opt['type'] == 'hidden') { $ret .= '<input type="hidden" name="' . $plugin_name . '_' . $opt['name'] . '"' . ' value="' . PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']) . '"' . ' />'; } elseif ($opt['type'] == 'bgroup') { $ret .= '<fieldset><legend>'; /* No checkbox without name */ if (!empty($opt['name'])) { $ret .= '<input type="checkbox" name="' . $plugin_name . '_' . $opt['name'] . '"' . ' value="something" id="checkbox_' . $plugin_name . '_' . $opt['name'] . '"' . ' ' . PMA_pluginCheckboxCheck($section, $plugin_name . '_' . $opt['name']); if (isset($opt['force'])) { /* Same code is also few lines higher, update both if needed */ $ret .= ' onclick="if (!this.checked && ' . '(!document.getElementById(\'checkbox_' . $plugin_name . '_' . $opt['force'] . '\') ' . '|| !document.getElementById(\'checkbox_' . $plugin_name . '_' . $opt['force'] . '\').checked)) ' . 'return false; else return true;"'; } $ret .= ' />'; $ret .= '<label for="checkbox_' . $plugin_name . '_' . $opt['name'] . '">' . PMA_getString($opt['text']) . '</label>'; } else { $ret .= PMA_getString($opt['text']); } $ret .= '</legend>'; } elseif ($opt['type'] == 'egroup') { $ret .= '</fieldset>'; } else { /* This should be seen only by plugin writers, so I do not thing this * needs translation. */ $ret .= 'UNKNOWN OPTION ' . $opt['type'] . ' IN IMPORT PLUGIN ' . $plugin_name . '!'; } if (isset($opt['doc'])) { $ret .= PMA_showMySQLDocu($opt['doc'][0], $opt['doc'][1]); } $ret .= "\n"; return $ret; }
/** * Returns single option in a list element * * @param string $section name of config section in * $GLOBALS['cfg'][$section] for plugin * @param string $plugin_name unique plugin name * @param array &$propertyGroup options property main group instance * @param boolean $is_subgroup if this group is a subgroup * * @return string table row with option */ function PMA_pluginGetOneOption($section, $plugin_name, &$propertyGroup, $is_subgroup = false) { $ret = "\n"; if (!$is_subgroup) { // for subgroup headers if (strpos(get_class($propertyGroup), "PropertyItem")) { $properties = [$propertyGroup]; } else { // for main groups $ret .= '<div class="export_sub_options" id="' . $plugin_name . '_' . $propertyGroup->getName() . '">'; if (method_exists($propertyGroup, 'getText')) { $text = $propertyGroup->getText(); } if ($text != null) { $ret .= '<h4>' . PMA_getString($text) . '</h4>'; } $ret .= '<ul>'; } } if (!isset($properties)) { $not_subgroup_header = true; if (method_exists($propertyGroup, 'getProperties')) { $properties = $propertyGroup->getProperties(); } } if (isset($properties)) { foreach ($properties as $propertyItem) { $property_class = get_class($propertyItem); // if the property is a subgroup, we deal with it recursively if (strpos($property_class, "Subgroup")) { // for subgroups // each subgroup can have a header, which may also be a form element $subgroup_header = $propertyItem->getSubgroupHeader(); if (isset($subgroup_header)) { $ret .= PMA_pluginGetOneOption($section, $plugin_name, $subgroup_header); } $ret .= '<li class="subgroup"><ul'; if (isset($subgroup_header)) { $ret .= ' id="ul_' . $subgroup_header->getName() . '">'; } else { $ret .= '>'; } $ret .= PMA_pluginGetOneOption($section, $plugin_name, $propertyItem, true); } else { // single property item switch ($property_class) { case "BoolPropertyItem": $ret .= '<li>' . "\n"; $ret .= '<input type="checkbox" name="' . $plugin_name . '_' . $propertyItem->getName() . '"' . ' value="something" id="checkbox_' . $plugin_name . '_' . $propertyItem->getName() . '"' . ' ' . PMA_pluginCheckboxCheck($section, $plugin_name . '_' . $propertyItem->getName()); if ($propertyItem->getForce() != null) { // Same code is also few lines lower, update both if needed $ret .= ' onclick="if (!this.checked && ' . '(!document.getElementById(\'checkbox_' . $plugin_name . '_' . $propertyItem->getForce() . '\') ' . '|| !document.getElementById(\'checkbox_' . $plugin_name . '_' . $propertyItem->getForce() . '\').checked)) ' . 'return false; else return true;"'; } $ret .= ' />'; $ret .= '<label for="checkbox_' . $plugin_name . '_' . $propertyItem->getName() . '">' . PMA_getString($propertyItem->getText()) . '</label>'; break; case "DocPropertyItem": echo "DocPropertyItem"; break; case "HiddenPropertyItem": $ret .= '<li><input type="hidden" name="' . $plugin_name . '_' . $propertyItem->getName() . '"' . ' value="' . PMA_pluginGetDefault($section, $plugin_name . '_' . $propertyItem->getName()) . '"' . ' /></li>'; break; case "MessageOnlyPropertyItem": $ret .= '<li>' . "\n"; $ret .= '<p>' . PMA_getString($propertyItem->getText()) . '</p>'; break; case "RadioPropertyItem": $default = PMA_pluginGetDefault($section, $plugin_name . '_' . $propertyItem->getName()); foreach ($propertyItem->getValues() as $key => $val) { $ret .= '<li><input type="radio" name="' . $plugin_name . '_' . $propertyItem->getName() . '" value="' . $key . '" id="radio_' . $plugin_name . '_' . $propertyItem->getName() . '_' . $key . '"'; if ($key == $default) { $ret .= ' checked="checked"'; } $ret .= ' />' . '<label for="radio_' . $plugin_name . '_' . $propertyItem->getName() . '_' . $key . '">' . PMA_getString($val) . '</label></li>'; } break; case "SelectPropertyItem": $ret .= '<li>' . "\n"; $ret .= '<label for="select_' . $plugin_name . '_' . $propertyItem->getName() . '" class="desc">' . PMA_getString($propertyItem->getText()) . '</label>'; $ret .= '<select name="' . $plugin_name . '_' . $propertyItem->getName() . '"' . ' id="select_' . $plugin_name . '_' . $propertyItem->getName() . '">'; $default = PMA_pluginGetDefault($section, $plugin_name . '_' . $propertyItem->getName()); foreach ($propertyItem->getValues() as $key => $val) { $ret .= '<option value="' . $key . '"'; if ($key == $default) { $ret .= ' selected="selected"'; } $ret .= '>' . PMA_getString($val) . '</option>'; } $ret .= '</select>'; break; case "TextPropertyItem": $ret .= '<li>' . "\n"; $ret .= '<label for="text_' . $plugin_name . '_' . $propertyItem->getName() . '" class="desc">' . PMA_getString($propertyItem->getText()) . '</label>'; $ret .= '<input type="text" name="' . $plugin_name . '_' . $propertyItem->getName() . '"' . ' value="' . PMA_pluginGetDefault($section, $plugin_name . '_' . $propertyItem->getName()) . '"' . ' id="text_' . $plugin_name . '_' . $propertyItem->getName() . '"' . ($propertyItem->getSize() != null ? ' size="' . $propertyItem->getSize() . '"' : '') . ($propertyItem->getLen() != null ? ' maxlength="' . $propertyItem->getLen() . '"' : '') . ' />'; break; default: } } } } if ($is_subgroup) { // end subgroup $ret .= '</ul></li>'; } else { // end main group if (!empty($not_subgroup_header)) { $ret .= '</ul></div>'; } } if (method_exists($propertyGroup, "getDoc")) { $doc = $propertyGroup->getDoc(); if ($doc != null) { if (count($doc) == 3) { $ret .= PMA_Util::showMySQLDocu($doc[0], $doc[1], false, $doc[2]); } elseif (count($doc) == 1) { $ret .= PMA_Util::showDocu('faq', $doc[0]); } else { $ret .= PMA_Util::showMySQLDocu($doc[0], $doc[1]); } } } // Close the list element after $doc link is displayed if (isset($property_class)) { if ($property_class == 'BoolPropertyItem' || $property_class == 'MessageOnlyPropertyItem' || $property_class == 'SelectPropertyItem' || $property_class == 'TextPropertyItem') { $ret .= '</li>'; } } $ret .= "\n"; return $ret; }
/** * string PMA_pluginGetOneOption(string $section, string $plugin_name, string $id, array &$opt) * * returns single option in a table row * * @uses PMA_getString() * @uses PMA_pluginCheckboxCheck() * @uses PMA_pluginGetDefault() * @param string $section name of config section in * $GLOBALS['cfg'][$section] for plugin * @param string $plugin_name unique plugin name * @param string $id option id * @param array &$opt plugin option details * @return string table row with option */ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt) { $ret = ''; $ret .= '<tr>'; if ($opt['type'] == 'bool') { $ret .= '<td colspan="2">'; $ret .= '<input type="checkbox" name="' . $plugin_name . '_' . $opt['name'] . '"' . ' value="something" id="checkbox_' . $plugin_name . '_' . $opt['name'] . '"' . ' ' . PMA_pluginCheckboxCheck($section, $plugin_name . '_' . $opt['name']) . ' />'; $ret .= '<label for="checkbox_' . $plugin_name . '_' . $opt['name'] . '">' . PMA_getString($opt['text']) . '</label>'; $ret .= '</td>'; } elseif ($opt['type'] == 'text') { $ret .= '<td>'; $ret .= '<label for="text_' . $plugin_name . '_' . $opt['name'] . '">' . PMA_getString($opt['text']) . '</label>'; $ret .= '</td><td>'; $ret .= '<input type="text" name="' . $plugin_name . '_' . $opt['name'] . '"' . ' value="' . PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']) . '"' . ' id="text_' . $plugin_name . '_' . $opt['name'] . '"' . (isset($opt['size']) ? ' size="' . $opt['size'] . '"' : '') . (isset($opt['len']) ? ' maxlength="' . $opt['len'] . '"' : '') . ' />'; $ret .= '</td>'; } else { /* This should be seen only by plugin writers, so I do not thing this * needs translation. */ $ret .= '<td colspan="2">'; $ret .= 'UNKNOWN OPTION IN IMPORT PLUGIN ' . $plugin_name . '!'; $ret .= '</td>'; } $ret .= '</tr>'; return $ret; }
/** * string PMA_pluginGetOneOption(string $section, string $plugin_name, string $id, array &$opt) * * returns single option in a list element * * @uses PMA_getString() * @uses PMA_pluginCheckboxCheck() * @uses PMA_pluginGetDefault() * @param string $section name of config section in * $GLOBALS['cfg'][$section] for plugin * @param string $plugin_name unique plugin name * @param string $id option id * @param array &$opt plugin option details * @return string table row with option */ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt) { $ret = "\n"; if ($opt['type'] == 'bool') { $ret .= '<li>' . "\n"; $ret .= '<input type="checkbox" name="' . $plugin_name . '_' . $opt['name'] . '"' . ' value="something" id="checkbox_' . $plugin_name . '_' . $opt['name'] . '"' . ' ' . PMA_pluginCheckboxCheck($section, $plugin_name . '_' . $opt['name']); if (isset($opt['force'])) { /* Same code is also few lines lower, update both if needed */ $ret .= ' onclick="if (!this.checked && ' . '(!document.getElementById(\'checkbox_' . $plugin_name . '_' . $opt['force'] . '\') ' . '|| !document.getElementById(\'checkbox_' . $plugin_name . '_' . $opt['force'] . '\').checked)) ' . 'return false; else return true;"'; } $ret .= ' />'; $ret .= '<label for="checkbox_' . $plugin_name . '_' . $opt['name'] . '">' . PMA_getString($opt['text']) . '</label>'; } elseif ($opt['type'] == 'text') { $ret .= '<li>' . "\n"; $ret .= '<label for="text_' . $plugin_name . '_' . $opt['name'] . '" class="desc">' . PMA_getString($opt['text']) . '</label>'; $ret .= '<input type="text" name="' . $plugin_name . '_' . $opt['name'] . '"' . ' value="' . PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']) . '"' . ' id="text_' . $plugin_name . '_' . $opt['name'] . '"' . (isset($opt['size']) ? ' size="' . $opt['size'] . '"' : '') . (isset($opt['len']) ? ' maxlength="' . $opt['len'] . '"' : '') . ' />'; } elseif ($opt['type'] == 'message_only') { $ret .= '<li>' . "\n"; $ret .= '<p>' . PMA_getString($opt['text']) . '</p>'; } elseif ($opt['type'] == 'select') { $ret .= '<li>' . "\n"; $ret .= '<label for="select_' . $plugin_name . '_' . $opt['name'] . '" class="desc">' . PMA_getString($opt['text']) . '</label>'; $ret .= '<select name="' . $plugin_name . '_' . $opt['name'] . '"' . ' id="select_' . $plugin_name . '_' . $opt['name'] . '">'; $default = PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']); foreach ($opt['values'] as $key => $val) { $ret .= '<option value="' . $key . '"'; if ($key == $default) { $ret .= ' selected="selected"'; } $ret .= '>' . PMA_getString($val) . '</option>'; } $ret .= '</select>'; } elseif ($opt['type'] == 'radio') { $default = PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']); foreach ($opt['values'] as $key => $val) { $ret .= '<li><input type="radio" name="' . $plugin_name . '_' . $opt['name'] . '" value="' . $key . '" id="radio_' . $plugin_name . '_' . $opt['name'] . '_' . $key . '"'; if ($key == $default) { $ret .= 'checked="checked"'; } $ret .= ' />' . '<label for="radio_' . $plugin_name . '_' . $opt['name'] . '_' . $key . '">' . PMA_getString($val) . '</label></li>'; } } elseif ($opt['type'] == 'hidden') { $ret .= '<li><input type="hidden" name="' . $plugin_name . '_' . $opt['name'] . '"' . ' value="' . PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']) . '"' . ' /></li>'; } elseif ($opt['type'] == 'begin_group') { $ret .= '<div class="export_sub_options" id="' . $plugin_name . '_' . $opt['name'] . '">'; if (isset($opt['text'])) { $ret .= '<h4>' . PMA_getString($opt['text']) . '</h4>'; } $ret .= '<ul>'; } elseif ($opt['type'] == 'end_group') { $ret .= '</ul></div>'; } elseif ($opt['type'] == 'begin_subgroup') { /* each subgroup can have a header, which may also be a form element */ $ret .= PMA_pluginGetOneOption($section, $plugin_name, $id, $opt['subgroup_header']) . '<li class="subgroup"><ul'; if (isset($opt['subgroup_header']['name'])) { $ret .= ' id="ul_' . $opt['subgroup_header']['name'] . '">'; } else { $ret .= '>'; } } elseif ($opt['type'] == 'end_subgroup') { $ret .= '</ul></li>'; } else { /* This should be seen only by plugin writers, so I do not thing this * needs translation. */ $ret .= 'UNKNOWN OPTION ' . $opt['type'] . ' IN IMPORT PLUGIN ' . $plugin_name . '!'; } if (isset($opt['doc'])) { if (count($opt['doc']) == 3) { $ret .= PMA_showMySQLDocu($opt['doc'][0], $opt['doc'][1], false, $opt['doc'][2]); } elseif (count($opt['doc']) == 1) { $ret .= PMA_showDocu($opt['doc'][0]); } else { $ret .= PMA_showMySQLDocu($opt['doc'][0], $opt['doc'][1]); } } // Close the list element after $opt['doc'] link is displayed if ($opt['type'] == 'bool' || $opt['type'] == 'text' || $opt['type'] == 'message_only' || $opt['type'] == 'select') { $ret .= '</li>'; } $ret .= "\n"; return $ret; }
/** * Prints Html For Display Import options : Other * * @return string */ function PMA_getHtmlForImportOptionsOther() { $html = ' <div class="importoptions">'; $html .= ' <h3>' . __('Other Options:') . '</h3>'; $html .= ' <div class="formelementrow">'; $html .= ' <input type="checkbox" name="disable_foreign_keys"'; $html .= ' value="yes" id="checkbox_disable_foreign_keys" '; $html .= PMA_pluginCheckboxCheck('Import', 'disable_foreign_keys') . '/>'; $html .= ' <label for="checkbox_disable_foreign_keys">'; $html .= __('Disable foreign key check'); $html .= ' </label>'; $html .= ' </div>'; $html .= ' </div>'; return $html; }
?> </fieldset> <fieldset class="options"> <legend><?php echo $strPartialImport; ?></legend> <?php if (isset($timeout_passed) && $timeout_passed) { echo '<div class="formelementrow">' . "\n"; echo '<input type="hidden" name="skip" value="' . $offset . '" />'; echo sprintf($strTimeoutInfo, $offset) . ''; echo '</div>' . "\n"; } ?> <div class="formelementrow"> <input type="checkbox" name="allow_interrupt" value="yes" id="checkbox_allow_interrupt" <?php echo PMA_pluginCheckboxCheck('Import', 'allow_interrupt'); ?>/> <label for="checkbox_allow_interrupt"><?php echo $strAllowInterrupt; ?></label><br /> </div> <?php if (! (isset($timeout_passed) && $timeout_passed)) { ?> <div class="formelementrow"> <label for="text_skip_queries"><?php echo $strSkipQueries; ?></label> <input type="text" name="skip_queries" value="<?php echo PMA_pluginGetDefault('Import', 'skip_queries');?>" id="text_skip_queries" /> </div> <?php } else { // If timeout has passed, // do not show the Skip dialog to avoid the risk of someone // entering a value here that would interfere with "skip"