106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
-
+
-
+
-
+
|
"Configure the trouble-ticketing system for this repository");
setup_menu_entry("Search","srchsetup",
"Configure the built-in search engine");
setup_menu_entry("Transfers", "xfersetup",
"Configure the transfer system for this repository");
setup_menu_entry("Skins", "setup_skin",
"Select from a menu of prepackaged \"skins\" for the web interface");
setup_menu_entry("CSS", "setup_editcss",
setup_menu_entry("CSS", "setup_skinedit?w=0",
"Edit the Cascading Style Sheet used by all pages of this repository");
setup_menu_entry("Header", "setup_header",
setup_menu_entry("Header", "setup_skinedit?w=2",
"Edit HTML text inserted at the top of every page");
setup_menu_entry("Footer", "setup_footer",
setup_menu_entry("Footer", "setup_skinedit?w=1",
"Edit HTML text inserted at the bottom of every page");
setup_menu_entry("Moderation", "setup_modreq",
"Enable/Disable requiring moderator approval of Wiki and/or Ticket"
" changes and attachments.");
setup_menu_entry("Ad-Unit", "setup_adunit",
"Edit HTML text for an ad unit inserted after the menu bar");
setup_menu_entry("Logo", "setup_logo",
|
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
|
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
|
-
+
|
}
@ /> <b>%s(zLabel)</b>
}
/*
** Generate a text box for an attribute.
*/
static void textarea_attribute(
const char *textarea_attribute(
const char *zLabel, /* The text label on the textarea */
int rows, /* Rows in the textarea */
int cols, /* Columns in the textarea */
const char *zVar, /* The corresponding row in the VAR table */
const char *zQP, /* The query parameter */
const char *zDflt, /* Default value if VAR table entry does not exist */
int disabled /* 1 if the textarea should not be editable */
|
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
|
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
@ <hr />
@ <p><input type="submit" name="submit" value="Apply Changes" /></p>
@ </div></form>
db_end_transaction(0);
style_footer();
}
/*
** WEBPAGE: setup_editcss
*/
void setup_editcss(void){
login_check_credentials();
if( !g.perm.Setup ){
login_needed(0);
return;
}
db_begin_transaction();
if( P("clear")!=0 ){
db_multi_exec("DELETE FROM config WHERE name='css'");
cgi_replace_parameter("css", builtin_text("skins/default/css.txt"));
db_end_transaction(0);
cgi_redirect("setup_editcss");
}
if( P("submit")!=0 ){
textarea_attribute(0, 0, 0, "css", "css",
builtin_text("skins/default/css.txt"), 0);
db_end_transaction(0);
cgi_redirect("setup_editcss");
}
style_header("Edit CSS");
@ <form action="%s(g.zTop)/setup_editcss" method="post"><div>
login_insert_csrf_secret();
@ Edit the CSS below:<br />
textarea_attribute("", 35, 80, "css", "css",
builtin_text("skins/default/css.txt"), 0);
@ <br />
@ <input type="submit" name="submit" value="Apply Changes" />
@ <input type="submit" name="clear" value="Revert To Default" />
@ </div></form>
@ <p><span class="note">Note:</span> Press your browser Reload button after
@ modifying the CSS in order to pull in the modified CSS file.</p>
@ <hr />
@ The default CSS is shown below for reference. Other examples
@ of CSS files can be seen on the <a href="setup_skin">skins page</a>.
@ See also the <a href="setup_header">header</a> and
@ <a href="setup_footer">footer</a> editing screens.
@ <blockquote><pre>
cgi_append_default_css();
@ </pre></blockquote>
style_footer();
db_end_transaction(0);
}
/*
** WEBPAGE: setup_header
*/
void setup_header(void){
login_check_credentials();
if( !g.perm.Setup ){
login_needed(0);
return;
}
db_begin_transaction();
if( P("clear")!=0 ){
db_multi_exec("DELETE FROM config WHERE name='header'");
cgi_replace_parameter("header", builtin_text("skins/default/header.txt"));
}else if( P("submit")!=0 ){
textarea_attribute(0, 0, 0, "header", "header",
builtin_text("skins/default/header.txt"), 0);
}else if( P("fixbase")!=0 ){
const char *z = db_get("header",
(char*)builtin_text("skins/default/header.txt"));
char *zHead = strstr(z, "<head>");
if( strstr(z, "<base href=")==0 && zHead!=0 ){
char *zNew;
char *zTail = &zHead[6];
while( fossil_isspace(zTail[0]) ) zTail++;
zNew = mprintf("%.*s\n<base href=\"$secureurl/$current_page\" />\n%s",
zHead+6-z, z, zTail);
cgi_replace_parameter("header", zNew);
db_set("header", zNew, 0);
}
}
style_header("Edit Page Header");
@ <form action="%R/setup_header" method="post"><div>
/* Make sure the header contains <base href="...">. Issue a warning
** if it does not. */
if( !cgi_header_contains("<base href=") ){
@ <p class="generalError">Please add
@ <tt><base href="$secureurl/$current_page"></tt> after
@ <tt><head></tt> in the header!
@ <input type="submit" name="fixbase" value="Add <base> Now"></p>
}
login_insert_csrf_secret();
@ <p>Edit HTML text with embedded TH1 (a Tcl dialect) that will be used to
@ generate the beginning of every page through start of the main
@ menu.</p>
textarea_attribute("", 35, 80, "header", "header",
builtin_text("skins/default/header.txt"), 0);
@ <br />
@ <input type="submit" name="submit" value="Apply Changes" />
@ <input type="submit" name="clear" value="Revert To Default" />
@ </div></form>
@ <hr />
@ The default header is shown below for reference. Other examples
@ of headers can be seen on the <a href="setup_skin">skins page</a>.
@ See also the <a href="setup_editcss">CSS</a> and
@ <a href="setup_footer">footer</a> editing screens.
@ <blockquote><pre>
@ %h(builtin_text("skins/default/header.txt"))
@ </pre></blockquote>
style_footer();
db_end_transaction(0);
}
/*
** WEBPAGE: setup_footer
*/
void setup_footer(void){
login_check_credentials();
if( !g.perm.Setup ){
login_needed(0);
return;
}
db_begin_transaction();
if( P("clear")!=0 ){
db_multi_exec("DELETE FROM config WHERE name='footer'");
cgi_replace_parameter("footer", builtin_text("skins/default/footer.txt"));
}
style_header("Edit Page Footer");
@ <form action="%s(g.zTop)/setup_footer" method="post"><div>
login_insert_csrf_secret();
@ <p>Edit HTML text with embedded TH1 (a Tcl dialect) that will be used to
@ generate the end of every page.</p>
textarea_attribute("", 20, 80, "footer", "footer",
builtin_text("skins/default/footer.txt"), 0);
@ <br />
@ <input type="submit" name="submit" value="Apply Changes" />
@ <input type="submit" name="clear" value="Revert To Default" />
@ </div></form>
@ <hr />
@ The default footer is shown below for reference. Other examples
@ of footers can be seen on the <a href="setup_skin">skins page</a>.
@ See also the <a href="setup_editcss">CSS</a> and
@ <a href="setup_header">header</a> editing screens.
@ <blockquote><pre>
@ %h(builtin_text("skins/default/footer.txt"))
@ </pre></blockquote>
style_footer();
db_end_transaction(0);
}
/*
** WEBPAGE: setup_modreq
*/
void setup_modreq(void){
login_check_credentials();
if( !g.perm.Setup ){
login_needed(0);
|
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
|
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
|
-
+
|
@ </div></form>
@ <hr />
@ <b>Ad-Unit Notes:</b><ul>
@ <li>Leave both Ad-Units blank to disable all advertising.
@ <li>The "Banner Ad-Unit" is used for wide pages.
@ <li>The "Right-Column Ad-Unit" is used on pages with tall, narrow content.
@ <li>If the "Right-Column Ad-Unit" is blank, the "Banner Ad-Unit" is used on all pages.
@ <li>Suggested <a href="setup_editcss">CSS</a> changes:
@ <li>Suggested <a href="setup_skinedit?w=0">CSS</a> changes:
@ <blockquote><pre>
@ div.adunit_banner {
@ margin: auto;
@ width: 100%;
@ }
@ div.adunit_right {
@ float: right;
|
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
|
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
|
-
-
+
+
-
-
+
+
|
@ </p></blockquote>
@
@ <form action="%s(g.zTop)/setup_logo" method="post"
@ enctype="multipart/form-data"><div>
@ <p>The logo is accessible to all users at this URL:
@ <a href="%s(g.zBaseURL)/logo">%s(g.zBaseURL)/logo</a>.
@ The logo may or may not appear on each
@ page depending on the <a href="setup_editcss">CSS</a> and
@ <a href="setup_header">header setup</a>.
@ page depending on the <a href="setup_skinedit?w=0">CSS</a> and
@ <a href="setup_skinedit?w=2">header setup</a>.
@ To change the logo image, use the following form:</p>
login_insert_csrf_secret();
@ Logo Image file:
@ <input type="file" name="logoim" size="60" accept="image/*" />
@ <p align="center">
@ <input type="submit" name="setlogo" value="Change Logo" />
@ <input type="submit" name="clrlogo" value="Revert To Default" /></p>
@ </div></form>
@ <hr />
@
@ <p>The current background image has a MIME-Type of <b>%h(zBgMime)</b>
@ and looks like this:</p>
@ <blockquote><p><img src="%s(g.zTop)/background/%z(zBgMtime)" alt="background" border=1 />
@ </p></blockquote>
@
@ <form action="%s(g.zTop)/setup_logo" method="post"
@ enctype="multipart/form-data"><div>
@ <p>The background image is accessible to all users at this URL:
@ <a href="%s(g.zBaseURL)/background">%s(g.zBaseURL)/background</a>.
@ The background image may or may not appear on each
@ page depending on the <a href="setup_editcss">CSS</a> and
@ <a href="setup_header">header setup</a>.
@ page depending on the <a href="setup_skinedit?w=0">CSS</a> and
@ <a href="setup_skinedit?w=2">header setup</a>.
@ To change the background image, use the following form:</p>
login_insert_csrf_secret();
@ Background image file:
@ <input type="file" name="bgim" size="60" accept="image/*" />
@ <p align="center">
@ <input type="submit" name="setbg" value="Change Background" />
@ <input type="submit" name="clrbg" value="Revert To Default" /></p>
|