...
 
Commits (4)
......@@ -31,6 +31,10 @@ class pro implements Interfaces\FS
$contents = $file->read();
if (!$contents) {
$this->fallback($pages);
}
header(sprintf("Content-Type: %s", $asset->getMimeType()));
header(sprintf("Expires: %s", date('r', time() + 864000)));
header('Pragma: public');
......@@ -39,4 +43,25 @@ class pro implements Interfaces\FS
echo $contents;
exit;
}
/**
* Fallback
* @param array $pages
* @return void
*/
private function fallback($pages): void
{
switch ($pages[1]) {
case "background":
$bannersFs = new banners();
$bannersFs->get([ $pages[0] ]);
exit;
break;
case "logo":
$avatarsFs = new avatars();
$avatarsFs->get([ $pages[0], 'large' ]);
exit;
break;
}
}
}
......@@ -327,6 +327,10 @@ class Manager
->save();
}
if (isset($values['payout_method'])) {
$settings->setPayoutMethod($values['payout_method']);
}
$settings->setTimeUpdated(time());
$this->setupRoutingDelegate
......
......@@ -101,6 +101,7 @@ class Repository
->setHasCustomLogo($data['has_custom_logo'] ?? false)
->setHasCustomBackground($data['has_custom_background'] ?? false)
->setTimeUpdated($data['time_updated'] ?? 0)
->setPayoutMethod($data['payout_method'] ?? 'usd')
;
$response[] = $settings;
......@@ -150,6 +151,7 @@ class Repository
'has_custom_logo' => $settings->hasCustomLogo(),
'has_custom_background' => $settings->hasCustomBackground(),
'time_updated' => $settings->getTimeUpdated(),
'payout_method' => $settings->getPayoutMethod(),
]),
];
......
......@@ -52,6 +52,8 @@ use Minds\Traits\MagicAttributes;
* @method Settings setHasCustomBackground(bool $customBackground)
* @method int getTimeUpdated()
* @method Settings setTimeUpdated(int $timeUpdated)
* @method string getPayoutMethod()
* @method Settings setPayoutMethod(string $method)
*/
class Settings implements JsonSerializable
{
......@@ -135,6 +137,9 @@ class Settings implements JsonSerializable
/** @var int */
protected $timeUpdated;
/** @var string */
protected $payoutMethod = 'usd';
/**
* @return string
*/
......@@ -176,6 +181,7 @@ class Settings implements JsonSerializable
'styles' => $this->buildStyles(),
'published' => $this->published,
'time_updated' => $this->timeUpdated,
'payout_method' => $this->payoutMethod,
];
}
......