/* (non-PHPdoc)
@see \rocket\ei\component\command\control\EntryControlComponent::getEntryControlOptions()
189998
public function getEntryControlOptions(N2nContext $n2nContext, N2nLocale $n2nLocale): array {
		$dtc = new DynamicTextCollection('rocket', $n2nLocale);
		return array(self::CONTROL_INSERT_BEFORE_KEY => $dtc->translate('ei_impl_tree_insert_before_label'),
				self::CONTROL_INSERT_AFTER_KEY => $dtc->translate('ei_impl_tree_insert_after_label'));
	}
247351
private function getControlStructureTokens()
    {
        static $tokens = null;

        if (null === $tokens) {
            $tokens = [
                T_IF,
                T_ELSEIF,
                T_FOR,
                T_FOREACH,
                T_WHILE,
                T_DO,
                T_CATCH,
                T_SWITCH,
                T_DECLARE,
            ];
        }

        return $tokens;
    }
612555
public function registerControls($controls)
    {
        $data = $this->getData();
        $customControls = $data['controls'];
        foreach ($customControls as &$c) {
            $c['label'] = $this->translateValueIfKeyExists($c, 'label');
            $c['description'] = $this->translateValueIfKeyExists($c, 'description');
            $c['default'] = $this->translateValueIfKeyExists($c, 'default');
            $c['help'] = $this->translateValueIfKeyExists($c, 'help');

            if (isset($c['choices'])) {
                foreach ($c['choices'] as $id => $label) {
                    if (isset($label)) {
                        $c['choices'][$id] = Strings::translate($label);
                    }
                }
            }
        }
        return array_merge($controls, $customControls);
    }
205232
public function controlMandatoryColumns($data = null)
    {
        if (is_null($data)) {
            $data = $this->getData();
        }
        $missingMandatoryColumns = [];
        if (!empty($data) && count($data)) {
            $fbColumns = $this->getColumnsInfo();
            if (count($fbColumns)) {
                foreach ($fbColumns as $columnName => $columnInfo) {
                    $mandatory = ($columnInfo['mandatory'] == 'true');
                    if ($mandatory && !array_key_exists($columnName, $data)) {
                        $missingMandatoryColumns[$columnName] = $columnInfo['name'];
                    }
                }
            }
        }
        return $missingMandatoryColumns;
    }
361331
public function getProgramOptions() {
    static $options = [];

    if (!$options) {
      $options = ['all' => $this->t('All')];
      $query = $this->entityQuery
        ->get('node')
        ->condition('status', 1)
        ->condition('type', 'program');
      $entity_ids = $query->execute();
      $nodes = $this->entityTypeManager->getStorage('node')
        ->loadMultiple($entity_ids);
      foreach ($nodes as $id => $node) {
        $options[$id] = $node->getTitle();
      }
    }

    return $options;
  }
801378
public static function getControlCapabilities()
    {
        $caps = array();
        foreach (array_keys(self::$virtualCapabilities) as $capabilityName) {
            $caps[] = self::PREFIX_CONTROL . $capabilityName;
        }

        return $caps;
    }
1022631
public function listControls($returnGrouped = true)
    {
        if ($this->groupedControls !== null) {
            return $returnGrouped ? $this->groupedControls : $this->controls;
        }

        $this->groupedControls = [
            $this->resolveControlGroupName(self::GROUP_STANDARD) => [],
            $this->resolveControlGroupName(self::GROUP_WIDGETS) => []
        ];

        Event::fire('pages.builder.registerControls', [$this]);

        foreach ($this->controls as $controlType=>$controlInfo) {
            $controlGroup = $this->resolveControlGroupName($controlInfo['group']);

            if (!array_key_exists($controlGroup, $this->groupedControls)) {
                $this->groupedControls[$controlGroup] = [];
            }

            $this->groupedControls[$controlGroup][$controlType] = $controlInfo;
        }

        return $returnGrouped ? $this->groupedControls : $this->controls;
    }
439778
public function getExplicitRoles()
    {
        $manager = \FelixOnline\Core\BaseManager::build('FelixOnline\Core\UserRole', 'user_roles', 'id');
        $manager->filter('user = "%s"', array($this->getUser()));

        $values = $manager->values();
        if (!$values) {
            return null;
        }

        $roles = array();
        foreach ($values as $value) {
            $roles[] = $value->getRole();
        }

        return $roles;
    }
157762
private function getPresetOptions()
    {
        $options = [];
        if($this->client->usesOAuth()) {
            $options["testmode"] = $this->mode === "test" ? true : false;
        }

        return $options;
    }
611745
private function transformEntry(Entry\EntryInterface $entry)
    {
        return [
            'id' => $entry->getID(),
            'name' => $entry->getLabel(),
            'icon' => (string) $entry->getIcon()
        ];
    }
1310934
public function getAccountEntries()
    {
        $entries = [];
        foreach ($this->extensions as $name => $extension) {
            if (null !== $e = $extension->getAccountMenuEntries()) {
                $entries = array_merge($entries, $e);
            }
        }
        return $entries;
    }
230271
private static function getEntryReader()
    {
        if (null === self::$entryReader) {
            self::$entryReader = new BundleEntryReader(new BufferedBundleReader(
                new JsonBundleReader(),
                self::BUFFER_SIZE
            ));
            $localeDataProvider = new LocaleDataProvider(
                self::getDataDirectory().'/'.self::LOCALE_DIR,
                self::$entryReader
            );
            self::$entryReader->setLocaleAliases($localeDataProvider->getAliases());
        }

        return self::$entryReader;
    }
1266848
public function getEntryValue($option_value)
    {
        $entry_value = null;

        if ($this->hasEntryWidget($option_value)) {
            $entry = $this->getEntryWidget($option_value)->getFirst();
            $entry_value = $entry->value;
        }

        return $entry_value;
    }
600042
@Override
  public Set<java.util.Map.Entry<String, String>> entrySet() {
    return bindings.entrySet();
  }
1016487
public function entry()
    {
        $this->defaultData();
        $entries = array();
        foreach (EntryPointService::getRegistry()->getEntryPoints() as $entry) {
            if (tao_models_classes_accessControl_AclProxy::hasAccessUrl($entry->getUrl())) {
                $entries[] = $entry;
            }
        }

        if (empty($entries)) {
            // no access -> error
            if (common_session_SessionManager::isAnonymous()) {
                /* @var $urlRouteService DefaultUrlService */
                $urlRouteService = $this->getServiceLocator()->get(DefaultUrlService::SERVICE_ID);
                $this->redirect($urlRouteService->getLoginUrl());
            } else {
                common_session_SessionManager::endSession();
                return $this->returnError(__('You currently have no access to the platform'), true, 403);
            }
        } elseif (count($entries) == 1 && !common_session_SessionManager::isAnonymous()) {
            // single entrypoint -> redirect
            $entry = current($entries);
            return $this->redirect($entry->getUrl());
        } else {
            // multiple entries -> choice
            if (!common_session_SessionManager::isAnonymous()) {
                $this->setData('user', $this->getSession()->getUserLabel());
            }
            $this->setData('entries', $entries);
            $naviElements = $this->getNavigationElementsByGroup('settings');
            foreach($naviElements as $key => $naviElement) {
                if($naviElement['perspective']->getId() !== 'user_settings') {
                    unset($naviElements[$key]);
                    continue;
                }
            }

            if ($this->hasRequestParameter('errorMessage')){
                $this->setData('errorMessage', $this->getRequestParameter('errorMessage'));
            }
            $this->setData('logout', $this->getServiceLocator()->get(DefaultUrlService::SERVICE_ID)->getLogoutUrl());
            $this->setData('userLabel', $this->getSession()->getUserLabel());
            $this->setData('settings-menu', $naviElements);
            $this->setData('current-section', $this->getRequestParameter('section'));
            $this->setData('content-template', array('blocks/entry-points.tpl', 'tao'));
            $this->setView('layout.tpl', 'tao');
        }
    }
21323
public function getInputControlStructure($uri) {
        $url = $this->service_url . '/reports' . $uri . '/inputControls';
        $data = $this->service->prepAndSend($url, array(200, 204), 'GET', null, true);

        if (empty($data)) {
            return array();
        }

        $json_obj = json_decode($data);

        $result = array();
        foreach ($json_obj->inputControl as $control) {
            $result[] = InputControl::createFromJSON($control);
        }
        return $result;
    }
535308
public function getEntryControlOptions(N2nContext $n2nContext, N2nLocale $n2nLocale): array {
		$dtc = new DynamicTextCollection('rocket', $n2nLocale);
		return array(self::CONTROL_KEY => $dtc->translate('common_edit_label'));
	}