plugin-wonderful/views/PluginWonderfulViewMain.php

54 lines
1.4 KiB
PHP
Raw Permalink Normal View History

2009-06-30 01:52:36 +00:00
<?php
class PluginWonderfulViewMain {
2009-06-30 11:40:23 +00:00
function render() {
$this->_create_nonce();
$this->_get_first_adboxid();
$this->_render_memberid_settings();
$this->_render_adbox_information();
$this->_render_instructions();
}
2009-06-30 01:52:36 +00:00
function _create_nonce() {
$this->_pw_nonce = wp_create_nonce('plugin-wonderful');
}
2009-06-30 11:40:23 +00:00
function _get_first_adboxid() {
global $plugin_wonderful;
$this->first_adboxid = null;
2009-07-01 12:17:23 +00:00
if (!empty($plugin_wonderful->publisher_info)) {
2009-06-30 11:40:23 +00:00
foreach ($plugin_wonderful->publisher_info->adboxes as $adbox) {
if (empty($this->first_adboxid)) {
if (!empty($adbox->template_tag_id)) {
$this->first_adboxid = "'" . $adbox->template_tag_id . "'";
} else {
$this->first_adboxid = $adbox->adboxid;
}
break;
}
}
}
2009-07-01 12:17:23 +00:00
if (is_null($this->first_adboxid)) { $this->first_adboxid = '12345'; }
2009-06-30 11:40:23 +00:00
}
2009-06-30 01:52:36 +00:00
function _partial_path($name) {
2009-07-01 12:17:23 +00:00
return dirname(__FILE__) . '/PluginWonderfulViewMain/' . $name . '.inc';
2009-06-30 01:52:36 +00:00
}
function _render_memberid_settings() {
include($this->_partial_path('memberid-settings'));
}
2009-06-30 11:40:23 +00:00
function _render_adbox_information() {
global $plugin_wonderful;
include($this->_partial_path('adbox-information'));
}
function _render_instructions() {
global $plugin_wonderful;
include($this->_partial_path('instructions'));
}
2009-06-30 01:52:36 +00:00
}
?>