1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-11 17:14:42 +02:00

Error page improvement: template support.

This commit is contained in:
lonalore
2016-12-14 15:01:51 +01:00
parent d5f9b9ac5e
commit fb3946ae0a
8 changed files with 498 additions and 216 deletions

View File

@@ -0,0 +1,81 @@
<?php
/**
* e107 website system
*
* Copyright (C) 2008-2016 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* @file
* Error shortcodes.
*/
if(!defined('e107_INIT'))
{
exit;
}
/**
* Class error_shortcodes.
*/
class error_shortcodes extends e_shortcode
{
/**
* @return mixed
*/
public function sc_error_title()
{
return varset($this->var['title'], '');
}
/**
* @return mixed
*/
public function sc_error_subtitle()
{
return varset($this->var['subtitle'], '');
}
/**
* @return mixed
*/
public function sc_error_caption()
{
return varset($this->var['caption'], '');
}
/**
* @return mixed
*/
public function sc_error_content()
{
return varset($this->var['content'], '');
}
/**
* @return string
*/
public function sc_error_link_home()
{
$icon = e107::getParser()->toGlyph('fa-home');
$url = SITEURL;
return '<a href="' . $url . '" class="btn btn-primary">' . $icon . ' ' . LAN_ERROR_20 . '</a>';
}
/**
* @return string
*/
public function sc_error_link_search()
{
$icon = e107::getParser()->toGlyph('fa-search');
$url = e107::getUrl()->create('search');
return '<a href="' . $url . '" class="btn btn-default">' . $icon . ' ' . LAN_ERROR_22 . '</a>';
}
}