Highway to PSR2
[openemr.git] / library / ESign / Form / Button.php
blobd51562071e448057f81af42b8db4690ec3b8e0bf
1 <?php
3 namespace ESign;
5 /**
6 * Form implementation of ButtonIF interface, which is used to
7 * display a button that triggers esign behavior.
9 * Copyright (C) 2013 OEMR 501c3 www.oemr.org
11 * LICENSE: This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 3
14 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
22 * @package OpenEMR
23 * @author Ken Chapple <ken@mi-squared.com>
24 * @author Medical Information Integration, LLC
25 * @link http://www.open-emr.org
26 **/
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);