本文整理汇总了PHP中WYSIJA::get_version方法的典型用法代码示例。如果您正苦于以下问题:PHP WYSIJA::get_version方法的具体用法?PHP WYSIJA::get_version怎么用?PHP WYSIJA::get_version使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WYSIJA
的用法示例。
在下文中一共展示了WYSIJA::get_version方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDomainStats
function getDomainStats()
{
$data = array();
$modelConfig =& WYSIJA::get('config', 'model');
$url = admin_url('admin.php');
$helperToolbox =& WYSIJA::get('toolbox', 'helper');
$data['domain_name'] = $helperToolbox->_make_domain_name($url);
$data['url'] = $url;
$data[uniqid()] = uniqid('WYSIJA');
$data['installed'] = $modelConfig->getValue('installed_time');
$data['contacts'] = $modelConfig->getValue('emails_notified');
$data['wysijaversion'] = WYSIJA::get_version();
$data['WPversion'] = get_bloginfo('version');
$data['sending_method'] = $modelConfig->getValue('sending_method');
if ($data['sending_method'] == 'smtp') {
$data['smtp_host'] = $modelConfig->getValue('smtp_host');
}
$modelList =& WYSIJA::get('list', 'model');
$data['number_list'] = $modelList->count();
$modelNL =& WYSIJA::get('email', 'model');
$data['number_sent_nl'] = $modelNL->count(array('status' => 2));
$data['number_sub'] = $modelConfig->getValue('total_subscribers');
$data['optin_status'] = $modelConfig->getValue('confirm_dbleoptin');
$data['list_plugins'] = unserialize(get_option('active_plugins'));
$data = base64_encode(serialize($data));
return $data;
}
示例2: wrap
function wrap($content)
{
$html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://gmpg.org/xfn/11">
<meta name="robots" content="NOINDEX,NOFOLLOW">
<meta charset="utf-8" />
<title>' . __('Wysija Subscription', WYSIJA) . '</title>';
global $wp_scripts, $wp_styles;
ob_start();
wp_print_scripts('jquery');
wp_print_styles('validate-engine-css');
if (isset($_REQUEST['external_site'])) {
$iframeJsUrl = $iframeCssUrl = false;
//check if an iframe.css file exists in the site uploads/wysija/css/iframe.css or in MS blogs.dir/5/files/wysija/css/iframe.css
if (file_exists(WYSIJA_UPLOADS_DIR . 'css' . DS . 'iframe.css')) {
$iframeCssUrl = WYSIJA_UPLOADS_URL . 'css/iframe.css';
} else {
//if we are in a multisite check to see if there is a file defined in the main site
if (is_multisite() && file_exists(WYSIJA_UPLOADS_MS_DIR . 'css' . DS . 'iframe.css')) {
$iframeCssUrl = WYSIJA_UPLOADS_MS_URL . 'css/iframe.css';
}
}
$iframeCssUrl = apply_filters('wysija_iframe_css_url', $iframeCssUrl);
//check if an iframe.js file exists in the site uploads/wysija/js/iframe.js or in MS blogs.dir/5/files/wysija/js/iframe.js
if (file_exists(WYSIJA_UPLOADS_DIR . 'js' . DS . 'iframe.js')) {
$iframeJsUrl = WYSIJA_UPLOADS_URL . 'js/iframe.js';
} else {
//if we are in a multisite check to see if there is a file defined in the main site
if (is_multisite() && file_exists(WYSIJA_UPLOADS_MS_DIR . 'js' . DS . 'iframe.js')) {
$iframeJsUrl = WYSIJA_UPLOADS_MS_URL . 'js/iframe.js';
}
}
$iframeJsUrl = apply_filters('wysija_iframe_js_url', $iframeJsUrl);
//if an iframe file has been detected then load it
if ($iframeCssUrl) {
wp_register_style('wysija-iframe-css', $iframeCssUrl, array(), WYSIJA::get_version());
wp_print_styles('wysija-iframe-css');
}
//if an iframe js file has been detected then load it
if ($iframeJsUrl) {
wp_register_style('wysija-iframe-js', $iframeJsUrl, array(), WYSIJA::get_version());
wp_print_styles('wysija-iframe-js');
}
}
wp_print_scripts('wysija-validator-lang');
wp_print_scripts('wysija-validator');
wp_print_scripts('wysija-front-subscribers');
$html .= ob_get_contents();
ob_end_clean();
$html .= '</head><body>';
if (isset($_REQUEST['external_site'])) {
$classform = '';
} else {
$classform = ' iframe-hidden';
}
$html .= '<div class="wysija-frame' . $classform . '" >' . $content . '</div>';
$html .= '</body></html>';
return $html;
}
示例3: wrap
function wrap($content)
{
$html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://gmpg.org/xfn/11">
<meta name="robots" content="NOINDEX,NOFOLLOW">
<meta charset="utf-8" />
<title>' . __('Wysija Subscription', WYSIJA) . '</title>';
global $wp_scripts, $wp_styles;
ob_start();
//if(isset($_REQUEST['external_site'])) wp_head();
wp_print_scripts('jquery');
wp_print_styles('validate-engine-css');
//add custom css for external site iframe
if (isset($_REQUEST['external_site']) && file_exists(WYSIJA_UPLOADS_DIR . 'css' . DS . 'iframe.css')) {
wp_register_style('wysija-iframe', WYSIJA_UPLOADS_URL . "css/iframe.css", array(), WYSIJA::get_version());
wp_print_styles('wysija-iframe');
}
wp_print_scripts('wysija-validator-lang');
wp_print_scripts('wysija-validator');
wp_print_scripts('wysija-front-subscribers');
$html .= ob_get_contents();
ob_end_clean();
$html .= '</head><body>';
if (isset($_REQUEST['external_site'])) {
$classform = '';
} else {
$classform = ' iframe-hidden';
}
$html .= '<div class="wysija-frame' . $classform . '" >' . $content . '</div>';
$html .= '</body></html>';
return $html;
}
示例4: main
function main()
{
parent::WYSIJA_control_back();
$this->js[] = 'jquery-ui-tabs';
$this->js[] = 'wysija-admin-ajax';
$this->js[] = 'thickbox';
$this->js[] = 'wysija-validator';
wp_enqueue_style('thickbox');
wp_enqueue_style('wysija-admin-edit-tb', WYSIJA_URL . 'css/admin-editor-forms.css', array(), WYSIJA::get_version());
wp_enqueue_script('wysija-admin-edit-forms', WYSIJA_URL . 'js/admin-editor-forms.js', array('jquery'), WYSIJA::get_version());
if (!isset($_REQUEST['action'])) {
$this->action = 'main';
} else {
$this->action = $_REQUEST['action'];
}
$localaction = $this->action;
switch ($localaction) {
case 'log':
case 'save':
case 'clearlog':
return $this->{$localaction}();
break;
case "reinstall":
$this->reinstall();
//if(defined('WYSIJA_REDIRECT')) $this->redirectProcess();
return;
break;
case 'dkimcheck':
$this->dkimcheck();
if (defined('WYSIJA_REDIRECT')) {
$this->redirectProcess();
}
return;
break;
case "doreinstall":
$this->doreinstall();
if (defined('WYSIJA_REDIRECT')) {
global $wysi_location;
$wysi_location = 'admin.php?page=wysija_campaigns';
$this->redirectProcess();
}
return;
break;
}
if (WYSIJA_DBG > 1) {
$this->viewObj->arrayMenus = array('log' => 'View log');
}
$this->data = array();
$this->action = "main";
$this->jsTrans["testemail"] = __("Sending a test email", WYSIJA);
$this->jsTrans["bounceconnect"] = __("Bounce handling connection test", WYSIJA);
$this->jsTrans["processbounceT"] = __("Bounce handling processing", WYSIJA);
$this->jsTrans["doubleoptinon"] = __("Subscribers will now need to activate their subscription by email in order to receive your newsletters. This is recommended.", WYSIJA);
$this->jsTrans["doubleoptinoff"] = __("Unconfirmed subscribers will receive your newslettters from now on without the need to activate their subscriptions.", WYSIJA);
$this->jsTrans["processbounce"] = __("Process bounce handling now!", WYSIJA);
$this->jsTrans["errorbounceforward"] = __("When setting up the bounce system, you need to have a different address for the bounce email and the forward to address", WYSIJA);
if (isset($_REQUEST['validate'])) {
$this->notice(str_replace(array('[link]', '[/link]'), array('<a title="' . __('Get Premium now', WYSIJA) . '" class="premium-tab" href="javascript:;">', '</a>'), __('You\'re almost there. Click this [link]link[/link] to activate the licence you have just purchased.', WYSIJA)));
}
}
示例5: defaultDisplay
public function defaultDisplay()
{
if (!WYSIJA::current_user_can('wysija_stats_dashboard')) {
die('Action is forbidden.');
}
$this->pre_defined_dates = $this->get_pre_defined_dates();
// Define view
$this->viewShow = $this->action = 'main';
$this->js['jquery.core'] = 'jquery/ui/jquery.ui.core';
$this->js['jquery.datepicker'] = 'jquery/ui/jquery.ui.datepicker';
$this->js['wysijalazyload'] = 'wysija-lazyload';
$this->js['admin-statistics-filter'] = 'admin-statistics-filter';
wp_enqueue_style('jquery.core', WYSIJA_URL . 'css/jquery/ui/themes/base/jquery.ui.core.min.css', array(), WYSIJA::get_version());
wp_enqueue_style('jquery.core', WYSIJA_URL . 'css/jquery/ui/themes/base/jquery.ui.theme.min.css', array(), WYSIJA::get_version());
// date filter
$default_duration = $this->get_default_duration();
if (function_exists('date_diff')) {
$this->data['date_interval'] = date_diff(date_create($default_duration->from), date_create($default_duration->to));
} else {
$duration = strtotime($default_duration->to) - strtotime($default_duration->from);
$helper_toolbox = WYSIJA::get('toolbox', 'helper');
$this->data['date_interval'] = (object) $helper_toolbox->convert_seconds_to_array($duration, false);
}
$this->data['custom_dates'] = $this->pre_defined_dates;
$this->data['default_duration'] = $default_duration;
$this->data['js_date_format'] = $this->js_date_format;
// Process and push data into view
$this->data['lazy_load'] = $this->lazy_load;
$hook_name = 'hook_stats';
$hook_params = array();
$hook_params['top'] = WYSIJA_module_statistics::DEFAULT_TOP_RECORDS;
$hook_params['from'] = !empty($_REQUEST['filter']['from']) ? $_REQUEST['filter']['from'] : $default_duration->from;
$hook_params['to'] = !empty($_REQUEST['filter']['to']) ? $_REQUEST['filter']['to'] : $default_duration->to;
$hook_params['group_by'] = $this->data['date_interval']->days == 0 || $this->data['date_interval']->days > WYSIJA_module_statistics::SWITCHING_DATE_TO_MONTH_THRESHOLD ? WYSIJA_module_statistics::GROUP_BY_MONTH : WYSIJA_module_statistics::GROUP_BY_DATE;
// $this->data['date_interval']->days == 0, means, no begin date, no end date
// Hack!
$_REQUEST['limit_pp'] = $hook_params['top'];
// Pagination, mark current selected value
// Modify TO date to make sure we always count 23:59:59 of that day
$to = new DateTime($hook_params['to']);
$to->modify('+1 day');
$hook_params['to'] = $to->format($this->date_format);
$modules = WYSIJA_module::get_modules_from_hook($hook_name);
$this->data['modules'] = $modules;
$this->data['lazy_load_modules'] = array();
$this->data['first_module'] = '';
if (!$this->lazy_load) {
$this->data['hooks'][$hook_name] = apply_filters('hook_stats', '', $hook_params);
} else {
if (!empty($modules)) {
$first_module = array_shift($modules);
// List of lazy loaded modules
$this->data['lazy_load_modules'] = $modules;
// Evenly we are lazy loading, we always load the first module by default
$this->data['first_module'] = apply_filters('custom_module_hook', '', $first_module, $hook_name, $hook_params);
}
}
}
示例6: generate_data
/**
* Generate fresh data and store it in the $analytics_data Class property.
* @return
*/
public function generate_data()
{
$this->analytics_data['monthly_emails_sent'] = $this->get_monthly_emails_sent();
$this->analytics_data['lists_with_more_than_25'] = $this->get_lists_with_more_than_25();
$this->analytics_data['confirmed_subscribers'] = $this->get_confirmed_subscribers();
$this->analytics_data['unconfirmed_subscribers'] = $this->get_unconfirmed_subscribers();
$this->analytics_data['standard_newsletters'] = $this->get_standard_newsletters();
$this->analytics_data['auto_newsletters'] = $this->get_auto_newsletters();
$this->analytics_data['wordpress_version'] = get_bloginfo('version');
$this->analytics_data['plugin_version'] = WYSIJA::get_version();
$this->analytics_data['license_type'] = $this->get_license_type();
$this->analytics_data['sending_method'] = $this->get_sending_method();
$this->analytics_data['smtp_hostname'] = $this->get_smtp_hostname();
$this->analytics_data['activation_email_status'] = $this->get_activation_email_status();
$this->analytics_data['average_open_rate'] = $this->get_average_open_rate();
$this->analytics_data['average_click_rate'] = $this->get_average_click_rate();
$this->analytics_data['industry'] = $this->get_industry();
$this->analytics_data['wordpress_language'] = get_bloginfo('language');
$this->analytics_data['rtl'] = $this->get_rtl();
}
示例7: install
function install()
{
$values = array();
if (!$this->testSystem()) {
return false;
}
if (!$this->createTables()) {
return false;
}
$this->moveData('themes');
$this->moveData('dividers');
$this->moveData('bookmarks');
$this->recordDefaultUserField();
$this->defaultSettings($values);
$this->defaultList($values);
$this->defaultCampaign($values);
$helpImport =& WYSIJA::get("import", "helper");
$values['importwp_list_id'] = $helpImport->importWP();
$this->createPage($values);
$this->createWYSIJAdir($values);
$modelConf =& WYSIJA::get("config", "model");
$mailModel =& WYSIJA::get("email", "model");
$mailModel->blockMe = true;
$values["confirm_email_id"] = $mailModel->insert(array("type" => "0", "from_email" => $values["from_email"], "from_name" => $values["from_name"], "replyto_email" => $values["from_email"], "replyto_name" => $values["from_name"], "subject" => $modelConf->getValue("confirm_email_title"), "body" => $modelConf->getValue("confirm_email_body"), "status" => 99));
$values['installed'] = true;
$values['installed_time'] = time();
$values['wysija_db_version'] = WYSIJA::get_version();
$wptoolboxs =& WYSIJA::get('toolbox', 'helper');
$values['dkim_domain'] = $wptoolboxs->_make_domain_name();
$modelConf->save($values);
$this->testNLplugins();
$this->wp_notice(str_replace(array('[link]', '[/link]'), array('<a href="admin.php?page=wysija_config">', '</a>'), __("Wysija has been installed successfully. Go to the [link]settings page[/link] now, and start blasting emails.", WYSIJA)));
$wptools =& WYSIJA::get('wp_tools', 'helper');
$wptools->set_default_rolecaps();
global $wysija_installing;
$wysija_installing = false;
return true;
}
示例8: whats_new
function whats_new($data)
{
?>
<div class="wrap about-wrap">
<h1><?php
echo sprintf(__('Welcome to Wysija %1$s', WYSIJA), WYSIJA::get_version());
?>
</h1>
<div class="about-text"><?php
echo $data['abouttext'];
?>
</div>
<div id="wysija-badge"><?php
_e('Version', WYSIJA);
?>
<?php
echo WYSIJA::get_version();
?>
</div>
<?php
foreach ($data['sections'] as $section) {
?>
<div class="changelog">
<h3><?php
echo $section['title'];
?>
</h3>
<div class="feature-section <?php
echo $section['format'];
?>
">
<?php
switch ($section['format']) {
case 'three-col':
foreach ($section['cols'] as $col) {
?>
<div>
<h4><?php
echo $col['title'];
?>
</h4>
<p><?php
echo $col['content'];
?>
</p>
</div>
<?php
}
break;
case 'bullets':
echo '<ul>';
foreach ($section['paragraphs'] as $line) {
?>
<li><?php
echo $line;
?>
</li>
<?php
}
echo '</ul>';
break;
case 'review-follow':
$class_review_kitten = ' small';
$count_title = count(str_split($section['review']['title']));
$count_content = count(str_split($section['review']['content']));
if ($count_title > 40 || $count_content > 340) {
$class_review_kitten = ' medium';
}
if ($count_title > 50 || $count_content > 400) {
$class_review_kitten = ' large';
}
echo '<div id="review-follow">';
echo '<div class="review-left' . $class_review_kitten . '">';
echo '<div class="description"><h4>' . $section['review']['title'] . '</h4>';
echo '<p>' . $section['review']['content'] . '</p></div>';
echo '<a title="On wordpress.org" target="_blank" class="link-cat-review" href="http://wordpress.org/support/view/plugin-reviews/wysija-newsletters"> </a></div>';
echo '<div class="review-right">';
echo '</div>';
echo '<div class="follow-left' . $class_review_kitten . '">';
echo '<div class="description" ><h4>' . $section['follow']['title'] . '</h4>';
echo '<div class="socials">' . $section['follow']['content'] . '</div></div>';
echo '</div>';
echo '<div class="follow-right">';
echo '</div>';
echo '</div>';
break;
default:
foreach ($section['paragraphs'] as $line) {
?>
<p><?php
echo $line;
?>
</p>
<?php
}
}
//.........这里部分代码省略.........
示例9: update_footer
function update_footer($text)
{
$screen = get_current_screen();
if (strpos($screen->base, 'wysija') === false) {
return $text;
}
$title = esc_attr(WYSIJA::is_beta() ? __('Revert to stable', WYSIJA) : __('Switch to beta', WYSIJA));
$warn_message = esc_attr(WYSIJA::is_beta() ? __('Confirm going back to the stable version?', WYSIJA) : __('Great! But the beta version might be buggy, and we expect you to report any bugs. Confirm to installing the Beta version?', WYSIJA));
$args = array('page' => 'wysija_config', 'action' => 'packager-switch', '_wpnonce' => wp_create_nonce('packager-switch'));
if (WYSIJA::is_beta()) {
$args["stable"] = 1;
}
$switch_link = esc_attr(add_query_arg($args, admin_url('admin.php')));
$switch_text = esc_attr(WYSIJA::is_beta() ? __('Revert to Stable', WYSIJA) : __('Switch to Beta', WYSIJA));
$version_link = esc_url(add_query_arg(array('page' => 'wysija_campaigns', 'action' => 'whats_new'), admin_url('admin.php')));
$premium = false;
if (is_plugin_active('wysija-newsletters-premium/index.php')) {
$premium = WYSIJA::get_version('wysija-newsletters-premium/index.php');
}
return (is_multisite() && WYSIJA::current_user_can('manage_network') || !is_multisite() && WYSIJA::current_user_can('switch_themes') ? "<span class='wrap'>" . "<a id='switch_to_package' href='{$switch_link}' title='{$title}' data-warn='{$warn_message}' class='add-new-h2'>{$switch_text}</a>" . (WYSIJA::is_beta() ? "<a target='_blank' class='add-new-h2' href='http://support.mailpoet.com/feedback/?utm_source=wpadmin&utm_campaign=contact_beta'>" . __('Report Bugs', WYSIJA) . "</a>" : "") . "</span>" : "") . "</p>" . "<p class='alignright'>" . __("MailPoet Version", WYSIJA) . ": <a href='{$version_link}'>" . esc_attr(WYSIJA::get_version()) . "</a>" . ($premium ? " | " . __("Premium", WYSIJA) . ": " . esc_attr($premium) . "</a>" : "");
}
示例10: version
function version()
{
$wysijaversion = '<div class="wysija-version">';
$wysijaversion .= '<div class="social-foot">';
$wysijaversion .= '<div id="upperfoot"><div class="support"><a target="_blank" href="http://support.wysija.com/?utm_source=wpadmin&utm_campaign=footer" >' . __('Support & documentation', WYSIJA) . '</a> | <a target="_blank" href="http://wysija.uservoice.com/forums/150107-feature-request" >' . __('Request feature', WYSIJA) . '</a> | ';
$wysijaversion .= str_replace(array('[stars]', '[link]', '[/link]'), array('<a target="_blank" href="http://wordpress.org/support/view/plugin-reviews/wysija-newsletters" >★★★★★</a>', '<a target="_blank" href="http://wordpress.org/support/view/plugin-reviews/wysija-newsletters" >', '</a>'), __('Add your [stars] on [link]wordpress.org[/link] and keep this plugin essentially free.', WYSIJA));
$wysijaversion .= '<div class="version">' . __('Wysija Version: ', WYSIJA) . '<a href="admin.php?page=wysija_campaigns&action=whats_new">' . WYSIJA::get_version() . '</a></div></div>';
$wysijaversion .= '</div></div>';
echo $wysijaversion;
}
示例11: export
public function export($form_id, $type)
{
switch ($type) {
case 'iframe':
$url_params = array('wysija-page' => 1, 'controller' => 'subscribers', 'action' => 'wysija_outter', 'wysija_form' => $form_id);
$url_params['external_site'] = 1;
$model_config = WYSIJA::get('config', 'model');
$source_url = WYSIJA::get_permalink($model_config->getValue('confirm_email_link'), $url_params, true);
return '<iframe width="100%" scrolling="no" frameborder="0" src="' . $source_url . '" class="iframe-wysija" vspace="0" tabindex="0" style="position: static; top: 0pt; margin: 0px; border-style: none; height: 330px; left: 0pt; visibility: visible;" marginwidth="0" marginheight="0" hspace="0" allowtransparency="true" title="' . __('Subscription Wysija', WYSIJA) . '"></iframe>';
break;
case 'php':
$output = array('$widgetNL = new WYSIJA_NL_Widget(true);', 'echo $widgetNL->widget(array(\'form\' => ' . (int) $form_id . ', \'form_type\' => \'php\'));');
return join("\n", $output);
break;
case 'html':
//need some language for the validation
$helper_toolbox = WYSIJA::get('toolbox', 'helper');
$wp_language_code = $helper_toolbox->get_language_code();
$wysija_version = WYSIJA::get_version();
$scripts_to_include = '<!--START Scripts : this is the script part you can add to the header of your theme-->' . "\n";
$scripts_to_include .= '<script type="text/javascript" src="' . includes_url() . 'js/jquery/jquery.js' . '?ver=' . $wysija_version . '"></script>' . "\n";
if (file_exists(WYSIJA_DIR . 'js' . DS . 'validate' . DS . 'languages' . DS . 'jquery.validationEngine-' . $wp_language_code . '.js')) {
$scripts_to_include .= '<script type="text/javascript" src="' . WYSIJA_URL . 'js/validate/languages/jquery.validationEngine-' . $wp_language_code . '.js' . '?ver=' . $wysija_version . '"></script>' . "\n";
} else {
$scripts_to_include .= '<script type="text/javascript" src="' . WYSIJA_URL . 'js/validate/languages/jquery.validationEngine-en.js' . '?ver=' . $wysija_version . '"></script>' . "\n";
}
$scripts_to_include .= '<script type="text/javascript" src="' . WYSIJA_URL . 'js/validate/jquery.validationEngine.js' . '?ver=' . $wysija_version . '"></script>' . "\n";
$scripts_to_include .= '<script type="text/javascript" src="' . WYSIJA_URL . 'js/front-subscribers.js' . '?ver=' . $wysija_version . '"></script>' . "\n";
$scripts_to_include .= '<script type="text/javascript">
/* <![CDATA[ */
var wysijaAJAX = {"action":"wysija_ajax","controller":"subscribers","ajaxurl":"' . admin_url('admin-ajax.php', 'absolute') . '","loadingTrans":"' . __('Loading...', WYSIJA) . '"};
/* ]]> */
</script>';
$scripts_to_include .= '<script type="text/javascript" src="' . WYSIJA_URL . 'js/front-subscribers.js?ver=' . $wysija_version . '"></script>' . "\n";
$scripts_to_include .= '<!--END Scripts-->' . "\n" . "\n";
//enqueue the scripts
$html_result = $scripts_to_include;
// add the html for the form
$widget_NL = new WYSIJA_NL_Widget(true);
$html_result .= $widget_NL->widget(array('form' => (int) $form_id, 'form_type' => 'html'));
return $html_result;
break;
case 'shortcode':
return '[wysija_form id="' . (int) $form_id . '"]';
break;
}
}
示例12: update_footer
function update_footer($text)
{
$screen = get_current_screen();
if (strpos($screen->base, 'wysija') === false) {
return $text;
}
$version_link = esc_url(add_query_arg(array('page' => 'wysija_campaigns', 'action' => 'whats_new'), admin_url('admin.php')));
$version_string = "</p>" . "<p class='alignright'>" . __("MailPoet Version", WYSIJA) . ": <a href='{$version_link}'>" . esc_attr(WYSIJA::get_version()) . "</a>";
$version_string = apply_filters('mailpoet_back_footer', $version_string);
return $version_string;
}
示例13: defaultCampaign
function defaultCampaign($valuesconfig)
{
$modelCampaign =& WYSIJA::get('campaign', 'model');
$campaign_id = $modelCampaign->insert(array('name' => __('5 Minute User Guide', WYSIJA), 'description' => __('Default newsletter created automatically during installation.', WYSIJA)));
$modelEmail =& WYSIJA::get('email', 'model');
$modelEmail->fieldValid = false;
$dataEmail = array('campaign_id' => $campaign_id, 'subject' => __('5 Minute User Guide', WYSIJA));
$wjEngine =& WYSIJA::get('wj_engine', 'helper');
$hDividers =& WYSIJA::get('dividers', 'helper');
$defaultDivider = $hDividers->getDefault();
$hBookmarks =& WYSIJA::get('bookmarks', 'helper');
$bookmarks = $hBookmarks->getAllByIconset('medium', '02');
//--------------
$dataEmail['wj_data'] = array('version' => WYSIJA::get_version(), 'header' => array('text' => null, 'image' => array('src' => WYSIJA_EDITOR_IMG . 'default-newsletter/newsletter/header.png', 'width' => 600, 'height' => 72, 'alignment' => 'center', 'static' => false), 'alignment' => 'center', 'static' => false, 'type' => 'header'), 'body' => array('block-1' => array('text' => array('value' => '<h2><strong>' . __('Step 1:', WYSIJA) . '</strong> ' . __('hey, click on this text!', WYSIJA) . '</h2>' . '<p>' . __('To edit, simply click on this block of text.', WYSIJA) . '</p>'), 'image' => null, 'alignment' => 'left', 'static' => false, 'position' => 1, 'type' => 'content'), 'block-2' => array_merge(array('position' => 2, 'type' => 'divider'), $defaultDivider), 'block-3' => array('text' => array('value' => '<h2><strong>' . __('Step 2:', WYSIJA) . '</strong> ' . __('play with this image', WYSIJA) . '</h2>'), 'image' => null, 'alignment' => 'left', 'static' => false, 'position' => 3, 'type' => 'content'), 'block-4' => array('text' => array('value' => '<p>' . __('Position your mouse over the image to the left.', WYSIJA) . '</p>'), 'image' => array('src' => WYSIJA_EDITOR_IMG . 'default-newsletter/newsletter/pigeon.png', 'width' => 281, 'height' => 190, 'alignment' => 'left', 'static' => false), 'alignment' => 'left', 'static' => false, 'position' => 4, 'type' => 'content'), 'block-5' => array_merge(array('position' => 5, 'type' => 'divider'), $defaultDivider), 'block-6' => array('text' => array('value' => '<h2><strong>' . __('Step 3:', WYSIJA) . '</strong> ' . __('drop content here', WYSIJA) . '</h2>' . '<p>' . sprintf(__('Drag and drop %1$stext, posts, dividers.%2$s Look on the right!', WYSIJA), '<strong>', '</strong>') . '</p>' . '<p>' . sprintf(__('You can even %1$ssocial bookmarks%2$s like these:', WYSIJA), '<strong>', '</strong>') . '</p>'), 'image' => null, 'alignment' => 'left', 'static' => false, 'position' => 6, 'type' => 'content'), 'block-7' => array('width' => 184, 'alignment' => 'center', 'items' => array(array_merge(array('url' => 'http://www.facebook.com/wysija', 'alt' => 'Facebook', 'cellWidth' => 61, 'cellHeight' => 32), $bookmarks['facebook']), array_merge(array('url' => 'http://www.twitter.com/wysija', 'alt' => 'Twitter', 'cellWidth' => 61, 'cellHeight' => 32), $bookmarks['twitter']), array_merge(array('url' => 'https://plus.google.com/104749849451537343615', 'alt' => 'Google', 'cellWidth' => 61, 'cellHeight' => 32), $bookmarks['google'])), 'position' => 7, 'type' => 'gallery'), 'block-8' => array_merge(array('position' => 8, 'type' => 'divider'), $defaultDivider), 'block-9' => array('text' => array('value' => '<h2><strong>' . __('Step 4:', WYSIJA) . '</strong> ' . __('and the footer?', WYSIJA) . '</h2>' . '<p>' . sprintf(__('Change the footer\'s content in Wysija\'s %1$sSettings%2$s page.', WYSIJA), '<strong>', '</strong>') . '</p>'), 'image' => null, 'alignment' => 'left', 'static' => false, 'position' => 9, 'type' => 'content')), 'footer' => array('text' => NULL, 'image' => array('src' => WYSIJA_EDITOR_IMG . 'default-newsletter/newsletter/footer.png', 'width' => 600, 'height' => 46, 'alignment' => 'center', 'static' => false), 'alignment' => 'center', 'static' => false, 'type' => 'footer'));
$dataEmail['wj_styles'] = array('html' => array('background' => 'e8e8e8'), 'header' => array('background' => 'e8e8e8'), 'body' => array('color' => '000000', 'family' => 'Arial', 'size' => 16, 'background' => 'ffffff'), 'footer' => array('background' => 'e8e8e8'), 'h1' => array('color' => '000000', 'family' => 'Trebuchet MS', 'size' => 40), 'h2' => array('color' => '424242', 'family' => 'Trebuchet MS', 'size' => 30), 'h3' => array('color' => '424242', 'family' => 'Trebuchet MS', 'size' => 24), 'a' => array('color' => '0000FF', 'underline' => false), 'unsubscribe' => array('color' => '000000'), 'viewbrowser' => array('color' => '000000', 'family' => 'Arial', 'size' => 12));
//---- END DEFAULT EMAIL ---------
foreach ($dataEmail['wj_data'] as $key => &$eachval) {
if ($key == "body") {
foreach ($eachval as &$realeachval) {
if (isset($realeachval['text']['value'])) {
$realeachval['text']['value'] = base64_encode($realeachval['text']['value']);
}
}
}
}
$dataEmail['params'] = array('quickselection' => array('wp-301' => array('identifier' => 'wp-301', 'width' => 281, 'height' => 190, 'url' => WYSIJA_EDITOR_IMG . 'default-newsletter/newsletter/pigeon.png', 'thumb_url' => WYSIJA_EDITOR_IMG . 'default-newsletter/newsletter/pigeon-150x150.png')));
$wjEngine =& WYSIJA::get('wj_engine', 'helper');
$wjEngine->setData($dataEmail['wj_data']);
$result = false;
$dataEmail['params'] = base64_encode(serialize($dataEmail['params']));
$dataEmail['wj_styles'] = base64_encode(serialize($dataEmail['wj_styles']));
$dataEmail['wj_data'] = base64_encode(serialize($dataEmail['wj_data']));
$dataEmail['replyto_name'] = $dataEmail['from_name'] = $valuesconfig['from_name'];
$dataEmail['replyto_email'] = $dataEmail['from_email'] = $valuesconfig['from_email'];
$data['email']['email_id'] = $modelEmail->insert($dataEmail);
$modelEmail =& WYSIJA::get('email', 'model');
$emailData = $modelEmail->getOne(array('wj_styles', 'subject', 'params', 'email_id'), array('email_id' => $data['email']['email_id']));
$wjEngine->setStyles($emailData['wj_styles'], true);
$values = array('wj_data' => $wjEngine->getEncoded('data'));
$values['body'] = $wjEngine->renderEmail($emailData);
$result = $modelEmail->update($values, array('email_id' => $data['email']['email_id']));
}
示例14: popupContent
function popupContent()
{
// remove auth check
remove_action('admin_enqueue_scripts', 'wp_auth_check_load');
// add popup css
wp_enqueue_style('custom_popup_css', WYSIJA_URL . 'css/adminPopup.css', array(), WYSIJA::get_version(), 'screen');
global $viewMedia;
$viewMedia = $this->viewObj;
$_GET['type'] = $_REQUEST['type'] = 'image';
$config = WYSIJA::get('config', 'model');
$_GET['post_id'] = $_REQUEST['post_id'] = $config->getValue('confirm_email_link');
$post_id = isset($_GET['post_id']) ? (int) $_GET['post_id'] : 0;
if (file_exists(ABSPATH . 'wp-admin' . DS . 'admin.php')) {
require_once ABSPATH . 'wp-admin' . DS . 'admin.php';
}
@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
add_filter('media_upload_tabs', array($this, '_addTab'));
if (!isset($this->iframeTabs)) {
//if wp version includes plupload then let's use it
if (version_compare(get_bloginfo('version'), '3.3.0') >= 0) {
$this->iframeTabs = array('special_new_wordp_upload' => __('Upload', WYSIJA));
} else {
$this->iframeTabs = array('special_wordp_upload' => __('Upload', WYSIJA));
}
$this->iframeTabs['special_wysija_browse'] = __('Newsletter Images', WYSIJA);
$this->iframeTabs['special_wordp_browse'] = __('WordPress Posts\' Images', WYSIJA);
foreach ($this->iframeTabs as $actionKey => $actionTitle) {
add_action('media_upload_' . $actionKey, array($this, $actionKey));
}
} else {
add_action('media_upload_standard', array($this, 'popupReturn'));
}
// upload type: image, video, file, ..?
if (isset($_GET['type'])) {
$type = strval($_GET['type']);
} else {
$type = apply_filters('media_upload_default_type', 'file');
}
// tab: gallery, library, or type-specific
if (isset($_GET['tab'])) {
$tab = strval($_GET['tab']);
} else {
$tab = 'special_wysija_browse';
}
$body_id = 'media-upload';
// let the action code decide how to handle the request
if ($tab == 'type' || $tab == 'type_url') {
//i'm not so sure we need that line
do_action("media_upload_{$type}");
} else {
if (strpos($tab, 'special_') !== false) {
do_action("media_upload_{$tab}");
} else {
do_action('media_upload_standard', $tab);
}
}
exit;
}
示例15: version
/**
*
*/
function version()
{
$wysija_footer_links = '<div class="wysija-version">';
$wysija_footer_links .= '<div class="social-foot">';
$link_start = ' | <a target="_blank" id="switch_to_package" href="admin.php?page=wysija_campaigns&action=switch_to_package&plugin=wysija-newsletters&_wpnonce=' . WYSIJA_view::secure(array('controller' => 'wysija_campaigns', 'action' => 'switch_to_package'), true);
if (WYSIJA::is_beta()) {
$beta_link = $link_start . '&stable=1" title="' . __('Switch back to stable', WYSIJA) . '">' . __('Switch back to stable', WYSIJA) . '</a>';
} else {
$beta_link = $link_start . '" title="' . __('Switch to beta', WYSIJA) . '">' . __('Switch to beta', WYSIJA) . '</a>';
}
if (is_multisite() && !WYSIJA::current_user_can('manage_network') || !is_multisite() && !WYSIJA::current_user_can('switch_themes')) {
$beta_link = '';
}
$wysija_footer_links .= '<div id="upperfoot"><div class="support"><a target="_blank" href="http://support.mailpoet.com/?utm_source=wpadmin&utm_campaign=footer" >' . __('Support', WYSIJA) . '</a>' . $beta_link;
add_filter('wysija_footer_add_stars', array($this, 'footer_add_stars'), 10);
$wysija_footer_links .= apply_filters('wysija_footer_add_stars', '');
$wysija_footer_links .= '<div class="version">' . __('Wysija Version: ', WYSIJA) . '<a href="admin.php?page=wysija_campaigns&action=whats_new">' . WYSIJA::get_version() . '</a></div></div>';
/*$config=WYSIJA::get('config','model');
$msg=$config->getValue('ignore_msgs');
if(!isset($msg['socialfoot'])){
$wysijaversion .= $this->controller->__get_social_buttons();
}*/
$wysija_footer_links .= '</div></div>';
echo $wysija_footer_links;
}