add_css();
$this->add_javascript();
}
}
function add_css(){
// Enqueue the ad_post_meta.css
wp_enqueue_style('ad-post-meta-style', ASSIGNMENT_DESK_URL.'css/post_meta.css', false, false, 'all');
wp_enqueue_style('ad-fancybox', ASSIGNMENT_DESK_URL . 'js/fancybox/jquery.fancybox-1.3.1.css', false, false, 'all');
}
function add_javascript(){
wp_enqueue_script('jquery-fancybox-js', ASSIGNMENT_DESK_URL .'js/fancybox/jquery.fancybox-1.3.1.pack.js',
array('jquery'));
wp_enqueue_script('ad-post-js', ASSIGNMENT_DESK_URL .'js/post.js', array('jquery'));
}
function post_meta_box(){
global $post, $edit_flow;
$user = wp_get_current_user();
if(current_user_can('editor')){
$this->read_write_post_meta_box();
}
else {
$this->read_only_post_meta_box();
}
}
function print_pitch_info(){
global $post;
echo '
';
echo '
';
echo "
";
$pitched_by = get_post_meta($post->ID, '_ad_pitched_by');
if(count($pitched_by)) {
foreach($pitched_by as $pitcher_id){
$user = get_userdata((int)$pitcher_id);
echo "
Pitched by: {$user->nicename}
";
}
}
// TODO - Origin? (community or staff)
echo '
';
echo '
';
}
function print_editor_link(){
global $post;
$editor_id = get_post_meta($post->ID, '_ad_editor', true);
if($editor_id){
$editor = get_userdata($editor_id);
$contact_url = "?page=assignment_desk-contributor&action=contact_editor&post_id={$post->ID}>";
$editor_name = $editor->nice_name;
echo "Editor: $editor_name";
}
else {
echo "Editor: None";
}
}
function read_write_post_meta_box(){
global $post, $wpdb, $edit_flow, $assignment_desk;
$this->print_pitch_info();
?>
Assign this post to:
Users assigned to this post
- Tommy Tester (Writer)
- Wendy Writer (Photographer)
print_editor_link();
// Other links ?>
print_pitch_info();
}
function save_post_meta_box(){
}
}
$assignment_desk_post_meta = new assignment_desk_post_meta();
} // end if(!class_exists)
?>