<commit_before><? defined('C5_EXECUTE') or die("Access Denied."); ?>

<? if ($this->controller->getTask() == 'select_type'
    || $this->controller->getTask() == 'add'
    || $this->controller->getTask() == 'edit'
    || $this->controller->getTask() == 'update'
    || $this->controller->getTask() == 'delete') { ?>

    <?
    if (is_object($location)) {
        $fslName = $location->getName();
        $fslIsDefault = $location->isDefault();
        $method = 'update';

        if (!$fslIsDefault) { ?>

        <div class="ccm-dashboard-header-buttons">
            <form method="post" action="<?=$this->action('delete')?>">
                <input type="hidden" name="fslID" value="<?=$location->getID()?>" />
                <?=Loader::helper('validation/token')->output('delete');?>
                <button type="button" class="btn btn-danger" data-action="delete-location"><?=t('Delete Location')?></button>
            </form>
        </div>

        <?
        }

    } else {
        $method = 'add';
    }
    ?>
    <form method="post" action="<?=$view->action($method)?>" id="ccm-attribute-key-form">
        <?=Loader::helper('validation/token')->output($method);?>
        <input type="hidden" name="fslTypeID" value="<?=$type->getID()?>" />
        <? if (is_object($location)) { ?>
            <input type="hidden" name="fslID" value="<?=$location->getID()?>" />
        <? } ?>
        <fieldset>
            <legend><?=t('Basics')?></legend>
            <div class="form-group">
                <?=$form->label('fslName', t('Name'))?>
                <div class="input-group">
                    <?=$form->text('fslName', $fslName)?><commit_msg>Disable the deleting of the default type storage location<commit_after><? defined('C5_EXECUTE') or die("Access Denied."); ?>

<? if ($this->controller->getTask() == 'select_type'
    || $this->controller->getTask() == 'add'
    || $this->controller->getTask() == 'edit'
    || $this->controller->getTask() == 'update'
    || $this->controller->getTask() == 'delete') { ?>

    <?
    if (is_object($location)) {
        $fslName = $location->getName();
        $fslIsDefault = $location->isDefault();
        $method = 'update';

        if (!$fslIsDefault && $type->getHandle() != 'default') { ?>

        <div class="ccm-dashboard-header-buttons">
            <form method="post" action="<?=$this->action('delete')?>">
                <input type="hidden" name="fslID" value="<?=$location->getID()?>" />
                <?=Loader::helper('validation/token')->output('delete');?>
                <button type="button" class="btn btn-danger" data-action="delete-location"><?=t('Delete Location')?></button>
            </form>
        </div>

        <?
        }

    } else {
        $method = 'add';
    }
    ?>
    <form method="post" action="<?=$view->action($method)?>" id="ccm-attribute-key-form">
        <?=Loader::helper('validation/token')->output($method);?>
        <input type="hidden" name="fslTypeID" value="<?=$type->getID()?>" />
        <? if (is_object($location)) { ?>
            <input type="hidden" name="fslID" value="<?=$location->getID()?>" />
        <? } ?>
        <fieldset>
            <legend><?=t('Basics')?></legend>
            <div class="form-group">
                <?=$form->label('fslName', t('Name'))?>
                <div class="input-group">
                    <?=$form->text('fslName', $fslName)?>
{'fraction_non_alphanumeric': 0.23658751099384345, 'fraction_numerical': 0.0005863383172090296, 'mean_word_length': 2.5991561181434597, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 0, '>': 110, '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': '7319366', 'n_tokens_mistral': 1043, 'n_tokens_neox': 1035, 'n_words': 153}