コード例 #1
0
ファイル: freshports.php プロジェクト: brycied00d/freshports
function freshports_cvsweb_Diff_Link($pathname, $previousRevision, $revision_name)
{
    $pathname = str_replace('/ports/head/', '/ports/', $pathname);
    $HTML = '<A HREF="' . FRESHPORTS_FREEBSD_CVS_URL . $pathname . '.diff?r1=' . $previousRevision . ';r2=' . $revision_name . '">';
    $HTML .= freshports_Diff_Icon() . '</a> ';
    return $HTML;
}
コード例 #2
0
ファイル: faq.php プロジェクト: brycied00d/freshports
	<P><a name="is_interactive"><?php 
echo freshports_Is_Interactive_Icon();
?>
</a> This port will require interaction during installation.
	</P>

	<P><?php 
echo freshports_Revision_Icon();
?>
 Revision details.  Click on the Files icon in the commit history and
	you'll see what files in this port were touched by this commit.  Click on the Revision details to view the
	revision of the file associated this commit.
	</P>

	<P><?php 
echo freshports_Diff_Icon();
?>
 Diff.  Click on the Files icon in the commit history and
	you'll see what files in this port were touched by this commit.  Click on the Diff icon to view the
	diff between this revision of the file and the previous revision..
	</P>

	<P><?php 
echo freshports_SanityTestFailure_Icon();
?>
 Sanity Test Failures.  The maintainers and committers are
	good.   But sometimes a mistake slips through.  This records the mistake to make it easier for others to correct
	it if it goes unnoticed.  If you see this icon next to a commit, it failed a Sanity Test.
	</P>

	<P><?php 
コード例 #3
0
    function CreateHTML($WhichRepo)
    {
        global $TableWidth;
        global $freshports_CommitMsgMaxNumOfLinesToShow;
        global $DaysMarkedAsNew;
        $this->HTML = '';
        if (!$this->ResultSet) {
            die("read from database failed");
            exit;
        }
        $NumRows = pg_numrows($this->ResultSet);
        if ($this->Debug) {
            echo __FILE__ . ':' . __LINE__ . " Number of rows = {$NumRows}<br>\n";
        }
        if (!$NumRows) {
            $this->HTML = "<TR><TD>\n<P>Sorry, nothing found in the database....</P>\n</td></tr>\n";
            return $this->HTML;
        }
        $this->HTML .= '
<table border="1" width="100%" CELLSPACING="0" CELLPADDING="5">
<TR>
';
        switch ($NumRows) {
            case 0:
                $title = 'no files found';
                break;
            case 1:
                $title = '1 file found';
                break;
            default:
                $title = $NumRows . ' files found';
        }
        $this->HTML .= freshports_PageBannerText($title, 4);
        $this->HTML .= "\n\t\t<TR>\n\t\t\t<TD><b>Action</b></TD><TD><B>Revision</B></TD><td><b>Links</b></td><TD><b>File</b></TD>\n\t\t</TR>\n";
        for ($i = 0; $i < $NumRows; $i++) {
            $myrow = pg_fetch_array($this->ResultSet, $i);
            $this->HTML .= "<TR>\n";
            switch ($myrow["change_type"]) {
                case "M":
                    $Change_Type = "modify";
                    break;
                case "A":
                    $Change_Type = "import";
                    break;
                case "R":
                    $Change_Type = "remove";
                    break;
                default:
                    $Change_Type = $myrow["change_type"];
            }
            $this->HTML .= "  <TD>" . $Change_Type . "</TD>";
            $this->HTML .= '  <TD>' . $myrow["revision_name"];
            $this->HTML .= "</TD>";
            $this->HTML .= '<td>';
            if ($Change_Type == "modify") {
                switch ($WhichRepo) {
                    case FREEBSD_REPO_CVS:
                        $this->HTML .= ' ';
                        $previousRevision = $this->GetPreviousRevision($myrow["revision_name"]);
                        $this->HTML .= freshports_cvsweb_Diff_Link($myrow["pathname"], $previousRevision, $myrow["revision_name"]);
                        break;
                    case FREEBSD_REPO_SVN:
                        $this->HTML .= ' ';
                        $previousRevision = $this->GetPreviousRevision($myrow["revision_name"]);
                        # we want something like http://svnweb.freebsd.org/ports/head/www/p5-App-Nopaste/Makefile?r1=300951&r2=300950&pathrev=300951
                        $this->HTML .= ' <A HREF="http://' . $myrow['svn_hostname'] . $myrow["pathname"] . '?r1=' . $myrow["revision_name"] . '&amp;r2=' . $previousRevision . '&amp;pathrev=' . $myrow["revision_name"] . '">';
                        $this->HTML .= freshports_Diff_Icon() . '</a> ';
                        break;
                }
            }
            switch ($WhichRepo) {
                case FREEBSD_REPO_CVS:
                    $this->HTML .= freshports_cvsweb_Annotate_Link($myrow["pathname"], $myrow["revision_name"]);
                    break;
                case FREEBSD_REPO_SVN:
                    # we want something like
                    # http://svn.freebsd.org/ports/head/x11-wm/awesome/Makefile
                    $this->HTML .= ' <A HREF="http://' . $myrow['svn_hostname'] . $myrow["pathname"] . '?annotate=' . $myrow["revision_name"] . '">';
                    $this->HTML .= freshports_Revision_Icon() . '</a> ';
                    break;
                default:
                    $this->HTML .= 'unknown: \'' . htmlentities($WhichRepo) . '\'';
            }
            $this->HTML .= '</td>';
            $this->HTML .= '  <TD WIDTH="100%" VALIGN="middle">';
            switch ($WhichRepo) {
                case FREEBSD_REPO_CVS:
                    $this->HTML .= freshports_cvsweb_Revision_Link($myrow["pathname"], $myrow["revision_name"]);
                    break;
                case FREEBSD_REPO_SVN:
                    # we want something like
                    # http://svnweb.freebsd.org/ports/head/textproc/bsddiff/Makefile?view=log#rev300953
                    $this->HTML .= ' <A HREF="http://' . $myrow['svn_hostname'] . $myrow["pathname"] . '?view=log#rev' . $myrow["revision_name"] . '">';
                    break;
            }
            $this->HTML .= '<CODE CLASS="code">' . $myrow["pathname"] . "</CODE></A></TD>";
            $this->HTML .= "</TR>\n";
        }
        $this->HTML .= "</table>";
        return $this->HTML;
    }