source/Application/Controller/Admin/ArticlePictures.php
public function deletePicture()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        if ($myConfig->isDemoShop()) {
            // disabling uploading pictures if this is demo shop
            $oEx = oxNew(\OxidEsales\Eshop\Core\Exception\ExceptionToDisplay::class);
            $oEx->setMessage('ARTICLE_PICTURES_UPLOADISDISABLED');
            \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($oEx, false);

            return;
        }

        $sOxId = $this->getEditObjectId();
        $iIndex = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("masterPicIndex");

        $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
        $oArticle->load($sOxId);

        if ($iIndex == "ICO") {
            // deleting main icon
            $this->_deleteMainIcon($oArticle);
        } elseif ($iIndex == "TH") {
            // deleting thumbnail
            $this->_deleteThumbnail($oArticle);
        } else {
            $iIndex = (int) $iIndex;
            if ($iIndex > 0) {
                // deleting master picture
                $this->_resetMasterPicture($oArticle, $iIndex, true);
            }
        }

        $oArticle->save();
    }
public function deletePicture()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        if ($myConfig->isDemoShop()) {
            // disabling uploading pictures if this is demo shop
            $oEx = oxNew(\OxidEsales\Eshop\Core\Exception\ExceptionToDisplay::class);
            $oEx->setMessage('ARTICLE_PICTURES_UPLOADISDISABLED');
            \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($oEx, false);

            return;
        }

        $sOxId = $this->getEditObjectId();
        $iIndex = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("masterPicIndex");

        $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
        $oArticle->load($sOxId);

        if ($iIndex == "ICO") {
            // deleting main icon
            $this->_deleteMainIcon($oArticle);
        } elseif ($iIndex == "TH") {
            // deleting thumbnail
            $this->_deleteThumbnail($oArticle);
        } else {
            $iIndex = (int) $iIndex;
            if ($iIndex > 0) {
                // deleting master picture
                $this->_resetMasterPicture($oArticle, $iIndex, true);
            }
        }

        $oArticle->save();
    }
public function deletePicture ( ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; if ( $ myConfig -> isDemoShop ( ) ) { // disabling uploading pictures if this is demo shop $ oEx = oxNew ( \ OxidEsales \ Eshop \ Core \ Exception \ ExceptionToDisplay :: class ) ; $ oEx -> setMessage ( 'ARTICLE_PICTURES_UPLOADISDISABLED' ) ; \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsView ( ) -> addErrorToDisplay ( $ oEx , false ) ; return ; } $ sOxId = $ this -> getEditObjectId ( ) ; $ iIndex = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "masterPicIndex" ) ; $ oArticle = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; $ oArticle -> load ( $ sOxId ) ; if ( $ iIndex == "ICO" ) { // deleting main icon $ this -> _deleteMainIcon ( $ oArticle ) ; } elseif ( $ iIndex == "TH" ) { // deleting thumbnail $ this -> _deleteThumbnail ( $ oArticle ) ; } else { $ iIndex = ( int ) $ iIndex ; if ( $ iIndex > 0 ) { // deleting master picture $ this -> _resetMasterPicture ( $ oArticle , $ iIndex , true ) ; } } $ oArticle -> save ( ) ; }
Deletes selected master picture and all other master pictures
where master picture index is higher than currently deleted index.
Also deletes custom icon and thumbnail.

@return null
Deletes selected master picture and all other master pictures where master picture index is higher than currently deleted index . Also deletes custom icon and thumbnail .