public function __construct($settings) { $this->domain = strtolower(_e_get_domain()); $this->root = self::get_root(); $this->config = $settings; $this->css_file = $this->get_css_file(); $this->mode = array_key_exists('production', $_GET) ? 'production' : 'development'; $this->languages = $settings['languages']; $this->inspect_dirs = array('images/', 'library/views/img/'); $this->social_image = $this->get_cdn_location() . 'facebook.gif'; $this->edmurl = 'http://www.aussiebum.com/edm/itempriceimage?'; $this->dev_edmurl = 'http://dev.local/edm/itempriceimage?'; $this->product_cache = array(); $this->cache_dir = realpath(dirname(__FILE__) . '/../_cache'); self::$instance = $this; }
protected function get_request() { $valid_params = array('lang', 'rev', 'reset', 'send', 'send_campaign', 'send_test', 'production', 'get_subscriber_count', 'update_send_time', 'update_cache', 'price', 'upload', 'split'); if (is_array($_GET)) { if (array_key_exists('campaignName', $_GET)) { echo $this->config['campaign_name_human_readable']; exit; } if (array_key_exists('campaignSubject', $_GET)) { $domain = isset($_GET['lang']) ? $_GET['lang'] : 'en'; echo _e(array('text' => 'title', 'section' => 'html_title', 'domain' => strtoupper($domain))); exit; } if (array_key_exists('campaignFolder', $_GET)) { $edm = new MC_edm($this->config); echo basename($edm->get_cdn_location()); exit; } if (array_key_exists('campaignSchedule', $_GET)) { $this->simple_campaign_table('EN', 'test'); } if (array_key_exists('lang', $_GET)) { $get_lang = strtoupper($_GET['lang']); if (in_array($get_lang, $this->config['languages'])) { $lang = i18n::get_instance(); $lang->set_domain($get_lang); } } else { $get_lang = 'EN'; } if (array_key_exists('rev', $_GET)) { $this->mc_edm = new MC_edm($this->config); $this->mc_edm->increment_all_image_filenames(); } if (array_key_exists('reset', $_GET)) { $this->mc_edm = new MC_edm($this->config); $this->mc_edm->reset_all_filenames(); } if (array_key_exists('send', $_GET)) { $lang = $get_lang ? $get_lang : 'EN'; $sendto = $_GET['send'] == '' ? 'test' : $_GET['send']; $this->create_campaign($lang, $sendto); } // if ( array_key_exists( 'test', $_GET ) ) { // $lang = $get_lang ? $get_lang : 'EN'; // $this->mc_edm = new MC_edm( $this->config ); // $html = $this->get_file( $this->host . "?lang={$lang}&production" ); // $this->mc_edm->send_test_mail( $html ); // } if (array_key_exists('get_subscriber_count', $_GET)) { $this->get_subscriber_count(); } if (array_key_exists('update_send_time', $_GET)) { $this->update_send_time(); } if (array_key_exists('send_campaign', $_GET)) { $this->send_campaign(); } if (array_key_exists('send_test', $_GET)) { $this->send_test(); } if (array_key_exists('update_cache', $_GET)) { $this->update_cache(); } if (array_key_exists('price', $_GET)) { $this->generate_prices(); } if (array_key_exists('upload', $_GET)) { $this->mc_edm = new MC_edm($this->config); $this->upload_image_dir(); } foreach ($_GET as $key => $value) { if (!in_array($key, $valid_params)) { echo 'EXIT - ' . $key . " is not a valid parameter\n"; exit; } } } }
<?php _e_set_section('ab_footer'); $mc_edm = MC_edm::get_instance(); ?> <tr> <td align="center" valign="top"> <table <?php inline_style('doubt_table', 'table'); ?> > <tr> <td <?php inline_style('doubt_font_td_right', 'td'); ?> > <?php echo $mc_edm->get_view('social'); ?> </td> </tr> </table> </td> </tr> <tr> <td align="center" valign="top"> <?php echo $mc_edm->get_view('benefits'); ?> </td> </tr>
/** * Create Price * Generates a <font> tag containing a localised price * Use with table() command as such: * array('font' => create_price($productId), 'width'=>$widthOfTableCell, 'valign' => 'middle', 'align' => 'center') */ function create_price($id, $passedDomain = false) { if (!$passedDomain) { $domain = get_price_domain(); } else { $domain = array('code' => $passedDomain); } $currecyStyle = inline_style('price_prefix_font', 'a', false); $price = get_dynamic_price(array('type' => 'text', 'id' => $id, 'currency' => $domain['code'])); $pricePrefix = MC_edm::php_supplant($domain['price'], array('sup' => "<font {{currencyprefix}}>", '/sup' => '</font>')); $pricePrefix = MC_edm::php_supplant($pricePrefix, array('currencyprefix' => $currecyStyle)); $super_style = inline_style('price_sup_font', 'a', false); return $price; }