Beispiel #1
0
?>
"><span class="dashicons dashicons-update"></span> <?php 
_e('Reload', 'foogallery');
?>
</a>
		</div>
	</h2>
</div>

<div class="foogallery-extension-browser">
	<div class="extensions">
		<?php 
foreach ($extensions as $extension) {
    $slug = $extension['slug'];
    $classes = 'extension all extension-' . $slug;
    $downloaded = $api->is_downloaded($extension);
    if ($downloaded) {
        $classes .= ' downloaded';
    } else {
        $classes .= ' download';
    }
    if ($downloaded && $api->is_active($slug)) {
        $classes .= ' activated';
    }
    if ($api->has_errors($slug)) {
        $classes .= ' has_error';
    }
    $tag_html = '';
    if (isset($extension['tags'])) {
        foreach ($extension['tags'] as $tag) {
            $classes .= ' ' . $tag;
 function alter_gallery_template_field($field, $gallery)
 {
     if ($field) {
         switch ($field['type']) {
             case 'thumb_link':
                 $field['type'] = 'radio';
                 $field['choices'] = $this->get_thumb_link_field_choices();
                 break;
             case 'lightbox':
                 $field['lightbox'] = true;
                 $lightboxes = $this->get_lightbox_field_choices();
                 if (1 === count($lightboxes) && array_key_exists('none', $lightboxes)) {
                     $field['type'] = 'html';
                     $field['desc'] = '<strong>' . __('You have no lightbox extensions activated!', 'foogallery') . '</strong><br />';
                     $api = new FooGallery_Extensions_API();
                     if ($api->is_downloaded(false, FOOGALLERY_FOOBOX_FREE_EXTENSION_SLUG)) {
                         //just need to activate it
                         $foobox_install_link = foogallery_build_admin_menu_url(array('page' => 'foogallery-extensions', 'extension' => FOOGALLERY_FOOBOX_FREE_EXTENSION_SLUG, 'action' => 'activate'));
                         $field['desc'] .= '<a target="_blank" href="' . esc_url($foobox_install_link) . '">' . __('Activate FooBox FREE right now!', 'foogallery') . '</a>';
                     } else {
                         //we need to download it
                         $foobox_install_link = foogallery_build_admin_menu_url(array('page' => 'foogallery-extensions', 'extension' => FOOGALLERY_FOOBOX_FREE_EXTENSION_SLUG, 'action' => 'download'));
                         $foobox_install_html = '<a target="_blank" href="' . esc_url($foobox_install_link) . '">' . __('Download and activate FooBox FREE', 'foogallery') . '</a>';
                         $field['desc'] .= sprintf(__('%s which works flawlessly with %s.', 'foogallery'), $foobox_install_html, foogallery_plugin_name());
                     }
                 } else {
                     $field['type'] = 'select';
                     $field['choices'] = $lightboxes;
                 }
                 break;
         }
         if (isset($field['help']) && $field['help']) {
             $field['type'] = 'help';
         }
     }
     return $field;
 }