Skip to content

Commit

Permalink
Better naming of functions
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Sep 11, 2012
1 parent 6a16006 commit 51b8557
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 37 deletions.
24 changes: 12 additions & 12 deletions libraries/config/FormDisplay.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,14 @@ public function display($tabbed_form = false, $show_restore_default = false)
$tabbed_form = $tabbed_form && (count($this->_forms) > 1);
$validators = PMA_config_get_validators();

display_form_top();
PMA_displayFormTop();

if ($tabbed_form) {
$tabs = array();
foreach ($this->_forms as $form) {
$tabs[$form->name] = PMA_lang("Form_$form->name");
}
display_tabs_top($tabs);
PMA_displayTabsTop($tabs);
}

// valdiate only when we aren't displaying a "new server" form
Expand All @@ -233,7 +233,7 @@ public function display($tabbed_form = false, $show_restore_default = false)
: '';
$form_errors = isset($this->_errors[$form->name])
? $this->_errors[$form->name] : null;
display_fieldset_top(
PMA_displayFieldsetTop(
PMA_lang("Form_$form->name"),
$form_desc,
$form_errors,
Expand Down Expand Up @@ -261,16 +261,16 @@ public function display($tabbed_form = false, $show_restore_default = false)
);
// register JS validators for this field
if (isset($validators[$path])) {
js_validate($translated_path, $validators[$path], $js);
PMA_addJsValidate($translated_path, $validators[$path], $js);
}
}
display_fieldset_bottom();
PMA_displayFieldsetBottom();
}

if ($tabbed_form) {
display_tabs_bottom();
PMA_displayTabsBottom();
}
display_form_bottom();
PMA_displayFormBottom();

// if not already done, send strings used for valdiation to JavaScript
if (!$js_lang_sent) {
Expand All @@ -283,7 +283,7 @@ public function display($tabbed_form = false, $show_restore_default = false)
}

$js[] = "$.extend(defaultValues, {\n\t" . implode(",\n\t", $js_default) . '})';
display_js($js);
PMA_displayJavascript($js);
}

/**
Expand Down Expand Up @@ -360,9 +360,9 @@ private function _displayFieldInput(
case 'group':
// :group:end is changed to :group:end:{unique id} in Form class
if (substr($field, 7, 4) != 'end:') {
display_group_header(substr($field, 7));
PMA_displayGroupHeader(substr($field, 7));
} else {
display_group_footer();
PMA_displayGroupFooter();
}
return;
case 'NULL':
Expand Down Expand Up @@ -404,7 +404,7 @@ private function _displayFieldInput(
}
$js_default[] = $js_line;

display_input(
PMA_displayInput(
$translated_path, $name, $type, $value,
$description, $value_is_default, $opts
);
Expand All @@ -429,7 +429,7 @@ public function displayErrors()
} else {
$name = $GLOBALS["strConfigForm_$system_path"];
}
display_errors($name, $error_list);
PMA_displayErrors($name, $error_list);
}
}

Expand Down
28 changes: 14 additions & 14 deletions libraries/config/FormDisplay.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @return void
*/
function display_form_top($action = null, $method = 'post', $hidden_fields = null)
function PMA_displayFormTop($action = null, $method = 'post', $hidden_fields = null)
{
static $has_check_page_refresh = false;

Expand All @@ -42,13 +42,13 @@ function display_form_top($action = null, $method = 'post', $hidden_fields = nul

/**
* Displays form tabs which are given by an array indexed by fieldset id
* ({@link display_fieldset_top}), with values being tab titles.
* ({@link PMA_displayFieldsetTop}), with values being tab titles.
*
* @param array $tabs tab names
*
* @return void
*/
function display_tabs_top($tabs)
function PMA_displayTabsTop($tabs)
{
?>
<ul class="tabs">
Expand All @@ -70,7 +70,7 @@ function display_tabs_top($tabs)
* @param array $errors
* @param array $attributes
*/
function display_fieldset_top($title = '', $description = '', $errors = null,
function PMA_displayFieldsetTop($title = '', $description = '', $errors = null,
$attributes = array()
) {
global $_FormDisplayGroup;
Expand Down Expand Up @@ -127,7 +127,7 @@ function display_fieldset_top($title = '', $description = '', $errors = null,
* @param bool $value_is_default
* @param array $opts
*/
function display_input($path, $name, $type, $value, $description = '',
function PMA_displayInput($path, $name, $type, $value, $description = '',
$value_is_default = true, $opts = null
) {
global $_FormDisplayGroup;
Expand Down Expand Up @@ -343,7 +343,7 @@ function display_input($path, $name, $type, $value, $description = '',
*
* @param string $header_text
*/
function display_group_header($header_text)
function PMA_displayGroupHeader($header_text)
{
global $_FormDisplayGroup;

Expand All @@ -367,7 +367,7 @@ function display_group_header($header_text)
* Display group footer
*
*/
function display_group_footer()
function PMA_displayGroupFooter()
{
global $_FormDisplayGroup;

Expand All @@ -377,7 +377,7 @@ function display_group_footer()
/**
* Displays bottom part of a fieldset
*/
function display_fieldset_bottom()
function PMA_displayFieldsetBottom()
{
$colspan = 2;
if (defined('PMA_SETUP')) {
Expand All @@ -399,7 +399,7 @@ function display_fieldset_bottom()
/**
* Displays simple bottom part of a fieldset (without submit buttons)
*/
function display_fieldset_bottom_simple()
function PMA_displayFieldsetBottomSimple()
{
?>
</table>
Expand All @@ -411,15 +411,15 @@ function display_fieldset_bottom_simple()
/**
* Closes form tabs
*/
function display_tabs_bottom()
function PMA_displayTabsBottom()
{
echo "</div>\n";
}

/**
* Displays bottom part of the form
*/
function display_form_bottom()
function PMA_displayFormBottom()
{
echo "</form>\n";
}
Expand All @@ -431,7 +431,7 @@ function display_form_bottom()
* @param string|array $validator
* @param array $js_array
*/
function js_validate($field_id, $validators, &$js_array)
function PMA_addJsValidate($field_id, $validators, &$js_array)
{
foreach ((array)$validators as $validator) {
$validator = (array)$validator;
Expand All @@ -450,7 +450,7 @@ function js_validate($field_id, $validators, &$js_array)
*
* @param array $js_array
*/
function display_js($js_array)
function PMA_displayJavascript($js_array)
{
if (empty($js_array)) {
return;
Expand All @@ -468,7 +468,7 @@ function display_js($js_array)
* @param string $name
* @param array $error_list
*/
function display_errors($name, $error_list)
function PMA_displayErrors($name, $error_list)
{
echo '<dl>';
echo '<dt>' . htmlspecialchars($name) . '</dt>';
Expand Down
8 changes: 4 additions & 4 deletions setup/frames/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
check_config_rw($config_readable, $config_writable, $config_exists);
?>
<h2><?php echo __('Configuration file') ?></h2>
<?php display_form_top('config.php'); ?>
<?php PMA_displayFormTop('config.php'); ?>
<input type="hidden" name="eol" value="<?php echo htmlspecialchars(PMA_ifSetOr($_GET['eol'], 'unix')) ?>" />
<?php display_fieldset_top('', '', null, array('class' => 'simple')); ?>
<?php PMA_displayFieldsetTop('', '', null, array('class' => 'simple')); ?>
<tr>
<td>
<textarea cols="50" rows="20" name="textconfig" id="textconfig" spellcheck="false"><?php
Expand All @@ -43,6 +43,6 @@
</td>
</tr>
<?php
display_fieldset_bottom_simple();
display_form_bottom();
PMA_displayFieldsetBottomSimple();
PMA_displayFormBottom();
?>
14 changes: 7 additions & 7 deletions setup/frames/index.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
//
// Display server list
//
display_form_top(
PMA_displayFormTop(
'index.php', 'get',
array(
'page' => 'servers',
Expand Down Expand Up @@ -169,7 +169,7 @@
</table>
</div>
<?php
display_form_bottom();
PMA_displayFormBottom();
?>
</fieldset>

Expand All @@ -180,7 +180,7 @@
//
$form_display = new FormDisplay();

display_form_top('config.php');
PMA_displayFormTop('config.php');
?>
<table width="100%" cellspacing="0">
<?php
Expand All @@ -195,7 +195,7 @@
$lang_name = PMA_langName($each_lang);
$opts['values'][$each_lang_key] = $lang_name;
}
display_input(
PMA_displayInput(
'DefaultLang', __('Default language'), 'select',
$cf->getValue('DefaultLang'), '', true, $opts
);
Expand All @@ -221,7 +221,7 @@
$opts['values']['1'] = __('- none -');
$opts['values_escaped'] = true;
}
display_input(
PMA_displayInput(
'ServerDefault', __('Default server'), 'select',
$cf->getValue('ServerDefault'), '', true, $opts
);
Expand All @@ -233,7 +233,7 @@
'win' => 'Windows (\r\n)'),
'values_escaped' => true);
$eol = PMA_ifSetOr($_SESSION['eol'], (PMA_IS_WINDOWS ? 'win' : 'unix'));
display_input(
PMA_displayInput(
'eol', __('End of line'), 'select',
$eol, '', true, $opts
);
Expand Down Expand Up @@ -263,7 +263,7 @@
</tr>
</table>
<?php
display_form_bottom();
PMA_displayFormBottom();
?>
</fieldset>
<div id="footer">
Expand Down

0 comments on commit 51b8557

Please sign in to comment.