Example #1
0
 public function postHandle()
 {
     $this->runDesign();
     $this->updateOnline();
     $this->setOutput($this->runCron(), 'runCron');
     //门户管理模式 编译目录切换
     if ($this->getRequest()->getPost('design')) {
         $loginUser = Wekit::getLoginUser();
         $designPermission = $loginUser->getPermission('design_allow_manage.push');
         if ($designPermission > 0) {
             $dir = Wind::getRealDir('DATA:design.template');
             if (is_dir($dir)) {
                 WindFolder::rm($dir, true);
             }
             $this->forward->getWindView()->compileDir = 'DATA:design.template';
         }
     }
     // SEO settings
     Wekit::setGlobal(NEXT_VERSION . ' ' . NEXT_RELEASE, 'version');
     $seo = Wekit::V('seo');
     Wekit::setGlobal($seo ? $seo->getData() : array('title' => Wekit::C('site', 'info.name')), 'seo');
     $this->setOutput($this->getRequest()->getIsAjaxRequest() ? '1' : '0', '_ajax_');
     /*[设置给PwGlobalFilters需要的变量]*/
     $_var = array('current' => $this->forward->getWindView()->templateName, 'a' => $this->router->getAction(), 'c' => $this->router->getController(), 'm' => $this->router->getModule());
     $this->getResponse()->setData($_var, '_aCloud_');
 }
Example #2
0
 public function postHandle()
 {
     //门户管理模式 编译目录切换
     if ($this->getRequest()->getPost('design')) {
         $loginUser = Wekit::getLoginUser();
         $designPermission = $loginUser->getPermission('design_allow_manage.push');
         if ($designPermission > 0) {
             $dir = Wind::getRealDir('DATA:design.template');
             if (is_dir($dir)) {
                 WindFolder::rm($dir, true);
             }
             $this->forward->getWindView()->compileDir = 'DATA:design.template';
         }
     }
     // SEO settings
     Wind::import('SRV:seo.bo.PwSeoBo');
     $sitename = Wekit::C('site', 'info.name');
     PwSeoBo::set('{sitename}', $sitename);
     Wekit::setGlobal(NEXT_VERSION . ' ' . NEXT_RELEASE, 'version');
     Wekit::setGlobal(PwSeoBo::getData(), 'seo');
     $this->setOutput($this->getRequest()->getIsAjaxRequest() ? '1' : '0', '_ajax_');
     /*[设置给PwGlobalFilters需要的变量]*/
     $_var = array('current' => $this->forward->getWindView()->templateName, 'a' => $this->router->getAction(), 'c' => $this->router->getController(), 'm' => $this->router->getModule());
     $this->getResponse()->setData($_var, '_aCloud_');
     Wekit::load('APPS:appcenter.service.srv.PwDebugApplication')->compile();
 }
Example #3
0
 public function clearFolder($moduleid)
 {
     if (!$moduleid) {
         return false;
     }
     $dir = $this->getSaveDir($moduleid);
     $store = Wind::getComponent('storage');
     //单独使用
     if (!$this->store instanceof PwStorageLocal) {
         $store->delete($dir, 0);
     } else {
         $dir = Wind::getRealDir('PUBLIC:') . PUBLIC_ATTACH . '/' . $dir;
     }
     WindFolder::rm($dir, true);
     return true;
 }
 public function moduleAction()
 {
     $moduleId = (int) $this->getInput('moduleid', 'post');
     Wind::import('SRV:design.bo.PwDesignModuleBo');
     $bo = new PwDesignModuleBo($moduleId);
     $module = $bo->getModule();
     if ($module['isused']) {
         $this->setTemplate('');
     }
     $bo->setStdId();
     $key = Wekit::load('design.srv.display.PwDesignDisplay')->bindDataKey($moduleId);
     $data[$key] = $bo->getData(true, false);
     $this->setOutput($data, '__design_data');
     list($theme, ) = $this->getForward()->getWindView()->getTheme();
     if (is_array($theme)) {
         list($theme, $pack) = $theme;
     }
     if (!$theme) {
         $theme = 'default';
     }
     WindFolder::rm(Wind::getRealDir('DATA:compile.template.' . $theme . '.design.segment.'), true);
     $this->setTemplate('TPL:design.segment.module');
 }
Example #5
0
 public function clearTemplate($pageid, $tplPath)
 {
     if (!$tplPath) {
         return false;
     }
     $dir = Wind::getRealDir('THEMES:portal.local.') . $tplPath;
     WindFolder::rm($dir, true);
     return true;
 }
Example #6
0
 /**
  * 清理安装过程中产生的临时信息
  *
  * step 5
  * 
  * @return void
  */
 public function clear()
 {
     list(, , $install) = $this->resolvedInstallation($this->tmpInstallLog);
     if (is_file($this->tmpInstallLog)) {
         WindFile::del($this->tmpInstallLog);
     }
     if ($install->getTmpPackage()) {
         WindFolder::rm($install->getTmpPackage(), true);
     }
     if ($install->getTmpPath()) {
         WindFolder::rm($install->getTmpPath(), true);
     }
 }
Example #7
0
 /**
  * 清除tpl缓存
  *
  * @return boolean
  */
 public function refreshTplCache()
 {
     WindFolder::rm(Wind::getRealDir('DATA:compile'), true);
     WindFolder::rm(Wind::getRealDir('DATA:design.template'), true);
     return true;
 }
Example #8
0
 protected function writeFile($fileData)
 {
     $failArray = array();
     $dir = $this->tplPath;
     WindFolder::rm($dir, true);
     WindFolder::mk($dir);
     foreach ($fileData as $file) {
         WindFolder::mkRecur($dir . '/' . dirname($file['filename']));
         if (!WindFile::write($dir . '/' . $file['filename'], $file['data'])) {
             $failArray[] = $file['filename'];
         }
     }
     return $failArray;
 }
 /**
  * 清理安装过程中产生的临时信息
  *
  * step 5
  *
  * @return void
  */
 public function clear()
 {
     if (is_file($this->tmpInstallLog)) {
         WindFile::del($this->tmpInstallLog);
     }
     if ($this->tmpPackage) {
         WindFolder::rm($this->tmpPackage, true);
     }
     if ($this->tmpPath) {
         WindFolder::rm($this->tmpPath, true);
     }
 }
Example #10
0
 /**
  * 批量删除备份
  * 
  * @return void
  */
 public function batchdeleteAction()
 {
     $files = $this->getInput('files');
     !$files && $this->showError('BACKUP:name.empty');
     foreach ($files as $value) {
         $value = WindSecurity::escapePath($value);
         if (!$value) {
             continue;
         }
         if (preg_match('/^(\\w{8}_pw_[^_]+_\\d{14})(.*)(sql|zip)$/i', $value)) {
             $deletePath = $this->_bakupDir . $value;
             WindFile::del($deletePath);
         } elseif (preg_match('/^\\w{8}_pw_([^_]+)_(\\d{14})/i', $value)) {
             WindFolder::rm($this->_bakupDir . $value, true);
         }
     }
     $this->showMessage('success');
 }