Exemplo n.º 1
0
// used each pref (and permission name too)
//
$ourFileName = "dump/prefreport.txt";
require_once 'tiki-setup.php';
require_once 'lib/prefslib.php';
$defaultValues = get_default_prefs();
$fields = array('preference' => '', 'name' => '', 'description' => '', 'default' => '', 'help' => '', 'hard_to_search' => false, 'duplicate_name' => 0, 'duplicate_description' => 0, 'word_count' => 0, 'filter' => '', 'locations' => '', 'dependencies' => '', 'type' => '', 'options' => '', 'admin' => '', 'module' => '', 'view' => '', 'permission' => '', 'plugin' => '', 'extensions' => '', 'tags' => '', 'parameters' => '', 'detail' => '', 'warning' => '', 'hint' => '', 'shorthint' => '', 'perspective' => '', 'separator' => '');
$stopWords = array('', 'in', 'and', 'a', 'to', 'be', 'of', 'on', 'the', 'for', 'as', 'it', 'or', 'with', 'by', 'is', 'an');
$data = array();
error_reporting(E_ALL);
ini_set('display_errors', 'on');
$data = collect_raw_data($fields);
remove_fake_descriptions($data);
set_default_values($data, $defaultValues);
collect_locations($data);
$index = array('name' => index_data($data, 'name'), 'description' => index_data($data, 'description'));
update_search_flag($data, $index, $stopWords);
$ourFileHandle = fopen($ourFileName, 'w+') or die("can't open file");
// Output results
fputcsv($ourFileHandle, array_keys($fields), '|');
foreach ($data as $values) {
    fputcsv($ourFileHandle, array_values($values), '|');
}
fclose($ourFileHandle);
/**
 * @param $fields
 * @return array
 */
function collect_raw_data($fields)
{
    $data = array();
Exemplo n.º 2
0
function main()
{
    global $current_page;
    ob_start();
    index_header();
    if (isset($_GET['message'])) {
        echo '<p class="notice">' . htmlspecialchars($_GET['message'], ENT_COMPAT, 'utf-8') . '</p>';
    }
    if (!isset($_SESSION['user_id'])) {
        if (!isset($_GET['openid_mode']) || $_GET['openid_mode'] == 'cancel') {
            return index_login();
        } else {
            return index_openid_callback();
        }
    } else {
        if (isset($_GET['logout'])) {
            return index_api_logout();
        }
        index_login_status();
        index_navigation();
        switch ($current_page) {
            case 'account':
                index_account();
                break;
            case 'events':
                index_events();
                break;
            case 'data':
                index_data();
                break;
            case 'keys':
            default:
                index_api_keys();
                break;
        }
    }
    index_footer();
}