示例#1
0
        echo $caption;
        ?>
</span>

      <input type="radio" <?php 
        Checked(isset($arr_role['capabilities'][$capability]));
        Disabled(True);
        ?>
 >
      <label for=""><?php 
        _e('Yes');
        ?>
</label>

      <input type="radio" <?php 
        Checked(!isset($arr_role['capabilities'][$capability]));
        Disabled(True);
        ?>
 >
      <label for=""><?php 
        _e('No');
        ?>
</label>
    </div>

  <?php 
    }
    ?>

<?php 
}
示例#2
0
    function Form($settings)
    {
        # Load options
        $this->load_options($settings);
        unset($settings);
        ?>
    <p style="color:green"><?php 
        $this->core->mocking_bird->Pro_Notice('widget');
        ?>
</p>

    <p>
      <label for="<?php 
        echo $this->Get_Field_Id('title');
        ?>
"><?php 
        _e('Title:');
        ?>
</label>
      <input type="text" id="<?php 
        echo $this->Get_Field_Id('title');
        ?>
" name="<?php 
        echo $this->Get_Field_Name('title');
        ?>
" value="<?php 
        echo Esc_Attr($this->Get_Option('title'));
        ?>
" class="widefat">
      <small><?php 
        echo $this->t('Leave blank to use the widget default title.');
        ?>
</small>
    </p>

    <p>
      <label for="<?php 
        echo $this->Get_Field_Id('limit');
        ?>
"><?php 
        echo $this->t('Number of Images:');
        ?>
</label>
      <input type="number" id="<?php 
        echo $this->Get_Field_Id('limit');
        ?>
" name="<?php 
        echo $this->Get_Field_Name('limit');
        ?>
" value="<?php 
        echo Esc_Attr($this->Get_Option('limit'));
        ?>
" class="widefat">
      <small><?php 
        echo $this->t('Leave blank (or "0") to show all.');
        ?>
</small>
    </p>

    <p>
      <label for="<?php 
        echo $this->Get_Field_Id('link_target');
        ?>
"><?php 
        echo $this->t('Link target:');
        ?>
</label>
      <select name="<?php 
        echo $this->Get_Field_Name('link_target');
        ?>
" id="<?php 
        echo $this->Get_Field_Id('link_target');
        ?>
" class="widefat">
        <option value="file" <?php 
        Selected($this->Get_Option('link_target'), 'file');
        ?>
><?php 
        echo $this->t('Fullsize Image');
        ?>
</option>
        <option value="gallery" <?php 
        Selected($this->Get_Option('link_target'), 'gallery');
        ?>
><?php 
        echo $this->t('Image Gallery');
        ?>
</option>
      </select>
    </p>

    <p>
      <label for="<?php 
        echo $this->Get_Field_Id('thumb_width');
        ?>
"><?php 
        echo $this->t('Thumbnail width:');
        ?>
</label>
      <input type="number" name="<?php 
        echo $this->Get_Field_Name('thumb_width');
        ?>
" id="<?php 
        echo $this->Get_Field_Id('thumb_width');
        ?>
" value="<?php 
        echo Esc_Attr($this->Get_Option('thumb_width'));
        ?>
" <?php 
        Disabled(True);
        ?>
 > px
    </p>

    <p>
      <label for="<?php 
        echo $this->Get_Field_Id('thumb_height');
        ?>
"><?php 
        echo $this->t('Thumbnail height:');
        ?>
</label>
      <input type="number" name="<?php 
        echo $this->Get_Field_Name('thumb_height');
        ?>
" id="<?php 
        echo $this->Get_Field_Id('thumb_height');
        ?>
" value="<?php 
        echo Esc_Attr($this->Get_Option('thumb_height'));
        ?>
" <?php 
        Disabled(True);
        ?>
 > px
    </p>

    <p>
      <input type="checkbox" name="<?php 
        echo $this->Get_Field_Name('thumb_grayscale');
        ?>
" id="<?php 
        echo $this->Get_Field_Id('thumb_grayscale');
        ?>
" value="yes" <?php 
        Disabled(True);
        ?>
  >
      <label for="<?php 
        echo $this->Get_Field_Id('thumb_grayscale');
        ?>
"><?php 
        echo $this->t('Convert thumbnails to grayscale.');
        ?>
</label>
    </p>

    <p>
      <input type="checkbox" name="<?php 
        echo $this->Get_Field_Name('thumb_negate');
        ?>
" id="<?php 
        echo $this->Get_Field_Id('thumb_negate');
        ?>
" value="yes" <?php 
        Disabled(True);
        ?>
 >
      <label for="<?php 
        echo $this->Get_Field_Id('thumb_negate');
        ?>
"><?php 
        echo $this->t('Negate the thumbnails.');
        ?>
</label>
    </p>

    <h3><?php 
        echo $this->t('Template');
        ?>
</h3>
    <p><?php 
        echo $this->t('Please choose a template to display this widget.');
        ?>
</p>
    <?php 
        foreach ($this->core->Get_Template_Files() as $name => $properties) {
            ?>
    <p>
      <input type="radio" name="<?php 
            echo $this->Get_Field_Name('template');
            ?>
" id="<?php 
            echo Sanitize_Title($properties['name']);
            ?>
" value="<?php 
            echo Esc_Attr($properties['file']);
            ?>
"
        <?php 
            Checked($this->Get_Option('template'), $properties['file']);
            ?>
        <?php 
            Checked(!$this->Get_Option('template') && $properties['file'] == $this->core->Get_Default_Template());
            ?>
 >
      <label for="<?php 
            echo Sanitize_Title($properties['name']);
            ?>
">
      <?php 
            if (empty($properties['name'])) {
                ?>
        <em><?php 
                echo $properties['file'];
                ?>
</em>
      <?php 
            } else {
                ?>
        <strong><?php 
                echo $properties['name'];
                ?>
</strong>
      <?php 
            }
            ?>
      </label>
      <?php 
            if ($properties['description']) {
                ?>
<br>
      <?php 
                echo $properties['description'];
            }
            ?>
    </p>
    <?php 
        }
    }