banner_id = $banner_id; $this->places = new adfoxlyPlaces(); $this->format = new adfoxlyFormats(); $this->image = new adfoxlyFormatImage(); $this->options = new adfoxlyAdOptions(); $this->group = new adfoxlyAdGroup(); $this->campaign = new adfoxlyAdCampaign(); $this->banners = new BannerController(); $this->settings_redirect = new adfoxlySettingsRedirect(); $this->settings_statistics = new adfoxlySettingsStatistics(); $this->places_settings = new adfoxlyPlacesSettings(); $this->groups_settings = new adfoxlyGroupsSettings(); $this->campaigns_settings = new adfoxlyCampaignsSettings(); $this->settings_pixel = new adfoxlySettingsPixel(); $this->settings_privacy = new adfoxlySettingsPrivacy(); $this->places_controller = new PlacesController(); if ( isset( $banner_id ) && !empty($banner_id) ) { // $this->banner = $banner->getBanner( $banner_id ); } } /** * @param array $arguments * * @return string */ public function generate( array $arguments = array() ) { if ( !empty($arguments) ) { foreach ( $arguments as $property => $argument ) { $this->{$property} = $argument; } if ( !empty($arguments['type']) ) { $output = ''; foreach ( $this->{$arguments['type']}->meta_fields as $meta_field ) { if ( !empty($arguments['banner_id']) ) { $bannerController = new BannerController(); $this->banner_data = $bannerController->getBanner( $this->banner_id ); } $output .= $this->generate_field( $meta_field ); } return $output; } } } /** * @param $meta_field * * @return string */ public function generate_field( $meta_field ) { $output = ''; if ( isset( $meta_field ) && isset( $meta_field['type'] ) ) { switch ( $meta_field['type'] ) { case $meta_field['type'] == "image_checkbox" || $meta_field['type'] == "image_radio": if ( isset( $meta_field ) && !empty($meta_field) && !empty($meta_field['options']) ) { foreach ( $meta_field['options'] as $key => $field ) { switch ( $meta_field['type'] ) { case "image_checkbox" || "image_radio": if ( $meta_field['type'] == 'image_checkbox' ) { $html_type = 'checkbox'; $design_type = 'check'; } else { if ( $meta_field['type'] == 'image_radio' ) { $html_type = 'radio'; $design_type = 'radio'; } } $output .= '