Skip to content

Commit

Permalink
Add alt url for registered users
Browse files Browse the repository at this point in the history
  • Loading branch information
Themroc committed Jan 9, 2022
1 parent 9a58435 commit bd92590
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions models/AdminForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class AdminForm extends \themroc\humhub\modules\modhelper\models\AdminForm
public $sort;
public $size;
public $url;
public $url_reg;

protected $vars= [
'label'=> [
Expand All @@ -40,6 +41,10 @@ class AdminForm extends \themroc\humhub\modules\modhelper\models\AdminForm
'label'=> 'Page URL',
'hints'=> 'The webpage to be shown',
],
'url_reg'=> [
'label'=> 'Page URL for registered users',
'hints'=> 'If empty, the above will be used',
],
];

protected $mod= [
Expand Down
4 changes: 3 additions & 1 deletion views/index/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

$frame= Yii::$app->request->get('frame');
$mod= Yii::$app->getModule('iframe');
$url= $mod->getSetting('url', $frame);
$url= $mod->getSetting('url_reg', $frame);
if (empty($url) || Yii::$app->user->isGuest)
$url= $mod->getSetting('url', $frame);

$js= [];
foreach ($mod->getFrames() as $f)
Expand Down

0 comments on commit bd92590

Please sign in to comment.