本文整理汇总了PHP中data_entry_helper::checkbox方法的典型用法代码示例。如果您正苦于以下问题:PHP data_entry_helper::checkbox方法的具体用法?PHP data_entry_helper::checkbox怎么用?PHP data_entry_helper::checkbox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类data_entry_helper
的用法示例。
在下文中一共展示了data_entry_helper::checkbox方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_controls
/**
* Define the HTML required for this filter's UI panel.
*/
public function get_controls()
{
$r = '<div class="context-instruct messages warning">' . lang::get('Please note, you cannnot change this setting because of your access permissions in this context.') . '</div>';
$r .= data_entry_helper::checkbox(array('label' => lang::get('Only include my records'), 'fieldname' => 'my_records'));
$vocabulary = taxonomy_vocabulary_machine_name_load('hubs');
$terms = entity_load('taxonomy_term', FALSE, array('vid' => $vocabulary->vid));
// the hub is driven by a user field, stored as tid.
$r .= '<fieldset><legend>' . lang::get('Members of Hub:') . '</legend>';
$r .= "<p id=\"who-hub-instruct\">" . lang::get('Please note that this converts each Hub into a list of users associated with the Hub, and fetches the data created by those users.') . "</p>\n";
$hubList = array();
foreach ($terms as $term) {
$hubList[] = array($term->tid, $term->name);
// TODO Cache
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'user')->fieldCondition('field_preferred_training_hub', 'tid', $term->tid);
$result = $query->execute();
// This gives us the CMS user ID: now convert to
$userIDList = array();
if (count($result) == 0) {
$userIDList = array(-1);
} else {
$cmsUserIDs = array_keys($result['user']);
foreach ($cmsUserIDs as $cmsUserID) {
$user_data = user_load($cmsUserID);
// TODO Making assumption about language
if (!empty($user_data->field_indicia_user_id['und'][0]['value'])) {
$userIDList[] = $user_data->field_indicia_user_id['und'][0]['value'];
}
}
if (count($userIDList) == 0) {
$userIDList = array(-1);
}
}
$userIDList = array_unique($userIDList);
data_entry_helper::$javascript .= "indiciaData.hub" . $term->tid . " = '" . implode(',', $userIDList) . "';\n";
$r .= data_entry_helper::checkbox(array('label' => $term->name, 'fieldname' => 'hub' . $term->tid, 'helpText' => ($userIDList[0] == -1 ? 'No' : count($userIDList)) . lang::get(' users.')));
}
data_entry_helper::$javascript .= "indiciaData.hubList = " . json_encode($hubList) . ";\n";
$r .= '</fieldset>';
return $r;
}
示例2: get_control_speciesattributes
/**
* Get the block of custom attributes at the species (occurrence) level
*/
private static function get_control_speciesattributes($auth, $args, $tabalias, $options)
{
if (!call_user_func(array(get_called_class(), 'getGridMode'), $args)) {
// Add any dynamically generated controls
$attrArgs = array('valuetable' => 'occurrence_attribute_value', 'attrtable' => 'occurrence_attribute', 'key' => 'occurrence_id', 'fieldprefix' => 'occAttr', 'extraParams' => $auth['read'], 'survey_id' => $args['survey_id']);
if (count(self::$occurrenceIds) == 1) {
// if we have a single occurrence Id to load, use it to get attribute values
$attrArgs['id'] = self::$occurrenceIds[0];
}
$attributes = data_entry_helper::getAttributes($attrArgs, false);
$defAttrOptions = array('extraParams' => $auth['read']);
$r = get_attribute_html($attributes, $args, $defAttrOptions);
if ($args['occurrence_comment']) {
$r .= data_entry_helper::textarea(array('fieldname' => 'occurrence:comment', 'label' => lang::get('Record Comment')));
}
if ($args['occurrence_confidential']) {
$r .= data_entry_helper::checkbox(array('fieldname' => 'occurrence:confidential', 'label' => lang::get('Record Confidental')));
}
if ($args['occurrence_images']) {
$opts = array('table' => 'occurrence_image', 'label' => lang::get('Upload your photos'));
if ($args['interface'] !== 'one_page') {
$opts['tabDiv'] = $tabalias;
}
$opts['resizeWidth'] = isset($options['resizeWidth']) ? $options['resizeWidth'] : 1600;
$opts['resizeHeight'] = isset($options['resizeHeight']) ? $options['resizeHeight'] : 1600;
$opts['caption'] = lang::get('Photos');
$r .= data_entry_helper::file_box($opts);
}
return $r;
} else {
// in grid mode the attributes are embedded in the grid.
return '';
}
}
示例3: get_form
/**
* Return the generated form output.
* @param array $args List of parameter values passed through to the form depending on how the form has been configured.
* This array always contains a value for language.
* @param object $node The Drupal node object.
* @param array $response When this form is reloading after saving a submission, contains the response from the service call.
* Note this does not apply when redirecting (in this case the details of the saved object are in the $_GET data).
* @return Form HTML.
* @todo: Implement this method
*/
public static function get_form($args, $node, $response = null)
{
global $indicia_templates, $user;
data_entry_helper::enable_validation('entry_form');
$url = !empty($_SERVER['HTTPS']) ? "https://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] : "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
$r = data_entry_helper::loading_block_start();
$r .= "<form method=\"post\" id=\"entry_form\" action=\"{$url}\">\n";
$readAuth = data_entry_helper::get_read_auth($args['website_id'], $args['password']);
$r .= "<div id=\"controls\">\n";
if ($args['interface'] != 'one_page') {
$r .= "<ul>\n";
if ($user->uid == 0) {
$r .= ' <li><a href="#about_you"><span>' . lang::get('about you') . "</span></a></li>\n";
}
$r .= ' <li><a href="#species"><span>' . lang::get('what did you see') . "</span></a></li>\n";
$r .= ' <li><a href="#place"><span>' . lang::get('where was it') . "</span></a></li>\n";
$r .= ' <li><a href="#other"><span>' . lang::get('other information') . "</span></a></li>\n";
$r .= "</ul>\n";
data_entry_helper::enable_tabs(array('divId' => 'controls', 'style' => $args['interface']));
}
if ($user->uid == 0) {
$r .= "<fieldset id=\"about_you\">\n";
if ($args['interface'] == 'one_page') {
$r .= '<legend>' . lang::get('about you') . '</legend>';
}
$r .= data_entry_helper::text_input(array('label' => lang::get('first name'), 'fieldname' => 'smpAttr:' . $args['first_name_attr_id'], 'class' => 'control-width-4', 'validation' => array('required')));
$r .= data_entry_helper::text_input(array('label' => lang::get('surname'), 'fieldname' => 'smpAttr:' . $args['surname_attr_id'], 'class' => 'control-width-4', 'validation' => array('required')));
$r .= data_entry_helper::text_input(array('label' => lang::get('phone number'), 'fieldname' => 'smpAttr:' . $args['phone_attr_id'], 'class' => 'control-width-4'));
$r .= data_entry_helper::text_input(array('label' => lang::get('email'), 'fieldname' => 'smpAttr:' . $args['email_attr_id'], 'class' => 'control-width-4 optional', 'validation' => array('email')));
if ($args['interface'] == 'wizard') {
$r .= data_entry_helper::wizard_buttons(array('divId' => 'controls', 'page' => 'first'));
}
$r .= "</fieldset>\n";
}
// Species tab
$r .= "<fieldset id=\"species\">\n";
if ($args['interface'] == 'one_page') {
$r .= '<legend>' . lang::get('what did you see') . '</legend>';
}
$species_list_args = array('label' => lang::get('Species'), 'fieldname' => 'occurrence:taxa_taxon_list_id', 'table' => 'taxa_taxon_list', 'captionField' => 'taxon', 'valueField' => 'id', 'listId' => $args['species_list_id'], 'columns' => 1, 'parentField' => 'parent_id', 'checkboxCol' => false, 'occAttrs' => array($args['abundance_attr_id']), 'extraParams' => $readAuth + array('view' => 'detail', 'orderby' => 'taxonomic_sort_order'), 'survey_id' => $args['survey_id'], 'header' => false, 'view' => 'detail', 'PHPtaxonLabel' => true);
// Build a nice template to show a picture of each species, with fancybox.
data_entry_helper::add_resource('fancybox');
data_entry_helper::$javascript .= "jQuery('a.fancybox').fancybox();\n";
$indicia_templates['taxon_label'] = 'return \'<div class="taxon-cell">' . '<a href="' . data_entry_helper::$base_url . 'upload/{image_path}" class="fancybox" >' . '<img alt="{taxon}" src="' . data_entry_helper::$base_url . 'upload/med-{image_path}" width="250"/></a>' . '<div>{taxon}</div></div>' . '<div class="taxon-desc"><ul><li>\'.str_replace("\\n", "</li><li>","{description_in_list}").\'</li></ul>' . '<a href="http://www.marine-life.org.uk/northeastcetaceans/?q=\'.
strtolower(str_replace(array(" ", "\\\'"), array("-", ""), "{taxon}")).
\'" target="_blank" class="ui-state-default ui-corner-all indicia-button">' . lang::get('More Info') . '...</a></div>\';';
// Template the taxon label cell
$indicia_templates['taxon_label_cell'] = "\n<td class='scTaxonCell'>{content}</td>";
// Also template the attribute controls to show the label in place.
$indicia_templates['attribute_cell'] = "\n<td class='scOccAttrCell'><label>{label}:</label><br/>{content}</td>";
$r .= data_entry_helper::species_checklist($species_list_args);
if ($args['interface'] == 'wizard') {
$r .= data_entry_helper::wizard_buttons(array('divId' => 'controls', 'page' => $user->uid == 0 ? 'middle' : 'first'));
}
$r .= "</fieldset>";
// --Place tab--
$r .= "<fieldset id=\"place\">\n";
if ($args['interface'] == 'one_page') {
$r .= '<legend>' . lang::get('where was it') . '</legend>';
}
$r .= data_entry_helper::radio_group(array('label' => 'Where were you when you made the sighting?', 'fieldname' => 'smpAttr:' . $args['platform_attr_id'], 'table' => 'termlists_term', 'captionField' => 'term', 'valueField' => 'id', 'extraParams' => $readAuth + array('termlist_id' => $args['platform_termlist_id']), 'sep' => '<br />', 'labelClass' => 'auto', 'class' => 'inline sighting-platform', 'validation' => array('required')));
$r .= '<div id="place_wrapper" class="hidden">';
// Some instructions only visible when entering data from a boat
$r .= '<p class="boat_mode page-notice ui-state-highlight ui-corner-all">' . lang::get('Instructions for when on boat') . '</p>';
// Some instructions only visible when entering data from the shore
$r .= '<p class="shore_mode page-notice ui-state-highlight ui-corner-all">' . lang::get('Instructions for clicking on map') . '</p>';
$r .= '<div class="boat_mode">';
// Add help examples to the lat and long boxes
$indicia_templates['sref_textbox_latlong'] = '<label for="{idLat}">{labelLat}:</label>' . '<input type="text" id="{idLat}" name="{fieldnameLat}" {class} {disabled} value="{default}" /> <p class="helpText">e.g. 55:12.345N</p>' . '<label for="{idLong}">{labelLong}:</label>' . '<input type="text" id="{idLong}" name="{fieldnameLong}" {class} {disabled} value="{default}" /> <p class="helpText">e.g. 0:45.678W</p>' . '<input type="hidden" id="imp-geom" name="{table}:geom" value="{defaultGeom}" />' . '<input type="text" id="{id}" name="{fieldname}" style="display:none" value="{default}" />';
$r .= data_entry_helper::sref_and_system(array('systems' => array(4326 => lang::get('Latitude, Longitude')), 'splitLatLong' => true, 'helpText' => lang::get('Instructions for latlong')));
$r .= '</div>';
// Initially, we hide the map. Only show it when the user selects the sighting was from the shore,
// as a click on the map for boat recordings will not be accurate.
$r .= '<div class="shore_mode">';
$options = iform_map_get_map_options($args, $readAuth);
$olOptions = iform_map_get_ol_options($args);
$options['maxZoom'] = 9;
// Switch to degrees and decimal minutes for lat long.
$options['latLongFormat'] = 'DM';
$r .= data_entry_helper::map_panel($options, $olOptions);
// Now, add some JavaScript to show or hide the map. Show it for when the sighting was from the shore.
// Hide it for boat based sightings as we want a GPS coordinate in this case. The JavaScript looks for the
// checked radio button to see the value
data_entry_helper::$javascript .= 'jQuery(".sighting-platform input").click(
function() {
var platformId = jQuery("input[name=smpAttr\\\\:' . $args['platform_attr_id'] . ']:checked").val();
if (platformId == ' . $args['platform_mapped_term_id'] . ') {
jQuery("#place_wrapper").removeClass("hidden");
jQuery(".shore_mode").removeClass("hidden");
jQuery(".boat_mode").addClass("hidden");
//.........这里部分代码省略.........
示例4: array
<legend>Verification rule details</legend>
<?php
data_entry_helper::link_default_stylesheet();
data_entry_helper::enable_validation('entry-form');
if (isset($values['verification_rule:id'])) {
?>
<input type="hidden" name="verification_rule:id" value="<?php
echo html::initial_value($values, 'verification_rule:id');
?>
" />
<?php
}
echo data_entry_helper::text_input(array('label' => 'Title', 'fieldname' => 'verification_rule:title', 'class' => 'control-width-4', 'validation' => array('required'), 'default' => html::initial_value($values, 'verification_rule:title')));
echo data_entry_helper::textarea(array('label' => 'Description', 'fieldname' => 'verification_rule:description', 'class' => 'control-width-6', 'default' => html::initial_value($values, 'verification_rule:description')));
echo data_entry_helper::text_input(array('label' => 'Test Type', 'fieldname' => 'verification_rule:test_type', 'class' => 'control-width-4', 'validation' => array('required'), 'default' => html::initial_value($values, 'verification_rule:test_type')));
echo data_entry_helper::text_input(array('label' => 'Source URL', 'fieldname' => 'verification_rule:source_url', 'class' => 'control-width-6', 'default' => html::initial_value($values, 'verification_rule:source_url'), 'helpText' => 'When this verification rule file was imported, this identifies the name of the file ' . 'it was imported from'));
echo data_entry_helper::text_input(array('label' => 'Source Filename', 'fieldname' => 'verification_rule:source_filename', 'class' => 'control-width-6', 'default' => html::initial_value($values, 'verification_rule:source_filename')));
echo data_entry_helper::text_input(array('label' => 'Error Message', 'fieldname' => 'verification_rule:error_message', 'class' => 'control-width-6', 'validation' => array('required'), 'default' => html::initial_value($values, 'verification_rule:error_message')));
echo data_entry_helper::checkbox(array('label' => 'Reverse Rule', 'fieldname' => 'verification_rule:reverse_rule', 'default' => html::initial_value($values, 'verification_rule:reverse_rule'), 'helpText' => 'Tick this box to reverse the rule logic - i.e. items that pass the test are flagged as failures.'));
echo data_entry_helper::textarea(array('label' => 'Metadata', 'fieldname' => 'metaFields:metadata', 'class' => 'control-width-6', 'default' => html::initial_value($values, 'metaFields:metadata'), 'helpText' => 'Additional settings from the header of the verification rule file, in parameter=value format with ' . 'one parameter per line'));
echo data_entry_helper::textarea(array('label' => 'Other Data', 'fieldname' => 'metaFields:data', 'class' => 'control-width-6', 'default' => html::initial_value($values, 'metaFields:data'), 'helpText' => 'Additional settings from the data part of the verification rule file, with blocks of data items ' . 'started by a header name in square brackets, followed by parameters in parameter=value format with ' . 'one parameter per line'));
echo $metadata;
echo html::form_buttons(html::initial_value($values, 'verification_rule:id') != null, false, false);
data_entry_helper::link_default_stylesheet();
data_entry_helper::$dumped_resources[] = 'jquery';
data_entry_helper::$dumped_resources[] = 'jquery_ui';
data_entry_helper::$dumped_resources[] = 'fancybox';
echo data_entry_helper::dump_javascript();
?>
</fieldset>
</form>
示例5: array
<p>This page allows you to specify the details of a rank in the taxon hierarchy.</p>
<form class="cmxform" id="rank-edit" action="<?php
echo url::site() . 'taxon_rank/save';
?>
" method="post">
<?php
echo $metadata;
?>
<fieldset>
<input type="hidden" name="taxon_rank:id" value="<?php
echo $id;
?>
" />
<legend>Taxon rank details</legend>
<?php
echo data_entry_helper::text_input(array('label' => 'Rank', 'fieldname' => 'taxon_rank:rank', 'default' => html::initial_value($values, 'taxon_rank:rank'), 'helpText' => 'The main label used for this taxon rank.', 'validation' => array('required')));
echo data_entry_helper::text_input(array('label' => 'Short name', 'fieldname' => 'taxon_rank:short_name', 'default' => html::initial_value($values, 'taxon_rank:short_name'), 'helpText' => 'The shortened label used for this taxon rank.', 'validation' => array('required')));
echo data_entry_helper::checkbox(array('label' => 'Italicise taxon', 'fieldname' => 'taxon_rank:italicise_taxon', 'default' => html::initial_value($values, 'taxon_rank:italicise_taxon'), 'helpText' => 'Tick this box if latin species names of this rank are typically shown in italics.'));
echo data_entry_helper::text_input(array('label' => 'Sort order', 'fieldname' => 'taxon_rank:sort_order', 'default' => html::initial_value($values, 'taxon_rank:sort_order'), 'helpText' => 'The sort order of this taxon rank. Ranks higher up the taxonomic tree have a lower order.', 'validation' => array('required', 'integer')));
?>
</fieldset>
<?php
echo html::form_buttons($id != null, false, false);
data_entry_helper::$dumped_resources[] = 'jquery';
data_entry_helper::$dumped_resources[] = 'jquery_ui';
data_entry_helper::$dumped_resources[] = 'fancybox';
data_entry_helper::enable_validation('rank-edit');
data_entry_helper::link_default_stylesheet();
echo data_entry_helper::dump_javascript();
?>
</form>
示例6: get_control_identifier
private static function get_control_identifier($auth, $args, $tabalias, $options)
{
$fieldPrefix = !empty($options['fieldprefix']) ? $options['fieldprefix'] : '';
$r = '';
$r .= '<h3 id="' . $fieldPrefix . 'header" class="idn:accordion:header"><a href="#">' . $options['identifierName'] . '</a></h2>';
$r .= '<div id="' . $fieldPrefix . 'panel" class="idn:accordion:panel">';
$r .= '<input type="hidden" name="' . $fieldPrefix . 'identifier:identifier_type_id" value="' . $options['identifierTypeId'] . '" />' . "\n";
$r .= '<input type="hidden" name="' . $fieldPrefix . 'identifier:coded_value" id="' . $fieldPrefix . 'identifier:coded_value" class="identifier_coded_value" value="" />' . "\n";
$val = isset(data_entry_helper::$entity_to_load[$fieldPrefix . 'identifier:id']) ? data_entry_helper::$entity_to_load[$fieldPrefix . 'identifier:id'] : '0';
$r .= '<input type="hidden" name="' . $fieldPrefix . 'identifier:id" id="' . $fieldPrefix . 'identifier:id" class="identifier_id" value="' . $val . '" />' . "\n";
if (isset(data_entry_helper::$entity_to_load[$fieldPrefix . 'identifiers_subject_observation:id'])) {
$r .= '<input type="hidden" id="' . $fieldPrefix . 'identifiers_subject_observation:id" name="' . $fieldPrefix . 'identifiers_subject_observation:id" ' . 'value="' . data_entry_helper::$entity_to_load[$fieldPrefix . 'identifiers_subject_observation:id'] . '" />' . "\n";
}
// checkbox - (now hidden by CSS, probably should refactor to hidden input?)
$r .= data_entry_helper::checkbox(array_merge(array('label' => '', 'fieldname' => $fieldPrefix . 'identifier:checkbox', 'class' => 'identifier_checkbox identifierRequired noDuplicateIdentifiers'), $options));
// loop through the requested attributes and output an appropriate control
$classes = $options['class'];
foreach ($options['attrList'] as $attribute) {
// find the definition of this attribute
$found = false;
if ($attribute['attrType'] === 'idn') {
foreach ($options['idnAttributeTypes'] as $attrType) {
if ($attrType['id'] === $attribute['typeId']) {
$found = true;
break;
}
}
} else {
if ($attribute['attrType'] === 'iso') {
foreach ($options['isoAttributeTypes'] as $attrType) {
if ($attrType['id'] === $attribute['typeId']) {
$found = true;
break;
}
}
}
}
if (!$found) {
throw new exception(lang::get('Unknown ' . $attribute['attrType'] . ' attribute type id [' . $attribute['typeId'] . '] specified for ' . $options['identifierName'] . ' in Identifier Attributes array.'));
}
// setup any locking
if (!empty($attribute['lockable']) && $attribute['lockable'] === true) {
$options['lockable'] = $options['identifiers_lockable'];
}
// setup any data filters
if ($attribute['attrType'] === 'idn' && $options['baseColourId'] == $attribute['typeId']) {
if (!empty($args['base_colours'])) {
// filter the colours available
$query = array('in' => array('id', $args['base_colours']));
}
$attr_name = 'base-colour';
} elseif ($attribute['attrType'] === 'idn' && $options['textColourId'] == $attribute['typeId']) {
if (!empty($args['text_colours'])) {
// filter the colours available
$query = array('in' => array('id', $args['text_colours']));
}
$attr_name = 'text-colour';
} elseif ($attribute['attrType'] === 'idn' && $options['positionId'] == $attribute['typeId']) {
$attr_name = 'position';
if (count($args['position']) > 0) {
// filter the identifier position available
$query = array('in' => array('id', $args['position']));
}
} elseif ($attribute['attrType'] === 'idn' && $options['sequenceId'] == $attribute['typeId']) {
$attr_name = 'sequence';
$options['maxlength'] = $options['seq_maxlength'] ? $options['seq_maxlength'] : '';
if ($options['seq_format_class']) {
$options['class'] = empty($options['class']) ? $options['seq_format_class'] : (strstr($options['class'], $options['seq_format_class']) ? $options['class'] : $options['class'] . ' ' . $options['seq_format_class']);
}
} elseif ($attribute['attrType'] === 'iso' && $options['conditionsId'] == $attribute['typeId']) {
// filter the identifier conditions available
if ($options['identifierTypeId'] == $args['neck_collar_type'] && !empty($args['neck_collar_conditions'])) {
$query = array('in' => array('id', $args['neck_collar_conditions']));
} elseif ($options['identifierTypeId'] == $args['enscribed_colour_ring_type'] && !empty($args['coloured_ring_conditions'])) {
$query = array('in' => array('id', $args['coloured_ring_conditions']));
} elseif ($options['identifierTypeId'] == $args['metal_ring_type'] && !empty($args['metal_ring_conditions'])) {
$query = array('in' => array('id', $args['metal_ring_conditions']));
}
$attr_name = 'conditions';
}
// add classes as identifiers
$options['class'] = empty($options['class']) ? $options['classprefix'] . $attr_name : (strstr($options['class'], $options['classprefix'] . $attr_name) ? $options['class'] : $options['class'] . ' ' . $options['classprefix'] . $attr_name);
$options['class'] = $options['class'] . ' idn-' . $attr_name;
if ($attribute['attrType'] === 'idn' && ($options['baseColourId'] == $attribute['typeId'] || $options['textColourId'] == $attribute['typeId'])) {
$options['class'] = strstr($options['class'], 'select_colour') ? $options['class'] : $options['class'] . ' select_colour';
$options['class'] = strstr($options['class'], 'textAndBaseMustDiffer') ? $options['class'] : $options['class'] . ' textAndBaseMustDiffer';
}
if ($attribute['attrType'] === 'idn' && $options['sequenceId'] == $attribute['typeId']) {
$options['class'] = strstr($options['class'], 'identifier_sequence') ? $options['class'] : $options['class'] . ' identifier_sequence';
}
if (!empty($attribute['hidden']) && $attribute['hidden'] === true) {
$dataType = 'H';
// hidden
if (!empty($attribute['hiddenValue'])) {
$dataDefault = $attribute['hiddenValue'];
} else {
$dataDefault = '';
}
} else {
$dataType = $attrType['data_type'];
//.........这里部分代码省略.........
示例7: get_control_zeroabundance
/**
* Get the zero abundance checkbox control
*/
protected static function get_control_zeroabundance($auth, $args, $tabAlias, $options)
{
if ($args['multiple_occurrence_mode'] === 'single') {
$options = array_merge(array('label' => 'Zero Abundance', 'fieldname' => 'occurrence:zero_abundance', 'helpText' => 'Tick this box if this is a record that the species was not found.'), $options);
return data_entry_helper::checkbox($options);
} else {
return "[zero abundance] control cannot be included in form when in grid entry mode.";
}
}
示例8: get_form
/**
* Return the generated form output.
* @param array $args List of parameter values passed through to the form depending on how the form has been configured.
* This array always contains a value for language.
* @param object $node The Drupal node object.
* @param array $response When this form is reloading after saving a submission, contains the response from the service call.
* Note this does not apply when redirecting (in this case the details of the saved object are in the $_GET data).
* @return Form HTML.
*/
public static function get_form($args, $node, $response = null)
{
if (!hostsite_get_user_field('indicia_user_id')) {
return 'Please ensure that you\'ve filled in your surname on your user profile before creating or editing groups.';
}
self::createBreadcrumb($args);
iform_load_helpers(array('report_helper', 'map_helper'));
$args = array_merge(array('include_code' => false, 'include_dates' => false, 'include_logo_controls' => true, 'include_sensitivity_controls' => true, 'include_report_filter' => true, 'include_linked_pages' => true, 'include_private_records' => false, 'include_administrators' => false, 'include_members' => false, 'filter_types' => '{"":"what,where,when","Advanced":"source,quality"}', 'indexed_location_type_ids' => '', 'other_location_type_ids' => '', 'data_inclusion_mode' => 'choose'), $args);
$args['filter_types'] = json_decode($args['filter_types'], true);
$reloadPath = self::getReloadPath();
data_entry_helper::$website_id = $args['website_id'];
$auth = data_entry_helper::get_read_write_auth($args['website_id'], $args['password']);
if (!empty($_GET['group_id'])) {
self::loadExistingGroup($_GET['group_id'], $auth, $args);
}
// maintain compatibility with form settings from before group type became multiselect.
if (empty($args['group_type'])) {
$args['group_type'] = array();
} elseif (!is_array($args['group_type'])) {
$args['group_type'] = array($args['group_type']);
}
if (count($args['group_type']) === 1) {
$response = data_entry_helper::get_population_data(array('table' => 'termlists_term', 'extraParams' => $auth['read'] + array('id' => $args['group_type'][0])));
self::$groupType = strtolower($response[0]['term']);
}
self::$groupType = lang::get(self::$groupType);
$r = "<form method=\"post\" id=\"entry_form\" action=\"{$reloadPath}\" enctype=\"multipart/form-data\">\n";
$r .= '<fieldset><legend>' . lang::get('Fill in details of your {1} below', self::$groupType) . '</legend>';
$r .= $auth['write'] . "<input type=\"hidden\" id=\"website_id\" name=\"website_id\" value=\"" . $args['website_id'] . "\" />\n";
$r .= data_entry_helper::hidden_text(array('fieldname' => 'group:id'));
// if a fixed choice of group type, can use a hidden input to put the value in the form.
if (count($args['group_type']) === 1) {
$r .= '<input type="hidden" name="group:group_type_id" value="' . $args['group_type'][0] . '"/>';
}
if (!empty(data_entry_helper::$entity_to_load['group:title'])) {
hostsite_set_page_title(lang::get('Edit {1}', data_entry_helper::$entity_to_load['group:title']));
}
$r .= data_entry_helper::text_input(array('label' => lang::get('{1} name', ucfirst(self::$groupType)), 'fieldname' => 'group:title', 'validation' => array('required'), 'class' => 'control-width-6', 'helpText' => lang::get('Provide the full title of the {1}', self::$groupType)));
if ($args['include_code']) {
$r .= data_entry_helper::text_input(array('label' => lang::get('Code'), 'fieldname' => 'group:code', 'class' => 'control-width-4', 'helpText' => lang::get('Provide a code or abbreviation identifying the {1}', self::$groupType)));
}
$r .= data_entry_helper::textarea(array('label' => ucfirst(lang::get('{1} description', self::$groupType)), 'fieldname' => 'group:description', 'helpText' => lang::get('LANG_Description_Field_Instruct', self::$groupType), 'class' => 'control-width-6'));
// If adding a new group which should have a parent group of some type or other, but no parent
// group is specified in the from_group_id parameter, then let the user pick a group to link as the parent.
if (empty($_GET['group_id']) && !empty($args['parent_group_type']) && !empty($args['parent_group_relationship_type']) && empty($_REQUEST['from_group_id'])) {
// There should be a parent group, but none provided, so allow the user to pick one.
$r .= data_entry_helper::select(array('label' => ucfirst(lang::get('{1} parent', self::$groupType)), 'fieldname' => 'from_group_id', 'table' => 'groups_user', 'captionField' => 'title', 'valueFields' => 'group_id', 'extraParams' => $auth['read'] + array('group_type_id' => $args['parent_group_type'], 'user_id' => hostsite_get_user_field('indicia_user_id'), 'view' => 'detail'), 'validation' => array('required'), 'blankText' => lang::get('<please select>')));
}
if (count($args['group_type']) !== 1) {
$params = array('termlist_external_key' => 'indicia:group_types', 'orderby' => 'sortorder,term');
if (!empty($args['group_type'])) {
$params['query'] = json_encode(array('in' => array('id' => array_values($args['group_type']))));
}
$r .= data_entry_helper::select(array('label' => ucfirst(lang::get('{1} type', self::$groupType)), 'fieldname' => 'group:group_type_id', 'validation' => array('required'), 'table' => 'termlists_term', 'valueField' => 'id', 'captionField' => 'term', 'extraParams' => $auth['read'] + $params, 'class' => 'control-width-4', 'blankText' => lang::get('<please select>'), 'helpText' => lang::get('What sort of {1} is it?', self::$groupType)));
}
$r .= self::groupLogoControl($args);
$r .= self::joinMethodsControl($args);
if ($args['include_sensitivity_controls']) {
$r .= data_entry_helper::checkbox(array('label' => lang::get('Show records at full precision'), 'fieldname' => 'group:view_full_precision', 'helpText' => lang::get('Any sensitive records added to the system are normally shown blurred to a lower grid reference precision. If this box ' . 'is checked, then group members can see sensitive records explicitly posted for the {1} at full precision.', self::$groupType)));
}
$r .= self::dateControls($args);
if ($args['include_private_records']) {
$r .= data_entry_helper::checkbox(array('label' => lang::get('Records are private'), 'fieldname' => 'group:private_records', 'helpText' => lang::get('Tick this box if you want to withold the release of the records from this {1} until a ' . 'later point in time, e.g. when a project is completed.', self::$groupType)));
// If an existing group with private records, then we might need to display a message warning the user about releasing the records.
// Initially hidden, we use JS to display it when appropriate.
if (!empty(data_entry_helper::$entity_to_load['group:id']) && data_entry_helper::$entity_to_load['group:private_records'] === 't') {
$r .= '<p class="warning" style="display: none" id="release-warning">' . lang::get('You are about to release the records belonging to this group. Do not proceed unless you intend to do this!') . '</p>';
}
}
$r .= self::memberControls($args, $auth);
$r .= '</fieldset>';
$r .= self::reportFilterBlock($args, $auth, $hiddenPopupDivs);
$r .= self::inclusionMethodControl($args);
$r .= self::formsBlock($args, $auth, $node);
// auto-insert the creator as an admin of the new group, unless the admins are manually specified
if (!$args['include_administrators'] && empty($_GET['group_id'])) {
$r .= '<input type="hidden" name="groups_user:admin_user_id[]" value="' . hostsite_get_user_field('indicia_user_id') . '"/>';
}
$r .= '<input type="hidden" name="groups_user:administrator" value="t"/>';
$r .= '<input type="submit" class="indicia-button" id="save-button" value="' . (empty(data_entry_helper::$entity_to_load['group:id']) ? lang::get('Create {1}', self::$groupType) : lang::get('Update {1} settings', self::$groupType)) . "\" />\n";
$r .= '</form>';
$r .= $hiddenPopupDivs;
data_entry_helper::enable_validation('entry_form');
// JavaScript to grab the filter definition and store in the form for posting when the form is submitted
data_entry_helper::$javascript .= "\r\n\$('#entry_form').submit(function() {\r\n \$('#filter-title-val').val('" . lang::get('Filter for user group') . " ' + \$('#group\\\\:title').val() + ' ' + new Date().getTime());\r\n \$('#filter-def-val').val(JSON.stringify(indiciaData.filter.def));\r\n});\n";
// for existing groups, prevent removal of yourself as a member. Someone else will have to do this for you so we don't orphan groups.
if (!empty(data_entry_helper::$entity_to_load['group:id'])) {
data_entry_helper::$javascript .= "\$('#groups_user\\\\:admin_user_id\\\\:sublist input[value=" . hostsite_get_user_field('indicia_user_id') . "]').closest('li').children('span').remove();\n";
}
return $r;
}
示例9:
?>
<fieldset>
<input type="hidden" name="occurrence_comment:id" value="<?php
echo $id;
?>
" />
<input type="hidden" name="occurrence_comment:occurrence_id" value="<?php
echo html::initial_value($values, 'occurrence_comment:occurrence_id');
?>
" />
<legend>Occurrence Comment</legend>
<?php
if (html::initial_value($values, 'occurrence_comment:auto_generated') === 't') {
?>
<p>This comment was generated by the auto verification rule
<?php
echo html::initial_value($values, 'occurrence_comment:generated_by');
?>
.</p>
<?php
}
echo data_entry_helper::textarea(array('label' => 'Comment', 'fieldname' => 'occurrence_comment:comment', 'default' => html::initial_value($values, 'occurrence_comment:comment')));
if (html::initial_value($values, 'occurrence_comment:auto_generated') === 'f') {
echo data_entry_helper::checkbox(array('label' => 'Query', 'fieldname' => 'occurrence_comment:query', 'helpText' => 'Does this comment represent a query about the record?', 'default' => html::initial_value($values, 'occurrence_comment:query')));
}
?>
</fieldset>
<?php
echo html::form_buttons($id != null, false, false);
?>
</form>
示例10: get_form
/**
* Return the generated form output.
* @param array $args List of parameter values passed through to the form depending on how the form has been configured.
* This array always contains a value for language.
* @param object $node The Drupal node object.
* @param array $response When this form is reloading after saving a submission, contains the response from the service call.
* Note this does not apply when redirecting (in this case the details of the saved object are in the $_GET data).
* @return Form HTML.
*/
public static function get_form($args, $node, $response = null)
{
if (!hostsite_get_user_field('indicia_user_id')) {
return 'Please ensure that you\'ve filled in your surname on your user profile before creating or editing groups.';
}
iform_load_helpers(array('report_helper', 'map_helper'));
$args = array_merge(array('include_code' => false, 'include_dates' => false, 'include_report_filter' => true, 'include_private_records' => false, 'include_administrators' => false, 'include_members' => false, 'filter_types' => '{"":"what,where,when","Advanced":"source,quality"}'), $args);
$args['filter_types'] = json_decode($args['filter_types'], true);
$reloadPath = self::getReloadPath();
data_entry_helper::$website_id = $args['website_id'];
$auth = data_entry_helper::get_read_write_auth($args['website_id'], $args['password']);
if (!empty($_GET['group_id'])) {
self::loadExistingGroup($_GET['group_id'], $auth, $args);
} else {
if (!empty($args['parent_group_relationship_type']) && empty($_GET['from_group_id'])) {
return 'This form should be called with a from_group_id parameter to define the parent when creating a new group';
}
}
$r = "<form method=\"post\" id=\"entry_form\" action=\"{$reloadPath}\">\n";
$r .= $auth['write'] . "<input type=\"hidden\" id=\"website_id\" name=\"website_id\" value=\"" . $args['website_id'] . "\" />\n";
$r .= data_entry_helper::hidden_text(array('fieldname' => 'group:id'));
if (!empty($args['group_type'])) {
$r .= '<input type="hidden" name="group:group_type_id" value="' . $args['group_type'] . '"/>';
$response = data_entry_helper::get_population_data(array('table' => 'termlists_term', 'extraParams' => $auth['read'] + array('id' => $args['group_type'])));
self::$groupType = strtolower($response[0]['term']);
}
if (!empty(data_entry_helper::$entity_to_load['group:title']) && function_exists('drupal_set_title')) {
drupal_set_title(lang::get('Edit {1}', data_entry_helper::$entity_to_load['group:title']));
}
$r .= data_entry_helper::text_input(array('label' => lang::get('{1} name', ucfirst(self::$groupType)), 'fieldname' => 'group:title', 'validation' => array('required'), 'class' => 'control-width-5', 'helpText' => lang::get('The full title of the {1}', self::$groupType)));
if ($args['include_code']) {
$r .= data_entry_helper::text_input(array('label' => lang::get('Code'), 'fieldname' => 'group:code', 'class' => 'control-width-4', 'helpText' => lang::get('A code or abbreviation identifying the {1}', self::$groupType)));
}
if (empty($args['group_type'])) {
$r .= data_entry_helper::select(array('label' => lang::get('Group type'), 'fieldname' => 'group:group_type_id', 'required' => true, 'table' => 'termlists_term', 'valueField' => 'id', 'captionField' => 'term', 'extraParams' => $auth['read'] + array('termlist_external_key' => 'indicia:group_types'), 'class' => 'control-width-4'));
}
$r .= self::joinMethodsControl($args);
$r .= data_entry_helper::textarea(array('label' => ucfirst(lang::get('{1} description', self::$groupType)), 'fieldname' => 'group:description', 'helpText' => lang::get('Description and notes about the {1}.', self::$groupType)));
$r .= self::dateControls($args);
if ($args['include_private_records']) {
$r .= data_entry_helper::checkbox(array('label' => lang::get('Records are private'), 'fieldname' => 'group:private_records', 'helpText' => lang::get('Tick this box if you want to withold the release of the records from this {1} until a ' . 'later point in time, e.g. when a project is completed.', self::$groupType)));
}
$r .= self::memberControls($args, $auth);
$r .= self::reportFilterBlock($args, $auth, $hiddenPopupDivs);
// auto-insert the creator as an admin of the new group, unless the admins are manually specified
if (!$args['include_administrators'] && empty($_GET['group_id'])) {
$r .= '<input type="hidden" name="groups_user:admin_user_id[]" value="' . hostsite_get_user_field('indicia_user_id') . '"/>';
}
$r .= '<input type="hidden" name="groups_user:administrator" value="t"/>';
$r .= '<input type="submit" class="indicia-button" id="save-button" value="' . (empty(data_entry_helper::$entity_to_load['group:id']) ? lang::get('Create {1}', self::$groupType) : lang::get('Update {1} settings', self::$groupType)) . "\" />\n";
$r .= '</form>';
$r .= $hiddenPopupDivs;
data_entry_helper::enable_validation('entry_form');
// JavaScript to grab the filter definition and store in the form for posting when the form is submitted
data_entry_helper::$javascript .= "\n\$('#entry_form').submit(function() {\n \$('#filter-title-val').val('" . lang::get('Filter for user group') . " ' + \$('#group\\\\:title').val());\n \$('#filter-def-val').val(JSON.stringify(indiciaData.filter.def));\n});\n";
return $r;
}
示例11:
?>
" method="post">
<?php
echo $metadata;
?>
<fieldset>
<input type="hidden" name="trigger:id" value="<?php
echo html::initial_value($values, 'trigger:id');
?>
" />
<legend>Trigger details</legend>
<?php
echo data_entry_helper::text_input(array('label' => 'Name', 'fieldname' => 'trigger:name', 'default' => html::initial_value($values, 'trigger:name'), 'class' => 'control-width-5'));
echo data_entry_helper::textarea(array('label' => 'Description', 'fieldname' => 'trigger:description', 'default' => html::initial_value($values, 'trigger:description')));
echo data_entry_helper::select(array('label' => 'Trigger template', 'fieldname' => 'trigger:trigger_template_file', 'default' => html::initial_value($values, 'trigger:trigger_template_file'), 'lookupValues' => $other_data['triggerFileList']));
echo data_entry_helper::checkbox(array('label' => 'Public', 'fieldname' => 'trigger:public', 'default' => html::initial_value($values, 'trigger:public')));
data_entry_helper::link_default_stylesheet();
// No need to re-link to jQuery
data_entry_helper::$dumped_resources[] = 'jquery';
data_entry_helper::$dumped_resources[] = 'jquery_ui';
data_entry_helper::$dumped_resources[] = 'fancybox';
echo data_entry_helper::dump_javascript();
?>
</fieldset>
<fieldset class="button-set">
<input type="submit" name="submit" value="<?php
echo kohana::lang('misc.next');
?>
" class="ui-corner-all ui-state-default button ui-priority-primary" />
<input type="submit" name="submit" value="<?php
echo kohana::lang('misc.cancel');
示例12:
?>
</div><div id="div-provide_for_verification"><?php
echo data_entry_helper::checkbox(array('label' => 'Provides data for verification', 'helpText' => 'Check this box if the website provides its data to other agreement participants for verification.', 'fieldname' => 'websites_website_agreement:provide_for_verification', 'default' => html::initial_value($values, 'websites_website_agreement:provide_for_verification'), 'labelClass' => 'control-width-4'));
?>
</div><div id="div-receive_for_verification"><?php
echo data_entry_helper::checkbox(array('label' => 'Receives data for verification', 'helpText' => 'Check this box if the website receives data from other agreement participants for verification.', 'fieldname' => 'websites_website_agreement:receive_for_verification', 'default' => html::initial_value($values, 'websites_website_agreement:receive_for_verification'), 'labelClass' => 'control-width-4'));
?>
</div><div id="div-provide_for_data_flow"><?php
echo data_entry_helper::checkbox(array('label' => 'Provides data for data flow', 'helpText' => 'Check this box if the website provides its data to other agreement participants for data flow, e.g. for passing data onto national information portals.', 'fieldname' => 'websites_website_agreement:provide_for_data_flow', 'default' => html::initial_value($values, 'websites_website_agreement:provide_for_data_flow'), 'labelClass' => 'control-width-4'));
?>
</div><div id="div-receive_for_data_flow"><?php
echo data_entry_helper::checkbox(array('label' => 'Receives data for data flow', 'helpText' => 'Check this box if the website receives data from other agreement participants for data flow, e.g. for passing data onto national information portals.', 'fieldname' => 'websites_website_agreement:receive_for_data_flow', 'default' => html::initial_value($values, 'websites_website_agreement:receive_for_data_flow'), 'labelClass' => 'control-width-4'));
?>
</div><div id="div-provide_for_moderation"><?php
echo data_entry_helper::checkbox(array('label' => 'Provides data for moderation', 'helpText' => 'Check this box if the website provides its data to other agreement participants for moderation, e.g. to check images before publishing.', 'fieldname' => 'websites_website_agreement:provide_for_moderation', 'default' => html::initial_value($values, 'websites_website_agreement:provide_for_moderation'), 'labelClass' => 'control-width-4'));
?>
</div><div id="div-receive_for_moderation"><?php
echo data_entry_helper::checkbox(array('label' => 'Receives data for moderation', 'helpText' => 'Check this box if the website receives data from other agreement participants for moderation, e.g. to check images before publishing.', 'fieldname' => 'websites_website_agreement:receive_for_moderation', 'default' => html::initial_value($values, 'websites_website_agreement:receive_for_moderation'), 'labelClass' => 'control-width-4'));
?>
</div>
</fieldset>
<?php
echo html::form_buttons($id != null, false, false);
data_entry_helper::$dumped_resources[] = 'jquery';
data_entry_helper::$dumped_resources[] = 'jquery_ui';
data_entry_helper::$dumped_resources[] = 'fancybox';
data_entry_helper::enable_validation('websites-website-agreement-edit');
data_entry_helper::link_default_stylesheet();
echo data_entry_helper::dump_javascript();
?>
</form>
示例13: get_controls
/**
* Define the HTML required for this filter's UI panel.
*/
public function get_controls($readAuth)
{
$r = '<div class="context-instruct messages warning">' . lang::get('Please note, your options for quality filtering are restricted by your access permissions in this context.') . '</div>';
$r .= data_entry_helper::select(array('label' => lang::get('Samples to include'), 'fieldname' => 'quality', 'id' => 'quality-filter', 'lookupValues' => array('V' => lang::get('Accepted records only'), 'P' => lang::get('Not reviewed'), '!R' => lang::get('Exclude not accepted records'), '!D' => lang::get('Exclude queried or not accepted records'), 'all' => lang::get('All records'), 'R' => lang::get('Not accepted records only'))));
$r .= data_entry_helper::select(array('label' => 'Automated checks', 'fieldname' => 'autochecks', 'lookupValues' => array('' => lang::get('Not filtered'), 'P' => lang::get('Only include records that pass all automated checks'), 'F' => lang::get('Only include records that fail at least one automated check'))));
$r .= data_entry_helper::checkbox(array('label' => lang::get('Only include records which have photos available'), 'fieldname' => 'has_photos'));
return $r;
}
示例14: get_controls
/**
* Define the HTML required for this filter's UI panel.
*/
public function get_controls($readAuth)
{
$r = '<div class="context-instruct messages warning">' . lang::get('Please note, your options for quality filtering are restricted by your access permissions in this context.') . '</div>';
$r .= data_entry_helper::select(array('label' => lang::get('Records to include'), 'fieldname' => 'quality', 'id' => 'quality-filter', 'lookupValues' => array('V' => lang::get('Verified records only'), 'C' => lang::get('Recorder was certain'), 'L' => lang::get('Recorder thought the record was at least likely'), 'P' => lang::get('Pending verification'), 'T' => lang::get('Pending verification for trusted records'), '!R' => lang::get('Exclude rejected'), '!D' => lang::get('Exclude dubious or rejected'), 'all' => lang::get('All records'), 'D' => lang::get('Queried records only'), 'R' => lang::get('Rejected records only'), 'DR' => lang::get('Queried or rejected records'))));
$r .= data_entry_helper::select(array('label' => 'Automated checks', 'fieldname' => 'autochecks', 'lookupValues' => array('' => lang::get('Not filtered'), 'P' => lang::get('Only include records that pass all automated checks'), 'F' => lang::get('Only include records that fail at least one automated check'))));
$r .= data_entry_helper::checkbox(array('label' => lang::get('Only include records which have photos available'), 'fieldname' => 'has_photos'));
return $r;
}
示例15: get_form
/**
* Return the generated form output.
* @return Form HTML.
*/
public static function get_form($args)
{
global $user;
$logged_in = $user->uid > 0;
$r = "\n<form method=\"post\" id=\"entry_form\">\n";
// Get authorisation tokens to update and read from the Warehouse.
$auth = data_entry_helper::get_read_write_auth($args['website_id'], $args['password']);
$readAuth = $auth['read'];
// request automatic JS validation
data_entry_helper::enable_validation('entry_form');
$r .= "<div id=\"controls\">\n";
if ($args['interface'] != 'one_page') {
$r .= "<ul>\n";
if (!$logged_in) {
$r .= ' <li><a href="#about_you"><span>' . lang::get('about you') . "</span></a></li>\n";
}
$r .= ' <li><a href="#species"><span>' . lang::get('what did you see') . "</span></a></li>\n";
$r .= ' <li><a href="#place"><span>' . lang::get('where was it') . "</span></a></li>\n";
$r .= ' <li><a href="#other"><span>' . lang::get('other information') . "</span></a></li>\n";
$r .= "</ul>\n";
data_entry_helper::enable_tabs(array('divId' => 'controls', 'style' => $args['interface']));
}
if ($user->uid == 0) {
$r .= "<div id=\"about_you\">\n";
$r .= '<p class="page-notice ui-state-highlight ui-corner-all">' . lang::get('about you tab instructions') . "</p>";
$r .= data_entry_helper::text_input(array('label' => lang::get('first name'), 'fieldname' => 'smpAttr:' . $args['first_name_attr_id'], 'class' => 'control-width-4'));
$r .= data_entry_helper::text_input(array('label' => lang::get('surname'), 'fieldname' => 'smpAttr:' . $args['surname_attr_id'], 'class' => 'control-width-4'));
$r .= data_entry_helper::text_input(array('label' => lang::get('email'), 'fieldname' => 'smpAttr:' . $args['email_attr_id'], 'class' => 'control-width-4'));
$r .= data_entry_helper::text_input(array('label' => lang::get('phone number'), 'fieldname' => 'smpAttr:' . $args['phone_attr_id'], 'class' => 'control-width-4'));
if ($args['interface'] == 'wizard') {
$r .= data_entry_helper::wizard_buttons(array('divId' => 'controls', 'page' => 'first'));
}
$r .= "</div>\n";
}
$r .= "<div id=\"species\">\n";
// Output all our hidden data here
$r .= $auth['write'];
if ($logged_in) {
// If logged in, output some hidden data about the user
$r .= iform_user_get_hidden_inputs($args);
}
$r .= "<input type=\"hidden\" id=\"website_id\" name=\"website_id\" value=\"" . $args['website_id'] . "\" />\n";
$r .= "<input type=\"hidden\" id=\"survey_id\" name=\"survey_id\" value=\"" . $args['survey_id'] . "\" />\n";
$r .= "<input type=\"hidden\" id=\"record_status\" name=\"record_status\" value=\"C\" />\n";
$r .= '<p class="page-notice ui-state-highlight ui-corner-all">' . lang::get('species tab instructions') . "</p>";
$extraParams = $readAuth + array('taxon_list_id' => $args['list_id']);
if ($args['preferred']) {
$extraParams += array('preferred' => 't');
}
if ($args['restrict_species_to_users_lang']) {
$extraParams += array('language_iso' => iform_lang_iso_639_2($user->lang));
}
$species_list_args = array('label' => lang::get('occurrence:taxa_taxon_list_id'), 'fieldname' => 'occurrence:taxa_taxon_list_id', 'table' => 'taxa_taxon_list', 'captionField' => 'taxon', 'valueField' => 'id', 'columns' => 2, 'view' => 'detail', 'parentField' => 'parent_id', 'extraParams' => $extraParams);
if ($args['species_ctrl'] == 'tree_browser') {
// change the node template to include images
global $indicia_templates;
$indicia_templates['tree_browser_node'] = '<div>' . '<img src="' . data_entry_helper::$base_url . '/upload/thumb-{image_path}" alt="Image of {caption}" width="80" /></div>' . '<span>{caption}</span>';
}
// Dynamically generate the species selection control required.
$r .= call_user_func(array('data_entry_helper', $args['species_ctrl']), $species_list_args);
if ($args['interface'] == 'wizard') {
$r .= data_entry_helper::wizard_buttons(array('divId' => 'controls', 'page' => $user->id == 0 ? 'first' : 'middle'));
}
$r .= "</div>\n";
$r .= "<div id=\"place\">\n";
$r .= '<p class="page-notice ui-state-highlight ui-corner-all">' . lang::get('place tab instructions') . "</p>";
// Build the array of spatial reference systems into a format Indicia can use.
$systems = array();
$list = explode(',', str_replace(' ', '', $args['spatial_systems']));
foreach ($list as $system) {
$systems[$system] = lang::get($system);
}
$r .= data_entry_helper::sref_and_system(array('label' => lang::get('sample:entered_sref'), 'systems' => $systems));
$r .= data_entry_helper::georeference_lookup(array('label' => lang::get('search for place on map'), 'georefPreferredArea' => $args['georefPreferredArea'], 'georefCountry' => $args['georefCountry'], 'georefLang' => $args['language']));
// retrieve options for the IndiciaMapPanel, and optionally options for OpenLayers.
$options = iform_map_get_map_options($args, $readAuth);
$olOptions = iform_map_get_ol_options($args);
$r .= data_entry_helper::map_panel($options, $olOptions);
if ($args['interface'] == 'wizard') {
$r .= data_entry_helper::wizard_buttons(array('divId' => 'controls'));
}
$r .= "</div>\n";
$r .= "<div id=\"other\">\n";
$r .= '<p class="page-notice ui-state-highlight ui-corner-all">' . lang::get('other tab instructions') . "</p>";
$r .= data_entry_helper::date_picker(array('label' => lang::get('Date'), 'fieldname' => 'sample:date'));
$r .= data_entry_helper::file_box(array('caption' => 'Upload your photos', 'resizeWidth' => 1024, 'resizeHeight' => 768, 'table' => 'occurrence_image'));
// Dynamically create a control for the abundance
$abundance_args = array('label' => lang::get('abundance'), 'fieldname' => 'occAttr:' + $args['abundance_attr_id'], 'table' => 'termlists_term', 'captionField' => 'term', 'valueField' => 'id', 'extraParams' => $readAuth + array('termlist_id' => $args['abundance_termlist_id']), 'size' => 6, 'sep' => '<br/>');
$r .= call_user_func(array('data_entry_helper', $args['abundance_ctrl']), $abundance_args);
$r .= data_entry_helper::textarea(array('label' => lang::get('sample:comment'), 'fieldname' => 'sample:comment', 'class' => 'wide'));
$r .= '<div class="footer">' . data_entry_helper::checkbox(array('label' => lang::get('happy for contact'), 'labelClass' => 'auto', 'fieldname' => 'smpAttr:' . $args['contact_attr_id'])) . '</div>';
if ($args['interface'] == 'wizard') {
$r .= data_entry_helper::wizard_buttons(array('divId' => 'controls', 'page' => 'last'));
} else {
$r .= "<input type=\"submit\" class=\"ui-state-default ui-corner-all\" value=\"Save\" />\n";
}
//.........这里部分代码省略.........