* @uses file_api.php * @uses form_api.php * @uses html_api.php * @uses lang_api.php * @uses utility_api.php */ require_once 'core.php'; require_api('access_api.php'); require_api('config_api.php'); require_api('file_api.php'); require_api('form_api.php'); require_api('html_api.php'); require_api('lang_api.php'); require_api('utility_api.php'); # Check if project documentation feature is enabled. if (OFF == config_get('enable_project_documentation') || !file_is_uploading_enabled() || !file_allow_project_upload()) { access_denied(); } access_ensure_project_level(config_get('upload_project_file_threshold')); $t_max_file_size = (int) min(ini_get_number('upload_max_filesize'), ini_get_number('post_max_size'), config_get('max_file_size')); html_page_top(); ?> <br /> <div> <form method="post" enctype="multipart/form-data" action="proj_doc_add.php"> <?php echo form_security_field('proj_doc_add'); ?> <table class="width75" cellspacing="1"> <tr>
function print_doc_menu($p_page = '') { $t_documentation_html = config_get('manual_url'); $t_proj_doc_page = 'proj_doc_page.php'; $t_proj_doc_add_page = 'proj_doc_add_page.php'; switch ($p_page) { case $t_documentation_html: $t_documentation_html = ''; break; case $t_proj_doc_page: $t_proj_doc_page = ''; break; case $t_proj_doc_add_page: $t_proj_doc_add_page = ''; break; } print_bracket_link($t_documentation_html, lang_get('user_documentation')); print_bracket_link($t_proj_doc_page, lang_get('project_documentation')); if (file_allow_project_upload()) { print_bracket_link($t_proj_doc_add_page, lang_get('add_file')); } }
/** * Print the menu for the docs section * @param string $p_page specifies the current page name so it's link can be disabled * @return null */ function print_doc_menu($p_page = '') { $t_documentation_html = config_get('manual_url'); $t_pages[$t_documentation_html] = array('url' => $t_documentation_html, 'label' => 'user_documentation'); $t_pages['proj_doc_page.php'] = array('url' => 'proj_doc_page.php', 'label' => 'project_documentation'); if (file_allow_project_upload()) { $t_pages['proj_doc_add_page.php'] = array('url' => 'proj_doc_add_page.php', 'label' => 'add_file'); } # Remove the link from the current page if (isset($t_pages[$p_page])) { $t_pages[$p_page]['url'] = ''; } echo '<div id="doc-menu">'; echo '<ul class="menu">'; foreach ($t_pages as $t_page) { if ($t_page['url'] == '') { echo '<li>', lang_get($t_page['label']), '</li>'; } else { echo '<li><a href="' . helper_mantis_url($t_page['url']) . '">' . lang_get($t_page['label']) . '</a></li>'; } } echo '</ul>'; echo '</div>'; }
/** * MantisBT Core API's */ require_once( 'core.php' ); require_api( 'access_api.php' ); require_api( 'config_api.php' ); require_api( 'file_api.php' ); require_api( 'form_api.php' ); require_api( 'html_api.php' ); require_api( 'lang_api.php' ); require_api( 'utility_api.php' ); # Check if project documentation feature is enabled. if ( OFF == config_get( 'enable_project_documentation' ) || !file_is_uploading_enabled() || !file_allow_project_upload() ) { access_denied(); } access_ensure_project_level( config_get( 'upload_project_file_threshold' ) ); $t_max_file_size = (int)min( ini_get_number( 'upload_max_filesize' ), ini_get_number( 'post_max_size' ), config_get( 'max_file_size' ) ); html_page_top(); ?> <br /> <div> <form method="post" enctype="multipart/form-data" action="proj_doc_add.php"> <?php echo form_security_field( 'proj_doc_add' ) ?> <table class="width75" cellspacing="1">
/** * Print the menu for the documentation section * @param string $p_page Specifies the current page name so it's link can be disabled. * @return void */ function print_doc_menu($p_page = '') { # User Documentation $t_doc_url = config_get('manual_url'); if (is_null(parse_url($t_doc_url, PHP_URL_SCHEME))) { # URL has no scheme, so it is relative to MantisBT root if (is_blank($t_doc_url) || !file_exists(config_get_global('absolute_path') . $t_doc_url)) { # Local documentation not available, use online docs $t_doc_url = 'http://www.mantisbt.org/documentation.php'; } else { $t_doc_url = helper_mantis_url($t_doc_url); } } $t_pages[$t_doc_url] = array('url' => $t_doc_url, 'label' => 'user_documentation'); # Project Documentation $t_pages['proj_doc_page.php'] = array('url' => helper_mantis_url('proj_doc_page.php'), 'label' => 'project_documentation'); # Add File if (file_allow_project_upload()) { $t_pages['proj_doc_add_page.php'] = array('url' => helper_mantis_url('proj_doc_add_page.php'), 'label' => 'add_file'); } # Remove the link from the current page if (isset($t_pages[$p_page])) { $t_pages[$p_page]['url'] = ''; } echo '<div id="doc-menu">'; echo '<ul class="menu">'; foreach ($t_pages as $t_page) { if ($t_page['url'] == '') { echo '<li>', lang_get($t_page['label']), '</li>'; } else { echo '<li><a href="' . $t_page['url'] . '">' . lang_get($t_page['label']) . '</a></li>'; } } echo '</ul>'; echo '</div>'; }