viewing source for "shrinky-ui.php"
last commit
commit 2e645a7ddbfaec3e66a394a975605ba8759b73dd
Date: Fri Aug 11 19:58:01 2006 +0000
source code
001: <?php
002: /*
003: Copyright 2006 Andrew Rader
004:
005: This file is part of Shrinky Link
006:
007: Shrinky Link is free software; you can redistribute it and/or modify
008: it under the terms of the GNU General Public License as published by
009: the Free Software Foundation; either version 2 of the License, or
010: (at your option) any later version.
011:
012: Shrinky Link is distributed in the hope that it will be useful,
013: but WITHOUT ANY WARRANTY; without even the implied warranty of
014: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
015: GNU General Public License for more details.
016:
017: You should have received a copy of the GNU General Public License
018: along with Shrinky Link; if not, write to the Free Software
019: Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
020: */
021:
022: check_admin_referer();
023:
024: if( isset($_POST['info_update']) ) {
025: if( isset($_POST['posts']) ) {
026: shrinky::enable_post_filter();
027: }
028: else {
029: shrinky::disable_post_filter();
030: }
031:
032: if( isset($_POST['comments']) ) {
033: shrinky::enable_comment_filter();
034: }
035: else {
036: shrinky::disable_comment_filter();
037: }
038:
039: $mode = $_POST['mode'];
040: if( $mode == 'replace' ) {
041: shrinky::enable_replace();
042: shrinky::disable_trim();
043: }
044: else {
045: shrinky::enable_trim();
046: shrinky::disable_replace();
047: }
048:
049: $rep_txt = $_POST['replace-text'];
050: shrinky::set_replace_text($rep_txt);
051:
052: $trim_len = $_POST['trim-to'];
053: shrinky::set_trim_length($trim_len);
054:
055: if( isset($_POST['domain']) ) {
056: shrinky::enable_show_domain();
057: }
058: else {
059: shrinky::disable_show_domain();
060: }
061:
062: if( isset($_POST['scheme']) ) {
063: shrinky::enable_scheme_trim();
064: }
065: else {
066: shrinky::disable_scheme_trim();
067: }
068:
069: if( isset($_POST['www']) ) {
070: shrinky::enable_www_trim();
071: }
072: else {
073: shrinky::disable_www_trim();
074: }
075:
076: if( isset($_POST['elipse']) ) {
077: shrinky::enable_elipses();
078: }
079: else {
080: shrinky::disable_elipses();
081: }
082: }
083: ?>
084: <div class=wrap>
085: <form method="post">
086: <h2>Shrinky Link Options</h2>
087: <fieldset name="Shrinky Link Options">
088: <legend><?php _e('Link Options:'); ?></legend>
089: <ul style="list-style-type: none;">
090: <li>
091: <input type="checkbox" name="posts" <?php if(shrinky::get_post_filter()) echo 'checked'; ?> id="posts"></input> <label for="posts">Filter Links in Posts</label>
092: </li>
093: <li>
094: <input type="checkbox" name="comments" <?php if(shrinky::get_comment_filter()) echo 'checked'; ?> id="comments"></input> <label for="comments">Filter Links in Comments</label>
095: </li>
096: <li>
097: <input type="checkbox" name="domain" <?php if(shrinky::get_show_domain()) echo 'checked'; ?> id="domain"></input> <label for="domain">Show Domain after Link</label>
098: </li>
099: <li>
100: <input type="radio" name="mode" id="replace" value="replace" <?php if(shrinky::get_replace()) echo 'checked'; ?>></input> <label for="replace">Replace URL Dislayed Text</label>
101: <ul>
102: <li>
103: <label for="replace-text">Replacement Text:</label>
104: <input type="text" name="replace-text" value="<?php echo shrinky::get_replace_text(); ?>" id="replace-text" />
105: </li>
106: </ul>
107: </li>
108: <li>
109: <input type="radio" name="mode" value="trim" <?php if(shrinky::get_trim()) echo 'checked'; ?> id="trim"></input> <label for="trim">Trim Text Length</label>
110: <ul>
111: <li>
112: <label for="trim-to">Trim Length To </label>
113: <input type="text" name="trim-to" value="<?php echo shrinky::get_trim_length(); ?>" id="trim-to" />
114: <label for="trim-to"> Characters</label>
115: </li>
116: <li>
117: <input type="checkbox" name="scheme" <?php if(shrinky::get_scheme_trim()) echo 'checked'; ?> id="scheme"></input> <label for="scheme">Trim Scheme (http://, ftp://) from Text</label>
118: </li>
119: <li>
120: <input type="checkbox" name="www" <?php if(shrinky::get_www_trim()) echo 'checked'; ?> id="www"></input> <label for="www">Trim WWW from Text</label>
121: </li>
122: <li>
123: <input type="checkbox" name="elipse" <?php if(shrinky::get_elipses()) echo 'checked'; ?> id="elipse"></input> <label for="elipse">Show Elipses after Trim</label>
124: </li>
125: </ul>
126: </li>
127: </ul>
128: </fieldset>
129: <div class="submit">
130: <input type="submit" name="info_update" value="<?php _e('Update options', 'Shrinky Link'); ?> »" />
131: </div>
132: </form>
133: </div>