lib/Pico.php
protected function discoverPageSiblings()
    {
        if (($this->getConfig('order_by') === 'date') && ($this->getConfig('order') === 'desc')) {
            $precedingPageKey = 'next_page';
            $succeedingPageKey = 'previous_page';
        } else {
            $precedingPageKey = 'previous_page';
            $succeedingPageKey = 'next_page';
        }

        $precedingPageId = null;
        foreach ($this->pages as $id => &$pageData) {
            $pageData[$precedingPageKey] = null;
            $pageData[$succeedingPageKey] = null;

            if (!empty($pageData['hidden'])) {
                continue;
            }

            if ($precedingPageId !== null) {
                $precedingPageData = &$this->pages[$precedingPageId];
                $pageData[$precedingPageKey] = &$precedingPageData;
                $precedingPageData[$succeedingPageKey] = &$pageData;
            }

            $precedingPageId = $id;
        }
    }
protected function discoverPageSiblings()
    {
        if (($this->getConfig('order_by') === 'date') && ($this->getConfig('order') === 'desc')) {
            $precedingPageKey = 'next_page';
            $succeedingPageKey = 'previous_page';
        } else {
            $precedingPageKey = 'previous_page';
            $succeedingPageKey = 'next_page';
        }

        $precedingPageId = null;
        foreach ($this->pages as $id => &$pageData) {
            $pageData[$precedingPageKey] = null;
            $pageData[$succeedingPageKey] = null;

            if (!empty($pageData['hidden'])) {
                continue;
            }

            if ($precedingPageId !== null) {
                $precedingPageData = &$this->pages[$precedingPageId];
                $pageData[$precedingPageKey] = &$precedingPageData;
                $precedingPageData[$succeedingPageKey] = &$pageData;
            }

            $precedingPageId = $id;
        }
    }
protected function discoverPageSiblings ( ) { if ( ( $ this -> getConfig ( 'order_by' ) === 'date' ) && ( $ this -> getConfig ( 'order' ) === 'desc' ) ) { $ precedingPageKey = 'next_page' ; $ succeedingPageKey = 'previous_page' ; } else { $ precedingPageKey = 'previous_page' ; $ succeedingPageKey = 'next_page' ; } $ precedingPageId = null ; foreach ( $ this -> pages as $ id => & $ pageData ) { $ pageData [ $ precedingPageKey ] = null ; $ pageData [ $ succeedingPageKey ] = null ; if ( ! empty ( $ pageData [ 'hidden' ] ) ) { continue ; } if ( $ precedingPageId !== null ) { $ precedingPageData = & $ this -> pages [ $ precedingPageId ] ; $ pageData [ $ precedingPageKey ] = & $ precedingPageData ; $ precedingPageData [ $ succeedingPageKey ] = & $ pageData ; } $ precedingPageId = $ id ; } }
Walks through the list of all known pages and discovers the previous and
next page respectively

@see Pico::readPages()
@see Pico::getPages()

@return void
Walks through the list of all known pages and discovers the previous and next page respectively