| Conditions | 3 |
| Paths | 4 |
| Total Lines | 35 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function assembleBook() |
||
| 21 | { |
||
| 22 | // generate easybook CSS file |
||
| 23 | if ($this->app->edition('include_styles')) { |
||
| 24 | $this->app->render( |
||
| 25 | '@theme/style.css.twig', |
||
| 26 | array('resources_dir' => $this->app['app.dir.resources'] . '/'), |
||
| 27 | $this->app['publishing.dir.output'] . '/css/easybook.css' |
||
| 28 | ); |
||
| 29 | } |
||
| 30 | |||
| 31 | // generate custom CSS file |
||
| 32 | $customCss = $this->app->getCustomTemplate('style.css'); |
||
| 33 | $hasCustomCss = file_exists($customCss); |
||
| 34 | if ($hasCustomCss) { |
||
| 35 | $this->app['filesystem']->copy( |
||
| 36 | $customCss, |
||
| 37 | $this->app['publishing.dir.output'] . '/css/styles.css', |
||
| 38 | true |
||
| 39 | ); |
||
| 40 | } |
||
| 41 | |||
| 42 | // implode all the contents to create the whole book |
||
| 43 | $this->app->render( |
||
| 44 | 'book.twig', |
||
| 45 | array( |
||
| 46 | 'items' => $this->app['publishing.items'], |
||
| 47 | 'has_custom_css' => $hasCustomCss |
||
| 48 | ), |
||
| 49 | $this->app['publishing.dir.output'] . '/book.html' |
||
| 50 | ); |
||
| 51 | |||
| 52 | // copy book images |
||
| 53 | $this->prepareBookImages($this->app['publishing.dir.output'] . '/images'); |
||
| 54 | } |
||
| 55 | } |
||
| 56 |