/** * Display a select field with list of available priorities * @param integer $default the default priority * @param string $select_name the name of the select field * @param string $select_id the id of the select field * @return void */ function task_breaker_task_priority_select($default = 1, $select_name = 'task_breaker_task_priority', $select_id = 'task_breaker-task-priority-select') { require_once plugin_dir_path(__FILE__) . '../controllers/tasks.php'; $task_breaker_tasks = new ThriveProjectTasksController(); $priorities = $task_breaker_tasks->getPriorityCollection(); echo '<select name="' . esc_attr($select_name) . '" id="' . esc_attr($select_id) . '" class="task_breaker-task-select">'; foreach ($priorities as $priority_id => $priority_label) { $selected = intval($priority_id) === $default ? 'selected' : ''; echo '<option ' . esc_html($selected) . ' value="' . esc_attr($priority_id) . '">' . esc_html($priority_label) . '</option>'; } echo '</select>'; return; }
} ?> <?php $classes = implode(' ', array(esc_attr(sanitize_title($priority_label)), $completed)); ?> <li class="task_breaker-task-item <?php echo esc_attr($classes); ?> "> <ul class="task_breaker-task-item-details"> <li class="priority"> <span> <?php $priority_collection = $task_breaker_tasks->getPriorityCollection(); ?> <?php echo $priority_collection[$task->priority]; ?> </span> </li> <li class="details"> <h3> <a href="#tasks/view/<?php echo intval($task->id); ?> "> <?php echo esc_html(stripslashes($task->title)); ?>