Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup setting support for recommendation engine
- Loading branch information
Showing
4 changed files
with
89 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/** | ||
* Display/save recommendation settings | ||
* | ||
* @license GPL | ||
* | ||
* @package MythWeb | ||
* @subpackage Settings | ||
* | ||
/**/ | ||
|
||
// Save? | ||
if ($_POST['save']) { | ||
setting('recommend_enabled', null, (bool)$_POST['recommend_enabled']); | ||
setting('recommend_server', null, $_POST['recommend_server']); | ||
setting('recommend_key', null, $_POST['recommend_key']); | ||
} | ||
|
||
// These settings are limited to MythWeb itself | ||
$Settings_Hosts = 'MythWeb'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
/** | ||
* Configure MythWeb Recommendation settings | ||
* | ||
* @license GPL | ||
* | ||
* @package MythWeb | ||
* @subpackage Settings | ||
* | ||
/**/ | ||
?> | ||
|
||
<form class="form" method="post" action="<?php echo form_action ?>"> | ||
|
||
<table border="0" cellspacing="0" cellpadding="0"> | ||
|
||
<tr> | ||
<th><?php echo t('Enable') ?>:</th> | ||
<td> | ||
<input class="radio" | ||
type="checkbox" | ||
name="recommend_enabled" | ||
title="<?php echo t('Enable') ?>" | ||
<?php if (setting('recommend_enabled')) echo ' CHECKED'; ?>> | ||
</td> | ||
</tr> | ||
|
||
<tr> | ||
<th><?php echo t('API Server') ?>:</th> | ||
<td> | ||
<input type="text" | ||
name="recommend_server" | ||
title="<?php echo t('API Server') ?>" | ||
value="<?php echo html_entities(setting('recommend_server')) ?>" /> | ||
</td> | ||
</tr> | ||
|
||
<tr> | ||
<th><?php echo t('API Key') ?>:</th> | ||
<td> | ||
<input type="text" | ||
name="recommend_key" | ||
title="<?php echo t('API Server') ?>" | ||
value="<?php echo html_entities(setting('recommend_key')) ?>" /> | ||
</td> | ||
</tr> | ||
|
||
<tr> | ||
<td align="right"><input type="reset" class="submit" value="<?php echo t('Reset') ?>"></td> | ||
<td align="center"><input type="submit" class="submit" name="save" value="<?php echo t('Save') ?>"></td> | ||
</tr> | ||
|
||
</table> | ||
|
||
</form> |
@kormoc those 3 lines of code can sometimes results in this bug:
https://code.mythtv.org/trac/ticket/12220#comment:12
Please help if you can. Many thanks.