Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/engine/PhabricatorProfilePanelEngine.php
| Show First 20 Lines • Show All 233 Lines • ▼ Show 20 Lines | private function loadPanels() { | ||||
| $stored_panels = id(new PhabricatorProfilePanelConfigurationQuery()) | $stored_panels = id(new PhabricatorProfilePanelConfigurationQuery()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->withProfilePHIDs(array($object->getPHID())) | ->withProfilePHIDs(array($object->getPHID())) | ||||
| ->execute(); | ->execute(); | ||||
| // Merge the stored panels into the builtin panels. If a builtin panel has | // Merge the stored panels into the builtin panels. If a builtin panel has | ||||
| // a stored version, replace the defaults with the stored changes. | // a stored version, replace the defaults with the stored changes. | ||||
| foreach ($stored_panels as $stored_panel) { | foreach ($stored_panels as $stored_panel) { | ||||
| if (!$stored_panel->shouldEnableForObject($object)) { | |||||
| continue; | |||||
| } | |||||
| $builtin_key = $stored_panel->getBuiltinKey(); | $builtin_key = $stored_panel->getBuiltinKey(); | ||||
| if ($builtin_key !== null) { | if ($builtin_key !== null) { | ||||
| // If this builtin actually exists, replace the builtin with the | // If this builtin actually exists, replace the builtin with the | ||||
| // stored configuration. Otherwise, we're just going to drop the | // stored configuration. Otherwise, we're just going to drop the | ||||
| // stored config: it corresponds to an out-of-date or uninstalled | // stored config: it corresponds to an out-of-date or uninstalled | ||||
| // panel. | // panel. | ||||
| if (isset($panels[$builtin_key])) { | if (isset($panels[$builtin_key])) { | ||||
| $panels[$builtin_key] = $stored_panel; | $panels[$builtin_key] = $stored_panel; | ||||
| ▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | foreach ($builtins as $builtin) { | ||||
| } | } | ||||
| $builtin | $builtin | ||||
| ->setProfilePHID($object->getPHID()) | ->setProfilePHID($object->getPHID()) | ||||
| ->attachPanel($panel) | ->attachPanel($panel) | ||||
| ->attachProfileObject($object) | ->attachProfileObject($object) | ||||
| ->setPanelOrder($order); | ->setPanelOrder($order); | ||||
| if (!$builtin->shouldEnableForObject($object)) { | |||||
| continue; | |||||
| } | |||||
| $map[$builtin_key] = $builtin; | $map[$builtin_key] = $builtin; | ||||
| $order++; | $order++; | ||||
| } | } | ||||
| return $map; | return $map; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 605 Lines • Show Last 20 Lines | |||||