";
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;
echo "
| |
|
|
|
" . self::get_checkbox("loc_everywhere",__("Everywhere"),'master_check') . " |
";
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("loc_all_".$type,__("All"),'parent_check',true) . " | ";
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' ),
'description' => __('Add helpful notes for site admins')
);
register_post_type( self::$post_type_name,$args);
}
// add sickeningly greedy self-serving donate links to the wp plugin page entry
public static function extra_plugin_links($data, $page) {
if ( $page == self::$base ) {
$flattr_url = "http://flattr.com/thing/379485/Dashboard-Site-Notes";
$paypal_url = "https://www.paypal.com/cgi-bin/webscr?business=donate@innerdvations.com&cmd=_donations¤cy_code=EUR&item_name=Donation%%20for%%20Dashboard%%20Site%%20Notes%%20plugin";
$data = array_merge($data,array(
sprintf('
%s',$flattr_url, esc_html__('Flattr', self::$plugin_id)),
sprintf('
%s',$paypal_url, esc_html__('Donate', self::$plugin_id))
));
}
return $data;
}
}
$dsnmanager = null;
function dsn_init_manager() {
global $dsnmanager;
$dsnmanager = new DSNManager();
}
add_action('init','dsn_init_manager', 1);