/**
 * Fetch the config from the config, add default values for missing keys
 */
function __kbnav_config_action_keys()
{
    $kmap = rss_plugins_get_option(KBNAVIGATIONPLUGIN_KMAP_CONFIG_OPTIONS);
    if (!isset($kmap['__kbnav_Next']['key'])) {
        $kmap['__kbnav_Next']['key'] = 'j';
    }
    if (!isset($kmap['__kbnav_Prev']['key'])) {
        $kmap['__kbnav_Prev']['key'] = 'k';
    }
    if (!isset($kmap['__kbnav_ToggleSticky']['key'])) {
        $kmap['__kbnav_ToggleSticky']['key'] = 's';
    }
    if (!isset($kmap['__kbnav_ToggleFlag']['key'])) {
        $kmap['__kbnav_ToggleFlag']['key'] = 'f';
    }
    if (!isset($kmap['__kbnav_NextMarkRead']['key'])) {
        $kmap['__kbnav_NextMarkRead']['key'] = 'm';
    }
    if (!isset($kmap['__kbnav_MarkAllRead']['key'])) {
        $kmap['__kbnav_MarkAllRead']['key'] = 'm';
        $kmap['__kbnav_MarkAllRead']['modifier'] = 'shift';
    }
    if (!isset($kmap['__kbnav_ScrollTop']['key'])) {
        $kmap['__kbnav_ScrollTop']['key'] = 'h';
    }
    if (!isset($kmap['__kbnav_ToggleCollapse']['key'])) {
        $kmap['__kbnav_ToggleCollapse']['key'] = 'c';
    }
    if (!isset($kmap['__kbnav_OpenUrl']['key'])) {
        $kmap['__kbnav_OpenUrl']['key'] = 'o';
    }
    if (!isset($kmap['__kbnav_OpenUrlNW']['key'])) {
        $kmap['__kbnav_OpenUrlNW']['key'] = 'o';
        $kmap['__kbnav_OpenUrlNW']['modifier'] = 'shift';
    }
    if (!isset($kmap['__kbnav_EditTags']['key'])) {
        $kmap['__kbnav_EditTags']['key'] = 't';
    }
    return $kmap;
}
Beispiel #2
0
function __firestats_config()
{
    if (rss_plugins_is_submit()) {
        $path = $_REQUEST['firestats_path'];
        if ($path != '') {
            if (file_exists($path . '/php/db-hit.php')) {
                rss_plugins_add_option('firestats.path', $path);
            } else {
                echo "<div>FireStats was not found in <b>{$path}</b></div>";
            }
        } else {
            echo '<div>You need to enter the path where FireStats is installed</div>';
        }
        $site_id = $_REQUEST['firestats_id'];
        if ($site_id == '') {
            $site_id = "0";
        }
        rss_plugins_add_option('firestats.id', $site_id);
    }
    $path = rss_plugins_get_option('firestats.path');
    $site_id = rss_plugins_get_option('firestats.id');
    ?>
FireStats path<br/>
example : /var/www/firestats<br/>
<input type="text" id="firestats_path" name="firestats_path" size="15" value="<?php 
    echo $path;
    ?>
"/><br/>
Site id<br/>
The ID of this Gregarius site in the FireStats sites table<br/>
<input type="text" id="firestats_id" name="firestats_id" size="15" value="<?php 
    echo $site_id;
    ?>
"/>
<?php 
}
Beispiel #3
0
function __markallread_config()
{
    $options = rss_plugins_get_option(MARKALLREAD_CONFIG_OPTIONS);
    if (null == $options) {
        $options = MARKALLREAD_OPTION_CONFIIRM;
    }
    if (rss_plugins_is_submit()) {
        $options = 0;
        if (!empty($_REQUEST['chkMarkReadButton'])) {
            $options |= MARKALLREAD_OPTION_BUTTON;
        }
        if (!empty($_REQUEST['chkMarkReadButtonBottom'])) {
            $options |= MARKALLREAD_OPTION_BOTTOM_BUTTON;
        }
        if (!empty($_REQUEST['chkFeedLink'])) {
            $options |= MARKALLREAD_OPTION_LINK_FEED;
        }
        if (!empty($_REQUEST['chkFolderLink'])) {
            $options |= MARKALLREAD_OPTION_LINK_FOLDER;
        }
        if (!empty($_REQUEST['chkChannelLink'])) {
            $options |= MARKALLREAD_OPTION_LINK_CATEGORY;
        }
        if (!empty($_REQUEST['chkConfirm'])) {
            $options |= MARKALLREAD_OPTION_CONFIIRM;
        }
        rss_plugins_add_option(MARKALLREAD_CONFIG_OPTIONS, $options, 'num');
    } else {
        ?>
<p>
  <input type='checkbox' value='1' name='chkMarkReadButton' id='chkMarkReadButton'<?php 
        echo $options & MARKALLREAD_OPTION_BUTTON ? " checked='1'" : "";
        ?>
 />
  <label for='chkMarkReadButton'>Display a button to mark all items read in the current feed, folder, or channel</label>
</p>
<p>
  <input type='checkbox' value='1' name='chkMarkReadButtonBottom' id='chkMarkReadButtonBottom'<?php 
        echo $options & MARKALLREAD_OPTION_BOTTOM_BUTTON ? " checked='1'" : "";
        ?>
 />
  <label for='chkMarkReadButtonBottom'>Display an identical button at the bottom of the screen</label>
</p>
<fieldset>
  <legend>Sidebar</legend>
  <p>
    <input type='checkbox' value='1' name='chkFeedLink' id='chkFeedLink'<?php 
        echo $options & MARKALLREAD_OPTION_LINK_FEED ? " checked='1'" : "";
        ?>
 />
    <label for='chkFeedLink'>Display a mark read link for feeds</label>
  </p>
  <p>
    <input type='checkbox' value ='1' name='chkFolderLink' id='chkFolderLink'<?php 
        echo $options & MARKALLREAD_OPTION_LINK_FOLDER ? " checked='1'" : "";
        ?>
 />
	<label for='chkFolderLink'>Display a mark read link for folders</label>
  </p>
  <p>
    <input type='checkbox' value='1' name='chkChannelLink' id='chkChannelLink'<?php 
        echo $options & MARKALLREAD_OPTION_LINK_CATEGORY ? " checked='1'" : "";
        ?>
 />
	<label for='chkChannelLink'>Display a mark read link for channels</label>
  </p>
</fieldset>
<p>
  <input type='checkbox' value='1' name='chkConfirm' id='chkConfirm'<?php 
        echo $options & MARKALLREAD_OPTION_CONFIIRM ? " checked='1'" : "";
        ?>
 />
  <label for='chkConfirm'>Ask for confirmation before marking items read</label>
</p>
<?php 
    }
}
function __stickyflag_OnOk($ret)
{
    $options = rss_plugins_get_option(STICKYFLAG_CONFIG_OPTIONS);
    if (null == $options) {
        return;
    }
    $ret .= " ";
    if ($options & STICKYFLAG_ENABLE_STICKY_SHORTCUT) {
        $ret .= "if((sfs = document.getElementById(\\'sf_ID_s\\')) && sfs.checked) {" . "  document.getElementById(\\'sticky_img__ID_\\').src = \\'" . STICKYFLAG_ICON_STICKY . "\\';" . "} else {" . "  document.getElementById(\\'sticky_img__ID_\\').src = \\'" . STICKYFLAG_ICON_NOSTICKY . "\\';" . "}";
    }
    if ($options & STICKYFLAG_ENABLE_FLAG_SHORTCUT) {
        $ret .= "if((sff = document.getElementById(\\'sf_ID_f\\')) && sff.checked) {" . "  document.getElementById(\\'flag_img__ID_\\').src = \\'" . __stickyflag_GetFlagIcon() . "\\';" . "} else {" . "  document.getElementById(\\'flag_img__ID_\\').src = \\'" . STICKYFLAG_ICON_NOFLAG . "\\';" . "}";
    }
    return $ret;
}