Store the given pictures.

@return array
428257
public function store() : array //check whether this method is required, otherwise, we have to rename to delte
	{
		$this->validate();

		if ($this->files()->isEmpty()) {
			return [];
		}

		return $this->files()->flatMap(function ($item) {
			$files[] = ['path' => $item->store($this->directory)];
			return $files;
		})->all();
	}
1276871
public function photos()
    {
        $links[] = [__d('me_cms', 'List photos'), [
            'controller' => 'Photos',
            'action' => 'index',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];
        $links[] = [__d('me_cms', 'Upload photos'), [
            'controller' => 'Photos',
            'action' => 'upload',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];
        $links[] = [__d('me_cms', 'List albums'), [
            'controller' => 'PhotosAlbums',
            'action' => 'index',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];
        $links[] = [__d('me_cms', 'Add album'), [
            'controller' => 'PhotosAlbums',
            'action' => 'add',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];

        return [$links, I18N_PHOTOS, ['icon' => 'camera-retro']];
    }
244452
public function toArray()
    {
        $data = [];

        $storages = $this->preloadAllStorages();

        foreach ($storages as $url=>$storage) {

            $prefix = $this->keyPrefix($url);

            $data[$prefix] = $storage->toArray();

        }

        return $data;
    }
1260782
public static function images()
    {
        // Helper Class Exists
        if (isset(self::$ImagesHelper)) {
            return self::$ImagesHelper;
        }
        // Initialize Class
        self::$ImagesHelper = new ImagesHelper();
        // Return Helper Class
        return self::$ImagesHelper;
    }
814637
public function toData()
    {
        $data = [
            'type' => 'standard',
        ];

        if ($this->imageSize) {
            $data['image_size'] = $this->imageSize;
        }

        if ($this->ref) {
            $data['data'] = $this->ref;
        }


        return $data;
    }
167803
public function store()
    {
        $attributes = request()->validate(Page::$rules, Page::$messages);

        $attributes['is_header'] = boolval(input('is_header'));
        $attributes['is_hidden'] = boolval(input('is_hidden'));
        $attributes['is_footer'] = boolval(input('is_footer'));
        $attributes['is_featured'] = boolval(input('is_featured'));
        $attributes['url_parent_id'] = ($attributes['url_parent_id'] == 0 ? $attributes['parent_id'] : $attributes['url_parent_id']);

        $page = $this->createEntry(Page::class, $attributes);

        if ($page) {
            $page->updateUrl()->save();
            $page->banners()->sync(input('banners'));
        }

        return redirect_to_resource();
    }
301417
protected function _getPicture()
    {
        if (!empty($this->_properties['id'])) {
            $files = ((new Folder(USER_PICTURES))->find($this->_properties['id'] . '\..+'));

            if (!empty($files)) {
                return 'users' . DS . array_values($files)[0];
            }
        }

        //Checks for `webroot/img/no-avatar.jpg`
        if (is_readable(WWW_ROOT . 'img' . DS . 'no-avatar.jpg')) {
            return 'no-avatar.jpg';
        }

        return 'MeCms.no-avatar.jpg';
    }
751402
public function fetchPics()
    {
        $message = sprintf(
            '%s() is deprecated and will be removed in version 3;'
                . ' use Krizalys\Onedrive\Client::getSpecialFolder() instead.',
            __METHOD__
        );

        @trigger_error($message, E_USER_DEPRECATED);
        $item    = $this->getSpecialFolder('photos');
        $options = $this->buildOptions($item);

        return new Folder($this, $item->id, $options);
    }
764817
public function images()
    {
        foreach($this->data as $post)
        {
            $post->images = Post::images($post->ID);
        }

        return $this;
    }
338961
public function attributes(): array
    {
        $attributes = [];

        if (!$this->isExternal() || $this->fileExists()) {
            $file = $this->folder() . $this->multimedia_file_refn;

            $attributes['__FILE_SIZE__'] = $this->fileSizeKB();

            $imgsize = getimagesize($file);
            if (is_array($imgsize) && !empty($imgsize['0'])) {
                $attributes['__IMAGE_SIZE__'] = I18N::translate('%1$s × %2$s pixels', I18N::number($imgsize['0']), I18N::number($imgsize['1']));
            }
        }

        return $attributes;
    }
50019
public function getPictureGallery()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        //initialize
        $blMorePic = false;
        $aArtPics = [];
        $aArtIcons = [];
        $iActPicId = 1;
        $sActPic = $this->getPictureUrl($iActPicId);

        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('actpicid')) {
            $iActPicId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('actpicid');
        }

        $oStr = getStr();
        $iCntr = 0;
        $iPicCount = $myConfig->getConfigParam('iPicCount');
        $blCheckActivePicId = true;

        for ($i = 1; $i <= $iPicCount; $i++) {
            $sPicVal = $this->getPictureUrl($i);
            $sIcoVal = $this->getIconUrl($i);
            if (!$oStr->strstr($sIcoVal, 'nopic_ico.jpg') && !$oStr->strstr($sIcoVal, 'nopic.jpg') &&
                !$oStr->strstr($sPicVal, 'nopic_ico.jpg') && !$oStr->strstr($sPicVal, 'nopic.jpg') &&
                $sPicVal !== null
            ) {
                if ($iCntr) {
                    $blMorePic = true;
                }
                $aArtIcons[$i] = $sIcoVal;
                $aArtPics[$i] = $sPicVal;
                $iCntr++;

                if ($iActPicId == $i) {
                    $sActPic = $sPicVal;
                    $blCheckActivePicId = false;
                }
            } elseif ($blCheckActivePicId && $iActPicId <= $i) {
                // if picture is empty, setting active pic id to next
                // picture
                $iActPicId++;
            }
        }

        $blZoomPic = false;
        $aZoomPics = [];
        $iZoomPicCount = $myConfig->getConfigParam('iPicCount');

        for ($j = 1, $c = 1; $j <= $iZoomPicCount; $j++) {
            $sVal = $this->getZoomPictureUrl($j);

            if ($sVal && !$oStr->strstr($sVal, 'nopic.jpg')) {
                $blZoomPic = true;
                $aZoomPics[$c]['id'] = $c;
                $aZoomPics[$c]['file'] = $sVal;
                //anything is better than empty name, because <img src=""> calls shop once more = x2 SLOW.
                if (!$sVal) {
                    $aZoomPics[$c]['file'] = "nopic.jpg";
                }
                $c++;
            }
        }

        $aPicGallery = [
            'ActPicID' => $iActPicId,
            'ActPic'   => $sActPic,
            'MorePics' => $blMorePic,
            'Pics'     => $aArtPics,
            'Icons'    => $aArtIcons,
            'ZoomPic'  => $blZoomPic,
            'ZoomPics' => $aZoomPics
        ];

        return $aPicGallery;
    }
528524
public function store()
    {
        $attributes = request()->validate(Banner::$rules, Banner::$messages);

        $attributes['hide_name'] = boolval(input('hide_name'));
        $attributes['is_website'] = boolval(input('is_website'));

        $photo = $this->uploadBanner($attributes['photo']);
        if ($photo) {
            $attributes['image'] = $photo;
            unset($attributes['photo']);
            $banner = $this->createEntry(Banner::class, $attributes);
        }

        return redirect_to_resource();
    }
1273312
public function getPaginatedGalleryImages() {

        $getGalleryImages = $this->GalleryImages()->sort('SortOrder DESC');
        $getRequest = $this->getRequest();

        $paginatedGalleryImages = PaginatedList::create(
            $getGalleryImages,
            $getRequest
        )->setPageLength(12);

        return $paginatedGalleryImages;

    }
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;
	}
150394
public function data() : array
    {

        //Get data
        $data = get_fields($this->ID);
        $data['args'] = $this->args;

        //Do not use link
        if ($data['mod_image_link'] == "false") {
            $data['mod_image_link_url'] = "";
        }

        //Set image class
        $imgClasses = array();
        if ($data['mod_image_responsive'] === true) {
            $imgClasses[] = 'image-responsive';
        }
        $data['img_classes'] = implode(' ', $imgClasses);

        //Crop image (if non existing)
        $data['img_src'] = $this->maybeCropImage($data);

        //Add box classes
        $data['classes'] = implode(' ', apply_filters('Modularity/Module/Classes', array('box', 'box-filled'), $this->post_type, $this->args));

        return $data;
    }
1166430
public function changePicture()
    {
        $id = $this->Auth->user('id');

        if ($this->request->getData('file')) {
            //Deletes any picture that already exists
            foreach (((new Folder(USER_PICTURES))->find($id . '\..+')) as $filename) {
                @unlink(USER_PICTURES . $filename);
            }

            $filename = sprintf('%s.%s', $id, pathinfo($this->request->getData('file')['tmp_name'], PATHINFO_EXTENSION));

            $uploaded = $this->Uploader->set($this->request->getData('file'))
                ->mimetype('image')
                ->save(USER_PICTURES, $filename);

            if (!$uploaded) {
                return $this->setUploadError($this->Uploader->getError());
            }

            //Updates the authentication data and clears similar thumbnails
            $this->Auth->setUser(array_merge($this->Auth->user(), ['picture' => $uploaded]));
            (new ThumbManager)->clear($uploaded);
        }
    }
460683
private function getLocallyStoredImages($imageSrcs, bool $returnAll = false): array {
        return ImageUtils::storeImagesToLocalFile($imageSrcs, $returnAll, $this->config());
    }