Ejemplo n.º 1
0
    function printForm($prefix = '', $fields = NULL)
    {
        include_once 'include/size_detector.class.php';
        if ($GLOBALS['system']->featureEnabled('PHOTOS') && (is_null($fields) || in_array('photo', $fields)) && !SizeDetector::isNarrow()) {
            $this->fields['photo'] = array('divider_before' => true);
            // fake field for interface purposes
            if ($this->id) {
                ?>
				<div class="person-photo-container">
					<img src="?call=photo&personid=<?php 
                echo (int) $this->id;
                ?>
" />
				</div>
				<?php 
            }
        }
        if (!$this->id) {
            unset($this->fields['familyid']);
        }
        parent::printForm($prefix, $fields);
        unset($this->fields['photo']);
        if (empty($fields) || in_array('custom', $fields)) {
            $customFields = $this->getCustomFields();
            $dummyField = new Custom_Field();
            if ($customFields) {
                ?>
				<hr />
				<div class="form-horizontal">
				<?php 
                foreach ($customFields as $fieldid => $fieldDetails) {
                    $dummyField->populate($fieldid, $fieldDetails);
                    $tableClass = $fieldDetails['allow_multiple'] ? 'expandable' : '';
                    $values = isset($this->_custom_values[$fieldid]) ? $this->_custom_values[$fieldid] : array('');
                    if ($fieldDetails['divider_before']) {
                        echo '<hr />';
                    }
                    ?>
					<div class="control-group">
						<?php 
                    if (strlen($fieldDetails['heading_before'])) {
                        ?>
								<h4><?php 
                        echo ents($fieldDetails['heading_before']);
                        ?>
</h4>
							<?php 
                    }
                    ?>

						<label class="control-label" for="custom_<?php 
                    echo $fieldid;
                    ?>
"><?php 
                    echo ents($fieldDetails['name']);
                    ?>
</label>
						<div class="controls">
							<table class="<?php 
                    echo $tableClass;
                    ?>
">
							<?php 
                    foreach ($values as $value) {
                        ?>
								<tr><td>
									<?php 
                        $dummyField->printWidget($value);
                        ?>
								</td></tr>
								<?php 
                    }
                    ?>
							</table>
						</div>
					</div>
					<?php 
                }
                ?>
				</div>
				<?php 
            }
        }
    }
Ejemplo n.º 2
0
    function printForm($prefix = '', $fields = NULL)
    {
        include_once 'include/size_detector.class.php';
        if ($GLOBALS['system']->featureEnabled('DATES') && (is_null($fields) || in_array('dates', $fields))) {
            $this->fields['dates'] = array('divider_before' => true);
            // fake field for interface purposes
        }
        if ($GLOBALS['system']->featureEnabled('PHOTOS') && (is_null($fields) || in_array('photo', $fields)) && !SizeDetector::isNarrow()) {
            $this->fields['photo'] = array('divider_before' => true);
            // fake field for interface purposes
            if ($this->id) {
                ?>
				<div class="person-photo-container">
					<img src="?call=person_photo&personid=<?php 
                echo (int) $this->id;
                ?>
" />
				</div>
				<?php 
            }
        }
        if (!$this->id) {
            unset($this->fields['familyid']);
        }
        parent::printForm($prefix, $fields);
        unset($this->fields['photo']);
    }