mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
More stuff for intro texts.
This commit is contained in:
@@ -68,6 +68,7 @@ class Controller extends BaseController
|
||||
// get shown-intro-preference:
|
||||
if (auth()->check()) {
|
||||
$route = Route::currentRouteName();
|
||||
$route = str_replace('.', '_', $route);
|
||||
$key = 'shown_demo_' . $route;
|
||||
$config = config('intro.' . $route);
|
||||
$shownDemo = Preferences::get($key, false)->data;
|
||||
|
@@ -11,7 +11,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Json;
|
||||
|
||||
use Preferences;
|
||||
use Response;
|
||||
|
||||
/**
|
||||
@@ -29,6 +28,7 @@ class IntroController
|
||||
*/
|
||||
public function getIntroSteps(string $route)
|
||||
{
|
||||
$route = str_replace('.', '_', $route);
|
||||
$elements = config(sprintf('intro.%s', $route));
|
||||
$steps = [];
|
||||
if (is_array($elements) && count($elements) > 0) {
|
||||
@@ -37,12 +37,14 @@ class IntroController
|
||||
|
||||
// point to HTML element when not an intro or outro:
|
||||
if (!in_array($key, ['intro', 'outro'])) {
|
||||
$currentStep['element'] = '#' . $key;
|
||||
$currentStep['element'] = $options['selector'];
|
||||
}
|
||||
|
||||
// get the text:
|
||||
$currentStep['intro'] = trans('intro.' . $route . '_' . $key);
|
||||
|
||||
|
||||
|
||||
// save in array:
|
||||
$steps[] = $currentStep;
|
||||
}
|
||||
@@ -59,7 +61,8 @@ class IntroController
|
||||
public function postFinished(string $route)
|
||||
{
|
||||
$key = 'shown_demo_' . $route;
|
||||
Preferences::set($key, true);
|
||||
|
||||
// Preferences::set($key, true);
|
||||
|
||||
return Response::json(['result' => sprintf('Reported demo watched for route "%s".', $route)]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user