<?php

$instructions = !empty($variables['data']['instructions']) ? theme('olctex_container', array('data' => _olctex_theme_multiple('olctex_instruction', $variables['data']['instructions']))) : '';
$node = $variables['data']['node'];
$morpheme = !empty($node->field_morpheme) ? _olctex_html2tex($node->field_morpheme['und'][0]['value']) : '';
$example_word = !empty($node->field_word) ? _olctex_html2tex($node->field_word['und'][0]['value']) : '';
$example_word_translation = !empty($node->field_translation) ? _olctex_html2tex($node->field_translation['und'][0]['value']) : '';
$description_in_language_studied = !empty($node->field_morpheme_desc_lang_studied) ? _olctex_html2tex($node->field_morpheme_desc_lang_studied['und'][0]['value']) : '';
$description = !empty($node->field_morpheme_description) ? _olctex_html2tex($node->field_morpheme_description['und'][0]['value']) : '';
?>
{\setlength{\parskip}{0pt}
<?php 
if (!empty($morpheme)) {
    echo $morpheme;
    ?>
 \\*

<?php 
}
$picture_file = isset($node->field_picture['und'][0]) ? $node->field_picture['und'][0] : array();
if (!empty($picture_file)) {
    echo theme('olctex_picture', array('data' => array('file' => $picture_file, 'style_name' => 'thumbnail')));
    ?>
 \\*
<?php 
}
if (!empty($example_word)) {
    echo implode(' : ', array($example_word, $example_word_translation));
    ?>
 \\*
<?php

// NOTE: Instructions UNAVAILABLE on a per-root-word basis
$root = $variables['data']['parent'];
$root_node = $root['node'];
$root_word = $root_node->field_word['und'][0]['value'];
$root_translation = $root_node->field_translation['und'][0]['value'];
$conjugations = $variables['data']['children'];
$conjugations_themed = theme('olctex_container', array('data' => _olctex_theme_multiple('olctex_bilingual_conjugation', $conjugations)));
?>

\subsubsection{<?php 
echo $root_word;
?>
 - <?php 
echo $root_translation;
?>
}

<?php 
foreach ($conjugations as $conjugation) {
    echo theme('olctex_bilingual_conjugation', array('data' => $conjugation));
}
// Conversation
if (isset($section_parts->conversation_turn)) {
    ?>
\subsection {Conversations}
<?php 
    echo theme('olctex_container', array('data' => _olctex_theme_multiple('olctex_bilingual_conversation_container', $section_parts->conversation_turn)));
}
?>



<?php 
// Narrative
if (isset($section_parts->narrative)) {
    ?>
\subsection{Narratives}
<?php 
    echo theme('olctex_container', array('data' => _olctex_theme_multiple('olctex_bilingual_narrative', $section_parts->narrative)));
}
?>



<?php 
// Article (Reading)
if (isset($section_parts->article)) {
    ?>
\subsection{Reading}
<?php 
    echo theme('olctex_container', array('data' => _olctex_theme_multiple('olctex_bilingual_article', $section_parts->article)));
}