Get a complete list of document as Metafile images.

@return array

@throws MetafilesException
508143
protected function getAllMetafiles()
    {
        $ret = array();
        try {
            $result = $this->getSoapClient()->GetAllMetafiles();
        } catch ( SoapException $ex ) {
            throw new MetafilesException('Error while retrieving the document from Livedocx service' , $ex);
        }
        if ( isset($result->GetAllMetafilesResult->string) ) {
            $pageCounter = 1;
            if ( is_array($result->GetAllMetafilesResult->string) ) {
                foreach ( $result->GetAllMetafilesResult->string as $string ) {
                    $ret[ $pageCounter ] = base64_decode($string);
                    $pageCounter ++;
                }
            } else {
                $ret[ $pageCounter ] = base64_decode($result->GetAllMetafilesResult->string);
            }
        }

        return $ret;
    }
9962
public function getImagesUrls()
    {
        return Collection::make($this->event->get('attachments'))->where('contentType', 'image')->map(function ($item) {
            return new Image($item['contentUrl'], $item);
        })->toArray();
    }
384884
public function getAcceptImageMimeTypes()
    {
        $imageAllowFiles = $this->getSetting('imageAllowFiles');
        $extensions = explode(',', $imageAllowFiles);
        array_walk($extensions, function (&$value) {
            $value = 'image/' . $value;
        });
        return $extensions;
    }
1226299
public function documentlist()
    {
        if (!$this->getRequest()->getVar('pageID')) {
            return $this->httpError(400);
        }

        $page = SiteTree::get()->byId($this->getRequest()->getVar('pageID'));

        if ($page && $page->getAllDocuments()->count() > 0) {
            $list = '<ul>';

            foreach ($page->getAllDocuments() as $document) {
                $list .= sprintf(
                    '<li><a class="add-document" data-document-id="%s">%s</a></li>',
                    $document->ID,
                    $document->ID . ' - '. Convert::raw2xml($document->Title)
                );
            }

            $list .= '</ul>';

            return $list;
        }

        return sprintf(
            '<p>%s</p>',
            _t('DMSDocumentAddController.NODOCUMENTS', 'There are no documents attached to the selected page.')
        );
    }
127095
public function getImagesForSeo() {
		$result = new ArrayList();
		$pwis = $this->owner->AllChildren()->where("ClassName in (
			'PageWithImage','PageWithImagesFolder')");
		foreach ($pwis->getIterator() as $pwi) {
			if ($pwi->MainImageID > 0) {
				$result->push($pwi->MainImage());
			}
		}
		return $result;
	}
201074
public function findAllWithImages()
    {
        $qb = $this->getQueryBuilder()
            ->select('s, partial i.{id, path}')
            ->innerJoin('s.image', 'i')
            ->where('s.active = TRUE')
            ->orderBy('s.order');

        return $qb->getQuery()
            ->getResult();
    }
1353331
public function getStagedFiles()
    {
        $base = $this->getProjectBase();

        $files = new FileCollection();

        foreach ($this->getFiles() as $file) {
            $fileData = explode("\t", $file);
            $status = reset($fileData);
            $relativePath = end($fileData);

            $fullPath = rtrim($base . DIRECTORY_SEPARATOR . $relativePath);

            $file = new File($status, $fullPath, $base);
            $this->saveFileToCache($file);
            $files->append($file);
        }

        return $files;
    }
319686
public function getImages() {
    	// Sort array
    	$images = array();
    	if (isset($this->_headerFooterImages[self::IMAGE_HEADER_LEFT])) 	$images[self::IMAGE_HEADER_LEFT] = 		$this->_headerFooterImages[self::IMAGE_HEADER_LEFT];
    	if (isset($this->_headerFooterImages[self::IMAGE_HEADER_CENTER])) 	$images[self::IMAGE_HEADER_CENTER] = 	$this->_headerFooterImages[self::IMAGE_HEADER_CENTER];
    	if (isset($this->_headerFooterImages[self::IMAGE_HEADER_RIGHT])) 	$images[self::IMAGE_HEADER_RIGHT] = 	$this->_headerFooterImages[self::IMAGE_HEADER_RIGHT];
    	if (isset($this->_headerFooterImages[self::IMAGE_FOOTER_LEFT])) 	$images[self::IMAGE_FOOTER_LEFT] = 		$this->_headerFooterImages[self::IMAGE_FOOTER_LEFT];
    	if (isset($this->_headerFooterImages[self::IMAGE_FOOTER_CENTER])) 	$images[self::IMAGE_FOOTER_CENTER] = 	$this->_headerFooterImages[self::IMAGE_FOOTER_CENTER];
    	if (isset($this->_headerFooterImages[self::IMAGE_FOOTER_RIGHT])) 	$images[self::IMAGE_FOOTER_RIGHT] = 	$this->_headerFooterImages[self::IMAGE_FOOTER_RIGHT];
    	$this->_headerFooterImages = $images;

    	return $this->_headerFooterImages;
    }
723143
public function getFiles()
    {
        if (isset($this->raw->files)) {
            $base = $this->getBasePath();
            $files = array();

            foreach ((array) $this->raw->files as $file) {
                $file = new SplFileInfo(
                    $path = $base . DIRECTORY_SEPARATOR . Path::canonical($file)
                );

                if (false === $file->isFile()) {
                    throw new RuntimeException(
                        sprintf(
                            'The file "%s" does not exist or is not a file.',
                            $path
                        )
                    );
                }

                $files[] = $file;
            }

            return $files;
        }

        return array();
    }
1078030
public function meta()
    {
        return array_merge([
            'wrapperClasses' => $this->wrapperClasses,
            'indexClasses' => $this->indexClasses,
            'inputClasses' => $this->inputClasses,
            'fieldClasses' => $this->fieldClasses,
            'panelFieldClasses' => $this->panelFieldClasses,
            'labelClasses' => $this->labelClasses,
            'panelLabelClasses' => $this->panelLabelClasses,
            'indexLinkClasses' => $this->indexLinkClasses,
            'excerptClasses' => $this->excerptClasses,
        ], $this->meta);
    }
805818
public function getMetaImageFooter()
    {
        if ($this->owner->hasMetaImageCaption()) {
            return $this->owner->obj('MetaImageCaption')->Plain();
        }
        
        return $this->owner->getMetaSummaryLimited();
    }
492601
protected function getDocuments() {
        if (!$this->_documents) {
            $this->_documents = new DocumentList($this->version, $this->solution['sid']);
        }

        return $this->_documents;
    }
645942
public function getList(): array {
        $list = array();
        $dir = $this->_docRoot . $this->_path;
        if (is_dir($dir)) {
            if ($dh = opendir($dir)) {
                while (($file = readdir($dh)) !== false) {
                    if (substr($file, 0, 1) !== '.'
                        && strpos($file, '.') !== false
                    ) {
                        $list[] = $file;
                    }
                }
                closedir($dh);
            }
        } else {
            throw new Exception($dir . ' is not a directory.');
        }

        return $list;
    }
1274
protected function getListFile()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            return $this->file->getList(array('limit' => $this->getLimit()));
        }

        if ($this->getParam('type')) {
            return $this->file->getList(array('file_type' => $id, 'limit' => $this->getLimit()));
        }

        if ($this->getParam('mime')) {
            return $this->file->getList(array('mime_type' => $id, 'limit' => $this->getLimit()));
        }

        if ($this->getParam('entity')) {
            return $this->file->getList(array('entity' => $id, 'limit' => $this->getLimit()));
        }

        if (!is_numeric($id)) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        $result = $this->file->get($id);

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($result);
    }
324187
public function getMetaImageWrapperClassNames()
    {
        $classes = [$this->owner->MetaImageCaptionShown ? 'captionImage' : 'image'];
        
        if ($alignment = $this->owner->getMetaImageAlignment()) {
            $classes[] = $alignment;
        }
        
        return $classes;
    }
994263
public function getImages() : array
	{
		$list = array_merge( [
			'origin' => $this->getOriginImage(),
		], $this->getCropImages() );
		foreach( $list as $key => $image ){
			$image['path'] = str_replace( ROOT_PATH, '', $image['path'] );
			$list[$key]    = $image;
		}
		return $list;
	}
902934
public function fileList()
    {
        $result = array();

        $dirContent = opendir($this->_dirPath);
        while (($file = readdir($dirContent)) !== false) {
            if (($file == '..')||($file == '.')) {   continue;
            }

            if(!is_dir($this->_dirPath . '/' . $file) ) {
                $result[] = $file;
            }
        }
        closedir($dirContent);

        return $result;
    }