Loading Core/Pro/Delegates/HydrateSettingsDelegate.php +1 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ class HydrateSettingsDelegate error_log($e); } $settings->setPublished($user->isProPublished()); return $settings; } } Core/Pro/Manager.php +7 −0 Original line number Diff line number Diff line Loading @@ -322,6 +322,13 @@ class Manager ->setCustomHead($values['custom_head']); } if (isset($values['published'])) { $this->user->setProPublished($values['published']); $this->saveAction ->setEntity($this->user) ->save(); } $this->setupRoutingDelegate ->onUpdate($settings); Loading Core/Pro/Settings.php +6 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,8 @@ use Minds\Traits\MagicAttributes; * @method Settings setFeaturedContent(array $featuredContent) * @method string getCustomHead() * @method Settings setCustomHead(string $customHead) * @method bool isPublished() * @method Settings setPublished(bool $published) */ class Settings implements JsonSerializable { Loading Loading @@ -120,6 +122,9 @@ class Settings implements JsonSerializable /** @var string */ protected $customHead = ''; /** @var bool */ protected $published; /** * @return string */ Loading Loading @@ -158,6 +163,7 @@ class Settings implements JsonSerializable 'custom_head' => $this->customHead, 'one_line_headline' => $this->getOneLineHeadline(), 'styles' => $this->buildStyles(), 'published' => $this->published, ]; } Loading Entities/User.php +31 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ class User extends \ElggUser $this->attributes['plus'] = 0; //TODO: REMOVE $this->attributes['plus_expires'] = 0; $this->attributes['pro_expires'] = 0; $this->attributes['pro_published'] = 0; $this->attributes['verified'] = 0; $this->attributes['founder'] = 0; $this->attributes['disabled_boost'] = 0; Loading Loading @@ -824,6 +825,7 @@ class User extends \ElggUser $export['programs'] = $this->getPrograms(); $export['plus'] = (bool) $this->isPlus(); $export['pro'] = (bool) $this->isPro(); $export['pro_published'] = (bool) $this->isProPublished(); $export['verified'] = (bool) $this->verified; $export['founder'] = (bool) $this->founder; $export['disabled_boost'] = (bool) $this->disabled_boost; Loading Loading @@ -945,6 +947,35 @@ class User extends \ElggUser return $this->getProExpires() >= time(); } /** * Set if pro is published * @param bool $published * @return self */ public function setProPublished(bool $published): self { $this->pro_published = $published ? 1 : 0; return $this; } /** * Return if is published * @return bool */ public function getProPublished(): bool { return (bool) $this->pro_published; } /** * Return if is published * @return bool */ public function isProPublished(): bool { return (bool) $this->pro_published; } /** * Gets the categories to which the user is subscribed. * Loading Loading
Core/Pro/Delegates/HydrateSettingsDelegate.php +1 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ class HydrateSettingsDelegate error_log($e); } $settings->setPublished($user->isProPublished()); return $settings; } }
Core/Pro/Manager.php +7 −0 Original line number Diff line number Diff line Loading @@ -322,6 +322,13 @@ class Manager ->setCustomHead($values['custom_head']); } if (isset($values['published'])) { $this->user->setProPublished($values['published']); $this->saveAction ->setEntity($this->user) ->save(); } $this->setupRoutingDelegate ->onUpdate($settings); Loading
Core/Pro/Settings.php +6 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,8 @@ use Minds\Traits\MagicAttributes; * @method Settings setFeaturedContent(array $featuredContent) * @method string getCustomHead() * @method Settings setCustomHead(string $customHead) * @method bool isPublished() * @method Settings setPublished(bool $published) */ class Settings implements JsonSerializable { Loading Loading @@ -120,6 +122,9 @@ class Settings implements JsonSerializable /** @var string */ protected $customHead = ''; /** @var bool */ protected $published; /** * @return string */ Loading Loading @@ -158,6 +163,7 @@ class Settings implements JsonSerializable 'custom_head' => $this->customHead, 'one_line_headline' => $this->getOneLineHeadline(), 'styles' => $this->buildStyles(), 'published' => $this->published, ]; } Loading
Entities/User.php +31 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ class User extends \ElggUser $this->attributes['plus'] = 0; //TODO: REMOVE $this->attributes['plus_expires'] = 0; $this->attributes['pro_expires'] = 0; $this->attributes['pro_published'] = 0; $this->attributes['verified'] = 0; $this->attributes['founder'] = 0; $this->attributes['disabled_boost'] = 0; Loading Loading @@ -824,6 +825,7 @@ class User extends \ElggUser $export['programs'] = $this->getPrograms(); $export['plus'] = (bool) $this->isPlus(); $export['pro'] = (bool) $this->isPro(); $export['pro_published'] = (bool) $this->isProPublished(); $export['verified'] = (bool) $this->verified; $export['founder'] = (bool) $this->founder; $export['disabled_boost'] = (bool) $this->disabled_boost; Loading Loading @@ -945,6 +947,35 @@ class User extends \ElggUser return $this->getProExpires() >= time(); } /** * Set if pro is published * @param bool $published * @return self */ public function setProPublished(bool $published): self { $this->pro_published = $published ? 1 : 0; return $this; } /** * Return if is published * @return bool */ public function getProPublished(): bool { return (bool) $this->pro_published; } /** * Return if is published * @return bool */ public function isProPublished(): bool { return (bool) $this->pro_published; } /** * Gets the categories to which the user is subscribed. * Loading