<optgroup label="===================="></optgroup> <option value="del">删除</option> </select><input type="submit" class="btn" name="forumlinksubmit" value="提交" /></div></td> </tr> </table> <div id="contenttypediv" class="tipsdiv" style="width:210px;"> <table class="tb tb2 nobdb" id="tips"> <tr> <th colspan="15" class="partition"><span style="float:right;margin-top:4px;" class="close" parent="contenttypediv"><img src="admin/images/close.gif" /></span>选择内容属性</th> </tr> <tr> <td class="tipsblock" style="padding-left:5px;"> <select name="type[]" size="10" multiple="multiple" id="type" style="width:98%;"> <option value="0">默认属性[type='0']</option> <?php echo contentype("article"); ?> </select><br />按住Ctrl可多选 </td> </tr> </table> </div> <div id="topdiv" class="tipsdiv" style="width:280px;"> <table class="tb tb2 nobdb" id="tips"> <tr> <th colspan="15" class="partition"><span style="float:right;margin-top:4px;" class="close" parent="topdiv"><img src="admin/images/close.gif" /></span>请输入权重</th> </tr> <tr> <td class="tipsblock" style="padding-left:5px;"> <input type="text" name="top" class="txt" id="top" value=""/> </td>
<tr> <td class="td80">归类:</td> <td class="rowform"><select name="sortid" style="width:auto;"> <option value="0"> == 暂无归类 == </option> <?php echo $forum->select($rs->sortid, 0, 1, 'all', NULL, true); ?> </select></td> <td class="tips2"> </td> </tr> <tr> <td class="td80">属性:</td> <td class="rowform"><select name="type" id="type"> <option value="0">普通标签[type='0']</option> <?php echo contentype("tag", $rs->type); ?> </select></td> <td class="tips2"> </td> </tr> <tr> <td class="td80">关键字:</td> <td class="rowform"><input name="keywords" id="keywords" value="<?php echo $rs->keywords; ?> " type="text" class="txt" style="width:560px"/></td> <td class="tips2">多个关键字请用;格开</td> </tr> <tr> <td class="td80">SEO标题:</td>
" method="get"> <input type="hidden" name="mo" value="tag" /> <input type="hidden" name="do" value="manage" /> <table class="adminlist"> <tr> <td class="tipsblock"><select name="sortid" id="sortid"> <option value="0"> == 按分类 == </option> <?php echo $forum->select($_GET['sortid'], 0, 1, 'all', NULL, true); ?> </select> <select name="type" id="type"> <option value=""> == 按属性 == </option> <option value="0"> 普通标签[type='0'] </option> <?php echo contentype("tag", $_GET['type']); ?> </select> 标签 <input type="text" name="keywords" class="txt" id="keywords" value="<?php echo $_GET['keywords']; ?> " size="30" /> 使用数 <input type="text" name="counts" class="txt" id="counts" value="<?php echo $_GET['counts']; ?> " size="12" /> 每页显示 <input type="text" name="perpage" class="txt" id="perpage" value="<?php echo $_GET['perpage'] ? $_GET['perpage'] : 20; ?>
function form($A, $rs = array(), $isUser = false) { $id = $A['field']; $val = $rs[$id] ? $rs[$id] : ''; $mId = $rs['mid']; $mName = $rs['mName']; $option = unserialize($A['option']); $optStr = $option[$A['type']]; if ($optStr) { $_optArray = explode("\n", $optStr); foreach ($_optArray as $k => $optA) { list($index, $choice) = explode("=", $optA); $optArray[trim($index)] = trim($choice); } } if ($A['hidden']) { $FORM['hidden'] = '<input type="hidden" name="content[' . $id . ']" id="' . $id . '" value="' . $val . '" />'; } else { //判读是否为特殊字段 if (in_array($A['field'], array('fid', 'type', 'vlink'))) { switch ($A['field']) { case "fid": $forum = new forum(); $cata_option = $isUser ? $forum->user_select($val, 0, 1, 1, $mId) : $forum->select($val, 0, 1, NULL, $mId); if ($cata_option) { $html = '<select name="content[fid]" id="fid" style="width:auto;">'; $html .= '<option value="0"> == 请选择所属栏目 == </option>'; $html .= $cata_option; } else { if ($isUser) { $html = '<select name="content[fid]" id="fid">'; $html .= '<option value="0"> == 暂无栏目 == </option>'; } else { $html = '<select name="content[fid]" id="fid" onclick="window.location.replace(\'' . __ADMINCP__ . '=forums&do=add\');">'; $html .= '<option value="0"> == 暂无栏目请先添加 == </option>'; } } $html .= '</select>'; break; case "type": $html = '<select name="content[type]"id="type">'; $html .= '<option value="0">默认属性[type=\'0\']</option>'; $html .= contentype($mName, $val); $html .= '</select>'; break; case "vlink": $forum = new forum(); $html = '<select name="content[vlink][]" size="10" multiple="multiple" id="vlink">'; $html .= $isUser ? $forum->user_select($val, 0, 1, 1, $mId) : $forum->select($val, 0, 1, 'all', $mId); $html .= '</select>'; $html .= selected($val, 'vlink', 'js'); break; // case in_array($A['field'],array('hits','digg','comments','status','postype')): break; } } else { switch ($A['type']) { case in_array($A['type'], array('number', 'text', 'email', 'url')): $html = '<input type="text" name="content[' . $id . ']" class="txt" id="' . $id . '" value="' . $val . '" />'; break; case "radio": foreach ((array) $optArray as $value => $text) { $checked = $value == $val ? ' checked="checked"' : ''; $html .= ' <input type="radio" name="content[' . $id . ']" class="radio" id="' . $id . '" value="' . $value . '" /> ' . $text; } break; case "checkbox": $valArray = explode(',', $val); foreach ((array) $optArray as $value => $text) { $checked = in_array($value, $valArray) ? ' checked="checked"' : ''; $html .= ' <input type="checkbox" name="content[' . $id . '][]" class="checkbox" id="' . $id . '.' . $value . '" value="' . $value . '" ' . $checked . '/> ' . $text; } break; case "textarea": $html = '<textarea name="content[' . $id . ']" id="' . $id . '" onKeyUp="textareasize(this)" class="tarea">' . $val . '</textarea>'; break; // case "editor": // $html='<script type="text/javascript" src="editor/fckeditor.js"></script> //<script type="text/javascript" src="admin/js/plus_format_fck.js"></script><select class="BP"> // <option value="1">第 1 页</option> // </select><input type="button" value="新增一页" onClick="newBody();" class="button"> //<iframe id="rtf" style="width: 0px; height: 0px;" marginwidth="0" marginheight="0" src="about:blank" scrolling="no"></iframe> // <label for="x_paste"></label> // <script>rtf.document.designMode="On";</script> // <input type="button" name="formatbutton" value="粘贴排版" onclick="trans(iCMS.eId);" class="button"> // <input type="button" name="formatbutton_img" value="自动排版" onClick="FormatImages(iCMS.eId)" class="button"> // <input type="button" value="批量上传" onClick="multiUpload();" class="button"> // <input type="button" value="插入图片" onClick="iCMS.showDialog(\''.__ADMINCP__.'=dialog&do=file&click=file&type=gif,jpg,png,bmp,jpeg&from=editor\',\'iCMSEDITOR\',\'从网站选择\');" class="button"> //<div id="iBody_1" class="nb"> // <textarea id="iEditor_1" name="content['.$id.'][]" cols="80" rows="20" style="display:none">'.$val.'</textarea> // <input type="hidden" id="iEditor_1___Config" value="" style="display:none" /> // <iframe id="iEditor_1___Frame" src="./editor/fckeditor.html?InstanceName=iEditor_1&Toolbar=Default" width="100%" height="500" frameborder="0" scrolling="no"></iframe> // </div>'; // break; // case "editor": // $html='<script type="text/javascript" src="editor/fckeditor.js"></script> //<script type="text/javascript" src="admin/js/plus_format_fck.js"></script><select class="BP"> // <option value="1">第 1 页</option> // </select><input type="button" value="新增一页" onClick="newBody();" class="button"> //<iframe id="rtf" style="width: 0px; height: 0px;" marginwidth="0" marginheight="0" src="about:blank" scrolling="no"></iframe> // <label for="x_paste"></label> // <script>rtf.document.designMode="On";</script> // <input type="button" name="formatbutton" value="粘贴排版" onclick="trans(iCMS.eId);" class="button"> // <input type="button" name="formatbutton_img" value="自动排版" onClick="FormatImages(iCMS.eId)" class="button"> // <input type="button" value="批量上传" onClick="multiUpload();" class="button"> // <input type="button" value="插入图片" onClick="iCMS.showDialog(\''.__ADMINCP__.'=dialog&do=file&click=file&type=gif,jpg,png,bmp,jpeg&from=editor\',\'iCMSEDITOR\',\'从网站选择\');" class="button"> //<div id="iBody_1" class="nb"> // <textarea id="iEditor_1" name="content['.$id.'][]" cols="80" rows="20" style="display:none">'.$val.'</textarea> // <input type="hidden" id="iEditor_1___Config" value="" style="display:none" /> // <iframe id="iEditor_1___Frame" src="./editor/fckeditor.html?InstanceName=iEditor_1&Toolbar=Default" width="100%" height="500" frameborder="0" scrolling="no"></iframe> // </div>'; // break; case "editor": global $iCMS; include iPATH . "include/fckeditor.php"; $editor = new FCKeditor('content[' . $id . ']'); $editor->BasePath = $iCMS->config['publicURL']; $editor->ToolbarSet = $isUser ? 'User' : 'Default'; $editor->Value = $val; //$html='<script type="text/javascript" src="'.$iCMS->config['publicURL'].'/ui/editor/fckeditor.js"></script>'; $html = $editor->CreateHtml(); break; case "select": $html = '<select name="content[' . $id . ']" id="' . $id . '" style="width:auto;">'; $html .= '<option value="0"> == 不选择 == </option>'; foreach ((array) $optArray as $value => $text) { $selected = $value == $val ? ' selected="selected"' : ''; $html .= '<option value="' . $value . '"' . $selected . '>' . $text . '</option>'; } $html .= '</select>'; break; case "multiple": $html = '<select name="content[' . $id . '][]" id="' . $id . '" style="width:auto;" size="10" multiple="multiple">'; $html .= '<option value="0"> == 不选择 == </option>'; $valArray = explode(',', $val); foreach ((array) $optArray as $value => $text) { $selected = in_array($value, $valArray) ? ' selected="selected"' : ''; $html .= '<option value="' . $value . '"' . $selected . '>' . $text . '</option>'; } $html .= '</select>'; break; case "calendar": $html = '<input name="content[' . $id . ']" class="txt datepicker" value="' . get_date($val, 'Y-m-d H:i:s') . '" id="' . $id . '" type="text"/>'; break; // case "image": // $html='<input name="content['.$id.']" id="image_'.$id.'" type="text" value="'.$val.'" class="txt" style="width:450px"/>'; // $html.='<button type="button" class="selectdefault button" hidefocus=true to="image_'.$id.'"><span>选 择</span></button>'; // $html.='<div id="image_'.$id.'_menu" style="display:none;">'; // $html.='<ul>'; // $html.='<li onClick="iCMS.showDialog(\''.__ADMINCP__.'=dialog&do=Aupload\',\'image_'.$id.'\',\'本地上传\',400,150);">本地上传</li>'; // $html.='<li onClick="iCMS.showDialog(\''.__ADMINCP__.'=dialog&do=file&click=file&type=gif,jpg,png,bmp,jpeg\',\'image_'.$id.'\',\'从网站选择\');">从网站选择</li>'; // $html.='<li onClick="viewPic(\'image_'.$id.'\');">查看缩略图</li>'; // $html.='<li onClick="crop(\'image_'.$id.'\');">剪裁图片</li>'; // $html.='</ul></div>'; // break; // case "image": // $html='<input name="content['.$id.']" id="image_'.$id.'" type="text" value="'.$val.'" class="txt" style="width:450px"/>'; // $html.='<button type="button" class="selectdefault button" hidefocus=true to="image_'.$id.'"><span>选 择</span></button>'; // $html.='<div id="image_'.$id.'_menu" style="display:none;">'; // $html.='<ul>'; // $html.='<li onClick="iCMS.showDialog(\''.__ADMINCP__.'=dialog&do=Aupload\',\'image_'.$id.'\',\'本地上传\',400,150);">本地上传</li>'; // $html.='<li onClick="iCMS.showDialog(\''.__ADMINCP__.'=dialog&do=file&click=file&type=gif,jpg,png,bmp,jpeg\',\'image_'.$id.'\',\'从网站选择\');">从网站选择</li>'; // $html.='<li onClick="viewPic(\'image_'.$id.'\');">查看缩略图</li>'; // $html.='<li onClick="crop(\'image_'.$id.'\');">剪裁图片</li>'; // $html.='</ul></div>'; // break; case "upload": $html = '<div id="' . $id . '1" style="display:' . ($val ? 'none' : 'block') . ';"><input id="' . $id . 'file" name="content_upload_' . $id . '" type="file" style="width:600px;" /><span id="c' . $id . '1" style="display:' . ($val ? '' : 'none') . '">[<a href="javascript:iCMS.SH(\'' . $id . '2\',\'' . $id . '1\');">取消</a>]</span></div> <div id="' . $id . '2" style="display:' . ($val ? 'block' : 'none') . '"><a class="content_viewPic" ref="' . $id . '" href="javascript:void(0);" title="点击查看图片">' . $val . '</a><input name="content[' . $id . ']" type="text" value="' . $val . '" class="txt content_upload_' . $id . '" style="display:none;"/> [<a href="javascript:iCMS.SH(\'' . $id . '1\',\'' . $id . '2\');">重新上传</a>] [<a href="' . ($isUser ? __USERCP__ : __ADMINCP__) . '=content&do=delpic&mid=' . $mId . '&table=' . $mName . '&id=' . $rs['id'] . '&field=' . $id . '&fp=' . $val . '" target="iCMS_FRAME">删除</a>]</div><script type="text/javascript"> $(".content_viewPic").click(function(){ var path =$(\'.content_upload_\'+$(this).attr(\'ref\')).val(); iCMS.showDialog("' . ($isUser ? __USERCP__ : __ADMINCP__) . '=dialog&do=viewPic",path,\'查看图片\'); });</script>'; break; } } if ($A['show'] || !$isUser) { $FORM['general'] = array('id' => $id, 'label' => $A['name'], 'description' => $A['description'], 'html' => $html); } } if (!model::isDefField($id)) { $valal = '$("#' . $id . '").val()'; //验证 switch ($A['validate']) { case "0": //不能为空 if ($A['type'] == "editor") { $js = 'var ' . $id . '_Editor = FCKeditorAPI.GetInstance(\'content[' . $id . ']\') ; if(' . $id . '_Editor.GetXHTML( true )==""){ alert("' . $A['name'] . '不能为空!"); ' . $id . '_Editor.focus(); return false; }'; } else { $js = 'if(' . $valal . '==""){ alert("' . $A['name'] . '不能为空!"); $("#' . $id . '").focus(); return false;}'; } break; case "2": $js = 'var ' . $id . '_val = ' . $valal . '; var pattern = /^\\d+(\\.\\d+)?$/; chkFlag = pattern.test(' . $id . '_val); if(!chkFlag){ alert("' . $A['name'] . '不是数字"); $("#' . $id . '").focus(); return false;}'; break; case "4": $js = 'var ' . $id . '_val = ' . $valal . '; var pattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\\.[a-zA-Z0-9_-])+/; if(!pattern.test(' . $id . '_val)){ alert("邮箱地址的格式不正确!!"); $("#' . $id . '").focus(); return false;}'; break; case "5": $js = 'var ' . $id . '_val = ' . $valal . '; var pattern = /^[a-zA-z]+:\\/\\/[^\\s]*/; if(!pattern.test(' . $id . '_val)){ alert("[' . $A['name'] . ']网址格式不正确!!"); $("#' . $id . '").focus(); return false;}'; break; } } if ($A['show'] || !$isUser) { $FORM['js'] = $js; } // var_dump($FORM); // var_dump($A); return $FORM; }
} else { ?> <select name="forum" id="forum" onclick="window.location.replace('<?php echo __ADMINCP__; ?> =forums&do=add');"> <option value="0"> == 暂无栏目请先添加 == </option> <?php } ?> </select></td> <td class="td40" style="width:50px;">属性:</td> <td><select name="type" id="type"> <option value="0">普通文章[type='0']</option> <?php echo contentype("article", $rs['type']); ?> </select></td> </tr> <tr> <td class="td40">标题:</td> <td colspan="3"><input type="text" name="title" class="txt" id="title" value="<?php echo $rs['title']; ?> " style="width:560px"/></td> </td> </tr> <tr> <td class="td40">短标题:</td> <td colspan="3"><input name="stitle" class="txt" id="stitle" value="<?php echo $rs['stitle'];
<thead> <tr> <th><span style="float:right;margin-top:4px;" class="close" parent="contentype-div"><img src="admin/images/close.gif" /></span>选择<?php echo $model['name']; ?> 属性</th> </tr> </thead> <tr> <td class="tipsblock" style="padding-left:5px;"><select name="type" size="10" id="type" style="width:98%;"> <option value="0">普通<?php echo $model['name']; ?> [type='0']</option> <?php echo contentype($model['table']); ?> </select></td> </tr> </table> </div> </div> <div class="tipsdiv" id="move-div"> <table class="adminlist" style="width:280px;"> <thead> <tr> <th><span style="float:right;margin-top:4px;" class="close" parent="move-div"><img src="admin/images/close.gif" /></span>请选择栏目</th> </tr> </thead> <tr> <td class="tipsblock" style="padding-left:5px;"><select name="fid" id="fid" style="width:98%;">