43 lines
1.0 KiB
PHP
43 lines
1.0 KiB
PHP
<?php defined('SYSPATH') or die('No direct access allowed.');
|
|
|
|
/**
|
|
* This class extends Kohana's HTML
|
|
*
|
|
* @package lnApp
|
|
* @category Modifications
|
|
* @author Deon George
|
|
* @copyright (c) 2009-2013 Deon George
|
|
* @license http://dev.leenooks.net/license.html
|
|
*/
|
|
abstract class lnApp_HTML extends Kohana_HTML {
|
|
public static $windowed_urls = TRUE;
|
|
|
|
/**
|
|
* Limit the number of characters that some text takes up.
|
|
* If the Text is smaller than the number of characters to display, then it is
|
|
* displayed normally.
|
|
*
|
|
* @param string Text to re-format
|
|
* @param int Number of characters to display
|
|
*/
|
|
public static function abbr($string,$chars=0) {
|
|
if (! $chars OR strlen($string)<=$chars)
|
|
return $string;
|
|
|
|
return sprintf('<abbr title="%s">%s</abbr>',$string,Text::limit_chars($string,$chars));
|
|
}
|
|
|
|
/**
|
|
* If the string is blank, then return &nbsp;
|
|
*
|
|
* @param string Text to print.
|
|
*/
|
|
public static function nbsp($string) {
|
|
if (strlen((string)$string))
|
|
return $string;
|
|
else
|
|
return ' ';
|
|
}
|
|
}
|
|
?>
|