<?php 
defined('C5_EXECUTE') or die("Access Denied.");

/**
 * Pirate Speak text processor for UCP by John Liddiard (aka JohntheFish)
 * www.jlunderwater.co.uk, www.c5magic.co.uk
 * This software is licensed under the terms described in the concrete5.org marketplace.
 * Please find the add-on there for the latest license copy.
 */

if (!class_exists('UniversalContentPullerTextProcessorsPirateSpeak')){
$ucp_pkg  = Package::getByHandle('jl_universal_content_puller');
if (is_object($ucp_pkg)){
Loader::library('universal_content_puller/text_processor_plugin_base', 'jl_universal_content_puller');
class UniversalContentPullerTextProcessorsPirateSpeak extends UniversalContentPullerTextProcessorPluginBase {

	/*
	Pirate speak text processor for UCP
	*/

	public function getName(){
		return t('Pirate Speak');
	}

	public function getDescription(){
		return t('Translate text to pirate speak');
	}

	public function getHelp(){
		return t('Translate text to pirate speak using a selection of substitutions and insertions.');
	}

	public function edit($block, $data){
		ob_start();
		echo parent::edit($block, $data);
		$HTML = ob_get_contents();
		ob_end_clean();
		return $HTML;
	}

	public function translate($block, $text, $data){
		$psh = Loader::helper('pirate_speak', 'jl_pirate_speak');
		return $psh->yarr($text);
	}



}
}
}
