Example #1
0
 public function run()
 {
     $template = "";
     $task = array_shift($this->tasks);
     if (!$task) {
         return $template;
     }
     foreach (Tasks::getCategories() as $category) {
         $template_rows = "";
         $current_category = $task->category;
         while ($task->category == $current_category) {
             $template_rows .= $this->join_tile($task);
             $task = array_shift($this->tasks);
             if (!$task) {
                 break;
             }
         }
         $template .= $this->join_row($template_rows);
         if (!$task) {
             break;
         }
     }
     $template = $this->join_container($template);
     return $template;
 }