| 1 |
<?php |
| 2 |
/** |
| 3 |
* groups-admin-tree-view.php |
| 4 |
* |
| 5 |
* Copyright (c) "kento" Karim Rahimpur www.itthinx.com |
| 6 |
* |
| 7 |
* This code is released under the GNU General Public License. |
| 8 |
* See COPYRIGHT.txt and LICENSE.txt. |
| 9 |
* |
| 10 |
* This code is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
* GNU General Public License for more details. |
| 14 |
* |
| 15 |
* This header and all notices must be kept intact. |
| 16 |
* |
| 17 |
* @author Karim Rahimpur |
| 18 |
* @package groups |
| 19 |
* @since groups 1.0.0 |
| 20 |
*/ |
| 21 |
|
| 22 |
/** |
| 23 |
* Tree view : a simple tree view |
| 24 |
*/ |
| 25 |
function groups_admin_tree_view() { |
| 26 |
|
| 27 |
global $wpdb; |
| 28 |
|
| 29 |
$output = ''; |
| 30 |
$today = date( 'Y-m-d', time() ); |
| 31 |
|
| 32 |
if ( !current_user_can( GROUPS_ACCESS_GROUPS ) ) { |
| 33 |
wp_die( __( 'Access denied.', GROUPS_PLUGIN_DOMAIN ) ); |
| 34 |
} |
| 35 |
|
| 36 |
$output .= |
| 37 |
'<div class="groups-tree-view">' . |
| 38 |
'<div>' . |
| 39 |
'<h2>' . |
| 40 |
__( 'Tree of Groups', GROUPS_PLUGIN_DOMAIN ) . |
| 41 |
'</h2>' . |
| 42 |
'</div>'; |
| 43 |
|
| 44 |
$tree = Groups_Utility::get_group_tree(); |
| 45 |
$tree_output = ''; |
| 46 |
Groups_Utility::render_group_tree( $tree, $tree_output ); |
| 47 |
$output .= $tree_output; |
| 48 |
|
| 49 |
$output .= '</div>'; // .groups-overview |
| 50 |
$output .= '</div>'; // .manage-groups |
| 51 |
|
| 52 |
echo $output; |
| 53 |
Groups_Help::footer(); |
| 54 |
} // function groups_admin_tree_view() |
| 55 |
?> |