コード例 #1
0
/**
 * Shows the documentation page for the plugin. 
 */
function WPCW_showPage_Documentation_load()
{
    $page = new PageBuilder();
    // List of tabs to show
    $docTabs = array('default' => array('flag' => false, 'fn' => 'WPCW_showPage_Documentation_shortcodes', 'label' => __('Shortcodes', 'wp_courseware')), 'howto' => array('flag' => 'howto', 'fn' => 'WPCW_showPage_Documentation_howto', 'label' => __('How-To Videos', 'wp_courseware')));
    // Allow modification of the documentation tabs.
    $docTabs = apply_filters('wpcw_back_documentation_tabs', $docTabs);
    printf('<div class="wrap">');
    $tabNames = array_keys($docTabs);
    // What tabs are active?
    $tabSel = WPCW_arrays_getValue($_GET, 'info');
    if (!in_array($tabSel, $tabNames)) {
        $tabSel = false;
    }
    // Create main settings tab URL
    $baseURL = admin_url('admin.php?page=WPCW_showPage_Documentation');
    // Header
    printf('<h2 class="nav-tab-wrapper">');
    // Icon
    printf('<div id="icon-pagebuilder" class="icon32" style="background-image: url(\'%s\'); margin: 0px 6px 0 6px;"><br></div>', WPCW_icon_getPageIconURL());
    foreach ($docTabs as $type => $tabDetails) {
        // Tabs
        $urlToUse = $baseURL;
        if ($tabDetails['flag']) {
            $urlToUse = $baseURL . '&info=' . $tabDetails['flag'];
        }
        printf('<a href="%s" class="nav-tab %s">%s</a>', $urlToUse, $tabDetails['flag'] == $tabSel ? 'nav-tab-active' : '', $tabDetails['label']);
    }
    printf('</h2>');
    // Create the doc header.
    $page->showPageHeader(false, '75%', false, true);
    // What settings do we show?
    if (in_array($tabSel, $tabNames)) {
        call_user_func($docTabs[$tabSel]['fn']);
    } else {
        call_user_func($docTabs['default']['fn']);
    }
    // Needed to show RHS section for panels
    $page->showPageMiddle('23%');
    // RHS Support Information
    WPCW_docs_showSupportInfo($page);
    WPCW_docs_showSupportInfo_News($page);
    WPCW_docs_showSupportInfo_Affiliate($page);
    $page->showPageFooter();
    // Final div closed by showPageFooter().
    //printf('</div>');
}
コード例 #2
0
/**
 * Show the page where the user can set up the certificate settings. 
 */
function WPCW_showPage_Certificates_load()
{
    $page = new PageBuilder(true);
    $page->showPageHeader(__('Training Courses - Certificate Settings', 'wp_courseware'), '75%', WPCW_icon_getPageIconURL());
    $settingsFields = array('section_certificates_defaults' => array('type' => 'break', 'html' => WPCW_forms_createBreakHTML(__('Certificate Settings', 'wp_courseware'))), 'cert_signature_type' => array('label' => __('Signature Type', 'wp_courseware'), 'type' => 'radio', 'cssclass' => 'wpcw_cert_signature_type', 'required' => 'true', 'data' => array('text' => sprintf('<b>%s</b> - %s', __('Text', 'wp_courseware'), __('Just use text for the signature.', 'wp_courseware')), 'image' => sprintf('<b>%s</b> - %s', __('Image File', 'wp_courseware'), __('Use an image for the signature.', 'wp_courseware')))), 'cert_sig_text' => array('label' => __('Name to use for signature', 'wp_courseware'), 'type' => 'text', 'cssclass' => 'wpcw_cert_signature_type_text', 'desc' => __('The name to use for the signature area.', 'wp_courseware'), 'validate' => array('type' => 'string', 'maxlen' => 150, 'minlen' => 1, 'regexp' => '/^[^<>]+$/', 'error' => __('Please enter the name to use for the signature area.', 'wp_courseware'))), 'cert_sig_image_url' => array('label' => __('Your Signature Image', 'wp_courseware'), 'cssclass' => 'wpcw_image_upload_field wpcw_cert_signature_type_image', 'type' => 'text', 'desc' => '&bull;&nbsp;' . __('The URL of your signature image. Using a transparent image is recommended.', 'wp_courseware') . '<br/>&bull;&nbsp;' . sprintf(__('The image must be <b>%d pixels wide, and %d pixels high</b> to render correctly. ', 'wp_courseware'), WPCW_CERTIFICATE_SIGNATURE_WIDTH_PX * 2, WPCW_CERTIFICATE_SIGNATURE_HEIGHT_PX * 2), 'validate' => array('type' => 'url', 'maxlen' => 300, 'minlen' => 1, 'error' => __('Please enter the URL of your signature image.', 'wp_courseware')), 'extrahtml' => sprintf('<a id="cert_sig_image_url_btn" href="#" class="wpcw_insert_image button-secondary" data-uploader_title="%s" data-uploader_btn_text="%s" data-target="cert_sig_image_url"><span class="wpcw_insert_image_img"></span> %s</a>', __('Choose an image to use for the signature image...', 'wp_courseware'), __('Select Image', 'wp_courseware'), __('Select Image', 'wp_courseware'))), 'cert_logo_enabled' => array('label' => __('Show your logo?', 'wp_courseware'), 'cssclass' => 'wpcw_cert_logo_enabled', 'type' => 'radio', 'required' => 'true', 'data' => array('cert_logo' => sprintf('<b>%s</b> - %s', __('Yes', 'wp_courseware'), __('Use your logo on the certificate.', 'wp_courseware')), 'no_cert_logo' => sprintf('<b>%s</b> - %s', __('No', 'wp_courseware'), __('Don\'t show a logo on the certificate.', 'wp_courseware')))), 'cert_logo_url' => array('label' => __('Your Logo Image', 'wp_courseware'), 'type' => 'text', 'cssclass' => 'wpcw_cert_logo_url wpcw_image_upload_field', 'desc' => '&bull;&nbsp;' . __('The URL of your logo image. Using a transparent image is recommended.', 'wp_courseware') . '<br/>&bull;&nbsp;' . sprintf(__('The image must be <b>%d pixels wide, and %d pixels</b> high to render correctly. ', 'wp_courseware'), WPCW_CERTIFICATE_LOGO_WIDTH_PX * 2, WPCW_CERTIFICATE_LOGO_HEIGHT_PX * 2), 'validate' => array('type' => 'url', 'maxlen' => 300, 'minlen' => 1, 'error' => __('Please enter the URL of your logo image.', 'wp_courseware')), 'extrahtml' => sprintf('<a id="cert_logo_url_btn" href="#" class="wpcw_insert_image button-secondary" data-uploader_title="%s" data-uploader_btn_text="%s" data-target="cert_logo_url"><span class="wpcw_insert_image_img"></span> %s</a>', __('Choose an image to use for your logo on the certificate...', 'wp_courseware'), __('Select Image', 'wp_courseware'), __('Select Image', 'wp_courseware'))), 'cert_background_type' => array('label' => __('Certificate Background', 'wp_courseware'), 'cssclass' => 'wpcw_cert_background_type', 'type' => 'radio', 'required' => 'true', 'data' => array('use_default' => sprintf('<b>%s</b> - %s', __('Built-in', 'wp_courseware'), __('Use the built-in certificate background.', 'wp_courseware')), 'use_custom' => sprintf('<b>%s</b> - %s', __('Custom', 'wp_courseware'), __('Use your own certificate background.', 'wp_courseware')))), 'cert_background_custom_url' => array('label' => __('Custom Background Image', 'wp_courseware'), 'type' => 'text', 'cssclass' => 'wpcw_cert_background_custom_url wpcw_image_upload_field', 'desc' => '&bull;&nbsp;' . __('The URL of your background image.', 'wp_courseware') . '<br/>&bull;&nbsp;' . sprintf(__('The background image must be <b>%d pixels wide, and %d pixels</b> high at <b>72 dpi</b> to render correctly. ', 'wp_courseware'), WPCW_CERTIFICATE_BG_WIDTH_PX, WPCW_CERTIFICATE_BG_HEIGHT_PX), 'validate' => array('type' => 'url', 'maxlen' => 300, 'minlen' => 1, 'error' => __('Please enter the URL of your certificate background image.', 'wp_courseware')), 'extrahtml' => sprintf('<a id="cert_background_custom_url_btn" href="#" class="wpcw_insert_image button-secondary" data-uploader_title="%s" data-uploader_btn_text="%s" data-target="cert_background_custom_url"><span class="wpcw_insert_image_img"></span> %s</a>', __('Choose an image to use for the certificate background...', 'wp_courseware'), __('Select Image', 'wp_courseware'), __('Select Image', 'wp_courseware'))), 'section_encodings' => array('type' => 'break', 'html' => WPCW_forms_createBreakHTML(__('Language and Encoding Settings', 'wp_courseware'))), 'certificate_encoding' => array('label' => __('Certificate Encoding', 'wp_courseware'), 'type' => 'select', 'required' => true, 'desc' => __('Choose a codepage encoding that matches your language to ensure certificates render correctly. You may need an encoding other than <code>ISO-8859-1</code> if you are using a non-English language.', 'wp_courseware'), 'data' => array('ISO-8859-1' => __('ISO-8859-1 - Latin alphabet - North America, Western Europe, Latin America, etc. (Default)', 'wp_courseware'), 'ISO-8859-2' => __('ISO-8859-2 - Latin alphabet 2 - Eastern Europe.', 'wp_courseware'), 'ISO-8859-3' => __('ISO-8859-3 - Latin alphabet 3 - SE Europe, Esperanto', 'wp_courseware'), 'ISO-8859-4' => __('ISO-8859-4 - Latin alphabet 4 - Scandinavia/Baltics', 'wp_courseware'), 'ISO-8859-5' => __('ISO-8859-5 - Latin/Cyrillic - Bulgarian, Belarusian, Russian and Macedonian', 'wp_courseware'), 'ISO-8859-6' => __('ISO-8859-6 - Latin/Arabic - Arabic languages', 'wp_courseware'), 'ISO-8859-7' => __('ISO-8859-7 - Latin/Greek - modern Greek language', 'wp_courseware'), 'ISO-8859-8' => __('ISO-8859-8 - Latin/Hebrew - Hebrew languages', 'wp_courseware'), 'ISO-8859-9' => __('ISO-8859-9 - Latin 5 part 9 - Turkish languages', 'wp_courseware'), 'ISO-8859-10' => __('ISO-8859-10 - Latin 6 Lappish, Nordic, Eskimo - The Nordic languages', 'wp_courseware'), 'ISO-8859-15' => __('ISO-8859-15 - Latin 9 (aka Latin 0) - Similar to ISO 8859-1', 'wp_courseware'))));
    $settings = new SettingsForm($settingsFields, WPCW_DATABASE_SETTINGS_KEY, 'wpcw_form_settings_certificates');
    $settings->setSaveButtonLabel(__('Save ALL Settings', 'wp_courseware'));
    $settings->msg_settingsSaved = __('Settings successfully saved.', 'wp_courseware');
    $settings->msg_settingsProblem = __('There was a problem saving the settings.', 'wp_courseware');
    $settings->setAllTranslationStrings(WPCW_forms_getTranslationStrings());
    $settings->show();
    // RHS Support Information
    $page->showPageMiddle('23%');
    // Create a box where the admin can preview the certificates to see what they look like.
    $page->openPane('wpcw-certificates-preview', __('Preview Certificate', 'wp_courseware'));
    printf('<p>%s</p>', __('After saving the settings, you can preview the certificate using the button below. The preview opens in a new window.', 'wp_courseware'));
    printf('<div class="wpcw_btn_centre"><a href="%spdf_create_certificate.php?certificate=preview" target="_blank" class="button-primary">%s</a></div>', WPCW_plugin_getPluginPath(), __('Preview Certificate', 'wp_courseware'));
    $page->closePane();
    WPCW_docs_showSupportInfo($page);
    WPCW_docs_showSupportInfo_News($page);
    WPCW_docs_showSupportInfo_Affiliate($page);
    $page->showPageFooter();
}
コード例 #3
0
/**
 * Show the page where the user can set up the certificate settings. 
 */
function WPCW_showPage_Certificates_load()
{
    $page = new PageBuilder(true);
    $page->showPageHeader(__('Training Courses - Certificate Settings', 'wp_courseware'), '75%', WPCW_icon_getPageIconURL());
    $settingsFields = array('section_certificates_defaults' => array('type' => 'break', 'html' => WPCW_forms_createBreakHTML(__('Certificate Settings', 'wp_courseware'))), 'cert_signature_type' => array('label' => __('Signature Type', 'wp_courseware'), 'type' => 'radio', 'cssclass' => 'wpcw_cert_signature_type', 'required' => 'true', 'data' => array('text' => sprintf('<b>%s</b> - %s', __('Text', 'wp_courseware'), __('Just use text for the signature.', 'wp_courseware')), 'image' => sprintf('<b>%s</b> - %s', __('Image File', 'wp_courseware'), __('Use an image for the signature.', 'wp_courseware')))), 'cert_sig_text' => array('label' => __('Name to use for signature', 'wp_courseware'), 'type' => 'text', 'cssclass' => 'wpcw_cert_signature_type_text', 'desc' => __('The name to use for the signature area.', 'wp_courseware'), 'validate' => array('type' => 'string', 'maxlen' => 150, 'minlen' => 1, 'regexp' => '/^[^<>]+$/', 'error' => __('Please enter the name to use for the signature area.', 'wp_courseware'))), 'cert_sig_image_url' => array('label' => __('Your Signature Image', 'wp_courseware'), 'cssclass' => 'wpcw_image_upload_field wpcw_cert_signature_type_image', 'type' => 'text', 'desc' => '&bull;&nbsp;' . __('The URL of your signature image. Using a transparent image is recommended.', 'wp_courseware') . '<br/>&bull;&nbsp;' . sprintf(__('The image must be <b>%d pixels wide, and %d pixels high</b> to render correctly. ', 'wp_courseware'), WPCW_CERTIFICATE_SIGNATURE_WIDTH_PX * 2, WPCW_CERTIFICATE_SIGNATURE_HEIGHT_PX * 2), 'validate' => array('type' => 'url', 'maxlen' => 300, 'minlen' => 1, 'error' => __('Please enter the URL of your signature image.', 'wp_courseware')), 'extrahtml' => sprintf('<a id="cert_sig_image_url_btn" href="#" class="wpcw_insert_image button-secondary" data-uploader_title="%s" data-uploader_btn_text="%s" data-target="cert_sig_image_url"><span class="wpcw_insert_image_img"></span> %s</a>', __('Choose an image to use for the signature image...', 'wp_courseware'), __('Select Image', 'wp_courseware'), __('Select Image', 'wp_courseware'))), 'cert_logo_enabled' => array('label' => __('Show your logo?', 'wp_courseware'), 'cssclass' => 'wpcw_cert_logo_enabled', 'type' => 'radio', 'required' => 'true', 'data' => array('cert_logo' => sprintf('<b>%s</b> - %s', __('Yes', 'wp_courseware'), __('Use your logo on the certificate.', 'wp_courseware')), 'no_cert_logo' => sprintf('<b>%s</b> - %s', __('No', 'wp_courseware'), __('Don\'t show a logo on the certificate.', 'wp_courseware')))), 'cert_logo_url' => array('label' => __('Your Logo Image', 'wp_courseware'), 'type' => 'text', 'cssclass' => 'wpcw_cert_logo_url wpcw_image_upload_field', 'desc' => '&bull;&nbsp;' . __('The URL of your logo image. Using a transparent image is recommended.', 'wp_courseware') . '<br/>&bull;&nbsp;' . sprintf(__('The image must be <b>%d pixels wide, and %d pixels</b> high to render correctly. ', 'wp_courseware'), WPCW_CERTIFICATE_LOGO_WIDTH_PX * 2, WPCW_CERTIFICATE_LOGO_HEIGHT_PX * 2), 'validate' => array('type' => 'url', 'maxlen' => 300, 'minlen' => 1, 'error' => __('Please enter the URL of your logo image.', 'wp_courseware')), 'extrahtml' => sprintf('<a id="cert_logo_url_btn" href="#" class="wpcw_insert_image button-secondary" data-uploader_title="%s" data-uploader_btn_text="%s" data-target="cert_logo_url"><span class="wpcw_insert_image_img"></span> %s</a>', __('Choose an image to use for your logo on the certificate...', 'wp_courseware'), __('Select Image', 'wp_courseware'), __('Select Image', 'wp_courseware'))), 'cert_background_type' => array('label' => __('Certificate Background', 'wp_courseware'), 'cssclass' => 'wpcw_cert_background_type', 'type' => 'radio', 'required' => 'true', 'data' => array('use_default' => sprintf('<b>%s</b> - %s', __('Built-in', 'wp_courseware'), __('Use the built-in certificate background.', 'wp_courseware')), 'use_custom' => sprintf('<b>%s</b> - %s', __('Custom', 'wp_courseware'), __('Use your own certificate background.', 'wp_courseware')))), 'cert_background_custom_url' => array('label' => __('Custom Background Image', 'wp_courseware'), 'type' => 'text', 'cssclass' => 'wpcw_cert_background_custom_url wpcw_image_upload_field', 'desc' => '&bull;&nbsp;' . __('The URL of your background image.', 'wp_courseware') . '<br/>&bull;&nbsp;' . sprintf(__('The background image must be <b>%d pixels wide, and %d pixels</b> high at <b>72 dpi</b> to render correctly. ', 'wp_courseware'), WPCW_CERTIFICATE_BG_WIDTH_PX, WPCW_CERTIFICATE_BG_HEIGHT_PX), 'validate' => array('type' => 'url', 'maxlen' => 300, 'minlen' => 1, 'error' => __('Please enter the URL of your certificate background image.', 'wp_courseware')), 'extrahtml' => sprintf('<a id="cert_background_custom_url_btn" href="#" class="wpcw_insert_image button-secondary" data-uploader_title="%s" data-uploader_btn_text="%s" data-target="cert_background_custom_url"><span class="wpcw_insert_image_img"></span> %s</a>', __('Choose an image to use for the certificate background...', 'wp_courseware'), __('Select Image', 'wp_courseware'), __('Select Image', 'wp_courseware'))));
    $settings = new SettingsForm($settingsFields, WPCW_DATABASE_SETTINGS_KEY, 'wpcw_form_settings_certificates');
    $settings->setSaveButtonLabel(__('Save ALL Settings', 'wp_courseware'));
    $settings->msg_settingsSaved = __('Settings successfully saved.', 'wp_courseware');
    $settings->msg_settingsProblem = __('There was a problem saving the settings.', 'wp_courseware');
    $settings->setAllTranslationStrings(WPCW_forms_getTranslationStrings());
    $settings->show();
    // RHS Support Information
    $page->showPageMiddle('23%');
    // Create a box where the admin can preview the certificates to see what they look like.
    $page->openPane('wpcw-certificates-preview', __('Preview Certificate', 'wp_courseware'));
    printf('<p>%s</p>', __('After saving the settings, you can preview the certificate using the button below. The preview opens in a new window.', 'wp_courseware'));
    printf('<div class="wpcw_btn_centre"><a href="%spdf_create_certificate.php?certificate=preview" target="_blank" class="button-primary">%s</a></div>', WPCW_plugin_getPluginPath(), __('Preview Certificate', 'wp_courseware'));
    $page->closePane();
    WPCW_docs_showSupportInfo($page);
    WPCW_docs_showSupportInfo_News($page);
    WPCW_docs_showSupportInfo_Affiliate($page);
    $page->showPageFooter();
}
コード例 #4
0
ファイル: admin_only.inc.php プロジェクト: nerdhaus/avse
/**
 * 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();
}
コード例 #5
0
/**
 * Shows the settings page for the plugin, shown just for the network page.
 */
function WPCW_showPage_Settings_Network_load()
{
    $page = new PageBuilder(true);
    $page->showPageHeader(__('WP Courseware - Settings', 'wp_courseware'), '75%', WPCW_icon_getPageIconURL());
    $settingsFields = array('section_access_key' => array('type' => 'break', 'html' => WPCW_forms_createBreakHTML(__('Licence Key Settings', 'wp_courseware'), false, true)), 'licence_key' => array('label' => __('Licence Key', 'wp_courseware'), 'type' => 'text', 'desc' => __('Your licence key for the WP Courseware plugin.', 'wp_courseware'), 'validate' => array('type' => 'string', 'maxlen' => 32, 'minlen' => 32, 'regexp' => '/^[A-Za-z0-9]+$/', 'error' => __('Please enter your 32 character licence key, which contains only letters and numbers.', 'wp_courseware'))));
    $settings = new SettingsForm($settingsFields, WPCW_DATABASE_SETTINGS_KEY, 'wpcw_form_settings_general');
    // Set strings and messages
    $settings->setAllTranslationStrings(WPCW_forms_getTranslationStrings());
    $settings->setSaveButtonLabel('Save ALL Settings', 'wp_courseware');
    // Form event handlers - processes the saved settings in some way
    $settings->afterSaveFunction = 'WPCW_showPage_Settings_afterSave';
    $settings->show();
    // RHS Support Information
    $page->showPageMiddle('23%');
    WPCW_docs_showSupportInfo($page);
    WPCW_docs_showSupportInfo_News($page);
    WPCW_docs_showSupportInfo_Affiliate($page);
    $page->showPageFooter();
}
コード例 #6
0
/**
 * Shows the documentation page for the plugin. TO TWEAK
 */
function WPCW_showPage_Documentation()
{
    // Wrapper added to format lists and other HTML correctly.
    printf('<div class="wpcw_docs_wrapper">');
    $page = new PageBuilder(true);
    $page->showPageHeader(__('WP Courseware - Documentation', 'wp_courseware'), '75%', WPCW_icon_getPageIconURL());
    ?>
	

	
	<?php 
    $page->openPane('wpcw-docs-shortcodes-progress', __('Course Progress Shortcodes', 'wp_courseware'));
    ?>
	<p><?php 
    _e('To show the current user progress, you can use the <code>[wpcourse]</code> shortcode. Here\'s a summary of the shortcode parameters for <code>[wpcourse]</code>:', 'wp_courseware');
    ?>
</p>
	<dl>
		<dt><?php 
    _e('course', 'wp_courseware');
    ?>
</dt>
		<dd><?php 
    _e('<em>(Required)</em> The ID of the course to show.', 'wp_courseware');
    ?>
</dd>
		
		<dt><?php 
    _e('show_title', 'wp_courseware');
    ?>
</dt>
		<dd><?php 
    _e('<em>(Optional)</em> If true, show the course title. (It can be <b>true</b> or <b>false</b>. By default, it\'s <b>false</b>).', 'wp_courseware');
    ?>
</dd>
		
		<dt><?php 
    _e('show_desc', 'wp_courseware');
    ?>
</dt>
		<dd><?php 
    _e('<em>(Optional)</em> If true, show the course description. (It can be <b>true</b> or <b>false</b>. By default, it\'s <b>false</b>).', 'wp_courseware');
    ?>
</dd>		
		
		<dt><?php 
    _e('module', 'wp_courseware');
    ?>
</dt>
		<dd><?php 
    _e('<em>(Optional)</em> The number of the module to show from the specified course.', 'wp_courseware');
    ?>
</dd>
		
		<dt><?php 
    _e('module_desc', 'wp_courseware');
    ?>
</dt>
		<dd><?php 
    _e('<em>(Optional)</em> If true, show the module descriptions. (It can be <b>true</b> or <b>false</b>. By default, it\'s <b>false</b>).', 'wp_courseware');
    ?>
</dd>
	</dl>
	
	<br/>
	<p><?php 
    _e('Here are some examples of how <code>[wpcourse]</code> shortcode works:', 'wp_courseware');
    ?>
</p>
	<dl>
		<dt><?php 
    _e('Example 1: <code>[wpcourse course="2" module_desc="false" show_title="false" show_desc="false" /]</code>', 'wp_courseware');
    ?>
</dt>
		<dd><?php 
    _e('Shows course 2, just with module and unit titles. Do not show course title, course description or module descriptions.', 'wp_courseware');
    ?>
</dd>
		
		<dt><?php 
    _e('Example 2: <code>[wpcourse course="2" /]</code>', 'wp_courseware');
    ?>
</dt>
		<dd><?php 
    _e('Exactly the same output as example 1.', 'wp_courseware');
    ?>
</dd>
		
		<dt><?php 
    _e('Example 3: <code>[wpcourse course="1" module="4" module_desc="true" /]</code>', 'wp_courseware');
    ?>
</dt>
		<dd><?php 
    _e('Shows module 4 from course 1, with module titles and descriptions, and unit titles.', 'wp_courseware');
    ?>
</dd>
		
		<dt><?php 
    _e('Example 4: <code>[wpcourse course="1" module_desc="true" show_title="true" show_desc="true" /]</code>', 'wp_courseware');
    ?>
</dt>
		<dd><?php 
    _e('Shows course 1, with course title, course description, module title, module description and unit titles.', 'wp_courseware');
    ?>
</dd>
	</dl>
	
	<?php 
    $page->closePane();
    ?>
	
	
	
	<?php 
    $page->openPane('wpcw-docs-shortcodes-example', __('WP Courseware Video Tutorials', 'wp_courseware'));
    ?>
	
	<div class="wpcw_vids"><h2><?php 
    _e('How to create a new course', 'wp_courseware');
    ?>
</h2>
		<iframe width="640" height="360" src="http://www.youtube.com/embed/x7q6T0R7vLg?rel=0" frameborder="0" allowfullscreen></iframe>
	</div>

	<div class="wpcw_vids"><h2><?php 
    _e('How to create a new module', 'wp_courseware');
    ?>
</h2>
		<iframe width="640" height="360" src="http://www.youtube.com/embed/v2h2y3iIOio?rel=0" frameborder="0" allowfullscreen></iframe>
	</div>
	
	<div class="wpcw_vids"><h2><?php 
    _e('How to create a new unit and assign it to a module', 'wp_courseware');
    ?>
</h2>
		<iframe width="640" height="360" src="http://www.youtube.com/embed/3nrLv0wxK3w?rel=0" frameborder="0" allowfullscreen></iframe>
	</div>

	<div class="wpcw_vids"><h2><?php 
    _e('How to edit and convert a post into a unit', 'wp_courseware');
    ?>
</h2>
		<iframe width="640" height="360" src="http://www.youtube.com/embed/zpnQSqKTePM?rel=0" frameborder="0" allowfullscreen></iframe>
	</div>
	
	<div class="wpcw_vids"><h2><?php 
    _e('How to create a quiz', 'wp_courseware');
    ?>
</h2>
		<iframe width="640" height="360" src="http://www.youtube.com/embed/DK2bhF9goAw?rel=0" frameborder="0" allowfullscreen></iframe>
	</div>

	<div class="wpcw_vids"><h2><?php 
    _e('How to add a course outline page', 'wp_courseware');
    ?>
</h2>
		<iframe width="640" height="360" src="http://www.youtube.com/embed/JR4k5SRlSD8?rel=0" frameborder="0" allowfullscreen></iframe>
	</div>

	<div class="wpcw_vids"><h2><?php 
    _e('How to add a course menu widget to the sidebar', 'wp_courseware');
    ?>
</h2>
		<iframe width="640" height="360" src="http://www.youtube.com/embed/mwsE7l9sfmg?rel=0" frameborder="0" allowfullscreen></iframe>
	</div>

	<div class="wpcw_vids"><h2><?php 
    _e('How to enroll students and track their progress', 'wp_courseware');
    ?>
</h2>
		<iframe width="640" height="360" src="http://www.youtube.com/embed/-1Gfh-3_Mxw?rel=0" frameborder="0" allowfullscreen></iframe>
	</div>
	
	<div class="wpcw_vids"><h2><?php 
    _e('How to use the grade book', 'wp_courseware');
    ?>
</h2>
		<iframe width="640" height="360" src="http://www.youtube.com/embed/dsQrDqew8yk?rel=0" frameborder="0" allowfullscreen></iframe>
	</div>

	<div class="wpcw_vids"><h2><?php 
    _e('How to import and export a course', 'wp_courseware');
    ?>
</h2>
		<iframe width="640" height="360" src="http://www.youtube.com/embed/8m4o5HHq-rw?rel=0" frameborder="0" allowfullscreen></iframe>
	</div>

	<div class="wpcw_vids"><h2><?php 
    _e('Bulk User Import and Course Enrollment via CSV', 'wp_courseware');
    ?>
</h2>
		<iframe width="640" height="360" src="http://www.youtube.com/embed/SPl2N9075LQ?rel=0" frameborder="0" allowfullscreen></iframe>
	</div>

	<div class="wpcw_vids"><h2><?php 
    _e('How to Generate a PDF Certificate of Completion for Your Course', 'wp_courseware');
    ?>
</h2>
		<iframe width="640" height="360" src="http://www.youtube.com/embed/5bPUkGlNefI?rel=0" frameborder="0" allowfullscreen></iframe>
	</div>
	
	<div class="wpcw_vids"><h2><?php 
    _e('WP Courseware Automated Course Enrollment with S2 Member', 'wp_courseware');
    ?>
</h2>
		<iframe width="640" height="360" src="http://www.youtube.com/embed/MHwAhWe7Xg0?rel=0" frameborder="0" allowfullscreen></iframe>
	</div>

	<div class="wpcw_vids"><h2><?php 
    _e('WP Courseware Automated Course Enrollment with Magic Members', 'wp_courseware');
    ?>
</h2>
		<iframe width="640" height="360" src="http://www.youtube.com/embed/JTlgEQ7KqY8?rel=0" frameborder="0" allowfullscreen></iframe>
	</div>

	<div class="wpcw_vids"><h2><?php 
    _e('WP Courseware Automated Course Enrollment with WishList Member', 'wp_courseware');
    ?>
</h2>
		<iframe width="640" height="360" src="http://www.youtube.com/embed/EkgpNvMfReY?rel=0" frameborder="0" allowfullscreen></iframe>
	</div>


	<?php 
    $page->closePane();
    ?>
	
	
	<?php 
    // Needed to show RHS section for panels
    $page->showPageMiddle('23%');
    // RHS Support Information
    WPCW_docs_showSupportInfo($page);
    WPCW_docs_showSupportInfo_News($page);
    WPCW_docs_showSupportInfo_Affiliate($page);
    $page->showPageFooter();
    printf('</div>');
}
コード例 #7
0
/**
 * Function that allows a module to be created or edited.
 */
function WPCW_showPage_ModifyModule_load()
{
    $page = new PageBuilder(true);
    $moduleDetails = false;
    $moduleID = false;
    $adding = false;
    // Trying to edit a course
    if (isset($_GET['module_id'])) {
        $moduleID = $_GET['module_id'] + 0;
        $moduleDetails = WPCW_modules_getModuleDetails($moduleID);
        // Abort if module not found.
        if (!$moduleDetails) {
            $page->showPageHeader(__('Edit Module', 'wp_courseware'), '75%', WPCW_icon_getPageIconURL());
            $page->showMessage(__('Sorry, but that module could not be found.', 'wp_courseware'), true);
            $page->showPageFooter();
            return;
        } else {
            $page->showPageHeader(__('Edit Module', 'wp_courseware'), '75%', WPCW_icon_getPageIconURL());
        }
    } else {
        $page->showPageHeader(__('Add Module', 'wp_courseware'), '75%', WPCW_icon_getPageIconURL());
        $adding = true;
    }
    global $wpcwdb;
    $formDetails = array('module_title' => array('label' => __('Module Title', 'wp_courseware'), 'type' => 'text', 'required' => true, 'cssclass' => 'wpcw_module_title', 'desc' => __('The title of your module. You <b>do not need to number the modules</b> - this is done automatically based on the order that they are arranged.', 'wp_courseware'), 'validate' => array('type' => 'string', 'maxlen' => 150, 'minlen' => 1, 'regexp' => '/^[^<>]+$/', 'error' => __('Please specify a name for your module, up to a maximum of 150 characters, just no angled brackets (&lt; or &gt;). Your trainees will be able to see this module title.', 'wp_courseware'))), 'parent_course_id' => array('label' => __('Associated Course', 'wp_courseware'), 'type' => 'select', 'required' => true, 'cssclass' => 'wpcw_associated_course', 'desc' => __('The associated training course that this module belongs to.', 'wp_courseware'), 'data' => WPCW_courses_getCourseList(__('-- Select a Training Course --', 'wp_courseware'))), 'module_desc' => array('label' => __('Module Description', 'wp_courseware'), 'type' => 'textarea', 'required' => true, 'cssclass' => 'wpcw_module_desc', 'desc' => __('The description of this module. Your trainees will be able to see this module description.', 'wp_courseware'), 'validate' => array('type' => 'string', 'maxlen' => 5000, 'minlen' => 1, 'error' => __('Please limit the description of your module to 5000 characters.', 'wp_courseware'))));
    $form = new RecordsForm($formDetails, $wpcwdb->modules, 'module_id');
    $form->customFormErrorMsg = __('Sorry, but unfortunately there were some errors saving the module details. Please fix the errors and try again.', 'wp_courseware');
    $form->setAllTranslationStrings(WPCW_forms_getTranslationStrings());
    // Useful place to go
    $directionMsg = '<br/></br>' . sprintf(__('Do you want to return to the <a href="%s">course summary page</a>?', 'wp_courseware'), admin_url('admin.php?page=WPCW_wp_courseware'));
    // Override success messages
    $form->msg_record_created = __('Module details successfully created.', 'wp_courseware') . $directionMsg;
    $form->msg_record_updated = __('Module details successfully updated.', 'wp_courseware') . $directionMsg;
    $form->setPrimaryKeyValue($moduleID);
    $form->setSaveButtonLabel(__('Save ALL Details', 'wp_courseware'));
    // See if we have a course ID to pre-set.
    if ($adding && ($courseID = WPCW_arrays_getValue($_GET, 'course_id'))) {
        $form->loadDefaults(array('parent_course_id' => $courseID));
    }
    // Call to re-order modules once they've been created
    $form->afterSaveFunction = 'WPCW_actions_modules_afterModuleSaved_formHook';
    $form->show();
    $page->showPageMiddle('20%');
    // Editing a module?
    if ($moduleDetails) {
        // ### Include a link to delete the module
        $page->openPane('wpcw-deletion-module', __('Delete Module?', 'wp_courseware'));
        printf('<a href="%s&action=delete_module&module_id=%d" class="wpcw_delete_item" title="%s">%s</a>', admin_url('admin.php?page=WPCW_wp_courseware'), $moduleID, __("Are you sure you want to delete the this module?\n\nThis CANNOT be undone!", 'wp_courseware'), __('Delete this Module', 'wp_courseware'));
        printf('<p>%s</p>', __('Units will <b>not</b> be deleted, they will <b>just be disassociated</b> from this module.', 'wp_courseware'));
        $page->closePane();
        // #### Show a list of all sub-units
        $page->openPane('wpcw-units-module', __('Units in this Module', 'wp_courseware'));
        $unitList = WPCW_units_getListOfUnits($moduleID);
        if ($unitList) {
            printf('<ul class="wpcw_unit_list">');
            foreach ($unitList as $unitID => $unitObj) {
                printf('<li>%s %d - %s</li>', __('Unit', 'wp_courseware'), $unitObj->unit_meta->unit_number, $unitObj->post_title);
            }
            printf('</ul>');
        } else {
            printf('<p>%s</p>', __('There are currently no units in this module.', 'wp_courseware'));
        }
    }
    $page->showPageFooter();
}