<?php
/**
* @package XenCentral Ad Server
* @author Skydevelop EU
* @copyright Drnoyan & Nalyan LDA, Portugal, EU
* @license http://www.dnf.pt/eula.html
* @link http://www.skydevelop.com
* @revision 97
* @version 2.0.0 beta 3 rev. 3
*/

class XenCentral_AdServer_ViewAdmin_Attachment_DoUpload extends XFCP_XenCentral_AdServer_ViewAdmin_Attachment_DoUpload
{
    protected function _prepareAttachmentForJson(array $attachment)
    {
        $originalAttachment = $attachment;
        $attachment = parent::_prepareAttachmentForJson($attachment);

        if (XenForo_Application::isRegistered('requestZone')) {
            $attachment['templateHtml'] = $this->createTemplateObject(
                    'xcas_attachment_editor_attachment',
                    $attachment['templateHtml']->getParams() + array(
                            'width' => $originalAttachment['width'],
                            'height' => $originalAttachment['height'],
                            'zone' => XenForo_Application::get('requestZone')
                    )
            );
        }


        return $attachment;
    }
}