コード例 #1
0
 function render_image_attributes($options)
 {
     $attr = array('class' => 'asg-image', 'data-height' => $this->height, 'data-width' => $this->width, 'data-tags' => implode(', ', $this->tags));
     if ($this->slug) {
         $attr['data-slug'] = $this->slug;
     }
     if ($options['image']['blur'] && $options['image']['blur'] != 'off') {
         $attr['data-blur'] = $options['image']['blur'];
     }
     if ($options['image']['bw'] && $options['image']['bw'] != 'off') {
         $attr['data-bw'] = $options['image']['bw'];
     }
     if (asg_get_active_lightbox() == 'jetpack') {
         $attr['data-meta'] = json_encode($this->meta);
         $attr['data-attachment-id'] = $this->attachment_id;
     }
     $this->render_attributes($attr);
 }
コード例 #2
0
 function get_lightbox_options()
 {
     switch (asg_get_active_lightbox()) {
         case 'prettyphoto':
             return array('theme' => get_option('asg_prettyphoto_theme', 'pp_default'), 'slideshow' => true, 'hook' => 'data-rel');
         default:
             return array();
     }
 }
コード例 #3
0
    function build_option_pages()
    {
        ?>
		<div class="wrap">
			<div class="icon32" id="icon-options-general"><br></div>
			<h2><?php 
        _e('Awesome Gallery Settings', 'asg');
        ?>
</h2>
			<form method="post" action="options.php" id="asg-settings">
				<?php 
        settings_fields('asg-options');
        ?>
				<ul>
					<li class="clear-after"><h3><?php 
        _e('Compatibility', 'asg');
        ?>
</li>
					<li class="clear-after">
						<label class="asg-options-label"><?php 
        _e('Use shortcode hack', 'asg');
        ?>
</label>
						<p class="inputs">
							<label class="checkbox-label"><input type="checkbox" name="asg_shortcode_hack" value="1"
									<?php 
        echo checked(get_option('asg_shortcode_hack'));
        ?>
></label><em><?php 
        _e('Try
									 this if Awesome Gallery looks strange on your site', 'asg');
        ?>
							</em>
						</p>
					</li>
					<li class="clear-after">
						<label class="asg-options-label"><?php 
        _e('Force new jQuery version', 'asg');
        ?>
</label>
						<p class="inputs">
							<label class="checkbox-label"><input type="checkbox" name="asg_new_jquery"
							                                     value="1" <?php 
        echo checked(get_option('asg_new_jquery'));
        ?>
></label><em><?php 
        _e('Try this if Awesome Gallery does
								not work at your site', 'asg');
        ?>
</em>
						</p>
					</li>
					<li class="clear-after"><h3><?php 
        _e('Image Processing', 'asg');
        ?>
</h3></li>
					<li class="clear-after">
						<label class="asg-options-label"><?php 
        _e('Processing engine', 'asg');
        ?>
</label>
						<p class="inputs" style="margin-left: 200px">
							<input type="radio" name="asg_processing_engine" value="timthumb" <?php 
        checked(asg_is_photon_active() ? get_option('asg_processing_engine', 'timthumb') : 'timthumb', 'timthumb');
        ?>
>
							<?php 
        _e("TimThumb", 'asg');
        ?>
<br>
							<input type="radio" name="asg_processing_engine" value="photon" <?php 
        checked(get_option('asg_processing_engine', 'timthumb'), 'photon');
        ?>
 <?php 
        echo asg_is_photon_active() ? '' : 'disabled="disabled"';
        ?>
>
							<?php 
        _e('Photon', 'asg');
        ?>
							<?php 
        if (!asg_is_photon_active()) {
            ?>
									<strong>
										&mdash; JetPack Photon is not installed or active. <a href="admin.php?page=asg-image-troubleshooting-easy">Learn how to activate it</a>.
									</strong>
							<?php 
        }
        ?>
<br>
						</p>
					</li>
					<li class="clear-after">
						<label class="asg-options-label"><?php 
        _e('CDN host (only for TimThumb)', 'asg');
        ?>
</label>
						<p class="inputs">
							<input name="asg_cdn_host" value="<?php 
        echo esc_attr(get_option('asg_cdn_host'));
        ?>
"
							       class="regular-text" type="text" placeholder="like 'http://test.cloudfront.net'">
							<em><?php 
        _e('Please make double sure you know what you are doing!', 'asg');
        ?>
</em>
						</p>
					</li>
					<li class="clear-after"><h3><?php 
        _e('CDN', 'asg');
        ?>
</li>
					<li class="clear-after"></li>
					<li class="clear-after"><h3><?php 
        _e('Lightbox integration', 'asg');
        ?>
</h3></li>
					<li class="clear-after">
						<label class="asg-options-label"><?php 
        _e('Lightbox', 'asg');
        ?>
</label>
						<p class="inputs" style="margin-left: 200px">
							<input type="radio" name="asg_lightbox" value="magnific-popup" <?php 
        checked('magnific-popup', asg_get_active_lightbox());
        ?>
><?php 
        _e('Magnific popup', 'asg');
        ?>
</input>
							<br>
							<input type="radio" name="asg_lightbox" value="swipebox" <?php 
        checked('swipebox', asg_get_active_lightbox());
        ?>
><?php 
        _e('Swipebox', 'asg');
        ?>
</input>
							<br>
							<input type="radio" name="asg_lightbox" value="prettyphoto" <?php 
        checked('prettyphoto', asg_get_active_lightbox());
        ?>
><?php 
        _e('Prettyphoto', 'asg');
        ?>
</input>
							<br>
							<input type="radio" name="asg_lightbox" value="ilightbox" <?php 
        checked('ilightbox', asg_get_active_lightbox());
        ?>
>
									<?php 
        _e('iLightbox', 'asg');
        ?>
									&mdash;
							</input>
							<?php 
        if (asg_is_ilightbox_available()) {
            ?>
								<strong>Installed and active.</strong>
							<?php 
        } else {
            ?>
								<strong>Not installed or inactive.</strong>
								<?php 
            echo sprintf(__('You can buy iLightbox at the <a href="%s" target="_blank">CodeCanyon</a>, install and activate it', 'asg'), 'http://codecanyon.net/item/ilightbox-revolutionary-lightbox-for-wordpress/3939523');
            ?>
							<?php 
        }
        ?>
							<br>
							<input type="radio" name="asg_lightbox" value="jetpack" <?php 
        checked('jetpack', asg_get_active_lightbox());
        ?>
>
								<?php 
        _e('JetPack carousel', 'asg');
        ?>
								&mdash;
							<?php 
        if (asg_is_jetpack_available()) {
            ?>
									<strong>Installed and active.</strong>
							<?php 
        } else {
            ?>
									<strong><?php 
            _e('JetPack not installed, not activated, or Carousel module is inactive', 'asg');
            ?>
</strong>
									<a href="admin.php?page=asg-image-troubleshooting-easy"><?php 
            _e('Install Jetpack', 'asg');
            ?>
</a>
							<?php 
        }
        ?>
							<br>
							<input type="radio" name="asg_lightbox" value="foobox" <?php 
        checked('foobox', asg_get_active_lightbox());
        ?>
>
							<?php 
        _e('FooBox', 'asg');
        ?>
							&mdash;
							<?php 
        if (asg_is_foobox_available()) {
            ?>
								<strong>Installed and active.</strong>
							<?php 
        } else {
            ?>
								<strong><?php 
            _e('FooBox is not installed, or was not activated.', 'asg');
            ?>
</strong>
								<?php 
            echo sprintf(__('You can buy FooBox at: <a href="%s" target="_blank">its official site</a>', 'asg'), 'http://http://getfoobox.com');
            ?>
							<?php 
        }
        ?>
							<br>
							<input type="radio" name="asg_lightbox" value="custom" <?php 
        checked('custom', asg_get_active_lightbox());
        ?>
><?php 
        _e('Custom', 'asg');
        ?>
</input>

						</p>
					</li>
					<li class="clear-after"><h4><?php 
        _e('PrettyPhoto options', 'asg');
        ?>
</h4></li>
					<li class="clear-after">
						<label class="asg-options-label"><?php 
        _e('PrettyPhoto skin', 'asg');
        ?>
</label>
						<p class="inputs">
							<select name="asg_prettyphoto_theme">
								<option value="pp_default" <?php 
        selected('default', get_option('asg_prettyphoto_theme'));
        ?>
><?php 
        _e('Default', 'asg');
        ?>
</option>
								<option value="facebook" <?php 
        selected('facebook', get_option('asg_prettyphoto_theme'));
        ?>
><?php 
        _e('Facebook', 'asg');
        ?>
</option>
								<option value="dark_rounded" <?php 
        selected('dark_rounded', get_option('asg_prettyphoto_theme'));
        ?>
><?php 
        _e('Dark rounded', 'asg');
        ?>
</option>
								<option value="dark_square" <?php 
        selected('dark_square', get_option('asg_prettyphoto_theme'));
        ?>
><?php 
        _e('Dark square', 'asg');
        ?>
</option>
								<option value="light_rounded" <?php 
        selected('light_rounded', get_option('asg_prettyphoto_theme'));
        ?>
><?php 
        _e('Light rounded', 'asg');
        ?>
</option>
								<option value="light_square" <?php 
        selected('light_square', get_option('asg_prettyphoto_theme'));
        ?>
><?php 
        _e('Light square', 'asg');
        ?>
</option>
							</select>
						</p>
					</li>
					<li class="clear-after"><h4><?php 
        _e('Custom lightbox options', 'asg');
        ?>
</h4></li>
					<li class="clear-after">
						<label class="asg-options-label"><?php 
        _e('Link custom rel attribute value', 'asg');
        ?>
</label>
						<p class="inputs">
							<input name="asg_link_rel" class="regular-text" type="text" value="<?php 
        echo esc_attr(get_option('asg_link_rel'));
        ?>
">
							<em><?php 
        _e('If your custom lightbox requires a specific rel attribute value, you can enter it here.', 'asg');
        ?>
</em>
						</p>
					</li>
					<li class="clear-after">
						<label class="asg-options-label"><?php 
        _e('Link class', 'asg');
        ?>
</label>
						<p class="inputs">
							<input name="asg_link_class" class="regular-text" type="text" value="<?php 
        echo esc_attr(get_option('asg_link_class'));
        ?>
">
							<em><?php 
        _e('If your custom lightbox requires a specific class, you can enter it here.', 'asg');
        ?>
</em>
						</p>
					</li>
					<li class="clear-after">
						<label class="asg-options-label"><?php 
        _e('Custom attribute name', 'asg');
        ?>
</label>
						<p class="inputs"><input name="asg_link_custom_attr_name" class="regular-text" type="text" value="<?php 
        echo esc_attr(get_option('asg_link_custom_attr_name'));
        ?>
"></p>
					</li>
					<li class="clear-after">
						<label class="asg-options-label"><?php 
        _e('Custom attribute value', 'asg');
        ?>
</label>
						<p class="inputs"><input name="asg_link_custom_attr_value" class="regular-text" type="text" value="<?php 
        echo esc_attr(get_option('asg_link_custom_attr_value'));
        ?>
"></p>
					</li>

					<li class="clear-after"><h3><?php 
        _e('Endless scroll', 'asg');
        ?>
</h3></li>
					<li class="clear-after">
						<label class="asg-options-label"><?php 
        _e('Endless scroll binder selector', 'asg');
        ?>
</label>
						<p class="inputs">
							<input name="asg_scroll_binder" value="<?php 
        echo esc_attr(get_option('asg_scroll_binder'));
        ?>
" class="regular-text" type="text" placeholder="jQuery selector here">
							<em><?php 
        _e('jQuery selector for your binder element if some scrolling plugin is used');
        ?>
</em>
						</p>
					</li>

				</ul>
				<?php 
        submit_button();
        ?>
			</form>
		</div>
<?php 
    }