<?php

	require_once('include/asterisk/asterisk_inc.php');

	class ecmasterisk_popup_link extends asterisk_popup_link {
		
		function ecmasterisk_popup_link($type, $id, $height="330", $width="450") {
			parent::asterisk_popup_link($type, $id, $height, $width);
		}	
		
		function create_phone_link($phone_num, $icon = 'phone_icon.png', $show_number = true) {
		
			if($icon == null || $icon == '') 
				return "<a href='#' onclick='window.open(\"index.php?module=Contacts&action=AS_Popup&html=Dial&form=Dial&number=".$phone_num."&to_pdf=1&dialed=1&type=".$this->type."&record=".$this->record."\",\"Dialing\",\"width=".$this->popup_width.",height=".$this->popup_height.",resizable=0,scrollbars=1\")'>".($show_number ? $phone_num : '')."</a>";
			else
				return "<a href='#' onclick='window.open(\"index.php?module=Contacts&action=AS_Popup&html=Dial&form=Dial&number=".$phone_num."&to_pdf=1&dialed=1&type=".$this->type."&record=".$this->record."\",\"Dialing\",\"width=".$this->popup_width.",height=".$this->popup_height.",resizable=0,scrollbars=1\")'><img src=\"include/ECM/EcmFormatPhoneNumber/images/".$icon."\" border=0></a>".($show_number ? "<img src=\"include/ECM/EcmFormatPhoneNumber/images/spacer.png\" width=5 border=0>".$phone_num : '');
		}
		
	}

?>