/**
	 * Meta Box: Extra Settings
	 */
	public function call_box_extra_settings() {
		echo $this->form->set_current_option( 'extra' )->open_form();
?>
		<fieldset class="options">
			<table class="form-table">
			<tr>
				<th style="width:250px;"><?php $this->_e( 'Solving problems' ) ?>
						<?php echo $this->tooltip_help( 'Some options to try when a problem occurs. These options can also cause other problems, so be carefull.' ) ?></th>
				<td><label><?php echo $this->form->checkbox( 'fix_js', 1 ); ?>
						<span><?php $this->_e( 'Replacing <code>&lt;/a&gt;</code> with <code>&lt;\/a&gt;</code> in JavaScript code.' ) ?></span></label>
						<?php echo $this->tooltip_help( 'By replacing </a> with <\/a> in JavaScript code these tags will not be processed by the plugin.' ) ?>
				</td>
			</tr>
			<tr>
				<th style="width:250px;"><?php $this->_e( 'Use phpQuery library' ) ?>
						<?php echo $this->tooltip_help( 'Using phpQuery library for manipulating links. This option is experimental.' ) ?></th>
				<td><label><?php echo $this->form->checkbox( 'phpquery', 1 ); ?>
						<span><?php $this->_e( 'Use phpQuery for parsing document.' ) ?></span>
						<span class="description">(Test it first!)</span></label>
				</td>
			</tr>
			<tr class="filter_excl_sel" <?php echo ( $this->form->value( 'phpquery' ) ) ? '' : 'style="display:none;"'; ?>>
				<th><?php $this->_e( 'Do NOT apply settings on...' ) ?>
					<?php echo $this->tooltip_help( 'The external links of these selection will be excluded for the settings of this plugin. Define the selection by using CSS selectors.' ) ?></th>
				<td><label><?php echo $this->form->textarea( 'filter_excl_sel' ); ?>
						<span class="description"><?php _e( 'Define selection by using CSS selectors, f.e.: <code>.excl-ext-link, .entry-title, #comments-title</code> (look <a href="http://code.google.com/p/phpquery/wiki/Selectors" target="_blank">here</a> for available selectors).' ) ?></span></label>
				</td>
			</tr>
			<tr>
				<th style="width:250px;"><?php $this->_e( 'Plugin menu position' ) ?>
					<?php echo $this->tooltip_help( 'Change the menu position of this plugin in "Screen Options".' ) ?></th>
				<td><label><a id="admin_menu_position" href="#"><?php _e( 'Change menu position' ) ?></a></label>
				</td>
			</tr>
			</table>
		</fieldset>
<?php
		echo $this->form->submit();
		echo $this->form->close_form();
	}
        /**
         * Meta Box: General Settings
         */
        public function call_box_general_settings()
        {
            echo $this->form->set_current_option('main')->open_form();
            ?>
		<fieldset class="options">
			<table class="form-table">
			<tr>
				<th style="width:250px;"><?php 
            $this->_e('Open external links in...');
            ?>
						<?php 
            echo $this->tooltip_help('Specify the target (window or tab) for opening external links.');
            ?>
</th>
				<td class="target_external_links">
					<label><?php 
            echo $this->form->radio('target', '_none', array('class' => 'field_target'));
            ?>
						<span><?php 
            $this->_e('Same window or tab (<code>_none</code>)');
            ?>
</span></label>
						<?php 
            echo $this->tooltip_help('Open in current window or tab, when framed in the same frame.');
            ?>
					<br/>
					<label><?php 
            echo $this->form->radio('target', '_blank', array('class' => 'field_target'));
            ?>
						<span><?php 
            $this->_e('New window or tab (<code>_blank</code>)');
            ?>
</span></label>
						<?php 
            echo $this->tooltip_help('Open every external link in a new window or tab.');
            ?>
					<br  style="margin-bottom:15px;" />
					<label><?php 
            echo $this->form->radio('target', '_top', array('class' => 'field_target'));
            ?>
						<span><?php 
            $this->_e('Topmost frame (<code>_top</code>)');
            ?>
</span></label>
						<?php 
            echo $this->tooltip_help('Open in current window or tab, when framed in the topmost frame.');
            ?>
					<br/>
					<label><?php 
            echo $this->form->radio('target', '_new', array('class' => 'field_target'));
            ?>
						<span><?php 
            $this->_e('Seperate window or tab (<code>_new</code>)');
            ?>
</span></label>
						<?php 
            echo $this->tooltip_help('Open new window the first time and use this window for each external link.');
            ?>
				</td>
			</tr>
			<tr>
				<th style="width:250px;"><?php 
            $this->_e('Apply plugin settings on...');
            ?>
						<?php 
            echo $this->tooltip_help('Choose contents for applying settings to external links.');
            ?>
</th>
				<td>
					<label><?php 
            echo $this->form->checkbox('filter_page', 1);
            ?>
					<span><?php 
            $this->_e('All contents');
            ?>
</span> <span class="description"><?php 
            $this->_e('(the whole <code>&lt;body&gt;</code>)');
            ?>
</span></label>
					<br/>&nbsp;&nbsp;&nbsp;<label><?php 
            echo $this->form->checkbox('filter_posts', 1);
            ?>
							<span><?php 
            $this->_e('Post contents');
            ?>
</span></label>
					<br/>&nbsp;&nbsp;&nbsp;<label><?php 
            echo $this->form->checkbox('filter_comments', 1);
            ?>
							<span><?php 
            $this->_e('Comments');
            ?>
</span></label>
					<br/>&nbsp;&nbsp;&nbsp;<label><?php 
            echo $this->form->checkbox('filter_widgets', 1);
            ?>
							<span><?php 
            if (self::check_widget_content_filter()) {
                $this->_e('All widgets');
                echo $this->tooltip_help('Applied to all widgets by using the "widget_content" filter of the Widget Logic plugin');
            } else {
                $this->_e('All text widgets');
                echo $this->tooltip_help('Only the text widget will be applied. To apply to all widget you should select "All contents" option.');
            }
            ?>
</span></label>
				</td>
			</tr>
			<tr>
				<th style="width:250px;"><?php 
            $this->_e('Make subdomains internal');
            ?>
						<?php 
            echo $this->tooltip_help('Threat all links to the site\'s domain and subdomains as internal links.');
            ?>
</th>
				<td>
					<label><?php 
            echo $this->form->checkbox('ignore_subdomains', 1);
            ?>
					<span><?php 
            $this->_e('Threat all links to the site\'s domain and subdomains as internal links');
            ?>
</span></label>
				</td>
			</tr>
			<tr>
				<th><?php 
            $this->_e('Ignore links with URL\'s containing...');
            ?>
					<?php 
            echo $this->tooltip_help('This plugin will completely ignore links that contain one of the given texts in the URL. Use enter to seperate each text. This check is not case sensitive.');
            ?>
</th>
				<td><label><?php 
            echo $this->form->textarea('ignore');
            ?>
						<span class="description"><?php 
            _e('Seperate each by an enter. No wildcards nescessary, f.e. <code>wordpress.org</code> will be threaded as <code>*wordpress.org*</code>');
            ?>
</span></label>
				</td>
			</tr>
            <?php 
            // only supported for users who were using phpquery
            $extra = get_option('wp_external_links-extra');
            if (isset($extra['phpquery']) && $extra['phpquery']) {
                ?>
			<tr>
				<th><?php 
                $this->_e('Ignore links by selectors...');
                ?>
					<?php 
                echo $this->tooltip_help('The external links of these selection will be excluded for the settings of this plugin. Define the selection by using CSS selectors.');
                ?>
</th>
				<td><label><?php 
                echo $this->form->textarea('ignore_selectors');
                ?>
						<span class="description"><?php 
                _e('Define selection by using CSS selectors, f.e.: <code>.excl-ext-link, .entry-title, #comments-title</code> (look <a href="http://code.google.com/p/phpquery/wiki/Selectors" target="_blank">here</a> for available selectors).');
                ?>
</span></label>
				</td>
			</tr>
            <?php 
            }
            ?>
			</table>
		</fieldset>

<?php 
            echo $this->form->submit();
            echo $this->form->close_form();
        }
예제 #3
0
	/**
	 * Meta Box: General Settings
	 */
	public function call_box_general_settings() {
		echo $this->form->set_current_option( 'general' )->open_form();
?>
		<fieldset class="options">
			<table class="form-table">
			<tr>
				<th style="width:300px;"><?php $this->_e( 'Set <code>target</code> for external links' ) ?>
						<?php echo $this->tooltip_help( 'Specify the target (window or tab) for opening external links.' ) ?></th>
				<td class="target_external_links">
					<label><?php echo $this->form->radio( 'target', '_blank', array( 'class' => 'field_target' ) ); ?>
						<span><?php $this->_e( '<code>_blank</code>, new window' ) ?></span></label>
						<?php echo $this->tooltip_help( 'Open every external link in a new window or tab.' ) ?>
					<br/>
					<label><?php echo $this->form->radio( 'target', '_top', array( 'class' => 'field_target' ) ); ?>
						<span><?php $this->_e( '<code>_top</code>, topmost frame' ) ?></span></label>
						<?php echo $this->tooltip_help( 'Open in current window or tab, when framed in the topmost frame.' ) ?>
					<br/>
					<label><?php echo $this->form->radio( 'target', '_new', array( 'class' => 'field_target' ) ); ?>
						<span><?php $this->_e( '<code>_new</code>, seperate window' ) ?></span></label>
						<?php echo $this->tooltip_help( 'Open new window the first time and use this window for each external link.' ) ?>
					<br/>
					<label><?php echo $this->form->radio( 'target', '_none', array( 'class' => 'field_target' ) ); ?>
						<span><?php $this->_e( '<code>_none</code>, current window' ) ?></span></label>
						<?php echo $this->tooltip_help( 'Open in current window or tab, when framed in the same frame.' ) ?>
				</td>
			</tr>
			<tr>
				<th><?php $this->_e( 'Add to <code>rel</code>-attribute' ) ?>
						<?php echo $this->tooltip_help( 'Set values for the "rel"-atribute of external links.' ) ?></th>
				<td><label><?php echo $this->form->checkbox( 'external', 1 ); ?>
						<span><?php $this->_e( 'Add <code>"external"</code>' ) ?></span></label>
						<?php echo $this->tooltip_help( 'Add "external" to the "rel"-attribute of external links.' ) ?>
					<br/><label><?php echo $this->form->checkbox( 'nofollow', 1 ); ?>
						<span><?php $this->_e( 'Add <code>"nofollow"</code>' ) ?></span></label>
						<?php echo $this->tooltip_help( 'Add "nofollow" to the "rel"-attribute of external links (unless link already has "follow").' ) ?>
				</td>
			</tr>
			<tr>
				<th><?php $this->_e( 'Add to <code>class</code>-attribute' ) ?>
						<?php echo $this->tooltip_help( 'Add one or more extra classes to the external links, seperated by a space. It is optional, else just leave field blank.' ) ?></th>
				<td><label><?php echo $this->form->text( 'class_name' ); ?></label></td>
			</tr>
			<tr>
				<th><?php $this->_e( 'Set <code>title</code>-attribute' ) ?>
						<?php echo $this->tooltip_help( 'Set title attribute for external links. Use %title% for the original title value.' ) ?></th>
				<td><label><?php echo $this->form->text( 'title' ); ?>
					<span class="description"><?php _e( 'Use <code>%title%</code> for the original title value.' ) ?></span></label></td>
			</tr>
			</table>

			<?php echo $this->hr(); ?>

			<table class="form-table">
			<tr>
				<th style="width:300px;"><?php $this->_e( 'Valid XHTML Strict' ) ?>
						<?php echo $this->tooltip_help( 'The "target"-attribute is not valid XHTML strict code. Enable this option to remove the target from external links and use the JavaScript method (built-in this plugin) for opening links.' ) ?></th>
				<td>
					<label><?php echo $this->form->checkbox( 'use_js', 1, array( 'class' => 'field_use_js' ) ); ?>
					<span><?php $this->_e( 'Use JavaScript for opening links in given target, instead of setting <code>target</code>-attribute <em>(recommended)</em>' ) ?></span></label>
				</td>
			</tr>
			</table>

			<?php echo $this->hr(); ?>

			<table class="form-table">
			<tr>
				<th style="width:300px;"><?php $this->_e( 'Apply settings to external links on...' ) ?>
						<?php echo $this->tooltip_help( 'Choose contents for applying settings to external links.' ) ?></th>
				<td>
					<label><?php echo $this->form->checkbox( 'filter_page', 1 ); ?>
					<span><?php $this->_e( 'All contents' ) ?></span></label>
					<br/>&nbsp;&nbsp;<label><?php echo $this->form->checkbox( 'filter_posts', 1 ); ?>
							<span><?php $this->_e( 'Post contents' ) ?></span></label>
					<br/>&nbsp;&nbsp;<label><?php echo $this->form->checkbox( 'filter_comments', 1 ); ?>
							<span><?php $this->_e( 'Comments' ) ?></span></label>
					<br/>&nbsp;&nbsp;<label><?php echo $this->form->checkbox( 'filter_widgets', 1 ); ?>
							<span><?php 
								if ( self::check_widget_content_filter() ):
									$this->_e( 'All widgets' );
									echo $this->tooltip_help( 'Applied to all widgets by using the "widget_content" filter of the Widget Logic plugin' );
								else:
									$this->_e( 'All text widgets' );
									echo $this->tooltip_help( 'Only the text widget will be applied. To apply to all widget you should select "All contents" option.' );
								endif;
							?></span></label>
				</td>
			</tr>
			<tr class="filter_excl_sel">
				<th><?php $this->_e( 'Do NOT apply settings on...' ) ?>
					<?php echo $this->tooltip_help( 'The external links of these selection will be excluded for the settings of this plugin. Define the selection by using CSS selectors.' ) ?></th>
				<td><label><?php echo $this->form->textarea( 'filter_excl_sel' ); ?>
						<span class="description"><?php _e( 'Define selection by using CSS selectors, f.e.: <code>.excl-ext-link, .entry-title, #comments-title</code> (look <a href="http://code.google.com/p/phpquery/wiki/Selectors" target="_blank">here</a> for available selectors).' ) ?></span></label>
				</td>
			</tr>
			</table>
		</fieldset>

		<p style="position:absolute;"><a id="admin_menu_position" href="#"><?php _e( 'Change menu position in "Screen Options"' ) ?></a></p>
<?php
		echo $this->form->submit();
		echo $this->form->close_form();
	}