Ejemplo n.º 1
0
 public function getfields()
 {
     if (IS_AJAX) {
         $mid = I('post.mid');
         $ModelField = DD('ModelField');
         $fieldlist = $ModelField->selFieldByMid($mid);
         \Org\Helper\IncludeLang::QuickInc('Content/modelfield', 'Admin');
         foreach ($fieldlist as $key => $f) {
             $fieldlist[$key]['title'] = L($f['title']);
         }
         echo json_encode($fieldlist);
     }
 }
Ejemplo n.º 2
0
 /**
  * 修改字段
  */
 public function editfield()
 {
     if (IS_POST) {
         $fieldMod = DD('ModelField');
         $b = $fieldMod->updatefield(I('post.id'));
         if ($b) {
             $this->success(L('OP_SUCCESS'));
         } else {
             $this->error(L('OP_ERROR'));
         }
     } else {
         $id = I('get.id');
         $fieldMod = DD('ModelField');
         $fieldinfo = $fieldMod->find($id);
         \Org\Helper\IncludeLang::QuickInc('Content/modelfield');
         //查询控件
         $plugin = $fieldinfo['plugin'];
         if ($plugin != '') {
             $plugin_arr = explode('/', $plugin);
             $method = $plugin_arr[count($plugin_arr) - 1];
             unset($plugin_arr[count($plugin_arr) - 1]);
             $path = implode('/', $plugin_arr);
             $hooklistmod = DD('HookList');
             //加载插件语言库
             $hookinfo = $hooklistmod->findByPathMethod($path, $method);
             \Org\Helper\IncludeLang::QuickInc($plugin_arr[0] . '/' . $plugin_arr[count($plugin_arr) - 1], 'Plugin');
             $this->assign('hookinfo', $hookinfo);
         }
         $pluginMod = DD('Plugin');
         $pluginlist = $pluginMod->select();
         foreach ($pluginlist as $p) {
             \Org\Helper\IncludeLang::QuickInc($p['filetitle'] . '/' . $p['filetitle'], 'Plugin');
         }
         $this->assign('pluginlist', $pluginlist);
         $this->assign('fieldinfo', $fieldinfo);
         $this->display();
     }
 }