/**
 * Handle on prepare project overview event
 *
 * @param NamedList $tabs
 * @param User $logged_user
 * @param Project $project
 * @return null
 */
function files_handle_on_project_tabs(&$tabs, &$logged_user, &$project)
{
    $tabs->add('attachments', array('text' => lang('Attachments'), 'url' => assemble_url('attachments_list', array('project_id' => $project->getId()))));
    if ($logged_user->getProjectPermission('file', $project) >= PROJECT_PERMISSION_ACCESS) {
        $tabs->add('files', array('text' => lang('Files'), 'url' => files_module_url($project)));
    }
    // if
}
 /**
  * Show upload form
  *
  * @param void
  * @return null
  */
 function upload()
 {
     $this->wireframe->page_actions = array();
     // clear page actions
     if (!File::canAdd($this->logged_user, $this->active_project)) {
         $this->httpError(HTTP_ERR_FORBIDDEN);
     }
     // if
     $file_data = array('milestone_id' => $this->request->get('milestone_id'), 'visibility' => $this->active_project->getDefaultVisibility());
     if (instance_of($this->active_category, 'Category')) {
         $file_data['parent_id'] = $this->active_category->getId();
     }
     // if
     js_assign('files_section_url', files_module_url($this->active_project));
     require_once SMARTY_PATH . '/plugins/modifier.filesize.php';
     $this->smarty->assign(array('file_data' => $file_data, 'max_upload_size' => smarty_modifier_filesize(get_max_upload_size()), 'upload_single_file_url' => assemble_url('project_files_upload_single', array('project_id' => $this->active_project->getId()))));
 }