@param OrderKeyword|OrderKeyword[] $component the component to be built
@param array                       $options   parameters for building

@return string
428796
public static function build($component, array $options = [])
    {
        if (is_array($component)) {
            return implode(', ', $component);
        }

        return $component->expr . ' ' . $component->type;
    }
926178
private function getActions(Component $component) {
        $defaultActions = (array) config('antares/installer::permissions.components.' . $component->name, []);

        return Action::where('component_id', $component->id)->whereIn('name', $defaultActions)->get();
    }
1059684
public static function normalize_component($component) {
        if ($component === 'moodle' or $component === 'core' or $component === '') {
            return array('core', null);
        }

        if (strpos($component, '_') === false) {
            self::init();
            if (array_key_exists($component, self::$subsystems)) {
                $type   = 'core';
                $plugin = $component;
            } else {
                // Everything else without underscore is a module.
                $type   = 'mod';
                $plugin = $component;
            }

        } else {
            list($type, $plugin) = explode('_', $component, 2);
            if ($type === 'moodle') {
                $type = 'core';
            }
            // Any unknown type must be a subplugin.
        }

        return array($type, $plugin);
    }
585113
static public function getRootElementClass($component)
    {
        if (!is_string($component)) $component = $component->getData()->componentClass;
        $ret = '';
        if (self::hasSetting($component, 'rootElementClass')) {
            $ret .= self::getSetting($component, 'rootElementClass').' ';
        }
        $ret .= Kwf_Component_Abstract::formatRootElementClass($component, '');
        return $ret;
    }
173971
public static function build($component, array $options = [])
    {
        if (is_array($component)) {
            return implode(', ', $component);
        }

        return trim((string) $component->expr);
    }
32657
protected function addCalendarComponentWithKeyAndValue($component, $keyword, $value)
    {
        if ($keyword == false) {
            $keyword = $this->lastKeyword;
        }

        switch ($component) {
            case 'VALARM':
                $key1 = 'VEVENT';
                $key2 = ($this->eventCount - 1);
                $key3 = $component;

                if (!isset($this->cal[$key1][$key2][$key3]["{$keyword}_array"])) {
                    $this->cal[$key1][$key2][$key3]["{$keyword}_array"] = array();
                }

                if (is_array($value)) {
                    // Add array of properties to the end
                    array_push($this->cal[$key1][$key2][$key3]["{$keyword}_array"], $value);
                } else {
                    if (!isset($this->cal[$key1][$key2][$key3][$keyword])) {
                        $this->cal[$key1][$key2][$key3][$keyword] = $value;
                    }

                    if ($this->cal[$key1][$key2][$key3][$keyword] !== $value) {
                        $this->cal[$key1][$key2][$key3][$keyword] .= ',' . $value;
                    }
                }
                break;

            case 'VEVENT':
                $key1 = $component;
                $key2 = ($this->eventCount - 1);

                if (!isset($this->cal[$key1][$key2]["{$keyword}_array"])) {
                    $this->cal[$key1][$key2]["{$keyword}_array"] = array();
                }

                if (is_array($value)) {
                    // Add array of properties to the end
                    array_push($this->cal[$key1][$key2]["{$keyword}_array"], $value);
                } else {
                    if (!isset($this->cal[$key1][$key2][$keyword])) {
                        $this->cal[$key1][$key2][$keyword] = $value;
                    }

                    if ($keyword === 'EXDATE') {
                        if (trim($value) === $value) {
                            $array = array_filter(explode(',', $value));
                            $this->cal[$key1][$key2]["{$keyword}_array"][] = $array;
                        } else {
                            $value = explode(',', implode(',', $this->cal[$key1][$key2]["{$keyword}_array"][1]) . trim($value));
                            $this->cal[$key1][$key2]["{$keyword}_array"][1] = $value;
                        }
                    } else {
                        $this->cal[$key1][$key2]["{$keyword}_array"][] = $value;

                        if ($keyword === 'DURATION') {
                            $duration = new \DateInterval($value);
                            array_push($this->cal[$key1][$key2]["{$keyword}_array"], $duration);
                        }
                    }

                    if ($this->cal[$key1][$key2][$keyword] !== $value) {
                        $this->cal[$key1][$key2][$keyword] .= ',' . $value;
                    }
                }
                break;

            case 'VFREEBUSY':
                $key1 = $component;
                $key2 = ($this->freeBusyIndex - 1);
                $key3 = $keyword;

                if ($keyword === 'FREEBUSY') {
                    if (is_array($value)) {
                        $this->cal[$key1][$key2][$key3][][] = $value;
                    } else {
                        $this->freeBusyCount++;

                        end($this->cal[$key1][$key2][$key3]);
                        $key = key($this->cal[$key1][$key2][$key3]);

                        $value = explode('/', $value);
                        $this->cal[$key1][$key2][$key3][$key][] = $value;
                    }
                } else {
                    $this->cal[$key1][$key2][$key3][] = $value;
                }
                break;

            case 'VTODO':
                $this->cal[$component][$this->todoCount - 1][$keyword] = $value;
                break;

            default:
                $this->cal[$component][$keyword] = $value;
                break;
        }

        $this->lastKeyword = $keyword;
    }
861264
protected function _getClassName($alias, array $options = [])
    {
        if (empty($options['className'])) {
            $options['className'] = Inflector::camelize($alias);
        }

        return App::className($options['className'], 'Model/Table', 'Table');
    }
1215835
public static function build($component, array $options = [])
    {
        if (is_array($component)) {
            return implode(', ', $component);
        }

        return $component->old . ' TO ' . $component->new;
    }
1212427
public function admin( $options, $component ) {

		global $wp_roles;

		// Hook into Gravity Forms roles (since it only adds filter if Members plugin itself is activated
		if ( class_exists( 'RGForms' ) && ! has_filter(
			'members_get_capabilities', array(
				'RGForms',
				'members_get_capabilities',
			)
		) ) {
			add_filter( 'members_get_capabilities', array( 'RGForms', 'members_get_capabilities' ) );
		}

		$default_role = get_option( 'default_role' );

		$roles = array();

		foreach ( $wp_roles->role_objects as $key => $role ) {
			$count = $this->count_users( $key );

			$roles[ $key ] = array(
				'id'           => $key,
				'label'        => $wp_roles->role_names[ $key ],
				'name'         => $key,
				'capabilities' => count( (array) $role->capabilities ),
				'users'        => sprintf( _n( '%s User', '%s Users', $count, 'pods' ), $count ),
			);

			if ( $default_role == $key ) {
				$roles[ $key ]['label'] .= ' (site default)';
			}

			if ( 0 < $count && pods_is_admin( array( 'list_users' ) ) ) {
				$roles[ $key ]['users'] .= '<br /><a href="' . admin_url( esc_url( 'users.php?role=' . $key ) ) . '">' . __( 'View Users', 'pods' ) . '</a>';
			}
		}

		$ui = array(
			'component'        => $component,
			'data'             => $roles,
			'total'            => count( $roles ),
			'total_found'      => count( $roles ),
			'items'            => 'Roles',
			'item'             => 'Role',
			'fields'           => array(
				'manage' => array(
					'label'        => array( 'label' => __( 'Label', 'pods' ) ),
					'name'         => array( 'label' => __( 'Name', 'pods' ) ),
					'capabilities' => array( 'label' => __( 'Capabilities', 'pods' ) ),
					'users'        => array(
						'label'   => __( 'Users', 'pods' ),
						'type'    => 'text',
						'options' => array(
							'text_allow_html'        => 1,
							'text_allowed_html_tags' => '',
						),
					),
				),
			),
			'actions_disabled' => array( 'duplicate', 'view', 'export' ),
			'actions_custom'   => array(
				'add'    => array( $this, 'admin_add' ),
				'edit'   => array( $this, 'admin_edit' ),
				'delete' => array( $this, 'admin_delete' ),
			),
			'search'           => false,
			'searchable'       => false,
			'sortable'         => false,
			'pagination'       => false,
		);

		if ( isset( $roles[ pods_var( 'id', 'get', - 1 ) ] ) ) {
			$ui['row'] = $roles[ pods_var( 'id', 'get', - 1 ) ];
		}

		if ( ! pods_is_admin( array( 'pods_roles_add' ) ) ) {
			$ui['actions_disabled'][] = 'add';
		}

		if ( ! pods_is_admin( array( 'pods_roles_edit' ) ) ) {
			$ui['actions_disabled'][] = 'edit';
		}

		if ( count( $roles ) < 2 || ! pods_is_admin( array( 'pods_roles_delete' ) ) ) {
			$ui['actions_disabled'][] = 'delete';
		}

		pods_ui( $ui );
	}
753542
protected function generatePopOrderSql($options = [])
    {
        $orderPart = 'ORDER BY priority ASC';
        if (isset($options['pop_order']) && $options['pop_order'] === self::POP_ORDER_FIFO) {
            $orderPart = 'ORDER BY created_at ASC';
        }

        return $orderPart;
    }
1178514
private static function padRgbaComponent($component)
    {
        $result = \dechex($component);

        if (2 > \strlen($result)) {
            $result = '0' . $result;
        }

        return $result;
    }
612112
private function getOption($option, array $options)
    {
        return isset($options[$option]) ? $options[$option] : $this->$option;
    }
261566
public static function get_component_strings($component, $lang = null) {

        if (empty($lang)) {
            $lang = current_language();
        }

        $params = self::validate_parameters(self::get_component_strings_parameters(),
                      array('component'=>$component, 'lang' => $lang));

        $stringmanager = get_string_manager();

        $wsstrings = array();
        $componentstrings = $stringmanager->load_component_strings($params['component'], $params['lang']);
        foreach($componentstrings as $stringid => $string) {
            $wsstring = array();
            $wsstring['stringid'] = $stringid;
            $wsstring['string'] = $string;
            $wsstrings[] = $wsstring;
        }

        return $wsstrings;
    }
898840
public static function getComponentNodeConfig($component, $user, $acl, array &$componentConfigs = array())
    {
        $data = parent::getNodeConfig($component);
        $enabled = $acl->isAllowed($user, $component);
        if (!$enabled && !$component instanceof Kwf_Component_Data_Root/*root nicht überprüfen, die wird immar angezeigt*/) {
            $allowedComponents = $acl->getAllowedRecursiveChildComponents($user, $component);
            $allowed = false;
            foreach ($allowedComponents as $allowedComponent) {
                $c = $allowedComponent;
                while ($c) {
                    if ($c->componentId == $component->componentId) {
                        if (!$allowedComponent->isPage) {
                            if (self::_getAllEditComponents(array($allowedComponent), $user, $acl)) {
                                //es gibt bearbeiten buttons, seite anzeigen
                                $allowed = true;
                                break;
                            }
                            if (!$allowed) {
                                 //nächste allowComponent überprüfen
                                 continue 2;
                            }
                        } else {
                            //seiten sind immer erlaubt (wegen seiteneigenschaften)
                            $allowed = true;
                        }
                        break 2;
                    }
                    $c = $c->parent;
                }
            }
            //wenn gar keine unterkomponente bearbeitet werden kann seite ausblenden
            if (!$allowed) return null;
        }
        if (!$enabled) {
            //wenn eine unterkomponente (nicht seite!) bearbeitet werden kann seite nicht ausgrauen
            $editComponents = $acl->getAllowedChildComponents($user, $component);
            if ($editComponents) $enabled = true;
        } else {
            $editComponents = array($component);
        }

        $data['disabled'] = !$enabled;

        if ($component->componentId != 'root' && !$enabled) {
            $data['iconEffects'][] = 'forbidden';
        }

        if (!$acl->isAllowed($user, $component)) {
            //wenn komponente *selbst* nicht bearbeitbar ist actions deaktivieren
            //(in dem fall ist eine unterkomponente der seite bearbeitbar)
            $data['actions'] = array_merge($data['actions'], array(
                'delete' => false,
                'copy' => false,
                'visible' => false,
                'makeHome' => false,
            ));
            $data['allowDrag'] = false;
        }

        //wenn *unter* der seite eine page möglich ist (pageGenerator vorhanden) dann
        //hinzufügen + drop erlauben
        //das kann nicht im Generator ermittelt werden, der macht nur sich selbst
        if ($acl->isAllowed($user, $component)) {
            $pageGenerator = Kwf_Component_Generator_Abstract::getInstances($component, array(
                'pageGenerator' => true
            ));
            if ($pageGenerator && $pageGenerator[0] instanceof Kwc_Root_Category_Generator) {
                $data['actions']['add'] = true;
                $data['actions']['paste'] = true;
                $data['allowDrop'] = true;
            }
        }
        $data['actions']['preview'] = (bool)$component->isPage;

        //default werte
        $data['actions'] = array_merge(array(
            'properties' => !$data['disabled'],
            'delete' => false,
            'copy' => false,
            'paste' => false,
            'visible' => false,
            'makeHome' => false,
            'add' => false,
        ), $data['actions']);

        $data['editComponents'] = self::_getAllEditComponents($editComponents, $user, $acl, $componentConfigs);

        return $data;
    }
548291
public function renderComponent($component, &$hasDynamicParts = false)
    {
        if (Kwf_Component_Data_Root::getShowInvisible()) {
            $hasDynamicParts = true;
        }

        $helper = new Kwf_Component_View_Helper_Component();
        $helper->setRenderer($this);
        $content = $helper->component($component);

        $content = $this->_renderPass2($content, $hasDynamicParts);
        Kwf_Component_Cache::getInstance()->writeBuffer();

        foreach (Kwf_Component_Data_Root::getInstance()->getPlugins('Kwf_Component_PluginRoot_Interface_PostRender') as $plugin) {
            $content = $plugin->processOutput($content, $component);
        }

        return $content;
    }
478499
public static function build($component, array $options = [])
    {
        $tmp = [];
        foreach ($component as $componentPart) {
            $tmp[] = $componentPart[0] . ' ' . $componentPart[1];
        }

        return implode(' ', $tmp);
    }
365972
final public function getComponent(string $componentName = null) : IColumnComponent
    {
        if ($componentName === null) {
            if ($this->hasSingleComponent()) {
                return reset($this->components);
            } else {
                throw InvalidArgumentException::format(
                    'Must supply component name for %s \'%s\' with more than one component: expecting one of (%s), null given',
                    static::$debugType, $this->name, Debug::formatValues(array_keys($this->components))
                );
            }
        }

        if (!isset($this->components[$componentName])) {
            throw InvalidArgumentException::format(
                'Invalid component name for %s \'%s\': expecting one of (%s), %s given',
                static::$debugType, $this->name, Debug::formatValues(array_keys($this->components)), $componentName
            );
        }

        return $this->components[$componentName];
    }