Exemplo n.º 1
0
    static function DisplayUploadPresets($prefix, $cat_select = true)
    {
        $defaults = array('display_name' => '', 'category' => 0, 'tags' => '', 'description' => '', 'version' => '', 'author' => '', 'license' => '', 'post_id' => 0, 'languages' => '', 'offline' => 0, 'user_roles' => '', 'direct_linking' => 1, 'platforms' => '', 'requirements' => '');
        ?>
	
<table class="form-table">
	
<?php 
        if ($cat_select) {
            ?>
<tr class="form-field">
	<th scope="row"><label for="batch_category"><?php 
            _e('Category');
            ?>
</label></th>
	<td><select name="file_category" id="<?php 
            echo $prefix;
            ?>
_category" class="wpfb-cat-select">
		<?php 
            echo WPFB_Output::CatSelTree(array('selected' => $defaults['category'], 'add_cats' => true));
            ?>
	</select>
	</td>
</tr>
<?php 
        }
        ?>

<tr class="form-field">
	<th scope="row"><label for="batch_tags"><?php 
        _e('Tags');
        ?>
</label></th>
	<td><input name="file_tags" id="<?php 
        echo $prefix;
        ?>
_tags" type="text" value="<?php 
        echo esc_attr(trim($defaults['tags'], ','));
        ?>
" maxlength="250" autocomplete="off" /></td>
</tr>

<tr class="form-field">
	<th scope="row"><label for="batch_description"><?php 
        _e('Description');
        ?>
</label></th>
	<td><textarea name="file_description" id="<?php 
        echo $prefix;
        ?>
_description" rows="2"><?php 
        echo esc_html($defaults['description']);
        ?>
</textarea></td>
</tr>

<tr class="form-field">
	<th scope="row"><label for="batch_author"><?php 
        _e('Author');
        ?>
</label></th>
	<td><input name="file_author" id="<?php 
        echo $prefix;
        ?>
_author" type="text" value="<?php 
        echo esc_attr($defaults['author']);
        ?>
" /></td>
</tr>
	
<?php 
        if (WPFB_Core::$settings->licenses) {
            ?>
<tr class="form-field">
	<th scope="row"><label for="batch_license"><?php 
            _e('License', 'wp-filebase');
            ?>
</label></th>
	<td><select id="<?php 
            echo $prefix;
            ?>
_license" name="file_license"><?php 
            echo WPFB_Admin::MakeFormOptsList('licenses', $defaults['license'], true);
            ?>
</select></td>
</tr>
<?php 
        }
        ?>

<tr class="form-field">
	<th scope="row"><label for="<?php 
        echo $prefix;
        ?>
_post_id"><?php 
        _e('Attach to Post', 'wp-filebase');
        ?>
</label></th>
	<td>ID: <input type="text" name="file_post_id" class="num" style="width:60px; text-align:right;" id="<?php 
        echo $prefix;
        ?>
_post_id" value="<?php 
        echo esc_attr($defaults['post_id']);
        ?>
" />
	<span id="<?php 
        echo $prefix;
        ?>
_post_title" style="font-style:italic;"><?php 
        if ($defaults['post_id'] > 0) {
            echo get_the_title($defaults['post_id']);
        }
        ?>
</span>
	<a href="javascript:;" class="button" onclick="WPFB_PostBrowser('<?php 
        echo $prefix;
        ?>
_post_id', '<?php 
        echo $prefix;
        ?>
_post_title');"><?php 
        _e('Select');
        ?>
</a></td>
</tr>

<tr>
	<td></td>
	<td><input type="checkbox" name="file_offline" id="<?php 
        echo $prefix;
        ?>
_offline" value="1" <?php 
        checked('1', $defaults['offline']);
        ?>
 />
	<label for="<?php 
        echo $prefix;
        ?>
_offline" style="display: inline;"><?php 
        _e('Don\'t publish uploaded files (set offline)', 'wp-filebase');
        ?>
</label></td>
</tr>

<?php 
        /*ADV_BATCH_UPLOADER*/
        ?>

</table>
	<?php 
    }
Exemplo n.º 2
0
    } else {
        ?>
<th></th><td></td><?php 
    }
    ?>
	</tr>
	<tr>
	<?php 
    if (WPFB_Core::$settings->languages) {
        ?>
		<th scope="row" valign="top"><label for="file_languages[]"><?php 
        _e('Languages');
        ?>
</label></th>
		<td  class="form-field"><select name="file_languages[]" size="40" multiple="multiple" id="file_languages[]" style="height: 80px;"><?php 
        echo WPFB_Admin::MakeFormOptsList('languages', $file ? $file->file_language : null, true);
        ?>
</select></td>
		<?php 
    } else {
        ?>
<th></th><td></td><?php 
    }
    ?>
		
		<th scope="row" valign="top"><label for="file_direct_linking"><?php 
    _e('Direct linking', WPFB);
    ?>
</label></th>
		<td>
			<fieldset><legend class="hidden"><?php