{x2;if:!$userhash}
{x2;include:header}
<body>
{x2;include:nav}
<div class="container-fluid">
	<div class="row-fluid">
		<div class="span2">
			{x2;include:menu}
		</div>
		<div class="span10" id="datacontent">
{x2;endif}
			<ul class="breadcrumb">
				<li><a href="index.php?{x2;$_app}-master">{x2;$apps[$_app]['appname']}</a> <span class="divider">/</span></li>
				<li><a href="index.php?{x2;$_app}-master-module">内容模型</a> <span class="divider">/</span></li>
				<li class="active">字段管理</li>
			</ul>
			<ul class="nav nav-tabs">
				<li class="active">
					<a href="#">字段管理</a>
				</li>
				<li class="dropdown pull-right"> <a class="dropdown-toggle" href="#" data-toggle="dropdown">添加字段<strong class="caret"></strong></a>
                    <ul class="dropdown-menu">
						<li><a href="index.php?{x2;$_app}-master-module-preview&moduleid={x2;$moduleid}">模型预览</a></li>
						<li class="divider"></li>
						<li><a href="index.php?{x2;$_app}-master-module-addfield&moduleid={x2;$moduleid}">添加模型字段</a></li>
						<li><a href="index.php?{x2;$_app}-master-module-addfield&moduleid={x2;$moduleid}&fieldpublic=1">添加公共字段</a></li>
                    </ul>
				</li>
			</ul>
		    <form action="index.php?user-master-module-fields" method="post">
			    <fieldset>
					<legend>{x2;$module['modulename']}</legend>
				    <table class="table table-hover">
						<thead>
							<tr>
								<th>ID</th>
								<th>排序</th>
								<th>字段名</th>
								<th>字段类型</th>
								<th>别名</th>
								<th>字段长度</th>
								<th>数据类型</th>
								<th>HTML类型</th>
								<th>索引</th>
								<th>字段描述</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							{x2;tree:$fields,field,fid}
							<tr>
								<td>{x2;v:field['fieldid']}</td>
								<td><input type="text" name="ids[{x2;v:field['fieldid']}]" value="{x2;v:field['fieldsequence']}" class="liter"/></td>
								<td>{x2;v:field['field']}</td>
								<td>{x2;if:v:field['fieldpublic']}公共{x2;else}模型{x2;endif}字段</td>
								<td>{x2;v:field['fieldtitle']}</td>
								<td>{x2;if:v:field['fieldlength']}{x2;v:field['fieldlength']}{x2;else}默认{x2;endif}</td>
								<td>{x2;v:field['fieldtype']}</td>
								<td>{x2;v:field['fieldhtmltype']}</td>
								<td>{x2;if:v:field['fieldindextype']}{x2;v:field['fieldindextype']}{x2;else}NULL{x2;endif}</td>
								<td>{x2;v:field['fielddescribe']}</td>
								<td>
									<div class="btn-group">
										{x2;if:v:field['fieldlock']}
										<a class="btn ajax" href="index.php?{x2;$_app}-master-module-forbiddenfield&fieldid={x2;v:field['fieldid']}&moduleid={x2;$moduleid}&page={x2;$page}{x2;$u}" title="启用"><em class="icon-ban-circle"></em></a>
										{x2;else}
										<a class="btn ajax" href="index.php?{x2;$_app}-master-module-forbiddenfield&fieldid={x2;v:field['fieldid']}&moduleid={x2;$moduleid}&page={x2;$page}{x2;$u}" title="禁用"><em class="icon-ok-circle"></em></a>
										{x2;endif}
										<a class="btn" href="index.php?{x2;$_app}-master-module-modifyfield&fieldid={x2;v:field['fieldid']}&page={x2;$page}{x2;$u}" title="修改字段"><em class="icon-edit"></em></a>
										{x2;if:!v:field['fieldsystem']}
										<a class="btn ajax" href="index.php?{x2;$_app}-master-module-delfield&fieldid={x2;v:field['fieldid']}&moduleid={x2;$moduleid}&page={x2;$page}{x2;$u}" title="删除字段"><em class="icon-remove"></em></a>
										{x2;endif}
									</div>
								</td>
							</tr>
							{x2;endtree}
						</tbody>
					</table>
					<div class="control-group">
						<div class="controls">
							<button class="btn btn-primary" type="submit">更改排序</button>
				            <input type="hidden" name="page" value="{x2;$page}">
				            <input type="hidden" name="modifyfieldsequence" value="1"/>
	          				<input type="hidden" name="moduleid" value="{x2;$moduleid}"/>
							{x2;tree:$search,arg,aid}
							<input type="hidden" name="search[{x2;v:key}]" value="{x2;v:arg}"/>
							{x2;endtree}
						</div>
					</div>
				</fieldset>
			</form>
{x2;if:!$userhash}
		</div>
	</div>
</div>
</body>
</html>
{x2;endif}