PageRenderTime 46ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/admin/modules/webtools/revision.php

http://viet-group.googlecode.com/
PHP | 549 lines | 493 code | 39 blank | 17 comment | 81 complexity | 3e71e7b0401c1f7a4db7a4c16269e9a4 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. <?php
  2. /**
  3. * @Project NUKEVIET 3.0
  4. * @Author VINADES.,JSC (contact@vinades.vn)
  5. * @Copyright (C) 2010 VINADES.,JSC. All rights reserved
  6. * @Createdate 9/9/2010, 6:38
  7. */
  8. if ( ! defined( 'NV_IS_FILE_WEBTOOLS' ) ) die( 'Stop!!!' );
  9. $page_title = $lang_module['revision'];
  10. $repository_url = "http://nuke-viet.googlecode.com/svn/trunk/";
  11. define( 'NV3_DIRECTORY_SNV', '/trunk/nukeviet3/' );
  12. function del_path_svn ( $path )
  13. {
  14. return preg_replace( "/^" . nv_preg_quote( NV3_DIRECTORY_SNV ) . "(.*)$/", "\\1", $path );
  15. }
  16. function nv_mkdir_svn ( $dirname )
  17. {
  18. global $lang_global, $global_config, $sys_info;
  19. $ftp_check_login = 0;
  20. $return = true;
  21. if ( $sys_info['ftp_support'] and intval( $global_config['ftp_check_login'] ) == 1 )
  22. {
  23. $ftp_server = nv_unhtmlspecialchars( $global_config['ftp_server'] );
  24. $ftp_port = intval( $global_config['ftp_port'] );
  25. $ftp_user_name = nv_unhtmlspecialchars( $global_config['ftp_user_name'] );
  26. $ftp_user_pass = nv_unhtmlspecialchars( $global_config['ftp_user_pass'] );
  27. $ftp_path = nv_unhtmlspecialchars( $global_config['ftp_path'] );
  28. // set up basic connection
  29. $conn_id = ftp_connect( $ftp_server, $ftp_port );
  30. // login with username and password
  31. $login_result = ftp_login( $conn_id, $ftp_user_name, $ftp_user_pass );
  32. if ( ( ! $conn_id ) || ( ! $login_result ) )
  33. {
  34. $ftp_check_login = 3;
  35. }
  36. elseif ( ftp_chdir( $conn_id, $ftp_path ) )
  37. {
  38. $ftp_check_login = 1;
  39. }
  40. else
  41. {
  42. $ftp_check_login = 2;
  43. }
  44. }
  45. $cp = "";
  46. $e = explode( "/", $dirname );
  47. foreach ( $e as $p )
  48. {
  49. if ( ! empty( $p ) and ! is_dir( NV_ROOTDIR . '/' . $cp . $p ) )
  50. {
  51. if ( $ftp_check_login == 1 )
  52. {
  53. $res = ftp_mkdir( $conn_id, $cp . $p );
  54. if ( substr( $sys_info['os'], 0, 3 ) != 'WIN' ) ftp_chmod( $conn_id, 0777, $cp . $p );
  55. }
  56. elseif ( ! @mkdir( NV_ROOTDIR . '/' . $cp . $p, 0777 ) )
  57. {
  58. $cp = '';
  59. $return = false;
  60. break;
  61. }
  62. }
  63. $cp .= $p . '/';
  64. }
  65. if ( $ftp_check_login == 1 )
  66. {
  67. ftp_close( $conn_id );
  68. }
  69. return $return;
  70. }
  71. if ( $sys_info['allowed_set_time_limit'] )
  72. {
  73. set_time_limit( 0 );
  74. }
  75. $vini = isset( $global_config['revision'] ) ? $global_config['revision'] : 0; // Phien ban truoc
  76. if ( $vini < 893 )
  77. {
  78. $contents = $lang_module['revision_nosuport'];
  79. }
  80. else
  81. {
  82. $step = $nv_Request->get_int( 'step', 'get', 1 );
  83. $n = $nv_Request->get_int( 'n', 'get', 1 );
  84. $checkss = $nv_Request->get_string( 'checkss', 'get', '' );
  85. $nextstep = $step + 1;
  86. if ( $step == 1 )
  87. {
  88. require ( NV_ROOTDIR . '/includes/phpsvnclient/phpsvnclient.php' );
  89. $svn = new phpsvnclient();
  90. $svn->setRepository( $repository_url );
  91. $vend = $svn->getVersion();
  92. if ( $vend > $vini )
  93. {
  94. $nv_Request->set_Session( 'getVersion', $vend );
  95. $nv_Request->set_Session( 'getfile', 0 );
  96. $logs = $svn->getFileLogs( NV3_DIRECTORY_SNV, $vini, $vend );
  97. if ( ! empty( $logs ) )
  98. {
  99. $add_files = $del_files = $edit_files = array();
  100. $is_check_lang = false;
  101. if ( $global_config['update_revision_lang_mode'] != 1 )
  102. {
  103. $is_check_lang = true;
  104. $rule = implode ( "|", array_keys( $language_array ) );
  105. // Check is lang file rule
  106. define ( "NV_WCHECK_LADMIN_GLOBAL_ADMIN", "/^language\/(" . $rule . ")\\/admin_global.php$/" );
  107. define ( "NV_WCHECK_LADMIN_GLOBAL_SITE", "/^language\/(" . $rule . ")\\/global.php$/" );
  108. define ( "NV_WCHECK_LADMIN_INSTALL", "/^language\/(" . $rule . ")\\/install.php$/" );
  109. define ( "NV_WCHECK_LADMIN_MODULES", "/^language\/(" . $rule . ")\\/admin_([a-zA-Z0-9\-\_]+)\.php$/" );
  110. define ( "NV_WCHECK_LMODULES_SITE", "/^modules\/([a-z0-9\-]+)\\/language\/(" . $rule . ")\.php$/" );
  111. define ( "NV_WCHECK_LMODULES_ADMIN", "/^modules\/([a-z0-9\-]+)\\/language\/admin_(" . $rule . ")\.php$/" );
  112. define ( "NV_WCHECK_LJS_GLOBAL", "/^js\/language\/(" . $rule . ")\.js$/" );
  113. define ( "NV_WCHECK_LJS_JQUERYUI", "/^js\/language\/jquery\.ui\.datepicker\-(" . $rule . ")\.js$/" );
  114. define ( "NV_WCHECK_LJS_CKEDITOR", "/^admin\/editors\/ckeditor\/lang\/(" . $rule . ")\.php$/" );
  115. define ( "NV_WCHECK_LBLOCK_MODULE", "/^modules\/([a-z0-9\-]+)\\/language\/block.(module|global)\.([a-zA-Z0-9\-\_]+)\_(" . $rule . ")\.php$/" );
  116. define ( "NV_WCHECK_LBLOCK_INCLUDES", "/^language\/(" . $rule . ")\\/block\.global\.([a-zA-Z0-9\-\_]+)\.php$/" );
  117. /**
  118. * nv_check_is_lang_file()
  119. *
  120. * @param mixed $file_path
  121. * @return
  122. */
  123. function nv_check_is_lang_file ( $file_path )
  124. {
  125. global $global_config;
  126. $check_rule = ( $global_config['update_revision_lang_mode'] == 2 )? $global_config['allow_adminlangs'] : $global_config['allow_sitelangs'];
  127. if ( preg_match( NV_WCHECK_LADMIN_GLOBAL_ADMIN, $file_path, $match ) )
  128. {
  129. if ( ! in_array ( $match[1], $check_rule ) )
  130. {
  131. return true;
  132. }
  133. }
  134. elseif ( preg_match( NV_WCHECK_LADMIN_GLOBAL_SITE, $file_path, $match ) )
  135. {
  136. if ( ! in_array ( $match[1], $check_rule ) )
  137. {
  138. return true;
  139. }
  140. }
  141. elseif ( preg_match( NV_WCHECK_LADMIN_INSTALL, $file_path, $match ) )
  142. {
  143. if ( ! in_array ( $match[1], $check_rule ) )
  144. {
  145. return true;
  146. }
  147. }
  148. elseif ( preg_match( NV_WCHECK_LADMIN_MODULES, $file_path, $match ) )
  149. {
  150. if ( ! in_array ( $match[1], $check_rule ) )
  151. {
  152. return true;
  153. }
  154. }
  155. elseif ( preg_match( NV_WCHECK_LMODULES_SITE, $file_path, $match ) )
  156. {
  157. if ( ! in_array ( $match[2], $check_rule ) )
  158. {
  159. return true;
  160. }
  161. }
  162. elseif ( preg_match( NV_WCHECK_LMODULES_ADMIN, $file_path, $match ) )
  163. {
  164. if ( ! in_array ( $match[2], $check_rule ) )
  165. {
  166. return true;
  167. }
  168. }
  169. elseif ( preg_match( NV_WCHECK_LJS_GLOBAL, $file_path, $match ) )
  170. {
  171. if ( ! in_array ( $match[1], $check_rule ) )
  172. {
  173. return true;
  174. }
  175. }
  176. elseif ( preg_match( NV_WCHECK_LJS_JQUERYUI, $file_path, $match ) )
  177. {
  178. if ( ! in_array ( $match[1], $check_rule ) )
  179. {
  180. return true;
  181. }
  182. }
  183. elseif ( preg_match( NV_WCHECK_LJS_CKEDITOR, $file_path, $match ) )
  184. {
  185. if ( ! in_array ( $match[1], $check_rule ) )
  186. {
  187. return true;
  188. }
  189. }
  190. elseif ( preg_match( NV_WCHECK_LBLOCK_MODULE, $file_path, $match ) )
  191. {
  192. if ( ! in_array ( $match[4], $check_rule ) )
  193. {
  194. return true;
  195. }
  196. }
  197. elseif ( preg_match( NV_WCHECK_LBLOCK_INCLUDES, $file_path, $match ) )
  198. {
  199. if ( ! in_array ( $match[1], $check_rule ) )
  200. {
  201. return true;
  202. }
  203. }
  204. return false;
  205. }
  206. }
  207. foreach ( $logs as $key => $arr_log_i )
  208. {
  209. if ( isset( $arr_log_i['del_files'] ) )
  210. {
  211. $array_remove_add = $array_remove_edit = array();
  212. $arr_temp = $arr_log_i['del_files'];
  213. foreach ( $arr_temp as $str )
  214. {
  215. $str = del_path_svn( trim( $str ) );
  216. if ( $is_check_lang )
  217. {
  218. $check_ok = nv_check_is_lang_file ( $str );
  219. if ( $check_ok )
  220. {
  221. continue;
  222. }
  223. }
  224. if ( in_array( $str, $add_files ) )
  225. {
  226. $array_remove_add[] = $str;
  227. }
  228. elseif ( in_array( $str, $edit_files ) )
  229. {
  230. $array_remove_edit[] = $str;
  231. }
  232. else
  233. {
  234. $del_files[] = $str;
  235. }
  236. }
  237. $add_files = array_diff( $add_files, $array_remove_add );
  238. $edit_files = array_diff( $edit_files, $array_remove_edit );
  239. }
  240. if ( isset( $arr_log_i['mod_files'] ) )
  241. {
  242. $arr_temp = $arr_log_i['mod_files'];
  243. foreach ( $arr_temp as $str )
  244. {
  245. $str = del_path_svn( trim( $str ) );
  246. if ( $is_check_lang )
  247. {
  248. $check_ok = nv_check_is_lang_file ( $str );
  249. if ( $check_ok )
  250. {
  251. continue;
  252. }
  253. }
  254. if ( ! in_array( $str, $edit_files ) and ! in_array( $str, $add_files ) )
  255. {
  256. $edit_files[] = $str;
  257. }
  258. }
  259. }
  260. if ( isset( $arr_log_i['add_files'] ) )
  261. {
  262. $array_remove_del = array();
  263. $arr_temp = $arr_log_i['add_files'];
  264. foreach ( $arr_temp as $str )
  265. {
  266. $str = del_path_svn( trim( $str ) );
  267. if ( $is_check_lang )
  268. {
  269. $check_ok = nv_check_is_lang_file ( $str );
  270. if ( $check_ok )
  271. {
  272. continue;
  273. }
  274. }
  275. if ( in_array( $str, $del_files ) )
  276. {
  277. $array_remove_del[] = $str;
  278. }
  279. $add_files[] = $str;
  280. }
  281. $del_files = array_diff( $del_files, $array_remove_del );
  282. }
  283. }
  284. if ( empty ( $add_files ) and empty ( $del_files ) and empty ( $edit_files ) )
  285. {
  286. $contents = $lang_module['revision_nochange'];
  287. }
  288. else
  289. {
  290. asort( $add_files );
  291. asort( $del_files );
  292. asort( $edit_files );
  293. $svn_data_files = array( 'version' => $vend, 'add_files' => $add_files, 'del_files' => $del_files, 'edit_files' => $edit_files );
  294. file_put_contents( NV_ROOTDIR . '/' . NV_DATADIR . '/svn_data_files_' . md5( $global_config['revision'] . $global_config['sitekey'] ) . '.log', serialize( $svn_data_files ), LOCK_EX );
  295. Header( 'Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&step=' . $nextstep . '&checkss=' . md5( $nextstep . $global_config['sitekey'] . session_id() ) );
  296. exit();
  297. }
  298. }
  299. else
  300. {
  301. $contents = $lang_module['revision_nochange'];
  302. }
  303. }
  304. elseif ( $vend == $vini )
  305. {
  306. $contents = $lang_module['revision_nochange'];
  307. }
  308. else
  309. {
  310. $contents = $lang_module['revision_error'];
  311. }
  312. }
  313. elseif ( $step == 2 and $checkss == md5( $step . $global_config['sitekey'] . session_id() ) )
  314. {
  315. if ( file_exists( NV_ROOTDIR . '/' . NV_DATADIR . '/svn_data_files_' . md5( $global_config['revision'] . $global_config['sitekey'] ) . '.log' ) )
  316. {
  317. $cache = file_get_contents( NV_ROOTDIR . '/' . NV_DATADIR . '/svn_data_files_' . md5( $global_config['revision'] . $global_config['sitekey'] ) . '.log' );
  318. $svn_data_files = unserialize( $cache );
  319. $check_del_dir_update = true;
  320. if ( is_dir( NV_ROOTDIR . '/install/update' ) )
  321. {
  322. $del_error = nv_deletefile( NV_ROOTDIR . '/install/update', true );
  323. if ( empty( $del_error[0] ) )
  324. {
  325. $contents = $del_error[1];
  326. if ( $sys_info['ftp_support'] and intval( $global_config['ftp_check_login'] ) != 1 )
  327. {
  328. $contents .= '<br /><br />' . $lang_module['revision_config_ftp'];
  329. }
  330. $check_del_dir_update = false;
  331. }
  332. }
  333. if ( $check_del_dir_update )
  334. {
  335. if ( ! nv_mkdir_svn( 'install/update' ) )
  336. {
  337. $contents = sprintf( $lang_global['error_create_directories_failed'], 'install/update' );
  338. if ( $sys_info['ftp_support'] and intval( $global_config['ftp_check_login'] ) != 1 )
  339. {
  340. $contents .= '<br /><br />' . $lang_module['revision_config_ftp'];
  341. }
  342. }
  343. else
  344. {
  345. nv_mkdir_svn( 'install/update/new' );
  346. nv_mkdir_svn( 'install/update/old' );
  347. @file_put_contents( NV_ROOTDIR . "/install/update/.htaccess", "deny from all", LOCK_EX );
  348. @file_put_contents( NV_ROOTDIR . "/install/update/index.html", "", LOCK_EX );
  349. @file_put_contents( NV_ROOTDIR . "/install/update/new/index.html", "", LOCK_EX );
  350. @file_put_contents( NV_ROOTDIR . "/install/update/old/index.html", "", LOCK_EX );
  351. $contents = '<div id="listfile">';
  352. $contents .= '<div style="text-align:center;color:red;">' . $lang_module['revision_list_file'] . '</div>';
  353. $contents .= '<div style="overflow:auto;height:300px;width:100%">';
  354. if ( ! empty( $svn_data_files['add_files'] ) ) $contents .= '<br /><br /><b>' . $lang_module['revision_add_files'] . '</b><br />' . implode( "<br />", $svn_data_files['add_files'] );
  355. if ( ! empty( $svn_data_files['edit_files'] ) ) $contents .= '<br /><br /><b>' . $lang_module['revision_mod_files'] . '</b><br />' . implode( "<br />", $svn_data_files['edit_files'] );
  356. if ( ! empty( $svn_data_files['del_files'] ) ) $contents .= '<br /><br /><b>' . $lang_module['revision_del_files'] . '</b><br />' . implode( "<br />", $svn_data_files['del_files'] );
  357. $contents .= '</div>';
  358. $contents .= '</div><br /><br />';
  359. $contents .= $lang_module['revision_msg_download'];
  360. $contents .= '<br /><br /><center><input style="margin-top:10px;font-size:15px" type="button" name="download_file" value="' . $lang_module['revision_download_files'] . '"/></center>';
  361. $contents .= '<br /><br /><div id="message" style="display:none;text-align:center;color:red"><img src="' . NV_BASE_SITEURL . 'images/load_bar.gif" alt="" /></div>';
  362. $contents .= '<script type="text/javascript">
  363. function nv_download_result(res)
  364. {
  365. var r_split = res.split("_");
  366. if (r_split[0] != "OK") {
  367. $("#message").hide();
  368. alert(r_split[1]);
  369. }
  370. else if (r_split[1] == "DOWNLOADFILE") {
  371. nv_ajax("get", "' . NV_BASE_ADMINURL . 'index.php", "' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&step=' . $nextstep . '&checkss=' . md5( $nextstep . $global_config['sitekey'] . session_id() ) . '", "", "nv_download_result");
  372. }
  373. else if (r_split[1] == "DOWNLOADCOMPLETE"){
  374. parent.location="' . NV_BASE_ADMINURL . 'index.php?' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=autoupdate";
  375. }
  376. else{
  377. $("input[name=download_file]").removeAttr("disabled");
  378. $("#message").hide();
  379. alert("' . $lang_module['revision_download_error'] . '");
  380. }
  381. }
  382. $(function(){
  383. $("input[name=download_file]").click(function(){
  384. $(this).attr("disabled","disabled");
  385. $("#listfile").hide();
  386. $("#message").show();
  387. $("#step1").html("");
  388. nv_ajax("get", "' . NV_BASE_ADMINURL . 'index.php", "' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&step=' . $nextstep . '&checkss=' . md5( $nextstep . $global_config['sitekey'] . session_id() ) . '", "", "nv_download_result");
  389. });
  390. });
  391. </script><br /><br />';
  392. }
  393. }
  394. }
  395. else
  396. {
  397. $contents = $lang_module['revision_error_cache_file'];
  398. }
  399. } //elseif ( $step == 3 and $checkss == md5( $step . $global_config['sitekey'] . session_id() ) )
  400. elseif ( $step == 3 )
  401. {
  402. $error_download = array();
  403. $cache = file_get_contents( NV_ROOTDIR . '/' . NV_DATADIR . '/svn_data_files_' . md5( $global_config['revision'] . $global_config['sitekey'] ) . '.log' );
  404. $svn_data_files = unserialize( $cache );
  405. $download_files = array_merge( $svn_data_files['edit_files'], $svn_data_files['add_files'] );
  406. $vend = $nv_Request->get_int( 'getVersion', 'session', 0 );
  407. $getfile = $nv_Request->get_int( 'getfile', 'session', 0 );
  408. require ( NV_ROOTDIR . '/includes/phpsvnclient/phpsvnclient.php' );
  409. $svn = new phpsvnclient();
  410. $svn->setRepository( $repository_url );
  411. if ( $getfile < count( $download_files ) )
  412. {
  413. $file_name = $download_files[$getfile];
  414. $path = NV3_DIRECTORY_SNV . $file_name;
  415. // download new file
  416. $fileInfo = $svn->getDirectoryTree( $path, $vend, false );
  417. $dirname = 'install/update/new/' . del_path_svn( $path );
  418. if ( $fileInfo["type"] != "directory" )
  419. {
  420. $contents_f = $svn->getFile( $path, $vend );
  421. if ( $contents_f === false )
  422. {
  423. $error_download[] = "error getFile: " . $path . "--->" . $vend;
  424. $dirname = "";
  425. }
  426. else
  427. {
  428. $filename = basename( $path );
  429. $dirname = substr( $dirname, 0, - ( strlen( $filename ) + 1 ) );
  430. }
  431. }
  432. if ( ! empty( $dirname ) and ! is_dir( NV_ROOTDIR . '/' . $dirname ) )
  433. {
  434. if ( ! nv_mkdir_svn( $dirname ) )
  435. {
  436. $contents = sprintf( $lang_global['error_create_directories_failed'], $dirname );
  437. if ( $sys_info['ftp_support'] and intval( $global_config['ftp_check_login'] ) != 1 )
  438. {
  439. $contents .= '<br /><br />' . $lang_module['revision_config_ftp'];
  440. }
  441. die( $contents );
  442. }
  443. }
  444. if ( ! empty( $filename ) and ! empty( $dirname ) )
  445. {
  446. file_put_contents( NV_ROOTDIR . '/' . $dirname . "/" . $filename, $contents_f, LOCK_EX );
  447. // download old file
  448. if ( in_array( $file_name, $svn_data_files['edit_files'] ) )
  449. {
  450. $contents_f = $svn->getFile( $path, $vini );
  451. if ( $contents_f === false )
  452. {
  453. $error_download[] = "error getFile: " . $path . "--->" . $vini;
  454. $dirname = "";
  455. }
  456. else
  457. {
  458. $filename = basename( $path );
  459. $dirname = 'install/update/old/' . del_path_svn( $path );
  460. $dirname = substr( $dirname, 0, - ( strlen( $filename ) + 1 ) );
  461. if ( ! empty( $dirname ) and ! is_dir( NV_ROOTDIR . '/' . $dirname ) )
  462. {
  463. if ( ! nv_mkdir_svn( $dirname ) )
  464. {
  465. $contents = sprintf( $lang_global['error_create_directories_failed'], $dirname );
  466. if ( $sys_info['ftp_support'] and intval( $global_config['ftp_check_login'] ) != 1 )
  467. {
  468. $contents .= '<br /><br />' . $lang_module['revision_config_ftp'];
  469. }
  470. die( $contents );
  471. }
  472. }
  473. file_put_contents( NV_ROOTDIR . '/' . $dirname . "/" . $filename, $contents_f, LOCK_EX );
  474. }
  475. }
  476. }
  477. if ( empty( $error_download ) )
  478. {
  479. $nv_Request->set_Session( 'getfile', $getfile + 1 );
  480. die( "OK_DOWNLOADFILE" );
  481. }
  482. else
  483. {
  484. die( implode( "<br />", $error_download ) );
  485. }
  486. }
  487. else
  488. {
  489. $path = NV3_DIRECTORY_SNV . "update_revision.php";
  490. $contents_f = $svn->getFile( $path, $vend );
  491. $contents_f = str_replace( "?>", "\n", $contents_f );
  492. $contents_f .= "\$update_info = array(
  493. 'revision' => array(
  494. 'from' => '" . $vini . "', 'to' => '" . $vend . "'
  495. )
  496. );\n";
  497. if ( ! empty( $svn_data_files['add_files'] ) ) $contents_f .= "\$add_files = array('" . implode( "',\n '", $svn_data_files['add_files'] ) . "');\n\n\n";
  498. if ( ! empty( $svn_data_files['edit_files'] ) ) $contents_f .= "\$edit_files = array('" . implode( "',\n '", $svn_data_files['edit_files'] ) . "');\n\n\n";
  499. if ( ! empty( $svn_data_files['del_files'] ) ) $contents_f .= "\$delete_files = array('" . implode( "',\n '", $svn_data_files['del_files'] ) . "');\n\n\n";
  500. $contents_f .= "\n?>";
  501. file_put_contents( NV_ROOTDIR . "/install/update/update.php", $contents_f, LOCK_EX );
  502. nv_deletefile( NV_ROOTDIR . '/' . NV_DATADIR . '/svn_data_files_' . md5( $global_config['revision'] . $global_config['sitekey'] ) . '.log' );
  503. die( "OK_DOWNLOADCOMPLETE" );
  504. }
  505. }
  506. }
  507. include ( NV_ROOTDIR . "/includes/header.php" );
  508. echo nv_admin_theme( $contents );
  509. include ( NV_ROOTDIR . "/includes/footer.php" );
  510. ?>