Пример #1
0
 /**
  * (non-PHPdoc)
  * @see CommonAction::edit()
  * 配置文件新增保存
  */
 public function insert()
 {
     // 		dump($_REQUEST);die;
     $model = D("Dynamicconf");
     $val = $model->GetRules($_POST['name'], $_REQUEST['md']);
     if ($val) {
         $this->error("该英文字段已创建,创建失败");
         exit;
     }
     //组装数据
     $data = array('name' => $_POST['name'], 'showname' => $_POST['showname'], 'shows' => $_POST['shows'], 'widths' => $_POST['widths'], 'sorts' => $_POST['sorts'], 'models' => $_POST['models'], 'sortname' => $_POST['sortname'], 'sortnum' => $_POST['sortnum'], 'issearch' => $_POST['issearch'], 'searchField' => $_POST['searchField'], 'table' => $_POST['table'], 'field' => $_POST['field'], 'conditions' => $_POST['conditions'], 'type' => $_POST['type'], 'isallsearch' => $_POST['isallsearch'], 'searchsortnum' => $_POST['searchsortnum'], 'status' => $_POST['status'], 'helpvalue' => $_POST['helpvalue']);
     //判断 有关联函数
     if ($_POST['arr_func'][0]) {
         foreach ($_POST['arr_func'] as $k => $v) {
             $data['func'][] = explode(",", $_POST['arr_func'][$k]);
             $data['funcdata'][] = array("0" => explode(";", $_POST['arr_funcdata'][$k]));
         }
     }
     //加载配置文件
     if (file_exists($model->GetFile($_REQUEST['md']))) {
         $aryRule = (require $model->GetFile($_REQUEST['md']));
     }
     //头部变为主key值
     $aryRule[$_POST['name']] = $data;
     Ksort($aryRule);
     // 		dump($aryRule);die;
     $model->SetRules($aryRule, $_REQUEST['md']);
     //写入文件
     $this->success(L('_SUCCESS_'));
 }
}
?>
         </div>
      </div>
      <!--×óLOGOÁбí½áÊø£¬ÓÒÃû³ÆÁÐ±í¿ªÊ¼-->
      <div class="fourRight">
          <div id="text_list">
              <ul>
              <?php 
$n = 1;
?>
              <?php 
$showid = 0;
?>
              <?php 
Ksort($GLOBALS['sitecate']);
?>
  <?php 
if (is_array($GLOBALS['sitecate'])) {
    foreach ($GLOBALS['sitecate'] as $k => $v) {
        ?>
              <?php 
        $displayStr = '';
        ?>
              <?php 
        if ($v['sitetype'] == 2) {
            ?>
    
              <?php 
            if ($n == 1) {
                ?>