*/ if ( !defined( 'WPINC' ) ) { die; } /** * Builds page for editing a activity * * @param string $title Page title * @param string $action Display and name text for primary button * @param array $map Information about the activity * @param string $archive Set to 'archive' to disable all fields, default '' * @return string Page */ function acts_activity_management( $title, $action, $map = null, $archive = '' ) { global $wpdb; $current_url = ( isset($_SERVER['HTTPS']) ? 'https' : 'http' ) . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $current_url = remove_query_arg( 'action', $current_url ); $current_url = remove_query_arg( 'item_id', $current_url ); if ( $map === null ) { $map = array( 'name' => '', 'short_desc' => '', 'long_desc' => '', 'start' => date('Y-m-d'), 'end' => date('Y-m-d'), 'location_id' => '', 'responsible_id' => '', 'members' => array(), 'categories' => array(), 'plan_id' => '' ); } $parent_select = acts_build_select( Activities_Category::get_categories( 'id=>name' ), array( 'name' => 'category_parent', 'blank' => __( 'No Category Parent', 'activities' ) ) ); $disabled = ''; if ( $archive == 'archive' || ( !current_user_can( ACTIVITIES_ADMINISTER_ACTIVITIES ) && !Activities_Responsible::current_user_restricted_edit() ) ) { $disabled = 'disabled'; } $output = '