/homepages
/41
/d103639694
/htdocs
/staging
/site
/snippets
/_overview-item.php
</figure>
</a>
<? else: ?>
<figure class="overview-item--figure">
<div class="overview-item--image">
<?= thumb($i->heroImage()->toFile(), array('width' => 600)); ?>
</div>
</figure>
<? endif; ?>
<? endif ?>
<div class="overview-item__description__holder">
<div class="overview-item__description__content">
<h1><?= e($i->headline()->isNotEmpty(), $i->headline()->html(), $i->title()) ?></h1>
<?= $i->intro()->kt() ?>
<p><?= $i->copyright()->html() ?></p>
<? if($i->linkedExternalPage()->isNotEmpty()): ?>
<a class="btn--default" href="<?= $i->linkedExternalPage(); ?>" target="_blank"><span class="btn__background"></span><p><?= l::get('article.further-reading') ?></p></a>
<? elseif($i->linkedInternalPage()->isNotEmpty()): ?>
<a class="btn--default" href="<?= $site->index()->findBy('uid',$i->linkedInternalPage()->uid())->url(); ?>" target="_blank"><span class="btn__background"></span><p><?= l::get('article.further-reading') ?></p></a>
<? elseif($i->iframeUrl()->isNotEmpty()): ?>
<a class="btn--default" href="<?= $i->iframeUrl(); ?>" data-featherlight="iframe" data-featherlight-iframe-allowfullscreen="true" data-featherlight-iframe-width="<?= $i->iframeWidth(); ?>" data-featherlight-iframe-height="<?= $i->iframeHeight(); ?>">
<span class="btn__background"></span>
<p>Anschauen</p>
</a>
<? endif ?>
<? if($i->pressDocument()->isNotEmpty()): ?>
<? $filenames = $i->pressDocument()->split(',');
if(count($filenames) < 2) $filenames = array_pad($filenames, 2, '');
$files = call_user_func_array(array($i->files(), 'find'), $filenames); ?>
<? foreach($files as $document): ?>
<a class="btn--default" href="<?= $document->url() ?>" target="_blank"><span class="btn__background"></span><p><?= l::get('article.document-download') ?></p></a>
<? endforeach ?>
<? endif ?>
</div>
<? if($page->isHomePage()): ?>
<? snippet('__category-item', array('tag' => $tag, 'pageTitle' => $pageTitle, 'tagPage' => $tagPage)) ?>
/homepages
/41
/d103639694
/htdocs
/staging
/kirby
/vendor
/getkirby
/toolkit
/lib
/tpl.php
/**
* Tpl
*
* Super simple template engine
*
* @package Kirby Toolkit
* @author Bastian Allgeier <bastian@getkirby.com>
* @link http://getkirby.com
* @copyright Bastian Allgeier
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
class Tpl extends Silo {
public static $data = array();
public static function load($_file, $_data = array(), $_return = true) {
if(!file_exists($_file)) return false;
ob_start();
extract(array_merge(static::$data, (array)$_data));
require($_file);
$_content = ob_get_contents();
ob_end_clean();
if($_return) return $_content;
echo $_content;
}
}
/homepages
/41
/d103639694
/htdocs
/staging
/kirby
/kirby
/component
/snippet.php
* Returns a snippet file path by name
*
* @param string $name
* @return string
*/
public function file($name) {
return $this->kirby->roots()->snippets() . DS . str_replace('/', DS, $name) . '.php';
}
/**
* Renders the snippet with the given data
*
* @param string $name
* @param array $data
* @param boolean $return
* @return string
*/
public function render($name, $data = [], $return = false) {
if(is_object($data)) $data = ['item' => $data];
return tpl::load($this->kirby->registry->get('snippet', $name), $data, $return);
}
}
/homepages
/41
/d103639694
/htdocs
/staging
/kirby
/helpers.php
<?php
/**
* Embeds a snippet from the snippet folder
*
* @param string $file
* @param mixed $data array or object
* @param boolean $return
* @return string
*/
function snippet($file, $data = array(), $return = false) {
return kirby::instance()->component('snippet')->render($file, $data, $return);
}
/**
* Builds a css link tag for relative or absolute urls
*
* @param string $url
* @param string $media
* @return string
*/
function css() {
return call([kirby::instance()->component('css'), 'tag'], func_get_args());
}
/**
* Builds a script tag for relative or absolute links
*
* @param string $src
* @param boolean $async
* @return string
*/
function js($src, $async = false) {
return call([kirby::instance()->component('js'), 'tag'], func_get_args());
}
/**
* Global markdown parser shortcut
*
* @param string $text
/homepages
/41
/d103639694
/htdocs
/staging
/site
/modules
/__overview-list
/__overview-list.html.php
<? endif ?>
<section class="overview-list grid-masonry grid <?= $columnWidth ?> <? e($pushClass, $pushClass) ?> <?= $sectionPaddingTop ?> <?= $sectionPaddingBottom ?>" data-page="<?= e($page->isHome(), $page->url() . '/', $page->url()) ?><?= e(param('tag'), 'tag:'. param('tag').'/') ?>" data-limit="<?= $page->artShow()->value() ?>">
<? snippet('_edit',array('i' => $m)) ?>
<? $i = 0 ?>
<? if($module->showVoices() == 'true'): ?>
<? $voicesPosition = $module->voicesPosition()->value() ?>
<? endif ?>
<?php foreach($overviewColl->filterBy('translations','1') as $item): ?>
<? if($module->showVoices() == 'true' && $i === ($voicesPosition - 1) && (!param('tag'))): ?>
<? snippet('_client-meanings--overview', array('item' => $item, 'columnWidth' => 'col-1-3', 'maxItems' => 3000)) ?>
<? endif ?>
<? if($item->intendedTemplate() == 'trend' && $item->children()->filterBy('intendedTemplate','module.__multipattern')->count() >= 1): ?>
<?php snippet('_overview-item', array('item' => $item, 'pressArticle' => 'false', 'multipattern' => 'true')) ?>
<? elseif($item->intendedTemplate() == 'press-article'): ?>
<?php snippet('_overview-item', array('item' => $item, 'pressArticle' => 'true', 'multipattern' => 'false')) ?>
<? elseif($item->intendedTemplate() == 'modules'): ?>
<? else: ?>
<?php snippet('_overview-item', array('item' => $item, 'pressArticle' => 'false', 'multipattern' => 'false')) ?>
<? endif ?>
<? $i++ ?>
<?php endforeach ?>
</section>
<? if($more === true): ?>
<section class="load-more__holder <?= $columnWidth ?>">
<div class="load-more__content grid">
<div class="load-more__dashed-line"></div>
<div class="load-more__background">
<a class="load-more__btn btn--default"><span class="btn__background"></span><p><?= l::get('load-more') ?></p></a>
</div>
</div>
</section>
<? endif ?>
/homepages
/41
/d103639694
/htdocs
/staging
/kirby
/vendor
/getkirby
/toolkit
/lib
/tpl.php
/**
* Tpl
*
* Super simple template engine
*
* @package Kirby Toolkit
* @author Bastian Allgeier <bastian@getkirby.com>
* @link http://getkirby.com
* @copyright Bastian Allgeier
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
class Tpl extends Silo {
public static $data = array();
public static function load($_file, $_data = array(), $_return = true) {
if(!file_exists($_file)) return false;
ob_start();
extract(array_merge(static::$data, (array)$_data));
require($_file);
$_content = ob_get_contents();
ob_end_clean();
if($_return) return $_content;
echo $_content;
}
}
/homepages
/41
/d103639694
/htdocs
/staging
/site
/plugins
/modules
/lib
/modules.php
/**
* Outputs all modules of the given page
*
* @param array $data Optional additional data to pass to each module
* @param boolean $return Whether to output or return the module string
* @return string
*/
public function output($data = array(), $return = false) {
$result = '';
// Loop through all valid modules in the file system order
foreach($this->modules() as $module) {
$moduleObj = static::module($module);
if(!$moduleObj) continue;
$moduleName = $moduleObj->name();
// Use the additional data but make sure that $module and $moduleName always win
$moduleData = array_merge($data, compact('module', 'moduleName'));
$result .= tpl::load($moduleObj->snippetFile(), $moduleData, true);
}
if($return) return $result;
echo $result;
}
/**
* Returns a collection of module subpages of the given page
*
* @return Pages
*/
public function modules() {
// Return from cache if possible
if($this->modules) return $this->modules;
// Determine where the modules live
if($childPage = $this->page->find(static::parentUid())) {
// Modules child page exists, use its children
$modules = $childPage->children();
} else {
/homepages
/41
/d103639694
/htdocs
/staging
/site
/plugins
/modules
/modules.php
'kirby\\modules\\module' => __DIR__ . DS . 'lib' . DS . 'module.php',
'kirby\\modules\\modulepage' => __DIR__ . DS . 'lib' . DS . 'modulepage.php',
'kirby\\registry\\module' => __DIR__ . DS . 'lib' . DS . 'moduleregistry.php'
));
// Register page methods, blueprints and page models
Kirby\Modules\Modules::register();
/**
* Helper function to output modules for a given page
* You can also use $page->modules($data, $return)
*
* @param Page $page Kirby page that contains modules
* @param array $data Optional additional data to pass to each module
* @param boolean $return Whether to output or return the module string
* @return string
*/
function modules($page, $data = array(), $return = false) {
$modules = new Kirby\Modules\Modules($page);
return $modules->output($data, $return);
}
/homepages
/41
/d103639694
/htdocs
/staging
/kirby
/vendor
/getkirby
/toolkit
/helpers.php
/**
* Facepalm typo alias
* @see csrf()
*/
function csfr($check = null) {
return csrf($check);
}
/**
* Shortcut for call_user_func_array with a better handling of arguments
*
* @param mixed $function
* @param mixed $arguments
* @return mixed
*/
function call($function, $arguments = array()) {
if(!is_callable($function)) return false;
if(!is_array($arguments)) $arguments = array($arguments);
return call_user_func_array($function, $arguments);
}
/**
* Parses yaml structured text
*
* @param $string
* @return array
*/
function yaml($string) {
return yaml::decode($string);
}
/**
* Simple email sender helper
*
* @param array $params
* @return Email
*/
function email($params = array()) {
return new Email($params);
/homepages
/41
/d103639694
/htdocs
/staging
/kirby
/core
/page.php
public function hash() {
if(isset($this->cache['hash'])) return $this->cache['hash'];
// add a unique hash
$checksum = sprintf('%u', crc32($this->uri()));
return $this->cache['hash'] = base_convert($checksum, 10, 36);
}
/**
* Magic getter for all content fields
*
* @return Field
*/
public function __call($key, $arguments = null) {
if(isset($this->$key)) {
return $this->$key;
} else if(isset(static::$methods[$key])) {
if(!$arguments) $arguments = array();
array_unshift($arguments, clone $this);
return call(static::$methods[$key], $arguments);
} else {
return $this->content()->get($key, $arguments);
}
}
/**
* Alternative for $this->equals()
*/
public function is($page) {
if(!is_a($page, 'Page')) $page = page($page);
return $this->id() == $page->id();
}
/**
* Alternative for $this->is()
*/
public function equals($page) {
return $this->is($page);
}
/homepages
/41
/d103639694
/htdocs
/staging
/site
/templates
/overview-page.php
<?php snippet('header') ?>
<? snippet('_page-title'); ?>
<? $page->modules() ?>
<?php snippet('footer') ?>
/homepages
/41
/d103639694
/htdocs
/staging
/kirby
/vendor
/getkirby
/toolkit
/lib
/tpl.php
/**
* Tpl
*
* Super simple template engine
*
* @package Kirby Toolkit
* @author Bastian Allgeier <bastian@getkirby.com>
* @link http://getkirby.com
* @copyright Bastian Allgeier
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
class Tpl extends Silo {
public static $data = array();
public static function load($_file, $_data = array(), $_return = true) {
if(!file_exists($_file)) return false;
ob_start();
extract(array_merge(static::$data, (array)$_data));
require($_file);
$_content = ob_get_contents();
ob_end_clean();
if($_return) return $_content;
echo $_content;
}
}
/homepages
/41
/d103639694
/htdocs
/staging
/kirby
/kirby
/component
/template.php
if($template instanceof Page) {
$page = $template;
$file = $page->templateFile();
$data = $this->data($page, $data);
} else {
$file = $template;
$data = $this->data(null, $data);
}
// check for an existing template
if(!file_exists($file)) {
throw new Exception('The template could not be found');
}
// merge and register the template data globally
$tplData = tpl::$data;
tpl::$data = array_merge(tpl::$data, $data);
// load the template
$result = tpl::load($file, null, $return);
// reset the template data
tpl::$data = $tplData;
return $result;
}
}
/homepages
/41
/d103639694
/htdocs
/staging
/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
*/
/homepages
/41
/d103639694
/htdocs
/staging
/kirby
/kirby.php
// check for modified content within the content folder
// and auto-expire the page cache in such a case
if($this->options['cache.autoupdate'] and $this->cache()->exists($cacheId)) {
// get the creation date of the cache file
$created = $this->cache()->created($cacheId);
// make sure to kill the cache if the site has been modified
if($this->site->wasModifiedAfter($created)) {
$this->cache()->remove($cacheId);
}
}
// 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
*/
/homepages
/41
/d103639694
/htdocs
/staging
/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;
}
}
}
/homepages
/41
/d103639694
/htdocs
/staging
/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
*/
/homepages
/41
/d103639694
/htdocs
/staging
/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();