This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/application/classes/lnApp/HeadImages.php

49 lines
1.2 KiB
PHP
Raw Normal View History

2010-11-29 22:41:08 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class is for all image icons shown on the page header.
*
* @package lnApp
* @subpackage Page
* @category Helpers
* @author Deon George
* @copyright (c) 2010 Deon George
* @license http://dev.leenooks.net/license.html
*/
2012-07-12 06:38:09 +00:00
abstract class lnApp_HeadImages extends HTMLRender {
2010-11-29 22:41:08 +00:00
protected static $_data = array();
protected static $_spacer = '&nbsp;';
2011-09-29 07:13:32 +00:00
protected static $_required_keys = array('img');
2010-11-29 22:41:08 +00:00
/**
* Return an instance of this class
*
* @return HeadImage
*/
public static function factory() {
return new HeadImages;
}
/**
* Render this Header Image
*
* @see HTMLRender::render()
*/
protected function render() {
$output = '';
$mediapath = Route::get(static::$_media_path);
foreach (static::$_data as $value) {
$i = HTML::image($mediapath->uri(array('file'=>$value['img'])),array('alt'=>isset($value['attrs']['title']) ? $value['attrs']['title'] : ''));
2011-09-29 07:13:32 +00:00
if (isset($value['url']))
2012-07-05 03:06:17 +00:00
$output .= HTML::anchor($value['url'],$i,(isset($value['attrs']) && is_array($value['attrs'])) ? $value['attrs'] : NULL);
2011-09-29 07:13:32 +00:00
else
$output .= $i;
2010-11-29 22:41:08 +00:00
$output .= static::$_spacer;
}
return $output;
}
}
?>