openrat-cms

OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs | README

Output.class.php (864B)


      1 <?php
      2 
      3 
      4 namespace template_engine;
      5 
      6 
      7 use cms\base\Configuration;
      8 use cms\base\Language;
      9 use util\Text;
     10 
     11 /**
     12  * A collection of methods, used by the templates.
     13  */
     14 class Output
     15 {
     16 	/**
     17 	 * Ersetzt alle Zeichen mit dem Ordinalwert > 127 mit einer HTML-Maskierung.
     18 	 *
     19 	 * @return String
     20 	 */
     21 	public static function encodeHtml($text)
     22 	{
     23 		return Text::translateutf8tohtml($text);
     24 	}
     25 
     26 	public static function escapeHtml($text)
     27 	{
     28 		return Text::translateutf8tohtml(htmlentities($text));
     29 	}
     30 
     31 	/**
     32 	 * Gets a localized message
     33 	 * @param $key string message key
     34 	 * @return string
     35 	 */
     36 	public static function lang($key) {
     37 		return Language::lang($key);
     38 	}
     39 
     40 
     41 	/**
     42 	 * Gets a configuraton value.
     43 	 *
     44 	 * Delegating to the Configuration.
     45 	 *
     46 	 * @param $keys array
     47 	 * @return mixed
     48 	 */
     49 	public static function config( $keys ) {
     50 		return Configuration::get( $keys );
     51 	}
     52 }