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

$ih = Loader::helper('concrete/interface');
$cap = Loader::helper('concrete/dashboard');
$valt = Loader::helper('validation/token');
$form = Loader::helper('form');
$u = new User();

Loader::model('file_set');
$pageTypeIconsFS = FileSet::getByName("Page Type Icons");

if ($_POST['task'] == 'add') {
	$ctName = $_POST['ctName'];
	$ctHandle = $_POST['ctHandle'];
	
	$error = array();
	if (!$ctHandle) {
		$error[] = t("Handle required.");
	}
	if (!$ctName) {
		$error[] = t("Name required.");
	}
	
	if (!$valt->validate('add_page_type')) {
		$error[] = $valt->getErrorMessage();
	}
	
	$akIDArray = $_POST['akID'];
	if (!is_array($akIDArray)) {
		$akIDArray = array();
	}
	
	if (count($error) == 0) {
		try {
			if ($_POST['task'] == 'add') {
				$nCT = CollectionType::add($_POST);
				$this->controller->redirect('/dashboard/pages/types?created=1');
			}		
			exit;
		} catch(Exception $e1) {
			$error[] = $e1->getMessage();
		}
	}
}

?>
	
    <!-- START: Add Page Type pane -->
    
    <?=Loader::helper('concrete/dashboard')->getDashboardPaneHeaderWrapper(t('Adds Page Type').'<span class="label" style="position:relative;top:-3px;left:12px;">'.t('* required field').'</span>', false, false, false);?>
	
    <form method="post" id="add_page_type" action="<?=$this->url('/dashboard/pages/types/add')?>">
	<?=$valt->output('add_page_type')?>
    <?=$form->hidden('task', 'add'); ?>
	
    <div class="ccm-pane-body">
    
        <table border="0" cellspacing="0" cellpadding="0">
            <thead>
                <tr>
                    <th class="header"><?=t('Name')?> <span class="required">*</span></th>
                    <th class="header"><?=t('Handle')?> <span class="required">*</span></th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        <?=$form->text('ctName', $_POST['ctName'], array('class' => 'span9'))?>
                    </td>
                    <td>
                        <?=$form->text('ctHandle', $_POST['ctHandle'], array('class' => 'span6'))?>
                    </td><commit_msg>Fix small typo in Add Page Type header<commit_after><?
defined('C5_EXECUTE') or die("Access Denied.");

$ih = Loader::helper('concrete/interface');
$cap = Loader::helper('concrete/dashboard');
$valt = Loader::helper('validation/token');
$form = Loader::helper('form');
$u = new User();

Loader::model('file_set');
$pageTypeIconsFS = FileSet::getByName("Page Type Icons");

if ($_POST['task'] == 'add') {
	$ctName = $_POST['ctName'];
	$ctHandle = $_POST['ctHandle'];
	
	$error = array();
	if (!$ctHandle) {
		$error[] = t("Handle required.");
	}
	if (!$ctName) {
		$error[] = t("Name required.");
	}
	
	if (!$valt->validate('add_page_type')) {
		$error[] = $valt->getErrorMessage();
	}
	
	$akIDArray = $_POST['akID'];
	if (!is_array($akIDArray)) {
		$akIDArray = array();
	}
	
	if (count($error) == 0) {
		try {
			if ($_POST['task'] == 'add') {
				$nCT = CollectionType::add($_POST);
				$this->controller->redirect('/dashboard/pages/types?created=1');
			}		
			exit;
		} catch(Exception $e1) {
			$error[] = $e1->getMessage();
		}
	}
}

?>
	
    <!-- START: Add Page Type pane -->
    
    <?=Loader::helper('concrete/dashboard')->getDashboardPaneHeaderWrapper(t('Add Page Type').'<span class="label" style="position:relative;top:-3px;left:12px;">'.t('* required field').'</span>', false, false, false);?>
	
    <form method="post" id="add_page_type" action="<?=$this->url('/dashboard/pages/types/add')?>">
	<?=$valt->output('add_page_type')?>
    <?=$form->hidden('task', 'add'); ?>
	
    <div class="ccm-pane-body">
    
        <table border="0" cellspacing="0" cellpadding="0">
            <thead>
                <tr>
                    <th class="header"><?=t('Name')?> <span class="required">*</span></th>
                    <th class="header"><?=t('Handle')?> <span class="required">*</span></th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        <?=$form->text('ctName', $_POST['ctName'], array('class' => 'span9'))?>
                    </td>
                    <td>
                        <?=$form->text('ctHandle', $_POST['ctHandle'], array('class' => 'span6'))?>
                    </td>
{'fraction_non_alphanumeric': 0.2358880220284534, 'fraction_numerical': 0.005966039467645709, 'mean_word_length': 2.8371478873239435, 'pattern_counts': {'":': 0, '<': 69, '<?xml version=': 0, '>': 95, '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': '7147081', 'n_tokens_mistral': 1539, 'n_tokens_neox': 1462, 'n_words': 244}