Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
PdfModule.php
1 <?php
2 /**
3  *
4  */
5 class PdfModule extends CWebModule
6 {
7  public $salt = '15552kjfjsdfhsdf';
8 
9  public $pdfFolder = 'site.frontend.www.assets.pdf';
10 
11  public $pdfWebPath = '/assets/pdf';
12 
13  public $assetsFolder = 'site.frontend.www.assets.pdf';
14 
15  public $wkhtmltopdfBin = '/usr/bin/wkhtmltopdf.sh';
16 
17  public $cssExpirationTime = 3600;
18 
19  public $allowExternalLinks = false;
20 
21  public function init()
22  {
23  parent::init();
24  $this->setImport(array(
25  'pdf.components.*'
26  ));
27  }
28 
29  public function encrypt($string)
30  {
31  $salt = Yii::app()->getModule('pdf')->salt;
32  return md5(md5($string . $salt) . $salt);
33  }
34 
35  public function createUrl($pageUrl)
36  {
37  return Yii::app()->createAbsoluteUrl('/pdf/gen', array('url' => $pageUrl, 'key' => $this->encrypt($pageUrl)));
38  }
39 
40 }