コード例 #1
0
function spa_permissions_add_auth_form()
{
    ?>
<script type="text/javascript">
    jQuery(document).ready(function() {
    	spjAjaxForm('sfauthnew', '');
    });
</script>
<?php 
    spa_paint_options_init();
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=permissions-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=newauth';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfauthnew" name="sfauthnew">
<?php 
    echo sp_create_nonce('forum-adminform_authnew');
    spa_paint_open_tab(spa_text('Permissions') . ' - ' . spa_text('Add New Authorization'), true);
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Add New Authorization'), 'true', 'create-new-authorization');
    ?>
                    <br /><div class="sfoptionerror">
                    <?php 
    spa_etext('Please note, this will create a new singular authorization.');
    ?>
                    <?php 
    spa_etext('However, by default, it will not be used by anything in core.');
    ?>
                    <?php 
    spa_etext('This authorization could be used for a profile authorization or by a theme or plugin.');
    ?>
                    <?php 
    spa_etext('Please see the popup help for more information.');
    ?>
                    </div><br />
<?php 
    spa_paint_input(spa_text('Authorization name'), 'auth_name', '');
    spa_paint_input(spa_text('Authorization description'), 'auth_desc', '');
    spa_paint_checkbox(spa_text('Activate authorization'), 'auth_active', true);
    spa_paint_checkbox(spa_text('Authorization is ignored for guests'), 'auth_guests', false);
    spa_paint_checkbox(spa_text('Authorization requires enabling (recommend false'), 'auth_enabling', false);
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_perm_add_auth_panel');
    spa_paint_close_container();
    ?>
	<div class="sfform-submit-bar">
	<input type="submit" class="button-primary" id="saveit" name="saveit" value="<?php 
    spa_etext('Create New Authorization');
    ?>
" />
	</div>
	<?php 
    spa_paint_close_tab();
    ?>
	</form>
	<div class="sfform-panel-spacer"></div>
<?php 
}
コード例 #2
0
function spa_plugins_upload_form()
{
    # Make sure only super admin can upload on multisite
    if (is_multisite() && !is_super_admin()) {
        spa_etext('Access denied - you do not have permission');
        die;
    }
    spa_paint_options_init();
    spa_paint_open_tab(spa_text('Upload Plugin') . ' - ' . spa_text('Upload a Simple:Press Plugin'), true);
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Upload Plugin'), true, 'upload-plugin');
    echo '<p>' . spa_text('Upload a Simple:Press plugin in .zip format') . '</p>';
    echo '<p>' . spa_text('If you have a plugin in a .zip format, you may upload it here') . '</p>';
    ?>
        	<form method="post" enctype="multipart/form-data" action="<?php 
    echo self_admin_url('update.php?action=upload-sp-plugin');
    ?>
" id="sfpluginuploadform" name="sfpluginuploadform">
                <?php 
    echo sp_create_nonce('forum-plugin_upload');
    ?>
        		<p><input type="file" id="pluginzip" name="pluginzip" /></p>
        		<p><input type="button" class="button-primary" id="saveupload" name="saveupload" value="<?php 
    spa_etext('Upload Now');
    ?>
" onclick="jQuery('#saveupload').attr('disabled', 'disabled'); javascript:document.sfpluginuploadform.submit();" /></p>
        	</form>
<?php 
    spa_paint_close_fieldset();
    do_action('sph_plugins_upload_panel');
    spa_paint_close_panel();
    spa_paint_close_container();
    spa_paint_close_tab();
}
コード例 #3
0
function spa_toolbox_uninstall_form()
{
    ?>
<script type="text/javascript">
    jQuery(document).ready(function() {
    	spjAjaxForm('sfuninstallform', '');
    });
</script>
<?php 
    $sfoptions = spa_get_uninstall_data();
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=toolbox-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=uninstall';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfuninstallform" name="sfuninstall">
	<?php 
    echo sp_create_nonce('forum-adminform_uninstall');
    spa_paint_options_init();
    #== UNINSTALL Tab ==========================================================
    spa_paint_open_tab(spa_text('Toolbox') . ' - ' . spa_text('Uninstall'), true);
    spa_paint_open_panel();
    echo '<br /><div class="sfoptionerror">';
    spa_etext('Should you, at any time, decide to remove Simple:Press, check the uninstall option below and then deactivate the Simple Press plugin in the standard WP fashion');
    echo '.<br />';
    spa_etext('If you have initiated uninstall, but changed your mind prior to Simple Press plugin deactivation, you can uncheck the uninstall option and it will be reversed');
    echo '.<br />';
    echo '<br />';
    spa_etext('UNINSTALLING SIMPLE PRESS WILL REMOVE ALL FORUM DATA FROM YOUR DATABASE');
    echo '!<br />';
    echo '<br />';
    spa_etext('UNINSTALLING SIMPLE PRESS WILL REMOVE ALL STORAGE LOCATIONS IF YOU ALSO ENABLE THE STORAGE LOCATUON REMOVAL OPTION');
    echo '!<br />';
    echo '<br />';
    spa_etext('ONCE YOU ENABLE UNINSTALL AND DEACTIVATE THE SIMPLE PRESS PLUGIN, THIS ACTION CAN NOT BE REVERSED');
    echo '!<br />';
    echo '<br />';
    spa_etext('Please note that you will still need to remove the Simple:Press core plugin files manually or use the wp plugin deletion functionalty');
    echo '.<br />';
    echo '</div>';
    spa_paint_open_fieldset(spa_text('Removing Simple:Press'), true, 'uninstall');
    spa_paint_checkbox(spa_text('Uninstall Simple Press - Requires plugin deactivation after enabling option (this will completely remove Simple:Press database entries)'), 'sfuninstall', $sfoptions['sfuninstall']);
    spa_paint_checkbox(spa_text('When uninstalling, completely remove Simple:Press storage locations'), 'removestorage', $sfoptions['removestorage']);
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_toolbox_uninstall_panel');
    spa_paint_close_container();
    ?>
	<div class="sfform-submit-bar">
	<input type="submit" class="button-primary" id="saveit" name="saveit" value="<?php 
    spa_etext('Uninstall');
    ?>
" />
	</div>
	</form>
<?php 
    spa_paint_close_tab();
}
function spa_toolbox_environment_form()
{
    #== ENVIRONMENT INFO Tab ==========================================================
    global $wp_version, $wpdb;
    include_once ABSPATH . 'wp-admin/includes/plugin.php';
    $theme = wp_get_theme();
    $wp_plugins = get_plugins();
    $sp_plugins = sp_get_plugins();
    spa_paint_open_tab(spa_text('Toolbox') . ' - ' . spa_text('Environment'), true);
    spa_paint_open_fieldset(spa_text('Environment'), false);
    echo '<div id="sp-environment-data">';
    echo '<table class=:widefat">';
    spa_env_open(spa_text('Simple:Press'));
    spa_env_info(spa_text('Version'), SPVERSION);
    spa_env_info(spa_text('Build'), SPBUILD);
    spa_env_info(spa_text('Release'), SPRELEASE);
    spa_env_close();
    spa_env_open(spa_text('WordPress'));
    spa_env_info(spa_text('Version'), $wp_version);
    spa_env_info(spa_text('Language'), get_bloginfo('language'));
    spa_env_info(spa_text('Character Set'), get_bloginfo('charset'));
    spa_env_info(spa_text('Theme'), $theme->get('Name'));
    spa_env_close();
    spa_env_open(spa_text('PHP'));
    spa_env_info(spa_text('Version'), phpversion());
    spa_env_info(spa_text('Memory'), ini_get('memory_limit'));
    spa_env_info(spa_text('Max Upload'), ini_get('upload_max_filesize'));
    spa_env_info(spa_text('Timeout'), ini_get('user_ini.cache_ttl'));
    spa_env_close();
    spa_env_open(spa_text('MySQL'));
    spa_env_info(spa_text('Version'), $wpdb->db_version());
    spa_env_info(spa_text('Prefix'), $wpdb->prefix);
    spa_env_close();
    spa_env_open(spa_text('Server'));
    spa_env_info(spa_text('Version'), $_SERVER['SERVER_SOFTWARE']);
    spa_env_close();
    spa_env_open(spa_text('WP Plugins'));
    foreach (array_keys($wp_plugins) as $key) {
        if (is_plugin_active($key)) {
            $plugin = $wp_plugins[$key];
            spa_env_list($plugin['Name'], $plugin['Version']);
        }
    }
    spa_env_close();
    spa_env_open(spa_text('SP Plugins'));
    foreach ((array) $sp_plugins as $plugin_file => $plugin_data) {
        if (sp_is_plugin_active($plugin_file)) {
            spa_env_list($plugin_data['Name'], $plugin_data['Version']);
        }
    }
    spa_env_close();
    echo '</table>';
    echo '</div>';
    spa_paint_close_fieldset();
    do_action('sph_toolbox_environment_panel');
    spa_paint_close_container();
    spa_paint_close_tab();
}
コード例 #5
0
function spa_toolbox_errorlog_form()
{
    ?>
<script type="text/javascript">
    jQuery(document).ready(function() {
    	spjAjaxForm('sfclearlog', 'sfreloadel');
    });
</script>
<?php 
    $sflog = spa_get_errorlog_data();
    spa_paint_open_tab(spa_text('Toolbox') . ' - ' . spa_text('Error Log'), true);
    spa_paint_open_fieldset(spa_text('Error Log'), false);
    echo '<p>' . spa_text('Error Logging can be disabled in the Global Options panel') . '<br /></p>';
    echo "<table class='sfhelptext'><tr>";
    echo "<td class='spaErrError spaErrCell'><b>" . spa_text('Error') . '</b></td>';
    echo "<td class='spaErrWarning spaErrCell'><b>" . spa_text('Warning') . '</b></td>';
    echo "<td class='spaErrNotice spaErrCell'><b>" . spa_text('Notice') . '</b></td>';
    echo "<td class='spaErrStrict spaErrCell'><b>" . spa_text('Strict') . '</b></td>';
    echo "</tr><tr>";
    echo "<td class='spaErrCellDesc'>" . spa_text('Errors should be reported to Simple:Press support as they may effect the proper behaviour of your forum') . '</td>';
    echo "<td class='spaErrCellDesc'>" . spa_text('Warnings suggest a code conflict of some type that should be investigated but which will not stop Simple:Press execution') . '</td>';
    echo "<td class='spaErrCellDesc'>" . spa_text('Notices are generally non-important and have no effect on Simple:Press execution. We make every effort to clear these when we are informed of them') . '</td>';
    echo "<td class='spaErrCellDesc'>" . spa_text('If you receive any Strict entries they are non-urgent but please inform Simple:Press support so we can deal with them') . '</td>';
    echo "</tr></table><p>&nbsp;</p>";
    if (!$sflog) {
        echo '<p>' . spa_text('There are no Error Log Entries') . '</p>';
    } else {
        echo "<table class='wp-list-table widefat'>";
        foreach ($sflog as $log) {
            echo '<tr>';
            echo "<td class='sferror " . $log['error_cat'] . "'>" . sp_date('d', $log['error_date']) . ' ' . sp_date('t', $log['error_date']) . ' | ' . $log['error_cat'] . ' | ' . $log['error_count'] . ' | ' . $log['error_type'] . '<hr />';
            echo $log['error_text'] . '</td>';
            echo '</tr>';
        }
        echo '</table>';
    }
    spa_paint_close_fieldset();
    do_action('sph_toolbox_error_panel');
    spa_paint_close_container();
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=toolbox-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=sfclearlog';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfclearlog" name="sfclearlog">
	<?php 
    echo sp_create_nonce('forum-adminform_clearlog');
    ?>
	<div class="sfform-submit-bar">
	<input type="submit" class="button-primary" id="saveit" name="saveit" value="<?php 
    spa_etext('Empty Error Log');
    ?>
" />
	</div>
	</form>
<?php 
    spa_paint_close_tab();
}
function spa_forums_global_rssset_form($id)
{
    ?>
<script type="text/javascript">
    jQuery(document).ready(function() {
    	spjAjaxForm('sfglobalrssset', 'sfreloadfd');
    });
</script>
<?php 
    spa_paint_options_init();
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=globalrssset';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfglobalrssset" name="sfglobalrssset">
<?php 
    echo sp_create_nonce('forum-adminform_globalrssset');
    spa_paint_open_tab(spa_text('Forums') . ' - ' . spa_text('Global RSS Settings'), true);
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Globally Enable/Disable RSS Feeds'), false);
    echo '<tr><td colspan="2"><br />';
    echo '<div class="sfoptionerror">';
    spa_etext('Warning: Enabling or disabling RSS feeds from this form will apply that setting to ALL forums and overwrite any existing RSS feed settings. If you wish to individually enable/disable RSS feeds for a single forum, please visit the manage forums admin panel - edit the forum and set the RSS feed status there');
    echo '<br /><br />';
    if ($id == 1) {
        spa_etext('Please press the confirm button below to disable RSS feeds for all forums');
    }
    if ($id == 0) {
        spa_etext('Please press the confirm button below to enable RSS feeds for all forums');
    }
    echo '</div><br />';
    echo '</td></tr>';
    echo '<input type="hidden" name="sfglobalrssset" value="' . $id . '" />';
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_forums_rss_panel');
    spa_paint_close_container();
    ?>
		<div class="sfform-submit-bar">
			<input type="submit" class="button-primary" id="saveit" name="saveit" value="<?php 
    spa_etext('Confirm RSS Feed Status');
    ?>
" />
			<input type="button" class="button-primary" onclick="javascript:jQuery('#sfallrss').html('');" id="sfallrsscancel" name="sfallrsscancel" value="<?php 
    spa_etext('Cancel');
    ?>
" />
		</div>
	</form>
	<?php 
    spa_paint_close_tab();
    ?>

	<div class="sfform-panel-spacer"></div>
<?php 
}
コード例 #7
0
function spa_toolbox_changelog_form()
{
    #== CHANGELOG Tab ==========================================================
    spa_paint_options_init();
    spa_paint_open_tab(spa_text('Toolbox') . ' - ' . spa_text('Change Log'), true);
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Change Log'), false);
    # Display current change log if available or passed log
    if (isset($_POST['clselect'])) {
        $current = $_POST['clselect'];
        $cFile = 'change-log-' . $_POST['clselect'] . '.txt';
    } else {
        $cFile = 'change-log-' . SPBUILD . '.txt';
        $current = 0;
    }
    echo '<div id="sp-changelog-data">';
    $c = wp_remote_get('http://simple-press.com/downloads/simple-press/changelogs/' . $cFile);
    if (is_wp_error($c) || wp_remote_retrieve_response_code($c) != 200) {
        $b = substr($cFile, 11);
        $b = str_replace('.txt', '', $b);
        echo '<p>' . sprintf(spa_text('No change log file found for build %s'), $b) . '</p>';
    } else {
        echo wpautop($c['body']);
    }
    echo '</div>';
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    $c = wp_remote_get('http://simple-press.com/downloads/simple-press/changelogs/log-index.xml');
    if (is_wp_error($c) || wp_remote_retrieve_response_code($c) != 200) {
        echo '<p>' . spa_text('Unable to communicate with Simple Press server') . '</p>';
    } else {
        $l = new SimpleXMLElement($c['body']);
        if (!empty($l)) {
            spa_paint_open_panel();
            spa_paint_open_fieldset(spa_text('Review Change Logs'), false);
            echo '<div id="sp-changelog-list">';
            echo '<form name="loadchangelog" method="post" action="admin.php?page=simple-press/admin/panel-toolbox/spa-toolbox.php&amp;tab=changelog">';
            echo '<select name="clselect" class="wp-core-ui" style="vertical-align:middle;font-weight: normal;font-size:13px;">';
            foreach ($l->log as $i => $x) {
                if ($x->build == $current ? $s = " selected='selected' " : ($s = '')) {
                }
                echo "<option class='wp-core-ui' value='" . $x->build . "' {$s}>" . $x->build . ' (' . $x->version . ') - ' . $x->date . '</option>';
            }
            echo '</select>';
            echo '<input type="submit" class="button-primary" id="gochangelog" name="gochangelog" value="' . spa_text('Display Change Log') . '" />';
            echo '</form>';
            echo '</div>';
            spa_paint_close_fieldset();
            spa_paint_close_panel();
        }
    }
    do_action('sph_toolbox_changelog_panel');
    spa_paint_close_container();
    echo '<div class="sfform-panel-spacer"></div>';
    spa_paint_close_tab();
}
コード例 #8
0
function spa_plugins_user_form($admin, $save, $form, $reload)
{
    global $spAPage;
    if ($form) {
        ?>
        <script type="text/javascript">
            jQuery(document).ready(function() {
            	jQuery('#sfpluginsuser').ajaxForm({
            		target: '#sfmsgspot',
            		success: function() {
            			<?php 
        if (!empty($reload)) {
            echo "jQuery('#" . $reload . "').click();";
        }
        ?>
            			jQuery('#sfmsgspot').fadeIn();
            			jQuery('#sfmsgspot').fadeOut(6000);
            		}
            	});

    		<?php 
        if ((defined('SP_USE_PRETTY_CBOX_ADMIN') && SP_USE_PRETTY_CBOX_ADMIN == true || !defined('SP_USE_PRETTY_CBOX_ADMIN')) && $spAPage != 'plugins') {
            # Checkboxes/radio buttons
            ?>
    			jQuery("input[type=checkbox],input[type=radio]").prettyCheckboxes();
    		<?php 
        }
        ?>

            });
        </script>
<?php 
        spa_paint_options_init();
        $ahahURL = SFHOMEURL . 'index.php?sp_ahah=plugins-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . "&amp;saveform=plugin&amp;func={$save}";
        echo '<form action="' . $ahahURL . '" method="post" id="sfpluginsuser" name="sfpluginsuser">';
        echo sp_create_nonce('forum-adminform_userplugin');
    }
    call_user_func($admin);
    if ($form) {
        ?>
    	<div class="sfform-submit-bar">
    	   <input type="submit" class="button-primary" value="<?php 
        spa_etext('Update');
        ?>
" />
    	</div>
        </form>

        <?php 
        spa_paint_close_tab();
        ?>

    	<div class="sfform-panel-spacer"></div>
<?php 
    }
}
コード例 #9
0
function spa_options_email_form()
{
    ?>
<script type="text/javascript">
    jQuery(document).ready(function() {
    	spjAjaxForm('sfemailform', '');
    });
</script>
<?php 
    $sfoptions = spa_get_email_data();
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=options-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=email';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfemailform" name="sfemail">
	<?php 
    echo sp_create_nonce('forum-adminform_email');
    spa_paint_options_init();
    #== EMAIL Tab ============================================================
    spa_paint_open_tab(spa_text('Options') . ' - ' . spa_text('Email Settings'));
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('New User Email'), true, 'new-user-email');
    spa_paint_checkbox(spa_text('Use the Simple:Press new user email version'), 'sfusespfreg', $sfoptions['sfusespfreg']);
    echo '<p><strong>' . spa_text('The following placeholders are available: %USERNAME%, %BLOGNAME%, %SITEURL%, %LOGINURL%, %PWURL%') . '</strong></p>';
    spa_paint_input(spa_text('Email subject line'), 'sfnewusersubject', $sfoptions['sfnewusersubject'], false, true);
    spa_paint_wide_textarea(spa_text('Email message (no html)'), 'sfnewusertext', $sfoptions['sfnewusertext'], $submessage = '', 4);
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_options_email_left_panel');
    spa_paint_tab_right_cell();
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Email Address Settings'), true, 'email-address-settings');
    spa_paint_checkbox(spa_text('Use the following email settings'), 'sfmailuse', $sfoptions['sfmailuse']);
    spa_paint_input(spa_text('The senders name'), 'sfmailsender', $sfoptions['sfmailsender'], false, false);
    spa_paint_input(spa_text('The email from name'), 'sfmailfrom', $sfoptions['sfmailfrom'], false, false);
    spa_paint_input(spa_text('The email domain name'), 'sfmaildomain', $sfoptions['sfmaildomain'], false, false);
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_options_email_right_panel');
    spa_paint_close_container();
    ?>
	<div class="sfform-submit-bar">
	<input type="submit" class="button-primary" id="saveit" name="saveit" value="<?php 
    spa_etext('Update Email Options');
    ?>
" />
	</div>
<?php 
    spa_paint_close_tab();
    ?>
	</form>
<?php 
}
コード例 #10
0
function spa_toolbox_toolbox_form()
{
    ?>
<script type="text/javascript">
    jQuery(document).ready(function() {
    	spjAjaxForm('sftoolboxform', '');
    });
</script>
<?php 
    $sfoptions = spa_get_toolbox_data();
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=toolbox-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=toolbox';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sftoolboxform" name="sftoolbox">
	<?php 
    echo sp_create_nonce('forum-adminform_toolbox');
    spa_paint_options_init();
    #== TOOLBOX Tab ============================================================
    spa_paint_open_tab(spa_text('Toolbox') . ' - ' . spa_text('Toolbox'));
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Current Version/Build'), false);
    $version = spa_text('Version:') . '&nbsp;<strong>' . sp_get_option('sfversion') . '</strong>';
    $build = spa_text('Build:  ') . '&nbsp;<strong>' . sp_get_option('sfbuild') . '</strong>';
    echo $version . '&nbsp;&nbsp;&nbsp;&nbsp;' . $build;
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_toolbox_toolbox_left_panel');
    spa_paint_tab_right_cell();
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Modify Build Number'), true, 'modify-build-number');
    echo '<div class="sfoptionerror">' . spa_text('WARNING: This value should not be changed unless requested by the Simple:Press team in the support forum as it may cause the install/upgrade script to be re-run.') . '</div>';
    spa_paint_input(spa_text('Build number'), "sfbuild", sp_get_option('sfbuild'), false, false);
    spa_paint_checkbox(spa_text('Force upgrade to build number'), "sfforceupgrade", $sfoptions['sfforceupgrade']);
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_toolbox_toolbox_right_panel');
    spa_paint_close_container();
    ?>
	<div class="sfform-submit-bar">
	<input type="submit" class="button-primary" id="saveit" name="saveit" value="<?php 
    spa_etext('Update Toolbox');
    ?>
" />
	</div>
<?php 
    spa_paint_close_tab();
    ?>
	</form>
<?php 
}
function spa_permissions_reset_perms_form()
{
    ?>
<script type="text/javascript">
    jQuery(document).ready(function() {
    	spjAjaxForm('sfresetpermissions', 'sfreloadpb');
    });
</script>
<?php 
    spa_paint_options_init();
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=permissions-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=resetperms';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfresetpermissions" name="sfresetpermissions">
<?php 
    echo sp_create_nonce('forum-adminform_resetpermissions');
    spa_paint_open_tab(spa_text('Forums') . ' - ' . spa_text('Reset All Permission'), true);
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Reset all permissions back to initial state.'), 'true', 'reset-permissions');
    echo '<p>';
    spa_etext('Warning! You are about to reset your permissions back to the install state.');
    echo '</p>';
    echo '<p>';
    spa_etext('This will delete all roles and permissions for your forums. You will have to give your users access to your forums again.');
    echo '</p>';
    echo '<p>';
    echo sprintf(spa_text('Please note that this action %s can NOT be reversed %s'), '<strong>', '</strong>');
    echo '</p>';
    echo '<p>';
    spa_etext('Click on the reset permissions button below to proceed');
    echo '</p>';
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_close_container();
    ?>
		<div class="sfform-submit-bar">
		<input type="submit" class="button-primary" id="saveit" name="saveit" value="<?php 
    spa_etext('Reset Permissions');
    ?>
" />
		</div>
	</form>
	<?php 
    spa_paint_close_tab();
    ?>

	<div class="sfform-panel-spacer"></div>
<?php 
}
コード例 #12
0
function spa_forums_remove_perms_form()
{
    ?>
<script type="text/javascript">
    jQuery(document).ready(function() {
    	spjAjaxForm('sfallpermissionsdel', 'sfreloadfb');
    });
</script>
<?php 
    spa_paint_options_init();
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=removeperms';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfallpermissionsdel" name="sfallpermissionsdel">
<?php 
    echo sp_create_nonce('forum-adminform_allpermissionsdelete');
    spa_paint_open_tab(spa_text('Forums') . ' - ' . spa_text('Delete All Permission Sets'), true);
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Delete All Forum Permission Sets'), 'true', 'delete-all-forum-permission-sets');
    echo '<p>';
    spa_etext('Warning! You are about to delete all permission sets');
    echo '</p>';
    echo '<p>';
    spa_etext('This will delete all permission sets for all groups and forums');
    echo '</p>';
    echo '<p>';
    echo sprintf(spa_text('Please note that this action %s can NOT be reversed %s'), '<strong>', '</strong>');
    echo '</p>';
    echo '<p>';
    spa_etext('Click on the delete all permission sets button below to proceed');
    echo '</p>';
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_close_container();
    ?>
		<div class="sfform-submit-bar">
		<input type="submit" class="button-primary" id="saveit" name="saveit" value="<?php 
    spa_etext('Delete All Permission Sets');
    ?>
" />
		</div>
	</form>
	<?php 
    spa_paint_close_tab();
    ?>

	<div class="sfform-panel-spacer"></div>
<?php 
}
コード例 #13
0
function spa_admins_your_options_form()
{
    global $spThisUser;
    ?>
<script type="text/javascript">
    jQuery(document).ready(function() {
    	spjAjaxForm('sfmyadminoptionsform', 'sfreloadao');
    });
</script>
<?php 
    $sfadminsettings = spa_get_admins_your_options_data();
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=admins-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=youradmin';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfmyadminoptionsform" name="sfmyadminoptions">
	<?php 
    echo sp_create_nonce('my-admin_options');
    spa_paint_options_init();
    spa_paint_open_tab(spa_text('Admins') . ' - ' . spa_text('Your Admin Options'), true);
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Your Admin/Moderator Options'), 'true', 'your-admin-options');
    spa_paint_checkbox(spa_text('Receive email notification on new topic/post'), 'sfnotify', $sfadminsettings['sfnotify']);
    spa_paint_checkbox(spa_text('Receive notification (within forum - not email) on topic/post edits'), 'notify-edited', $sfadminsettings['notify-edited']);
    spa_paint_checkbox(spa_text('Bypass the Simple Press logout redirect'), 'bypasslogout', $sfadminsettings['bypasslogout']);
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_admins_options_top_panel');
    if ($spThisUser->admin) {
        spa_paint_open_panel();
        spa_paint_open_fieldset(spa_text('Set Your Moderator Options'), 'true', 'set-moderator-options');
        spa_paint_checkbox(spa_text('Grant all moderators the same option settings as above'), 'setmods', $sfadminsettings['setmods']);
        spa_paint_close_fieldset();
        spa_paint_close_panel();
    }
    do_action('sph_admins_options_bottom_panel');
    spa_paint_close_container();
    ?>
	<div class="sfform-submit-bar">
	<input type="submit" class="button-primary" id="saveit" name="saveit" value="<?php 
    spa_etext('Update Your Admin Options');
    ?>
" />
	</div>
<?php 
    spa_paint_close_tab();
    ?>
	</form>
<?php 
}
コード例 #14
0
function spa_themes_css_form()
{
    $css = '';
    $id = 0;
    # get current theme
    $curTheme = sp_get_option('sp_current_theme');
    $rec = sp_get_sfmeta('css', $curTheme['theme']);
    if ($rec) {
        $css = $rec[0]['meta_value'];
        $id = $rec[0]['meta_id'];
    }
    ?>
<script type="text/javascript">
jQuery(document).ready(function() {
	spjAjaxForm('speditcss', '');
});
</script>
<?php 
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=themes-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=css';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="speditcss" name="speditcss">
	<?php 
    echo sp_create_nonce('forum-adminform_css-editor');
    spa_paint_options_init();
    spa_paint_open_tab(spa_text('CSS Editor') . ' - ' . spa_text('Custom Simple:Press Theme CSS'), true);
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('CSS Editor'), true, 'css-editor');
    echo '<div>';
    echo '<textarea rows="25" name="spnewcontent" id="spnewcontent" tabindex="1">' . $css . '</textarea>';
    echo '<input type="hidden" name="metaId" value="' . $id . '" />';
    echo '</div>';
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_close_container();
    ?>
    	<div class="sfform-submit-bar">
    	   <input type="submit" class="button-primary" id="saveit" name="saveit" value="<?php 
    spa_etext('Update CSS');
    ?>
" />
    	</div>
<?php 
    spa_paint_close_tab();
    echo '</form>';
}
function spa_usergroups_create_usergroup_form()
{
    global $spPaths;
    ?>
<script type="text/javascript">
    jQuery(document).ready(function() {
    	spjAjaxForm('sfusergroupnew', 'sfreloadub');
    });
</script>
<?php 
    spa_paint_options_init();
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=usergroups-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=newusergroup';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfusergroupnew" name="sfusergroupnew">
<?php 
    echo sp_create_nonce('forum-adminform_usergroupnew');
    spa_paint_open_tab(spa_text('User Groups') . ' - ' . spa_text('Create New User Group'), true);
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Edit User Group'), 'true', 'edit-user-group');
    spa_paint_input(spa_text('User Group Name'), 'usergroup_name', '', false, true);
    spa_paint_input(spa_text('User Group Description'), 'usergroup_desc', '', false, true);
    spa_paint_select_start(spa_text('Select Badge'), 'usergroup_badge', 'usergroup_badge');
    spa_select_icon_dropdown('usergroup_badge', spa_text('Select Badge'), SF_STORE_DIR . '/' . $spPaths['ranks'] . '/', '', false);
    spa_paint_select_end('<small>(' . spa_text('Upload badges on the Components - Forum Ranks admin panel') . ')</small>');
    spa_paint_checkbox(spa_text('Allow members to join usergroup'), 'usergroup_join', false, false, false, false, '<small>' . spa_text('(Indicates that members are allowed to choose to join this usergroup on their profile page)') . '</small>');
    spa_paint_checkbox(spa_text('Is moderator'), 'usergroup_is_moderator', false, false, false, false, '<small>' . spa_text('(Indicates that members of this usergroup are considered Moderators)') . '</small>');
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_usergroup_create_panel');
    spa_paint_close_container();
    ?>
		<div class="sfform-submit-bar">
		<input type="submit" class="button-primary" id="saveit" name="saveit" value="<?php 
    spa_etext('Create New User Group');
    ?>
" />
		</div>
		</form>
	<?php 
    spa_paint_close_tab();
    ?>

	<div class="sfform-panel-spacer"></div>
<?php 
}
コード例 #16
0
function spa_forums_global_perm_form()
{
    ?>
<script type="text/javascript">
    jQuery(document).ready(function() {
    	spjAjaxForm('sfnewglobalpermission', 'sfreloadfb');
    });
</script>
<?php 
    spa_paint_options_init();
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=globalperm';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfnewglobalpermission" name="sfnewglobalpermission">
<?php 
    echo sp_create_nonce('forum-adminform_globalpermissionnew');
    spa_paint_open_tab(spa_text('Forums') . ' - ' . spa_text('Add Global Permission Set'), true);
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Add a User Group Permission Set to All Forums'), 'true', 'add-a-user-group-permission-set-to-all-forums');
    spa_paint_select_start(spa_text('Select usergroup'), 'usergroup_id', '');
    spa_display_usergroup_select(false, 0, false);
    spa_paint_select_end();
    spa_paint_select_start(spa_text('Select permission set'), 'role', '');
    spa_display_permission_select(false, 0, false);
    spa_paint_select_end();
    echo '<p>' . spa_text('Caution:  Any current permission sets for the selected usergroup for ANY forum may be overwritten') . '</p>';
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_forums_global_perm_panel');
    spa_paint_close_container();
    ?>
		<div class="sfform-submit-bar">
		<input type="submit" class="button-primary" id="saveit" name="saveit" value="<?php 
    spa_etext('Add Global Permission');
    ?>
" />
		</div>
	</form>
	<?php 
    spa_paint_close_tab();
    ?>

	<div class="sfform-panel-spacer"></div>
<?php 
}
コード例 #17
0
function spa_admins_global_options_form()
{
    ?>
<script type="text/javascript">
    jQuery(document).ready(function() {
    	spjAjaxForm('sfadminoptionsform', '');
    });
</script>
<?php 
    $sfoptions = spa_get_admins_global_options_data();
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=admins-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=globaladmin';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfadminoptionsform" name="sfadminoptions">
	<?php 
    echo sp_create_nonce('global-admin_options');
    spa_paint_options_init();
    spa_paint_open_tab(spa_text('Admins') . " - " . spa_text('Global Admin Options'));
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Admin Options'), 'true', 'global-options');
    spa_paint_checkbox(spa_text('Display forum statistics in the dashboard'), 'sfdashboardstats', $sfoptions['sfdashboardstats']);
    spa_paint_checkbox(spa_text('Approve all posts in topic in moderation when an admin posts to the topic'), 'sfadminapprove', $sfoptions['sfadminapprove']);
    spa_paint_checkbox(spa_text('Approve all posts in topic in moderation when a moderator posts to the topic'), 'sfmoderapprove', $sfoptions['sfmoderapprove']);
    spa_paint_checkbox(spa_text('Display post/topic edit notices to users'), 'editnotice', $sfoptions['editnotice']);
    spa_paint_checkbox(spa_text('Display post/topic move notices to users'), 'movenotice', $sfoptions['movenotice']);
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_admins_global_left_panel');
    spa_paint_tab_right_cell();
    do_action('sph_admins_global_right_panel');
    spa_paint_close_container();
    ?>
	<div class="sfform-submit-bar">
	<input type="submit" class="button-primary" id="saveit" name="saveit" value="<?php 
    spa_etext('Update Global Admin Options');
    ?>
" />
	</div>
<?php 
    spa_paint_close_tab();
    ?>
	</form>
<?php 
}
コード例 #18
0
function spa_plugins_user_form($admin, $save, $form, $reload)
{
    global $spAPage;
    if ($form) {
        ?>
        <script type="text/javascript">
            jQuery(document).ready(function() {
            	jQuery('#sfpluginsuser').ajaxForm({
            		target: '#sfmsgspot',
            		success: function() {
            			<?php 
        if (!empty($reload)) {
            echo "jQuery('#" . $reload . "').click();";
        }
        ?>
            			jQuery('#sfmsgspot').fadeIn();
            			jQuery('#sfmsgspot').fadeOut(6000);
            		}
            	});
            });
        </script>
<?php 
        spa_paint_options_init();
        $ahahURL = SFHOMEURL . 'index.php?sp_ahah=plugins-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . "&amp;saveform=plugin&amp;func={$save}";
        echo '<form action="' . $ahahURL . '" method="post" id="sfpluginsuser" name="sfpluginsuser">';
        echo sp_create_nonce('forum-adminform_userplugin');
    }
    call_user_func($admin);
    if ($form) {
        ?>
    	<div class="sfform-submit-bar">
<?php 
        echo apply_filters('sph_UpdateBar', '<input type="submit" class="button-primary" value="' . spa_text("Update") . '" />', $reload);
        ?>
    	</div>
        <?php 
        spa_paint_close_tab();
        ?>
        </form>

    	<div class="sfform-panel-spacer"></div>
<?php 
    }
}
コード例 #19
0
function spa_toolbox_log_form()
{
    $sflog = spa_get_log_data();
    #== log Tab ==========================================================
    spa_paint_open_tab(spa_text('Toolbox') . " - " . spa_text('Install Log'), true);
    if (!$sflog) {
        spa_etext("There are no Install Log Entries");
        return;
    }
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Install Log'), false);
    echo "<table class='wp-list-table widefat'><tr>";
    echo '<th>' . spa_text('Version') . '</th>';
    echo "<th class='logDetail'>" . "</th>";
    echo '<th>' . spa_text('Build') . '</th>';
    echo "<th class='logRelease'>" . spa_text('Release') . "</th>";
    echo '<th>' . spa_text('Installed') . '</th>';
    echo "<th class='logBy'>" . spa_text('By') . "</th>";
    echo '</tr>';
    foreach ($sflog as $log) {
        $idVer = 'version' . str_replace('.', '', $log['version']);
        $idQVer = str_replace('.', '-', $log['version']);
        echo '<tr>';
        echo "<td class='sflabel'>" . $log['version'] . "</td>";
        $site = SFHOMEURL . 'index.php?sp_ahah=install-log&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;log=' . $idQVer;
        $gif = SFCOMMONIMAGES . 'working.gif';
        echo '<td class="logDetail"><input type="button" class="logDetail button" value="' . spa_text('Details') . '" onclick="spjLoadAhah(\'' . $site . '\', \'' . $idVer . '\', \'' . $gif . '\');" /></td>';
        echo "<td class='sflabel'>" . $log['build'] . "</td>";
        echo "<td class='sflabel logRelease'>" . $log['release_type'] . "</td>";
        echo "<td class='sflabel'>" . sp_date('d', $log['install_date']) . "</td>";
        echo "<td class='sflabel logBy'>" . sp_filter_name_display($log['display_name']) . "</td>";
        echo '</tr>';
        echo "<tr><td style='display:none;' class='sflabel' id='" . $idVer . "' colspan='6'></td></tr>";
    }
    echo '</table>';
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_toolbox_install_panel');
    spa_paint_close_container();
    echo '<div class="sfform-panel-spacer"></div>';
    spa_paint_close_tab();
}
コード例 #20
0
function spa_permissions_add_permission_form()
{
    ?>
<script type="text/javascript">
    jQuery(document).ready(function() {
    	spjAjaxForm('sfrolenew', 'sfreloadpb');
    });
</script>
<?php 
    # Get correct tooltips file
    $lang = spa_get_language_code();
    if (empty($lang)) {
        $lang = 'en';
    }
    $ttpath = SPHELP . 'admin/tooltips/admin-permissions-tips-' . $lang . '.php';
    if (file_exists($ttpath) == false) {
        $ttpath = SPHELP . 'admin/tooltips/admin-permissions-tips-en.php';
    }
    if (file_exists($ttpath)) {
        include_once $ttpath;
    }
    global $spGlobals;
    spa_paint_options_init();
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=permissions-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=addperm';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfrolenew" name="sfrolenew">
<?php 
    echo sp_create_nonce('forum-adminform_rolenew');
    spa_paint_open_tab(spa_text('Permissions') . " - " . spa_text('Add New Permission'), true);
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Add New Permission'), 'true', 'create-new-permission-set');
    spa_paint_input(spa_text('Permission Set Name'), "role_name", '', false, true);
    spa_paint_input(spa_text('Permission Set Description'), "role_desc", '', false, true);
    spa_paint_select_start(spa_text('Clone Existing Permission Set'), 'role', 'role');
    spa_display_permission_select('', false);
    spa_paint_select_end('<small>(' . spa_text('Select an existing Permission Set to Clone.  Any settings below will be ignored.') . ')</small>');
    ?>
					<br /><p><strong><?php 
    spa_etext('Permission Set Actions');
    ?>
:</strong></p>
<?php 
    echo '<p><img src="' . SFADMINIMAGES . 'sp_GuestPerm.png" alt="" style="width:16px;height:16px;vertical-align:top" />';
    echo '<small>&nbsp;' . spa_text('Note: Action settings displaying this icon will be ignored for Guest Users') . '</small>';
    echo '&nbsp;&nbsp;&nbsp;<img src="' . SFADMINIMAGES . 'sp_GlobalPerm.png" alt="" style="width:16px;height:16px;vertical-align:top" />';
    echo '<small>&nbsp;' . spa_text('Note: Action settings displaying this icon require enabling to use') . '</small>';
    echo '&nbsp;&nbsp;&nbsp;<img src="' . SFADMINIMAGES . 'sp_Warning.png" alt="" style="width:16px;height:16px;vertical-align:top" />';
    echo '<small>&nbsp;' . spa_text('Note: Action settings displaying this icon should be used with great care') . '</small></p>';
    sp_build_site_auths_cache();
    $sql = 'SELECT auth_id, auth_name, auth_cat, authcat_name, warning FROM ' . SFAUTHS . '
							JOIN ' . SFAUTHCATS . ' ON ' . SFAUTHS . '.auth_cat = ' . SFAUTHCATS . '.authcat_id
							WHERE active = 1
							ORDER BY auth_cat, auth_id';
    $authlist = spdb_select('set', $sql);
    $firstitem = true;
    $category = '';
    ?>
					<!-- OPEN OUTER CONTAINER DIV -->
					<div class="outershell" style="width: 100%;">
<?php 
    foreach ($authlist as $a) {
        if ($category != $a->authcat_name) {
            $category = $a->authcat_name;
            if (!$firstitem) {
                ?>
								<!-- CLOSE DOWN THE ENDS -->
								</table></div>
<?php 
            }
            ?>
							<!-- OPEN NEW INNER DIV -->
							<div class="innershell">
							<!-- NEW INNER DETAIL TABLE -->
							<table style="width:100%;border:0">
							<tr><td colspan="2" class="permhead"><?php 
            spa_etext($category);
            ?>
</td></tr>
<?php 
            $firstitem = false;
        }
        $auth_id = $a->auth_id;
        $auth_name = $a->auth_name;
        $authWarn = empty($a->warning) ? false : true;
        $warn = $authWarn ? " permwarning" : '';
        $tip = $authWarn ? " class='permwarning' title='" . esc_js(spa_text($a->warning)) . "'" : '';
        $button = 'b-' . $auth_id;
        if ($spGlobals['auths'][$auth_id]->ignored || $spGlobals['auths'][$auth_id]->enabling || $authWarn) {
            $span = '';
        } else {
            $span = ' colspan="2" ';
        }
        ?>
							<tr<?php 
        echo $tip;
        ?>
>
								<td class="permentry<?php 
        echo $warn;
        ?>
">

								<input type="checkbox" name="<?php 
        echo $button;
        ?>
" id="sf<?php 
        echo $button;
        ?>
"  />
								<label for="sf<?php 
        echo $button;
        ?>
" class="sflabel">
								<img style="text-align:top;float: right; border: 0pt none ; margin: -4px 5px 0px 3px; padding: 0;" class="" title="<?php 
        echo $tooltips[$auth_name];
        ?>
" src="<?php 
        echo SFADMINIMAGES;
        ?>
sp_Information.png" alt="" />
								<?php 
        spa_etext($spGlobals['auths'][$auth_id]->auth_desc);
        ?>
</label>
								<?php 
        if ($span == '') {
            ?>
									<td style="text-align:center;width:32px" class="permentry">
<?php 
        }
        if ($span == '') {
            if ($spGlobals['auths'][$auth_id]->enabling) {
                echo '<img src="' . SFADMINIMAGES . 'sp_GlobalPerm.png" alt="" style="width:16px;height:16px" title="' . spa_text('Requires Enabling') . '" />';
            }
            if ($spGlobals['auths'][$auth_id]->ignored) {
                echo '<img src="' . SFADMINIMAGES . 'sp_GuestPerm.png" alt="" style="width:16px;height:16px" title="' . spa_text('Ignored for Guests') . '" />';
            }
            if ($authWarn) {
                echo '<img src="' . SFADMINIMAGES . 'sp_Warning.png" alt="" style="width:16px;height:16px" title="' . spa_text('Use with Caution') . '" />';
            }
            echo '</td>';
        } else {
            ?>
								    </td><td class="permentry" style="width:32px"></td>
                                <?php 
        }
        ?>
							</tr>
                        <?php 
    }
    ?>
					<!-- END CONTAINER DIV -->
					</table></div><div class="clearboth"></div>
					</div>
<?php 
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_perm_add_perm_panel');
    spa_paint_close_container();
    ?>
	<div class="sfform-submit-bar">
	<input type="submit" class="button-primary" id="saveit" name="saveit" value="<?php 
    spa_etext('Create New Permission');
    ?>
" />
	</div>
	<?php 
    spa_paint_close_tab();
    ?>
	</form>
	<div class="sfform-panel-spacer"></div>
<?php 
}
コード例 #21
0
function spa_profiles_options_form()
{
    ?>
<script type="text/javascript">
	spjAjaxForm('sfoptionsform', '');
</script>
<?php 
    $sfoptions = spa_get_options_data();
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=profiles-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=options';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfoptionsform" name="sfoptions">
	<?php 
    echo sp_create_nonce('forum-adminform_options');
    spa_paint_options_init();
    #== PROFILE OPTIONS Tab ============================================================
    spa_paint_open_tab(spa_text('Profiles') . ' - ' . spa_text('Profile Options'));
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Display Name Format'), true, 'display-name-format');
    spa_paint_checkbox(spa_text('Let member choose display name'), 'nameformat', $sfoptions['nameformat']);
    spa_paint_select_start(spa_text('Display name format if member cannot choose') . '<br />' . spa_text('(ignored if member allowed to choose)'), 'fixeddisplayformat', 'fixeddisplayformat');
    echo spa_display_name_format_options($sfoptions['fixeddisplayformat']);
    spa_paint_select_end();
    echo '<tr><td colspan="2"><br /><div class="sfoptionerror">';
    spa_etext('Warning: If you change the display name format, it may take some time on a large number of users to update them to the new format. Please be patient.');
    echo '</div><br />';
    echo '</td></tr>';
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Personal Photos'), true, 'personal-photos');
    spa_paint_input(spa_text('Maximum number of photos allowed'), 'photosmax', $sfoptions['photosmax'], false, false);
    spa_paint_input(spa_text('Maximum pixel width of photo display'), 'photoswidth', $sfoptions['photoswidth'], false, false);
    spa_paint_input(spa_text('Maximum pixel height of photo display'), 'photosheight', $sfoptions['photosheight'], false, false);
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Signature Image Size'), true, 'sig-images');
    echo '<tr><td colspan="2">&nbsp;<u>' . spa_text('If you are allowing signature images (zero = not limited)') . ':</u></td></tr>';
    spa_paint_input(spa_text('Maximum signature width (pixels)'), 'sfsigwidth', $sfoptions['sfsigwidth']);
    spa_paint_input(spa_text('Maximum signature height (pixels)'), 'sfsigheight', $sfoptions['sfsigheight']);
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('First Forum Visit'), true, 'first-forum-visit');
    spa_paint_checkbox(spa_text('Display profile form on login'), 'firstvisit', $sfoptions['firstvisit']);
    $show_password_fields = apply_filters('show_password_fields', true);
    if ($show_password_fields) {
        spa_paint_checkbox(spa_text('Force password change'), 'forcepw', $sfoptions['forcepw']);
    }
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_profiles_options_left_panel');
    spa_paint_tab_right_cell();
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Display Profile Mode'), true, 'display-profile-mode');
    $values = array(spa_text('Popup window'), spa_text('Forum profile page'), spa_text('BuddyPress profile'), spa_text('WordPress author page'), spa_text('Other page'), spa_text('Mingle profile'));
    spa_paint_radiogroup(spa_text('Display profile information in'), 'displaymode', $values, $sfoptions['displaymode'], false, true);
    spa_paint_input(spa_text('URL for Other page'), 'displaypage', sp_filter_url_display($sfoptions['displaypage']), false, true);
    spa_paint_input(spa_text('Query String Variable Name'), 'displayquery', sp_filter_title_display($sfoptions['displayquery']), false, true);
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Profile Entry Form Mode'), true, 'profile-entry-form-mode');
    $values = array(spa_text('Forum profile form'), spa_text('WordPress profile form'), spa_text('BuddyPress profile'), spa_text('Other form'), spa_text('Mingle profile'));
    spa_paint_radiogroup(spa_text('Enter profile information In'), 'formmode', $values, $sfoptions['formmode'], false, true);
    spa_paint_input(spa_text('URL for Other page'), 'formpage', sp_filter_url_display($sfoptions['formpage']), false, true);
    spa_paint_input(spa_text('Query string variable name'), 'formquery', sp_filter_title_display($sfoptions['formquery']), false, true);
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Profile Overview Message'), true, 'profile-message');
    $submessage = spa_text('Text you enter here will be displayed to the User on their profile overview page');
    spa_paint_wide_textarea(spa_text('Profile overview message'), 'sfprofiletext', sp_filter_text_edit($sfoptions['sfprofiletext']), $submessage);
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_profiles_options_right_panel');
    spa_paint_close_container();
    ?>
    	<div class="sfform-submit-bar">
    	   <input type="submit" class="button-primary" id="saveit" name="saveit" value="<?php 
    spa_etext('Update Profile Options');
    ?>
" />
    	</div>
	</form>
<?php 
    spa_paint_close_tab();
}
コード例 #22
0
function spa_usergroups_edit_usergroup_form($usergroup_id)
{
    global $spPaths;
    ?>
<script type="text/javascript">
    jQuery(document).ready(function() {
    	jQuery('#usergrouprow-<?php 
    echo $usergroup_id;
    ?>
').addClass('inForm');
    	spjAjaxForm('sfusergroupedit<?php 
    echo $usergroup_id;
    ?>
', 'sfreloadub');
    });
</script>
<?php 
    $usergroup = spa_get_usergroups_row($usergroup_id);
    spa_paint_options_init();
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=usergroups-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=editusergroup';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfusergroupedit<?php 
    echo $usergroup->usergroup_id;
    ?>
" name="sfusergroupedit<?php 
    echo $usergroup->usergroup_id;
    ?>
">
<?php 
    echo sp_create_nonce('forum-adminform_usergroupedit');
    spa_paint_open_tab(spa_text('User Groups') . ' - ' . spa_text('Manage User Groups'), true);
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Edit User Group'), 'true', 'edit-user-group');
    ?>
					<input type="hidden" name="usergroup_id" value="<?php 
    echo $usergroup->usergroup_id;
    ?>
" />
					<input type="hidden" name="ugroup_name" value="<?php 
    echo sp_filter_title_display($usergroup->usergroup_name);
    ?>
" />
					<input type="hidden" name="ugroup_desc" value="<?php 
    echo sp_filter_title_display($usergroup->usergroup_desc);
    ?>
" />
					<input type="hidden" name="ugroup_join" value="<?php 
    echo $usergroup->usergroup_join;
    ?>
" />
					<input type="hidden" name="ugroup_ismod" value="<?php 
    echo $usergroup->usergroup_is_moderator;
    ?>
" />
<?php 
    spa_paint_input(spa_text('User Group Name'), 'usergroup_name', sp_filter_title_display($usergroup->usergroup_name), false, true);
    spa_paint_input(spa_text('User Group Description'), 'usergroup_desc', sp_filter_title_display($usergroup->usergroup_desc), false, true);
    spa_paint_select_start(spa_text('Select Badge'), 'usergroup_badge', 'usergroup_badge');
    spa_select_icon_dropdown('usergroup_badge', spa_text('Select Badge'), SF_STORE_DIR . '/' . $spPaths['ranks'] . '/', $usergroup->usergroup_badge, false);
    spa_paint_select_end('<small>(' . spa_text('Upload badges on the Components - Forum Ranks admin panel') . ')</small>');
    spa_paint_checkbox(spa_text('Allow members to join usergroup'), 'usergroup_join', $usergroup->usergroup_join, false, false, false, '<small>' . spa_text('(Indicates that members are allowed to choose to join this usergroup on their profile page)') . '</small>');
    spa_paint_checkbox(spa_text('Is moderator'), 'usergroup_is_moderator', $usergroup->usergroup_is_moderator, false, false, false, '<small>' . spa_text('(Indicates that members of this usergroup are considered Moderators)') . '</small>');
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_usergroup_edit_panel');
    spa_paint_close_container();
    ?>
		<div class="sfform-submit-bar">
		<input type="submit" class="button-primary" id="sfusergroupedit<?php 
    echo $usergroup->usergroup_id;
    ?>
" name="sfusergroupedit<?php 
    echo $usergroup->usergroup_id;
    ?>
" value="<?php 
    spa_etext('Update User Group');
    ?>
" />
		<input type="button" class="button-primary" onclick="javascript:jQuery('#usergroup-<?php 
    echo $usergroup->usergroup_id;
    ?>
').html('');jQuery('#usergrouprow-<?php 
    echo $usergroup_id;
    ?>
').removeClass('inForm');" id="sfusergroupedit<?php 
    echo $usergroup->usergroup_id;
    ?>
" name="editusergroupcancel<?php 
    echo $usergroup->usergroup_id;
    ?>
" value="<?php 
    spa_etext('Cancel');
    ?>
" />
		</div>
	</form>
	<?php 
    spa_paint_close_tab();
    ?>

	<div class="sfform-panel-spacer"></div>
<?php 
}
コード例 #23
0
function spa_toolbox_housekeeping_form()
{
    ?>
<script type="text/javascript">
    jQuery(document).ready(function() {
    	spjAjaxForm('sfindexes', 'sfreloadhk');
    	spjAjaxForm('sfnewpostcleanup', 'sfreloadhk');
    	spjAjaxForm('sftransientcleanup', 'sfreloadhk');
    	spjAjaxForm('sfpostcountcleanup', 'sfreloadhk');
    	spjAjaxForm('sfresetprofiletabs', 'sfreloadhk');
    	spjAjaxForm('sfresetauths', 'sfreloadhk');
    	spjAjaxForm('sfresetplugdata', 'sfreloadhk');
    	spjAjaxForm('sfresetcombined', 'sfreloadhk');
    	spjAjaxForm('sfflushcache', 'sfreloadhk');
    	<?php 
    do_action('sph_toolbox_housekeeping_ajax');
    ?>
    });
</script>
<?php 
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=toolbox-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=housekeeping';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfhousekeepingform" name="sfhousekeeping">
	</form>
<?php 
    spa_paint_options_init();
    spa_paint_open_tab(spa_text('Toolbox') . ' - ' . spa_text('Housekeeping'));
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Rebuild Indexes'), true, 'rebuild-indexes');
    echo '<p class="sublabel">' . spa_text("You shouldn't need to rebuild your indexes unless asked to by Simple:Press Support.") . '</p>';
    ?>
				<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfindexes" name="sfindexes">
				<?php 
    echo sp_create_nonce('forum-adminform_housekeeping');
    ?>
				<p class="sublabel"><?php 
    spa_etext('Select forum to have its indexes rebuilt');
    ?>
:<br /><br /></p>
				<select class="wp-core-ui" name="forum_id" >
					<?php 
    echo sp_render_group_forum_select(false, false, false, true, '', '', 'wp-core-ui', 20);
    ?>
				</select>
                <br /><br />
				<input type="submit" class="button-primary" id="saveit1" name="rebuild-fidx" value="<?php 
    spa_etext('Rebuild Forum Indexes');
    ?>
" onclick="jQuery('#riimg').show();"/>
				<img class="sfhidden" id="riimg" src="<?php 
    echo SFCOMMONIMAGES . 'working.gif';
    ?>
" alt=""/>
				</form>
<?php 
    echo '<p class="sublabel">' . spa_text('Note: Rebuilding the forum indexes may take some time if you have a large number of topics or posts.') . '</p>';
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('New Post Cleanup'), true, 'newpost-cleanup');
    echo '<p class="sublabel">' . spa_text('This will reset the New Posts list for users who haven not visited the forum in the specified number of days.') . '</p>';
    ?>
				<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfnewpostcleanup" name="sfnewpostcleanup">
				<?php 
    echo sp_create_nonce('forum-adminform_housekeeping');
    ?>

				<span>Number of Days Since User's Last Visit:
				<input class="wp-core-ui" type="text" value="30" name="sfdays" /></span>
				<br />
				<input type="submit" class="button-primary" id="saveit2" name="clean-newposts" value="<?php 
    spa_etext('Clean New Posts List');
    ?>
"  onclick="jQuery('#npcimg').show();"/>
				<img class="sfhidden" id="npcimg" src="<?php 
    echo SFCOMMONIMAGES . 'working.gif';
    ?>
" alt=""/>
				</form>
<?php 
    echo '<p>' . spa_text('Note: Cleaning up the New Post Lists may take some time if you have a large number of users that meet the criteria.') . '</p>';
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('User Post Count Cleanup'), true, 'post-count-cleanup');
    echo '<p class="sublabel">' . spa_text('This will go through the users and posts database tables and recalculate post counts for all users based on existing posts.') . '</p>';
    ?>
				<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfpostcountcleanup" name="sfpostcountcleanup">
				<?php 
    echo sp_create_nonce('forum-adminform_housekeeping');
    ?>
<br />
				<input type="submit" class="button-primary" id="saveit3" name="postcount-cleanup" value="<?php 
    spa_etext('Clean Up Post Counts');
    ?>
"  onclick="jQuery('#pcimg').show();"/>
				<img class="sfhidden" id="pcimg" src="<?php 
    echo SFCOMMONIMAGES . 'working.gif';
    ?>
" alt=""/>
				</form>
<?php 
    echo '<p class="sublabel">' . spa_text('Note: Recalculating user post counts may take some time if you have a large number of users and cannot be reversed.') . '</p>';
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_toolbox_housekeeping_left_panel');
    spa_paint_tab_right_cell();
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Transient Cleanup'), true, 'transient-cleanup');
    echo '<p class="sublabel">' . spa_text('This will clean up expired WP Transients from the WP options table and any expired SP user notices.') . '</p>';
    ?>
				<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sftransientcleanup" name="sftransientcleanup">
				<?php 
    echo sp_create_nonce('forum-adminform_housekeeping');
    ?>
<br />
				<input type="submit" class="button-primary" id="saveit4" name="transient-cleanup" value="<?php 
    spa_etext('Clean Up Transients');
    ?>
"  onclick="jQuery('#tcimg').show();"/>
				<img class="sfhidden" id="tcimg" src="<?php 
    echo SFCOMMONIMAGES . 'working.gif';
    ?>
" alt=""/>
				</form>
<?php 
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Rebuild Default Profile Tabs'), true, 'reset-tabs');
    echo '<p class="sublabel">' . spa_text('This will remove all Profile Tabs and restore to default state.') . '</p>';
    ?>
				<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfresetprofiletabs" name="sfresetprofiletabs">
				<?php 
    echo sp_create_nonce('forum-adminform_housekeeping');
    ?>
				<input type="submit" class="button-primary" id="saveit5" name="reset-tabs" value="<?php 
    spa_etext('Reset Profile Tabs');
    ?>
"  onclick="jQuery('#rdptimg').show();"/>
				<img class="sfhidden" id="rdptimg" src="<?php 
    echo SFCOMMONIMAGES . 'working.gif';
    ?>
" alt=""/>
				</form>
<?php 
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Reset the Auths Cache'), true, 'reset-auths');
    echo '<p class="sublabel">' . spa_text("This will force a rebuild of each user's auth cache. It does not change any permissions.") . '</p>';
    ?>
				<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfresetauths" name="sfresetauths">
				<?php 
    echo sp_create_nonce('forum-adminform_housekeeping');
    ?>
				<input type="submit" class="button-primary" id="saveit6" name="reset-auths" value="<?php 
    spa_etext('Reset Auths Cache');
    ?>
"  onclick="jQuery('#rtacimg').show();"/>
				<img class="sfhidden" id="rtacimg" src="<?php 
    echo SFCOMMONIMAGES . 'working.gif';
    ?>
" alt=""/>
				</form>
<?php 
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Reset Users Plugin Data Cache'), true, 'reset-plugin-data');
    echo '<p class="sublabel">' . spa_text("This will force each user's plugin data cache to be cleared.") . '</p>';
    ?>
				<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfresetplugdata" name="sfresetplugdata">
				<?php 
    echo sp_create_nonce('forum-adminform_housekeeping');
    ?>
				<input type="submit" class="button-primary" id="saveit10" name="reset-plugin-data" value="<?php 
    spa_etext('Reset Users Plugin Data');
    ?>
"  onclick="jQuery('#rrpdimg').show();"/>
				<img class="sfhidden" id="rrpdimg" src="<?php 
    echo SFCOMMONIMAGES . 'working.gif';
    ?>
" alt=""/>
				</form>
<?php 
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Reset combined CSS/JS'), true, 'reset-combined');
    echo '<p class="sublabel">' . spa_text('This will force a rebuild of the combined CSS and JS cache files.') . '</p>';
    ?>
				<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfresetcombined" name="sfresetcombined">
				<?php 
    echo sp_create_nonce('forum-adminform_housekeeping');
    ?>
				<input type="submit" class="button-primary" id="saveit7" name="reset-combinedcss" value="<?php 
    spa_etext('Reset Combined CSS Cache');
    ?>
"  onclick="jQuery('#rtccimg').show();"/>
				<input type="submit" class="button-primary" id="saveit8" name="reset-combinedjs" value="<?php 
    spa_etext('Reset Combined Script Cache');
    ?>
"  onclick="jQuery('#rtccimg').show();"/>
				<img class="sfhidden" id="rtccimg" src="<?php 
    echo SFCOMMONIMAGES . 'working.gif';
    ?>
" alt=""/>
				</form>
<?php 
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Flush general cache'), true, 'flush-cache');
    echo '<p class="sublabel">' . spa_text("This will force a flushing of the general cache.") . '</p>';
    ?>
				<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfflushcache" name="sfflushcache">
				<?php 
    echo sp_create_nonce('forum-adminform_housekeeping');
    ?>
				<input type="submit" class="button-primary" id="saveit9" name="flushcache" value="<?php 
    spa_etext('Flush General Cache');
    ?>
"  onclick="jQuery('#fcacheimg').show();"/>
				<img class="sfhidden" id="fcacheimg" src="<?php 
    echo SFCOMMONIMAGES . 'working.gif';
    ?>
" alt=""/>
				</form>
<?php 
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_toolbox_housekeeping_right_panel');
    spa_paint_close_container();
    echo '<div class="sfform-panel-spacer"></div>';
    spa_paint_close_tab();
}
コード例 #24
0
function spa_themes_list_form()
{
    global $spPaths;
    # get current theme
    $curTheme = sp_get_option('sp_current_theme');
    # get themes
    $themes = sp_get_themes_list_data();
    # get update version info
    $xml = sp_load_version_xml();
    spa_paint_options_init();
    spa_paint_open_tab(spa_text('Available Themes') . '- ' . spa_text('Select Simple:Press Theme'), true);
    spa_paint_open_panel();
    spa_paint_spacer();
    echo '<div class="sfoptionerror">';
    echo spa_text('Themes Folder') . ': <b>' . realpath(SF_STORE_DIR . '/' . $spPaths['themes']) . '</b>';
    echo '</div>';
    spa_paint_open_fieldset(spa_text('Theme Management'), true, 'themes');
    ?>
	<h3><?php 
    echo spa_text('Current Theme');
    ?>
</h3>
	<div class="theme-browser rendered">
	<div class="spThemeContainer">
	<div id="current-theme" class="spTheme">
<?php 
    if (file_exists(SPTHEMEBASEDIR . $curTheme['theme'] . '/styles/' . $curTheme['style'])) {
        ?>
			<h3 class="theme-name"><?php 
        echo $themes[$curTheme['theme']]['Name'];
        ?>
</h3>

    		<img src="<?php 
        echo SPTHEMEBASEURL . $curTheme['theme'] . '/' . $themes[$curTheme['theme']]['Screenshot'];
        ?>
" alt="" />
    		<h4>
    			<?php 
        echo $themes[$curTheme['theme']]['Name'] . ' ' . $themes[$curTheme['theme']]['Version'] . ' ' . spa_text('by') . ' <a href="' . $themes[$curTheme['theme']]['AuthorURI'] . '" title="' . spa_text('Visit author homepage') . '">' . $themes[$curTheme['theme']]['Author'] . '</a>';
        ?>
    		</h4>
<?php 
        if (!empty($curTheme['parent'])) {
            if (file_exists(SPTHEMEBASEDIR . $curTheme['parent'])) {
                echo '<p class="theme-parent">';
                echo spa_text('This theme is a child theme of ') . '<b>' . $curTheme['parent'] . '</b>';
                echo '</p>';
            } else {
                echo '<p class="theme-parent">';
                echo '<b>' . spa_text('The specified parent theme') . " '" . $curTheme['parent'] . "' " . spa_text('does not exist') . '</b> ';
                echo '</p>';
            }
        }
        ?>
    		<p class="description" style="padding: 0;">
    			<?php 
        echo $themes[$curTheme['theme']]['Description'];
        ?>
    		</p>
<?php 
        $overlays = sp_get_overlays(SPTHEMEBASEDIR . $curTheme['theme'] . '/styles/overlays');
        # pull in parent overlays if child theme
        if (!empty($curTheme['parent'])) {
            $parent_overlays = sp_get_overlays(SPTHEMEBASEDIR . $curTheme['parent'] . '/styles/overlays');
            $overlays = array_merge($overlays, $parent_overlays);
            $overlays = array_unique($overlays);
        }
        if (!empty($overlays)) {
            ?>
                <script type="text/javascript">
                jQuery(document).ready(function() {
					spjAjaxForm('sftheme-<?php 
            echo esc_js($curTheme['theme']);
            ?>
', 'sfreloadtlist');
                });
                </script>
                <br />
<?php 
            $ahahURL = SFHOMEURL . 'index.php?sp_ahah=themes-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=theme';
            echo '<form action="' . $ahahURL . '" method="post" id="sftheme-' . esc_attr($curTheme['theme']) . '" name="sftheme-' . esc_attr($curTheme['theme']) . '">';
            echo sp_create_nonce('forum-adminform_themes');
            echo '<input type="hidden" name="theme" value="' . esc_attr($curTheme['theme']) . '" />';
            echo '<input type="hidden" name="style" value="' . esc_attr($themes[$curTheme['theme']]['Stylesheet']) . '" />';
            echo '<input type="hidden" name="parent" value="' . esc_attr($curTheme['parent']) . '" />';
            echo '<input type="hidden" name="default-color" value="' . esc_attr($overlays[0]) . '" />';
            echo spa_text('Select Overlay') . ': ';
            echo '<select name="color-' . esc_attr($curTheme['theme']) . '">';
            foreach ($overlays as $overlay) {
                $overlay = trim($overlay);
                $selected = $curTheme['color'] == $overlay ? ' selected="selected" ' : '';
                echo '<option' . $selected . ' value="' . esc_attr($overlay) . '">' . esc_html($overlay) . '</option>';
            }
            echo '</select> ';
            echo ' <input type="submit" class="button-secondary action" id="update" name="update" value="' . spa_text('Update Overlay') . '" />';
            echo '</form>';
        }
        # any upgrade for this theme? in multisite only main site can update
        if (is_main_site() && $xml) {
            foreach ($xml->themes->theme as $latest) {
                if ($themes[$curTheme['theme']]['Name'] == $latest->name) {
                    if (version_compare($latest->version, $themes[$curTheme['theme']]['Version'], '>') == 1) {
                        echo '<br />';
                        echo '<p style="padding: 0;">';
                        echo '<strong>' . spa_text('There is an update for the') . ' ' . $themes[$curTheme['theme']]['Name'] . ' ' . spa_text('theme') . '.</strong> ';
                        echo spa_text('Version') . ' ' . $latest->version . ' ' . spa_text('is available') . '. ';
                        echo spa_text('For details and to download please visit') . ' ' . SFPLUGHOME . ' ' . spa_text('or') . ' ' . spa_text('go to the') . ' ';
                        echo '<a href="' . self_admin_url('update-core.php') . '" title="" target="_parent">' . spa_text('WordPress updates page') . '</a>';
                        echo '</p>';
                    }
                    break;
                }
            }
        }
    } else {
        echo '<h4>' . spa_text('The current theme stylesheet') . ':<br /><br />' . SPTHEMEBASEDIR . $curTheme['theme'] . '/styles/' . $curTheme['style'] . '<br /><br />' . spa_text('cannot be found. Please correct or select a new theme for proper operation.') . '</h4>';
    }
    ?>
	</div></div></div>

	<br class="clear" />

	<h3><?php 
    echo spa_text('Available Themes');
    ?>
</h3>
<?php 
    $numThemes = count($themes);
    if ($numThemes > 1) {
        ?>
		<div class="theme-browser rendered">
			<div class="spThemeContainer">
<?php 
        foreach ((array) $themes as $theme_file => $theme_data) {
            # skip cur theme
            if ($theme_file == $curTheme['theme']) {
                continue;
            }
            $theme_desc = $theme_data['Description'];
            $theme_name = $theme_data['Name'];
            $theme_version = $theme_data['Version'];
            $theme_author = $theme_data['Author'];
            $theme_uri = $theme_data['AuthorURI'];
            $theme_style = $theme_data['Stylesheet'];
            $theme_image = SPTHEMEBASEURL . $theme_file . '/' . $theme_data['Screenshot'];
            $theme_overlays = sp_get_overlays(SPTHEMEBASEDIR . $theme_file . '/styles/overlays');
            # pull in parent overlays if child theme
            if (!empty($theme_data['Parent'])) {
                $parent_overlays = sp_get_overlays(SPTHEMEBASEDIR . $theme_data['Parent'] . '/styles/overlays');
                $theme_overlays = array_merge($theme_overlays, $parent_overlays);
            }
            ?>
				<div class="spTheme">
					<h3 class="theme-name"><?php 
            echo $theme_name;
            ?>
</h3>
					<img alt="" src="<?php 
            echo $theme_image;
            ?>
" />
					<h4>
						<?php 
            echo $theme_name . ' ' . $theme_version . ' ' . spa_text('by') . ' <a href="' . $theme_uri . '" title="' . spa_text('Visit author homepage') . '">' . $theme_author . '</a>';
            ?>
					</h4>
<?php 
            if (!empty($theme_data['Parent'])) {
                if (file_exists(SPTHEMEBASEDIR . $theme_data['Parent'])) {
                    echo '<p class="theme-parent">';
                    echo spa_text('This theme is a child theme of ') . '<b>' . $theme_data['Parent'] . '</b>';
                    echo '</p>';
                } else {
                    echo '<p class="theme-parent">';
                    echo '<b>' . spa_text('The specified parent theme') . " '" . $theme_data['Parent'] . "' " . spa_text('does not exist') . '</b> ';
                    echo '</p>';
                }
            }
            ?>
					<p class="description" style="padding: 0;">
						<?php 
            echo $theme_desc;
            ?>
					</p>
					<br />
					<div class="action-links">
	                    <script type="text/javascript">
	                    jQuery(document).ready(function() {
	                    	spjAjaxForm('sftheme-<?php 
            echo esc_js($theme_file);
            ?>
', 'sfreloadtlist');
	                    });
	                    </script>
	                    <?php 
            $ahahURL = SFHOMEURL . 'index.php?sp_ahah=themes-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=theme';
            ?>
                        <?php 
            $msg = esc_js(spa_text('Are you sure you want to delete this Simple Press theme?'));
            ?>
	                	<form action="<?php 
            echo $ahahURL;
            ?>
" method="post" id="sftheme-<?php 
            echo esc_attr($theme_file);
            ?>
" name="sftheme-<?php 
            echo esc_attr($theme_file);
            ?>
" >
	                    <?php 
            echo sp_create_nonce('forum-adminform_themes');
            ?>
	                    <input type="hidden" name="theme" value="<?php 
            echo esc_attr($theme_file);
            ?>
" />
	                    <input type="hidden" name="style" value="<?php 
            echo esc_attr($theme_style);
            ?>
" />
	                    <input type="hidden" name="parent" value="<?php 
            echo esc_attr($theme_data['Parent']);
            ?>
" />
<?php 
            $defOverlay = !empty($theme_overlays) ? esc_attr($theme_overlays[0]) : 0;
            echo "<input type='hidden' name='default-color' value='{$defOverlay}' />";
            if ($theme_overlays) {
                echo spa_text('Select Overlay') . ': ';
                echo ' <select name="color-' . esc_attr($theme_file) . '" style="margin-bottom:5px;">';
                foreach ($theme_overlays as $theme_overlay) {
                    $theme_overlay = trim($theme_overlay);
                    $selected = $theme_overlays[0] == $theme_overlay ? ' selected="selected" ' : '';
                    echo '<option' . $selected . ' value="' . esc_attr($theme_overlay) . '">' . esc_html($theme_overlay) . '</option>';
                }
                echo '</select> ';
                echo '<div class="clearboth"></div>';
            }
            ?>
	                    <input type="submit" class="button-secondary action" id="activate-<?php 
            echo esc_attr($theme_file);
            ?>
" name="activate" value="<?php 
            echo spa_etext('Activate Theme');
            ?>
" />
	                    <?php 
            if (!is_multisite() || is_super_admin()) {
                ?>
<input type="submit" class="button-secondary action" id="delete-<?php 
                echo esc_attr($theme_file);
                ?>
" name="delete" value="<?php 
                echo spa_etext('Delete Theme');
                ?>
" onclick="javascript: if (confirm('<?php 
                echo $msg;
                ?>
')) {return true;} else {return false;}" /><?php 
            }
            ?>
	                    </form>
					</div>
<?php 
            # any upgrade for this theme?
            if ($xml) {
                foreach ($xml->themes->theme as $latest) {
                    if ($theme_data['Name'] == $latest->name) {
                        if (version_compare($latest->version, $theme_data['Version'], '>') == 1) {
                            echo '<br />';
                            echo '<div class="plugin-update-tr"><div class="update-message" style="background-color:#fcf3ef;margin-left:10px;">';
                            echo '<strong>' . spa_text('There is an update for the') . ' ' . $theme_data['Name'] . ' ' . spa_text('theme') . '.</strong> ';
                            echo spa_text('Version') . ' ' . $latest->version . ' ' . spa_text('is available') . '. ';
                            echo spa_text('For details and to download please visit') . ' ' . SFPLUGHOME . ' ' . spa_text('or') . ' ' . spa_text('go to the') . ' ';
                            echo '<a href="' . self_admin_url('update-core.php') . '" title="" target="_parent">' . spa_text('WordPress updates page') . '</a>';
                            echo '</div></div>';
                        }
                        break;
                    }
                }
            }
            echo '</div>';
        }
        echo "</div>";
        echo '</div>';
    } else {
        echo spa_text('No other available themes found');
    }
    do_action('sph_themes_list_panel');
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_close_container();
    spa_paint_close_tab();
}
コード例 #25
0
function spa_forums_edit_forum_form($forum_id)
{
    ?>
<script type="text/javascript">
    jQuery(document).ready(function() {
    	jQuery('#forumrow-<?php 
    echo $forum_id;
    ?>
').addClass('inForm');
    	spjAjaxForm('sfforumedit<?php 
    echo $forum_id;
    ?>
', 'sfreloadfb');
    });
</script>
<?php 
    global $spPaths, $tab;
    $forum = spdb_table(SFFORUMS, "forum_id={$forum_id}", 'row');
    spa_paint_options_init();
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=editforum';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfforumedit<?php 
    echo $forum->forum_id;
    ?>
" name="sfforumedit<?php 
    echo $forum->forum_id;
    ?>
">
<?php 
    echo sp_create_nonce('forum-adminform_forumedit');
    spa_paint_open_tab(spa_text('Forums') . ' - ' . spa_text('Manage Groups and Forums'), true);
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Forum Details'), false);
    $subforum = $forum->parent ? true : false;
    echo "<input type='hidden' name='cgroup_id' value='{$forum->group_id}' />";
    echo "<input type='hidden' name='cparent' value='{$forum->parent}' />";
    echo "<input type='hidden' name='cchildren' value='{$forum->children}' />";
    if (!$subforum && empty($forum->children)) {
        $mess = sp_text('This is a top-level forum with no sub-forums and on this panel you can change the forum Group it is a member of. If changed it will be moved to the target Forum Group.');
    } elseif (!$subforum && !empty($forum->children)) {
        $mess = sp_text('This is a top level forum with designated sub-forums and on this panel you can change the forum Group it is a member of. If changed it will be moved, along with the sub-forums, to the target Forum Group.');
    } elseif ($subforum && empty($forum->children)) {
        $mess = sp_text('This is a sub-forum and on this panel you can change the forum parent it belongs to. If changed it will be moved to become a sub-forum of the target Forum.');
    } else {
        $mess = sp_text('This is a sub-forum and also a parent to other sub-forums and on this panel you can change the forum parent it belongs to. If changed it will be moved, along with the sub-forums, to the target Forum.');
    }
    echo '<div class="sfoptionerror spaceabove">';
    echo "<p><b>{$mess}</b></br>";
    echo sp_text('For more flexible Group/Forum ordering and sub-forum promotion and demotion, please use the drag and drop interface on the Order Groups and Forums admin panel from the Forums Menu - or the Order Forums panel at Group level.') . '</p>';
    echo '</div>';
    # Top level forum...
    $style = $subforum ? ' style="display:none"' : ' style="display:block"';
    echo "<div {$style}>";
    spa_paint_select_start(spa_text('The group this forum belongs to'), 'group_id', '');
    echo spa_create_group_select($forum->group_id);
    spa_paint_select_end();
    echo '</div>';
    # sub-forum...
    $style = $subforum ? ' style="display:block"' : ' style="display:none"';
    echo "<div {$style}>";
    spa_paint_select_start(spa_text('Parent forum this subforum belongs to'), 'parent', '');
    echo spa_create_forum_select($forum->parent);
    spa_paint_select_end();
    echo '</div>';
    spa_paint_input(spa_text('Forum name'), 'forum_name', sp_filter_title_display($forum->forum_name), false, true);
    echo '<input type="hidden" name="forum_id" value="' . $forum->forum_id . '" />';
    $target = 'cforum_slug';
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums&amp;sfnonce=' . wp_create_nonce('forum-ahah');
    echo "<div class='sp-form-row'>\n";
    echo "<div class='wp-core-ui sflabel sp-label-40'>" . spa_text('Forum slug') . ':</div>';
    echo '<input type="text" class="wp-core-ui sp-input-60" tabindex="' . $tab . '" name="cforum_slug" id="cforum_slug" value="' . esc_attr($forum->forum_slug) . '" onchange="spjSetForumSlug(this, \'' . $ahahURL . '\', \'' . $target . '\', \'edit\');" />';
    echo '<div class="clearboth"></div>';
    echo '</div>';
    $tab++;
    spa_paint_input(spa_text('Description'), 'forum_desc', sp_filter_text_edit($forum->forum_desc), false, true);
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Forum Options'), false);
    $target = 'cforum_slug';
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums&amp;sfnonce=' . wp_create_nonce('forum-ahah');
    spa_paint_checkbox(spa_text('Locked'), 'forum_status', $forum->forum_status);
    spa_paint_checkbox(spa_text('Disable forum RSS feed so feed will not be generated'), 'forum_private', $forum->forum_rss_private);
    spa_paint_select_start(sprintf(spa_text('Featured Image for this forum %s(200px x 200px recommended)'), '<br>'), 'feature_image', '');
    spa_select_icon_dropdown('feature_image', spa_text('Select Feature Image'), SF_STORE_DIR . '/' . $spPaths['forum-images'] . '/', $forum->feature_image, false);
    spa_paint_select_end();
    echo '<div class="sfoptionerror spaceabove">';
    echo '<p><b>' . sp_text('Custom Icon Ordering') . '</b></br>';
    echo sp_text('When using custom forum or topic icons and multiple conditions exist, the following precedence is used:') . '</p>';
    echo sp_text('Locked') . '<br />';
    echo sp_text('Pinned') . '<br />';
    echo sp_text('Unread') . '<br />';
    echo sp_text('Custom') . '<br />';
    echo sp_text('Theme Default') . '<br />';
    echo '</div>';
    spa_paint_select_start(spa_text('Custom forum icon'), 'forum_icon', '');
    spa_select_icon_dropdown('forum_icon', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', $forum->forum_icon, false);
    spa_paint_select_end();
    spa_paint_select_start(spa_text('Custom forum icon when new posts'), 'forum_icon_new', '');
    spa_select_icon_dropdown('forum_icon_new', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', $forum->forum_icon_new, false);
    spa_paint_select_end();
    spa_paint_select_start(spa_text('Custom forum icon when locked'), 'forum_icon_locked', '');
    spa_select_icon_dropdown('forum_icon_locked', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', $forum->forum_icon_locked, false);
    spa_paint_select_end();
    spa_paint_select_start(spa_text('Custom topic icon'), 'topic_icon', '');
    spa_select_icon_dropdown('topic_icon', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', $forum->topic_icon, false);
    spa_paint_select_end();
    spa_paint_select_start(spa_text('Custom topic icon when new posts'), 'topic_icon_new', '');
    spa_select_icon_dropdown('topic_icon_new', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', $forum->topic_icon_new, false);
    spa_paint_select_end();
    spa_paint_select_start(spa_text('Custom topic icon when locked'), 'topic_icon_locked', '');
    spa_select_icon_dropdown('topic_icon_locked', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', $forum->topic_icon_locked, false);
    spa_paint_select_end();
    spa_paint_select_start(spa_text('Custom topic icon when pinned'), 'topic_icon_pinned', '');
    spa_select_icon_dropdown('topic_icon_pinned', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', $forum->topic_icon_pinned, false);
    spa_paint_select_end();
    spa_paint_input(spa_text('Replacement external RSS URL') . '<br />' . spa_text('Default') . ': <strong>' . sp_build_url($forum->forum_slug, '', 0, 0, 0, 1) . '</strong>', 'forum_rss', sp_filter_url_display($forum->forum_rss), false, true);
    spa_paint_input(spa_text('Custom meta keywords (SEO option must be enabled)'), 'forum_keywords', '', false, true);
    spa_paint_wide_textarea('Special forum message to be displayed above forums', 'forum_message', sp_filter_text_edit($forum->forum_message));
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Extended Forum Options'), false);
    # As added by plugins
    do_action('sph_forum_edit_forum_options', $forum);
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_close_container();
    ?>
		<div class="sfform-submit-bar">
    		<input type="submit" class="button-primary" id="sfforumedit<?php 
    echo $forum->forum_id;
    ?>
" name="sfforumedit<?php 
    echo $forum->forum_id;
    ?>
" value="<?php 
    spa_etext('Update Forum');
    ?>
" />
    		<input type="button" class="button-primary" onclick="javascript:jQuery('#forum-<?php 
    echo $forum->forum_id;
    ?>
').html('');jQuery('#forumrow-<?php 
    echo $forum_id;
    ?>
').removeClass('inForm');" id="sfforumedit<?php 
    echo $forum->forum_id;
    ?>
" name="editforumcancel<?php 
    echo $forum->forum_id;
    ?>
" value="<?php 
    spa_etext('Cancel');
    ?>
" />
		</div>
	<?php 
    spa_paint_close_tab();
    ?>
	</form>
	<div class="sfform-panel-spacer"></div>
<?php 
}
コード例 #26
0
spa_paint_open_panel();
echo '<div class="helpAndFAQ">';
spa_paint_open_fieldset(spa_text('Available Plugins'), false);
include 'spa-plugin-links.php';
spa_paint_close_fieldset();
echo '</div>';
spa_paint_close_panel();
spa_paint_spacer();
spa_paint_close_container();
spa_paint_close_tab();
echo '<div class="sfform-panel-spacer"></div>';
spa_paint_open_tab(spa_text('Support and Customisation'));
spa_paint_open_panel();
echo '<div class="helpAndFAQ">';
spa_paint_open_fieldset(spa_text('Premium Support'), false);
include 'spa-support-links.php';
spa_paint_close_fieldset();
echo '</div>';
spa_paint_close_panel();
spa_paint_tab_right_cell();
spa_paint_open_panel();
echo '<div class="helpAndFAQ">';
spa_paint_open_fieldset(spa_text('Customisation Service'), false);
include 'spa-custom-links.php';
spa_paint_close_fieldset();
echo '</div>';
spa_paint_close_panel();
spa_paint_spacer();
spa_paint_close_container();
spa_paint_close_tab();
die;
コード例 #27
0
function spa_admins_manage_admins_form()
{
    ?>
<script type="text/javascript">
    jQuery(document).ready(function() {
    	spjAjaxForm('sfupdatecaps', 'sfreloadma');
    	spjAjaxForm('sfaddadmins', 'sfreloadma');
    });
</script>
<?php 
    global $spThisUser, $spGlobals;
    $adminsexist = false;
    $adminrecords = $spGlobals['forum-admins'];
    # get all the moderators
    $modrecords = array();
    $mods = spdb_table(SFMEMBERS, 'moderator=1');
    if ($mods) {
        foreach ($mods as $mod) {
            $modrecords[$mod->user_id] = $mod->display_name;
        }
    }
    spa_paint_options_init();
    if ($adminrecords || $modrecords) {
        $adminsexist = true;
        $ahahURL = SFHOMEURL . 'index.php?sp_ahah=admins-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=manageadmin';
        ?>
		<form action="<?php 
        echo $ahahURL;
        ?>
" method="post" id="sfupdatecaps" name="sfupdatecaps">
		<?php 
        echo sp_create_nonce('forum-adminform_sfupdatecaps');
        spa_paint_open_tab(spa_text('Admins') . " - " . spa_text('Manage Admins and Moderators'), true);
        spa_paint_open_panel();
        spa_paint_open_fieldset(spa_text('Current Admins and Moderators'), 'true', 'manage-admins');
        for ($x = 1; $x < 3; $x++) {
            $records = $x == 1 ? $adminrecords : $modrecords;
            if (empty($records)) {
                continue;
            }
            foreach ($records as $adminId => $adminName) {
                $user = new WP_User($adminId);
                $manage_opts = $user->has_cap('SPF Manage Options') ? 1 : 0;
                $manage_forums = $user->has_cap('SPF Manage Forums') ? 1 : 0;
                $manage_ugs = $user->has_cap('SPF Manage User Groups') ? 1 : 0;
                $manage_perms = $user->has_cap('SPF Manage Permissions') ? 1 : 0;
                $manage_comps = $user->has_cap('SPF Manage Components') ? 1 : 0;
                $manage_users = $user->has_cap('SPF Manage Users') ? 1 : 0;
                $manage_profiles = $user->has_cap('SPF Manage Profiles') ? 1 : 0;
                $manage_admins = $user->has_cap('SPF Manage Admins') ? 1 : 0;
                $manage_tools = $user->has_cap('SPF Manage Toolbox') ? 1 : 0;
                $manage_plugins = $user->has_cap('SPF Manage Plugins') ? 1 : 0;
                $manage_themes = $user->has_cap('SPF Manage Themes') ? 1 : 0;
                $manage_integration = $user->has_cap('SPF Manage Integration') ? 1 : 0;
                $title = $x == 1 ? spa_text('Admin') : spa_text('Moderator');
                spa_paint_open_fieldset($title . ': ' . $adminName, false);
                echo spa_text('ID') . ': ' . $adminId . ' - ' . spa_text('Name') . ': <strong>' . $adminName . '</strong>';
                ?>
								<input type="hidden" name="uids[]" value="<?php 
                echo $adminId;
                ?>
" />

								<ul class='floatList'>
									<li>
										<?php 
                spa_render_caps_checkbox(spa_text('Manage Options'), 'manage-opts[' . $adminId . ']', $manage_opts, $adminId);
                ?>
										<input type="hidden" name="old-opts[<?php 
                echo $adminId;
                ?>
]" value="<?php 
                echo $manage_opts;
                ?>
" />
									</li>
									<li>
										<?php 
                spa_render_caps_checkbox(spa_text('Manage Forums'), 'manage-forums[' . $adminId . ']', $manage_forums, $adminId);
                ?>
										<input type="hidden" name="old-forums[<?php 
                echo $adminId;
                ?>
]" value="<?php 
                echo $manage_forums;
                ?>
" />
									</li>
									<li>
										<?php 
                spa_render_caps_checkbox(spa_text('Manage User Groups'), 'manage-ugs[' . $adminId . ']', $manage_ugs, $adminId);
                ?>
										<input type="hidden" name="old-ugs[<?php 
                echo $adminId;
                ?>
]" value="<?php 
                echo $manage_ugs;
                ?>
" />
									</li>
									<li>
										<?php 
                spa_render_caps_checkbox(spa_text('Manage Permissions'), 'manage-perms[' . $adminId . ']', $manage_perms, $adminId);
                ?>
										<input type="hidden" name="old-perms[<?php 
                echo $adminId;
                ?>
]" value="<?php 
                echo $manage_perms;
                ?>
" />
									</li>
									<li>
										<?php 
                spa_render_caps_checkbox(spa_text('Manage Components'), 'manage-comps[' . $adminId . ']', $manage_comps, $adminId);
                ?>
										<input type="hidden" name="old-comps[<?php 
                echo $adminId;
                ?>
]" value="<?php 
                echo $manage_comps;
                ?>
" />
									</li>
									<li>
										<?php 
                spa_render_caps_checkbox(spa_text('Manage Plugins'), 'manage-plugins[' . $adminId . ']', $manage_plugins, $adminId);
                ?>
										<input type="hidden" name="old-plugins[<?php 
                echo $adminId;
                ?>
]" value="<?php 
                echo $manage_plugins;
                ?>
" />
									</li>
									<li>
										<?php 
                spa_render_caps_checkbox(spa_text('Manage Users'), 'manage-users[' . $adminId . ']', $manage_users, $adminId);
                ?>
										<input type="hidden" name="old-users[<?php 
                echo $adminId;
                ?>
]" value="<?php 
                echo $manage_users;
                ?>
" />
									</li>
									<li>
										<?php 
                spa_render_caps_checkbox(spa_text('Manage Toolbox'), 'manage-tools[' . $adminId . ']', $manage_tools, $adminId);
                ?>
										<input type="hidden" name="old-tools[<?php 
                echo $adminId;
                ?>
]" value="<?php 
                echo $manage_tools;
                ?>
" />
									</li>
									<li>
										<?php 
                spa_render_caps_checkbox(spa_text('Manage Profiles'), 'manage-profiles[' . $adminId . ']', $manage_profiles, $adminId);
                ?>
										<input type="hidden" name="old-profiles[<?php 
                echo $adminId;
                ?>
]" value="<?php 
                echo $manage_profiles;
                ?>
" />
									</li>
									<li>
										<?php 
                spa_render_caps_checkbox(spa_text('Manage Themes'), 'manage-themes[' . $adminId . ']', $manage_themes, $adminId);
                ?>
										<input type="hidden" name="old-themes[<?php 
                echo $adminId;
                ?>
]" value="<?php 
                echo $manage_themes;
                ?>
" />
									</li>
									<li>
										<?php 
                spa_render_caps_checkbox(spa_text('Manage Integration'), 'manage-integration[' . $adminId . ']', $manage_integration, $adminId);
                ?>
										<input type="hidden" name="old-integration[<?php 
                echo $adminId;
                ?>
]" value="<?php 
                echo $manage_integration;
                ?>
" />
									</li>
									<li>
<?php 
                if ($adminId == $spThisUser->ID) {
                    ?>
                                            <span class='floatListLabel'><?php 
                    echo spa_text('Manage Admins');
                    ?>
</span>
											<input type="hidden" name="manage-admins[<?php 
                    echo $adminId;
                    ?>
]" value="<?php 
                    echo $manage_admins;
                    ?>
" />
											<img src="<?php 
                    echo SFADMINIMAGES . 'sp_Locked.png';
                    ?>
" alt="" style="vertical-align:middle;padding:0 0 0 10px;margin:3px 0;" />
<?php 
                } else {
                    spa_render_caps_checkbox(spa_text('Manage Admins'), 'manage-admins[' . $adminId . ']', $manage_admins, $adminId);
                }
                ?>
										<input type="hidden" name="old-admins[<?php 
                echo $adminId;
                ?>
]" value="<?php 
                echo $manage_admins;
                ?>
" />
									</li>
<?php 
                do_action('sph_admin_caps_list', $user);
                ?>
      						</ul>

								<div class="clearboth"></div>
<?php 
                if ($adminId != $spThisUser->ID) {
                    echo '<hr />';
                    spa_render_caps_checkbox(spa_text('Remove All Capabilities from this') . ' ' . $title, 'remove-admin[' . $adminId . ']', '', $adminId);
                }
                spa_paint_close_fieldset();
            }
        }
        spa_paint_close_fieldset();
        spa_paint_close_panel();
        spa_paint_close_container();
    }
    ?>
	<div class="sfform-submit-bar">
	<input type="submit" class="button-primary" id="savecaps" name="savecaps" value="<?php 
    spa_etext('Update Admin Capabilities');
    ?>
" />
	</div>
<?php 
    spa_paint_close_tab();
    ?>
	</form>
	<div class="sfform-panel-spacer"></div>
<?php 
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=admins-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=addadmin';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfaddadmins" name="sfaddadmins">
	<?php 
    echo sp_create_nonce('forum-adminform_sfaddadmins');
    ?>

<?php 
    spa_paint_open_tab(spa_text('Manage Admins') . ' - ' . spa_text('Add Admins'), true);
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Add New Admins'), false);
    ?>
	<table style="text-align:center;padding:0;border-spacing:0;border-collapse:separate;" class="forum-table">
		<tr>
			<th style="text-align:center"><?php 
    spa_etext('Select New Admin Users');
    ?>
</th>
		</tr>
		<tr>
			<td style="text-align:center">
				<p style="text-align:center"><?php 
    spa_etext('Select members to make Admins (use CONTROL for multiple users)');
    ?>
</p>
<?php 
    $from = esc_js(spa_text('Eligible Members'));
    $to = esc_js(spa_text('Selected Members'));
    $action = 'addadmin';
    include_once SF_PLUGIN_DIR . '/admin/library/ahah/spa-ahah-multiselect.php';
    ?>
				<div class="clearboth"></div>
			</td>
		</tr>
	</table>

	<p><strong><?php 
    spa_etext('Select New Admin Capabilities');
    ?>
</strong></p>

	<ul class='floatList'>
		<li><?php 
    spa_render_caps_checkbox(spa_text('Manage Options'), 'add-opts', 0);
    ?>
</li>
		<li><?php 
    spa_render_caps_checkbox(spa_text('Manage Forums'), 'add-forums', 0);
    ?>
</li>
		<li><?php 
    spa_render_caps_checkbox(spa_text('Manage User Groups'), 'add-ugs', 0);
    ?>
</li>
		<li><?php 
    spa_render_caps_checkbox(spa_text('Manage Permissions'), 'add-perms', 0);
    ?>
</li>
		<li><?php 
    spa_render_caps_checkbox(spa_text('Manage Components'), 'add-comps', 0);
    ?>
</li>
		<li><?php 
    spa_render_caps_checkbox(spa_text('Manage Users'), 'add-users', 0);
    ?>
</li>
		<li><?php 
    spa_render_caps_checkbox(spa_text('Manage Profiles'), 'add-profiles', 0);
    ?>
</li>
		<li><?php 
    spa_render_caps_checkbox(spa_text('Manage Admins'), 'add-admins', 0);
    ?>
</li>
		<li><?php 
    spa_render_caps_checkbox(spa_text('Manage Toolbox'), 'add-tools', 0);
    ?>
</li>
		<li><?php 
    spa_render_caps_checkbox(spa_text('Manage Plugins'), 'add-plugins', 0);
    ?>
</li>
		<li><?php 
    spa_render_caps_checkbox(spa_text('Manage Themes'), 'add-themes', 0);
    ?>
</li>
		<li><?php 
    spa_render_caps_checkbox(spa_text('Manage Integration'), 'add-integration', 0);
    ?>
</li>
		<?php 
    do_action('sph_admin_caps_form', $user);
    ?>
	</ul>
<?php 
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('WP Admins but not Forum Admins'), false);
    ?>
	<table style="text-align:center;width:auto;padding:0;border-spacing:0;border-collapse:separate;" class="sfmaintable">
		<tr>
			<th style="text-align:center;width:30px" scope="col"></th>
			<th style="text-align:center"><?php 
    spa_etext('User ID');
    ?>
</th>
			<th style="text-align:center" scope="col"><?php 
    spa_etext('Admin Name');
    ?>
</th>
			<th style="text-align:center;width:30px" scope="col"></th>
		</tr>
<?php 
    $wp_admins = new SP_User_Search('', '', 'administrator');
    $is_users = false;
    for ($x = 0; $x < count($wp_admins->results); $x++) {
        $username = spdb_table(SFMEMBERS, 'admin=0 AND user_id=' . $wp_admins->results[$x], 'display_name');
        if ($username) {
            echo '<tr>';
            echo '<td></td>';
            echo '<td style="text-align:center">';
            echo $wp_admins->results[$x];
            echo '</td>';
            echo '<td>';
            echo esc_html($username);
            echo '</td>';
            echo '<td></td>';
            echo '</tr>';
            $is_users = true;
        }
    }
    if (!$is_users) {
        echo '<tr>';
        echo '<td></td>';
        echo '<td colspan="2">';
        spa_etext('No WP administrators that are not SPF admins were found');
        echo '</td>';
        echo '<td></td>';
        echo '</tr>';
    }
    ?>
	</table>
<?php 
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_admins_manage_panel');
    spa_paint_close_container();
    ?>
	<div class="sfform-submit-bar">
	<input type="submit" class="button-primary" id="savenew" name="savenew" value="<?php 
    spa_etext('Add New Admins');
    ?>
" />
	</div>
<?php 
    spa_paint_close_tab();
    ?>
	</form>
<?php 
}
コード例 #28
0
function spa_forums_enable_forum_form($forum_id)
{
    ?>
<script type="text/javascript">
    jQuery(document).ready(function() {
    	spjAjaxForm('sfforumenable<?php 
    echo $forum_id;
    ?>
', 'sfreloadfb');
    });
</script>
<?php 
    spa_paint_options_init();
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=enableforum';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfforumenable<?php 
    echo $forum_id;
    ?>
" name="sfforumenable<?php 
    echo $forum_id;
    ?>
">
<?php 
    echo sp_create_nonce('forum-adminform_forumenable');
    spa_paint_open_tab(spa_text('Forums') . ' - ' . spa_text('Manage Groups and Forums'), true);
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Enable Forum'), 'true', 'enable-forum');
    ?>
					<input type="hidden" name="forum_id" value="<?php 
    echo $forum_id;
    ?>
" />
<?php 
    echo '<p><b>';
    spa_etext('Warning! You are about to enable this forum');
    echo '</b></p>';
    echo '<p>';
    spa_etext('This will restore the forum to the front end with permissions/memberships controlling access');
    echo '</p>';
    echo '<p>';
    spa_etext('Click on the enable forum button below to proceed');
    echo '</p>';
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_forums_enable_forum_panel');
    spa_paint_close_container();
    ?>
		<div class="sfform-submit-bar">
		<input type="submit" class="button-primary" id="sfforumenable<?php 
    echo $forum_id;
    ?>
" name="sfforumenable<?php 
    echo $forum_id;
    ?>
" value="<?php 
    spa_etext('Enable Forum');
    ?>
" />
		<input type="button" class="button-primary" onclick="javascript:jQuery('#forum-<?php 
    echo $forum_id;
    ?>
').html('');" id="sfforumenable<?php 
    echo $forum_id;
    ?>
" name="enableforumcancel<?php 
    echo $forum_id;
    ?>
" value="<?php 
    spa_etext('Cancel');
    ?>
" />
		</div>
	</form>

	<?php 
    spa_paint_close_tab();
    ?>

	<div class="sfform-panel-spacer"></div>
<?php 
}
コード例 #29
0
function spa_components_seo_form()
{
    ?>
<script type="text/javascript">
    jQuery(document).ready(function() {
    	spjAjaxForm('sfseoform', 'sfreloadse');
    });
</script>
<?php 
    $sfcomps = spa_get_seo_data();
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=components-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=seo';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfseoform" name="sfseo">
	<?php 
    echo sp_create_nonce('forum-adminform_seo');
    spa_paint_options_init();
    #== EXTENSIONS Tab ============================================================
    spa_paint_open_tab(spa_text('Components') . ' - ' . spa_text('SEO'));
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Page/Browser Title (SEO)'), true, 'seo-plugin-integration');
    spa_paint_checkbox(spa_text('Overwrite page/browser title with ours'), 'sfseo_overwrite', $sfcomps['sfseo_overwrite']);
    spa_paint_checkbox(spa_text('Include blog name in page/browser title'), 'sfseo_blogname', $sfcomps['sfseo_blogname']);
    spa_paint_checkbox(spa_text('Include page name in page/browser title'), 'sfseo_pagename', $sfcomps['sfseo_pagename']);
    spa_paint_checkbox(spa_text('Display page name on forum home page (Group View) only'), 'sfseo_homepage', $sfcomps['sfseo_homepage']);
    spa_paint_checkbox(spa_text('Include forum name in page/browser title'), 'sfseo_forum', $sfcomps['sfseo_forum']);
    spa_paint_checkbox(spa_text('Include topic name in page/browser title'), 'sfseo_topic', $sfcomps['sfseo_topic']);
    spa_paint_checkbox(spa_text('Exclude forum name in page/browser title on topic views only'), 'sfseo_noforum', $sfcomps['sfseo_noforum']);
    spa_paint_checkbox(spa_text('Include non-forum page view names (ie profile, member list, etc) in page/browser title'), 'sfseo_page', $sfcomps['sfseo_page']);
    spa_paint_input(spa_text('Title separator'), 'sfseo_sep', $sfcomps['sfseo_sep']);
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Meta Tags Data'), true, 'meta-tags');
    $submessage = spa_text('Text you enter here will entered as a custom meta desciption tag if enabled in the option above');
    spa_paint_wide_textarea(spa_text('Custom meta description'), 'sfdescr', $sfcomps['sfdescr'], $submessage, 3);
    $submessage = spa_text('Enter keywords separated by commas');
    spa_paint_wide_textarea(spa_text('Custom meta keywords'), 'sfkeywords', $sfcomps['sfkeywords'], $submessage);
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_components_seo_left_panel');
    spa_paint_tab_right_cell();
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Meta Tags Setup'), true, 'meta-setup');
    $values = array(spa_text('Do not add meta description to any forum pages'), spa_text('Use custom meta description on all forum pages'), spa_text('Use custom meta description on main forum page only and use forum description on forum and topic pages'), spa_text('Use custom meta description on main forum page only, use forum description on forum pages and use topic title on topic pages'), spa_text('Use custom meta description on main forum page only, use forum description on forum pages and use first post excerpt (120 chars) on topic pages'));
    spa_paint_radiogroup(spa_text('Select meta description option'), 'sfdescruse', $values, $sfcomps['sfdescruse'], false, true);
    $values = array(spa_text('Do not add meta keywords to any forum pages'), spa_text('Use custom meta keywords (entered in left panel) on all forum pages'), spa_text('Use custom meta keywords for each forum on forum and topic view pages. Custom meta keywords (from left panel) used on other forum pages'));
    spa_paint_radiogroup(spa_text('Select meta keywords option'), 'sfusekeywords', $values, $sfcomps['sfusekeywords'], false, true);
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_components_seo_right_panel');
    spa_paint_close_container();
    ?>
    	<div class="sfform-submit-bar">
        	<input type="submit" class="button-primary" id="saveit" name="saveit" value="<?php 
    spa_etext('Update SEO Component');
    ?>
" />
    	</div>
	</form>
<?php 
    spa_paint_close_tab();
}
コード例 #30
0
function spa_forums_add_permission_form($forum_id)
{
    ?>
<script type="text/javascript">
    jQuery(document).ready(function() {
    	spjAjaxForm('sfpermissionnew<?php 
    echo $forum_id;
    ?>
', 'sfreloadfb');
    });
</script>
<?php 
    $forum = spdb_table(SFFORUMS, "forum_id={$forum_id}", 'row');
    echo '<div class="sfform-panel-spacer"></div>';
    spa_paint_options_init();
    $ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums-loader&amp;sfnonce=' . wp_create_nonce('forum-ahah') . '&amp;saveform=addperm';
    ?>
	<form action="<?php 
    echo $ahahURL;
    ?>
" method="post" id="sfpermissionnew<?php 
    echo $forum->forum_id;
    ?>
" name="sfpermissionnew<?php 
    echo $forum->forum_id;
    ?>
">
<?php 
    echo sp_create_nonce('forum-adminform_permissionnew');
    spa_paint_open_tab(spa_text('Forums') . ' - ' . spa_text('Manage Groups and Forums'), true);
    spa_paint_open_panel();
    spa_paint_open_fieldset(spa_text('Add Permission Set'), 'true', 'add-user-group-permission-set');
    ?>
					<table class="form-table">
						<tr>
							<td class="sflabel"><?php 
    spa_display_usergroup_select(true, $forum->forum_id);
    ?>
</td>
						</tr><tr>
							<td class="sflabel"><?php 
    spa_display_permission_select();
    ?>
</td>
						</tr>
					</table>
					<input type="hidden" name="forum_id" value="<?php 
    echo $forum->forum_id;
    ?>
" />
<?php 
    spa_paint_close_fieldset();
    spa_paint_close_panel();
    do_action('sph_forums_add_perm_panel');
    spa_paint_close_container();
    ?>
		<div class="sfform-submit-bar">
		<input type="submit" class="button-primary" id="permnew<?php 
    echo $forum->forum_id;
    ?>
" name="permnew<?php 
    echo $forum->forum_id;
    ?>
" value="<?php 
    spa_etext('Add Permission Set');
    ?>
" />
		<input type="button" class="button-primary" onclick="javascript:jQuery('#newperm-<?php 
    echo $forum->forum_id;
    ?>
').html('');" id="sfpermissionnew<?php 
    echo $forum->forum_id;
    ?>
" name="addpermcancel<?php 
    echo $forum->forum_id;
    ?>
" value="<?php 
    spa_etext('Cancel');
    ?>
" />
		</div>
<?php 
    spa_paint_close_tab();
    ?>
	</form>
	<div class="sfform-panel-spacer"></div>
<?php 
}