diff options
-rw-r--r-- | js/viewer/viewer.js | 4 | ||||
-rw-r--r-- | lib/TemplateManager.php | 10 | ||||
-rw-r--r-- | templates/templatePicker.html | 7 |
3 files changed, 5 insertions, 16 deletions
diff --git a/js/viewer/viewer.js b/js/viewer/viewer.js index 8fdad39f..22e6af6a 100644 --- a/js/viewer/viewer.js +++ b/js/viewer/viewer.js @@ -285,12 +285,8 @@ var odfViewer = { var $dlg = $tmpl.octemplate({ dialog_name: 'template-picker', dialog_title: t('richdocuments','Select template'), - default_name: t('richdocuments','Empty file') }); - $dlg[0].querySelector('.default').onclick = function() { - $dlg[0].dataset.templateId = undefined; - }; // create templates list var templates = _.values(data) templates.forEach(function(template) { diff --git a/lib/TemplateManager.php b/lib/TemplateManager.php index 87150a7a..d97af4f9 100644 --- a/lib/TemplateManager.php +++ b/lib/TemplateManager.php @@ -169,13 +169,13 @@ class TemplateManager { * @param File[] $templates * @return File[] */ - private function filterTemplates($templates, $type) { + private function filterTemplates($templates, $type = null) { return array_filter($templates, function (Node $templateFile) use ($type) { if (!($templateFile instanceof File)) { return false; } - if (!in_array($templateFile->getMimeType(), self::$tplTypes[$type])) { + if ($type !== null && !in_array($templateFile->getMimeType(), self::$tplTypes[$type])) { return false; } @@ -185,7 +185,7 @@ class TemplateManager { }); } - private function getEmpty($type) { + private function getEmpty($type = null) { $folder = $this->getEmptyTemplateDir(); $templateFiles = $folder->getDirectoryListing(); @@ -213,7 +213,7 @@ class TemplateManager { * * @return File[] */ - public function getSystem($type) { + public function getSystem($type = null) { $folder = $this->getSystemTemplateDir(); $templateFiles = $folder->getDirectoryListing(); @@ -243,7 +243,7 @@ class TemplateManager { * * @return File[] */ - public function getUser($type) { + public function getUser($type = null) { try { $templateDir = $this->getUserTemplateDir(); $templateFiles = $templateDir->getDirectoryListing(); diff --git a/templates/templatePicker.html b/templates/templatePicker.html index 74c1b8be..492e77bc 100644 --- a/templates/templatePicker.html +++ b/templates/templatePicker.html @@ -6,12 +6,5 @@ <h2></h2> </span> </a> - <a class="default" href="#"> - <span> - <span class="icon-add-white"></span> - <h2>{default_name}</h2> - </span> - </a> </div> </div> -
\ No newline at end of file |