コード例 #1
0
 /**
  * Create navigation structure
  *
  * @param string $dir Source directory in relative format
  *
  * @return array
  */
 protected function getNav($dir)
 {
     $var = array();
     $rootname = FileSystem::getRootName();
     if ($dir === $rootname) {
         $var[] = array("name" => $rootname, "link" => $this->link("openDir", $rootname));
     } else {
         $nav = explode("/", $dir);
         $path = "/";
         foreach ($nav as $item) {
             if ($item) {
                 $path .= "{$item}/";
                 $var[] = array("name" => $item, "link" => $this->link("openDir", $path));
             }
         }
     }
     return $var;
 }
コード例 #2
0
ファイル: FileManager.php プロジェクト: ixtrum/file-manager
 /**
  * Render body
  */
 public function renderBody()
 {
     $this->template->setFile(__DIR__ . "/templates/body.latte");
     $this->template->setTranslator($this->system->translator);
     if (!isset($this->template->content)) {
         $this->template->content = $this->getContent($this->getActualDir(), $this->system->session->mask, $this->system->session->order);
     }
     $this->template->actualdir = $this->getActualDir();
     $this->template->rootname = FileSystem::getRootName();
     $this->template->view = $this->view;
     $this->template->resUrl = $this->system->parameters["resUrl"];
     $this->template->resDir = $this->system->parameters["resDir"];
     $this->template->timeFormat = $this->system->translator->getTimeFormat();
     $this->template->plugins = array();
     foreach ($this->system->parameters["plugins"] as $name => $config) {
         if (isset($config["types"]["content"])) {
             $this->template->plugins[$name] = $config;
         }
     }
     $this->template->render();
 }
コード例 #3
0
 /**
  * Render in toolbar
  */
 public function renderToolbar()
 {
     $this->template->setFile(__DIR__ . "/toolbar.latte");
     $this->template->setTranslator($this->translator);
     $this->template->clipboard = $this->system->session->clipboard;
     $this->template->rootname = FileSystem::getRootName();
     $this->template->render();
 }