Parse a xCalendar component.

@param Component $parentComponent
546635
protected function parseVCalendarComponents(Component $parentComponent)
    {
        foreach ($this->pointer['value'] ?: [] as $children) {
            switch (static::getTagName($children['name'])) {
                case 'properties':
                    $this->pointer = &$children['value'];
                    $this->parseProperties($parentComponent);
                    break;

                case 'components':
                    $this->pointer = &$children;
                    $this->parseComponent($parentComponent);
                    break;
            }
        }
    }
225548
private static function _parseAdditions(array &$components, $namespace, $path)
    {
        if (!file_exists($path)) {
            return;
        }
        foreach (new \DirectoryIterator($path) as $object) {
            if ($object->isDot() || $object->isDir()) {
                continue;
            }
            $components[$namespace][lcfirst(substr($object->getFilename(), 0, -4))] = substr($object->getFilename(), -3) == 'php' ? 1 : $object->getPathname();
        }
    }
1147715
public function saveImageAjaxAction($parentId, $parentType)
    {
        $config = FileConfiguration::getImageConfig();
        return $this->saveFileAjaxAction(
            $parentId,
            $parentType,
            $config['objectType'],
            $config['validMimeTypes'],
            $config['extBlackList']
        );
    }
1040917
public function getElement(Parser $parser, ElementInterface $parent = null)
    {
        $parser->getReader()->open($this->src);
        $parsed = $parser->getReader()->parse();

        return $parser->parseElements($parsed['value'], $parent);
    }
103238
public static Component findParentByClassname(final Component childComponent,
		final Class<? extends Component> parentClass)
	{
		Component parent = childComponent.getParent();
		while (parent != null)
		{
			if (ClassExtensions.equalsByClassName(parentClass, parent.getClass()))
			{
				break;
			}
			parent = parent.getParent();
		}
		return parent;
	}
290334
public function parseElement(Node $parent, \DOMElement $element)
    {
        if (Atom::NS !== $element->namespaceURI) {
            return null;
        }

        $name = 'atom:' . $element->localName;
        if (array_key_exists($name, $this->elementMap)) {
            $class = $this->elementMap[$name];

            return new $class($parent, $element);
        }

        return null;
    }
617869
public function parseElements(array $elements, ElementInterface $parent = null)
    {
        foreach ($elements as $element) {
            try {
                $object = $this->elementFactory->make($element['name']);
            } catch (InvalidElementException $e) {
                $object = $this->getReservation($element['name']);
            }

            // Set some stuff
            $object->setCollection($this->collection);
            $object->setAttributes($element['attributes']);

            if ( ! is_array($element['value'])) {
                $object->setValue(trim($element['value']));
            }

            // Add the object to the collection
            $this->collection->add($object);

            if ($parent) {
                $object->setParent($parent);
                $parent->addChild($object);
            }

            if (is_array($element['value'])) {
                $this->parseElements($element['value'], $object);
            }

            // Initialize object
            $object->init();

            if ($object instanceof ReservationInterface) {
                $object = $object->getElement($this, $parent);
            }

            $data[] = $object;
        }

        return $data;
    }
771700
function createComponent( &$xcaldecl ) {
    $objectname    = $this->_createFormat();
    $component     = $this->componentStart1.$objectname.$this->componentStart2.$this->nl;
    $component    .= $this->createTzid();
    $component    .= $this->createLastModified();
    $component    .= $this->createTzurl();
    $component    .= $this->createDtstart( TRUE );
    $component    .= $this->createTzoffsetfrom();
    $component    .= $this->createTzoffsetto();
    $component    .= $this->createComment();
    $component    .= $this->createRdate( TRUE );
    $component    .= $this->createRrule();
    $component    .= $this->createTzname();
    $component    .= $this->createXprop();
    if( $this->nl != substr( $component, ( 0 - strlen( $this->nl ))))
      $component  .= $this->nl;
    $component    .= $this->createSubComponent();
    $component    .= $this->componentEnd1.$objectname.$this->componentEnd2;
    if( is_array( $this->xcaldecl ) && ( 0 < count( $this->xcaldecl ))) {
      foreach( $this->xcaldecl as $localxcaldecl )
        $xcaldecl[] = $localxcaldecl;
    }
    return $component;
  }
106873
protected void addVerbatimAfterComponent(UIComponentClassicTagBase parentTag, UIComponent verbatim,
                                             UIComponent component)
    {
        int indexOfComponentInParent = 0;
        UIComponent parent = component.getParent();

        // invert the order of this if and the assignment below. Since this line is
        // here, it appears an early return is acceptable/desired if parent is null,
        // and, if it is null, we should probably check for that before we try to
        // access it. 2006-03-15 jdl
        if (null == parent)
        {
            return;
        }
        List<UIComponent> children = parent.getChildren();
        indexOfComponentInParent = children.indexOf(component);
        if (children.size() - 1 == indexOfComponentInParent)
        {
            children.add(verbatim);
        }
        else
        {
            children.add(indexOfComponentInParent + 1, verbatim);
        }
        parentTag.addChild(verbatim);
    }
175739
private void addCalendars(MpxjTreeNode parentNode, ProjectFile file)
   {
      for (ProjectCalendar calendar : file.getCalendars())
      {
         addCalendar(parentNode, calendar);
      }
   }
616490
public static Component findParentForm(final Component childComponent)
	{
		final Component parent = findParent(childComponent, Form.class);
		if ((parent != null) && parent.getClass().equals(Form.class))
		{
			return parent;
		}
		return null;
	}
971825
function createComponent( &$xcaldecl ) {
    $objectname = $this->_createFormat();
    $component  = $this->componentStart1.$objectname.$this->componentStart2.$this->nl;
    $component .= $this->createUid();
    $component .= $this->createDtstamp();
    $component .= $this->createAttendee();
    $component .= $this->createComment();
    $component .= $this->createContact();
    $component .= $this->createDtend();
    $component .= $this->createDtstart();
    $component .= $this->createDuration();
    $component .= $this->createFreebusy();
    $component .= $this->createOrganizer();
    $component .= $this->createRequestStatus();
    $component .= $this->createUrl();
    $component .= $this->createXprop();
    $component .= $this->componentEnd1.$objectname.$this->componentEnd2;
    if( is_array( $this->xcaldecl ) && ( 0 < count( $this->xcaldecl ))) {
      foreach( $this->xcaldecl as $localxcaldecl )
        $xcaldecl[] = $localxcaldecl;
    }
    return $component;
  }
898286
public function setParentConfig(CommandConfig $parentConfig)
    {
        $this->parentConfig = $parentConfig;

        if ($parentConfig->getApplicationConfig()) {
            $this->setApplicationConfig($parentConfig->getApplicationConfig());
        }
    }
573139
protected function parseParameter( ADT_PHP_Function $parent, $matches )
	{
		$parameter	= new ADT_PHP_Parameter( $matches[5] );
		$parameter->setParent( $parent );
		$parameter->setLine( $this->lineNumber );
		$parameter->setCast( $matches[2] );
		$parameter->setReference( (bool) $matches[4] );

		if( isset( $matches[6] ) )
			$parameter->setDefault( $matches[7] );
		return $parameter;
	}
1004100
public function field($parent, array $field)
    {
        if (!isset($field['attributes'])) {
            $field['attributes'] = array();
        }
        $magentoType = $this->getMagentoType($field);
        $magentoElementSettings = $this->getMagentoElementSettings($field);
        $element = $parent->addField($field['id'], $magentoType, $magentoElementSettings);

        if ($magentoType === 'multiselect') {
            if (!empty($magentoElementSettings['size'])) {
                /** @noinspection PhpUndefinedMethodInspection */
                $element->setSize($magentoElementSettings['size']);
            }
        }

        if (!empty($field['fields'])) {
            // Add description at the start of the fieldset/summary as a note
            // element.
            if (isset($field['description'])) {
                $element->addField($field['id'] . '-note', 'note', array('text' => '<p class="note">' . $field['description'] . '</p>'));
            }

            // Add fields of fieldset.
            $this->fields($element, $field['fields']);
        }
    }
977961
@SuppressWarnings({ "rawtypes", "unchecked" })
	private void writeComponent(ICalComponent component, ICalComponent parent) throws IOException {
		boolean inICalendar = component instanceof ICalendar;
		boolean inVCalRoot = inICalendar && getTargetVersion() == ICalVersion.V1_0;
		boolean inICalRoot = inICalendar && getTargetVersion() != ICalVersion.V1_0;

		ICalComponentScribe componentScribe = index.getComponentScribe(component);
		try {
			componentScribe.checkForDataModelConversions(component, parent, getTargetVersion());
		} catch (DataModelConversionException e) {
			for (ICalComponent c : e.getComponents()) {
				writeComponent(c, parent);
			}
			for (ICalProperty p : e.getProperties()) {
				writeProperty(p);
			}
			return;
		}

		writer.writeBeginComponent(componentScribe.getComponentName());

		List propertyObjs = componentScribe.getProperties(component);
		if (inICalendar && component.getProperty(Version.class) == null) {
			propertyObjs.add(0, new Version(getTargetVersion()));
		}

		for (Object propertyObj : propertyObjs) {
			context.setParent(component); //set parent here incase a scribe resets the parent
			ICalProperty property = (ICalProperty) propertyObj;
			writeProperty(property);
		}

		List subComponents = componentScribe.getComponents(component);
		if (inICalRoot) {
			//add the VTIMEZONE components
			Collection<VTimezone> timezones = getTimezoneComponents();
			for (VTimezone timezone : timezones) {
				if (!subComponents.contains(timezone)) {
					subComponents.add(0, timezone);
				}
			}
		}

		for (Object subComponentObj : subComponents) {
			ICalComponent subComponent = (ICalComponent) subComponentObj;
			writeComponent(subComponent, component);
		}

		if (inVCalRoot) {
			Collection<VTimezone> timezones = getTimezoneComponents();
			if (!timezones.isEmpty()) {
				VTimezone timezone = timezones.iterator().next();
				VCalTimezoneProperties props = convert(timezone, context.getDates());

				Timezone tz = props.getTz();
				if (tz != null) {
					writeProperty(tz);
				}
				for (Daylight daylight : props.getDaylights()) {
					writeProperty(daylight);
				}
			}
		}

		writer.writeEndComponent(componentScribe.getComponentName());
	}
805060
public function displayComponentParents() {
		$componentsList = $this->moufManager->getOwnerComponents($this->instanceName);
		
		$this->canBeWeak = false;
		if (!empty($componentsList)) {
			\MoufAdmin::getBlock_left()->addText("<div id='referredInstances'><b>Referred by:</b></div>");
			$this->canBeWeak = true;
			//$children = array();
			foreach ($componentsList as $component) {
				/*$child = new MenuItem($component, ROOT_URL.'ajaxinstance/?name='.urlencode($component));
				$child->setPropagatedUrlParameters(array("selfedit"));
				$children[] = $child;*/

				\MoufAdmin::getBlock_left()->addText("<script>MoufInstanceManager.getInstance('".addslashes($component)."').then(function(instance) { 
						instance.render().appendTo(jQuery('#referredInstances')).click(function() { window.location.href=MoufInstanceManager.rootUrl+'ajaxinstance/?name='+encodeURIComponent(instance.getName())+'&selfedit='+MoufInstanceManager.selfEdit; }); 
				});</script>");
				
			}
			//$referredByMenuItem = new MenuItem('Referred by instances:', null, $children);
			//\MoufAdmin::getInstanceMenu()->addChild($referredByMenuItem);
			
		}
	}