Exemplo n.º 1
0
/**
 * bp_album_picture_title()
 *
 * @version 0.1.8.12
 * @since 0.1.8.0
 */
function bp_album_picture_title()
{
    echo bp_album_get_picture_title();
}
/**
 * bp_album_screen_edit_content()
 *
 * @version 0.1.8.12
 * @since 0.1.8.0
 */
function bp_album_screen_edit_content()
{
    global $bp;
    if (bp_album_has_pictures()) {
        bp_album_the_picture();
        $limit_info = bp_album_limits_info();
        $priv_str = array(0 => __('Public', 'bp-album'), 2 => __('Registered members', 'bp-album'), 4 => __('Only friends', 'bp-album'), 6 => __('Private', 'bp-album'), 10 => __('Hidden (admin only)', 'bp-album'));
        ?>

	<form method="post" enctype="multipart/form-data" name="bp-album-edit-form" id="bp-album-edit-form" class="standard-form">
    <img id="picture-edit-thumb" src='<?php 
        bp_album_picture_thumb_url();
        ?>
' />
    <p>
	<label><?php 
        _e('Picture Title *', 'bp-album');
        ?>
<br />
	<input type="text" name="title" id="picture-title" size="100" value="<?php 
        echo empty($_POST['title']) ? bp_album_get_picture_title() : wp_filter_kses($_POST['title']);
        ?>
"/></label>
    </p>
    <p>
	<label><?php 
        _e('Picture Description', 'bp-album');
        ?>
<br />
	<textarea name="description" id="picture-description" rows="15"cols="40" ><?php 
        echo empty($_POST['description']) ? bp_album_get_picture_desc() : wp_filter_kses($_POST['description']);
        ?>
</textarea></label>
    </p>
    <p>
	<label><?php 
        _e('Visibility', 'bp-album');
        ?>
</label>

			<?php 
        foreach ($priv_str as $k => $str) {
            if ($limit_info[$k]['enabled']) {
                ?>

			<label><input type="radio" name="privacy" value="<?php 
                echo $k;
                ?>
" <?php 
                if ($limit_info[$k]['current']) {
                    echo 'checked="checked" ';
                }
                if (!$limit_info[$k]['current'] && !$limit_info[$k]['remaining']) {
                    echo 'disabled="disabled" />' . $str . ' ' . __('(limit reached)', 'bp-album');
                } else {
                    echo '/>' . $str;
                }
                ?>
</label>

			<?php 
            }
        }
        ?>
    </p>
    <?php 
        if (bp_is_active('activity') && $bp->album->bp_album_enable_comments) {
            ?>
    <p>
	<label><?php 
            _e('Picture activity and comments', 'bp-album');
            ?>
</label>
			<label><input type="radio" name="enable_comments" value="1" checked="checked" /><?php 
            _e('Enable', 'bp-album');
            ?>
</label>
			<label><input type="radio" name="enable_comments" value="0" /><?php 
            _e('Disable', 'bp-album');
            ?>
</label>
			<?php 
            _e('If the picture already has comments this will delete them', 'bp-album');
            ?>
    </p>
    <?php 
        }
        ?>
    <input type="submit" name="submit" id="submit" value="<?php 
        _e('Save', 'bp-album');
        ?>
"/>

		<?php 
        // This is very important, don't leave it out.
        wp_nonce_field('bp-album-edit');
        ?>
	</form>
	<?php 
    } else {
        ?>
		<p><?php 
        _e("Either this url is not valid or you can't edit this picture.", 'bp-album');
        ?>
</p>
	<?php 
    }
}