Changeset View
Changeset View
Standalone View
Standalone View
plugins/tasklist/tasklist_ui.php
Show First 20 Lines • Show All 212 Lines • ▼ Show 20 Lines | class tasklist_ui | ||||
public function list_tree_html($node, $data, &$jsenv, $attrib) | public function list_tree_html($node, $data, &$jsenv, $attrib) | ||||
{ | { | ||||
$out = ''; | $out = ''; | ||||
foreach ($node->children as $folder) { | foreach ($node->children as $folder) { | ||||
$id = $folder->id; | $id = $folder->id; | ||||
$prop = $data[$id]; | $prop = $data[$id]; | ||||
$is_collapsed = false; // TODO: determine this somehow? | $is_collapsed = false; // TODO: determine this somehow? | ||||
$content = $this->tasklist_list_item($id, $prop, $jsenv, $attrib['activeonly']); | $content = $this->tasklist_list_item($id, $prop, $jsenv, $attrib['activeonly'] ?? null); | ||||
if (!empty($folder->children)) { | if (!empty($folder->children)) { | ||||
$content .= html::tag('ul', array('style' => ($is_collapsed ? "display:none;" : null)), | $content .= html::tag('ul', array('style' => ($is_collapsed ? "display:none;" : null)), | ||||
$this->list_tree_html($folder, $data, $jsenv, $attrib)); | $this->list_tree_html($folder, $data, $jsenv, $attrib)); | ||||
} | } | ||||
if (strlen($content)) { | if (strlen($content)) { | ||||
$out .= html::tag('li', array( | $out .= html::tag('li', array( | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | public function tasklist_list_item($id, $prop, &$jsenv, $activeonly = false) | ||||
)); | )); | ||||
$actions = ''; | $actions = ''; | ||||
if (!empty($prop['removable'])) { | if (!empty($prop['removable'])) { | ||||
$actions .= html::a(['href' => '#', 'class' => 'remove', 'title' => $this->plugin->gettext('removelist')], ' '); | $actions .= html::a(['href' => '#', 'class' => 'remove', 'title' => $this->plugin->gettext('removelist')], ' '); | ||||
} | } | ||||
$actions .= html::a(['href' => '#', 'class' => 'quickview', 'title' => $this->plugin->gettext('focusview'), 'role' => 'checkbox', 'aria-checked' => 'false'], ' '); | $actions .= html::a(['href' => '#', 'class' => 'quickview', 'title' => $this->plugin->gettext('focusview'), 'role' => 'checkbox', 'aria-checked' => 'false'], ' '); | ||||
if (isset($prop['subscribed'])) { | if (isset($prop['subscribed'])) { | ||||
$action .= html::a(['href' => '#', 'class' => 'subscribed', 'title' => $this->plugin->gettext('tasklistsubscribe'), 'role' => 'checkbox', 'aria-checked' => $prop['subscribed'] ? 'true' : 'false'], ' '); | $actions .= html::a(['href' => '#', 'class' => 'subscribed', 'title' => $this->plugin->gettext('tasklistsubscribe'), 'role' => 'checkbox', 'aria-checked' => $prop['subscribed'] ? 'true' : 'false'], ' '); | ||||
} | } | ||||
return html::div(join(' ', $classes), | return html::div(join(' ', $classes), | ||||
html::a(['class' => 'listname', 'title' => $title, 'href' => '#', 'id' => $label_id], | html::a(['class' => 'listname', 'title' => $title, 'href' => '#', 'id' => $label_id], | ||||
!empty($prop['listname']) ? $prop['listname'] : $prop['name']) | !empty($prop['listname']) ? $prop['listname'] : $prop['name']) | ||||
. (!empty($prop['virtual']) ? '' : $chbox . html::span('actions', $actions)) | . (!empty($prop['virtual']) ? '' : $chbox . html::span('actions', $actions)) | ||||
); | ); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 318 Lines • Show Last 20 Lines |