Пример #1
0
function __stickyflag_Config()
{
    $options = rss_plugins_get_option(STICKYFLAG_CONFIG_OPTIONS);
    $flag_icon = rss_plugins_get_option(STICKYFLAG_CONFIG_FLAGICON);
    if (null == $options) {
        $options = 0;
    }
    if (null == $flag_icon) {
        $flag_option = 0;
    }
    if (rss_plugins_is_submit()) {
        $options = 0;
        if (!empty($_REQUEST['ui_sm'])) {
            $options |= STICKYFLAG_ENABLE_STICKY_MENU;
        }
        if (!empty($_REQUEST['ui_fm'])) {
            $options |= STICKYFLAG_ENABLE_FLAG_MENU;
        }
        if (!empty($_REQUEST['ui_ss'])) {
            $options |= STICKYFLAG_ENABLE_STICKY_SHORTCUT;
        }
        if (!empty($_REQUEST['ui_fs'])) {
            $options |= STICKYFLAG_ENABLE_FLAG_SHORTCUT;
        }
        rss_plugins_add_option(STICKYFLAG_CONFIG_OPTIONS, $options, 'num');
        rss_plugins_add_option(STICKYFLAG_CONFIG_FLAGICON, $_REQUEST['flag_icon'], 'num');
        return;
    }
    print "<fieldset>\n";
    print "  <legend>" . __('Sticky') . " " . __('items') . "</legend>\n";
    print "   <p><input id='ui_sm' type='checkbox' value='1' name='ui_sm'" . ($options & STICKYFLAG_ENABLE_STICKY_MENU ? "checked='1'" : "") . ">" . "<label for='ui_sm'>Show Menu Item</label></br></p>\n";
    print "   <p><input id='ui_ss' type='checkbox' value='1' name='ui_ss'" . ($options & STICKYFLAG_ENABLE_STICKY_SHORTCUT ? "checked='1'" : "") . ">" . "<label for='ui_ss'>Show Shortcut</label></br></p>\n";
    print "   <p>&nbsp;</p>\n";
    print "</fieldset>\n";
    print "<fieldset>\n";
    print "  <legend>" . __('Flagged') . " " . __('items') . "</legend>\n";
    print "    <p><input id='ui_fm' type='checkbox' value='1' name='ui_fm'" . ($options & STICKYFLAG_ENABLE_FLAG_MENU ? "checked='1'" : "") . ">" . "<label for='ui_fm'>Show Menu Item</label></br></p>\n";
    print "    <p><input id='ui_fs' type='checkbox' value='1' name='ui_fs'" . ($options & STICKYFLAG_ENABLE_FLAG_SHORTCUT ? "checked='1'" : "") . ">" . "<label for='ui_fs'>Show Shortcut</label></br></p>\n";
    print "    <p><input id='flag_icon' name='flag_icon' type='radio' value='" . STICKYFLAG_FLAG_BLUE . "'" . (STICKYFLAG_FLAG_BLUE == $flag_icon ? " checked='1'" : "") . ">" . "<img src='" . STICKYFLAG_ICON_FLAG_BLUE . "' alt='blue'>\n" . "<input id='flag_icon' name='flag_icon' type='radio' value='" . STICKYFLAG_FLAG_GREEN . "'" . (STICKYFLAG_FLAG_GREEN == $flag_icon ? " checked='1'" : "") . ">" . "<img src='" . STICKYFLAG_ICON_FLAG_GREEN . "' alt='green'>\n" . "<input id='flag_icon' name='flag_icon' type='radio' value='" . STICKYFLAG_FLAG_ORANGE . "'" . (STICKYFLAG_FLAG_ORANGE == $flag_icon ? " checked='1'" : "") . ">" . "<img src='" . STICKYFLAG_ICON_FLAG_ORANGE . "' alt='orange'>\n" . "<input id='flag_icon' name='flag_icon' type='radio' value='" . STICKYFLAG_FLAG_RED . "'" . (STICKYFLAG_FLAG_RED == $flag_icon ? " checked='1'" : "") . ">" . "<img src='" . STICKYFLAG_ICON_FLAG_RED . "' alt='red'>\n" . "<input id='flag_icon' name='flag_icon' type='radio' value='" . STICKYFLAG_FLAG_WHITE . "'" . (STICKYFLAG_FLAG_WHITE == $flag_icon ? " checked='1'" : "") . ">" . "<img src='" . STICKYFLAG_ICON_FLAG_WHITE . "' alt='white'></p>\n";
    print "</fieldset>\n";
}
Пример #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 
}
Пример #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 
    }
}
Пример #4
0
/**
 * Configuration: display a table row for each possible action
 */
function __kbnav_config()
{
    $kmap = __kbnav_config_action_keys();
    if (rss_plugins_is_submit()) {
        foreach ($_POST as $k => $v) {
            if (preg_match('#key_([a-zA-Z_]+)#', $k, $matches)) {
                $action = $matches[1];
                if (isset($kmap[$action])) {
                    $kmap[$action]['key'] = $v;
                }
            } elseif (preg_match('#mod_([a-zA-Z_]+)#', $k, $matches)) {
                $action = $matches[1];
                if (isset($kmap[$action])) {
                    $kmap[$action]['modifier'] = $v;
                }
            }
        }
        rss_plugins_add_option(KBNAVIGATIONPLUGIN_KMAP_CONFIG_OPTIONS, $kmap, 'array');
        return;
    }
    $actions = __kbnav_config_actions();
    ?>
	<table class="frame">
		<tr>
			<th>Action</th>
			<th>Modifier</th>
			<th>Key</th>
		</tr>
<?php 
    foreach ($kmap as $action => $data) {
        ?>
	<tr>
		<td><?php 
        echo $actions[$action];
        ?>
</td>
		<td><?php 
        __kbnav_config_modifier_combo($action, @$kmap[$action]['modifier']);
        ?>
</td>
		<td><?php 
        __kbnav_config_key_combo($action, @$kmap[$action]['key']);
        ?>
</td>
	</tr>
<?php 
    }
    ?>
	</table>
<?php 
}