/kunden/328402_1030/webpage/_live/site/templates/pdf.php
$workingpage = page(r::get('path'));
$pdfpage = page('pdf');
$pdftemplate = $pdfpage->documents()->first();
$pdftemplate_path = $pdftemplate->dir().'/'.$pdftemplate->filename();
$pdf = new Fpdi();
$lineHeight = 5;
$pdf->setSourceFile($pdftemplate_path);
$pdf->AddPage();
$pdf->SetDrawColor(255, 255, 255);
$pdf->SetFillColor(255, 255, 255);
$pdf->Rect( 5, 9, 195, 2, 'F', [], [255, 255, 255]);
$pdf->Rect( 5, 295, 195, 10, 'F', [], [255, 255, 255]);
$pdf->useTemplate($pdf->importPage(1), 0, 0);
$pdf->setPageMark();
$image = $workingpage->images()->nth('1');
if ($image) {
$pdf->Image($this->thumbUrl($image, 1600, 1200, 90, 'centered'), 20.9, 33, 169);
}
$pdf->SetFontSize(9);
$pdf->SetTextColor(0, 0, 0);
$pdf->SetXY(20, 170);
$pdf->SetMargins(20, 20, 20, true);
$pdf->Write($lineHeight, str_replace('—', '-', $workingpage->text()));
$pdf->Write($lineHeight, "\n\n");
$additonalContent = [];
$partnerContent = snippet('partner-pdf', ['page' => $workingpage], true);
if (strlen(trim($partnerContent)) > 0) {
$additonalContent = ['Partner' => $partnerContent];
}
if ($workingpage->pdf_p_leader() && !$workingpage->pdf_p_leader()->empty()) {
$additonalContent['Projektleiter'] = $workingpage->pdf_p_leader()->value();
Arguments
"Call to a member function images() on boolean"
/kunden/328402_1030/webpage/_live/php/xberg/Kirby/View/View.php
$output = $this->capture($name, $data);
if ($capture) {
return $output;
}
echo $output;
}
public function capture(string $name, array $data = [])
{
$this->localScopeStack[] = [
'name' => $name,
'data' => array_replace($this->defaultData, $data),
'wrapLevel' => count($this->wrappersStack)
];
ob_start();
unset($name);
unset($data);
extract($this->localScopeStack[count($this->localScopeStack) - 1]['data']);
$output = require($this->getTemplate($this->localScopeStack[count($this->localScopeStack) - 1]['name']));
$wrapLevel = array_pop($this->localScopeStack)['wrapLevel'];
$output = ($output !== 1 ? $output : ob_get_contents());
ob_end_clean();
while (count($this->wrappersStack) > $wrapLevel) {
$wrapEntry = array_pop($this->wrappersStack);
$wrapName = $wrapEntry['name'];
$wrapData = $wrapEntry['data'];
$wrapData[$wrapEntry['contentName']] = $output;
$output = $this->capture($wrapName, $wrapData);
}
return $output;
}
public function wrap(string $name, array $data = [], $contentName = 'content')
{
$this->wrappersStack[] = [
'name' => $name,
'data' => $data,
/kunden/328402_1030/webpage/_live/php/xberg/Kirby/View/View.php
}
public function setDefaultVar(string $name, $value)
{
$this->defaultData[$name] = $value;
return $this;
}
public function resetDefaultVar(string $name)
{
unset($this->defaultData[$name]);
return $this;
}
public function render(string $name, array $data = [], $capture = false)
{
$output = $this->capture($name, $data);
if ($capture) {
return $output;
}
echo $output;
}
public function capture(string $name, array $data = [])
{
$this->localScopeStack[] = [
'name' => $name,
'data' => array_replace($this->defaultData, $data),
'wrapLevel' => count($this->wrappersStack)
];
ob_start();
unset($name);
unset($data);
extract($this->localScopeStack[count($this->localScopeStack) - 1]['data']);
$output = require($this->getTemplate($this->localScopeStack[count($this->localScopeStack) - 1]['name']));
$wrapLevel = array_pop($this->localScopeStack)['wrapLevel'];
Arguments
/kunden/328402_1030/webpage/_live/php/xberg/Kirby/Component/Template.php
$this->view->setDefaultData($data);
}
// apply the basic template vars
return $data;
}
public function render($template, $data = [], $return = true)
{
if($template instanceof Page) {
$data = $this->data($template, $data);
$path = $template->templateFile();
} else {
$data = $this->data(null, $data);
$path = $template;
}
return $this->view->render($path, $data, $return);
}
}
Arguments
"/kunden/328402_1030/webpage/_live/site/templates/pdf.php"
array:3 [
"site" => Site {}
"pages" => Children {}
"page" => Page {}
]
true
/kunden/328402_1030/webpage/_live/kirby/kirby.php
}
return $template;
}
// return a fresh template
return $this->template($page, $data);
}
/**
* Template configuration
*
* @param Page $page
* @param array $data
* @return string
*/
public function template(Page $page, $data = array()) {
return $this->component('template')->render($page, $data);
}
public function request() {
if(!is_null($this->request)) return $this->request;
return $this->request = new Request($this);
}
public function router() {
return $this->router;
}
public function route() {
return $this->route;
}
/**
* Starts the router, renders the page and returns the response
*
* @return mixed
*/
Arguments
Page {}
array:3 [
"site" => Site {}
"pages" => Children {}
"page" => Page {}
]
/kunden/328402_1030/webpage/_live/kirby/kirby.php
}
}
// try to fetch the template from cache
$template = $this->cache()->get($cacheId);
// fetch fresh content if the cache is empty
if(empty($template)) {
$template = $this->template($page, $data);
// store the result for the next round
$this->cache()->set($cacheId, $template);
}
return $template;
}
// return a fresh template
return $this->template($page, $data);
}
/**
* Template configuration
*
* @param Page $page
* @param array $data
* @return string
*/
public function template(Page $page, $data = array()) {
return $this->component('template')->render($page, $data);
}
public function request() {
if(!is_null($this->request)) return $this->request;
return $this->request = new Request($this);
}
public function router() {
Arguments
/kunden/328402_1030/webpage/_live/kirby/kirby/component/response.php
* @link http://getkirby.com
* @copyright Bastian Allgeier
* @license http://getkirby.com/license
*/
class Response extends \Kirby\Component {
/**
* Builds and return the response by various input
*
* @param mixed $response
* @return mixed
*/
public function make($response) {
if(is_string($response)) {
return $this->kirby->render(page($response));
} else if(is_array($response)) {
return $this->kirby->render(page($response[0]), $response[1]);
} else if(is_a($response, 'Page')) {
return $this->kirby->render($response);
} else if(is_a($response, 'Response')) {
return $response;
} else {
return null;
}
}
}
Arguments
/kunden/328402_1030/webpage/_live/kirby/kirby.php
// check for a valid route
if(is_null($this->route)) {
header::status('500');
header::type('json');
die(json_encode(array(
'status' => 'error',
'message' => 'Invalid route or request method'
)));
}
// call the router action with all arguments from the pattern
$response = call($this->route->action(), $this->route->arguments());
// load all language variables
// this can only be loaded once the router action has been called
// otherwise the current language is not yet available
$this->localize();
// build the response
$this->response = $this->component('response')->make($response);
// store the current language in the session
if(
$this->option('language.detect') &&
$this->site()->multilang() &&
$this->site()->language()
) {
s::set('kirby_language', $this->site()->language()->code());
}
return $this->response;
}
/**
* Register a new hook
*
* @param string/array $hook The name of the hook
* @param closure $callback
*/
Arguments
/kunden/328402_1030/webpage/_live/index.php
<?php
define('DS', DIRECTORY_SEPARATOR);
// load kirby
require(__DIR__ . DS . 'kirby' . DS . 'bootstrap.php');
// check for a custom site.php
if(file_exists(__DIR__ . DS . 'site.php')) {
require(__DIR__ . DS . 'site.php');
} else {
$kirby = kirby();
}
// render
echo $kirby->launch();