<commit_before><?php use_helper('Javascript') ?>

<h2>
<?php if ($form->isNew()) : ?>
<?php echo __('Create new entry') ?>
<?php else : ?>
<?php echo __('Edit entry') ?>
<?php endif; ?>
</h2>

<?php if ($form->isNew()) : ?>
<div style="margin-bottom: 1em;">
<select id="original_preset">
  <option name="presetting"<?php if ($isPreset) : ?> selected="selected"<?php endif; ?>><?php echo __('Select from presets')?></option>
  <option name="original"<?php if (!$isPreset) : ?> selected="selected"<?php endif; ?>><?php echo __('Enter on your own')?></option>
</select>
</div>
<?php endif; ?>

<div id="preset"<?php if (!$isPreset): ?> style="display: none;"<?php endif ?>>
<?php if ($presetForm->isNew()): ?>
<?php if (0 < count($presetForm->getWidget('preset')->getChoices())): ?>
<form action="<?php echo url_for('profile/edit?type=preset') ?>" method="post">
<table style="width: 50%;">
<?php echo $presetForm ?>
</table>
<input type="submit" value="<?php echo  __('Add') ?>" />
</form>
<?php else: ?>
<?php echo __('There is no preset profile.') ?>
<?php endif; ?>
<?php else: ?>
<form action="<?php echo url_for('profile/edit?type=preset&id='.$profile->getId()) ?>" method="post">
<table style="width: 50%;">
<?php echo $presetForm ?><commit_msg>(fixes #2464) add preset profile name to editing page<commit_after><?php use_helper('Javascript') ?>

<h2>
<?php if ($form->isNew()) : ?>
<?php echo __('Create new entry') ?>
<?php else : ?>
<?php echo __('Edit entry') ?>
<?php endif; ?>
</h2>

<?php if ($form->isNew()) : ?>
<div style="margin-bottom: 1em;">
<select id="original_preset">
  <option name="presetting"<?php if ($isPreset) : ?> selected="selected"<?php endif; ?>><?php echo __('Select from presets')?></option>
  <option name="original"<?php if (!$isPreset) : ?> selected="selected"<?php endif; ?>><?php echo __('Enter on your own')?></option>
</select>
</div>
<?php endif; ?>

<div id="preset"<?php if (!$isPreset): ?> style="display: none;"<?php endif ?>>
<?php if ($presetForm->isNew()): ?>
<?php if (0 < count($presetForm->getWidget('preset')->getChoices())): ?>
<form action="<?php echo url_for('profile/edit?type=preset') ?>" method="post">
<table style="width: 50%;">
<?php echo $presetForm ?>
</table>
<input type="submit" value="<?php echo  __('Add') ?>" />
</form>
<?php else: ?>
<?php echo __('There is no preset profile.') ?>
<?php endif; ?>
<?php else: ?>
<h3><?
$presetList = opToolkit::getPresetProfileList();
foreach ($presetList as $k => $v)
{
  if ('op_preset_'.$v['Name'] === $profile['name'])
  {
    echo __($v['Caption']);
    break;
  }
}
?></h3>
<form action="<?php echo url_for('profile/edit?type=preset&id='.$profile->getId()) ?>" method="post">
<table style="width: 50%;">
<?php echo $presetForm ?>
{'fraction_non_alphanumeric': 0.2617743702081051, 'fraction_numerical': 0.008032128514056224, 'mean_word_length': 6.191601049868766, 'pattern_counts': {'":': 0, '<': 98, '<?xml version=': 0, '>': 109, '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': '7056444', 'n_tokens_mistral': 990, 'n_tokens_neox': 977, 'n_words': 245}