/usr
/www
/users
/gmurgi
/kirby
/site
/config
/config.php
} else {
$pag = page( $parent );
}
echo $pag->children()->visible()->count() . ' Seiten';
echo '<table><thead><tr><th>URL</th><th>KW</th></thead><tbody>';
foreach( $pag->children()->visible() as $p ) {
echo '<tr><td>' . $p->url() . '</td><td>' . $p->menuname()->value() . '</td></tr>';
}
echo '</tbody></table>';
}
),
array(
'pattern' => 'hauskauf/vorvertrag/download',
'method' => 'ALL',
'action' => function() {
page('hauskauf/vorvertrag')
->file('vorvertrag-hauskauf.pdf')
->download();
}
),
array(
'pattern' => 'ivbyandex',
'method' => 'ALL',
'action' => function() {
cookie::forever(
'_ivbya',
'stoptracking',
'/',
'.hauskredite.de'
);
$cookies = explode(';', $_SERVER['HTTP_COOKIE']);
foreach($cookies as $cookie) {
$parts = explode('=', $cookie);
$name = trim($parts[0]);
if( $name == '_ym_isad' OR $name == '_ym_uid' OR $name == '_ym_visorc_35375570' OR $name == '_ym_wasSynced') {
setcookie($name, '', time()-1000);
setcookie($name, '', time()-1000, '/');
/usr
/www
/users
/gmurgi
/kirby
/kirby
/vendor
/getkirby
/toolkit
/helpers.php
/**
* Facepalm typo alias
* @see csrf()
*/
function csfr() {
return call('csrf', func_get_args());
}
/**
* 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);
/usr
/www
/users
/gmurgi
/kirby
/kirby
/kirby.php
// load all plugins
$this->plugins();
// start the router
$this->router = new Router($this->routes());
$this->route = $this->router->run($this->path());
// 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;
/usr
/www
/users
/gmurgi
/kirby
/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();