3
* @copyright © 2008, 2009 Intrahealth International, Inc.
4
* This File is part of I2CE
6
* I2CE is free software; you can redistribute it and/or modify it
7
* under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 3 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
23
* @author Carl Leitner <litlfred@ibiblio.org>
29
class I2CE_Swiss_Default extends I2CE_Swiss_Default_Base{
33
protected function displayValues($contentNode,$transient_options,$action) {
34
$this->template->addHeaderLink('swiss_default.css');
35
$showExpert = $this->factory->getStoredOptions('expert');
36
$node = $this->template->appendFileByNode("configuration_main.html",'div',$contentNode);
37
$displayName = $this->storage->getAttribute('displayName');
38
if (!$displayName) { //the display name has not been set. set it to the name of this configuration(Group) node
39
$displayName = self::humanText($this->storage->getName());
41
$this->template->setDisplayDataImmediate('displayName',$this->getDisplayName(),$node);
42
$this->template->setDisplayDataImmediate('description',$this->getDescription(),$node);
45
$configurationListNode = $this->template->getElementById('configuration_options',$node);
46
if (!$configurationListNode instanceof DOMNode) {
47
I2CE::raiseError ("No place to add scalars");
50
$configurationGroupListNode = $this->template->getElementById('configurationGroup_options',$node);
51
if (!$configurationGroupListNode instanceof DOMNode) {
52
I2CE::raiseError ("No place to add parents");
55
if ($this->path == '/') {
61
$children = $this->getChildNames();
62
if (!array_key_exists('leaf_as_link',$transient_options)) {
63
$mod_factory = I2CE_ModuleFactory::instance();
64
$transient_options['leaf_as_link'] = ($mod_factory->isEnabled('stub') && $this->template->hasAjax());
66
foreach ($children as $child) {
67
$swissChild = $this->factory->getSwiss($this->path,$child);
68
if (!$swissChild instanceof I2CE_Swiss) {
71
$childStorage = $swissChild->getStorage();
72
if ($childStorage->is_indeterminate()) {
75
if ($swissChild->getStatus('visible') === false) {
78
if ( (!$showExpert) && ($swissChild->getStatus('advanced') !== false)) {
81
if ( ($swissChild instanceof I2CE_Swiss_Default_Leaf )
82
&& ! (array_key_exists('leaf_as_link',$transient_options) && $transient_options['leaf_as_link'])) {
83
if (!$swissChild->displayValue($configurationListNode,$transient_options, $action)) {
88
$gNode = $this->template->appendFileByNode("configurationGroup_default.html","li",$configurationGroupListNode);
89
if (!$gNode instanceof DOMNode) {
90
I2CE::raiseError("Cannot append configurationGroup_default.html");
93
$swissChild->addAjaxLink('configurationGroup_link','configuration_main_contents','configurationGroup_link_ajax',$gNode,$action);
97
if (!$added && $node instanceof DOMNode) {
98
$this->template->removeNode($node);
114
# c-default-style: "bsd"
115
# indent-tabs-mode: nil