function clearbase_parse_url($parts = array(), $url = '') { if (empty($url)) { $url = clearbase_current_url(); } $url = parse_url($url); $scheme = in_array('scheme', $parts) && isset($url['scheme']) ? $url['scheme'] . '://' : ''; $host = in_array('host', $parts) && isset($url['host']) ? $url['host'] : ''; $port = in_array('port', $parts) && isset($url['port']) ? ':' . $url['port'] : ''; $user = in_array('user', $parts) && isset($url['user']) ? $url['user'] : ''; $pass = in_array('pass', $parts) && isset($url['pass']) ? ':' . $url['pass'] : ''; $pass = $user || $pass ? "{$pass}@" : ''; $path = in_array('path', $parts) && isset($url['path']) ? $url['path'] : ''; $query = in_array('query', $parts) && isset($url['query']) ? '?' . $url['query'] : ''; $fragment = in_array('fragment', $parts) && isset($url['fragment']) ? '#' . $url['fragment'] : ''; return "{$scheme}{$user}{$pass}{$host}{$port}{$path}{$query}{$fragment}"; }
protected function render_subfolder_actions($post) { $actions = array(); if (current_user_can('edit_post', $post->ID) && !$this->is_trash) { $actions['edit'] = '<a href="' . clearbase_workspace_url(array('id' => $post->ID, 'cbaction' => 'edit', 'back' => clearbase_current_url(true))) . '" title="' . __('Edit Folder', 'clearbase') . '">' . __('Edit', 'clearbase') . '</a>'; } if (clearbase_get_value($this->is_parent_settings ? 'allow_nesting' : 'allow_child_nesting', true, $this->settings)) { $actions['move'] = "<a class='move-post' title='" . esc_attr__('Move this folder to another folder', 'clearbase') . "' href='" . clearbase_workspace_url(array('id' => $post->ID, 'cbaction' => 'move', 'cbnonce' => wp_create_nonce('move'))) . "'>" . __('Move', 'clearbase') . "</a>"; } if (current_user_can('delete_post', $post->ID)) { $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__('Delete this folder permanently') . "' href='" . clearbase_workspace_url(array('id' => $post->ID, 'cbaction' => 'delete', 'cbnonce' => wp_create_nonce('delete'))) . "'>" . __('Delete', 'clearbase') . "</a>"; //MEDIA LIST VIEW NOT WORKING } $actions = apply_filters("clearbase_{$this->ID()}_subfolder_actions", $actions, $post); $action_count = count($actions); if (!$action_count) { return; } $i = 0; ?> <div class="folder-actions-container"> <div class="folder-actions"> <?php foreach ($actions as $action => $link) { ++$i == $action_count ? $sep = '' : ($sep = ' | '); echo "<span class='{$action}'>{$link}{$sep}</span>"; } ?> </div> </div> <?php }