$field->setAttribute('onchange', 'url_generate_table(this);'); $field->setAttribute('style', 'width: 200px;'); $select =& $field->getSelect(); $select->setSize(1); $select->addOption($I18N->msg('b_no_table_selected'), ''); $fields = array(); $tables = rex_sql::showTables(); foreach ($tables as $table) { $select->addOption($table, $table); $columns = rex_sql::showColumns($table); foreach ($columns as $column) { $fields[$table][] = $column['name']; } } $table_id = $field->getAttribute('id'); $fieldContainer =& $form->addContainerField('table_parameters'); $fieldContainer->setAttribute('style', 'display: none'); if (count($fields > 0)) { foreach ($fields as $table => $columns) { $group = $table; $options = $columns; $type = 'select'; $name = $table . '_name'; $f1 =& $fieldContainer->addGroupedField($group, $type, $name, $value, $attributes = array()); $f1->setHeader('<div class="url-control-grid3col">'); $f1->setLabel($I18N->msg('b_url')); $f1->setAttribute('style', 'width: 200px;'); $f1->setNotice($I18N->msg('b_url_control_generate_notice_name')); $select =& $f1->getSelect(); $select->setSize(1); $select->addOptions($options, true);
$select =& $field->getSelect(); $select->setSize(1); $select->addOption($I18N->msg('b_active'), '1'); $select->addOption($I18N->msg('b_inactive'), '0'); $field =& $form->addTextField('url'); $field->setLabel($I18N->msg('b_url_control_manager_requested_url')); $field->setNotice($I18N->msg('b_url_control_manager_requested_url_notice')); $field =& $form->addSelectField('method'); $field->setLabel($I18N->msg('b_method')); $select_method_id = $field->getAttribute('id'); $select =& $field->getSelect(); $select->setSize(1); $select->addOption($I18N->msg('b_url_control_manager_legend_1'), 'article'); $select->addOption($I18N->msg('b_url_control_manager_legend_2'), 'target_url'); $form->addFieldset($I18N->msg('b_url_control_manager_method')); $fieldContainer =& $form->addContainerField('method_parameters'); $fieldContainer->setAttribute('style', 'display: none'); // Group ------------------------------------------------------------------- $group = 'article'; $type = 'link'; $name = 'article_id'; $value = ''; $field =& $fieldContainer->addGroupedField($group, $type, $name, $value, $attributes = array()); $field->setLabel($I18N->msg('b_article')); if (count($REX['CLANG']) >= 2) { $type = 'select'; $name = 'clang'; $value = ''; $field =& $fieldContainer->addGroupedField($group, $type, $name, $value, $attributes = array()); $field->setLabel($I18N->msg('b_language')); $field->setAttribute('style', 'width: 200px;');