Renders a section

@param Section $section

@return string
972532
public function renderSection(Section $section)
    {
        $output = sprintf("[%s]\n", $section->getName());

        foreach ($section->getProperties() as $key => $value) {
            $value = $this->normalizeValue($value);
            $output .= sprintf("%s = %s\n", $key, $value);
        }

        // Write a linefeed after sections
        $output .= "\n";

        return $output;
    }
686479
public function renderSectionBody(array $section, DataCollection $collection, array $sections = [], string $sectionName = '') : void
    {
        if ($this->isSilent()) {
            return;
        }

        $division          = $collection->getDefaultProperties();
        $ua                = $division->getUserAgents()[0];
        $defaultproperties = $ua->getProperties();
        $properties        = array_merge(['Parent'], array_keys($defaultproperties));

        foreach ($defaultproperties as $propertyName => $propertyValue) {
            if (is_bool($propertyValue)) {
                $defaultproperties[$propertyName] = $propertyValue;
            } else {
                $defaultproperties[$propertyName] = $this->trimProperty->trimProperty((string) $propertyValue);
            }
        }

        foreach ($properties as $property) {
            if (!isset($section[$property])) {
                continue;
            }

            if (!isset($this->outputProperties[$property])) {
                $this->outputProperties[$property] = $this->filter->isOutputProperty($property, $this);
            }

            if (!$this->outputProperties[$property]) {
                continue;
            }

            if (isset($section['Parent']) && 'Parent' !== $property) {
                if ('DefaultProperties' === $section['Parent']
                    || !isset($sections[$section['Parent']])
                ) {
                    if (isset($defaultproperties[$property])
                        && $defaultproperties[$property] === $section[$property]
                    ) {
                        continue;
                    }
                } else {
                    $parentProperties = $sections[$section['Parent']];

                    if (isset($parentProperties[$property])
                        && $parentProperties[$property] === $section[$property]
                    ) {
                        continue;
                    }
                }
            }

            fwrite(
                $this->file,
                $this->formatter->formatPropertyName($property)
                . '=' . $this->formatter->formatPropertyValue($section[$property], $property) . PHP_EOL
            );
        }
    }
1119226
public function info($section = null) {
        return $this->returnCommand(['INFO'], null, $section ? [$section] : null, ResponseParser::PARSE_INFO);
    }
604006
public static function createFromMultilingualSection(Section $section)
    {
        $parent = \Page::getByPath(STACKS_PAGE_PATH);
        $data = array();
        $data['name'] = $section->getLocale();
        $data['cHandle'] = $section->getLocale();
        $type = Type::getByHandle(STACK_CATEGORY_PAGE_TYPE);
        $page = $parent->add($type, $data);

        $sc = new self($page);

        return $sc;
    }
971134
private function findSection($section)
	{
		// Check section type
		if (is_int($section) || $section === 'new') {
			return $section;
		} else if (is_string($section)) {
			// Search section names for related index
			$sections = array_keys($this->sections->byName);
			$index = array_search($section, $sections);

			// Return index if found
			if ($index !== false) {
				return $index;
			}
		}

		// Return error message and value
		$this->error = array();
		$this->error['page'] = "Section '$section' was not found on this page";
		return -1;
	}
875421
public function getSection($section)
    {
        if (!array_key_exists($section, $this->config)) {
            return null;
        }

        return $this->config[$section];
    }
137844
protected function retrieveSectionContent( $section ) {
		if ( array_key_exists( 'raw', $section['content'] ) ) {
			$source_content = $section['content']['raw'];
		} else {
			$source_content = $section['content']['rendered'];
		}

		// According to the html5 spec section 8.3: https://www.w3.org/TR/2013/CR-html5-20130806/syntax.html#serializing-html-fragments
		// We should replace any occurrences of the U+00A0 NO-BREAK SPACE character (aka "\xc2\xa0") by the string "&nbsp;" when serializing HTML5
		// When cloning, we don't want to modify whitespaces, so we hide them from the parser.
		$characters_to_keep = [ "\xc2\xa0" ];
		foreach ( $characters_to_keep as $c ) {
			$md5 = md5( $c );
			$source_content = str_replace( $c, "<!-- pb_fixme_{$md5} -->", $source_content );
		}

		// Load source content
		$html5 = new \Pressbooks\HtmlParser();
		$dom = $html5->loadHTML( $source_content );

		// Download images, change image paths
		$media = $this->downloads->scrapeAndKneadImages( $dom );
		$dom = $media['dom'];
		$attachments = $media['attachments'];

		// Download media, change media paths
		$media = $this->downloads->scrapeAndKneadMedia( $dom, $html5->parser );
		$dom = $media['dom'];
		$attachments = array_merge( $attachments, $media['attachments'] );

		// Fix internal links
		$dom = $this->fixInternalLinks( $dom );

		// Save the destination content
		$content = $html5->saveHTML( $dom );

		// Put back the hidden characters
		foreach ( $characters_to_keep as $c ) {
			$md5 = md5( $c );
			$content = str_replace( "<!-- pb_fixme_{$md5} -->", $c, $content );
		}

		// Count attachments
		foreach ( $attachments as $pid ) {
			$this->clonedItems['media'][] = $pid;
		}

		return [ trim( $content ), $attachments ];
	}
484810
public function renderSectionHeader(string $sectionName) : void
    {
        if ($this->isSilent()) {
            return;
        }

        fwrite($this->file, '  ' . $this->formatter->formatPropertyName($sectionName) . ': ');
    }
309102
public function setSection(Section $section)
    {
        if ($section !== $this->_mainsection) {
            $this->_mainsection = null;
            $this->_level = $section->getLevel() + 1;
            if (0 === $this->_position) {
                $this->_position = 1;
            }
        }

        $this->_section = $section;

        return $this;
    }
13004
public function panel_section() {
		$output = null;

		// render the section wrapper.
		$output .= '<div class="uix-' . esc_attr( $this->type ) . '-sections uix-sections">';

		$hidden = 'false';
		foreach ( $this->child as $section ) {

			if ( ! $this->is_section_object( $section ) && ! $this->is_control_object( $section ) ) {
				continue;
			}
			$section->struct['active'] = $hidden;
			$output                   .= $section->render();
			$hidden                    = 'true';
		}

		$output .= '</div>';

		return $output;
	}
1073016
public function getSectionType($section, $code)
    {
        if (!isset($this->types[$section])) {
            return null;
        }

        $types = array_filter(
            $this->types[$section],
            function (ImageType $item) use ($code) {
                return strtolower($code) === strtolower($item->getCode());
            }
        );

        return array_values($types)[0];
    }
97404
public function startSection(SectionInterface $section)
    {
        $this->timer->start($section);
        $message = sprintf('<bg=green;options=bold> Section %s</>', $section->getName());
        $messageLengthWithoutDecoration = Helper::strlenWithoutDecoration($this->output->getFormatter(), $message);
        $messageLength = $this->lineLength - $messageLengthWithoutDecoration;

        $this->writeln([
            sprintf('<bg=green>%s</>', str_repeat(' ', $this->lineLength)),
            sprintf('<bg=green;options=bold>%s%s</>', $message, str_pad(' ', $messageLength)),
            sprintf('<bg=green>%s</>', str_repeat(' ', $this->lineLength)),
        ]);

        $this->newLine();
    }
338993
public function renderSection()
    {
        $sections = array();
        foreach ($this->items as $item) {
            $sections[] = $this->renderItem($item);
        }
        return \CHtml::tag('div', $this->htmlOptions, implode("\n", $sections));
    }
477235
public function viewAction(Section $section): Response
    {
        $sectionDeleteForm = $this->formFactory->deleteSection(
            new SectionDeleteData($section)
        )->createView();

        return $this->render('@ezdesign/admin/section/view.html.twig', [
            'section' => $section,
            'form_section_delete' => $sectionDeleteForm,
            'deletable' => !$this->sectionService->isSectionUsed($section),
            'can_edit' => $this->isGranted(new Attribute('section', 'edit')),
        ]);
    }
894574
function renderHeader(&$header) 
    {
        $hobj = new StdClass;
        $hobj->header = $header->toHtml();
        $this->_obj->sections[$this->_sectionCount] = $hobj;
        $this->_currentSection = $this->_sectionCount++;
    }
258521
public function getSectionComponents($sectionName)
    {
        return $this->getComponents()->filter(
            function (ComponentInterface $component) use ($sectionName) {
                return $component instanceof RenderableComponentInterface
                && $component->getRenderSection() === $sectionName;
            }
        );
    }
1141019
protected function processSection(array $section)
        {
            $config = array();

            foreach ($section as $key => $value) {
                $this->processKey($key, $value, $config);
            }

            return $config;
        }