/** * Edit album option * * @global RTMediaQuery $rtmedia_query * * @param array $options * * @return array|void */ function rtmedia_album_edit($options) { if (!is_rtmedia_album() || !is_user_logged_in()) { return; } if (!is_rtmedia_album_enable()) { return; } global $rtmedia_query; if (isset($rtmedia_query->media_query) && isset($rtmedia_query->media_query['album_id']) && !in_array(intval($rtmedia_query->media_query['album_id']), array_map('intval', rtmedia_get_site_option('rtmedia-global-albums')), true)) { if (rtmedia_is_album_editable() || is_rt_admin()) { $options[] = "<a href='edit/' class='rtmedia-edit' title='" . esc_attr__('Edit Album', 'buddypress-media') . "' ><i class='rtmicon dashicons dashicons-edit'></i>" . esc_html__('Edit Album', 'buddypress-media') . '</a>'; $options[] = '<form method="post" class="album-delete-form rtmedia-inline" action="delete/">' . wp_nonce_field('rtmedia_delete_album_' . $rtmedia_query->media_query['album_id'], 'rtmedia_delete_album_nonce') . '<button type="submit" name="album-delete" class="rtmedia-delete-album" title="' . esc_attr__('Delete Album', 'buddypress-media') . '"><i class="dashicons dashicons-trash rtmicon"></i>' . esc_html__('Delete Album', 'buddypress-media') . '</button></form>'; if (is_rtmedia_group_album()) { $album_list = rtmedia_group_album_list(); } else { $album_list = rtmedia_user_album_list(); } if ($album_list) { $options[] = '<a href="#rtmedia-merge" class="rtmedia-reveal-modal rtmedia-modal-link" title="' . esc_attr__('Merge Album', 'buddypress-media') . '"><i class="dashicons dashicons-randomize"></i>' . esc_html__('Merge Album', 'buddypress-media') . '</a>'; } } } return $options; }
"/> <a class="button rtm-button rtm-button-back" href="<?php rtmedia_permalink(); ?> "><?php esc_html_e('Back', 'buddypress-media'); ?> </a> </div> </form> </div> <!--media management tab--> <?php if (!is_rtmedia_group_album()) { ?> <div class="content" id="manage-media-tab"> <?php if (have_rtmedia()) { ?> <form class="rtmedia-album-edit rtmedia-bulk-actions" method="post" name="rtmedia_album_edit"> <?php wp_nonce_field('rtmedia_bulk_delete_nonce', 'rtmedia_bulk_delete_nonce'); ?> <?php RTMediaMedia::media_nonce_generator($rtmedia_query->media_query['album_id']); ?> <p>
function rtmedia_album_edit($options) { if (!is_rtmedia_album() || !is_user_logged_in()) { return; } if (!is_rtmedia_album_enable()) { return; } global $rtmedia_query; ?> <?php if (isset($rtmedia_query->media_query) && isset($rtmedia_query->media_query['album_id']) && !in_array($rtmedia_query->media_query['album_id'], rtmedia_get_site_option('rtmedia-global-albums'))) { //if ( isset ( $rtmedia_query->media_query[ 'media_author' ] ) && get_current_user_id () == $rtmedia_query->media_query[ 'media_author' ] ) { if (rtmedia_is_album_editable() || is_rt_admin()) { $options[] = "<a href='edit/' class='rtmedia-edit' title='" . __('Edit Album', 'rtmedia') . "' ><i class='rtmicon-edit rtmicon-fw'></i>" . __('Edit Album', 'rtmedia') . "</a>"; $options[] = '<form method="post" class="album-delete-form rtmedia-inline" action="delete/">' . wp_nonce_field('rtmedia_delete_album_' . $rtmedia_query->media_query['album_id'], 'rtmedia_delete_album_nonce') . '<button type="submit" name="album-delete" class="rtmedia-delete-album" title="' . __('Delete Album', 'rtmedia') . '"><i class="rtmicon-trash-o rtmicon-fw"></i>' . __('Delete Album', 'rtmedia') . '</button></form>'; if (is_rtmedia_group_album()) { $album_list = rtmedia_group_album_list(); } else { $album_list = rtmedia_user_album_list(); } if ($album_list) { $options[] = '<a href="#rtmedia-merge" class="rtmedia-reveal-modal rtmedia-modal-link" title="' . __('Merge Album', 'rtmedia') . '"><i class="rtmicon-code-fork rtmicon-fw"></i>' . __('Merge Album', 'rtmedia') . '</a>'; } } } return $options; }
/** * Rendering merge album markup * * @global RTMediaQuery $rtmedia_query */ function rtmedia_merge_album_modal() { if (!is_rtmedia_album() || !is_user_logged_in()) { return; } if (!is_rtmedia_album_enable()) { return; } global $rtmedia_query; if (is_rtmedia_group_album()) { $album_list = rtmedia_group_album_list(); } else { $album_list = rtmedia_user_album_list(); } if ($album_list && !empty($rtmedia_query->media_query['album_id'])) { ?> <div class="rtmedia-merge-container rtmedia-popup mfp-hide" id="rtmedia-merge"> <div id="rtm-modal-container"> <h2 class="rtm-modal-title"><?php esc_html_e('Merge Album', 'buddypress-media'); ?> </h2> <form method="post" class="album-merge-form" action="merge/"> <p> <span><?php esc_html_e('Select Album to merge with : ', 'buddypress-media'); ?> </span> <?php echo '<select name="album" class="rtmedia-merge-user-album-list">' . $album_list . '</select>'; // @codingStandardsIgnoreLine ?> </p> <?php wp_nonce_field('rtmedia_merge_album_' . $rtmedia_query->media_query['album_id'], 'rtmedia_merge_album_nonce'); ?> <input type="submit" class="rtmedia-merge-selected" name="merge-album" value="<?php esc_html_e('Merge Album', 'buddypress-media'); ?> "/> </form> </div> </div> <?php } }