aboutsummaryrefslogtreecommitdiff
path: root/apps/subfield.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/subfield.php')
-rw-r--r--apps/subfield.php26
1 files changed, 13 insertions, 13 deletions
diff --git a/apps/subfield.php b/apps/subfield.php
index a4c804a..4694d74 100644
--- a/apps/subfield.php
+++ b/apps/subfield.php
@@ -7,15 +7,15 @@
require_once '../index.php';
// Get input data.
-$entry = CinisisHttpHelper::get_numeric_arg('entry');
-$field = CinisisHttpHelper::get_numeric_arg('field');
-$subfield = CinisisHttpHelper::get_textual_arg('subfield');
+$entry = CinisisHttpHelper::get_numeric_arg('entry');
+$field_key = CinisisHttpHelper::get_numeric_arg('field_key');
+$subfield_key = CinisisHttpHelper::get_textual_arg('subfield_key');
// Draw the document.
$display = new CinisisDisplayHelper('Subfield finder');
$form = $display->form_input_text('entry', $entry);
-$form .= $display->form_input_text('field', $field);
-$form .= $display->form_input_text('subfield', $subfield);
+$form .= $display->form_input_text('field_key', $field_key);
+$form .= $display->form_input_text('subfield_key', $subfield_key);
$display->form($form, basename(__FILE__));
// Get a db instance.
@@ -24,21 +24,21 @@ $isis = new IsisFinder();
// Setup database and entry number.
if ($isis) {
// Query database.
- $field_name = $isis->getFieldName($field);
- $subfield_name = $isis->getSubfieldName($field, $subfield);
- list($entry, $result) = $isis->nextSubfield($entry, $field_name, $subfield_name);
+ $field = $isis->getFieldArray($field_key);
+ $subfield = $isis->getSubfieldName($field_key, $subfield_key);
+ list($entry, $result) = $isis->nextSubfield($entry, $field, $subfield);
// Navigation bar.
- $display->navbar($entry, $isis->entries, $repetition, '&field='. $field . '&subfield='. $subfield);
+ $display->navbar($entry, $isis->entries, $repetition, '&field_key='. $field_key . '&subfield_key='. $subfield_key);
// Format output.
echo "<pre>\n";
- echo "Selected field: $field: $field_name.\n";
- echo "Selected subfield: $subfield: $subfield_name.\n";
+ echo "Selected field: $field_key: ". $field['name'] .".\n";
+ echo "Selected subfield: $subfield_key: $subfield.\n";
echo "Showing entry ". $display->entry_link($entry) ." from $entries total entries.\n";
- echo "Repetitions found: ". count($result[$field]) .".\n";
+ echo "Repetitions found: ". count($result[$field['name']]) .".\n";
echo "\n";
- print_r($result[$field_name]);
+ print_r($result[$field['name']]);
echo '</pre>';
}