New config parameter: buttons_position: top | bottom | both

SVN:trunk[1436]
This commit is contained in:
Denis Flaven
2011-08-09 07:47:50 +00:00
parent 9bd6fa61c5
commit aa9d9ed578
3 changed files with 20 additions and 18 deletions

View File

@@ -1737,14 +1737,15 @@ EOF
}
}
$bDisplayActionsAtTop = MetaModel::GetConfig()->Get('display_actions_at_top');
$sButtonsPosition = MetaModel::GetConfig()->Get('buttons_position');
$iTransactionId = utils::GetNewTransactionId();
$oPage->SetTransactionId($iTransactionId);
$oPage->add("<form action=\"$sFormAction\" id=\"form_{$this->m_iFormId}\" enctype=\"multipart/form-data\" method=\"post\" onSubmit=\"return OnSubmit('form_{$this->m_iFormId}');\">\n");
$oPage->add_ready_script("$(window).unload(function() { OnUnload('$iTransactionId') } );\n");
if ($bDisplayActionsAtTop)
if ($sButtonsPosition != 'bottom')
{
// top or both, display the buttons here
$oPage->add($sButtons);
}
@@ -1767,8 +1768,9 @@ EOF
$oPage->add("<input type=\"hidden\" name=\"$sName\" value=\"$value\">\n");
}
$oPage->add($oAppContext->GetForForm());
if ($bDisplayActionsAtTop)
if ($sButtonsPosition != 'top')
{
// bottom or both: display the buttons here
$oPage->add($sButtons);
}

View File

@@ -401,12 +401,12 @@ class Config
'source_of_value' => '',
'show_in_conf_sample' => true,
),
'display_actions_at_top' => array(
'type' => 'bool',
'description' => 'Whether or not the actions/buttons should be displayed at the top of the screen',
'buttons_position' => array(
'type' => 'string',
'description' => 'Position of the forms buttons: bottom | top | both',
// examples... not used
'default' => true,
'value' => false,
'default' => 'both',
'value' => 'both',
'source_of_value' => '',
'show_in_conf_sample' => true,
),

View File

@@ -1577,10 +1577,10 @@ EOF
$iFieldIndex++;
}
}
$bDisplayFormAtTop = MetaModel::GetConfig()->Get('display_actions_at_top');
if (!$bDisplayFormAtTop)
$sButtonsPosition = MetaModel::GetConfig()->Get('buttons_position');
if ($sButtonsPosition != 'bottom')
{
// Displays the ticket details BEFORE the actions
// top or both: Displays the ticket details BEFORE the actions
$oP->add('<div class="ui-widget-content">');
$oObj->DisplayBareProperties($oP);
$oP->add('</div>');
@@ -1604,9 +1604,9 @@ EOF
$oP->add("<button type=\"submit\" class=\"action\"><span>$sActionLabel</span></button>\n");
$oP->add("</form>\n");
$oP->add("</div>\n");
if ($bDisplayFormAtTop)
if ($sButtonsPosition == 'bottom')
{
// Displays the ticket details BEFORE the actions
// bottom or both: Displays the ticket details AFTER the actions
$oP->add('<div class="ui-widget-content">');
$oObj->DisplayBareProperties($oP);
$oP->add('</div>');
@@ -1800,10 +1800,10 @@ EOF
$aTargetState = $aTargetStates[$sTargetState];
$aExpectedAttributes = $aTargetState['attribute_list'];
$oP->add("<h1>$sActionDetails</h1>\n");
$bDisplayFormAtTop = MetaModel::GetConfig()->Get('display_actions_at_top');
if (!$bDisplayFormAtTop)
$sButtonsPosition = MetaModel::GetConfig()->Get('buttons_position');
if ($sButtonsPosition == 'bottom')
{
// Displays the ticket details BEFORE the actions
// bottom: Displays the ticket details BEFORE the actions
$oP->add('<div class="ui-widget-content">');
$oObj->DisplayBareProperties($oP);
$oP->add('</div>');
@@ -1882,9 +1882,9 @@ EOF
$oP->add("<button type=\"submit\" class=\"action\"><span>$sActionLabel</span></button>\n");
$oP->add("</form>\n");
$oP->add("</div>\n");
if ($bDisplayFormAtTop)
if ($sButtonsPosition != 'top')
{
// Displays the ticket details AFTER the actions
// bottom or both: Displays the ticket details AFTER the actions
$oP->add('<div class="ui-widget-content">');
$oObj->DisplayBareProperties($oP);
$oP->add('</div>');