Skip to content

Commit

Permalink
make chrome's origin trial token meta fields configurable via setting…
Browse files Browse the repository at this point in the history
…s page
  • Loading branch information
Wedding DJ committed Jan 4, 2018
1 parent 4805327 commit 3a6500e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions app/Http/Controllers/SpaceTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,31 @@ private function prepare_space_content($space, $contentType, $preview = false) {


$origin_trial_token = '';
$origin_trial_token_data_feature = '';
$origin_trial_token_data_expires = '';
try {
$setting_origin_trial_token = Setting::where('key', \App\Http\Controllers\Admin\Settings\GeneralSettingsController::ORIGIN_TRIAL_TOKEN)->firstOrFail();
$origin_trial_token = $setting_origin_trial_token->value;
} catch (ModelNotFoundException $e) {
}
try {
$setting_origin_trial_token_data_feature = Setting::where('key', \App\Http\Controllers\Admin\Settings\GeneralSettingsController::ORIGIN_TRIAL_TOKEN_DATA_FEATURE)->firstOrFail();
$origin_trial_token_data_feature = $setting_origin_trial_token_data_feature->value;
} catch (ModelNotFoundException $e) {
}
try {
$setting_origin_trial_token_data_expires = Setting::where('key', \App\Http\Controllers\Admin\Settings\GeneralSettingsController::ORIGIN_TRIAL_TOKEN_DATA_EXPIRES)->firstOrFail();
$origin_trial_token_data_expires = $setting_origin_trial_token_data_expires->value;
} catch (ModelNotFoundException $e) {
}


$vars = [
'space_url' => url($space->uri) . (($preview==false)?'':'/preview'),
'space_title' => $space->title,
'origin_trial_token' => $origin_trial_token,
'origin_trial_token_data_feature' => $origin_trial_token_data_feature,
'origin_trial_token_data_expires' => $origin_trial_token_data_expires,
'theme_dir' => $theme->root_dir,
'theme_view' => $config['#theme-view'],
'content' => []
Expand Down Expand Up @@ -86,17 +100,31 @@ private function prepare_contenttype_content($space, $content_key, $contentType,


$origin_trial_token = '';
$origin_trial_token_data_feature = '';
$origin_trial_token_data_expires = '';
try {
$setting_origin_trial_token = Setting::where('key', \App\Http\Controllers\Admin\Settings\GeneralSettingsController::ORIGIN_TRIAL_TOKEN)->firstOrFail();
$origin_trial_token = $setting_origin_trial_token->value;
} catch (ModelNotFoundException $e) {
}
try {
$setting_origin_trial_token_data_feature = Setting::where('key', \App\Http\Controllers\Admin\Settings\GeneralSettingsController::ORIGIN_TRIAL_TOKEN_DATA_FEATURE)->firstOrFail();
$origin_trial_token_data_feature = $setting_origin_trial_token_data_feature->value;
} catch (ModelNotFoundException $e) {
}
try {
$setting_origin_trial_token_data_expires = Setting::where('key', \App\Http\Controllers\Admin\Settings\GeneralSettingsController::ORIGIN_TRIAL_TOKEN_DATA_EXPIRES)->firstOrFail();
$origin_trial_token_data_expires = $setting_origin_trial_token_data_expires->value;
} catch (ModelNotFoundException $e) {
}


$vars = [
'space_url' => url($space->uri) . (($preview==false)?'':'/preview'),
'space_title' => $space->title,
'origin_trial_token' => $origin_trial_token,
'origin_trial_token_data_feature' => $origin_trial_token_data_feature,
'origin_trial_token_data_expires' => $origin_trial_token_data_expires,
'theme_dir' => $theme->root_dir,
'content_type_view' => $config['#content-types'][$content_key]['#content-type-view'],
'content' => []
Expand Down

0 comments on commit 3a6500e

Please sign in to comment.