PluginProbe
Taskbuilder – Project Management & Task Management Tool With Kanban Board / 5.0.5
Taskbuilder – Project Management & Task Management Tool With Kanban Board v5.0.5
6.0.5 6.0.2 6.0.3 6.0.4 6.0.1 6.0.0 5.0.8 5.0.9 4.0.9 5.0.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 All 57 releases
taskbuilder / includes / admin / tasks / open_task / wppm_edit_task_thread.php

wppm_edit_task_thread.php in Taskbuilder – Project Management & Task Management Tool With Kanban Board 5.0.5, at includes/admin/tasks/open_task/wppm_edit_task_thread.php

90 lines 5.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit; // Exit if accessed directly
4 }
5
6 global $wpdb,$wppmfunction,$current_user;
7 $comment_id = isset($_POST['comment_id']) ? absint(sanitize_text_field(wp_unslash($_POST['comment_id']))) : '' ;
8 $task_id = isset($_POST['task_id']) ? absint(sanitize_text_field(wp_unslash($_POST['task_id']))) : '' ;
9 $proj_id = isset($_POST['proj_id']) ? absint(sanitize_text_field(wp_unslash($_POST['proj_id']))) : '' ;
10 $task_data = $wppmfunction->get_task($task_id);
11 $task_comment = $wppmfunction->get_task_comment($comment_id);
12 $settings = get_option("wppm-ap-modal");
13 $wppm_rich_text_editor = get_option('wppm_rich_text_editor');
14 $wppm_toolbar_actions = get_option('wppm_toolbar_actions');
15 if (!(($current_user->ID && $current_user->has_cap('manage_options')) || ($wppmfunction->has_permission('change_task_details',$task_id)) || ($current_user->ID == $task_comment['created_by']))) {exit;}
16 ob_start();
17 ?>
18 <form id="frm_edit_task_thread" method="post">
19 <div>
20 <textarea id="wppm_edit_task_thread_editor">
21 <?php echo !empty($task_comment['body']) ? wp_kses_post(wpautop($task_comment['body'])) : ''; ?>
22 </textarea>
23 </div>
24 <input type="hidden" name="action" value="wppm_set_edit_task_thread" />
25 <input type="hidden" name="_ajax_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wppm_set_edit_task_thread' ) ); ?>">
26 <input type="hidden" id="wppm_task_id" name="task_id" value="<?php echo (esc_attr($task_id)) ?>" />
27 <input type="hidden" id="wppm_comment_id" name="comment_id" value="<?php echo (esc_attr($comment_id)) ?>" />
28 </form>
29 <script>
30 jQuery( document ).ready( function( jQuery ) { <?php
31 if((!empty($wppm_rich_text_editor)) && ($wppm_rich_text_editor == 1)){
32 $bold = (isset($wppm_toolbar_actions['bold']) && $wppm_toolbar_actions['bold']==1)? 'bold' :"";
33 $italic = (isset($wppm_toolbar_actions['italic']) && $wppm_toolbar_actions['italic']==1)? 'italic' :"";
34 $underline = (isset($wppm_toolbar_actions['underline']) && $wppm_toolbar_actions['underline']==1)?'underline' :"";
35 $blockquote = (isset($wppm_toolbar_actions['blockquote']) && $wppm_toolbar_actions['blockquote']==1)? 'blockquote' :"";
36 $align = (isset($wppm_toolbar_actions['align']) && $wppm_toolbar_actions['align']==1)? ' alignleft aligncenter alignright ' :"";
37 $bullist = (isset($wppm_toolbar_actions['bullist']) && $wppm_toolbar_actions['bullist']==1)? $bullist = 'bullist' :"";
38 $numlist = (isset($wppm_toolbar_actions['numlist']) && $wppm_toolbar_actions['numlist']==1)? $numlist = 'numlist' :"";
39 $rtl = (isset($wppm_toolbar_actions['rtl']) && $wppm_toolbar_actions['rtl']==1)? $rtl = 'rtl' :"";
40 $link = (isset($wppm_toolbar_actions['link']) && $wppm_toolbar_actions['link']==1)? $link = 'link' :"";
41 $image = (isset($wppm_toolbar_actions['wppm_insert_editor_img']) && $wppm_toolbar_actions['wppm_insert_editor_img']==1)? $image = 'image' :"";
42 $forecolor = (isset($wppm_toolbar_actions['forecolor']) && $wppm_toolbar_actions['forecolor']==1)? $forecolor = 'forecolor' :"";
43 $backcolor = (isset($wppm_toolbar_actions['backcolor']) && $wppm_toolbar_actions['backcolor']==1)? $backcolor = 'backcolor' :"";
44 $strikethrough = (isset($wppm_toolbar_actions['strikethrough']) && $wppm_toolbar_actions['strikethrough']==1)? $strikethrough = 'strikethrough' :"";
45 $toolbar = trim("$bold $italic $underline $blockquote | $align | $bullist $numlist | $rtl | $link $image | $forecolor $backcolor $strikethrough");?>
46 tinymce.remove();
47 tinymce.init({
48 selector:'#wppm_edit_task_thread_editor',
49 body_id: 'wppm_edit_task_thread_editor',
50 directionality : '<?php //echo 'rtl'; ?>',
51 menubar: false,
52 statusbar: false,
53 height : '200',
54 width : '100%',
55 plugins: [
56 'lists link image directionality'
57 ],
58 image_advtab: true,
59 toolbar: '<?php echo esc_js( $toolbar ); ?>',
60 branding: false,
61 autoresize_bottom_margin: 20,
62 browser_spellcheck : true,
63 relative_urls : false,
64 remove_script_host : false,
65 convert_urls : true,
66 content_style:
67 `body {
68 color:<?php echo esc_attr( $settings['body-text-color'])?>!important;
69 }`,
70 setup: function (editor) {
71 }
72 });
73 <?php } ?>
74 });
75 <?php
76 $body = ob_get_clean();
77
78 ob_start();
79 ?>
80 <button type="button" class="btn <?php echo ($proj_id!=0)?'wppm_modal_close':'wppm_task_modal_close'?>" onclick="<?php echo ($proj_id!=0)?'wppm_modal_close();':'wppm_task_modal_close();'?>"><?php echo esc_html_e('Close','taskbuilder');?></button>
81 <button type="button" class="btn <?php echo ($proj_id!=0)?'wppm_popup_action':'wppm_task_popup_action'?>" onclick="wppm_set_edit_task_thread(<?php echo (esc_js($task_id))?>,<?php echo esc_js($proj_id) ?>);"><?php echo esc_html_e('Save','taskbuilder');?></button>
82 <?php
83 $footer = ob_get_clean();
84
85 $output = array(
86 'body' => $body,
87 'footer' => $footer
88 );
89
90 echo wp_json_encode($output);