<?php $update = isset($item) && is_object($item) && !empty($item->cat_id); if ($update) { $file_category =& $item; $exform = true; } else { $file_category = new WPFB_Category(); } $action = $update ? 'updatecat' : 'addcat'; $title = $update ? __('Edit Category') : __('Add Category', WPFB); /*def*/ $form_name = $update ? 'editcat' : 'addcat'; $nonce_action = WPFB . "-" . $action . ($update ? $file_category->cat_id : ''); $default_roles = WPFB_Core::$settings->default_roles; $user_roles = $update || empty($default_roles) ? $file_category->GetReadPermissions() : $default_roles; $cat_members_only = !empty($user_roles); $form_action = add_query_arg('page', 'wpfilebase_cats', remove_query_arg(array('cat_id', 'page', 'action'))); ?> <div class="wrap"> <h2><?php echo $title; ?> </h2> <div id="ajax-response"></div> <form enctype="multipart/form-data" method="post" name="<?php echo $form_name; ?> " id="<?php echo $form_name;