/** * Outputs HTML for forms * * @uses ConfigFile::getInstance() * @uses ConfigFile::get() * @uses display_fieldset_bottom() * @uses display_fieldset_top() * @uses display_form_bottom() * @uses display_form_top() * @uses display_js() * @uses display_tabs_bottom() * @uses display_tabs_top() * @uses js_validate() * @uses PMA_config_get_validators() * @uses PMA_jsFormat() * @uses PMA_lang() * @param bool $tabbed_form * @param bool $show_restore_default whether show "restore default" button besides the input field */ public function display($tabbed_form = false, $show_restore_default = false) { static $js_lang_sent = false; $js = array(); $js_default = array(); $tabbed_form = $tabbed_form && count($this->forms) > 1; $validators = PMA_config_get_validators(); display_form_top(); if ($tabbed_form) { $tabs = array(); foreach ($this->forms as $form) { $tabs[$form->name] = PMA_lang("Form_{$form->name}"); } display_tabs_top($tabs); } // valdiate only when we aren't displaying a "new server" form $is_new_server = false; foreach ($this->forms as $form) { /* @var $form Form */ if ($form->index === 0) { $is_new_server = true; break; } } if (!$is_new_server) { $this->_validate(); } // user preferences $this->_loadUserprefsInfo(); // display forms foreach ($this->forms as $form) { /* @var $form Form */ $form_desc = isset($GLOBALS["strConfigForm_{$form->name}_desc"]) ? PMA_lang("Form_{$form->name}_desc") : ''; $form_errors = isset($this->errors[$form->name]) ? $this->errors[$form->name] : null; display_fieldset_top(PMA_lang("Form_{$form->name}"), $form_desc, $form_errors, array('id' => $form->name)); foreach ($form->fields as $field => $path) { $work_path = array_search($path, $this->system_paths); $translated_path = $this->translated_paths[$work_path]; // always true/false for user preferences display // otherwise null $userprefs_allow = isset($this->userprefs_keys[$path]) ? !isset($this->userprefs_disallow[$path]) : null; // display input $this->_displayFieldInput($form, $field, $path, $work_path, $translated_path, $show_restore_default, $userprefs_allow, $js_default); // register JS validators for this field if (isset($validators[$path])) { js_validate($translated_path, $validators[$path], $js); } } display_fieldset_bottom(); } if ($tabbed_form) { display_tabs_bottom(); } display_form_bottom(); // if not already done, send strings used for valdiation to JavaScript if (!$js_lang_sent) { $js_lang_sent = true; $js_lang = array(); foreach ($this->js_lang_strings as $strName => $strValue) { $js_lang[] = "'{$strName}': '" . PMA_jsFormat($strValue, false) . '\''; } $js[] = "\$.extend(PMA_messages, {\n\t" . implode(",\n\t", $js_lang) . '})'; } $js[] = "\$.extend(defaultValues, {\n\t" . implode(",\n\t", $js_default) . '})'; display_js($js); }
/** * Outputs HTML for forms * * @param bool $tabbed_form * @param bool $show_restore_default whether show "restore default" button besides the input field */ public function display($tabbed_form = false, $show_restore_default = false) { static $js_lang_sent = false; $js = array(); $js_default = array(); $tabbed_form = $tabbed_form && count($this->forms) > 1; $validators = ConfigFile::getInstance()->getDbEntry('_validators'); display_form_top(); if ($tabbed_form) { $tabs = array(); foreach ($this->forms as $form) { $tabs[$form->name] = PMA_lang("Form_{$form->name}"); } display_tabs_top($tabs); } // valdiate only when we aren't displaying a "new server" form $is_new_server = false; foreach ($this->forms as $form) { /* @var $form Form */ if ($form->index === 0) { $is_new_server = true; break; } } if (!$is_new_server) { $this->_validate(); } // display forms foreach ($this->forms as $form) { /* @var $form Form */ $form_desc = isset($GLOBALS["strSetupForm_{$form->name}_desc"]) ? PMA_lang("Form_{$form->name}_desc") : ''; $form_errors = isset($this->errors[$form->name]) ? $this->errors[$form->name] : null; display_fieldset_top(PMA_lang("Form_{$form->name}"), $form_desc, $form_errors, array('id' => $form->name)); foreach ($form->fields as $field => $path) { $work_path = array_search($path, $this->system_paths); $translated_path = $this->translated_paths[$work_path]; // display input $this->_displayFieldInput($form, $field, $path, $work_path, $translated_path, $show_restore_default, $js_default); // register JS validators for this field if (isset($validators[$path])) { js_validate($translated_path, $validators[$path], $js); } } display_fieldset_bottom(); } if ($tabbed_form) { display_tabs_bottom(); } display_form_bottom(); // if not already done, send strings used for valdiation to JavaScript if (!$js_lang_sent) { $js_lang_sent = true; $js_lang = array(); foreach ($this->js_lang_strings as $str) { $lang = isset($GLOBALS["strSetup{$str}"]) ? $GLOBALS["strSetup{$str}"] : filter_input($GLOBALS["str{$str}"]); // null if not set $js_lang[] = "'{$str}': '" . PMA_jsFormat($lang, false) . '\''; } $js[] = '$extend(PMA_messages, {' . implode(",\n\t", $js_lang) . '})'; } $js[] = '$extend(defaultValues, {' . implode(",\n\t", $js_default) . '})'; display_js($js); }
<input type="hidden" id="banner_url" name="banner_url"> <div id="banner_display"> </div> </div> </div> <div class="control-group"> <label class="control-label"></label> <!-- Button --> <div class="controls"> <button type="submit" class="btn btn-success">提交</button> </div> </div> </fieldset> </form> </div> </div> <script src="<?php echo base_url("/plugins/iupload/i_upload.js"); ?> " type="text/javascript" ></script> <?php display_js(array('jquery.validate.min.js', 'test.form.js', 'test.upload.js')); ?>
<!-- Styles --> <?php if ($this->config->item('bootstrap_responsive')) { display_css('bootstrap.css', 'bootstrap-responsive.css', 'style.css'); } else { display_css('bootstrap.css', 'style.css'); } ?> <script type="text/javascript"> var WEB_ROOT = "<?php echo site_url(); ?> "; </script> <?php display_js(array('jquery-1.7.1.min.js', 'bootstrap.min.js', 'index.js')); ?> <link rel="shortcut icon" href="img/favicon.ico"> </head> <body> <div class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> <a class="brand" href="<?php echo site_url("/");
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>CodeIgniter Sparks | <?php echo isset($title) ? "{$title}" : "The Package Manager and Repository"; ?> </title> <?php display_css(array('reset.css', 'style.css', 'clear.css')); ?> <?php display_js(array('jquery-1.4.4.min.js', 'jquery-ui-1.8.9.min.js', 'jquery.available.1.6.1.min.js', 'site.js')); ?> <meta http-equiv='expires' content='-1' /> <meta http-equiv= 'pragma' content='no-cache' /> <meta name='robots' content='all' /> </head> <body> <script type="text/javascript"> var base_url = '<?php echo base_url(); ?> '; </script> <div id="header" class="clearfix">