コード例 #1
0
ファイル: View.php プロジェクト: krvd/cms-Inji
 public function paramsParse($params)
 {
     // set template
     if (!empty($params['template']) && $params['template'] != 'current') {
         $this->template = \View\Template::get($params['template']);
     }
     //set page
     if (!empty($params['page']) && $params['page'] != 'current') {
         $this->template->setPage($params['page']);
     }
     //set module
     if (!empty($params['module'])) {
         $this->template->setModule($params['module']);
     }
     //set content
     if (!empty($params['content'])) {
         $this->template->setContent($params['content']);
     } elseif (!$this->template->contentPath) {
         $this->template->setContent();
     }
     //set data
     if (!empty($params['data'])) {
         $this->contentData = array_merge($this->contentData, $params['data']);
     }
 }
コード例 #2
0
ファイル: TemplateController.php プロジェクト: krvd/cms-Inji
 function editFileAction($templateName)
 {
     $template = \View\Template::get($templateName, \App::$primary);
     if (!empty($_GET['path']) && file_exists($template->path . '/' . Tools::parsePath($_GET['path']))) {
         $code = file_get_contents("php://input");
         if (!empty($code)) {
             $result = new Server\Result();
             $result->successMsg = 'Файл сохранен';
             $content = file_put_contents($template->path . '/' . Tools::parsePath($_GET['path']), $code);
             $result->send();
         }
         $content = file_get_contents($template->path . '/' . Tools::parsePath($_GET['path']));
         $this->libs->loadLib('Ace');
         $this->view->page(['content' => 'Template/edit', 'data' => compact('template', 'content')]);
     } else {
         $this->view->page(['content' => 'Template/chooseFile', 'data' => compact('template')]);
     }
 }