<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
 * Code Igniter
 *
 * An open source application development framework for PHP 4.3.2 or newer
 *
 * @package		CodeIgniter
 * @author		Rick Ellis
 * @copyright	Copyright (c) 2006, pMachine, Inc.
 * @license		http://www.codeignitor.com/user_guide/license.html
 * @link		http://www.codeigniter.com
 * @since		Version 1.0
 * @filesource
 */

// ------------------------------------------------------------------------

/**
 * Code Igniter Smiley Helpers
 *
 * @package		CodeIgniter
 * @subpackage	Helpers
 * @category	Helpers
 * @author		Rick Ellis
 * @link		http://www.codeigniter.com/user_guide/helpers/download_helper.html
 */

// ------------------------------------------------------------------------

/**
 * JS Insert Smiley
 *
 * Generates the javascrip function needed to insert smileys into a form field
 *
 * @access	public
 * @param	string	form name
 * @param	string	field name
 * @return	string
 */	
function js_insert_smiley($form_name = '', $form_field = '')
{
return <<<EOF
<script type="text/javascript">
	function insert_smiley(smiley)
	{
		document.{$form_name}.{$form_field}.value += " " + smiley;
	}
</script>
EOF;
}	

// ------------------------------------------------------------------------

/**
 * Get Clickable Smileys
 *
 * Returns an array of image tag links that can be clicked to be inserted 
 * into a form field.  
 *
 * @access	public
 * @param	string	the URL to the folder containing the smiley images
 * @return	array
 */	
function get_clickable_smileys($image_url = '')
{
	if (FALSE === ($smileys = _get_smiley_array()))
	{
		return array();
	}  

	// Add a trailing slash to the file path if needed
	$image_url = preg_replace("/(.+?)\/*$/", "\\1/",  $image_url);
	
	$used = array();
	foreach ($smileys as $key => $val)
	{
		// Keep duplicates from being used, which can happen if the
		// mapping array contains multiple identical replacements.  For example:
		// :-) and :) might be replaced with the same image so both smileys
		// will be in the array.
		if (isset($used[$smileys[$key]['0']]))
		{
			continue;
		}
	
		$link[] = "<a href=\"javascript:void(0);\" onClick=\"insert_smiley('".$key."')\"><img src=\"".$image_url.$smileys[$key]['0']."\" width=\"".$smileys[$key]['1']."\" height=\"".$smileys[$key]['2']."\" alt=\"".$smileys[$key]['3']."\" style=\"border:0;\" /></a>";	
	
		$used[$smileys[$key]['0']] = TRUE;
	}
	
	return $link;
}

// ------------------------------------------------------------------------

/**
 * Parse Smileys
 *
 * Takes a string as input and swaps any contained smileys for the actual image
 *
 * @access	public
 * @param	string	the text to be parsed
 * @param	string	the URL to the folder containing the smiley images
 * @return	string
 */	
function parse_smileys($str, $image_url)
{
	if (FALSE === ($smileys = _get_smiley_array()))
	{
		return $str;
	}        

	// Add a trailing slash to the file path if needed
	$image_url = preg_replace("/(.+?)\/*$/", "\\1/",  $image_url);

	foreach ($smileys as $key => $val)
	{        
		$str = str_replace($key, "<img src=\"".$image_url.$smileys[$key]['0']."\" width=\"".$smileys[$key]['1']."\" height=\"".$smileys[$key]['2']."\" alt=\"".$smileys[$key]['3']."\" style=\"border:0;\" />", $str);
	}
	
	return $str;
}

// ------------------------------------------------------------------------

/**
 * Get Smiley Array
 *
 * Fetches the config/smiley.php file
 *
 * @access	private
 * @return	mixed
 */	
function _get_smiley_array()
{
	if ( ! file_exists(APPPATH.'config/smileys'.EXT))
	{
		return FALSE;
	}

	include_once(APPPATH.'config/smileys'.EXT);
	
	if ( ! isset($smileys) OR ! is_array($smileys))
	{
		return FALSE;
	}
	
	return $smileys;
}




?>