<?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_ZoneAdd extends XenCentral_AdServer_ViewAdmin_ZoneBase
{
    public function renderHtml()
    {
        parent::renderHtml();

        $params = $this->getParams();

        $params['helperCriteriaUser'] = $this->createTemplateObject('helper_criteria_user', $params);
        $params['helperCriteriaUserDate'] = $this->createTemplateObject('helper_criteria_user_date', $params);
        $params['helperCriteriaPage'] = $this->createTemplateObject('helper_criteria_page', $params);
        $params['helperCriteriaUserField'] = $this->createTemplateObject('helper_criteria_user_field', $params);

        $params['userCriteria'] = $params['not_userCriteria'];
        $params['pageCriteria'] = $params['not_pageCriteria'];

        $params['not_helperCriteriaUser'] = $this->createTemplateObject('helper_criteria_user', $params);
        $params['not_helperCriteriaUserDate'] = $this->createTemplateObject('helper_criteria_user_date', $params);
        $params['not_helperCriteriaPage'] = $this->createTemplateObject('helper_criteria_page', $params);
        $params['not_helperCriteriaUserField'] = $this->createTemplateObject('helper_criteria_user_field', $params);

        $find= array('name="user_criteria[', 'id="', 'name="page_criteria[');
        $replace= array('name="user_criteria_not[', 'id="not_', 'name="page_criteria_not[');
        $params['not_helperCriteriaUser'] = str_replace(
                $find,
                $replace,
                $params['not_helperCriteriaUser']
        );
        $params['not_helperCriteriaUserDate'] = str_replace(
                $find,
                $replace,
                $params['not_helperCriteriaUserDate']
        );
        $params['not_helperCriteriaUserField'] = str_replace($find, $replace, $params['not_helperCriteriaUserField']);
        $params['not_helperCriteriaPage'] = str_replace($find, $replace, $params['not_helperCriteriaPage']);

        /*echo $params['not_helperCriteriaUser'];
        exit;*/

        $this->setParams($params);
    }
}