Commit 81eb2fbd authored by Ben's avatar Ben
Browse files

Adding in blog editor versioning. front#2333

parent a6322d55
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -251,6 +251,10 @@ class blog implements Interfaces\Api
            }
            }
        }
        }


        if (isset($_POST['editor_version'])) {
            $blog->setEditorVersion($_POST['editor_version']);
        }

        $blog->setLastSave(time());
        $blog->setLastSave(time());


        if (isset($_POST['wire_threshold'])) {
        if (isset($_POST['wire_threshold'])) {
@@ -298,7 +302,6 @@ class blog implements Interfaces\Api
            }
            }
        }
        }
        
        
        
        if (isset($_POST['time_created'])) {
        if (isset($_POST['time_created'])) {
            try {
            try {
                $timeCreatedDelegate = new Core\Blogs\Delegates\TimeCreatedDelegate();
                $timeCreatedDelegate = new Core\Blogs\Delegates\TimeCreatedDelegate();
+18 −0
Original line number Original line Diff line number Diff line
@@ -97,6 +97,8 @@ use Minds\Traits\MagicAttributes;
 * @method bool getAllowComments()
 * @method bool getAllowComments()
 * @method int getTimeSent()
 * @method int getTimeSent()
 * @method Blog setTimeSent(int $time_sent)
 * @method Blog setTimeSent(int $time_sent)
 * @method bool getEditorVersion()
 * @method bool setEditorVersion(string $editorVersion)
 */
 */
class Blog extends RepositoryEntity
class Blog extends RepositoryEntity
{
{
@@ -245,6 +247,8 @@ class Blog extends RepositoryEntity
    /** @var int */
    /** @var int */
    protected $timeSent;
    protected $timeSent;


    /** @var bool */
    protected $editorVersion = '1';
    /**
    /**
     * Blog constructor.
     * Blog constructor.
     * @param null $eventsDispatcher
     * @param null $eventsDispatcher
@@ -544,6 +548,18 @@ class Blog extends RepositoryEntity
        return $this;
        return $this;
    }
    }


    // public function setEditorVersion($version): Blog {
    //     error_log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>setting editor version to ".$version);
    //     $this->editor_version = $version;
    //     error_log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>its ".$this->editor_version);
    //     return $this;
    // }

    // public function getEditorVersion(): string {
    //     error_log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>getting editor version ".$this->editor_version);
    //     return $this->editor_version ?? '1';
    // }

    /**
    /**
     * Defines the exportable members
     * Defines the exportable members
     * @return array
     * @return array
@@ -589,6 +605,7 @@ class Blog extends RepositoryEntity
            'nsfw_lock',
            'nsfw_lock',
            'allow_comments',
            'allow_comments',
            'time_sent',
            'time_sent',
            'editor_version',
            function ($export) {
            function ($export) {
                return $this->_extendExport($export);
                return $this->_extendExport($export);
            }
            }
@@ -617,6 +634,7 @@ class Blog extends RepositoryEntity
        $output['nsfw_lock'] = $this->getNsfwLock();
        $output['nsfw_lock'] = $this->getNsfwLock();
        $output['allow_comments'] = $this->getAllowComments();
        $output['allow_comments'] = $this->getAllowComments();
        $output['time_sent'] = $this->getTimeSent();
        $output['time_sent'] = $this->getTimeSent();
        $output['editor_version'] = $this->getEditorVersion();
        $output['header_bg'] = $export['has_header_bg'];
        $output['header_bg'] = $export['has_header_bg'];


        if (!$this->isEphemeral()) {
        if (!$this->isEphemeral()) {