国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
2.0KB

  1. <?php
  2. /**
  3. * 生成js操作
  4. *
  5. * @version $Id: makehtml_js_action.php 1 11:04 2010年7月19日Z tianya $
  6. * @package DedeCMS.Administrator
  7. * @copyright Copyright (c) 2007 - 2020, DesDev, Inc.
  8. * @license http://help.dedecms.com/usersguide/license.html
  9. * @link http://www.dedecms.com
  10. */
  11. require_once(dirname(__FILE__)."/config.php");
  12. CheckPurview('sys_MakeHtml');
  13. require_once(DEDEINC."/arc.partview.class.php");
  14. if(empty($typeid)) $typeid = 0;
  15. if(empty($templet)) $templet = "plus/js.htm";
  16. if(empty($uptype)) $uptype = "all";
  17. if($uptype == "all")
  18. {
  19. $row = $dsql->GetOne("SELECT id FROM `#@__arctype` WHERE id>'$typeid' AND ispart<>2 ORDER BY id ASC LIMIT 0,1;");
  20. if(!is_array($row))
  21. {
  22. echo "<link rel=\"stylesheet\" href=\"{$cfg_cmsurl}/static/css/bootstrap.min.css\"><style>.modal {position: static;}</style>";
  23. echo "<div class=\"alert alert-success\" role=\"alert\">完成所有文件更新!</div>";
  24. exit();
  25. } else {
  26. $pv = new PartView($row['id']);
  27. $pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet);
  28. $pv->SaveToHtml($cfg_basedir.$cfg_cmspath."/data/js/".$row['id'].".js", 0);
  29. $typeid = $row['id'];;
  30. ShowMsg("成功更新".$cfg_cmspath."/data/js/".$row['id'].".js,继续进行操作!","makehtml_js_action.php?typeid=$typeid",0,100);
  31. exit();
  32. }
  33. } else {
  34. $pv = new PartView($typeid);
  35. $pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet);
  36. $pv->SaveToHtml($cfg_basedir.$cfg_cmspath."/data/js/".$typeid.".js", 0);
  37. echo "<link rel=\"stylesheet\" href=\"{$cfg_cmsurl}/static/css/bootstrap.min.css\"><style>.modal {position: static;}</style>";
  38. echo "<div class=\"alert alert-success\" role=\"alert\">成功更新".$cfg_cmspath."/data/js/".$typeid.".js!";
  39. echo "预览:</div>";
  40. echo "<hr>";
  41. echo "<script src='".$cfg_cmspath."/data/js/".$typeid.".js'></script>";
  42. exit();
  43. }