Skip to content

Commit

Permalink
Not sure how this got left out but it did.
Browse files Browse the repository at this point in the history
  • Loading branch information
adunsulag committed Jun 21, 2024
1 parent 6ade6c4 commit 4e0d3f7
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/Common/Forms/FormActionBarSettings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace OpenEMR\Common\Forms;

class FormActionBarSettings
{
const ACTION_BAR_DISPLAY_FORM_TOP = '0';
const ACTION_BAR_DISPLAY_FORM_BOTTOM = '1';

// TODO: @adunsulag demographics_full.php does NOT like the TOP_AND_BOTTOM option so going to skip this for now as a valid setting.
const ACTION_BAR_DISPLAY_FORM_TOP_AND_BOTTOM = '2';
public static function getGlobalSettingsList()
{
return array(
self::ACTION_BAR_DISPLAY_FORM_TOP => xl('Top of Form (default)')
,self::ACTION_BAR_DISPLAY_FORM_BOTTOM => xl('Bottom of Form')
// ,self::ACTION_BAR_DISPLAY_FORM_TOP_AND_BOTTOM => xl('Top and Bottom of Form')
);
}

public static function getDefaultSetting()
{
return self::ACTION_BAR_DISPLAY_FORM_TOP;
}

public static function shouldDisplayTopActionBar()
{
// probably could make this more efficient by doing integer position comparisons, but the global values are stored as strings...
return $GLOBALS['form_actionbar_position'] == self::ACTION_BAR_DISPLAY_FORM_TOP
|| $GLOBALS['form_actionbar_position'] == self::ACTION_BAR_DISPLAY_FORM_TOP_AND_BOTTOM;
}
public static function shouldDisplayBottomActionBar()
{
return $GLOBALS['form_actionbar_position'] == self::ACTION_BAR_DISPLAY_FORM_BOTTOM
|| $GLOBALS['form_actionbar_position'] == self::ACTION_BAR_DISPLAY_FORM_TOP_AND_BOTTOM;
}
}

0 comments on commit 4e0d3f7

Please sign in to comment.