function Form($settings)
        {
            // Load options
            $this->load_options($settings);
            unset($settings);
            ?>
    <p>
      <label for="<?php 
            echo $this->Get_Field_Id('title');
            ?>
"><?php 
            echo $this->t('Title');
            ?>
</label>:
      <input type="text" id="<?php 
            echo $this->Get_Field_Id('title');
            ?>
" name="<?php 
            echo $this->get_field_name('title');
            ?>
" value="<?php 
            echo HTMLSpecialChars($this->get_option('title'));
            ?>
" /><br />
      <small><?php 
            echo $this->t('Leave blank to use the widget default title.');
            ?>
</small>
    </p>

    <p>
      <label for="<?php 
            echo $this->Get_Field_Id('taxonomy');
            ?>
"><?php 
            echo $this->t('Taxonomy');
            ?>
</label>:
      <select id="<?php 
            echo $this->Get_Field_Id('taxonomy');
            ?>
" name="<?php 
            echo $this->Get_Field_Name('taxonomy');
            ?>
">
      <?php 
            foreach (Get_Object_Taxonomies($this->fancy_gallery->gallery_post_type) as $taxonomy) {
                $taxonomy = Get_Taxonomy($taxonomy);
                ?>
      <option value="<?php 
                echo $taxonomy->name;
                ?>
" <?php 
                Selected($this->get_option('taxonomy'), $taxonomy->name);
                ?>
><?php 
                echo HTMLSpecialChars($taxonomy->labels->name);
                ?>
</option>
      <?php 
            }
            ?>
      </select><br />
      <small><?php 
            echo $this->t('Please choose the Taxonomy the widget should display.');
            ?>
</small>
    </p>

    <p>
      <label for="<?php 
            echo $this->Get_Field_Id('number');
            ?>
"><?php 
            echo $this->t('Number');
            ?>
</label>:
      <input type="text" id="<?php 
            echo $this->Get_Field_Id('number');
            ?>
" name="<?php 
            echo $this->get_field_name('number');
            ?>
" value="<?php 
            echo HTMLSpecialChars($this->get_option('number'));
            ?>
" size="4" /><br />
      <small><?php 
            echo $this->t('Leave blank to show all.');
            ?>
</small>
    </p>

    <p>
      <label for="<?php 
            echo $this->get_field_id('exclude');
            ?>
"><?php 
            _e('Exclude:');
            ?>
</label>
      <input type="text" value="<?php 
            echo HTMLSpecialChars($this->get_option('exclude'));
            ?>
" name="<?php 
            echo $this->get_field_name('exclude');
            ?>
" id="<?php 
            echo $this->get_field_id('exclude');
            ?>
" class="widefat" /><br />
      <small><?php 
            echo $this->t('Term IDs, separated by commas.');
            ?>
</small>
    </p>

    <p>
      <input type="checkbox" id="<?php 
            echo $this->get_field_id('count');
            ?>
" name="<?php 
            echo $this->get_field_name('count');
            ?>
" <?php 
            Checked($this->get_option('count') == True);
            ?>
 />
      <label for="<?php 
            echo $this->get_field_id('count');
            ?>
"><?php 
            _e('Show Gallery counts.');
            ?>
</label>
    </p>

    <p>
      <label for="<?php 
            echo $this->Get_Field_Id('orderby');
            ?>
"><?php 
            echo $this->t('Order by');
            ?>
</label>:
      <select id="<?php 
            echo $this->Get_Field_Id('orderby');
            ?>
" name="<?php 
            echo $this->Get_Field_Name('orderby');
            ?>
">
      <option value="name" <?php 
            Selected($this->get_option('orderby'), 'name');
            ?>
><?php 
            echo __('Name');
            ?>
</option>
      <option value="count" <?php 
            Selected($this->get_option('orderby'), 'count');
            ?>
><?php 
            echo $this->t('Gallery Count');
            ?>
</option>
      <option value="ID" <?php 
            Selected($this->get_option('orderby'), 'ID');
            ?>
>ID</option>
      <option value="slug" <?php 
            Selected($this->get_option('orderby'), 'slug');
            ?>
><?php 
            echo $this->t('Slug');
            ?>
</option>
      </select>
    </p>

    <p>
      <label for="<?php 
            echo $this->Get_Field_Id('order');
            ?>
"><?php 
            echo $this->t('Order');
            ?>
</label>:
      <select id="<?php 
            echo $this->Get_Field_Id('order');
            ?>
" name="<?php 
            echo $this->Get_Field_Name('order');
            ?>
">
      <option value="ASC" <?php 
            Selected($this->get_option('order'), 'ASC');
            ?>
><?php 
            _e('Ascending');
            ?>
</option>
      <option value="DESC" <?php 
            Selected($this->get_option('order'), 'DESC');
            ?>
><?php 
            _e('Descending');
            ?>
</option>
      </select>
    </p>

    <?php 
        }
Ejemplo n.º 2
0
    function Print_Taxonomy_Archive_Urls($tag, $taxonomy)
    {
        $taxonomy = Get_Taxonomy($taxonomy);
        $archive_url = Get_Term_Link(get_term($tag->term_id, $taxonomy->name));
        $archive_feed = Get_Term_Feed_Link($tag->term_id, $taxonomy->name);
        ?>
    <tr class="form-field">
      <th scope="row" valign="top"><?php 
        echo I18n::t('Archive Url');
        ?>
</th>
      <td>
        <a href="<?php 
        echo $archive_url;
        ?>
" target="_blank"><?php 
        echo $archive_url;
        ?>
</a><br>
        <span class="description"><?php 
        PrintF(I18n::t('This is the URL to the archive of this %s.'), $taxonomy->labels->singular_name);
        ?>
</span>
      </td>
    </tr>
    <tr class="form-field">
      <th scope="row" valign="top"><?php 
        echo I18n::t('Archive Feed');
        ?>
</th>
      <td>
        <a href="<?php 
        echo $archive_feed;
        ?>
" target="_blank"><?php 
        echo $archive_feed;
        ?>
</a><br>
        <span class="description"><?php 
        PrintF(I18n::t('This is the URL to the feed of the archive of this %s.'), $taxonomy->labels->singular_name);
        ?>
</span>
      </td>
    </tr>
    <?php 
    }