/** * Print the interface for CONFIGURING this custom field. * @param string $fieldname Name of this object's field * @param string $prefix Prefix to use on HTML element names */ function printFieldInterface($fieldname, $prefix = '') { switch ($fieldname) { case 'allow_multiple': print_widget($prefix . $fieldname, array('type' => 'checkbox'), $this->values[$fieldname]); break; case 'params': $params = $this->getValue('params'); $params['options'] = $this->getOptions(); if ($this->id) { $fn = 'printParams' . ucfirst($this->values['type']); call_user_func(array('Custom_Field', $fn), $prefix, $params); } else { foreach ($this->fields['type']['options'] as $opt => $label) { ?> <div class="field-params" data-params-type="<?php echo $opt; ?> "> <?php $fn = 'printParams' . ucfirst($opt); call_user_func(array('Custom_Field', $fn), $prefix, $params); ?> </div> <?php } } break; default: parent::printFieldInterface($fieldname, $prefix); } }
function printFieldInterface($fieldname, $prefix) { if ($fieldname == 'parent_category') { self::printChooser($prefix . $fieldname, $this->getValue('parent_category'), $this->id); } else { return parent::printFieldInterface($fieldname, $prefix); } }
function printFieldInterface($name, $prefix = '') { if ($name == 'volunteer_group' && (empty($this->id) || $this->haveLock())) { $GLOBALS['system']->includeDBClass('person_group'); $value = array_get($this->values, $name); Person_Group::printChooser($prefix . $name, $value, array(), null, '(None)'); } else { parent::printFieldInterface($name, $prefix); } }
/** * Print an interface for CONFIGURING this note template * * @param string $fieldname * @param string $prefix */ function printFieldInterface($fieldname, $prefix = '') { switch ($fieldname) { case 'fields': $this->_printFieldsConfiguration(); break; default: parent::printFieldInterface($fieldname, $prefix); } }
function printFieldInterface($name) { parent::printFieldInterface($name); $postcode_url = POSTCODE_LOOKUP_URL; if ($name == 'address_suburb' && !empty($postcode_url)) { ?> <a class="smallprint hidden-phone postcode-lookup" href="<?php echo POSTCODE_LOOKUP_URL; ?> " tabindex="-1">Look up <?php echo strtolower(defined('ADDRESS_POSTCODE_LABEL') ? constant('ADDRESS_POSTCODE_LABEL') : 'postcode'); ?> </a> <?php } }
function printFieldInterface($fieldname, $prefix) { switch ($fieldname) { case 'params': ?> <div class="indepfield-options" data-indeptype="select"> <?php Custom_Field::printParamsSelect($prefix, $this->getValue('params')); ?> </div> <?php break; default: return parent::printFieldInterface($fieldname, $prefix); } }
function printFieldInterface($name, $prefix) { switch ($name) { case 'members': $all_roles = $GLOBALS['system']->getDbObjectData('roster_role', array(), 'OR', 'roster_role.congregationid, roster_role.title'); ?> <script> $(window).load(function() { $('select.roster-view-member-type-chooser').change(function() { var chooser = this; $(this).siblings('select').each(function() { var wanted = this.className == 'view-members-'+$(chooser).val(); this.style.display = wanted ? '' : 'none'; this.disabled = wanted ? false : true; }); }).change(); }); </script> <table class="no-padding middle expandable"> <?php $members_to_print = $this->_members + array(-1 => array('role_id' => 0, 'role_title' => '', 'service_field' => NULL, 'congregationid' => NULL)); foreach ($members_to_print as $order_num => $member_details) { $role_selected_html = is_null($member_details['role_id']) ? '' : 'selected="selected"'; $field_selected_html = is_null($member_details['service_field']) ? '' : 'selected="selected"'; $role_enabled_html = is_null($member_details['role_id']) ? 'disabled="disabled" style="display: none"' : ''; $field_enabled_html = is_null($member_details['service_field']) ? 'disabled="disabled" style="display: none"' : ''; ?> <tr> <td> <img src="<?php echo BASE_URL; ?> /resources/img/expand_up_down_green_small.png" class="icon insert-row-below" style="position: relative; top: 2ex" title="Create a blank entry here" /> </td> <td class="nowrap"> <select class="roster-view-member-type-chooser"> <option <?php echo $role_selected_html; ?> value="role">Roster Role</option> <option <?php echo $field_selected_html; ?> value="service_field">Service Field</option> </select> <select name="members[]" class="view-members-role" <?php echo $role_enabled_html; ?> > <option value=""></option> <?php $last_cong = ''; foreach ($all_roles as $id => $details) { if ($details['congregation_name'] != $last_cong) { if ($last_cong) { echo '</optgroup>'; } ?> <optgroup label="<?php echo ents($details['congregation_name']); ?> "> <?php $last_cong = $details['congregation_name']; } ?> <option value="role-<?php echo $id; ?> "<?php if ($id == $member_details['role_id']) { echo 'selected="selected" '; } ?> ><?php echo ents($details['congregation_name'] . ' ' . $details['title']); ?> </option> <?php } ?> </optgroup> </select> <select name="members[]" class="view-members-service_field" <?php echo $field_enabled_html; ?> > <option value=""></option> <?php foreach ($GLOBALS['system']->getDBObjectData('congregation', array('!meeting_time' => ''), 'AND', 'meeting_time') as $congid => $cong_details) { ?> <optgroup label="<?php echo ents($cong_details['name']); ?> "> <?php foreach (Service::getDisplayFields() as $k => $v) { $selected = $member_details['congregationid'] == $congid && $member_details['service_field'] == $k ? 'selected="selected"' : ''; ?> <option value="service-<?php echo $congid . '-' . $k; ?> " <?php echo $selected; ?> ><?php echo ents($cong_details['name'] . ' ' . $v); ?> </option> <?php } ?> </optgroup> <?php } ?> </select> </td> <td class="nowrap"> <img src="<?php echo BASE_URL; ?> /resources/img/arrow_up_thin_black.png" class="icon move-row-up" title="Move this role up" /> <img src="<?php echo BASE_URL; ?> /resources/img/arrow_down_thin_black.png" class="icon move-row-down" title="Move this role down" /> <img src="<?php echo BASE_URL; ?> /resources/img/cross_red.png" class="icon delete-row" title="Delete this role from the list" /> </td> </tr> <?php } ?> </table> <br /> <?php break; default: return parent::printFieldInterface($name, $prefix); } }
function printFieldInterface($fieldname, $prefix = '') { if ($fieldname == 'categoryid') { $GLOBALS['system']->includeDBClass('person_group_category'); Person_Group_Category::printChooser($prefix . $fieldname, $this->getValue('categoryid')); echo ' <small><a href="' . build_url(array('view' => 'groups__manage_categories')) . '">Manage categories</a></small>'; } else { return parent::printFieldInterface($fieldname, $prefix); } }
public function printFieldInterface($name, $prefix = '') { if ($name == 'tags') { $options = $GLOBALS['system']->getDBObjectData('service_component_tag', array(), 'OR', 'tag'); foreach ($options as $k => $v) { $options[$k] = $v['tag']; } $params = array('type' => 'select', 'options' => $options, 'label' => 'Tags', 'references' => 'service_component_tag', 'order_by' => 'tag', 'allow_empty' => FALSE, 'allow_multiple' => FALSE, 'class' => 'tag-chooser', 'empty_text' => '-- Select --'); ?> <table class="expandable"> <?php foreach (array_get($this->values, 'tags', array()) as $tagid) { ?> <tr> <td><?php print_widget('tags[]', $params, $tagid); ?> </td> <td><img src="<?php echo BASE_URL; ?> resources/img/cross_red.png" class="icon delete-row" title="Delete this tag from the list" /></td> </tr> <?php } $params['allow_empty'] = TRUE; $params['options']['_new_'] = '* Add new tag:'; ?> <tr> <td> <?php print_widget('tags[]', $params, NULL); ?> <input style="display: none" placeholder="Type new tag here" type="text" name="new_tags[]" /> </td> <td><img src="<?php echo BASE_URL; ?> resources/img/cross_red.png" class="icon delete-row" title="Delete this tag from the list" /></td> </tr> </table> <p class="help-inline"><a href="?view=_manage_service_component_tags">Manage tag library</a></p> <?php } else { parent::printFieldInterface($name, $prefix); } if ($name == 'ccli_number') { if (defined('CCLI_SEARCH_URL')) { ?> <a class="smallprint ccli-lookup" href="<?php echo CCLI_SEARCH_URL; ?> ">Search CCLI</a> <?php } } }
function printFieldInterface($fieldname, $prefix) { return parent::printFieldInterface($fieldname, $prefix); }