コード例 #1
0
?>
><?php 
_e("DESC", "file-gallery");
?>
</option>
					</select>
				</p>
			
				<p>
					<label for="file_gallery_template"><?php 
_e("template", "file-gallery");
?>
:</label>
					<select name="file_gallery_template" id="file_gallery_template">
						<?php 
$file_gallery_templates = file_gallery_get_templates('main-form');
foreach ($file_gallery_templates as $template_name) {
    $templates_dropdown .= "<option value=\"" . $template_name . "\"";
    if ($file_gallery_options["default_template"] == $template_name) {
        $templates_dropdown .= ' selected="selected"';
    }
    $templates_dropdown .= ">" . $template_name . "</option>\n";
}
echo $templates_dropdown;
?>
					</select>
				</p>
				
				<p>
					<label for="file_gallery_galleryclass"><?php 
_e("gallery class", "file-gallery");
コード例 #2
0
/**
 * Creates select option dropdowns
 *
 * @since 1.7
 */
function file_gallery_dropdown($name, $type)
{
    $output = '';
    $options = get_option('file_gallery');
    $current = $options[$name];
    if ('image_size' == $type) {
        $keys['image_size'] = file_gallery_get_intermediate_image_sizes();
    }
    if ('template' == $type) {
        $keys['template'] = file_gallery_get_templates('file_gallery_dropdown');
    }
    $keys['align'] = array('none' => __('none', 'file-gallery'), 'left' => __('left', 'file-gallery'), 'right' => __('right', 'file-gallery'), 'center' => __('center', 'file-gallery'));
    $keys['linkto'] = array("none" => __("nothing (do not link)", "file-gallery"), "file" => __("file", "file-gallery"), "attachment" => __("attachment page", "file-gallery"), "parent_post" => __("parent post", "file-gallery"), "external_url" => __("external url", "file-gallery"));
    $keys['orderby'] = array("default" => __("file gallery", "file-gallery"), "rand" => __("random", "file-gallery"), "menu_order" => __("menu order", "file-gallery"), "post_title" => __("title", "file-gallery"), "ID" => __("date / time", "file-gallery"));
    $keys['order'] = array("ASC" => __("ascending", "file-gallery"), "DESC" => __("descending", "file-gallery"));
    $keys['align'] = array("none" => __("none", "file-gallery"), "left" => __("left", "file-gallery"), "right" => __("right", "file-gallery"), "center" => __("center", "file-gallery"));
    $keys['columns'] = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
    if ('image_size' == $type) {
        $output .= '<option value="thumbnail"';
        if ($current == 'thumbnail') {
            $output .= ' selected="selected"';
        }
        $output .= '>' . __('thumbnail', 'file-gallery') . '</option>';
        $output .= '<option value="medium"';
        if ($current == 'medium') {
            $output .= ' selected="selected"';
        }
        $output .= '>' . __('medium', 'file-gallery') . '</option>';
        $output .= '<option value="large"';
        if ($current == 'large') {
            $output .= ' selected="selected"';
        }
        $output .= '>' . __('large', 'file-gallery') . '</option>';
        $output .= '<option value="full"';
        if ($current == 'full') {
            $output .= ' selected="selected"';
        }
        $output .= '>' . __('full', 'file-gallery') . '</option>';
    }
    foreach ($keys[$type] as $name => $description) {
        if (is_numeric($name)) {
            $name = $description;
        }
        if ('image_size' == $type && in_array($name, array('thumbnail', 'medium', 'large', 'full'))) {
            continue;
        }
        $output .= '<option value="' . $name . '"';
        if ($current == $name) {
            $output .= ' selected="selected"';
        }
        $output .= '>' . $description . '</option>';
    }
    return $output;
}