fix: faxsms psr7 vendor fix (#7794)
[openemr.git] / library / ESign / Form / Button.php
blobb6585ca28fb54e3c2af9e406999d05945a84bfa0
1 <?php
3 /**
4 * Form implementation of ButtonIF interface, which is used to
5 * display a button that triggers esign behavior.
7 * Copyright (C) 2013 OEMR 501c3 www.oemr.org
9 * LICENSE: This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 3
12 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
20 * @package OpenEMR
21 * @author Ken Chapple <ken@mi-squared.com>
22 * @author Medical Information Integration, LLC
23 * @link http://www.open-emr.org
24 **/
26 namespace ESign;
28 require_once $GLOBALS['srcdir'] . '/ESign/ButtonIF.php';
29 require_once $GLOBALS['srcdir'] . '/ESign/Viewer.php';
31 class Form_Button implements ButtonIF
33 private $_viewer = null;
35 public function __construct($formId, $formDir, $encounterId)
37 // Configure the viewer so it has access to these variables
38 $this->_viewer = new Viewer();
39 $this->_viewer->formId = $formId;
40 $this->_viewer->formDir = $formDir;
41 $this->_viewer->encounterId = $encounterId;
42 $this->_viewer->target = "_parent";
45 public function isViewable()
47 return $GLOBALS['esign_individual'];
50 public function getViewScript()
52 return $GLOBALS['srcdir'] . '/ESign/views/form/esign_button.php';
55 public function render(SignableIF $signable = null)
57 return $this->_viewer->render($this);
60 public function getHtml(SignableIF $signable = null)
62 return $this->_viewer->getHtml($this);