/**
 * Returns html div with editable options for plugin
 *
 * @param string $section name of config section in $GLOBALS['cfg'][$section]
 * @param array  &$list   array with plugin instances
 *
 * @return string  html fieldset with plugin options
 */
function PMA_pluginGetOptions($section, &$list)
{
    $ret = '';
    // Options for plugins that support them
    foreach ($list as $plugin) {
        $properties = $plugin->getProperties();
        if ($properties != null) {
            $text = $properties->getText();
            $options = $properties->getOptions();
        }
        $elem = explode('\\', get_class($plugin));
        $plugin_name = array_pop($elem);
        unset($elem);
        $plugin_name = mb_strtolower(mb_substr($plugin_name, mb_strlen($section)));
        $ret .= '<div id="' . $plugin_name . '_options" class="format_specific_options">';
        $ret .= '<h3>' . PMA_getString($text) . '</h3>';
        $no_options = true;
        if ($options != null && count($options) > 0) {
            foreach ($options->getProperties() as $propertyMainGroup) {
                // check for hidden properties
                $no_options = true;
                foreach ($propertyMainGroup->getProperties() as $propertyItem) {
                    if (strcmp('PMA\\libraries\\properties\\options\\items\\HiddenPropertyItem', get_class($propertyItem))) {
                        $no_options = false;
                        break;
                    }
                }
                $ret .= PMA_pluginGetOneOption($section, $plugin_name, $propertyMainGroup);
            }
        }
        if ($no_options) {
            $ret .= '<p>' . __('This format has no options') . '</p>';
        }
        $ret .= '</div>';
    }
    return $ret;
}
/**
 * string PMA_pluginGetOptions(string $section, array &$list)
 *
 * return html fieldset with editable options for plugin
 *
 * @uses    PMA_getString()
 * @uses    PMA_pluginGetOneOption()
 * @param   string  $section    name of config section in $GLOBALS['cfg'][$section]
 * @param   array   &$list      array with plugin configuration defined in plugin file
 * @return  string              html fieldset with plugin options
 */
function PMA_pluginGetOptions($section, &$list)
{
    $ret = '';
    // Options for plugins that support them
    foreach ($list as $plugin_name => $val) {
        $ret .= '<fieldset id="' . $plugin_name . '_options" class="options">';
        $ret .= '<legend>' . PMA_getString($val['options_text']) . '</legend>';
        $count = 0;
        if (isset($val['options']) && count($val['options']) > 0) {
            foreach ($val['options'] as $id => $opt) {
                if ($opt['type'] != 'hidden') {
                    $count++;
                }
                $ret .= PMA_pluginGetOneOption($section, $plugin_name, $id, $opt);
            }
        }
        if ($count == 0) {
            $ret .= $GLOBALS['strNoOptions'];
        }
        $ret .= '</fieldset>';
    }
    return $ret;
}
Exemple #3
0
/**
 * string PMA_pluginGetOptions(string $section, array &$list)
 *
 * return html fieldset with editable options for plugin
 *
 * @uses    PMA_getString()
 * @uses    PMA_pluginGetOneOption()
 * @param   string  $section    name of config section in $GLOBALS['cfg'][$section]
 * @param   array   &$list      array with plugin configuration defined in plugin file
 * @return  string              html fieldset with plugin options
 */
function PMA_pluginGetOptions($section, &$list)
{
    $ret = '';
    // Options for plugins that support them
    foreach ($list as $plugin_name => $val) {
        $ret .= '<fieldset id="' . $plugin_name . '_options" class="options">';
        $ret .= '<legend>' . PMA_getString($val['options_text']) . '</legend>';
        if (isset($val['options'])) {
            $ret .= '<table class="form">';
            $ret .= '<tbody>';
            foreach ($val['options'] as $id => $opt) {
                $ret .= PMA_pluginGetOneOption($section, $plugin_name, $id, $opt);
            }
            $ret .= '</tbody>';
            $ret .= '</table>';
        } else {
            $ret .= $GLOBALS['strNoOptions'];
        }
        $ret .= '</fieldset>';
    }
    return $ret;
}
/**
 * Returns html div with editable options for plugin
 *
 * @param string $section name of config section in $GLOBALS['cfg'][$section]
 * @param array &$list array with plugin instances
 *
 * @return string  html fieldset with plugin options
 */
function PMA_pluginGetOptions($section, &$list)
{
    $ret = '';
    $default = PMA_pluginGetDefault('Export', 'format');
    // Options for plugins that support them
    foreach ($list as $plugin) {
        $properties = $plugin->getProperties();
        if ($properties != null) {
            $text = $properties->getText();
            $options = $properties->getOptions();
        }
        $plugin_name = strtolower(substr(get_class($plugin), strlen($section)));
        $ret .= '<div id="' . $plugin_name . '_options" class="format_specific_options">';
        $ret .= '<h3>' . PMA_getString($text) . '</h3>';
        $no_options = true;
        if ($options != null && count($options) > 0) {
            foreach ($options->getProperties() as $propertyMainGroup) {
                // check for hidden properties
                $no_options = true;
                foreach ($propertyMainGroup->getProperties() as $propertyItem) {
                    if (strcmp("HiddenPropertyItem", get_class($propertyItem))) {
                        $no_options = false;
                        break;
                    }
                }
                $ret .= PMA_pluginGetOneOption($section, $plugin_name, $propertyMainGroup);
            }
        }
        if ($no_options) {
            $ret .= '<p>' . __('This format has no options') . '</p>';
        }
        $ret .= '</div>';
    }
    return $ret;
}
/**
 * string PMA_pluginGetOptions(string $section, array &$list)
 *
 * return html div with editable options for plugin
 *
 * @uses    PMA_getString()
 * @uses    PMA_pluginGetOneOption()
 * @uses    PMA_pluginGetDefault();
 * @param   string  $section    name of config section in $GLOBALS['cfg'][$section]
 * @param   array   &$list      array with plugin configuration defined in plugin file
 * @return  string              html fieldset with plugin options
 */
function PMA_pluginGetOptions($section, &$list)
{
    $ret = '';
    $default = PMA_pluginGetDefault('Export', 'format');
    // Options for plugins that support them
    foreach ($list as $plugin_name => $val) {
        $ret .= '<div id="' . $plugin_name . '_options" class="format_specific_options">';
        $count = 0;
        $ret .= '<h3>' . PMA_getString($val['text']) . '</h3>';
        if (isset($val['options']) && count($val['options']) > 0) {
            foreach ($val['options'] as $id => $opt) {
                if ($opt['type'] != 'hidden' && $opt['type'] != 'begin_group' && $opt['type'] != 'end_group' && $opt['type'] != 'begin_subgroup' && $opt['type'] != 'end_subgroup') {
                    $count++;
                }
                $ret .= PMA_pluginGetOneOption($section, $plugin_name, $id, $opt);
            }
        }
        if ($count == 0) {
            $ret .= '<p>' . __('This format has no options') . '</p>';
        }
        $ret .= '</div>';
    }
    return $ret;
}