@@ -54,10 +54,7 @@ public function mainAction()
5454 */
5555 public function annotationtool ()
5656 {
57- if (
58- $ this ->document === null
59- || $ this ->document ->getDoc ()->numPages < 1
60- ) {
57+ if ($ this ->isDocMissingOrEmpty ()) {
6158 // Quit without doing anything if required variables are not set.
6259 return '' ;
6360 } else {
@@ -97,8 +94,7 @@ public function annotationtool()
9794 public function fulltextdownloadtool ()
9895 {
9996 if (
100- $ this ->document === null
101- || $ this ->document ->getDoc ()->numPages < 1
97+ $ this ->isDocMissingOrEmpty ()
10298 || empty ($ this ->extConf ['fileGrpFulltext ' ])
10399 ) {
104100 // Quit without doing anything if required variables are not set.
@@ -143,8 +139,7 @@ public function fulltextdownloadtool()
143139 public function fulltexttool ()
144140 {
145141 if (
146- $ this ->document === null
147- || $ this ->document ->getDoc ()->numPages < 1
142+ $ this ->isDocMissingOrEmpty ()
148143 || empty ($ this ->extConf ['fileGrpFulltext ' ])
149144 ) {
150145 // Quit without doing anything if required variables are not set.
@@ -189,8 +184,7 @@ public function fulltexttool()
189184 public function imagedownloadtool ()
190185 {
191186 if (
192- $ this ->document === null
193- || $ this ->document ->getDoc ()->numPages < 1
187+ $ this ->isDocMissingOrEmpty ()
194188 || empty ($ this ->settings ['fileGrpsImageDownload ' ])
195189 ) {
196190 // Quit without doing anything if required variables are not set.
@@ -281,9 +275,7 @@ public function imagemanipulationtool()
281275 public function pdfdownloadtool ()
282276 {
283277 if (
284- $ this ->document === null
285- || $ this ->document ->getDoc () === null
286- || $ this ->document ->getDoc ()->numPages < 1
278+ $ this ->isDocMissingOrEmpty ()
287279 || empty ($ this ->extConf ['fileGrpDownload ' ])
288280 ) {
289281 // Quit without doing anything if required variables are not set.
@@ -396,8 +388,7 @@ protected function getWorkLink()
396388 public function searchindocumenttool ()
397389 {
398390 if (
399- $ this ->document === null
400- || $ this ->document ->getDoc ()->numPages < 1
391+ $ this ->isDocMissingOrEmpty ()
401392 || empty ($ this ->extConf ['fileGrpFulltext ' ])
402393 || empty ($ this ->settings ['solrcore ' ])
403394 ) {
0 commit comments