function king_def() { global $king; $king->access("portal_model"); // kc_error('<pre>'.print_r($king->portal->infoModel(19),1)); $_sql = 'select modelid,modelname,modeltable,klanguage from %s_model order by norder desc,modelid desc'; if (!($_res = $king->db->getRows($_sql, 1))) { $_res = array(); } //准备开始列表 $_cmd = array('delete' => $king->lang->get('system/common/del')); $_manage = "'<a title=\"" . $king->lang->get('system/common/editattrib') . "\" href=\"manage.model.php?action=edt&modelid='+K[0]+'\">'+\$.kc_icon('b2','" . $king->lang->get('system/common/edit') . "')+'</a>'"; //attrib $_manage .= "+'<a title=\"" . $king->lang->get('portal/list/dbdelete') . "\" href=\"javascript:;\" class=\"k_ajax\" rel=\"{list:'+K[0]+',CMD:\\'delete\\'}\">'"; $_manage .= "+\$.kc_icon('d2','" . $king->lang->get('system/common/del') . "')+'</a>'"; //db_delete $_manage .= "+'<a href=\"javascript:;\" class=\"k_ajax\" rel=\"{CMD:\\'dbcopy\\',METHOD:\\'GET\\',modelid:'+K[0]+'}\">'"; $_manage .= "+\$.kc_icon('e2','" . $king->lang->get('portal/list/dbcopy') . "')+'</a>'"; //db_copy $_manage .= "+'<a href=\"javascript:;\" class=\"k_ajax\" rel=\"{CMD:\\'dbout\\',modelid:'+K[0]+'}\">'+\$.kc_icon('i2','" . $king->lang->get('portal/list/dbout') . "')+'</a>'"; //db_out $_manage .= "+'<a title=\"" . $king->lang->get('portal/title/field') . "\" href=\"manage.field.php?modelid='+K[0]+'\">'+\$.kc_icon('a4','" . $king->lang->get('portal/common/fieldlist') . "')+'</a>'"; //db_field $_manage .= "+'<a title=\"" . $king->lang->get('portal/title/fieldadd') . "\" href=\"manage.field.php?action=edt&modelid='+K[0]+'\">'+\$.kc_icon('c4','" . $king->lang->get('portal/common/addfield') . "')+'</a>'"; //db_field_add $_manage .= "+\$.kc_updown(K[0])"; //up $_js = array("\$.kc_list(K[0],K[1],'manage.field.php?modelid='+K[0],1)", $_manage, "'" . DB_PRE . "__'+K[2]", "'{King:Portal.'+K[2]+'}<span class=\"i green\"><-- INNER --></span>{/King:Portal.'+K[2]+'}'", "'<i>'+K[3]+'</i>'"); $s = $king->openList($_cmd, '', $_js, $king->db->pagelist('model.php?pid=PID&rn=RN', $king->db->getRows_number('%s_model'))); $s .= "ll('" . $king->lang->get('portal/list/modelname') . "','manage','" . $king->lang->get('portal/list/table') . "','" . $king->lang->get('portal/list/tag') . "','" . $king->lang->get('portal/list/klanguage') . "',1);"; foreach ($_res as $_rs) { //td $s .= 'll(' . $_rs['modelid'] . ',\'' . $_rs['modelname'] . '\',\'' . $_rs['modeltable'] . '\',\'' . kc_getlang($_rs['klanguage']) . '\',0);'; } //结束列表 $s .= $king->closeList(); list($left, $right) = king_inc_list(); $king->skin->output($king->lang->get('portal/title/model'), $left, $right, $s); }
function king_def() { global $king; $sel_array = array('mysql' => 'MySQL', 'sqlite' => 'SQLite'); $phpself = $_SERVER['PHP_SELF']; $inst = substr($phpself, 0, strlen($phpself) - 11); //安装目录 $select_type = kc_htm_radio('dbtype', $sel_array, 'sqlite'); //数据库类型 $array_dirs = array('config.php', 'system/js'); $array_func = array('mysql_connect', 'file_get_contents', 'file_put_contents', 'simplexml_load_file'); //,'fsockopen' $s = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n<title>" . $king->lang->get('system/install/title') . "</title>\r\n<link href=\"system/skins/default/style.css\" rel=\"stylesheet\" type=\"text/css\" />\r\n<style type=\"text/css\">\r\n.k_table_form{font-size:12px;}\r\n.k_table_form th{width:200px;color:#000;font-weight:normal;text-indent:5px;padding:5px;}\r\n.k_table_form td{text-indent:5px;}\r\n</style>\r\n<meta name=\"generator\" content=\"KingCMS\"/>\r\n<script type=\"text/javascript\" src=\"system/js/jquery.js\"></script>\r\n<script type=\"text/javascript\" src=\"system/js/jquery.kc.js\"></script>\r\n<script type=\"text/javascript\" src=\"system/skins/default/fun.js\"></script>\r\n<script type=\"text/javascript\">\r\njQuery(function(\$){\r\n\r\n\t\$(\"#k_dbtype_mysql , #k_dbtype_sqlite\").click(function(){\$.ck_radio(this)});\r\n\r\n\t\$.ck_radio=function(obj){\r\n\t\tif(\$(obj).attr('id')=='k_dbtype_mysql'){\r\n\t\t\t\$('.mysql').show();\r\n\t\t\t\$('.sqlite').hide();\r\n\r\n\t\t}else{\r\n\t\t\t\$('.sqlite').show();\r\n\t\t\t\$('.mysql').hide();\r\n\t\t\r\n\t\t}\r\n\t}\r\n\r\n});\r\n\r\n</script>\r\n</head>\r\n<body>\r\n<div id=\"k_ajax\"></div>\r\n<div id=\"top\">\r\n\t<a id=\"logo\" href=\"http://www.kingcms.com\" target=\"_blank\"><img alt=\"KingCMS\" src=\"system/skins/default/logo.gif\"/></a>\r\n\t<ul class=\"k_menu\">\r\n\t\t<li><a href=\"INSTALL.php\">" . $king->lang->get('system/common/install') . "</a></li>\r\n\t\t<li><a href=\"javascript:;\">" . $king->lang->get('system/common/language') . "</a>\r\n\r\n\t\t\t\t<ul>"; //language $array = kc_f_getdir('system/language', 'xml'); $array = array_map('kc_f_name', $array); $_language = kc_cookie('language'); foreach ($array as $val) { $s .= '<li><a href="javascript:;" class="k_ajax" rel="{CMD:\'language\',lang:\'' . $val . '\'}">'; if ($_language == $val) { $s .= '• '; } $s .= kc_getlang($val) . '</a></li>'; } $s .= "</ul>\r\n\t\t</li>\r\n\t</ul>\r\n</div>\r\n<div id=\"main\">\r\n\r\n\r\n<table class=\"w0\"><tr><td style=\"vertical-align:top;\" class=\"w10\">\r\n\t<form name=\"form_install\" id=\"form_install\">\r\n\t<h3 class=\"caption\">" . $king->lang->get('system/install/db') . "</h3>\r\n\t<table class=\"k_table_form\" cellspacing=\"0\">\r\n\t\t<tbody><tr><th>" . $king->lang->get('system/install/dbtype') . "</th><td>{$select_type}</td></tr></tbody>\r\n\t\t<tr><th>" . $king->lang->get('system/install/pre') . "</th><td><input id=\"pre\" name=\"pre\" class=\"k_in w200\" value=\"king\"/></td></tr>\r\n\t\t<tr><th>" . $king->lang->get('system/install/preadmin') . "</th><td><input id=\"preadmin\" name=\"preadmin\" class=\"k_in w200\" value=\"kc\"/></td></tr>\r\n\r\n\t\t<tr class=\"mysql none\"><th>" . $king->lang->get('system/install/dbhost') . "</th><td><input id=\"host\" name=\"host\" class=\"k_in w200\" value=\"localhost\"/></td></tr>\r\n\t\t<tr class=\"mysql none\"><th>" . $king->lang->get('system/install/dbdata') . "</th><td><input id=\"data\" name=\"data\" class=\"k_in w200\" value=\"test\"/></td></tr>\r\n\t\t<tr class=\"mysql none\"><th>" . $king->lang->get('system/install/dbuser') . "</th><td><input id=\"user\" name=\"user\" class=\"k_in w200\" value=\"root\"/></td></tr>\r\n\t\t<tr class=\"mysql none\"><th>" . $king->lang->get('system/install/dbpass') . "</th><td><input id=\"pass\" name=\"pass\" class=\"k_in w200\" value=\"\"/></td></tr>\r\n\r\n\t\t<tr class=\"sqlite\"><th>" . $king->lang->get('system/install/dbfile') . "</th><td><input id=\"sqlitedata\" name=\"sqlitedata\" class=\"k_in w200\" value=\"" . kc_random(12) . ".db3\"/></td></tr>\r\n\t</table>\r\n\r\n\t<h3 class=\"caption\">" . $king->lang->get('system/install/admin') . "</h3>\r\n\t<table class=\"k_table_form\" cellspacing=\"0\">\r\n\t\t<tbody><tr><th>" . $king->lang->get('system/install/adminname') . "</th><td><input id=\"adminname\" name=\"adminname\" class=\"k_in w200\" value=\"admin\"/></td></tr></tbody>\r\n\t\t<tr><th>" . $king->lang->get('system/install/adminpass') . "</th><td><input id=\"adminpass\" name=\"adminpass\" class=\"k_in w200\" value=\"admin888\"/></td></tr>\r\n\t</table>\r\n\r\n\t<h3 class=\"caption\">" . $king->lang->get('system/level/config') . "</h3>\r\n\t<table class=\"k_table_form\" cellspacing=\"0\">\r\n\t\t<tbody><tr><th>" . $king->lang->get('system/install/cache') . "</th><td><input id=\"cache\" name=\"cache\" class=\"k_in w200\" value=\"_cache\"/></td></tr></tbody>\r\n\r\n\t\t<tr><th>" . $king->lang->get('system/const/inst') . "</th><td><input id=\"inst\" name=\"inst\" class=\"k_in w100\" value=\"{$inst}\"/></td></tr>\r\n\t\t<tr><th>" . $king->lang->get('system/install/timediff') . "</th><td><input id=\"timediff\" name=\"timediff\" class=\"k_in w100\"/></td></tr>\r\n\t\t<tr><th>" . $king->lang->get('system/install/debug') . "</th><td><input id=\"debug\" value=\"1\" name=\"debug\" type=\"checkbox\" checked=\"checked\"/><label for=\"debug\">" . $king->lang->get('system/install/opendebug') . "</label></td></tr>\r\n\t</table>\r\n\r\n\t<script type=\"text/javascript\">\r\n\tvar dateObj = new Date();\r\n\tvar timediff=" . date('G', 0) . ";\r\n\t\$('#timediff').val(timediff);\r\n\t</script>\r\n\r\n\t<p>\r\n\t\t<input value=\"1\" id=\"license\" name=\"license\" type=\"checkbox\"/><label for=\"license\">" . $king->lang->get('system/install/readlicense') . "</label>\r\n\t\t[<a href=\"http://www.kingcms.com/license/\" target=\"_blank\">" . $king->lang->get('system/install/license') . "</a>]\r\n\t</p>\r\n\t\t<input value=\"1\" id=\"isdelete\" name=\"isdelete\" type=\"checkbox\" checked=\"checked\"/><label for=\"isdelete\">" . $king->lang->get('system/install/isdelete') . "</label>\r\n\t<p>\r\n\r\n\t</p>\r\n\r\n\t<p class=\"k_submit\">\r\n\r\n\t\t<input value=\"" . $king->lang->get('system/common/install') . "[S]\" class=\"k_ajax big\" rel=\"{CMD:'config',FORM:'form_install'}\" type=\"button\" accesskey=\"s\"/>\r\n\r\n\t</p>\r\n\t</form>\r\n</td><td class=\"w1\" style=\"vertical-align:top;\"></td><td>\r\n\r\n\t<h3 class=\"caption\">" . $king->lang->get('system/skin/sys') . "</h3>\r\n\t<table class=\"k_table_list\" cellspacing=\"0\">\r\n\t<tr><th class=\"w10\">" . $king->lang->get('system/skin/obj') . "</th><th class=\"w5\">" . $king->lang->get('system/skin/required') . "</th><th class=\"w5\">" . $king->lang->get('system/skin/this') . "</th></tr>"; $s .= '<tr><td>' . $king->lang->get('system/skin/os') . '</td><td>ALL</td><td>' . PHP_OS . '</td></tr>'; $s .= '<tr><td>' . $king->lang->get('system/skin/phpver') . '</td><td>5.1.0+</td><td>' . PHP_VERSION . '</td></tr>'; if (function_exists('disk_free_space')) { $s .= '<tr><td>' . $king->lang->get('system/skin/diskspace') . '</td><td>>2 Mb</td><td>' . kc_f_size(disk_free_space('./')) . '</td></tr>'; } $s .= "</table>\r\n\t<h3 class=\"caption\">" . $king->lang->get('system/skin/writeinfo') . "</h3>\r\n\t<table class=\"k_table_list\" cellspacing=\"0\">\r\n\t<tr><th class=\"w10\">" . $king->lang->get('system/skin/filedir') . "</th><th class=\"w5\">" . $king->lang->get('system/skin/required') . "</th><th class=\"w5wgfv -k07-87;[yu'pbv9io/h9;'99999\">" . $king->lang->get('system/skin/this') . "</td></tr>"; foreach ($array_dirs as $val) { $s .= '<tr><td>' . $val . '</td><td>' . $king->lang->get('system/skin/write/w1') . '</td><td>' . $king->lang->get('system/skin/write/w' . (is_writable(ROOT . $val) ? 1 : 0)) . '</td></tr>'; } $s .= "</table>\r\n\t<h3 class=\"caption\">" . $king->lang->get('system/skin/func') . "</h3>\r\n\t<table class=\"k_table_list\" cellspacing=\"0\">\r\n\t<tr><th class=\"w10\">" . $king->lang->get('system/skin/funs') . "</th><th class=\"w5\">" . $king->lang->get('system/skin/required') . "</th><th class=\"w5\">" . $king->lang->get('system/skin/this') . "</th></tr>"; foreach ($array_func as $val) { $s .= '<tr><td>' . $val . '()</td><td>' . $king->lang->get('system/skin/fun/f1') . '</td><td>' . $king->lang->get('system/skin/fun/f' . (function_exists($val) ? 1 : 0)) . '</td></tr>'; } $s .= "</table>\r\n\t<h3 class=\"caption\">" . $king->lang->get('system/skin/other') . "</h3>\r\n\t<table class=\"k_table_list\" cellspacing=\"0\">\r\n\t"; $s .= "<tr><th class=\"w10 red\">" . $king->lang->get('system/skin/obj') . "</th><th class=\"w5 red\">" . $king->lang->get('system/skin/advice') . "</th><th class=\"w5 red\">" . $king->lang->get('system/skin/this') . "</th></tr>\r\n\t<tr><td>" . $king->lang->get('system/skin/browser') . "</td><td>IE 7.0</td><td>" . kc_browser() . "</td></tr>\r\n\t<tr><td>" . $king->lang->get('system/skin/safemode') . "</td><td>--</td><td>" . $king->lang->get('system/skin/open/o' . (ini_get('safe_mode') ? 1 : 0)) . "</td></tr>\r\n\t<tr><td>" . $king->lang->get('system/skin/maxetime') . "</td><td>--</td><td>" . ini_get('max_execution_time') . "s</td></tr>\r\n\t</table>\r\n\r\n\t<p><img class=\"f6 os\" src=\"system/images/white.gif\"/><a href=\"http://www.kingcms.com/\" class=\"k_ajax\" rel=\"{CMD:'repass',METHOD:'GET'}\">" . $king->lang->get('system/install/resetpass') . "</a></p>\r\n\t<p><img class=\"j2 os\" src=\"system/images/white.gif\"/><a href=\"http://www.kingcms.com/\" class=\"k_ajax\" rel=\"{CMD:'delete'}\">" . $king->lang->get('system/install/delfile') . "</a></p>\r\n\t<p><img class=\"n1 os\" src=\"system/images/white.gif\"/><a href=\"system/login.php\">" . $king->lang->get('system/install/login') . "</a></p>\r\n\r\n</td></tr></table>\r\n\r\n</div>\r\n</body>\r\n</html>"; exit($s); }
/** 返回mainmenu值 @return string */ private function tag_mainMenu() { global $king; $cachepath = 'system/mainmenu/' . $king->admin['adminid'] . '/' . $king->admin['adminlanguage']; $s = $king->cache->get($cachepath); if ($s) { return $s; } if (!$king->acc('#open_setting') && !$king->acc('#open_help')) { return ''; } $str = ''; //language $_array = kc_f_getdir('system/language', 'xml'); if (count($_array) > 1) { $_array = array_map('kc_f_name', $_array); $i = 0; foreach ($_array as $_value) { $i ? $str .= '<li>' : ($str .= '<li class="hr">'); $str .= '<a class="k_ajax" rel="{CMD:\'language\',lang:\'' . $_value . '\',URL:\'../system/manage.php\'}">'; $str .= '<img src="../system/images/white.gif" class="os ' . ($king->admin['adminlanguage'] == $_value ? 'n8' : '') . '"/>'; $str .= kc_getlang($_value) . '</a></li>'; $i++; } } //skins $_array = kc_f_getdir('system/skins/', 'dir'); if (count($_array) > 1) { $i = 0; foreach ($_array as $_value) { $i ? $str .= '<li>' : ($str .= '<li class="hr">'); $str .= '<a class="k_ajax" rel="{CMD:\'skins\',URL:\'../system/manage.php\',skins:\'' . $_value . '\'}">'; $str .= '<img src="../system/images/white.gif" class="os ' . ($king->admin['adminskins'] == $_value ? 'n8' : '') . '"/>'; $str .= kc_getlang($_value) . '</a></li>'; $i++; } } //editor $_array = kc_f_getdir('system/editor/', 'dir'); if (count($_array) > 1) { $i = 0; foreach ($_array as $_value) { $i ? $str .= '<li>' : ($str .= '<li class="hr">'); $str .= '<a class="k_ajax" rel="{CMD:\'editor\',URL:\'../system/manage.php\',editor:\'' . $_value . '\'}">'; $str .= '<img src="../system/images/white.gif" class="os ' . ($king->admin['admineditor'] == $_value ? 'n8' : '') . '"/>'; $str .= kc_getlang($_value) . '</a></li>'; $i++; } } $s = '<ul class="k_menu" id="k_mainmenu">'; if ($king->acc('#open_setting')) { $s .= '<li> <a href="javascript:;">' . $king->lang->get('system/common/tools') . '</a> <ul>'; if ($king->acc('#systemcache')) { $s .= '<li><a class="k_ajax" rel="{CMD:\'clearcache\',URL:\'../system/manage.php\'}"><img src="../system/images/white.gif" class="os d8"/>' . $king->lang->get('system/common/clearcache') . '</a></li>'; } if ($king->acc('#systeminfo')) { $s .= '<li class="hr"><a href="../system/manage.php?action=config"><img src="../system/images/white.gif" class="os e7"/>' . $king->lang->get('system/title/system') . '</a></li>'; } if ($king->admin['adminlevel'] == 'admin') { $s .= '<li><a href="../system/manage.php?action=admin"><img src="../system/images/white.gif" class="os e6"/>' . $king->lang->get('system/title/admin') . '</a></li>'; } if ($king->acc('#module')) { $s .= '<li><a href="../system/manage.php?action=module"><img src="../system/images/white.gif" class="os m8"/>' . $king->lang->get('system/menu/module') . '</a></li>'; } if ($king->acc('#conn')) { $s .= '<li class="hr"><a href="../system/manage.php?action=conn"><img src="../system/images/white.gif" class="os r5"/>' . $king->lang->get('system/title/conn') . '</a></li>'; } if ($king->acc('#lnkclass')) { $s .= '<li><a href="../system/manage.php?action=lnk"><img src="../system/images/white.gif" class="os r1"/>' . $king->lang->get('system/title/lnk') . '</a></li>'; } if ($king->acc('#upfile')) { $s .= '<li><a href="../system/manage.php?action=upfile"><img src="../system/images/white.gif" class="os m5"/>' . $king->lang->get('system/title/upfile') . '</a></li>'; } /* if($king->acc('#timingtask')) $s.='<li><a href="../system/manage.php?action=timingtask">'.$king->lang->get('system/title/timingtask').'</a></li>'; */ if ($king->acc('#log')) { $s .= '<li class="hr"><a href="../system/manage.php?action=log"><img src="../system/images/white.gif" class="os h6"/>' . $king->lang->get('system/title/log') . '</a></li>'; } if ($king->acc('#event')) { $s .= '<li><a href="../system/manage.php?action=event"><img src="../system/images/white.gif" class="os g9"/>' . $king->lang->get('system/title/event') . '</a></li>'; } if ($king->acc('#bot')) { $s .= '<li><a href="../system/manage.php?action=bot"><img src="../system/images/white.gif" class="os o8"/>' . $king->lang->get('system/title/bot') . '</a></li>'; } $s .= $str . ' </ul> </li>'; } if ($king->acc('#open_help')) { $s .= ' <li> <a href="javascript:;">' . $king->lang->get('system/common/help') . '</a> <ul> <li><a href="http://help.kingcms.com/" target="_blank"><img src="../system/images/white.gif" class="os q9"/>' . $king->lang->get('system/common/kchelp') . '</a></li> <li><a href="javascript:;" class="k_ajax" rel="{URL:\'../system/manage.php\',CMD:\'faq\'}"><img src="../system/images/white.gif" class="os g6"/>' . $king->lang->get('system/common/faq') . '</a></li> <li class="hr"><a href="http://www.kingcms.com/" target="_blank"><img src="../system/images/white.gif" class="os b9"/>' . $king->lang->get('system/menu/official') . '</a></li> <li><a href="http://bbs.kingcms.com/" target="_blank"><img src="../system/images/white.gif" class="os r2"/>' . $king->lang->get('system/menu/club') . '</a></li> <li><a href="http://bbs.kingcms.com/forum-17-1.html" target="_blank"><img src="../system/images/white.gif" class="os r3"/>' . $king->lang->get('system/menu/bug') . '</a></li> <li class="hr"><a href="http://www.kingcms.com/license/" target="_blank"><img src="../system/images/white.gif" class="os r4"/>' . $king->lang->get('system/menu/license') . '</a></li>'; /* <li class="hr"><a class="k_ajax" rel="{CMD:\'about\',URL:\'../system/login.php\'}"><img src="../system/images/white.gif" class="os"/>'.$king->lang->get('system/menu/checknew').'</a></li>'; */ if ($king->acc('#phpinfo')) { $s .= '<li><a href="../system/manage.php?action=phpinfo"><img src="../system/images/white.gif" class="os a3"/>PHPINFO()</a></li>'; } $s .= '<li class="hr"><a class="k_ajax" rel="{CMD:\'about\',URL:\'../system/login.php\'}"><img src="../system/images/white.gif" class="os h2"/>' . $king->lang->get("system/common/about") . '..</a></li> </ul> </li>'; } $s .= '</ul>'; $king->cache->put($cachepath, $s); return $s; }
function king_def() { global $king; $king->access('portal'); $_cmd = array($king->lang->get('system/common/create'), 'create' => $king->lang->get('portal/common/create'), '-', 'createlist' => $king->lang->get('portal/common/createlist'), 'createpage' => $king->lang->get('portal/common/createpage'), '-', 'createnot' => $king->lang->get('portal/common/createnot'), '-', 'createall' => $king->lang->get('portal/common/createall')); //准备开始列表 $_cmd = array_merge($_cmd, array($king->lang->get('system/common/del'), 'delete' => $king->lang->get('portal/common/deletelist'), '-', 'deletecachelist' => $king->lang->get('portal/common/deletecachelist'), $king->lang->get('system/common/union'), 'uniondata' => $king->lang->get('portal/common/uniondata'))); $manage = "'<a href=\"'+K[8]+'\" target=\"_blank\">'+\$.kc_icon('h7','" . $king->lang->get('system/common/brow') . "')+'</a>'"; if ($king->acc('portal_list_edt')) { $manage .= "+'<a href=\"manage.php?action=edt&listid='+K[0]+'\">'+\$.kc_icon('i1','" . $king->lang->get('system/common/edit') . "')+'</a>'"; } if ($king->acc('portal_list_delete')) { $manage .= "+isdelete(K[0],K[5])"; } $manage .= "+ismodel(K[0],K[1])"; if ($king->acc('portal_editor')) { $manage .= "+iseditor(K[0],K[1])"; } if ($king->acc('portal_list_updown')) { $manage .= "+\$.kc_updown(K[0])"; } $_js = array("\$.kc_list(K[0],K[2],isLink(K[0],K[1]),1,1,isico(K[1]),K[4],isexistsub(K[0],K[5],K[4]))", $manage, "modelname[K[1]]", "K[3]", "'<i>'+isNil(K[6]+'/'+K[7])+'</i>'"); $modelnames = $king->portal->getModelNames(); $s = '<script>'; $s .= kc_js2array('modelname', $modelnames); $s .= "function isico(modelid){var I1;if(modelid==0){I1='c1'}else if(modelid==-1){I1='e1'}else{I1='d1'};return I1;};"; $s .= "function ismodel(listid,modelid){var I1;if(modelid==-1||modelid==0){I1=\$.kc_icon()+\$.kc_icon()}else{I1='<a href=\"manage.content.php?listid='+listid+'\">'+\$.kc_icon('d5','" . $king->lang->get('system/common/objlist') . "')+'</a><a href=\"manage.content.php?action=edt&listid='+listid+'\">'+\$.kc_icon('f5','" . $king->lang->get('system/common/add') . "')+'</a>'};return I1;};"; $s .= "function iseditor(listid,modelid){var s;if(modelid>0){s='<a href=\"javascript:;\" class=\"k_ajax\" rel=\"{CMD:\\'list_editor\\',listid:'+listid+',METHOD:\\'GET\\'}\">'+\$.kc_icon('n9','" . $king->lang->get('portal/title/listeditor') . "')+'</a>'}else{s=\$.kc_icon()}return s};"; $s .= "function isLink(listid,modelid){var I1;if(modelid==-1||modelid==0){I1=" . ($king->acc('portal_list_edt') ? "'manage.php?action=edt&listid='+listid" : "'javascript:;'") . "}else{I1='manage.content.php?listid='+listid}return I1};"; //是否有子栏目 $s .= "function isexistsub(listid,is,space){var I1= (is=='1')?'<a id=\"ico_'+listid+'\" rel=\"{CMD:\\'openlist\\',is:'+is+',ID:\\'ico_'+listid+'\\',IS:2,listid:'+listid+',space:'+space+'}\" href=\"javascript:;\" class=\"ico_isexistsub k_ajax\">'+\$.kc_icon('k1')+'</a>':\$.kc_icon();return I1;};"; $s .= "function tr_remove(listid,space){\$('#tr_'+listid+' ~ tr').each(function(){\r\n\r\n\t\tvar marginRight=\$(this).children('td:first').children('label').children('input').css('marginRight');\r\n\r\n\t\tvar this_space=(Number(marginRight.match(/\\d+/)))/20;\r\n\r\n\t\tif(this_space>= space){\$(this).remove()}else{return false;}\r\n\r\n\t\t});};"; ////\$('#tr_{$listid} ~ tr').remove(); $s .= "function isdelete(listid,is){var I1=(is=='0')?'<a class=\"k_ajax\" rel=\"{CMD:\\'delete\\',list:'+listid+'}\" href=\"javascript:;\">'+\$.kc_icon('g1','" . $king->lang->get('system/common/del') . "')+'</a>':\$.kc_icon('j1','" . $king->lang->get('portal/error/sublist') . "');return I1;};"; $s .= "function isNil(str){var I1;str=='0/0'?I1='-':I1=str;return I1;};"; $s .= '</script>'; $s .= $king->openList($_cmd, '', $_js); $s .= "ll('" . $king->lang->get('portal/list/listname') . "','manage','" . $king->lang->get('portal/list/modelname') . "','" . $king->lang->get('system/common/language') . "','<i>" . $king->lang->get('system/common/count') . "</i>',1);"; $array = array(); //COOKIE['portal_isopen'] if (isset($_COOKIE['portal_isopen'])) { $array = explode(',', $_COOKIE['portal_isopen']); } if ($res = $king->db->getRows("select listid from %s_list where listid1=0 order by norder,listid;")) { foreach ($res as $rs) { $info = $king->portal->infoList($rs['listid']); $s .= $king->tdList(array($info['listid'], $info['modelid'], $info['klistname'], kc_getlang($info['klanguage']), 1, $info['isexist'], $info['ncount'], $info['ncountall'], addslashes($king->portal->pathList($info)))); //自动展开的列表 if ($info['isexist'] == 1 && in_array($info['listid'], $array)) { $s .= "\$.kc_ajax('{CMD:\\'openlist\\',is:1,ID:\\'ico_{$info['listid']}\\',IS:2,listid:{$info['listid']},space:1}');"; } unset($info); } } //结束列表 $s .= $king->closeList(); if ($king->config('cachetip')) { $s .= $king->cache->info('portal/site/info'); } list($left, $right) = king_inc_list(); $king->skin->output($king->lang->get('portal/title/list'), $left, $right, $s); }