function create_form(&$data) { foreach ($data as $element) { if (is_array($element)) { switch ($element[2]) { case 0: form_input($element[0], $element[1]); break; case 1: form_yes_no($element[0], $element[1]); break; case 2: form_img_pkg($element[0], $element[1]); break; case 3: form_sort_order($element[0], $element[1]); break; case 4: form_charset($element[0], $element[1]); break; case 5: form_language($element[0], $element[1]); break; case 6: form_theme($element[0], $element[1]); break; // Thumbnail scaling // Thumbnail scaling case 7: form_scale($element[0], $element[1]); break; // Language + Theme selection // Language + Theme selection case 8: form_lang_theme($element[0], $element[1]); break; // debug mode selection // debug mode selection case 9: form_lang_debug($element[0], $element[1]); break; // tabbed display fix // tabbed display fix case 10: form_number_dropdown($element[0], $element[1]); break; default: die('Invalid action'); } // switch } else { form_label($element); } } }
function create_form(&$data) { global $sn1, $sn2, $sn3, $options_to_disable, $CONFIG; $row_style_class = 'tableb'; foreach ($data as $element) { if (is_array($element)) { $skipped = 0; $element[3] = isset($element[3]) ? $element[3] : ''; if (UDB_INTEGRATION != 'coppermine' and in_array($element[1], $options_to_disable) and $CONFIG['bridge_enable']) { $element[2] = 15; } $sn1 = max($sn1, strpos($element[0], '<a href="#notice1"')); $sn2 = max($sn2, strpos($element[0], '<a href="#notice2"')); $sn3 = max($sn3, strpos($element[0], '<a href="#notice3"')); switch ($element[2]) { case 0: form_input($element[0], $element[1], $element[3], $row_style_class); break; case 1: if (!($element[1] == 'enable_encrypted_passwords' && $CONFIG['enable_encrypted_passwords'])) { form_yes_no($element[0], $element[1], $element[3], $row_style_class); break; } $skipped = 1; break; case 2: form_img_pkg($element[0], $element[1], $element[3], $row_style_class); break; case 3: form_sort_order($element[0], $element[1], $element[3], $row_style_class); break; case 4: form_charset($element[0], $element[1], $element[3], $row_style_class); break; case 5: form_language($element[0], $element[1], $element[3], $row_style_class); break; case 6: form_theme($element[0], $element[1], $element[3], $row_style_class); break; // Thumbnail scaling // Thumbnail scaling case 7: form_scale($element[0], $element[1], $element[3], $row_style_class); break; // Language + Theme selection // Language + Theme selection case 8: form_lang_theme($element[0], $element[1], $element[3], $row_style_class); break; // debug mode selection // debug mode selection case 9: form_lang_debug($element[0], $element[1], $element[3], $row_style_class); break; // tabbed display fix // tabbed display fix case 10: form_number_dropdown($element[0], $element[1], $element[3], $row_style_class); break; case 11: form_lang_logmode($element[0], $element[1], $element[3], $row_style_class); break; case 12: form_plugin_yes_no($element[0], $element[1], $element[3], $row_style_class); break; case 13: form_exif_yes_no($element[0], $element[1], $element[3], $row_style_class); break; case 14: form_keywords_yes_no($element[0], $element[1], $element[3], $row_style_class); break; case 15: form_disabled($element[0], $element[1], $element[3], $row_style_class); break; case 16: form_auto_resize($element[0], $element[1], $element[3], $row_style_class); break; // ascending or descending // ascending or descending case 17: form_asc_desc($element[0], $element[1], $element[3], $row_style_class); break; // registration disclaimer // registration disclaimer case 18: form_registration_disclaimer($element[0], $element[1], $element[3], $row_style_class); break; case 19: form_user_guest_yes_no($element[0], $element[1], $element[3], $row_style_class); break; //Watermark place //Watermark place case 20: form_watermark_place($element[0], $element[1], $row_style_class); break; //Which filest to watermark //Which filest to watermark case 21: form_watermark_files($element[0], $element[1], $row_style_class); break; default: die('Invalid action'); } // switch if (!$skipped) { $row_style_class = $row_style_class == 'tableb' ? 'tableb tableb_alternate' : 'tableb'; } } else { form_label($element); } } }
EOT; */ } if ($thecharset == 'utf-8') { echo '<p class="warning">Your site is already configured to use utf-8. <b>You don\'t need this script and should <a href="index.php">leave this page</a></b>.</p>'; $alreadyunicode = 1; } if (!$alreadyunicode && !$iconvavailable) { set_config('lang', 'english'); echo '<p class="warning">The <a href="http://www.php.net/iconv">iconv</a> function is not available. <b>You cannot use this script.</b> Coppermine will now run in English. <br/>You may install iconv and start this script again. You should now <a href="index.php?lang=english">proceed to the main page</a>.</p>'; } echo <<<EOT <ul> <li><b>You should not change the value of the second menu (utf-8) unless you know what you are doing!</b></li> <li>Clicking on check will just allow you to check if the conversion is possible. The database will be left unchanged. </ul> EOT; echo "<fieldset><legend>Charset Converter</legend>"; echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="cpgform" id="cpgform">'; echo "Convert from "; form_charset('charset_in', $thecharset); echo " to "; form_charset('charset_out', 'utf-8'); echo <<<EOT <input type="submit" class="button" name="check" value="Check" /> EOT; echo "</form>"; echo "</fieldset>"; ob_end_flush(); html_footer();
function create_form(&$data) { global $sn1, $sn2, $sn3, $options_to_disable, $CONFIG; foreach ($data as $element) { if (is_array($element)) { $element[3] = isset($element[3]) ? $element[3] : ''; if (UDB_INTEGRATION != 'coppermine' and in_array($element[1], $options_to_disable) and $CONFIG['bridge_enable']) { $element[2] = 15; } $sn1 = max($sn1, strpos($element[0], '<a href="#notice1"')); $sn2 = max($sn2, strpos($element[0], '<a href="#notice2"')); $sn3 = max($sn3, strpos($element[0], '<a href="#notice3"')); switch ($element[2]) { case 0: form_input($element[0], $element[1], $element[3]); break; case 1: if ($element[1] == 'enable_encrypted_passwords' && !$CONFIG['enable_encrypted_passwords'] || $element[1] != 'enable_encrypted_passwords') { form_yes_no($element[0], $element[1], $element[3]); } break; case 2: form_img_pkg($element[0], $element[1], $element[3]); break; case 3: form_sort_order($element[0], $element[1], $element[3]); break; case 4: form_charset($element[0], $element[1], $element[3]); break; case 5: form_language($element[0], $element[1], $element[3]); break; case 6: form_theme($element[0], $element[1], $element[3]); break; // Thumbnail scaling // Thumbnail scaling case 7: form_scale($element[0], $element[1], $element[3]); break; // Language + Theme selection // Language + Theme selection case 8: form_lang_theme($element[0], $element[1], $element[3]); break; // debug mode selection // debug mode selection case 9: form_lang_debug($element[0], $element[1], $element[3]); break; // tabbed display fix // tabbed display fix case 10: form_number_dropdown($element[0], $element[1], $element[3]); break; case 11: form_lang_logmode($element[0], $element[1], $element[3]); break; case 12: form_plugin_yes_no($element[0], $element[1], $element[3]); break; case 13: form_exif_yes_no($element[0], $element[1], $element[3]); break; case 14: form_keywords_yes_no($element[0], $element[1], $element[3]); break; case 15: form_disabled($element[0], $element[1], $element[3]); break; case 16: form_auto_resize($element[0], $element[1], $element[3]); break; // ascending or descending // ascending or descending case 17: form_asc_desc($element[0], $element[1], $element[3]); break; default: die('Invalid action'); } // switch } else { form_label($element); } } }