Changeset View
Changeset View
Standalone View
Standalone View
src/applications/guides/module/PhabricatorGuideInstallModule.php
<?php | <?php | ||||
final class PhabricatorGuideInstallModule extends PhabricatorGuideModule { | final class PhabricatorGuideInstallModule extends PhabricatorGuideModule { | ||||
public function getModuleKey() { | public function getModuleKey() { | ||||
return 'install'; | return 'install'; | ||||
} | } | ||||
public function getModuleName() { | public function getModuleName() { | ||||
return pht('Install Phabricator'); | return pht('Install'); | ||||
} | } | ||||
public function getModulePosition() { | public function getModulePosition() { | ||||
return 20; | return 20; | ||||
} | } | ||||
public function getIsModuleEnabled() { | public function getIsModuleEnabled() { | ||||
if (PhabricatorEnv::getEnvConfig('cluster.instance')) { | if (PhabricatorEnv::getEnvConfig('cluster.instance')) { | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | if ($have_auth) { | ||||
$icon_bg = 'bg-green'; | $icon_bg = 'bg-green'; | ||||
$description = pht( | $description = pht( | ||||
"You've configured at least one authentication provider."); | "You've configured at least one authentication provider."); | ||||
} else { | } else { | ||||
$icon = 'fa-key'; | $icon = 'fa-key'; | ||||
$icon_bg = 'bg-sky'; | $icon_bg = 'bg-sky'; | ||||
$description = pht( | $description = pht( | ||||
'Authentication providers allow users to register accounts and '. | 'Authentication providers allow users to register accounts and '. | ||||
'log in to Phabricator.'); | 'log in.'); | ||||
} | } | ||||
$item = id(new PhabricatorGuideItemView()) | $item = id(new PhabricatorGuideItemView()) | ||||
->setTitle($title) | ->setTitle($title) | ||||
->setHref($href) | ->setHref($href) | ||||
->setIcon($icon) | ->setIcon($icon) | ||||
->setIconBackground($icon_bg) | ->setIconBackground($icon_bg) | ||||
->setDescription($description); | ->setDescription($description); | ||||
$guide_items->addItem($item); | $guide_items->addItem($item); | ||||
$title = pht('Configure Phabricator'); | $title = pht('Configure'); | ||||
$href = PhabricatorEnv::getURI('/config/'); | $href = PhabricatorEnv::getURI('/config/'); | ||||
// Just load any config value at all; if one exists the install has figured | // Just load any config value at all; if one exists the install has figured | ||||
// out how to configure things. | // out how to configure things. | ||||
$have_config = (bool)id(new PhabricatorConfigEntry())->loadAllWhere( | $have_config = (bool)id(new PhabricatorConfigEntry())->loadAllWhere( | ||||
'1 = 1 LIMIT 1'); | '1 = 1 LIMIT 1'); | ||||
if ($have_config) { | if ($have_config) { | ||||
$icon = 'fa-check'; | $icon = 'fa-check'; | ||||
$icon_bg = 'bg-green'; | $icon_bg = 'bg-green'; | ||||
$description = pht( | $description = pht( | ||||
"You've configured at least one setting from the web interface."); | "You've configured at least one setting from the web interface."); | ||||
} else { | } else { | ||||
$icon = 'fa-sliders'; | $icon = 'fa-sliders'; | ||||
$icon_bg = 'bg-sky'; | $icon_bg = 'bg-sky'; | ||||
$description = pht( | $description = pht( | ||||
'Learn how to configure mail and other options in Phabricator.'); | 'Learn how to configure mail and other options.'); | ||||
} | } | ||||
$item = id(new PhabricatorGuideItemView()) | $item = id(new PhabricatorGuideItemView()) | ||||
->setTitle($title) | ->setTitle($title) | ||||
->setHref($href) | ->setHref($href) | ||||
->setIcon($icon) | ->setIcon($icon) | ||||
->setIconBackground($icon_bg) | ->setIconBackground($icon_bg) | ||||
->setDescription($description); | ->setDescription($description); | ||||
Show All 36 Lines | if ($have_notifications) { | ||||
$icon = 'fa-check'; | $icon = 'fa-check'; | ||||
$icon_bg = 'bg-green'; | $icon_bg = 'bg-green'; | ||||
$description = pht( | $description = pht( | ||||
"You've set up a real-time notification server."); | "You've set up a real-time notification server."); | ||||
} else { | } else { | ||||
$icon = 'fa-bell'; | $icon = 'fa-bell'; | ||||
$icon_bg = 'bg-sky'; | $icon_bg = 'bg-sky'; | ||||
$description = pht( | $description = pht( | ||||
'Phabricator can deliver notifications in real-time with WebSockets.'); | 'Real-time notifications can be delivered with WebSockets.'); | ||||
} | } | ||||
$item = id(new PhabricatorGuideItemView()) | $item = id(new PhabricatorGuideItemView()) | ||||
->setTitle($title) | ->setTitle($title) | ||||
->setHref($href) | ->setHref($href) | ||||
->setIcon($icon) | ->setIcon($icon) | ||||
->setIconBackground($icon_bg) | ->setIconBackground($icon_bg) | ||||
->setDescription($description); | ->setDescription($description); | ||||
$guide_items->addItem($item); | $guide_items->addItem($item); | ||||
$intro = pht( | $intro = pht( | ||||
'Phabricator has been successfully installed. These next guides will '. | '%s has been successfully installed. These next guides will '. | ||||
'take you through configuration and new user orientation. '. | 'take you through configuration and new user orientation. '. | ||||
'These steps are optional, and you can go through them in any order. '. | 'These steps are optional, and you can go through them in any order. '. | ||||
'If you want to get back to this guide later on, you can find it in '. | 'If you want to get back to this guide later on, you can find it in '. | ||||
'{icon globe} **Applications** under {icon map-o} **Guides**.'); | '{icon globe} **Applications** under {icon map-o} **Guides**.', | ||||
PlatformSymbols::getPlatformServerName()); | |||||
$intro = new PHUIRemarkupView($viewer, $intro); | $intro = new PHUIRemarkupView($viewer, $intro); | ||||
$intro = id(new PHUIDocumentView()) | $intro = id(new PHUIDocumentView()) | ||||
->appendChild($intro); | ->appendChild($intro); | ||||
return array($intro, $guide_items); | return array($intro, $guide_items); | ||||
} | } | ||||
} | } |