";
echo self::get_checkbox("loc_dashboard",__("Include in the dashboard widget"));
echo "
";
echo "
";
echo self::get_checkbox("dsn_loc_manual",__("Include this note on the following pages (eg, options-general.php to appear on the Settings->General page)."));
echo "
";
*/
echo "
";
echo self::get_checkbox("instructions_exclude",__("Exclude this note from the site instruction manual."));
echo "
";
global $wp_roles;
$roles = $wp_roles->roles;
echo "
";
echo "
" . __("Show this note for the following roles:") . "
";
foreach($roles as $role_name=>$role_arr) {
echo "
";
echo self::get_checkbox("role_".$role_name,$role_arr['name']);
echo "
";
}
echo "
";
echo "
";
echo "
" . __("Display this message in the following locations:") . "
";
echo "
";
$ct = 0;
foreach(self::$post_types as $type=>$type_obj) {
if($ct++ % 2 == 0) $class = ' odd ';
else $class = ' even ';
echo "";
echo "| {$type_obj->name}: | ";
echo "" . self::get_checkbox("loc_edit_".$type,__("Edit"),'child_check') . " | ";
echo "" . self::get_checkbox("loc_new_".$type,__("New"),'child_check') . " | ";
echo "" . self::get_checkbox("loc_search_".$type,__("Search"),'child_check') . " | ";
echo "" . self::get_checkbox("all_".$type,__("Everywhere"),'parent_check') . " | ";
echo "
";
}
echo "
";
echo "
";
}
// Create the site note content type
public static function add_content_type() {
$labels = array(
'name' => __( 'Site Notes' ),
'singular_name' => __( 'Site Note' ),
'add_new_item' => __( 'Add Site Note' ),
'edit_item' => __( 'Edit Site Note' ),
'new_item' => __( 'New Site Note' ),
'view_item' => __( 'View Site Note' )
);
$supports = array(
'editor'=>true,
'title'=>true,
'page-attributes'=>true,
'hierarchy'=>true
);
// TODO: add capability_type for security so non-superadmins can't add/edit notes
$args = array(
'labels' => $labels,
'public' => false,
'publicly_queryable' => false,
'show_ui' => self::$has_edit,
'hierarchical' => true,
'page-attributes' => true,
'revisions' => true,
//'supports' => array('title', 'editor', 'excerpt', 'page-attributes' ),
'supports' => array('title', 'editor', 'page-attributes' ),
'description' => __('Add helpful notes for site admins')
);
register_post_type( self::$post_type_name,$args);
}
}
$dsnmanager = null;
function dsn_init_manager() {
global $dsnmanager;
$dsnmanager = new DSNManager();
}
add_action('init','dsn_init_manager', 1);