<commit_before><? 
$form = Loader::helper('form'); 
$ih = Loader::helper("concrete/interface");
$valt = Loader::helper('validation/token');
$akName = '';
$akIsSearchable = 0;
$asID = 0;

if (is_object($key)) {
	if (!isset($akHandle)) {
		$akHandle = $key->getAttributeKeyHandle();
	}
	$akName = $key->getAttributeKeyName();
	$akIsSearchable = $key->isAttributeKeySearchable();
	$akIsSearchableIndexed = $key->isAttributeKeyContentIndexed();
	$sets = $key->getAttributeSets();
	if (count($sets) == 1) {
		$asID = $sets[0]->getAttributeSetID();
	}
	print $form->hidden('akID', $key->getAttributeKeyID());
}
?>
<table class="entry-form" border="0" cellspacing="1" cellpadding="0">
<tr>
	<td class="subheader"><?=t('Handle')?> <span class="required">*</span></td>
	<td class="subheader"><?=t('Name')?> <span class="required">*</span></td>
	<? if ($category->allowAttributeSets() == AttributeKeyCategory::ASET_ALLOW_SINGLE) { ?>
		<td class="subheader"><?=t("Set")?></td>
	<? } ?>
	<td class="subheader"><?=t("Searchable")?></td>
</tr>	
<tr>
	<td style="padding-right: 15px"><?=$form->text('akHandle', $akHandle, array('style' => 'width: 100%'))?></td>
	<td style="padding-right: 15px"><?=$form->text('akName', $akName, array('style' => 'width: 100%'))?></td>
	<? if ($category->allowAttributeSets() == AttributeKeyCategory::ASET_ALLOW_SINGLE) { ?>
		<td style="padding-right: 10px">
		<?
		$sel = array('0' => t('** None'));
		$sets = $category->getAttributeSets();
		foreach($sets as $as) {
			$sel[$as->getAttributeSetID()] = $as->getAttributeSetName();
		}
		print $form->select('asID', $sel, $asID);
		?>
		</td>
	<? } ?>

	<td style="padding-right: 10px">
	<?=$form->checkbox('akIsSearchableIndexed', 1, $akIsSearchableIndexed)?> <?=t('Content included in "Keyword Search".');?><br/>
	<?=$form->checkbox('akIsSearchable', 1, $akIsSearchable)?> <?=t('Field available in "Advanced Search".');?>
	</td>
</tr>
</table>

<?=$form->hidden('atID', $type->getAttributeTypeID())?>
<?=$form->hidden('akCategoryID', $category->getAttributeKeyCategoryID()); ?>
<?=$valt->output('add_or_update_attribute')?>
<? 
if ($category->getPackageID() > 0) { 
	Loader::packageElement('attribute/categories/' . $category->getAttributeKeyCategoryHandle(), $category->getPackageHandle(), array('key' => $key));
} else {
	Loader::element('attribute/categories/' . $category->getAttributeKeyCategoryHandle(), array('key' => $key));
}
?>
<? $type->render('type_form', $key); ?>

<? if (is_object($key)) { ?>
	<?=$ih->submit(t('Update Attribute'), 'ccm-attribute-key-form')?>
<? } else { ?>
	<?=$ih->submit(t('Add Attribute'), 'ccm-attribute-key-form')?>
<? } ?>

<div class="ccm-spacer">&nbsp;</div><commit_msg>Change attribute "Searchable" checkbox labels so they make sense to normal human beings. Note that I'm not sure if the description for keyword user search is accurate (perhaps it's the "member search" or something?) -- further proof that the current labels are not informative enough, btw :)<commit_after><? 
$form = Loader::helper('form'); 
$ih = Loader::helper("concrete/interface");
$valt = Loader::helper('validation/token');
$akName = '';
$akIsSearchable = 0;
$asID = 0;

if (is_object($key)) {
	if (!isset($akHandle)) {
		$akHandle = $key->getAttributeKeyHandle();
	}
	$akName = $key->getAttributeKeyName();
	$akIsSearchable = $key->isAttributeKeySearchable();
	$akIsSearchableIndexed = $key->isAttributeKeyContentIndexed();
	$sets = $key->getAttributeSets();
	if (count($sets) == 1) {
		$asID = $sets[0]->getAttributeSetID();
	}
	print $form->hidden('akID', $key->getAttributeKeyID());
}
?>
<table class="entry-form" border="0" cellspacing="1" cellpadding="0">
<tr>
	<td class="subheader"><?=t('Handle')?> <span class="required">*</span></td>
	<td class="subheader"><?=t('Name')?> <span class="required">*</span></td>
	<? if ($category->allowAttributeSets() == AttributeKeyCategory::ASET_ALLOW_SINGLE) { ?>
		<td class="subheader"><?=t("Set")?></td>
	<? } ?>
	<td class="subheader"><?=t("Searchable")?></td>
</tr>	
<tr>
	<td style="padding-right: 15px"><?=$form->text('akHandle', $akHandle, array('style' => 'width: 100%'))?></td>
	<td style="padding-right: 15px"><?=$form->text('akName', $akName, array('style' => 'width: 100%'))?></td>
	<? if ($category->allowAttributeSets() == AttributeKeyCategory::ASET_ALLOW_SINGLE) { ?>
		<td style="padding-right: 10px">
		<?
		$sel = array('0' => t('** None'));
		$sets = $category->getAttributeSets();
		foreach($sets as $as) {
			$sel[$as->getAttributeSetID()] = $as->getAttributeSetName();
		}
		print $form->select('asID', $sel, $asID);
		?>
		</td>
	<? } ?>

	<td style="padding-right: 10px">
	<?php
	$category_handle = $category->getAttributeKeyCategoryHandle();
	$keyword_label = t('Content included in "Keyword Search".');
	$advanced_label = t('Field available in "Advanced Search".');
	switch ($category_handle) {
		case 'page':
			$keyword_label = t('Content included in sitewide search".');
			$advanced_label = t('Field available in Dashboard Page Search".');
			break;
		case 'file':
			$keyword_label = t('Content included in sitewide search".');
			$advanced_label = t('Field available in File Manager Search".');			
			break;
		case 'user':
			$keyword_label = t('Content included in sitewide search".');
			$advanced_label = t('Field available in Dashboard User Search".');
			break;
	}
	?>
	<?=$form->checkbox('akIsSearchableIndexed', 1, $akIsSearchableIndexed)?> <?=$keyword_label?><br/>
	<?=$form->checkbox('akIsSearchable', 1, $akIsSearchable)?> <?=$advanced_label?>
	</td>
</tr>
</table>

<?=$form->hidden('atID', $type->getAttributeTypeID())?>
<?=$form->hidden('akCategoryID', $category->getAttributeKeyCategoryID()); ?>
<?=$valt->output('add_or_update_attribute')?>
<? 
if ($category->getPackageID() > 0) { 
	Loader::packageElement('attribute/categories/' . $category->getAttributeKeyCategoryHandle(), $category->getPackageHandle(), array('key' => $key));
} else {
	Loader::element('attribute/categories/' . $category->getAttributeKeyCategoryHandle(), array('key' => $key));
}
?>
<? $type->render('type_form', $key); ?>

<? if (is_object($key)) { ?>
	<?=$ih->submit(t('Update Attribute'), 'ccm-attribute-key-form')?>
<? } else { ?>
	<?=$ih->submit(t('Add Attribute'), 'ccm-attribute-key-form')?>
<? } ?>

<div class="ccm-spacer">&nbsp;</div>
{'fraction_non_alphanumeric': 0.23979672860092108, 'fraction_numerical': 0.007940289026520565, 'mean_word_length': 6.348891481913652, 'pattern_counts': {'":': 0, '<': 114, '<?xml version=': 0, '>': 187, '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': '6435958', 'n_tokens_mistral': 2230, 'n_tokens_neox': 2179, 'n_words': 393}