<commit_before><?php
if(!defined("GOOSE")){exit();}

if ($paramAction == 'create')
{
	if (!$nest_srl)
	{
		$util->back('nest값이 없습니다.');
		exit;
	}
	$nest = $spawn->getItem(array(
		'table' => $tablesName[nests],
		'where' => 'srl='.$nest_srl
	));
}
else if ($paramAction == 'modify')
{
	if (!$article_srl)
	{
		$util->back('article값이 없습니다.');
		exit;
	}
	$article = $spawn->getItem(array(
		'table' => $tablesName[articles],
		'where' => 'srl='.$article_srl
	));
	$nest = $spawn->getItem(array(
		'table' => $tablesName[nests],
		'where' => 'srl='.$article[nest_srl]
	));
	$nest_srl = $article[nest_srl];
}

$nestName = '['.$nest[name].'] ';
$titleType = getActionType($paramAction);


/**
 * 확장변수 폼 만들어주는 함수
 * 
 * @param Number $n : 폼 타입 (0:input[type=text], 1:textarea, 2:select)
 * @param String $keyName : key 이름
 * @param String $keyValue : 기본값
 * @param String $selectVar : 사용자값 (기본값보다 우선)
 * @param Number $required : 필수항목 (0:false, 1:true)
 * @return String $str : 만들어진 폼 일리먼트 문자
 */
function extraKeyTypePrint($type=NULL, $keyName="", $keyValue="", $selectVar="", $required=null)
{
	$requiredAttr = ($required == 1) ? 'required' : '';

	switch ($type)
	{
		case 0:
			$value = ($selectVar) ? $selectVar : $keyValue;
			$str = "<input type=\"text\" name=\"$keyName\" id=\"$keyName\" value=\"$value\" class=\"block\" $requiredAttr />";
			break;

		case 1:
			$value = ($selectVar) ? $selectVar : $keyValue;
			$str = "<textarea name=\"$keyName\" id=\"$keyName\" class=\"block\" rows=\"4\" $requiredAttr>$value</textarea>";
			break;

		case 2:
			$arr = explode(",", $keyValue);
			$str .= "<select name=\"$keyName\" id=\"$keyName\" $requiredAttr>";
			$str .= "<option value=\"\">선택하세요.</option>";
			for ($i=0; $i<count($arr); $i++)
			{
				$selected = ($selectVar == $arr[$i]) ? 'selected' : '';
				$str .= "<option value=\"$arr[$i]\" $selected>$arr[$i]</option>";
			}
			$str .= "</select>";
			break;
	}
	return $str;
}
?>

<script src="<?=$jQueryAddress?>"></script>

<section class="form">
	<div class="hgroup">
		<h1><?=$nestName?>문서<?=$titleType?></h1>
	</div>

	<form name="writeForm" action="<?=ROOT?>/article/<?=$paramAction?>/" method="post" enctype="multipart/form-data">
		<input type="hidden" name="group_srl" value="<?=$nest['group_srl']?>" />
		<input type="hidden" name="nest_srl" value="<?=$nest_srl?>" />
		<input type="hidden" name="article_srl" value="<?=$article_srl?>" />
		<input type="hidden" name="page" value="<?=$_GET['page']?>" />
		<fieldset>
			<legend class="blind">문서<?=$titleType?></legend>
			<?<commit_msg>에디트 플러그인에서 필요하면 쓰기때문에 jquery삭제<commit_after><?php
if(!defined("GOOSE")){exit();}

if ($paramAction == 'create')
{
	if (!$nest_srl)
	{
		$util->back('nest값이 없습니다.');
		exit;
	}
	$nest = $spawn->getItem(array(
		'table' => $tablesName[nests],
		'where' => 'srl='.$nest_srl
	));
}
else if ($paramAction == 'modify')
{
	if (!$article_srl)
	{
		$util->back('article값이 없습니다.');
		exit;
	}
	$article = $spawn->getItem(array(
		'table' => $tablesName[articles],
		'where' => 'srl='.$article_srl
	));
	$nest = $spawn->getItem(array(
		'table' => $tablesName[nests],
		'where' => 'srl='.$article[nest_srl]
	));
	$nest_srl = $article[nest_srl];
}

$nestName = '['.$nest[name].'] ';
$titleType = getActionType($paramAction);


/**
 * 확장변수 폼 만들어주는 함수
 * 
 * @param Number $n : 폼 타입 (0:input[type=text], 1:textarea, 2:select)
 * @param String $keyName : key 이름
 * @param String $keyValue : 기본값
 * @param String $selectVar : 사용자값 (기본값보다 우선)
 * @param Number $required : 필수항목 (0:false, 1:true)
 * @return String $str : 만들어진 폼 일리먼트 문자
 */
function extraKeyTypePrint($type=NULL, $keyName="", $keyValue="", $selectVar="", $required=null)
{
	$requiredAttr = ($required == 1) ? 'required' : '';

	switch ($type)
	{
		case 0:
			$value = ($selectVar) ? $selectVar : $keyValue;
			$str = "<input type=\"text\" name=\"$keyName\" id=\"$keyName\" value=\"$value\" class=\"block\" $requiredAttr />";
			break;

		case 1:
			$value = ($selectVar) ? $selectVar : $keyValue;
			$str = "<textarea name=\"$keyName\" id=\"$keyName\" class=\"block\" rows=\"4\" $requiredAttr>$value</textarea>";
			break;

		case 2:
			$arr = explode(",", $keyValue);
			$str .= "<select name=\"$keyName\" id=\"$keyName\" $requiredAttr>";
			$str .= "<option value=\"\">선택하세요.</option>";
			for ($i=0; $i<count($arr); $i++)
			{
				$selected = ($selectVar == $arr[$i]) ? 'selected' : '';
				$str .= "<option value=\"$arr[$i]\" $selected>$arr[$i]</option>";
			}
			$str .= "</select>";
			break;
	}
	return $str;
}
?>

<section class="form">
	<div class="hgroup">
		<h1><?=$nestName?>문서<?=$titleType?></h1>
	</div>

	<form name="writeForm" action="<?=ROOT?>/article/<?=$paramAction?>/" method="post" enctype="multipart/form-data">
		<input type="hidden" name="group_srl" value="<?=$nest['group_srl']?>" />
		<input type="hidden" name="nest_srl" value="<?=$nest_srl?>" />
		<input type="hidden" name="article_srl" value="<?=$article_srl?>" />
		<input type="hidden" name="page" value="<?=$_GET['page']?>" />
		<fieldset>
			<legend class="blind">문서<?=$titleType?></legend>
			<?
{'fraction_non_alphanumeric': 0.25531077891424075, 'fraction_numerical': 0.0051140833988985055, 'mean_word_length': 4.5092091007583965, 'pattern_counts': {'":': 0, '<': 74, '<?xml version=': 0, '>': 92, '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': '3357248', 'n_tokens_mistral': 2230, 'n_tokens_neox': 2184, 'n_words': 374}