protected function taskLinks($tasks)
 {
     $user = $this->getUser();
     foreach ($tasks as $index => $id) {
         $task = TranslateTasks::getTask($id);
         if (!$task) {
             unset($tasks[$index]);
             continue;
         }
         if (!$task->isAllowedFor($user)) {
             unset($tasks[$index]);
             continue;
         }
     }
     $sep = Html::element('br');
     $count = count($tasks);
     if ($count === 0) {
         return $sep . $this->msg('translate-taction-disabled')->escaped();
     } elseif ($count === 1) {
         $id = array_pop($tasks);
         // If there is only one task, and it is the default task, hide it.
         // If someone disables the default task for action, we will show
         // a list of alternative task(s), but not showing anything
         // by default. */
         if ($this->defaults['task'] === $id) {
             return '';
         }
         // Give grep a chance to find the usages:
         // translate-taskui-view, translate-taskui-untranslated, translate-taskui-optional,
         // translate-taskui-acceptqueue, translate-taskui-reviewall,
         // translate-taskui-export-to-file, translate-taskui-export-as-po
         return $sep . Html::rawElement('label', array(), Xml::radio('task', $id, true) . ' ' . $this->msg("translate-taskui-{$id}")->escaped());
     } else {
         $output = '';
         foreach ($tasks as $id) {
             // Give grep a chance to find the usages:
             // translate-taskui-view, translate-taskui-untranslated, translate-taskui-optional,
             // translate-taskui-acceptqueue, translate-taskui-reviewall,
             // translate-taskui-export-to-file, translate-taskui-export-as-po
             $output .= Html::rawElement('label', array(), Xml::radio('task', $id, $this->options['task'] === $id) . ' ' . $this->msg("translate-taskui-{$id}")->escaped()) . ' ';
         }
         return $sep . $output;
     }
 }
 protected function taskSelector($pageTranslation = false)
 {
     global $wgUser;
     $selector = new XmlSelect('task', 'task');
     $selector->setDefault($this->options['task']);
     $isPageTranslation = $this->group instanceof WikiPageMessageGroup;
     foreach (TranslateTasks::getTasks($isPageTranslation) as $id) {
         if (TranslateTasks::getTask($id)->isAllowedFor($wgUser)) {
             $label = TranslateTask::labelForTask($id);
             $selector->addOption($label, $id);
         }
     }
     return $selector->getHTML();
 }