'Enable Debugging Output: ', 'debugging', 'checkbox' ); $this->add_section(array( 'name' => 'Plugin Info', 'description' => $this->get_broadcast(), 'auto' => false ) ); } } } /**------------------------------------ ** method: get_broadcast ** **/ function get_broadcast() { $content = ''; // HTTP Handler is not set fail the license check // if (isset($this->http_handler)) { if ($this->broadcast_url != '') { $result = $this->http_handler->request( $this->broadcast_url, array('timeout' => 3) ); if ($this->parent->http_result_is_ok($result) ) { return $result['body']; } } } // Return default content // if ($content == '') { return $this->default_broadcast(); } } /**------------------------------------ ** method: default_broadcast ** **/ function default_broadcast() { return '

This plugin has been brought to you by Charleston Software Associates

We develop desktop, mobile, and web applications for clients large and small from all around the world. We hope our plugin brings you closer to the perfect site. If there is anything we can do to improve our work or if you wish to hire us to customize this plugin please call our Charleston South Carolina headquarters or email us and let us know.

' ; } /**------------------------------------ ** method: add_section ** **/ function add_section($params) { if (!isset($this->sections[$params['name']])) { $this->sections[$params['name']] = new wpCSL_settings_section__mpcj( array_merge( $params, array('plugin_url' => $this->plugin_url, 'css_prefix' => $this->css_prefix, ) ) ); } } /**------------------------------------ ** method: get_item ** ** Return the value of a WordPress option that was saved via the settings interface. **/ function get_item($name, $default = null, $separator='-') { $option_name = $this->prefix . $separator . $name; if (!isset($this->$option_name)) { $this->$option_name = ($default == null) ? get_option($option_name) : get_option($option_name,$default) ; } return $this->$option_name; } /**------------------------------------ ** Class: WPCSL_Settings **------------------------------------ ** Method: add_item ** ** Parameters: ** section name ** display name, the label that shows before the input field ** name, the database key for the setting ** type (default: text, list, checkbox, textarea) ** required setting? (default: false, true) ** description (default: null) - this is what shows via the expand/collapse setting ** custom (default: null, name/value pair if list ** value (default: null), the value to use if not using get_option ** disabled (default: false), show the input but keep it disabled ** **/ function add_item($section, $display_name, $name, $type = 'text', $required = false, $description = null, $custom = null, $value = null, $disabled = false ) { $name = $this->prefix .'-'.$name; //** Need to check the section exists first. **/ if (!isset($this->sections[$section])) { if (isset($this->notifications)) { $this->notifications->add_notice( 3, sprintf( __('Program Error: section %s not defined.',WPCSL__mpcj__VERSION), $section ) ); } return; } $this->sections[$section]->add_item( array( 'prefix' => $this->prefix, 'css_prefix' => $this->css_prefix, 'display_name' => $display_name, 'name' => $name, 'type' => $type, 'required' => $required, 'description' => $description, 'custom' => $custom, 'value' => $value, 'disabled' => $disabled ) ); if ($required) { if (get_option($name) == '') { if (isset($this->notifications)) { $this->notifications->add_notice( 1, "Please provide a value for $display_name", "options-general.php?page={$this->prefix}-options#". strtolower(strtr($display_name,' ', '_')) ); } } } } /** * Add a simple checkbox to the settings array. * * @param string $section - slug for the parent section * @param string $label - text to appear before the setting * @param string $fieldID - the option value field * @param string $description - the help text under the more icon expansion * @param string $value - the default value to use, overrides get-option(name) * @param boolean $disabled - true if the field is disabled */ function add_checkbox($section,$label,$fieldID,$description=null,$value=null,$disabled=false) { $this->add_item( $section, $label, $fieldID, 'checkbox', false, $description, null, $value, $disabled ); } /** * Add a simple text input to the settings array. * * @param string $section - slug for the parent section * @param string $label - text to appear before the setting * @param string $fieldID - the option value field * @param string $description - the help text under the more icon expansion * @param string $value - the default value to use, overrides get-option(name) * @param boolean $disabled - true if the field is disabled */ function add_input($section,$label,$fieldID,$description=null,$value=null,$disabled=false) { $this->add_item( $section, $label, $fieldID, 'text', false, $description, null, $value, $disabled ); } /**------------------------------------ ** Method: register ** ** This function should be used via an admin_init action ** **/ function register() { if (isset($this->license)) { $this->license->initialize_options(); } if (isset($this->cache)) { $this->cache->initialize_options(); } if (isset($this->sections)) { foreach ($this->sections as $section) { $section->register($this->prefix); } } } /**------------------------------------ ** method: render_settings_page ** ** Create the HTML for the plugin settings page on the admin panel **/ function render_settings_page() { $this->header(); // Redner all top menus first. // foreach ($this->sections as $section) { if (isset($section->is_topmenu) && ($section->is_topmenu)) { $section->display(); } } // Show the plugin environment and info section on every plugin // if ($this->render_csl_blocks) { $this->sections['Plugin Info']->display(); } // Only render license section if plugin settings // asks for it if (isset($this->license_section_title) && (isset($this->sections[$this->license_section_title]))) { if ($this->has_packages || !$this->no_license) { $this->sections[$this->license_section_title]->header(); $this->show_plugin_settings(); $this->sections[$this->license_section_title]->footer(); } } // Draw each settings section as defined in the plugin config file // foreach ($this->sections as $section) { if ($section->auto) { $section->display(); } } // Show the plugin environment and info section on every plugin // if ($this->render_csl_blocks) { $this->sections['Plugin Environment']->display(); } $this->render_javascript(); $this->footer(); } /**------------------------------------ ** method: show_plugin_settings ** ** This is a function specifically for showing the licensing stuff, ** should probably be moved over to the licensing submodule **/ function show_plugin_settings() { $theLicenseKey = get_option($this->prefix.'-license_key'); $license_ok =( (get_option($this->prefix.'-purchased') == '1') && ($theLicenseKey != '') ); // If has_packages is true that means we have an unlicensed product // so we don't want to show the license box // if (!$this->has_packages) { $content = "\n"; $content .= " License Key *"; $content .= " "; $content .= "prefix}-license_key\"" : '') . " value=\"". $theLicenseKey . "\"". ($license_ok?'disabled' :'') . " />"; if ($license_ok) { $content .= '

'.$theLicenseKey.'

' . '' . '' ; } $content .= (!$license_ok) ? ('
Without a license key, this plugin will ' . 'only function for Admins
') : ''; $content .= (!(get_option($this->prefix.'-license_key') == '') && !get_option($this->prefix.'-purchased')) ? ('Your license key could not be verified') : ''; if (!$license_ok) { $content .= $this->MakePayPalButton($this->paypal_button_id); } $content .= '
sku: '; if (isset($this->sku) && ($this->sku != '')) { $content .= $this->sku; } else { $content .= 'not set'; } $content .= '
'; // If we are using has_packages we need to seed our content string // } else { $content =''; } // List Packages // $content .= $this->ListThePackages($license_ok); // If the main product or packages show the license box // Then show a save button here // $license_ok =( (get_option($this->prefix.'-purchased') == '1') && (get_option($this->prefix.'-license_key') != '') ); if (!$license_ok) { $content .= '' . $this->generate_save_button_string(). ''; } echo $content; } /** * Create the package license otuput for the admin interface. */ function ListThePackages($license_ok = false) { $content = ''; if (isset($this->parent->license->packages) && ($this->parent->license->packages > 0)) { $content .= ''; foreach ($this->parent->license->packages as $package) { $content .= '
'; $content .= '
'.$package->name.'
'; $content .= '
'.$this->EnabledOrBuymeString($license_ok,$package).'
'; $content .= '
'; } $content .= ''; } return $content; } /**------------------------------------ ** method: EnabledOrBuymeString ** **/ function EnabledOrBuymeString($mainlicenseOK, $package) { $content = ''; // If the main product is licensed or we want to force // the packages list, show the checkbox or buy/validate button. // if ($mainlicenseOK || $this->has_packages) { // Check if package is licensed now. // $package->isenabled = ( $package->force_enabled || $package->parent->check_license_key( $package->sku, true, ($this->has_packages ? $package->license_key : ''), true // Force a server check ) ); $installed_version = (isset($package->force_version)? $package->force_version : get_option($this->prefix.'-'.$package->sku.'-version') ); $latest_version = get_option($this->prefix.'-'.$package->sku.'-latest-version'); // Upgrade is available if the current package version < the latest available // -AND- the current package version is has been set $upgrade_available = ( ($installed_version != '') && ( get_option($this->prefix.'-'.$package->sku.'-version-numeric') < get_option($this->prefix.'-'.$package->sku.'-latest-version-numeric') ) ); // Package is enabled, just show that // if ($package->isenabled && ($package->license_key != '')) { $packString = $package->name . ' is enabled!'; $content .= '
'. (($package->sku!='')?'SKU: '.$package->sku.'
':''). (($package->license_key!='')?'License Key: '.$package->license_key.'
':''). '' . (($installed_version != '')?'Version: ' . $installed_version : '') . '
'. ''; ; // OK - the license was verified, this package is valid // but the mainlicense was not set... // go set it. if (!$mainlicenseOK && ($package->license_key != '')) { update_option($this->prefix.'-purchased',true); update_option($this->prefix.'-license_key',$package->license_key); } // Package not enabled, show buy button // } if (!$package->isenabled || $upgrade_available || ($package->license_key == '')) { if ($package->isenabled && $upgrade_available) { $content .= 'There is a new version available: ' . $latest_version . '
'; $content .= $this->MakePayPalButton($package->paypal_upgrade_button_id, $package->help_text); $content .= "Once you've made your purchase, the plugin will automatically re-validate with the latest version."; } else { $content .= $this->MakePayPalButton($package->paypal_button_id, $package->help_text); } // Show license entry box if we need to // if ( ($this->has_packages && !$upgrade_available) || ($package->license_key == '') ){ $content .= "{$package->sku} Activation Key: "; if ($package->license_key != '') { $content .= "
". "The key {$package->license_key} could not be validated.". ""; } } } // Main product not licensed, tell them. // } else { $content .= 'You must license the product before you can purchase add-on packages.'; } return $content; } /**------------------------------------ ** method: MakePayPalButton ** **/ function MakePayPalButton($buttonID, $helptext = '') { // Set default help text // if ($helptext == '') { $helptext = 'Your license key is emailed within minutes of your purchase.
'. 'If you do not receive your license check your spam '. 'folder then Contact us.'; } // PayPal Form String $ppFormString = "
". "". "". "". "". "". "". "
" ; // Modal Form Helpers // // // $modalFormSetup = ' '; // Build paypal form and send it back // return $modalFormSetup . '
'. '
'. '

'.$helptext.'

'. '
'; } /**------------------------------------ ** method: header ** **/ function header() { echo "
\n"; screen_icon(preg_replace('/\W/','_',$this->name)); echo "

{$this->name}

\n"; echo "
\n"; echo settings_fields($this->prefix.'-settings'); echo "\n
\n"; } /**------------------------------------ ** method: footer ** **/ function footer() { print '
' . $this->generate_save_button_string() . '
'; } /**------------------------------------ ** method: generate_save_button_string ** **/ function generate_save_button_string() { return sprintf('', $this->save_text ); } /**------------------------------------ ** method: render_javascript ** **/ function render_javascript() { echo ""; } /**------------------------------------ ** method: check_required ** **/ function check_required($section = null) { if ($section == null) { foreach ($this->sections as $section) { foreach ($section->items as $item) { if ($item->required && get_option($item->name) == '') return false; } } } else { // The requested section does not exist yet. if (!isset($this->sections[$section])) { return false; } // Check the required items // foreach ($this->sections[$section]->items as $item) { if ($item->required && get_option($item->name) == '') return false; } } return true; } } /**************************************************************************** ** ** class: wpCSL_settings_section__mpcj ** **/ class wpCSL_settings_section__mpcj { /**------------------------------------ **/ function __construct($params) { $this->headerbar = true; foreach ($params as $name => $value) { $this->$name = $value; } if (!isset($this->auto)) $this->auto = true; } /**------------------------------------ ** Class: wpCSL_settings_section ** Method: add_item ** **/ function add_item($params) { $this->items[] = new wpCSL_settings_item__mpcj( array_merge( $params, array('plugin_url' => $this->plugin_url, 'css_prefix' => $this->css_prefix, ) ) ); } /**------------------------------------ **/ function register($prefix) { if (!isset($this->items)) return false; foreach ($this->items as $item) { $item->register($prefix); } } /**------------------------------------ **/ function display() { $this->header(); if (isset($this->items)) { foreach ($this->items as $item) { $item->display(); } } $this->footer(); } /**------------------------------------ **/ function header() { echo "
div_id) ? "id='$this->div_id'" : '') . ">"; if ($this->headerbar) { echo "

{$this->name} name, ' ', '_'))."\">

"; } echo"
start_collapsed) && $this->start_collapsed ? 'style="display:none;"' : '') . ">
{$this->description}
\n"; } /**------------------------------------ **/ function footer() { echo "
\n"; } } /**************************************************************************** ** ** class: wpCSL_settings_item__mpcj ** ** Settings Page : Items Class ** This class manages individual settings on the admin panel settings page. ** **/ class wpCSL_settings_item__mpcj { /**------------------------------------ **/ function __construct($params) { foreach ($params as $name => $value) { $this->$name = $value; } } /**------------------------------------ **/ function register($prefix) { register_setting( $prefix.'-settings', $this->name ); } /**------------------------------------ **/ function display() { $this->header(); if (isset($this->value)) { $showThis = $this->value; } else { $showThis = get_option($this->name); } $showThis = htmlspecialchars($showThis); echo '
'; switch ($this->type) { case 'textarea': echo ''; break; case 'text': echo 'disabled?'disabled="disabled" ':''). 'value="'. $showThis .'" />'; break; case "checkbox": echo 'disabled?'disabled="disabled" ':''). ($showThis?' checked' : '').'>'; break; case "list": echo $this->create_option_list(); break; case "submit_button": echo ''; break; default: echo $this->custom; break; } echo '
'; if ($this->description != null) { $this->display_description_icon(); } if ($this->required) { echo ((get_option($this->name) == '') ? '
'. '
'. '
This field is required.
'. '
' : '' ); } if ($this->description != null) { $this->display_description_text($this->description); } $this->footer(); } /**------------------------------------ * If $type is 'list' then $custom is a hash used to make a name}\">\n"); foreach ($this->custom as $key => $value) { if (get_option($this->name) === $value) { $output_list[] = "\n"; } else { $output_list[] = "\n"; } } $output_list[] = "\n"; return implode('', $output_list); } /**------------------------------------ **/ function header() { echo "" . "{$this->display_name}". (($this->required) ? ' *' : ''). ''; } /**------------------------------------ **/ function footer() { echo ''; } /**------------------------------------ **/ function display_description_icon() { echo '

'; } /**------------------------------------ **/ function display_description_text($content) { echo '
'; echo $content; echo '
'; } }
Fatal error: Class 'wpCSL_settings__mpcj' not found in /home/nicram/public_html/2-clicks-sportsmemorabilia/sportsmemorabilia/wp-content/plugins/moneypress-commission-junction-le/WPCSL-generic/classes/CSL-plugin.php on line 407