Initial public commit
This commit is contained in:
Submodule
+1
Submodule site/plugins/baromator added at cfe2ef2c4c
Submodule
+1
Submodule site/plugins/cachebuster added at eb92317c13
Submodule
+1
Submodule site/plugins/patterns added at 3e1d562073
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Returns the current qdated address
|
||||
* If qdated is not available, returns null
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function qdated() {
|
||||
$path = $_SERVER['HOME'] . DS . '.qdated-current';
|
||||
if(!is_file($path)) return null;
|
||||
|
||||
return 'dated-' . trim(f::read($path)) . '@' . url::host();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an HTML a mailto tag with the current qdated address
|
||||
* If qdated is not available, returns an HTML error message
|
||||
*
|
||||
* @param mixed $text Optional text for the link
|
||||
* Can also be true to use the email
|
||||
* address but put a line break in it
|
||||
* @return string HTML code
|
||||
*/
|
||||
function qdatedHtml($text = false) {
|
||||
$email = qdated();
|
||||
if(!$email) return '<p><strong>' . l::get('qdated.error') . '</strong></p>';
|
||||
|
||||
if($text === true) $text = str_replace('@', '<br>@', $email);
|
||||
return str::email($email, $text);
|
||||
}
|
||||
|
||||
/**
|
||||
* qdated Kirbytag
|
||||
*
|
||||
* Usage: (qdated: Optional link text)
|
||||
*/
|
||||
kirby()->set('tag', 'qdated', [
|
||||
'html' => function($tag) {
|
||||
return qdatedHtml($tag->attr('qdated'));
|
||||
}
|
||||
]);
|
||||
Submodule
+1
Submodule site/plugins/uniform added at 26f17b120b
Reference in New Issue
Block a user