]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 28 Nov 2012 17:59:32 +0000 (17:59 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 28 Nov 2012 17:59:32 +0000 (17:59 +0000)
inc/ws/Util/html5/class.ws.html5.compiler.php

index c86d8e42645958ed9fa40207a74627e52c0cae82..316e1ef07f3beca8590e33bae9ec8c07675c66b1 100644 (file)
@@ -433,8 +433,9 @@ class wsHTML5Compiler {
 
                $style = array();
                foreach ($sheets as $sheet) {
-                       $style[] = '<link type="text/css" rel="stylesheet" href="' . $sheet . '">';
+                       $style[] = '<link type="text/css" rel="stylesheet" media="screen" href="' . $sheet . '">';
                }
+               $style[] = '<link type="text/css" rel="stylesheet" media="print" href="style/print.css">';
                $style = implode("\n\t\t", $style);
 
                $pagesContents = '';
@@ -454,7 +455,9 @@ class wsHTML5Compiler {
                        $description = '<meta name="description" content="' . html::escapeHTML($this->book->parametres->seoDescription) . '">';
                }
 
-               $vars = array('titre', 'credits', 'ga', 'style', 'script', 'pagesContents', 'description');
+               $print = $this->writePrint();
+
+               $vars = array('titre', 'credits', 'ga', 'style', 'script', 'pagesContents', 'description', 'print');
                foreach ($vars as $v) {
                        $html = str_replace('<!-- $' . $v . ' -->', $$v, $html);
                }
@@ -482,13 +485,13 @@ class wsHTML5Compiler {
 
                $thtml = $uhtml;
 
-               $vars = array('titre', 'credits', 'ga', 'style', 'script', 'pagesContents');
+               $vars = array('titre', 'credits', 'ga', 'style', 'script', 'pagesContents', 'print');
                foreach ($vars as $v) {
                        $uhtml = str_replace('<!-- $' . $v . ' -->', $$v, $uhtml);
                }
 
                $script.="\n\t\t" . '<script type="text/javascript">window.tester = true;</script>';
-               $vars = array('titre', 'credits', 'ga', 'style', 'script');
+               $vars = array('titre', 'credits', 'ga', 'style', 'script', 'print');
                foreach ($vars as $v) {
                        $thtml = str_replace('<!-- $' . $v . ' -->', $$v, $thtml);
                }
@@ -509,6 +512,15 @@ class wsHTML5Compiler {
                file_put_contents($this->vdir . '/widget.html', $whtml);
        }
 
+       protected function writePrint() {
+               $res = '<div id="printpages">';
+               for ($i = 1; $i <= $this->book->parametres->pages; $i++) {
+                       $res.='<div class="printpage"><img src="data/background/150/t' . $i . '.jpg" alt="" /></div>';
+               }
+               $res.='</div>';
+               return $res;
+       }
+
        protected function writeLangs() {
                global $core;
                $daoLang = new wsDAOLang($core->con);