コード例 #1
0
		<a href="http://www.chatwee.com" class="chatwee-logo"></a>
		<h1>WordPress Chat by Chatwee: Moderation</h1>
		
		<div class="stuffbox">
		
			<article>
				
				<h2>Appoint user roles as moderators</h2>
				
				<form action="<?php 
echo $PHP_SELF;
?>
" method='post'>
												
					<?php 
$roles = get_role_names();
foreach ($roles as $role => $lang) {
    if ($role != 'administrator') {
        $checked = get_option('chatwee-settings-group[group_moderators_' . $role . ']');
        $checked1 = $checked == 'on' ? 'checked="checked"' : '';
        echo '<div class="right">';
        echo '<input name="group_moderators_' . $role . '" type="hidden" value="0">';
        echo '<input ' . $checked1 . ' id="group_moderators_' . $role . '" name="group_moderators_' . $role . '" value="on" type="checkbox" />';
        echo '<label for="group_moderators_' . $role . '">' . $lang . '</label>';
        echo '</div>';
    }
    ?>
					<?php 
}
?>
コード例 #2
0
ファイル: admin.php プロジェクト: TinkerBill/vagrant-2
function get_widget_dialog()
{
    $post_types = get_insertable_posttypes();
    // v6.52 Was get_widget_help_posttypes();
    d('$post_types', $post_types);
    // (F3) calls Wf_Debug
    $html = "<div id='widget_dialog_box'>\n";
    // wrapper round whole thing
    $html .= "<div id='dialog-form'></div>\n";
    // the form
    $html .= "<div id='available_items'>\n";
    // the available posts etc to insert
    $html .= "<h3>Available items to insert...</h3>\n";
    $html .= "<p>(For info only: &lsquo;selecting&rsquo; doesn't do anything)</p>\n";
    $cat_html = "<div id='post_type_picker'>\n";
    $cat_html .= "<select name='post_type' class='widefat' id='post_type'>\n";
    $cat_html .= "<option value='0'>Select...</option>\n";
    foreach ($post_types as $post_type => $name) {
        $html .= get_post_listing_dropdown($post_type, $name);
        // defined in wf_library.php
        $html .= get_term_dropdown($post_type, $name);
        $cat_html .= get_post_type_option($post_type, $name);
        //v5.19 v6.2
    }
    // Now add the post_type param selector (that is moved by js)  // v5.19
    $html .= $cat_html;
    $html .= "</select>\n";
    $html .= "</div>\n";
    // Now add the list of active plugins to pass via Ajax as a comma-separated string
    //$active_plugins = get_option('active_plugins'); // typical array item: "wf_widget_forms/wf_forms.php" // v6.2
    /*
    //v6.60 replaced now with function wf_get_active_plugin_dirs($value) in wf_widgets.php
    $active_plugin_dirs = array_map(function($value) { // v6.3
    	$path_array = explode('/',$value);
    	return $path_array[0];
    }, get_option('active_plugins'));
    */
    $active_plugin_dirs = array_map('wf_get_active_plugin_dirs', get_option('active_plugins'));
    //v6.60
    //var_dump($active_plugin_dirs);
    $html .= "<div id='active_plugin_dirs'>" . implode(',', $active_plugin_dirs) . "</div>\n";
    // eg: syntaxhighlighter,wf_library,wf_widget_forms,wf_widgets
    $html .= "<div id='user_roles'>" . implode(',', array_keys(get_role_names())) . "</div>\n";
    // comma-separated list of available roles
    //var_dump(implode(',',array_keys(get_role_names()))); // comma-separated list of available roles
    $html .= "</div>\n";
    // #available_items
    $html .= "</div>\n";
    // #widget_dialog_box
    return $html;
}