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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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 }
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(); }
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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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_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> </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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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 }
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&sfnonce=' . wp_create_nonce('forum-ahah') . "&saveform=plugin&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 } }
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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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 }
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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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:') . ' <strong>' . sp_get_option('sfversion') . '</strong>'; $build = spa_text('Build: ') . ' <strong>' . sp_get_option('sfbuild') . '</strong>'; echo $version . ' ' . $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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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 }
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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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 }
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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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 }
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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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 }
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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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_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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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 }
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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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 }
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&sfnonce=' . wp_create_nonce('forum-ahah') . "&saveform=plugin&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 } }
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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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> ' . spa_text('Note: Action settings displaying this icon will be ignored for Guest Users') . '</small>'; echo ' <img src="' . SFADMINIMAGES . 'sp_GlobalPerm.png" alt="" style="width:16px;height:16px;vertical-align:top" />'; echo '<small> ' . spa_text('Note: Action settings displaying this icon require enabling to use') . '</small>'; echo ' <img src="' . SFADMINIMAGES . 'sp_Warning.png" alt="" style="width:16px;height:16px;vertical-align:top" />'; echo '<small> ' . 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 }
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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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 }
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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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"> <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(); }
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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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(); }
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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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(); }
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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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 }
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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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&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&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 }
function spa_permissions_edit_permission_form($role_id) { global $spGlobals; ?> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('#rolerow-<?php echo $role_id; ?> ').addClass('inForm'); spjAjaxForm('sfroleedit<?php echo $role_id; ?> ', 'sfreloadpb'); jQuery(function(jQuery){vtip();}) }); </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; } $role = spa_get_role_row($role_id); spa_paint_options_init(); $ahahURL = SFHOMEURL . 'index.php?sp_ahah=permissions-loader&sfnonce=' . wp_create_nonce('forum-ahah') . '&saveform=editperm'; ?> <form action="<?php echo $ahahURL; ?> " method="post" id="sfroleedit<?php echo $role->role_id; ?> " name="sfroleedit<?php echo $role->role_id; ?> "> <?php echo sp_create_nonce('forum-adminform_roleedit'); spa_paint_open_tab(spa_text('Permissions') . ' - ' . spa_text('Manage Permissions'), true); spa_paint_open_panel(); spa_paint_open_fieldset(spa_text('Edit Permission'), 'true', 'edit-master-permission-set'); ?> <input type="hidden" name="role_id" value="<?php echo $role->role_id; ?> " /> <?php spa_paint_input(spa_text('Permission Set Name'), 'role_name', sp_filter_title_display($role->role_name), false, true); spa_paint_input(spa_text('Permission Set Description'), 'role_desc', sp_filter_title_display($role->role_desc), false, true); ?> <br /><p><strong><?php spa_etext("Permission Set Actions"); ?> :</strong></p> <?php echo '<p><img src="' . SFADMINIMAGES . 'sp_GuestPerm.png" alt="" width="16" height="16" align="top" />'; echo '<small> ' . spa_text('Note: Action settings displaying this icon will be ignored for Guest Users') . '</small><br />'; echo '<img src="' . SFADMINIMAGES . 'sp_GlobalPerm.png" alt="" width="16" height="16" align="top" />'; echo '<small> ' . spa_text('Note: Action settings displaying this icon require enabling to use') . '</small><br />'; echo '<img src="' . SFADMINIMAGES . 'sp_Warning.png" alt="" width="16" height="16" align="top" />'; echo '<small> ' . 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); $role_auths = maybe_unserialize($role->role_auths); $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 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='vtip permwarning' title='" . esc_js(spa_text($a->warning)) . "'" : ''; $button = 'b-' . $auth_id; $checked = ''; if (isset($role_auths[$auth_id]) && $role_auths[$auth_id]) { $checked = ' checked="checked"'; } 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; ?> "> <label for="sfR<?php echo $role->role_id . $button; ?> " class="sflabel"> <img align="top" style="float: right; border: 0pt none ; margin: -4px 5px 0px 3px; padding: 0;" class="vtip" title="<?php echo $tooltips[$auth_name]; ?> " src="<?php echo SFADMINIMAGES; ?> sp_Information.png" alt="" /> <?php spa_etext($spGlobals['auths'][$auth_id]->auth_desc); ?> </label> <input type="checkbox" name="<?php echo $button; ?> " id="sfR<?php echo $role->role_id . $button; ?> "<?php echo $checked; ?> /> <?php if ($span == '') { ?> <td align="center" class="permentry" width="32px"> <?php } if ($span == '') { if ($spGlobals['auths'][$auth_id]->enabling) { echo '<img src="' . SFADMINIMAGES . 'sp_GlobalPerm.png" alt="" width="16" height="16" title="' . spa_text('Requires Enabling') . '" />'; } if ($spGlobals['auths'][$auth_id]->ignored) { echo '<img src="' . SFADMINIMAGES . 'sp_GuestPerm.png" alt="" width="16" height="16" title="' . spa_text('Ignored for Guests') . '" />'; } if ($authWarn) { echo '<img src="' . SFADMINIMAGES . 'sp_Warning.png" alt="" width="16" height="16" title="' . spa_text('Use with Caution') . '" />'; } echo '</td>'; } else { ?> </td><td class="permentry" 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_edit_perm_panel'); spa_paint_close_container(); ?> <div class="sfform-submit-bar"> <input type="submit" class="button-primary" id="sfpermedit<?php echo $role->role_id; ?> " name="sfpermedit<?php echo $role->role_id; ?> " value="<?php spa_etext('Update Permission'); ?> " /> <input type="button" class="button-primary" onclick="javascript:jQuery('#perm-<?php echo $role->role_id; ?> ').html('');jQuery('#rolerow-<?php echo $role_id; ?> ').removeClass('inForm');" id="sfpermedit<?php echo $role->role_id; ?> " name="editpermcancel<?php echo $role->role_id; ?> " value="<?php spa_etext('Cancel'); ?> " /> </div> </form> <?php spa_paint_close_tab(); ?> <div class="sfform-panel-spacer"></div> <?php }
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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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 }
function spa_forums_delete_forum_form($forum_id) { ?> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('#forumrow-<?php echo $forum_id; ?> ').addClass('inForm'); spjAjaxForm('sfforumdelete<?php echo $forum_id; ?> ', 'sfreloadfb'); }); </script> <?php $forum = spdb_table(SFFORUMS, "forum_id={$forum_id}", 'row'); spa_paint_options_init(); $ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums-loader&sfnonce=' . wp_create_nonce('forum-ahah') . '&saveform=deleteforum'; ?> <form action="<?php echo $ahahURL; ?> " method="post" id="sfforumdelete<?php echo $forum->forum_id; ?> " name="sfforumdelete<?php echo $forum->forum_id; ?> "> <?php echo sp_create_nonce('forum-adminform_forumdelete'); spa_paint_open_tab(spa_text('Forums') . ' - ' . spa_text('Manage Groups and Forums'), true); spa_paint_open_panel(); spa_paint_open_fieldset(spa_text('Delete Forum'), 'true', 'delete-forum'); ?> <input type="hidden" name="group_id" value="<?php echo $forum->group_id; ?> " /> <input type="hidden" name="forum_id" value="<?php echo $forum->forum_id; ?> " /> <input type="hidden" name="cforum_seq" value="<?php echo $forum->forum_seq; ?> " /> <input type="hidden" name="parent" value="<?php echo $forum->parent; ?> " /> <input type="hidden" name="children" value="<?php echo $forum->children; ?> " /> <?php echo '<p>'; spa_etext('Warning! You are about to delete a forum'); echo '</p>'; echo '<p>'; spa_etext('This will remove ALL topics and posts contained in this forum'); echo '</p>'; echo '<p>'; spa_etext('Any Subforums will be promoted'); 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 forum button below to proceed'); echo '</p>'; echo '<p><strong>'; spa_etext('IMPORTANT: Be patient. For busy forums this action can take some time'); echo '</strong></p>'; spa_paint_close_fieldset(); spa_paint_close_panel(); do_action('sph_forums_delete_forum_panel'); spa_paint_close_container(); ?> <div class="sfform-submit-bar"> <input type="submit" class="button-primary" id="sfforumdelete<?php echo $forum->forum_id; ?> " name="sfforumdelete<?php echo $forum->forum_id; ?> " value="<?php spa_etext('Delete 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="sfforumdelete<?php echo $forum->forum_id; ?> " name="delforumcancel<?php echo $forum->forum_id; ?> " value="<?php spa_etext('Cancel'); ?> " /> </div> <?php spa_paint_close_tab(); ?> </form> <div class="sfform-panel-spacer"></div> <?php }
} }); }) </script> <?php $out = ''; $out .= '<p>'; $msg = sp_text('Usergroups enable forum admins to better control permissions and administer users. If the forum administrator has allowed it, you may also be able to join or leave open Usergroups. Your Usergroup memberships are shown below.'); $out .= apply_filters('sph_profile_membership_header', $msg); $out .= '</p>'; $out .= '<hr>'; # get the users profile data $spProfileData = sp_get_user_memberships($userid); $ahahURL = SFHOMEURL . 'index.php?sp_ahah=profile-save&sfnonce=' . wp_create_nonce('forum-ahah') . "&form={$thisSlug}&userid={$userid}"; $out .= '<form action="' . $ahahURL . '" method="post" name="spProfileFormMemberships" id="spProfileFormMemberships" class="spProfileForm">'; $out .= sp_create_nonce('forum-profile'); # show usergroup memberships $out .= '<div class="spProfileUsergroupsMemberships">'; $out = apply_filters('sph_ProfileFormTop', $out, $userid, $thisSlug); $out = apply_filters('sph_ProfileUsergroupsMembershipsFormTop', $out, $userid); $out .= '<p class="spHeaderName">' . sp_text('Memberships') . ':</p>'; $submit = false; # flag to indicate if any membership joins/leaves are available $out .= '<div id="spProfileUsergroupsMemberships">'; if ($spProfileData) { $alt = 'spOdd'; foreach ($spProfileData as $userGroup) { $out .= "<div class='spProfileUsergroup {$alt}'>"; $out .= '<div class="spColumnSection">'; $out .= '<div class="spHeaderName">' . $userGroup['usergroup_name'] . '</div>'; $out .= '<div class="spHeaderDescription">' . $userGroup['usergroup_desc'] . '</div>';
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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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 }
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&sfnonce=' . wp_create_nonce('forum-ahah') . '&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(); }
function sp_render_add_topic_form($args) { global $spVars, $spGlobals, $spThisForum, $spThisUser, $spGuestCookie; include_once SF_PLUGIN_DIR . '/forum/content/forms/sp-form-components.php'; $toolbar = $spGlobals['display']['editor']['toolbar']; $defs = array('tagClass' => 'spForm', 'hide' => 1, 'controlFieldset' => 'spEditorFieldset', 'controlInput' => 'spControl', 'controlSubmit' => 'spSubmit', 'controlOrder' => 'cancel|save', 'maxTitleLength' => 200, 'labelHeading' => sp_text('Add Topic'), 'labelGuestName' => sp_text('Guest name (required)'), 'labelGuestEmail' => sp_text('Guest email (required)'), 'labelModerateAll' => sp_text('NOTE: new posts are subject to administrator approval before being displayed'), 'labelModerateOnce' => sp_text('NOTE: first posts are subject to administrator approval before being displayed'), 'labelTopicName' => sp_text('Topic name'), 'labelSmileys' => sp_text('Smileys'), 'labelOptions' => sp_text('Options'), 'labelOptionLock' => sp_text('Lock this topic'), 'labelOptionPin' => sp_text('Pin this post'), 'labelOptionTime' => sp_text('Edit post timestamp'), 'labelMath' => sp_text('Math Required'), 'labelMathSum' => sp_text('What is the sum of'), 'labelPostButtonReady' => sp_text('Submit Topic'), 'labelPostButtonMath' => sp_text('Do Math To Save'), 'labelPostCancel' => sp_text('Cancel'), 'tipSmileysButton' => sp_text('Open/Close to Add a Smiley'), 'tipOptionsButton' => sp_text('Open/Close to select Posting Options'), 'tipSubmitButton' => sp_text('Save the New Topic'), 'tipCancelButton' => sp_text('Cancel the New Topic')); $a = wp_parse_args($args, $defs); extract($a, EXTR_SKIP); # sanitize $tagClass = esc_attr($tagClass); $hide = (int) $hide; $controlFieldset = esc_attr($controlFieldset); $controlInput = esc_attr($controlInput); $maxTitleLength = (int) $maxTitleLength; $labelHeading = sp_filter_title_display($labelHeading); $labelGuestName = sp_filter_title_display($labelGuestName); $labelGuestEmail = sp_filter_title_display($labelGuestEmail); $labelModerateAll = sp_filter_title_display($labelModerateAll); $labelModerateOnce = sp_filter_title_display($labelModerateOnce); $labelTopicName = sp_filter_title_display($labelTopicName); # Check for a failure package in case this is a redirect $f = sp_get_cache('post'); if (isset($f['guestname']) ? $guestnameval = $f['guestname'] : ($guestnameval = $spGuestCookie->guest_name)) { } if (isset($f['guestemail']) ? $guestemailval = $f['guestemail'] : ($guestemailval = $spGuestCookie->guest_email)) { } if (isset($f['newtopicname']) ? $topicnameval = $f['newtopicname'] : ($topicnameval = '')) { } if (isset($f['postitem']) ? $postitemval = $f['postitem'] : ($postitemval = '')) { } if (isset($f['message']) ? $failmessage = $f['message'] : ($failmessage = '')) { } $captchaValue = sp_get_option('captcha-value'); $out = ''; # Grab above editor message if there is one $postmsg = sp_get_option('sfpostmsg'); # Grab in-editor message if one $inEdMsg = sp_filter_text_display(sp_get_option('sfeditormsg')); if ($hide ? $hide = ' style="display:none;"' : ($hide = '')) { } $out .= '<div id="spPostForm"' . $hide . '>' . "\n"; $out .= "<form class='{$tagClass}' action='" . SFHOMEURL . "index.php?sp_ahah=post&sfnonce=" . wp_create_nonce('forum-ahah') . "' method='post' id='addtopic' name='addtopic' onsubmit='return spjValidatePostForm(this, {$spThisUser->guest}, 1, \"" . sp_paint_file_icon(SPTHEMEICONSURL, 'sp_Success.png') . "\");'>\n"; $out .= sp_create_nonce('forum-userform_addtopic'); $out .= '<div class="spEditor">' . "\n"; $out = apply_filters('sph_topic_editor_top', $out, $spThisForum); $out .= "<fieldset class='{$controlFieldset}'>\n"; $out .= "<legend>{$labelHeading}: " . $spThisForum->forum_name . "</legend>\n"; $out .= "<input type='hidden' name='action' value='topic' />\n"; $out .= "<input type='hidden' name='forumid' value='{$spThisForum->forum_id}' />\n"; $out .= "<input type='hidden' name='forumslug' value='{$spThisForum->forum_slug}' />\n"; $out .= "<input type='hidden' name='captcha' value='{$captchaValue}' />\n"; # input field that plugins can use $out .= "<input type='hidden' id='spEditorCustomValue' name='spEditorCustomValue' value='' />\n"; # plugins can add before the header $out = apply_filters('sph_topic_before_editor_header', $out, $spThisForum, $a); $tout = ''; $tout .= '<div class="spEditorSection">'; # let plugins add stuff at top of editor header $tout = apply_filters('sph_topic_editor_header_top', $tout, $spThisForum, $a); if (!empty($postmsg['sfpostmsgtopic'])) { $tout .= '<div class="spEditorMessage">' . sp_filter_text_display($postmsg['sfpostmsgtext']) . '</div>' . "\n"; } # create an empty div to allow plugins to add something $tout .= '<div id="spEditorCustomDiv"></div>'; if ($spThisUser->guest) { $tout .= '<div class="spEditorSectionLeft">' . "\n"; $tout .= "<div class='spEditorTitle'>{$labelGuestName}:\n"; $tout .= "<input type='text' tabindex='100' class='{$controlInput}' name='guestname' value='{$guestnameval}' /></div>\n"; $tout .= '</div>' . "\n"; $sfguests = sp_get_option('sfguests'); if ($sfguests['reqemail']) { $tout .= '<div class="spEditorSectionRight">' . "\n"; $tout .= "<div class='spEditorTitle'>{$labelGuestEmail}:\n"; $tout .= "<input type='text' tabindex='101' class='{$controlInput}' name='guestemail' value='{$guestemailval}' /></div>\n"; $tout .= '</div>' . "\n"; } $tout .= '<div class="spClear"></div>' . "\n"; } if (!sp_get_auth('bypass_moderation', $spThisForum->forum_id)) { $tout .= "<p class='spLabelSmall'>{$labelModerateAll}</p>\n"; } elseif (!sp_get_auth('bypass_moderation_once', $spThisForum->forum_id)) { $tout .= "<p class='spLabelSmall'>{$labelModerateOnce}</p>\n"; } $tout2 = ''; $tout2 .= "<div class='spEditorTitle'>{$labelTopicName}: \n"; $tout2 .= "<input id='spTopicTitle' type='text' tabindex='102' class='{$controlInput}' maxlength='{$maxTitleLength}' name='newtopicname' value='{$topicnameval}'/>\n"; $tout2 = apply_filters('sph_topic_editor_name', $tout2, $a); $tout2 .= '</div>' . "\n"; $tout .= apply_filters('sph_topic_editor_title', $tout2, $spThisForum, $a); # let plugins add stuff at bottom of editor header $tout = apply_filters('sph_topic_editor_header_bottom', $tout, $spThisForum, $a); $tout .= '</div>' . "\n"; # allow plugins to filter just the header $out .= apply_filters('sph_topic_editor_header', $tout, $spThisForum, $a); # do we have content? Or just add any inline message if (empty($postitemval)) { $postitemval = $inEdMsg; } # Display the selected editor $tout = ''; $tout .= '<div id="spEditorContent">' . "\n"; $tout .= sp_setup_editor(103, $postitemval); $tout .= '</div>' . "\n"; # allow plugins to filter the editor content $out .= apply_filters('sph_topic_editor_content', $tout, $spThisForum, $a); # define area above toolbar for plugins to add components $section = apply_filters('sph_topic_editor_above_toolbar', '', $spThisForum, $a); if (!empty($section)) { $tout = ''; $tout .= '<div class="spEditorSection">'; $tout .= $section; $tout .= '</div>' . "\n"; $out .= apply_filters('sph_topic_editor_above_toolbar_end', $tout, $spThisForum, $a); } # DEFINE NEW FAILURE AREA HERE # define validation failure notice area $out .= "<div class='spClear'></div>\n"; $out .= "<div id='spPostNotifications'>{$failmessage}</div>\n"; # TOOLBAR # define toolbar - submit buttons on right, plugin extensions on left $toolbarRight = apply_filters('sph_topic_editor_toolbar_submit', '', $spThisForum, $a, 'toolbar'); $toolbarLeft = apply_filters('sph_topic_editor_toolbar_buttons', '', $spThisForum, $a, 'toolbar'); if (!empty($toolbarRight) || !empty($toolbarLeft)) { # Submit section $tout = ''; $tout .= '<div class="spEditorSection spEditorToolbar">'; $tout .= $toolbarRight; # toolbar for plugins to add buttons $tout .= $toolbarLeft; $out .= apply_filters('sph_topic_editor_toolbar', $tout, $spThisForum, $a, 'toolbar'); $out .= '<div style="clear:both"></div>'; $out .= '</div>' . "\n"; } # START SMILEYS/OPTIONS # let plugins add stuff at top of editor footer $tout = ''; $tout = apply_filters('sph_topic_editor_footer_top', $tout, $spThisForum, $a); # smileys and options $tout = apply_filters('sp_topic_editor_inline_footer', $tout, $spThisForum, $a, 'inline'); # let plugins add stuff at end of editor footer $tout = apply_filters('sph_topic_editor_footer_bottom', $tout, $spThisForum, $a); # plugins can remove or adjust whole footer $out .= apply_filters('sph_topic_editor_footer', $tout, $spThisForum, $a); # allow plugins to insert stuff after editor footer $out = apply_filters('sph_topic_editor_after_footer', $out, $spThisForum, $a); # START SUBMIT SECTION # define submit section of no toolbar in use if (!$toolbar) { $out .= '<div class="spEditorSubmit">' . "\n"; $out = apply_filters('sph_topic_editor_submit_top', $out, $spThisForum, $a); # let plugins add/remove the controls area $tout = apply_filters('sp_topic_editor_inline_submit', '', $spThisForum, $a, 'inline'); # let plugins add stuff at end of editor submit bottom $out .= apply_filters('sph_topic_editor_submit_bottom', $tout, $spThisForum, $a); $out .= '</div>' . "\n"; } # close it up $out .= '</fieldset>' . "\n"; $out = apply_filters('sph_topic_editor_bottom', $out, $spThisForum, $a); $out .= '</div>' . "\n"; $out .= '</form>' . "\n"; $out .= '</div>' . "\n"; # let plugins add stuff beneath the editor $out = apply_filters('sph_topic_editor_beneath', $out, $spThisForum, $a); return $out; }