function __construct($size = 'A4hoch')
 {
     // Update size variables to allow calculations for distance.
     $this->setSize($size);
     // Create basic page layout
     $this->pdffile = new TCPDF('P', 'mm', 'A4hoch', true, 'UTF-8', false);
     $this->pdffile->AddPage();
     // Load the certificate settings
     $this->settingsList = TidySettings_getSettings(WPCW_DATABASE_SETTINGS_KEY);
 }
示例#2
0
 function __construct($size = 'A4')
 {
     // Update size variables to allow calculations for distance.
     $this->setSize($size);
     // Create basic page layout
     $this->pdffile = new FPDF('L', 'mm', $this->size_name);
     $this->pdffile->AddPage();
     // Fonts
     $this->pdffile->AddFont('ArchitectsDaughter', '', 'architectsdaughter.php');
     // Load the certificate settings
     $this->settingsList = TidySettings_getSettings(WPCW_DATABASE_SETTINGS_KEY);
 }
示例#3
0
 /**
  * Method called when settings form details are being saved.
  * @param Array $formValues The list of settings being saved.
  * @see wplib/EasyForm::handleSave()
  */
 protected function handleSave($formValues)
 {
     // Get existing settings first (in case we don't have all the setting to play with
     // on a certain page), then merge changes.
     $originalSettings = TidySettings_getSettings($this->settingPrefix);
     foreach ($formValues as $name => $value) {
         $originalSettings[$name] = $value;
     }
     $saveSuccess = TidySettings_saveSettings($originalSettings, $this->settingPrefix);
     if ($saveSuccess) {
         $this->messages = $this->showMessage('Settings successfully saved.');
     } else {
         $this->messages = $this->showMessage('There was a problem saving the settings.', true);
     }
 }
示例#4
0
 function __construct($size = 'A4')
 {
     $this->setSize($size);
     $this->setTraineeName(false);
     $this->setQuizName(false);
     $this->setCourseName(false);
     $this->data_Results = false;
     $this->data_Feedback = false;
     // Load the settings
     $this->settingsList = TidySettings_getSettings(WPCW_DATABASE_SETTINGS_KEY);
     // Create basic page
     $this->pdffile = new WPCW_PDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // Set margins
     $this->pdffile->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
     $this->pdffile->SetHeaderMargin(PDF_MARGIN_HEADER);
     $this->pdffile->SetFooterMargin(PDF_MARGIN_FOOTER);
     // Set auto page breaks
     $this->pdffile->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     // Set page details
     $this->pdffile->setFooterString(get_bloginfo('title') . ' - ' . home_url('/'));
     $this->pdffile->AddPage();
 }
示例#5
0
/**
 * Install the plugin, initialise the default settings, and create the tables for the websites and groups.
 */
function WPCW_plugin_setup($force)
{
    $installed_ver = get_option(WPCW_DATABASE_KEY) + 0;
    $current_ver = WPCW_DATABASE_VERSION + 0;
    // Performing an upgrade
    if ($current_ver != $installed_ver || $force) {
        global $wpdb, $wpcwdb;
        $wpcwdb = new WPCW_Database();
        // If settings don't already exist, create new settings based on defaults
        // only when plugin activates.
        $existingSettings = TidySettings_getSettings(WPCW_DATABASE_SETTINGS_KEY);
        // The default settings that should exist on initialisation.
        $defaultSettings = array('show_powered_by' => 'show_link', 'use_default_css' => 'show_css', 'license_activation' => 'activate_license', 'cert_background_type' => 'use_default', 'cert_logo_enabled' => 'no_cert_logo', 'cert_logo_enabled' => 'no_cert_logo', 'cert_signature_type' => 'text', 'cert_sig_text' => get_bloginfo('name'));
        // No settings at all, so save all settings direct to the database.
        if (!$existingSettings) {
            TidySettings_saveSettings($defaultSettings, WPCW_DATABASE_SETTINGS_KEY);
        } else {
            // Check all settings
            foreach ($defaultSettings as $key => $value) {
                if (!isset($existingSettings[$key])) {
                    $existingSettings[$key] = $value;
                }
            }
            // Save modified existing settings back to the settings
            TidySettings_saveSettings($existingSettings, WPCW_DATABASE_SETTINGS_KEY);
        }
        // Remove the flag for flushing rules
        delete_option('wpcw_flush_rules');
        // Upgrade database tables if version change.
        WPCW_database_upgradeTables($installed_ver, $force);
        // Create upload directory
        WPCW_files_createFileUploadDirectory_base();
    }
}
示例#6
0
/**
 * Function checks if a feature is permitted
 * @param String $featureName Name of feature
 * @return Boolean True if the feature is allowed, false otherwise.
 */
function STWWT_account_featuredAllowed($featureName)
{
    // Get account settings, return false if no account settings.
    $accountSettings = TidySettings_getSettings(STWWT_SETTINGS_KEY_ACCOUNT);
    if (!$accountSettings) {
        return false;
    }
    // Enabled if setting == 1
    if (isset($accountSettings[$featureName]) && $accountSettings[$featureName] == 1) {
        return true;
    }
    return false;
}
示例#7
0
/**
 * Function that creates a list of units.
 * 
 * @param Integer $courseID The ID of the course to show.
 * @param Array $options The list of options to show.
 */
function WPCW_courses_renderCourseList($courseID, $options)
{
    extract(shortcode_atts(array('module' => 0, 'module_desc' => false, 'show_title' => false, 'show_desc' => false, 'widget_mode' => false, 'show_toggle_col' => false, 'show_modules_previous' => 'all', 'show_modules_next' => 'all', 'toggle_modules' => 'expand_all'), $options));
    // Check settings to to see if they are true
    $module_desc = $module_desc == 'true';
    $show_title = $show_title == 'true';
    $show_desc = $show_desc == 'true';
    $courseDetails = false;
    $parentData = false;
    global $post;
    // Show course based on current location for user. Use the currently shown post
    // to work out which course to show using the associated parent data.
    if ('current' == $courseID) {
        $parentData = WPCW_units_getAssociatedParentData($post->ID);
        if ($parentData) {
            $courseDetails = WPCW_courses_getCourseDetails($parentData->parent_course_id);
            $courseID = $parentData->parent_course_id;
        } else {
            return false;
        }
    } else {
        // Check course ID is valid
        $courseDetails = WPCW_courses_getCourseDetails($courseID);
        if (!$courseDetails) {
            return __('Unrecognised course ID.', 'wp_courseware');
        }
        // Course ID is fine, get associated parent data for
        // hiding aspects of the widget
        $parentData = WPCW_units_getAssociatedParentData($post->ID);
    }
    $moduleList = false;
    // Do we just want a single module?
    if ($module > 0) {
        // Get module by module number within course (not the module ID)
        $moduleDetailsSingle = WPCW_modules_getModuleDetails_byModuleNumber($courseDetails->course_id, $module);
        if (!$moduleDetailsSingle) {
            return __('Could not find module.', 'wp_courseware');
        }
        // Create module list of 1 using single module
        $moduleList[$moduleDetailsSingle->module_id] = $moduleDetailsSingle;
    } else {
        // Check there are modules
        $moduleList = WPCW_courses_getModuleDetailsList($courseID);
        if (!$moduleList) {
            return __('There are no modules in this training course.', 'wp_courseware');
        }
    }
    $html = false;
    // #### Show course title/description
    if ($show_title) {
        $html .= sprintf('<div class="wpcw_fe_course_title">%s</div>', $courseDetails->course_title);
    }
    if ($show_desc) {
        $html .= sprintf('<div class="wpcw_fe_course_desc">%s</div>', $courseDetails->course_desc);
    }
    $html .= '<table id="wpcw_fe_course" cellspacing="0" cellborder="0">';
    $showUnitLinks = false;
    // If true, show links to the units
    $colCount = 2;
    // Number of columns in the table
    // UP Object to determine what to show to the user.
    $userProgress = false;
    // Check user is logged in, and if they can access this course
    $user_id = get_current_user_id();
    if ($user_id != 0) {
        $userProgress = new UserProgress($courseID, $user_id);
        // Show links for user if they are allowed to access this course.
        if ($userProgress->canUserAccessCourse()) {
            // User is logged in and can do course, so show the stuff they can do.
            $showUnitLinks = true;
            // Got an extra column to show progress
            $colCount = 3;
        }
    }
    // If we're showing a widget, and we have the parent data based on the
    // currently viewed unit, then change what's in the widget in terms
    // of previous/next units.
    $hideList = array();
    if ($widget_mode && $module == 0 && $parentData) {
        // Build a list of the modules before and after the current
        // module, so that we can more easily control what's visible,
        // and what's not.
        $modulesBefore = array();
        $modulesAfter = array();
        $currentList =& $modulesBefore;
        foreach ($moduleList as $moduleID => $moduleObj) {
            // Switch lists, we've found the current module
            if ($moduleID == $parentData->parent_module_id) {
                $currentList =& $modulesAfter;
            } else {
                $currentList[] = $moduleID;
            }
        }
        // Handle showing previous modules
        switch ($show_modules_previous) {
            // All all items in the before list to be hidden
            case 'none':
                $hideList = array_merge($hideList, $modulesBefore);
                break;
            case 'all':
                break;
                // Keep a specific number of modules to show.
            // Keep a specific number of modules to show.
            default:
                $show_modules_previous += 0;
                $modulesToPickFrom = count($modulesBefore);
                // Remove the modules at the start of the list, leaving the right number of
                // $show_modules_previous modules in the list.
                if ($show_modules_previous > 0 && $modulesToPickFrom > $show_modules_previous) {
                    $hideList = array_merge($hideList, array_slice($modulesBefore, 0, $modulesToPickFrom - $show_modules_previous));
                }
                break;
        }
        // end switch
        // Handle showing the next modules.
        switch ($show_modules_next) {
            // All all items in the after list to be hidden
            case 'none':
                $hideList = array_merge($hideList, $modulesAfter);
                break;
            case 'all':
                break;
                // Keep a specific number of modules to show.
            // Keep a specific number of modules to show.
            default:
                $show_modules_next += 0;
                $modulesToPickFrom = count($modulesAfter);
                // Remove the modules at the start of the list, leaving the right number of
                // $show_modules_previous modules in the list.
                if ($show_modules_next > 0 && $modulesToPickFrom > $show_modules_next) {
                    $hideList = array_merge($hideList, array_slice($modulesAfter, $show_modules_next));
                }
                break;
        }
        // end switch
    }
    // Columns for marking item as being pending or complete.
    $progress_Complete = '<td class="wpcw_fe_unit_progress wpcw_fe_unit_progress_complete"><span>&nbsp;</span></td>';
    $progress_Pending = '<td class="wpcw_fe_unit_progress wpcw_fe_unit_progress_incomplete"><span>&nbsp;</span></td>';
    $progress_Blank = '<td class="wpcw_fe_unit_progress"><span>&nbsp;</span></td>';
    // Show modules
    foreach ($moduleList as $moduleID => $moduleObj) {
        // See if we're skipping this module
        if (in_array($moduleID, $hideList)) {
            continue;
        }
        // If $collapseTitleArea is set to true, then the module will be collapsed. So just check what to hide
        // based on the contents of $toggle_modules
        $collapseTitleArea = false;
        if ($widget_mode && $parentData) {
            switch ($toggle_modules) {
                case 'contract_all':
                    $collapseTitleArea = true;
                    break;
                    // See if the currently visible unit module is the one being rendered.
                // See if the currently visible unit module is the one being rendered.
                case 'contract_all_but_current':
                    $collapseTitleArea = $moduleID != $parentData->parent_module_id;
                    break;
                    // Default is not to collapse.
            }
        }
        // We're showing the toggle section, so add it.
        if ($show_toggle_col) {
            $moduleTitleArea = false;
            $moduleTitleArea = sprintf('<td>%s</td><td class="wpcw_fe_toggle">%s</td>', $moduleObj->module_title, $collapseTitleArea ? '+' : '-');
        } else {
            $moduleTitleArea = sprintf('<td colspan="%d">%s</td>', $colCount - 1, $moduleObj->module_title);
        }
        // Render final title bit
        $html .= sprintf('<tr class="wpcw_fe_module %s" id="wpcw_fe_module_group_%d">
							<td>%s %d</td>
							' . $moduleTitleArea . '			
						</tr>', $collapseTitleArea ? 'wpcw_fe_module_toggle_hide' : '', $moduleObj->module_number, __('Module', 'wp_courseware'), $moduleObj->module_number, $moduleTitleArea);
        // ### Showing the module descriptions?
        if ($module_desc) {
            $html .= sprintf('<tr class="wpcw_fe_module_des"><td colspan="%d">%s</td></tr>', $colCount, $moduleObj->module_desc);
        }
        // Add the class for the row that matches the parent module ID.
        $moduleRowClass = ' wpcw_fe_module_group_' . $moduleObj->module_number;
        // ### No Units Line
        $units = WPCW_units_getListOfUnits($moduleID);
        if (!$units) {
            $extraColSpan = 0;
            if ($show_toggle_col) {
                $extraColSpan = 1;
            }
            $html .= sprintf('<tr class="wpcw_fe_unit wpcw_fe_unit_none %s">
						<td colspan="%d">%s</td>
					  </tr>', $moduleRowClass, $colCount + $extraColSpan, __('There are no units in this module.', 'wp_courseware'));
        } else {
            // Render each unit
            foreach ($units as $unit) {
                $progressRow = false;
                $progressCol = false;
                // Show links for units
                if ($showUnitLinks) {
                    // Yes we are showing progress data... see what state we're at.
                    if ($userProgress) {
                        if ($userProgress->isUnitCompleted($unit->ID)) {
                            $progressCol = $progress_Complete;
                            $progressRow = 'wpcw_fe_unit_complete';
                        } else {
                            $progressCol = $progress_Pending;
                            $progressRow = 'wpcw_fe_unit_pending';
                        }
                        //$progressCol = ($userProgress->isUnitCompleted($unit->ID) ? $progress_Complete : $progress_Pending);
                    }
                    // See if the user is allowed to access this unit or not.
                    if ($userProgress->canUserAccessUnit($unit->ID)) {
                        // Main unit title, link and unit number
                        $html .= sprintf('
							<tr class="wpcw_fe_unit ' . $progressRow . $moduleRowClass . '">
								<td>%s %d</td>
								<td class="wpcw_fe_unit"><a href="%s">%s</a></td>
								' . $progressCol . '
							</tr>', __('Unit', 'wp_courseware'), $unit->unit_meta->unit_number, get_permalink($unit->ID), $unit->post_title);
                    } else {
                        // If we're not allowed to access the unit, then it's always marked as pending.
                        $html .= sprintf('
							<tr class="wpcw_fe_unit ' . $progressRow . $moduleRowClass . '">
								<td>%s %d</td>
								<td class="wpcw_fe_unit">%s</td>
								' . $progress_Pending . '
							</tr>', __('Unit', 'wp_courseware'), $unit->unit_meta->unit_number, $unit->post_title);
                    }
                } else {
                    $colspan = 1;
                    if ($show_toggle_col) {
                        $colspan = 2;
                    }
                    $html .= sprintf('
					<tr class="wpcw_fe_unit ' . $progressRow . $moduleRowClass . '">
						<td>%s %d</td>
						<td colspan="%d" class="wpcw_fe_unit">%s</td>
					</tr>', __('Unit', 'wp_courseware'), $unit->unit_meta->unit_number, $colspan, $unit->post_title);
                }
            }
        }
        // end show units
    }
    $html .= '</table>';
    // Add powered by link
    $settings = TidySettings_getSettings(WPCW_DATABASE_SETTINGS_KEY);
    $html .= WPCW_generatedPoweredByLink($settings);
    return $html;
}
示例#8
0
 /**
  * Handle processing the form when it's posted, such as saving and handling errors.
  */
 protected function processPost()
 {
     // Process data as usual
     parent::processPost();
     // ### Now manipulate the interface
     // Get currently saved account details
     $settings = TidySettings_getSettings($this->settingPrefix);
     // Only do check if we have access ID and secret ID. Code will handle hiding pro features
     // automatically if we can't get the account details.
     $accountDetails = false;
     if (isset($settings['stwwt_access_id']) && isset($settings['stwwt_secret_id'])) {
         $accountDetails = $this->checkAccountType($settings['stwwt_access_id'], $settings['stwwt_secret_id']);
     }
     // Check account level
     $accountLevel = 'invalid';
     if (isset($accountDetails['account_type'])) {
         $accountLevel = $accountDetails['account_type'];
     }
     // Save the account details to the database for use later.
     TidySettings_saveSettings($accountDetails, STWWT_SETTINGS_KEY_ACCOUNT);
     // Set the account level in the interface
     if ($accountLevel == 'invalid') {
         $this->formObj->setElementHTML('stwwt_account_level', sprintf('<span class="stwwt_account_invalid"><span class="stwwt_account_level">Invalid</span> - please provide valid account details.</span>'));
     } else {
         $displayAcctName = ucwords($accountLevel);
         if ('Plus' == $displayAcctName) {
             $displayAcctName = 'PLUS';
         }
         $this->formObj->setElementHTML('stwwt_account_level', sprintf('<span class="stwwt_account_level stwwt_account_%s">%s</span>', $accountLevel, $displayAcctName));
     }
     if (!empty($this->paramList)) {
         // Look for any elements that have an account_level value. If that account level doesn't match the
         // desired account level, then that field doesn't get rendered. For all other fields, assume they
         // have account.
         foreach ($this->paramList as $fieldName => $fieldDetails) {
             // ### Check 1 - Account level required
             if (isset($fieldDetails['account_level']) && $fieldDetails['account_level']) {
                 // Got a list of account levels? Copy them all over
                 if (is_array($fieldDetails['account_level'])) {
                     if (!in_array($accountLevel, $fieldDetails['account_level'])) {
                         $this->removeElementDueToAccountLevel($fieldName, $fieldDetails);
                     }
                 } else {
                     if ($fieldDetails['account_level'] != $accountLevel) {
                         $this->removeElementDueToAccountLevel($fieldName, $fieldDetails);
                     }
                 }
             }
             // end if account level required
             // ### Check 2 - Check for account feature (independent of account level)
             if (isset($fieldDetails['account_feature']) && $fieldDetails['account_feature']) {
                 $featureName = $fieldDetails['account_feature'];
                 if (isset($accountDetails[$featureName]) && $accountDetails[$featureName] != 1 || $accountLevel == 'invalid') {
                     $this->removeElementDueToAccountLevel($fieldName, $fieldDetails);
                 }
             }
         }
         // end foreach
     }
     // end if (!empty($paramList))
 }
示例#9
0
/**
 * Function that shows the settings page.
 */
function STWWT_showPage_Settings()
{
    /**
     * Constant: Documentation on how the mouseover bubble works.
     */
    define('STWWT_DESC_MOUSEOVER', '
		<p><img src="' . STWWT_plugin_getPluginPath() . 'img/stw_bubble_example.png" class="stwwt_settings_bubble_example"/> 
		The Shrink The Web mouseover bubble shows a thumbnail of the website when hovered over a link on your WordPress website. 
		This gives website visitors a preview of the link before they visit the website you link to.</p>
		<p>If the "<b>Automatic</b>" is selected below, all external links will show ShrinkTheWeb preview bubbles. Use <code>class="nopopup"</code> to disable popup bubble for a specific link.</p>
		<p>If the "<b>Manual</b>" method is selected below, then you choose which links get a preview bubble by adding <code>class="stwpopup"</code> to any link where you want to show them.</p>
		<div class="stwwt_clear"></div>
	');
    /**
     * Constant: Documentation on how the embedded code works.
     */
    define('STWWT_DESC_EMBEDDED', '
		<p>The Shrink The Web embed code shows a thumbnail for any link you wrap in <code>[thumb][/thumb]</code> or <code>[stwthumb][/stwthumb]</code> tags. Any use of these tags is replaced with the thumbnail of the website included in the tags. <a href="admin.php?page=stwwt_documentation#embed">See some examples on the documentation page</a>.

	');
    /**
     * Constant: Documentation on how the pro features work.
     */
    define('STWWT_DESC_EMBEDDED_PRO', '
		<p>The following features <b>require an upgraded account</b>. You can find more details on the <a href="https://www.shrinktheweb.com/auth/order-page" target="_blank">Shrink The Web Upgrade Page</a>.</p>
		<p>These settings are <b>global</b>, so they apply to <b>all thumbnails</b> on your website. Some of these settings have a per-thumbnail override, so please read <a href="admin.php?page=stwwt_documentation">the documentation</a> on how to apply these settings to specific thumbnails.</p>
	');
    $page = new PageBuilder(true);
    $page->showPageHeader(__('Shrink The Web - Website Thumbnails - Settings', 'stwwt'), '70%');
    $page->openPane('stw_settings_main', 'Thumbnail Settings');
    $settingDetails = array('stwwt_break_main' => array('type' => 'break', 'html' => STWWT_forms_createBreakHTML('Account Settings')), 'stwwt_access_id' => array('label' => 'Access Key Id', 'type' => 'text', 'required' => true, 'cssclass' => 'stwwt_access_id', 'desc' => 'Your Shrink The Web <b>access</b> key. You can find this within your <a href="http://www.shrinktheweb.com/auth/stw-lobby" target="_blank">STW Account Details</a>.', 'validate' => array('type' => 'string', 'regexp' => '/^[A-Za-z0-9]{12,20}$/', 'error' => 'Your STW access key should only contain numbers and letters, and it\'s about 15 characters long.')), 'stwwt_secret_id' => array('label' => 'Secret Key Id', 'type' => 'text', 'required' => true, 'cssclass' => 'stwwt_access_id', 'desc' => 'Your Shrink The Web <b>secret</b> key. You can find this within your <a href="http://www.shrinktheweb.com/auth/stw-lobby" target="_blank">STW Account Details</a>.', 'validate' => array('type' => 'string', 'regexp' => '/^[A-Za-z0-9]{5,10}$/', 'error' => 'Your STW access key should only contain numbers and letters, and it\'s about 5 characters long.')), 'stwwt_account_level' => array('label' => 'Your STW Account Level', 'type' => 'custom', 'html' => false, 'desc' => 'If you change any aspects of your Shrink The Web account (such as upgrades), click on the <b>Save All Settings</b> button below to re-load what features you can use.'), 'stwwt_break_embedded' => array('type' => 'break', 'html' => STWWT_forms_createBreakHTML('Screenshot Settings', 'Save ALL Settings') . '<div class="stwwt_description">' . STWWT_DESC_EMBEDDED . '</div>'), 'stwwt_shortcode' => array('label' => 'Shortcode Syntax', 'type' => 'radio', 'data' => array('stwthumb' => '<b>[stwthumb]</b>', 'thumb' => '[thumb]'), 'default' => 'thumb'), 'stwwt_embedded_default_size' => array('label' => 'Default Screenshot Size', 'type' => 'select', 'data' => array('mcr' => 'Micro (75x56)', 'tny' => 'Tiny (90x68)', 'vsm' => 'Very Small (100x75)', 'sm' => 'Small (120x90)', 'lg' => 'Large (200x150)', 'xlg' => 'Extra Large (320x200)'), 'desc' => 'The size of the thumbnail shown by the thumbnail shortcode.', 'default' => 'lg'), 'stwwt_embedded_cache_length' => array('label' => 'Cache Length in Days', 'type' => 'select', 'data' => array('3' => '3 Days', '7' => '7 Days (recommended)', '10' => '10 Days', '14' => '14 Days', '21' => '21 Days', '30' => '30 Days'), 'desc' => 'How long you want to cache the thumbnails for.', 'account_level' => array('basic', 'plus'), 'account_denied_msg' => STWWT_ACCOUNT_UPGRADE, 'default' => 7), 'stwwt_break_embedded_pro' => array('type' => 'break', 'html' => STWWT_forms_createBreakHTML('PRO Feature Settings', 'Save ALL Settings') . '<div class="stwwt_description">' . STWWT_DESC_EMBEDDED_PRO . '</div>'), 'stwwt_embedded_pro_inside' => array('label' => 'Inside Pages Capture', 'type' => 'radio', 'data' => array('enable' => '<b>Enabled</b>', 'disable' => 'Disabled'), 'account_feature' => 'embedded_pro_inside', 'account_denied_msg' => STWWT_FEATURE_UPGRADE, 'default' => 'disable'), 'stwwt_embedded_pro_full_length' => array('label' => 'Full-length Page Captures', 'type' => 'radio', 'data' => array('enable' => '<b>Enabled</b>', 'disable' => 'Disabled'), 'account_feature' => 'embedded_pro_full_length', 'account_denied_msg' => STWWT_FEATURE_UPGRADE, 'default' => 'disable'), 'stwwt_embedded_pro_custom_quality' => array('label' => 'Custom Thumbnail Quality', 'type' => 'select', 'data' => STWWT_getQualityList(), 'desc' => 'If you want to customise the thumbnail image quality, then you can select a quality value between 1% and 100%. A value of <b>1% is the lowest quality</b>, and <b>100% is the best quality</b>.', 'account_feature' => 'embedded_pro_custom_quality', 'account_denied_msg' => STWWT_FEATURE_UPGRADE), 'stwwt_break_bubble' => array('type' => 'break', 'html' => STWWT_forms_createBreakHTML('Mouseover Bubble Settings', 'Save ALL Settings') . '<div class="stwwt_description">' . STWWT_DESC_MOUSEOVER . '</div>'), 'stwwt_bubble_method' => array('label' => 'Preview Bubbles Show Method', 'type' => 'select', 'data' => array('disable' => 'Disabled', 'automatic' => 'Automatic', 'manual' => 'Manual'), 'default' => 'disable'), 'stwwt_bubble_size' => array('label' => 'Preview Bubbles Thumbnail Size', 'type' => 'select', 'data' => array('sm' => 'Small (120x90)', 'lg' => 'Large (200x150)', 'xlg' => 'Extra Large (320x200)'), 'desc' => 'The size of the thumbnail shown in the preview bubble when a website visitor hovers over a link.', 'default' => 'lg'));
    // Show main settings form
    $settings = new STWSettingsForm($settingDetails, STWWT_SETTINGS_KEY, 'stwwt_settings');
    $settings->setSaveButtonLabel('Save ALL Settings');
    $settings->show();
    // #### Support section
    $page->showPageMiddle('27%');
    $yes = sprintf('<img src="%simg/icon_%s.png" />', STWWT_plugin_getPluginPath(), 'tick');
    $no = sprintf('<img src="%simg/icon_%s.png" />', STWWT_plugin_getPluginPath(), 'cross');
    // Feature check
    $accountSettings = TidySettings_getSettings(STWWT_SETTINGS_KEY_ACCOUNT);
    if ($accountSettings) {
        $page->openPane('stw_settings_support', 'Your Account Features');
        ?>
			<table id="stwwt_feature_comp">
				<thead>
					<tr>
						<th>Feature</th>
						<th>Your Account</th>
					</tr>
				</thead>
				<tbody>										
					<?php 
        // Now show the features
        unset($accountSettings['account_type']);
        // So we can just loop through settings.
        foreach ($accountSettings as $settingName => $enabled) {
            switch ($settingName) {
                case 'embedded_pro_inside':
                    printf('<tr><th>%s</th><td>%s</td></tr>', 'Inside Pages Capture', 1 == $enabled ? $yes : $no);
                    break;
                case 'embedded_pro_full_length':
                    printf('<tr><th>%s</th><td>%s</td></tr>', 'Full Length Capture', 1 == $enabled ? $yes : $no);
                    break;
                case 'embedded_pro_custom_size':
                    printf('<tr><th>%s</th><td>%s</td></tr>', 'Custom Sizes', 1 == $enabled ? $yes : $no);
                    break;
                case 'embedded_pro_custom_quality':
                    printf('<tr><th>%s</th><td>%s</td></tr>', 'Custom Quality', 1 == $enabled ? $yes : $no);
                    break;
                    // Don't show feature
                // Don't show feature
                default:
                    break;
            }
        }
        ?>
					
				</tbody>
			</table>
	
		<?php 
        $page->closePane();
    }
    // end of your feature list
    $page->openPane('stw_settings_support', 'Get a STW Account...');
    ?>
	<div id="stwwt_signup">
			<a href="http://www.shrinktheweb.com/user/register" target="_blank">
				<img src="http://www.shrinktheweb.com/uploads/stw-banners/shrinktheweb-234x60.gif" alt="Website Thumbnail Provider" class="stwwt_settings_banner" width="234" height="60" alt="Register for a free account with Shrink The Web">
			</a>
			
			<div class="stwwt_settings_banner_text">
				<span>Need an account?</span>
				<a href="http://www.shrinktheweb.com/user/register" target="_blank" class="button-primary">Register for FREE</a>
			</div>
		</div>

	<?php 
    $page->closePane();
    // Support
    $page->openPane('stw_settings_support', 'Help &amp; Support');
    ?>
	<p>If you've got a problem with the plugin, please follow the following steps.</p>
	<ol>
		<li>Check the <a href="http://wordpress.org/extend/plugins/shrinktheweb-website-preview-plugin/faq/" target="_blank">Frequently Asked Questions</a> on WordPress.org. Your issue might already be answered or resolved.</li>
		<li>Check the <a href="http://wordpress.org/tags/shrinktheweb-website-preview-plugin?forum_id=10" target="_blank">plugin support forum</a> on WordPress.org. Someone might have had the same issue, and fixed it already.</li>
		<li>If you think the problem is a <b>plugin problem</b>, please raise the problem in the <a href="http://wordpress.org/tags/shrinktheweb-website-preview-plugin?forum_id=10" target="_blank">plugin support forum</a> on WordPress.org, including <b>as much detail as possible</b>, including any <b>error messages</b>.</li>
		<li>If you think the problem is a <b>STW or STW account problem</b>, please raise the problem in the <a href="http://www.shrinktheweb.com/forum" target="_blank">STW support forum</a>, including <b>as much detail as possible</b>, including any <b>error messages</b>.</li>
	</ol>
	
	<br/>
	<div class="stwwt_title">A word about the plugin authors...</div>
	<p>This plugin and the <a href="http://www.shrinktheweb.com" target="_blank">Shrink The Web</a> service has been developed and is provided by <a href="http://www.neosys.net/profile.htm" target="_blank">Neosys Consulting, Inc.</a></p>
	<?php 
    $page->closePane();
    $page->showPageFooter();
}