private function buildIssueList(array $issues, $group, $fonticon) { assert_instances_of($issues, 'PhabricatorSetupIssue'); $list = new PHUIObjectItemListView(); $list->setBig(true); $ignored_items = array(); $items = 0; foreach ($issues as $issue) { if ($issue->getGroup() == $group) { $items++; $href = $this->getApplicationURI('/issue/' . $issue->getIssueKey() . '/'); $item = id(new PHUIObjectItemView())->setHeader($issue->getName())->setHref($href)->addAttribute($issue->getSummary()); if (!$issue->getIsIgnored()) { $icon = id(new PHUIIconView())->setIcon($fonticon)->setBackground('bg-sky'); $item->setImageIcon($icon); $list->addItem($item); } else { $icon = id(new PHUIIconView())->setIcon('fa-eye-slash')->setBackground('bg-grey'); $item->setDisabled(true); $item->setImageIcon($icon); $ignored_items[] = $item; } } } foreach ($ignored_items as $item) { $list->addItem($item); } if ($items == 0) { return null; } else { return $list; } }
private function buildConfigOptionsList(array $groups, $type) { assert_instances_of($groups, 'PhabricatorApplicationConfigOptions'); $list = new PHUIObjectItemListView(); $list->setBig(true); $groups = msort($groups, 'getName'); foreach ($groups as $group) { if ($group->getGroup() == $type) { $icon = id(new PHUIIconView())->setIcon($group->getIcon())->setBackground('bg-violet'); $item = id(new PHUIObjectItemView())->setHeader($group->getName())->setHref('/config/group/' . $group->getKey() . '/')->addAttribute($group->getDescription())->setImageIcon($icon); $list->addItem($item); } } return $list; }
private function buildOptionList(array $options) { assert_instances_of($options, 'PhabricatorConfigOption'); require_celerity_resource('config-options-css'); $db_values = array(); if ($options) { $db_values = id(new PhabricatorConfigEntry())->loadAllWhere('configKey IN (%Ls) AND namespace = %s', mpull($options, 'getKey'), 'default'); $db_values = mpull($db_values, null, 'getConfigKey'); } $engine = id(new PhabricatorMarkupEngine())->setViewer($this->getRequest()->getUser()); foreach ($options as $option) { $engine->addObject($option, 'summary'); } $engine->process(); $list = new PHUIObjectItemListView(); $list->setBig(true); foreach ($options as $option) { $summary = $engine->getOutput($option, 'summary'); $item = id(new PHUIObjectItemView())->setHeader($option->getKey())->setHref('/config/edit/' . $option->getKey() . '/')->addAttribute($summary); $label = pht('Current Value:'); $color = null; $db_value = idx($db_values, $option->getKey()); if ($db_value && !$db_value->getIsDeleted()) { $item->setEffect('visited'); $color = 'violet'; $label = pht('Customized Value:'); } if ($option->getHidden()) { $item->setStatusIcon('fa-eye-slash grey', pht('Hidden')); $item->setDisabled(true); } else { if ($option->getLocked()) { $item->setStatusIcon('fa-lock ' . $color, pht('Locked')); } else { $item->setStatusIcon('fa-pencil-square-o ' . $color, pht('Editable')); } } if (!$option->getHidden()) { $current_value = PhabricatorEnv::getEnvConfig($option->getKey()); $current_value = PhabricatorConfigJSON::prettyPrintJSON($current_value); $current_value = phutil_tag('div', array('class' => 'config-options-current-value'), array(phutil_tag('span', array(), $label), ' ' . $current_value)); $item->appendChild($current_value); } $list->addItem($item); } return $list; }