public function submitSort()
    {
        $order = 1;
        $galleryData = $this->_defaultData($this->_block->getContent());
        foreach (Request::input('arr') as $image) {
            if (!isset($galleryData[$image])) {
                return 0;
            }
            $galleryData[$image]->order = $order++;
        }
        $this->_block->updateContent(serialize($galleryData));
        if ($this->_block->getPageId() && !config('coaster::admin.publishing')) { // update live page if no publishing
            PageVersion::latest_version($this->_block->getPageId(), true)->publish();
        }
        return 1;
    }
public function submitSort()
    {
        $order = 1;
        $galleryData = $this->_defaultData($this->_block->getContent());
        foreach (Request::input('arr') as $image) {
            if (!isset($galleryData[$image])) {
                return 0;
            }
            $galleryData[$image]->order = $order++;
        }
        $this->_block->updateContent(serialize($galleryData));
        if ($this->_block->getPageId() && !config('coaster::admin.publishing')) { // update live page if no publishing
            PageVersion::latest_version($this->_block->getPageId(), true)->publish();
        }
        return 1;
    }
public function submitSort ( ) { $ order = 1 ; $ galleryData = $ this -> _defaultData ( $ this -> _block -> getContent ( ) ) ; foreach ( Request :: input ( 'arr' ) as $ image ) { if ( ! isset ( $ galleryData [ $ image ] ) ) { return 0 ; } $ galleryData [ $ image ] -> order = $ order ++ ; } $ this -> _block -> updateContent ( serialize ( $ galleryData ) ) ; if ( $ this -> _block -> getPageId ( ) && ! config ( 'coaster::admin.publishing' ) ) { // update live page if no publishing PageVersion :: latest_version ( $ this -> _block -> getPageId ( ) , true ) -> publish ( ) ; } return 1 ; }
Update sort values of images
@return int
Update sort values of images