<commit_before><?php
namespace Jazzee\Page;

/**
 * Branch a child page depending on an applicant input
 *
 * @author  <NAME>  <<EMAIL>>
 * @license http://jazzee.org/license BSD-3-Clause
 */
class Branching extends Standard
{

  /**
   *
   * Enter description here ...
   */
  protected function makeForm()
  {
    $form = new \Foundation\Form;
    $form->setAction($this->_controller->getActionPath());
    $field = $form->newField();
    $field->setLegend($this->_applicationPage->getTitle());
    $field->setInstructions($this->_applicationPage->getInstructions());

    $element = $field->newElement('SelectList', 'branching');
    $element->setLabel($this->_applicationPage->getPage()->getVar('branchingElementLabel'));
    $element->addValidator(new \Foundation\Form\Validator\NotEmpty($element));

    foreach ($this->_applicationPage->getPage()->getChildren() as $child) {
      $element->newItem($child->getId(), $child->getTitle());
    }
    $form->newHiddenElement('level', 1);
    $form->newButton('submit', 'Next');

    return $form;
  }

  /**
   * Branching Page Form
   * Replaces the form with the correct branch
   * @param \Jazzee\Entity\Page $page
   */
  protected function branchingForm(\Jazzee\Entity\Page $page)
  {
    $form = new \Foundation\Form;
    $form->setAction($this->_controller->getActionPath());
    $field = $form->newField();
    $field->setLegend($this->_applicationPage->getTitle());
    $field->setInstructions($this->_applicationPage->getInstructions());

    foreach ($page->getElements() as $element) {
      $element->getJazzeeElement()->setController($this->_controller);
      $element->getJazzeeElement()->addToField($field);
    }
    $form->newHiddenElement('level', 2);
    $form->newHiddenElement('branching', $page->getId());
    $form->newButton('submit', 'Save');
    $this->_form = $form;
  }

  public function validateInput($input)
  {
    $page = $this->_applicationPage->getPage()->getChildById($input['branching']);
    $this->branchingForm($page);
    if ($input['level'] == 1) {<commit_msg>Display instructions on branching page children. Fixes #188<commit_after><?php
namespace Jazzee\Page;

/**
 * Branch a child page depending on an applicant input
 *
 * @author  <NAME>  <<EMAIL>>
 * @license http://jazzee.org/license BSD-3-Clause
 */
class Branching extends Standard
{

  /**
   *
   * Enter description here ...
   */
  protected function makeForm()
  {
    $form = new \Foundation\Form;
    $form->setAction($this->_controller->getActionPath());
    $field = $form->newField();
    $field->setLegend($this->_applicationPage->getTitle());
    $field->setInstructions($this->_applicationPage->getInstructions());

    $element = $field->newElement('SelectList', 'branching');
    $element->setLabel($this->_applicationPage->getPage()->getVar('branchingElementLabel'));
    $element->addValidator(new \Foundation\Form\Validator\NotEmpty($element));

    foreach ($this->_applicationPage->getPage()->getChildren() as $child) {
      $element->newItem($child->getId(), $child->getTitle());
    }
    $form->newHiddenElement('level', 1);
    $form->newButton('submit', 'Next');

    return $form;
  }

  /**
   * Branching Page Form
   * Replaces the form with the correct branch
   * @param \Jazzee\Entity\Page $page
   */
  protected function branchingForm(\Jazzee\Entity\Page $page)
  {
    $form = new \Foundation\Form;
    $form->setAction($this->_controller->getActionPath());
    $field = $form->newField();
    $field->setLegend($this->_applicationPage->getTitle());
    $field->setInstructions($page->getInstructions());

    foreach ($page->getElements() as $element) {
      $element->getJazzeeElement()->setController($this->_controller);
      $element->getJazzeeElement()->addToField($field);
    }
    $form->newHiddenElement('level', 2);
    $form->newHiddenElement('branching', $page->getId());
    $form->newButton('submit', 'Save');
    $this->_form = $form;
  }

  public function validateInput($input)
  {
    $page = $this->_applicationPage->getPage()->getChildById($input['branching']);
    $this->branchingForm($page);
    if ($input['level'] == 1) {
{'fraction_non_alphanumeric': 0.1858108108108108, 'fraction_numerical': 0.0026544401544401543, 'mean_word_length': 4.168329177057356, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 106, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4985643', 'n_tokens_mistral': 1269, 'n_tokens_neox': 1233, 'n_words': 211}