westdc-zf1/application/admin/views/scripts/news/category-add.phtml

112 lines
5.8 KiB
PHTML
Raw Normal View History

2011-09-23 07:34:40 +00:00
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
2012-04-12 04:04:23 +00:00
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin">后台首页</a>');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->breadcrumb('<a href="/admin/news">新闻中心</a>');
$this->breadcrumb('栏目添加');
2011-09-23 07:34:40 +00:00
?>
<div class="row">
<div class="hidden-sm hidden-xs col-md-2">
<?= $this->partial('news/left.phtml'); ?>
</div>
<div class="col-md-10 col-sm-12">
<?php if (!empty($this->error)) :?>
<div id="message" class="alert alert-info">
<?php echo $this->error;?>
</div>
<?php endif; ?>
<?php if(empty($this->msg)) {?>
<h4>栏目添加</h4>
<hr />
<form id="sampleform" method="post" action="#" class="form-horizontal">
<div class="form-group">
<label for="ctitle" class="required col-md-2 col-sm-2 col-xs-2 control-label">栏目标题:</label>
<div class="col-md-4 col-sm-4 col-xs-4">
<input type="text" id="ctitle" class="half form-control" value="<?php if(!empty($this->info['title'])) echo $this->info['title'];?>" name="ctitle"/>
</div>
</div>
<div class="form-group">
<label for="ptype" class="required col-md-2 col-sm-2 col-xs-2 control-label">栏目类型:</label>
<div class="col-md-4 col-sm-4 col-xs-4">
<select name="ptype" class="form-control">
<?php if(!empty($this->ptype)) :?>
<?php foreach($this->ptype as $k=>$v) : ?>
<?php if(empty($this->info['ptype'])) {?>
<option value="<?= $v ?>"><?= $k ?></option>
<?php }else{
if($this->info['ptype'] == $v)
{ ?>
<option value="<?= $v ?>" selected="selected"><?= $k ?></option>
<?php }else{?>
<option value="<?= $v ?>"><?= $k ?></option>
<?php }
}?>
<?php endforeach;?>
<?php endif; ?>
</select>
</div>
</div>
<div class="form-group">
<label for="fid" class="required col-md-2 col-sm-2 col-xs-2 control-label">父级栏目:</label>
<div class="col-md-4 col-sm-4 col-xs-4">
<select name="fid" class="form-control" >
<option value="0"></option>
<?php if(!empty($this->categories)) :?>
<?php foreach($this->categories as $v) : ?>
<?php if(empty($this->info['fid'])) {?>
<option value="<?= $v['id'];?>">
<?php if(!empty($v[$this->deepField])) {echo str_repeat('-',$v[$this->deepField]);} ?>
<?=$v['title'];?>
</option>
<?php }else{
if($this->info['fid'] == $v['id'])
{ ?>
<option value="<?= $v['id'];?>" selected="selected">
<?php if(!empty($v[$this->deepField])) {echo str_repeat('-',$v[$this->deepField]);} ?>
<?= $v['title'];?>
</option>
<?php }else{?>
<option value="<?= $v['id'];?>"><?= $v['title'];?></option>
<?php }
}?>
<?php endforeach;?>
<?php endif; ?>
</select>
</div>
</div>
<div class="form-group">
<label for="code" class="required col-md-2 col-sm-2 col-xs-2 control-label">栏目URL</label>
<div class="col-md-4 col-sm-4 col-xs-4">
<input type="text" id="code" class="half form-control" value="<?php if(!empty($this->info['code'])) echo $this->info['code'];?>" name="code"/>
<h5>(仅小写英文字母与数字)</h5>
<h5><small>如填写: technology 则前台访问地址为: http://westdc.westgis.ac.cn/news/technology </small></h5>
</div>
</div>
<div class="form-group">
<label for="title_en" class="required col-md-2 col-sm-2 col-xs-2 control-label">英文标题:</label>
<div class="col-md-4 col-sm-4 col-xs-4">
<input type="text" id="title_en" class="half form-control" value="<?php if(!empty($this->info['title_en'])) echo $this->info['title_en'];?>" name="title_en" />
</div>
</div>
<div class="form-group">
<label for="" class="required col-md-2 col-sm-2 col-xs-2 control-label"></label>
<div class="col-md-4 col-sm-4 col-xs-4">
<input type="hidden" name="submit" value="1" />
<input type="submit" class="btn btn-primary" value="提交"/>
<input type="reset" class="btn btn-danger" value="重置"/>
</div>
</div>
</form>
<?php }else{ ?>
<div class="alert alert-success">
<a data-dismiss="alert" class="close">×</a>
<?php echo $this->msg ?>
</div>
<script language="javascript">setTimeout("self.location='<?php echo $this->jump_url ?>'",3000);</script>
<?php } ?>
</div>
</div>