This commit is contained in:
Phyks 2014-02-09 15:46:19 +01:00
parent 49634f657a
commit b1ecbb1971
1 changed files with 111 additions and 102 deletions

View File

@ -143,11 +143,16 @@ function adblock_plugin_treat_events(&$events) {
}
function adblock_plugin_setting_link(&$myUser) {
$myUser = (isset($_SESSION['currentUser'])?unserialize($_SESSION['currentUser']):false);
if($myUser!=false) {
echo '
<li class="pointer" onclick="$(\'#main section\').hide();$(\'#main #adblockSettingsBloc\').fadeToggle(200);">Adblock</li>';
<li onclick="toggleBlocks(\'#adblockSettingsBloc\');"><a href="#adblockSettingsBloc">Adblock</a></li>';
}
}
function adblock_plugin_setting_bloc(&$myUser) {
$myUser = (isset($_SESSION['currentUser'])?unserialize($_SESSION['currentUser']):false);
if($myUser!=false) {
$adblock_constants = file_get_contents('adblock_constants.php');
$adblock_constants = explode("\n", $adblock_constants);
@ -179,18 +184,18 @@ function adblock_plugin_setting_bloc(&$myUser) {
$getimagesize_available = function_exists("getimagesize") && ((ini_get("allow_url_fopen") == "1") ? true : false);
echo '
<section id="adblockSettingsBloc">
<form action="action.php?action=adblock_update" method="POST">
<section id="adblockSettingsBloc" class="settingsPage">
<article>
<h2>Plugin Adblock</h2>
<p><em>Note:</em><br/>
You must enter a list of id of feeds in the blacklist / whitelist fields. This list must be one id per line. You can find the id of the feed you want in the address bar on the page of the feed in Leed (http://LEED_URL/index.php?action=selectedFeed&feed=ID).</p>
<p><em>Note: </em> You must enter a list of id of feeds in the blacklist / whitelist fields. This list must be one id per line. You can find the id of the feed you want in the address bar on the page of the feed in Leed (http://LEED_URL/index.php?action=selectedFeed&feed=ID).</p>
<form action="action.php?action=adblock_update" method="POST">
<fieldset>
<div class="flash_adblockSettingsBlock">
<h3>Flash embedded contents:</h3>
<p>
Enable / Disable blocking of flash contents in events:<br/>
<input type="radio" name="flash_adblock_enable" value="1" id="flash_adblock_block_enabled" '.(($flash_enabled) ? 'checked="checked"' : '').'/><label for="flash_adblock_block_enabled">Enabled</label><br/>
<input type="radio" name="flash_adblock_enable" value="0" id="flash_adblock_block_disable" '.((!$flash_enabled) ? 'checked="checked"' : '').'/><label for="flash_adblock_block_disable">Disabled</label>
<input type="radio" name="flash_adblock_enable" value="0" id="flash_adblock_block_disable" '.((!$flash_enabled) ? 'checked="checked"' : '').'/> <label for="flash_adblock_block_disable">Disabled</label>
</p>
<p>Default behavior:<br/>
@ -236,9 +241,12 @@ function adblock_plugin_setting_bloc(&$myUser) {
</p>
</form>
</section>';
}
}
function adblock_plugin_setting_update($_) {
$myUser = (isset($_SESSION['currentUser'])?unserialize($_SESSION['currentUser']):false);
if($myUser!=false) {
if($_['action'] == 'adblock_update') {
$flash_enabled = (int) $_['flash_adblock_enable'];
$flash_block = (int) $_['flash_adblock_default_behavior'];
@ -258,6 +266,7 @@ function adblock_plugin_setting_update($_) {
else
exit("Unable to write parameters to adblock_constants.php. Check permissions on the folders.");
}
}
}
Plugin::addCSS("/css/adblock_plugin_css.css");