$relPath = '../pinc/';
include_once $relPath . 'base.inc';
include_once $relPath . 'maybe_mail.inc';
include_once $relPath . 'stages.inc';
include_once $relPath . 'slim_header.inc';
include_once $relPath . 'access_log.inc';
include_once $relPath . 'SettingsClass.inc';
require_login();
$stage_id = @$_GET['stage_id'];
if (empty($stage_id)) {
    die("parameter 'stage_id' is empty");
}
$stage = get_Stage_for_id($stage_id);
$title = sprintf(_('Requesting access to "%s"'), $stage->name);
slim_header($title);
echo "<h2>{$title}</h2>\n";
$email_addr = $promotion_requests_email_addr;
echo "<p>";
echo sprintf(_('(In case of problems, please send email to %s.)'), $email_addr);
echo "</p>";
$uao = $stage->user_access($pguser);
// echo "<pre>"; var_dump($uao); echo "</pre>";
echo "<p>";
if ($uao->can_access) {
    echo _('You already have access to this stage.');
} else {
    switch ($uao->request_status) {
        case 'sat-unneeded':
        case 'sat-granted':
        case 'unsat-granted':
?frame=right">
</frameset>
<noframes>
<?php 
    echo _("Your browser currently does not display frames!");
    ?>
</noframes>
<?php 
    exit;
}
// now load data in the left frame
if ($frame == "left") {
    // get all projects for this PM
    $projects = _get_projects_for_pm($pm);
    $submitLabel = _("Add selected words to Good Words List");
    slim_header(_("Manage Suggestions"));
    // how many instances (ie: frequency sections) are there?
    $instances = count($projects) + 1;
    // what are the cutoff options?
    $cutoffOptions = array(1, 2, 3, 4, 5, 10, 25, 50);
    // what is the initial cutoff frequency?
    $initialFreq = getInitialCutoff($freqCutoff, $cutoffOptions);
    // echo page support text, like JS and stylesheets
    echo_cutoff_script($cutoffOptions, $instances);
    echo_word_freq_style();
    echo "<h1>" . _("Manage Suggestions") . "</h1>";
    echo "<p><a href='{$code_url}/tools/project_manager/projectmgr.php' target='_TOP'>" . _("Return to the PM page") . "</a></p>";
    echo "<form action='" . attr_safe($_SERVER['PHP_SELF']) . "' method='get'>";
    echo "<input type='hidden' name='frame' value='left'>";
    echo "<p>";
    if (user_is_a_sitemanager() || user_is_proj_facilitator()) {
<input type="hidden" name="round_id" value="<?php 
        echo $round_id;
        ?>
">
<input type="hidden" name="frame" value="image">
<input type="submit" value="<?php 
        echo _("Resize");
        ?>
" size="3">
</form>
<?php 
        echo "<img src='{$projects_url}/{$projectid}/{$page}' width='{$width}' border='1'>";
    }
    exit;
} elseif ($frame == "text") {
    slim_header(_("Text Frame"));
    if (!count($error_messages)) {
        if ($round_id == "OCR") {
            $text_column_name = 'master_text';
        } else {
            $round = get_Round_for_round_id($round_id);
            if (is_null($round)) {
                die("unexpected parameter round_id = '{$round_id}'");
            }
            $text_column_name = $round->text_column_name;
        }
        $result = mysql_query(sprintf("SELECT {$text_column_name} FROM {$projectid} WHERE image = '%s'", mysql_real_escape_string($page)));
        $data = mysql_result($result, 0, $text_column_name);
        // Use the font and wrap prefs for the user's default interface layout,
        // since they're more likely to have set those prefs
        if ($userP['i_layout'] == 1) {
Example #4
0
if ($expected_state != $project->state) {
    slim_header($project->nameofwork);
    echo "<p>";
    echo sprintf('Warning: Project "%1$s" is no longer in state "%2$s"; it is now in state "%3$s".', $project->nameofwork, $expected_state_text, project_states_text($project->state));
    echo "</p>\n";
    $expected_round = get_Round_for_project_state($expected_state);
    echo "<p>";
    echo sprintf(_('Back to <a href="%s">%s</a>'), "{$code_url}/tools/proofers/round.php?round_id={$expected_round->id}", $expected_round->name);
    echo "</p>\n";
    exit;
}
// Check that the project is in a proofable state
list($code, $msg) = $project->can_be_proofed_by_current_user();
if ($code != $project->CBP_OKAY) {
    // I think this can only happen via URL-tweaking.
    slim_header($project->nameofwork);
    echo _("Project") . ": \"{$project->nameofwork}\"<br>\n";
    echo _("State") . ": " . project_states_text($project->state) . "<br>\n";
    echo "<p>{$msg}</p>\n";
    echo "<p>";
    echo sprintf(_("Back to <a href='%s'>Activity Hub</a>"), "{$code_url}/activity_hub.php");
    echo "</p>\n";
    exit;
}
//load the master frameset
// Add name of round before nameofwork
$round = get_Round_for_project_state($project->state);
$nameofwork = "[" . $round->id . "] " . $project->nameofwork;
// Re src="dp_foo.js?YYMMDD##" in the following <script> tags:
// When a JS script file changes, the browser should note this and update its
// cached version. However, it appears that some browsers are not very good
Example #5
0
<?php

$relPath = '../../pinc/';
include_once $relPath . 'base.inc';
include_once $relPath . 'slim_header.inc';
include_once $relPath . 'quizzes.inc';
// get_quiz_page_id_param
$quiz_page_id = get_quiz_page_id_param($_REQUEST, 'quiz_page_id');
include './quiz_page.inc';
// qp_page_image_path
slim_header("", array('css_data' => 'body { background-color: #ffffff; }'));
echo "<img src='" . qp_page_image_path() . "' alt=''>";
        # being saved, let the PM know about it.
        if (!count($context_strings)) {
            echo "<p>" . sprintf(_('The word was suggested in round %1$s for page %2$s, but no longer exists in the saved text for that round.'), $round, $page) . "</p>";
            continue;
        }
        echo "<p><b>" . _("Date") . "</b>: " . strftime($datetime_format, $time) . "<br>";
        echo "<b>" . _("Round") . "</b>: {$round} &nbsp; | &nbsp; ";
        echo "<b>" . _("Proofreader") . "</b>: " . private_message_link($proofer) . "<br>";
        echo "<b>" . _("Page") . "</b>: <a href='displayimage.php?project={$projectid}&amp;imagefile={$page}&amp;showreturnlink=0' target='imageframe'>{$page}</a><br>";
        foreach ($context_strings as $lineNum => $context_string) {
            $context_string = _highlight_word(html_safe($context_string, ENT_NOQUOTES), $word);
            echo "<b>" . _("Line") . "</b>: ", sprintf(_('~%1$d of %2$d'), $lineNum, $totalLines), " &nbsp; | &nbsp; ";
            echo "<b>" . _("Context") . "</b>:<br><span class='mono'>{$context_string}</span><br>";
        }
        echo "</p>";
        echo "<hr>";
    }
    exit;
}
if ($frame == "right") {
    slim_header(_("Image Frame"));
    echo "<p>" . _("Select one of the page links to view the page image (scan).") . "</p>";
    exit;
}
function _get_word_context_on_page($projectid, $page, $round, $word)
{
    $lpage = new LPage($projectid, $page, "{$round}.page_saved", 0);
    $page_text = $lpage->get_text();
    return _get_word_context_from_text($page_text, $word);
}
// vim: sw=4 ts=4 expandtab
Example #7
0
<?php

$relPath = "./../../../pinc/";
include_once $relPath . 'base.inc';
include_once $relPath . 'slim_header.inc';
include_once $relPath . 'misc.inc';
// html_safe()
include_once "{$wikihiero_dir}/wh_language.php";
include_once "{$wikihiero_dir}/wikihiero.php";
require_login();
slim_header();
$tables = array("Phoneme", "A", "B", "C", "D", "E", "F", "G", "H", "I", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "Aa", "All");
$syntax = array("-", ":", "*", "!");
?>
<form name="hieroform" method="POST">
<table>
<tr><td rowspan="2">
<textarea name="hierobox" rows="4" cols="30">
<?php 
$hierobox = stripslashes(@$_POST['hierobox']);
echo html_safe($hierobox);
?>
</textarea>
</td><td colspan="2">
<select onChange="window.parent.hierotable.location='table.php?table='+this.value;">
<?php 
echo "<option>" . WH_Text("Tables") . "</option>\n";
echo "<option>----</option>\n";
foreach ($tables as $v) {
    echo "<option value=\"{$v}\">" . (strlen($v) <= 2 ? "{$v} &mdash; " : "") . WH_Text($v) . "</option>\n";
}
include_once $relPath . 'maybe_mail.inc';
include_once $relPath . 'access_log.inc';
include_once $relPath . 'SettingsClass.inc';
include_once $relPath . 'User.inc';
include_once $relPath . 'slim_header.inc';
require_login();
$subject_username = array_get($_POST, 'subject_username', null);
$notify_user = array_get($_POST, 'notify_user', null);
if (check_username($subject_username) != '') {
    die("Invalid parameter subject_username.");
}
list($can_grant, $can_revoke) = user_can_modify_access_of($subject_username);
if (!$can_grant && !$can_revoke) {
    die("Error: you are not permitted to modify the access of user '{$subject_username}'.");
}
slim_header(_("Modify Access"));
echo "subject_username='******'<br>\n";
// so we don't hit them in the following loop
unset($_POST['subject_username']);
unset($_POST['notify_user']);
$actions = array();
foreach ($_POST as $name => $value) {
    echo "<br>\n";
    echo "Considering '{$name}' => '{$value}'<br>\n";
    if ($value != 'on') {
        die("Error: unexpected value in parameter '{$name}' => '{$value}'");
    }
    $a = explode('|', $name);
    if (count($a) != 2) {
        die("Error: bad parameter name '{$name}'");
    }
                    if ($stage == 'smooth_done') {
                        $title = _("Upload smooth read version");
                        $intro_blurb = _("This page allows you to upload a smooth read version of the project.");
                        $submit_button = _("Upload file");
                        $is_file_optional = FALSE;
                        $indicator = "_smooth_done_" . $pguser;
                        $new_state = PROJ_POST_FIRST_CHECKED_OUT;
                        $extras = array();
                        $back_url = "{$code_url}/project.php?id={$projectid}&amp;expected_state={$new_state}";
                        $back_blurb = _("Project Page");
                        $deadline = time() + $weeks * 60 * 60 * 24 * 7;
                    } else {
                        if (!isset($stage)) {
                            // this may be due to a timeout when uploading big files.
                            include_once $relPath . 'slim_header.inc';
                            slim_header(_("Upload failed"));
                            echo "<p>" . _("The upload failed.") . "</p>\n";
                            echo "<p>{$big_upload_blurb}</p>";
                            echo "<p>" . sprintf(_("Please go <a href='%s'>back</a> and try uploading \n        the original again or uploading a smaller placeholder instead."), "javascript:history.back()") . "</p>";
                            exit;
                        } else {
                            echo "Don't know how to handle stage='{$stage}'<br>\n";
                            return;
                        }
                    }
                }
            }
        }
    }
}
if (!isset($action)) {
Example #10
0
<?php

$relPath = '../../pinc/';
include_once $relPath . 'base.inc';
include_once $relPath . 'slim_header.inc';
slim_header(_("Feeds SDK"));
?>

<table border="0" style="border-collapse: collapse" width="100%" id="table1">
<tr>
<td bgcolor="#006699"><b><font face="Arial" color="#FFFFFF">
<a name="top"></a>Distributed 
Proofreaders XML Feeds SDK</font></b></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><font face="Arial" size="2">Revision 1.0 - March 
19th, 2003</font></td>
</tr>
<tr>
<td bgcolor="#D8E4F1"><b><font face="Arial">Contents</font></b></td>
</tr>
</table>

<blockquote>
<p><u><b><a href="#1">1. Overview</a></b></u></p>
<blockquote>
<p><b><a href="#1.1">1.1 XML Overview</a><br>
<u><a href="#1.2">1.2 Sample Uses</a><br>
<a href="#1.3">1.3 Feed Locations</a><br>
<a href="#1.4">1.4 Suggestions &amp; Updates</a></u></b></p>
</blockquote>
Example #11
0
    $table = "";
}
function WH_Text($index)
{
    global $wh_language;
    global $lang;
    if (isset($wh_language[$index])) {
        if (isset($wh_language[$index][$lang])) {
            return $wh_language[$index][$lang];
        } else {
            return $wh_language[$index]["en"];
        }
    }
    return "";
}
slim_header("{$table} - " . WH_Text($table));
?>
<script language="JavaScript" type="text/javascript">
function add(glyph) {
	text=window.parent.hierodisplay.document.hieroform.hierobox.value;
	lastc=text.charCodeAt(text.length-1);
	if((lastc>=48&&lastc<=57)||(lastc>=65 && lastc<=90)||(lastc>=97&&lastc<=122))
		sep='-';
	else
		sep='';
	window.parent.hierodisplay.document.hieroform.hierobox.value+=sep+glyph;
}
</script>
<?php 
if ($dh = opendir("{$wikihiero_dir}/" . WH_IMG_DIR)) {
    while (($file = readdir($dh)) !== false) {
Example #12
0
<?php

$relPath = "./../../pinc/";
include_once $relPath . 'base.inc';
include_once $relPath . 'http_headers.inc';
include_once $relPath . 'slim_header.inc';
include_once $relPath . 'stages.inc';
include_once 'toolbox.inc';
$round_id = get_enumerated_param($_GET, 'round_id', null, array_keys($Round_for_round_id_));
$round = get_Round_for_round_id($round_id);
$header_args = array("css_data" => get_ctrl_page_styles(), "body_attributes" => 'onLoad="top.cRef = top.markRef = document.markform;"');
slim_header(_("Control Frame"), $header_args);
?>
<a
	href="#"
	accesskey="="
	onfocus="top.focusText()"
></a><form
	name="markform"
	id="markform"
	onsubmit="return(false);"
	action="ctrl_frame.php"
><table
	cellpadding="0"
	cellspacing="0"
	align="center"
	width="99%"
	border="0"
><tr><td
	valign="top"
	align="right"
            $prev_image = mysql_result($res, $row - 1, "image");
        }
        if ($row != $num_rows - 1) {
            $next_image = mysql_result($res, $row + 1, "image");
        }
    }
}
$link_tags = "";
if ($prev_image != "" && $preload == "prev") {
    $link_tags .= "<link rel=\"prefetch prev\" href=\"{$projects_url}/{$projectid}/{$prev_image}\">\n";
}
if ($next_image != "" && $preload == "next") {
    $link_tags .= "<link rel=\"prefetch next\" href=\"{$projects_url}/{$projectid}/{$next_image}\">\n";
}
$title = sprintf(_("Display Image: %s"), $imagefile);
slim_header($title, array("head_data" => $link_tags));
?>

<form method="get" action="displayimage.php">
<input type="hidden" name="project" value="<?php 
echo $projectid;
?>
">
<input type="hidden" name="imagefile" value="<?php 
echo $imagefile;
?>
">
<input type="hidden" name="showreturnlink" value="<?php 
echo $showreturnlink;
?>
">
<?php

$relPath = '../../pinc/';
include_once $relPath . 'base.inc';
include_once $relPath . 'Project.inc';
include_once $relPath . 'slim_header.inc';
include_once $relPath . 'misc.inc';
include_once $relPath . 'user_is.inc';
require_login();
if (!user_is_a_sitemanager()) {
    die("You are not allowed to run this script.");
}
slim_header(_("Rename Pages"));
echo "<h2>" . _("Rename Pages") . "</h2>";
echo "<pre>\n";
$projectid = validate_projectID('projectid', @$_REQUEST['projectid'], true);
if (!$projectid) {
    echo "<form method='GET'>";
    echo "Please specify a project: ";
    echo "<input type='text' name='projectid' size='23'>";
    echo "<input type='submit' value='Go'>";
    echo "</form>\n";
    exit;
}
$project = new Project($projectid);
$title = $project->nameofwork;
echo "projectid: {$projectid}\n";
echo "title    : {$title}\n";
echo "\n";
$res = mysql_query("\n    SELECT fileid, image\n    FROM {$projectid}\n    ORDER BY image\n") or die(mysql_error());
$current_image_for_fileid_ = array();
function leave_proofing_interface($title)
{
    global $code_url, $projectid, $proj_state;
    slim_header($title);
    $url = "{$code_url}/project.php?id={$projectid}&expected_state={$proj_state}";
    $text = _("You will be returned to the <a href='%s' target='_top'>Project Page</a> in one second.");
    echo sprintf($text, $url);
    echo "<script language='JavaScript'><!--\n";
    echo "setTimeout(\"top.location.href='{$url}';\", 1000);\n";
    echo "// --></script>\n";
}
<?php

$relPath = "./../../pinc/";
include_once $relPath . 'base.inc';
include_once $relPath . 'http_headers.inc';
include_once $relPath . 'slim_header.inc';
include_once 'PPage.inc';
require_login();
$ppage = get_requested_PPage($_GET);
$page_css = "body { background-color: #CDC0B0; }";
slim_header("Image Frame", array('css_data' => $page_css));
?>
<center><div align="center" id="imagedisplay"><img
name="scanimage" id="scanimage" title="" alt=""
src="<?php 
echo $ppage->url_for_image();
?>
"
width="<?php 
if ($userP['i_layout'] == 1) {
    $iWidth = $userP['v_zoom'];
} else {
    $iWidth = $userP['h_zoom'];
}
$iWidth = round(1000 * $iWidth / 100);
echo $iWidth;
?>
"></div></center>

<?php 
// vim: sw=4 ts=4 expandtab
<?php

$relPath = "./../../pinc/";
include_once $relPath . 'base.inc';
include_once $relPath . 'pg.inc';
include_once $relPath . 'slim_header.inc';
include_once $relPath . 'misc.inc';
// attr_safe()
require_login();
$greek_contents = @$_GET['textbox'];
if (get_magic_quotes_gpc()) {
    $greek_contents = stripslashes($greek_contents);
}
$title = _("Greek to Latin-1 Transliteration");
$header_args = array("css_data" => "p.info { font-size: 12px; }", "js_data" => "\n        function clearBox() {\n            document.greek.textbox.value = '';\n            document.greek.textbox.focus();\n        }\n\n        function addChar(myChar) {\n            document.greek.textbox.value += myChar;\n            document.greek.textbox.focus();\n            // Following line is Opera focus+highlight workaround\n            document.greek.textbox.value += '';\n        }\n    ");
slim_header($title, $header_args);
?>
<table border="0" cellspacing="0" cellpadding="0" width="600">

<tr>
<td colspan="3">

<img name="greekimg" 

<?php 
// Use the form x/y coords for image button to see which one was pressed.
// Later, we can add other glyphsets and image maps, for alternate glyphs.
if (@$_REQUEST['italic_y'] != 0 || @$_REQUEST['italic_x'] != 0) {
    echo "src=\"gfx/igreek.png\"";
} else {
    echo "src=\"gfx/greek.png\"";
Example #18
0
<?php

$relPath = './../../pinc/';
include_once $relPath . "base.inc";
include_once $relPath . "slim_header.inc";
include_once $relPath . "misc.inc";
require_login();
slim_header(_("Search/Replace"));
?>

<script type='text/javascript'>
var saved_text = '';

function do_replace()
{
    var search_textbox = document.getElementById('search');
    var search = search_textbox.value;
    var regex_checkbox = document.getElementById('is_regex');
    var replacetext = document.getElementById('replace');
    save_text();
    var is_regex = regex_checkbox.checked;
    if (!is_regex)
    {
        search = preg_quote(search);
    }
    opener.parent.docRef.editform.text_data.value=opener.parent.docRef.editform.text_data.value.replace(new RegExp(search,'g'),replacetext.value);
    set_undo_button_disabled(false);
}

function save_text()
{
Example #19
0
<?php

// This file can be accessed directly in which case it needs appropriate
// HTML tags, and it can be include()d into other files, such as
// addproofer.php. We determine which is the case by checking if $relPath
// is set or not.
if (!isset($relPath)) {
    $relPath = "./../pinc/";
    include_once $relPath . 'base.inc';
    include_once $relPath . 'slim_header.inc';
    include_once $relPath . 'misc.inc';
    // undo_all_magic_quotes()
    undo_all_magic_quotes();
    slim_header(_("Privacy Statement"));
}
$test_system_access_string = '';
if ($testing) {
    $test_system_access_string = "<font style='color: red'>";
    $test_system_access_string .= _('Because this is a testing site, developers with login access to this server will also have access to the Real Name you provide.');
    $test_system_access_string .= "</font>";
}
// The privacy statement is particularly important and thus needs to be
// translateable. To do this we use _() on every sentence (not on every
// paragraph to reduce the number of new translations required should
// any given sentence change). This makes the code more difficult to read
// though, particularly since many strings need $site_name replaced in them.
// To mitigate that, some wrapper functions are used to take straightforward
// _() strings and output them by first pre-processing all strings with
// sprintf(<string>, $site_name). sprintf will ignore unused arguments so
// this works fine for strings without $site_name substitutions.
echo "<h2>" . _('Privacy Statement') . "</h2>";
Example #20
0
    }
    $font_face = $proofreading_font_faces[$font_face_i];
    $font_size = $proofreading_font_sizes[$font_size_i];
    $font_settings = '';
    if ($font_face != '') {
        $font_settings .= "font-family: {$font_face};";
        $font_settings .= " ";
    }
    if ($font_size != '') {
        $font_settings .= "font-size: {$font_size};";
    }
} else {
    $font_settings = '';
}
$header_args = array('css_data' => 'body { background-color: #ffffff; }', 'body_attributes' => "onload='top.initializeStuff(1)'");
slim_header("", $header_args);
?>
<form action="./returnfeed.php?quiz_page_id=<?php 
echo $quiz_page_id;
?>
" target="right" method="post" name="editform" id="editform">
<textarea rows="12" cols="60" name="text_data" id="text_data" wrap="off"
    style='width:100%; <?php 
echo $font_settings;
?>
'>
<?php 
echo qp_initial_page_text();
?>
</textarea> <p>
<input type="submit" value="<?php