2 define('AT_INCLUDE_PATH', '../../include/');
3 require (AT_INCLUDE_PATH.'vitals.inc.php');
4 admin_authenticate(AT_ADMIN_PRIV_PHPDOC);
5 $_custom_css = $_base_path . 'mods/phpdoc2/module.css'; // use a custom stylesheet
7 if (!function_exists('version_compare'))
9 print "phpDocumentor requires PHP version 4.1.0 or greater to function";
13 // Find out if we are submitting and if we are, send it
14 // This code originally by Joshua Eichorn on phpdoc.php
16 if (isset($_GET['dataform']) && empty($_REQUEST['altuserdir'])) {
17 foreach ($_GET as $k=>$v) {
18 if (strpos( $k, 'setting_' ) === 0) {
19 $_GET['setting'][substr( $k, 8 )] = $v;
24 $_GET['setting']['output'] = 'HTML:frames:DOM/earthli'; //Theme
25 $_GET['setting']['directory'] = AT_INCLUDE_PATH; //Source codes location, use "include/"
26 $_GET['setting']['defaultpackagename'] = 'ATutor '.VERSION; //ATutor package
28 //Check if the directory is writable, if not, halt.
29 if (!(is_dir($_GET['setting']['target']) && is_writable($_GET['setting']['target']))) {
30 $msg->addError(array('API_NOT_WRITABLE', $_GET['setting']['target'], "directory", "apidoc"));
31 header("Location: api_install.php");
33 } elseif(!(is_file($_GET['setting']['target'].'/index.html') && is_writable($_GET['setting']['target'].'/index.html'))) {
34 //Check if the index.html file is writable
35 $msg->addError(array('API_NOT_WRITABLE', $_GET['setting']['target'].'/index.html', "file", "index.html"));
36 header("Location: api_install.php");
39 //Output api convertion steps
40 require (AT_INCLUDE_PATH.'header.inc.php');
41 echo "<strong>Parsing Files ...</strong><br/>";
43 echo "<div id='api_process_box'><pre>\n";
45 include("PhpDocumentor/phpDocumentor/phpdoc.inc");
46 echo "</pre></div>\n";
47 echo "<strong>Operation Completed!!</strong> <a href=\"mods/phpdoc2/".$_GET['setting']['target']."\" target=\"atutor_api\">View API Here</a>.";
48 require (AT_INCLUDE_PATH.'footer.inc.php');
54 // set up include path so we can find all files, no matter what
55 $GLOBALS['_phpDocumentor_install_dir'] = dirname(dirname(realpath(__FILE__)));
59 * common file information
61 include_once("PhpDocumentor/phpDocumentor/common.inc.php");
62 // add my directory to the include path, and make it first, should fix any errors
63 if (substr(PHP_OS, 0, 3) == 'WIN')
65 ini_set('include_path',$GLOBALS['_phpDocumentor_install_dir'].';'.ini_get('include_path'));
67 ini_set('include_path',$GLOBALS['_phpDocumentor_install_dir'].':'.ini_get('include_path'));
69 // find the .ini directory by parsing phpDocumentor.ini and extracting _phpDocumentor_options[userdir]
70 $ini = phpDocumentor_parse_ini_file($_phpDocumentor_install_dir . PATH_DELIMITER . 'phpDocumentor.ini', true);
71 if (isset($ini['_phpDocumentor_options']['userdir']))
73 $configdir = $ini['_phpDocumentor_options']['userdir'];
75 $configdir = $_phpDocumentor_install_dir . '/user';
79 /* Template starts here */
80 require (AT_INCLUDE_PATH.'header.inc.php'); ?>
81 <div id="phpdoc2_installer">
82 <form name="dataForm" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="GET">
84 <tr><td class="title"><label for="setting_title">API Title: </label></td>
85 <td><input type="text" name="setting_title" id="setting_title" value="<?php echo 'ATutor '.VERSION; ?>" size="40" /></td></tr>
86 <tr><td class="title"><label for="setting_target">Save to... (relative path is allowed): </label></td>
87 <td><input type="text" name="setting_target" id="setting_target" value="apidoc" size="40" /></td></tr>
88 <tr><td class="title"><label for="setting_ignore">These files will be ignored: </label></td>
89 <td><input type="text" name="setting_ignore" id="setting_ignore" value="*.svn" size="40" /></td></tr>
91 <td><input class="buttons" type="SUBMIT" value="Go" name="submitButton" /></td>
94 <input type="hidden" name="dataform" value="true">
97 <p>This feature is provided by <a href="http://www.phpdoc.org/" target="phpdoc">phpDocumentor 1.4.1</a>.</p>
101 <?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>