forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Not sure how this got left out but it did.
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |