示例#1
0
文件: tags.php 项目: ecerta/webcomic
 /**
  * Return all collection ID's or configurations.
  * 
  * <code class="php">
  * // return an array of all collection ID's
  * $collections = get_webcomic_collections();
  * 
  * // Return an array of all collection configurations
  * $collections = get_webcomic_collections( true );
  * </code>
  * 
  * @package Webcomic
  * @param boolean $config Return the entire configuration for all collections.
  * @return array
  * @uses WebcomicTag::get_webcomic_collections()
  */
 function get_webcomic_collections($config = false)
 {
     return WebcomicTag::get_webcomic_collections($config);
 }
示例#2
0
    /**
     * Render widget settings.
     * 
     * @param array $instance Specific instance settings.
     * @uses WebcomicTag::get_webcomic_collections()
     */
    public function form($instance)
    {
        extract($instance);
        $collections = WebcomicTag::get_webcomic_collections(true);
        ?>
		<p>
			<label>
				<?php 
        _e('Title', 'webcomic');
        ?>
				<input type="text" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" value="<?php 
        echo empty($title) ? '' : esc_attr($title);
        ?>
" class="widefat">
			</label>
		</p>
		<p>
			<label>
				<?php 
        _e('None Link', 'webcomic');
        ?>
<br>
				<span id="<?php 
        echo $this->get_field_id('none_image');
        ?>
"><?php 
        self::ajax_image(empty($none_image) ? 0 : $none_image, $this->get_field_name('none_image'), $this->get_field_id('none_image'));
        ?>
</span><br>
				<input type="text" id="<?php 
        echo $this->get_field_name('none');
        ?>
" name="<?php 
        echo $this->get_field_name('none');
        ?>
" value="<?php 
        echo empty($none) ? '' : esc_attr($none);
        ?>
" class="widefat">
				<span class="description"><?php 
        _e('Displayed when transcription is on but no transcripts are available. The link text will be used as alternate text if you select an image.', 'webcomic');
        ?>
</span>
			</label>
		</p>
		<p>
			<label>
				<?php 
        _e('Some Link', 'webcomic');
        ?>
<br>
				<span id="<?php 
        echo $this->get_field_id('some_image');
        ?>
"><?php 
        self::ajax_image(empty($some_image) ? 0 : $some_image, $this->get_field_name('some_image'), $this->get_field_id('some_image'));
        ?>
</span><br>
				<input type="text" id="<?php 
        echo $this->get_field_name('some');
        ?>
" name="<?php 
        echo $this->get_field_name('some');
        ?>
" value="<?php 
        echo empty($some) ? '' : esc_attr($some);
        ?>
" class="widefat">
				<span class="description"><?php 
        _e('Displayed when one or more transcripts are available. The link text will be used as alternate text if you select an image.', 'webcomic');
        ?>
</span>
			</label>
		</p>
		<p>
			<label>
				<?php 
        _e('Off Link', 'webcomic');
        ?>
<br>
				<span id="<?php 
        echo $this->get_field_id('off_image');
        ?>
"><?php 
        self::ajax_image(empty($off_image) ? 0 : $off_image, $this->get_field_name('off_image'), $this->get_field_id('off_image'));
        ?>
</span><br>
				<input type="text" id="<?php 
        echo $this->get_field_name('off');
        ?>
" name="<?php 
        echo $this->get_field_name('off');
        ?>
" value="<?php 
        echo empty($off) ? '' : esc_attr($off);
        ?>
" class="widefat">
				<span class="description"><?php 
        _e('Displayed when transcription is turned off. The link text will be used as alternate text if you select an image.', 'webcomic');
        ?>
</span>
			</label>
		</p>
		<table class="widefat">
			<thead>
				<tr>
					<th><?php 
        _e('Token', 'webcomic');
        ?>
</th>
					<th><?php 
        _e('Replacement', 'webcomic');
        ?>
</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>%title</td>
					<td><?php 
        _e('Webcomic Title', 'webcomic');
        ?>
</td>
				</tr>
				<tr>
					<td>%date</td>
					<td><?php 
        _e('Publish Date', 'webcomic');
        ?>
</td>
				</tr>
				<?php 
        $count = 1;
        $sizes = '<tr><td>%full</td></tr>';
        foreach (get_intermediate_image_sizes() as $size) {
            $count++;
            $sizes .= "<tr><td>%{$size}</td></tr>";
        }
        echo preg_replace('/<\\/td><\\/tr>/', '</td><td rowspan="' . $count . '" style="border-left:thin solid #dfdfdf">' . __('Image Preview', 'webcomic') . '</td></tr>', $sizes, 1);
        ?>
			</tbody>
		</table>
		<?php 
    }