From: <pre...@us...> - 2002-08-22 05:26:00
|
Update of /cvsroot/mantisbt/manual In directory usw-pr-cvs1:/tmp/cvs-serv16274 Modified Files: add_form.php config.php core.php edit_form.php index.php Added Files: manual.css tags.php Log Message: Many updates for manual. Better info section and improved css. --- NEW FILE: manual.css --- body {margin: 4px;} td, a {font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;} a.small {font-size: 8pt;} a.parent {font-size: 10pt;} a.item {font-size: 8pt;} table {} tr {background-color: #ffffff; vertical-align: top;} th {background-color: #ffffff; text-align: left;} th.category {background-color: #b8c8f8; text-align: left;} th.subcategory {background-color: #d8e8ff; text-align: left;} td {background-color: #ffffff; text-align: left; padding: 4px;} td.side-menu {background-color: #e8e8e8; border-right: 1px dashed #444444; width: 20%; white-space: nowrap;} td.applicable-version {background-color: #98b8e8; border-top: 1px solid #222222; padding: 3px; border-bottom: 1px solid #222222; width: 100%; font-size: 8pt; font-style: italic;} td.see-also {background-color: #d8d8d8; border: 1px solid #444444; padding: 3px; width: 100%; font-size: 8pt;} td.top-bar {background-color: #98b8e8; border-top: 1px solid #222222; padding: 3px; border-bottom: 1px solid #222222; padding: 3px; width: 100%; font-size: 8pt;} td.description {padding: 10px;} table.conf {background-color: #8888aa; width: 97%; border: 1px;} td.conf-var {background-color: #bbccee; width: 20%; white-space: nowrap;} td.conf-desc {background-color: #e8e8e8; padding: 6px;} td.conf-text {background-color: #ffffff;} td.spacer {font-size: 1px; line-height: 1px; background-color: #ffffff; height: 1px;} td.markup1 {font-size: 10pt; background-color:#ffffff; width: 30%} td.markup2 {font-size: 10pt; background-color:#f8f8f8; width: 30%} td.markup3 {font-size: 10pt; background-color:#ffffff; width: 40%} span.item-title {font-size: 14pt; font-weight: bold; color: #225566;} span.description {font-size: 11pt; font-weight: bold; color: #003366;} span.last-modified {font-size: 8pt; font-style: italic;} span.bold {font-weight: bold;} span.italic {font-style: italic;} span.underline {text-decoration: underline;} span.file {background-color: #e8e8d8; font-family: courier new, courier, fixed;} span.string {color: #C11900; font-weight: bold; font-style: italic;} span.function {color: #0019B7; font-weight: bold; font-style: italic; font-family: courier new, courier, fixed;} span.line {color: #ff8844; font-weight: bold; font-style: italic; font-family: courier new, courier, fixed;} span.variable {color: #00C1B5; font-weight: bold; font-family: courier new, courier, fixed;} span.example {background-color: #f4f4f4; font-family: courier new, courier, fixed; border-left: 1px solid #000000; border-right: 1px solid #000000;} div {width: auto; font-size: 10pt;} div.code {background-color: #f0f0f0; border: 1px solid #444444; padding: 8px; font-family: courier new, courier, fixed; white-space: pre;} div.note {background-color: #c8e0f8; border: 1px solid #4444aa; padding: 8px;} div.warning {background-color: #f8e0e0; border: 1px solid #aa4444; padding: 8px;} div.parent {background-color: #e8e8e8; border-bottom: 1px solid #aaaaaa; padding-top: 4px;} div.example {background-color: #f4f4f4; font-family: courier new, courier, fixed; border-left: 1px solid #000000; border-right: 1px solid #000000; display: inline;} pre {display: inline;} --- NEW FILE: tags.php --- <hr> <a name="tags"> </a> <table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#888888"> <tr> <th colspan="3" class='category'>Markup Tags</th> </tr> <tr> <td class="spacer" colspan="3"> </td> </tr> <tr> <th class='category'>Desired Result</th> <th class='category'>Markup Tag</th> <th class='category'>Notes</th> </tr> <tr> <td class="spacer" colspan="3"> </td> </tr> <tr> <th colspan="3" class='subcategory'>String Modifiers</th> </tr> <tr> <td class="markup1"> <b>bold-text</b> </td> <td class="markup2"> [b]bold-text[/b] </td> <td class="markup3"> </td> </tr> <tr> <td class="markup1"> <i>italics-text</i> </td> <td class="markup2"> [i]italics-text[/i] </td> <td class="markup3"> </td> </tr> <tr> <td class="markup1"> <u>underline-text</u> </td> <td class="markup2"> [u]underline-text[/u] </td> <td class="markup3"> </td> </tr> <tr> <td class="markup1"> <span class="file">filename or directory name</span> </td> <td class="markup2"> [file]filename or directory name[/file] </td> <td class="markup3"> </td> </tr> <tr> <td class="markup1"> <div class="example"> eg. example-text </div> </td> <td class="markup2"> [example]eg. example-text[/example] </td> <td class="markup3"> Be careful how this wraps. </td> </tr> <tr> <td class="markup1"> <span class="string">special string</span> </td> <td class="markup2"> [string]special string[/string] </td> <td class="markup3"> For distinguishing special string values that users should take note of. </td> </tr> <tr> <td class="markup1"> <span class="function">function name</span> </td> <td class="markup2"> [function]function name[/function] </td> <td class="markup3"> </td> </tr> <tr> <td class="markup1"> <span class="line">line number</span> </td> <td class="markup2"> [line]line number[/line] </td> <td class="markup3"> For distinguishing the line number of a file. </td> </tr> <tr> <td class="markup1"> <span class="variable">variable name</span> </td> <td class="markup2"> [variable]variable name[/variable] </td> <td class="markup3"> </td> </tr> <tr> <th colspan="3" class='subcategory'>Custom String Modfiers</th> </tr> <tr> <td class="markup1"> <span style="color: #ff00ff;">colorize-text</span> </td> <td class="markup2"> [color=#ff00ff]colorize-text[/color] </td> <td class="markup3"> </td> </tr> <tr> <td class="markup1"> <span style="font-size: 12pt;">text-size-in-pts</span> </td> <td class="markup2"> [size=12pt]text-size-in-pts[/size] </td> <td class="markup3"> </td> </tr> <tr> <th colspan="3" class='subcategory'>Lists</th> </tr> <tr> <td class="markup1"> ordered-list </td> <td class="markup2"> [ol]ordered-list[/ol] </td> <td class="markup3"> </td> </tr> <tr> <td class="markup1"> unordered-list </td> <td class="markup2"> [ul]unordered-list[/ul] </td> <td class="markup3"> </td> </tr> <tr> <td class="markup1"> <li>list-item</li> </td> <td class="markup2"> [li]list-item[/li] </td> <td class="markup3"> </td> </tr> <tr> <th colspan="3" class='subcategory'>Links</th> </tr> <tr> <td class="markup1"> <a href="http://mantisbt.sf.net/">URL-text</a> </td> <td class="markup2"> [url=http://mantisbt.sf.net/]URL-text[/url] </td> <td class="markup3"> </td> </tr> <tr> <td class="markup1"> <a name="anchor-name"> </a> </td> <td class="markup2"> [name=anchor-name] </td> <td class="markup3"> </td> </tr> <tr> <td class="markup1"> <img src="image-src"> </td> <td class="markup2"> [img]image-src[/img] </td> <td class="markup3"> Be careful of image linking until we have a good stategy for image file location storage. </td> </tr> <tr> <th colspan="3" class='subcategory'>Blocks</th> </tr> <tr> <td class="markup1"> <div class="code">code-block</div> </td> <td class="markup2"> [code]code-block[/code] </td> <td class="markup3"> Any code should be placed in [code] blocks. </td> </tr> <tr> <td class="markup1"> <div class="note">note-block</div> </td> <td class="markup2"> [note]note-block[/note] </td> <td class="markup3"> Any notes that users should consider should be placed in [note] blocks. </td> </tr> <tr> <td class="markup1"> <div class="warning ">warning-block</div> </td> <td class="markup2"> [warning]warning-block[/warning] </td> <td class="markup3"> Any cautionary items should be placed in [warning] blocks. This means damage may occur, security may be breached, the app may break, etc. </td> </tr> <tr> <th colspan="3" class='subcategory'>Spacing</th> </tr> <tr> <td class="markup1"> Indentation </td> <td class="markup2"> Tabs are replaced by 4 &nbsp; elements.<br /> 2 and 4 space blocks are replaced by &nbsp; elements. </td> <td class="markup3"> </td> </tr> <tr> <th colspan="3" class='subcategory'>Tables</th> </tr> <tr> <td class="markup1"> <table border="0" bgcolor="#444444"> </tr> <th> table-heading </th> </tr> </tr> <td style="background-color: #ddddff"> table-body </td> </tr> </table> </td> <td class="markup2"> <div class="code"> <pre> [table border="0" bgcolor="#444444"] [/tr] [th] table-heading [/th] [/tr] [/tr] [td style="background-color: #ddddff"] table-body [/td] [/tr] [/table] </pre> </div> </td> <td class="markup3"> Basically you just create tables like nroma except use [ and ] insttead of < and >. </td> </tr> </table> <hr> Index: add_form.php =================================================================== RCS file: /cvsroot/mantisbt/manual/add_form.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- add_form.php 21 Aug 2002 04:37:49 -0000 1.1.1.1 +++ add_form.php 22 Aug 2002 05:25:56 -0000 1.2 @@ -2,11 +2,8 @@ <?php $f_parent_id = isset( $f_parent_id ) ? $f_parent_id : ""; ?> -<style> -<!-- -td, a {font-family: arial, helvetica, geneva, sans-serif; font-size: 10pt} -//--> -</style> +<link rel="StyleSheet" href="manual.css" type="text/css"> + <a href="index.php">Back</a> <form method="post" action="add.php"> <input type="submit" name="more" value="Add More"><input type="submit" value="Add Item"> @@ -39,7 +36,7 @@ </td> </tr> <tr> - <td bgcolor="#b8c8f8">Description (eg. db_num_rows)</td> + <td bgcolor="#b8c8f8">Description (HTML will display as text) <a href="#tags">Tag Reference</a></td> </tr> <tr> <td bgcolor="#f8f8ff"> @@ -73,4 +70,6 @@ </table> <p> <input type="submit" name="more" value="Add More"><input type="submit" value="Add Item"> -</form> \ No newline at end of file +</form> + +<?php include( 'tags.php' ); ?> \ No newline at end of file Index: config.php =================================================================== RCS file: /cvsroot/mantisbt/manual/config.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- config.php 21 Aug 2002 04:37:49 -0000 1.1.1.1 +++ config.php 22 Aug 2002 05:25:56 -0000 1.2 @@ -2,7 +2,7 @@ $g_hostname = 'localhost'; $g_username = 'root'; $g_password = ''; - $g_db_name = 'doc'; + $g_db_name = 'manual'; $g_table_name = 'item_table'; ?> Index: core.php =================================================================== RCS file: /cvsroot/mantisbt/manual/core.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- core.php 21 Aug 2002 04:37:49 -0000 1.1.1.1 +++ core.php 22 Aug 2002 05:25:56 -0000 1.2 @@ -6,6 +6,7 @@ mysql_connect( $g_hostname, $g_username, $g_password ); mysql_select_db( $g_db_name ); + # --- --- function parent_option_list( $p_parent_id ) { global $g_table_name; @@ -28,6 +29,7 @@ } } + # --- algorithm to bump the id list when a new one is inserted --- function update_item_order( $p_parent_id, $p_item_order, $p_item_id ) { global $g_table_name; @@ -39,10 +41,12 @@ $result = mysql_query( $query ); } + # --- helper function for our regexes --- function process_tag_output( $p_text, $p_tag ) { return "<".$p_tag." ".str_replace( """, "\"", $p_text ).">"; } + # --- all the main work is done here --- function process_output( $p_text ) { $p_text = stripslashes( $p_text ); $p_text = str_replace( "\r", "", $p_text ); @@ -68,6 +72,11 @@ $p_text = preg_replace( "/\[url=(.*)\](.*)\[\/url\]/U", '<a href="\\1">\\2</a>', $p_text ); $p_text = preg_replace( "/\[img\](.*)\[\/img\]/U", '<img src="\\1">', $p_text ); $p_text = preg_replace( "/\[li\]/U", '<li>', $p_text ); + $p_text = preg_replace( "/\[\/li\]/U", '</li>', $p_text ); + $p_text = preg_replace( "/\[ul\]/U", '<ul>', $p_text ); + $p_text = preg_replace( "/\[\/ul\]/U", '</ul>', $p_text ); + $p_text = preg_replace( "/\[ol\]/U", '<ol>', $p_text ); + $p_text = preg_replace( "/\[\/ol\]/U", '</ol>', $p_text ); # blocks elements $p_text = preg_replace( "/\[code\](.*)\[\/code\]/U", '<div class="code">\\1</div>', $p_text ); Index: edit_form.php =================================================================== RCS file: /cvsroot/mantisbt/manual/edit_form.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- edit_form.php 21 Aug 2002 04:37:49 -0000 1.1.1.1 +++ edit_form.php 22 Aug 2002 05:25:56 -0000 1.2 @@ -11,11 +11,8 @@ $v_description = htmlspecialchars( stripslashes( $v_description ) ); $v_see_also = htmlspecialchars( stripslashes( $v_see_also ) ); ?> -<style> -<!-- -td, a {font-family: arial, helvetica, geneva, sans-serif; font-size: 10pt} -//--> -</style> +<link rel="StyleSheet" href="manual.css" type="text/css"> + <a href="index.php?f_item_id=<?php echo $f_item_id ?>">Back</a> <form method="post" action="update.php"> <input type="hidden" name="f_item_id" value="<?php echo $f_item_id ?>"> @@ -50,7 +47,7 @@ </td> </tr> <tr> - <td bgcolor="#b8c8f8">Description (eg. db_num_rows)</td> + <td bgcolor="#b8c8f8">Description (HTML will display as text) <a href="#tags">Tag Reference</a></td> </tr> <tr> <td bgcolor="#f8f8ff"> @@ -85,29 +82,5 @@ <p> <input type="submit" name="quick" value="Quick Save"><input type="submit" value="Update Item"> </form> -<hr> -<b>Markup Tags</b> -<p> -[b]<text>[/b] Bold<br /> -[i]<text>[/i] Italics<br /> -[u]<text>[/u] Underline<br /> -<br /> -[file]<text>[/file] file/dir<br /> -[string]<text>[/string] special string<br /> -[function]<text>[/function] function<br /> -[line]<text>[/line] line<br /> -[variable]<text>[/variable] variable<br /> -[img]<text>[/img] img<br /> -[li]<br /> -<br /> -[color=<text>]<text>[/color] colorize text<br /> -[size=<text>]<text>[/size] size of text in pts.<br /> -[url=<text>]<text>[/url] URL<br /> -[name=<text>] anchor name<br /> -<br /> -[code]<text>[/code] code block<br /> -[note]<text>[/note] note block<br /> -[warning]<text>[/warning] warning block<br /> -<br /> -Tabs are replaced by 4 elements.<br /> -2 and 4 space blocks are replaced by elements.<br /> + +<?php include( 'tags.php' ); ?> \ No newline at end of file Index: index.php =================================================================== RCS file: /cvsroot/mantisbt/manual/index.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- index.php 21 Aug 2002 15:28:19 -0000 1.2 +++ index.php 22 Aug 2002 05:25:56 -0000 1.3 @@ -2,54 +2,7 @@ <?php $f_item_id = isset( $f_item_id ) ? $f_item_id : 1; ?> -<style> -<!-- -body {margin: 0px;} -td, a {font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;} -a.small {font-size: 8pt;} - -a.parent {font-size: 10pt;} -a.item {font-size: 8pt;} - -table {} - -tr {background-color: #ffffff; vertical-align: top;} - -th {background-color: #ffffff; text-align: left;} - -td {background-color: #ffffff; text-align: left; padding: 4px;} - -td.side-menu {background-color: #e8e8e8; border-right: 1px dashed #444444; width: 20%; white-space: nowrap;} -td.applicable-version {background-color: #98b8e8; border-top: 1px solid #222222; padding: 3px; border-bottom: 1px solid #222222; width: 100%; font-size: 8pt; font-style: italic;} -td.see-also {background-color: #d8d8d8; border: 1px solid #444444; padding: 3px; width: 100%; font-size: 8pt;} -td.top-bar {background-color: #98b8e8; border-top: 1px solid #222222; padding: 3px; border-bottom: 1px solid #222222; padding: 3px; width: 100%; font-size: 8pt;} -td.description {padding: 10px;} - -table.conf {background-color: #8888aa; width: 97%; border: 1px;} -td.conf-var {background-color: #bbccee; width: 20%; white-space: nowrap;} -td.conf-desc {background-color: #e8e8e8; padding: 6px;} -td.conf-text {background-color: #ffffff;} - -span.item-title {font-size: 14pt; font-weight: bold; color: #225566;} -span.description {font-size: 11pt; font-weight: bold; color: #003366;} -span.last-modified {font-size: 8pt; font-style: italic;} -span.bold {font-weight: bold;} -span.italic {font-style: italic;} -span.underline {text-decoration: underline;} -span.file {background-color: #e8e8d8; font-family: courier new, courier, fixed;} -span.string {color: #209b5d; font-style: italic;} -span.function {color: #2244aa; font-weight: bold; font-style: italic; font-family: courier new, courier, fixed;} -span.line {color: #ff8844; font-weight: bold; font-style: italic; font-family: courier new, courier, fixed;} -span.variable {color: #44aabb; font-weight: bold; font-family: courier new, courier, fixed;} -span.example {background-color: #f4f4f4; font-family: courier new, courier, fixed; border-left: 1px solid #000000; border-right: 1px solid #000000;} - -div {width: auto; font-size: 10pt;} -div.code {background-color: #f0f0f0; border: 1px solid #444444; padding: 8px; font-family: courier new, courier, fixed;} -div.note {background-color: #c8e0f8; border: 1px solid #4444aa; padding: 8px;} -div.warning {background-color: #f8e0e0; border: 1px solid #aa4444; padding: 8px;} -div.parent {background-color: #e8e8e8; border-bottom: 1px solid #aaaaaa; padding-top: 4px;} -//--> -</style> +<link rel="StyleSheet" href="manual.css" type="text/css"> <br> <a href="add_form.php">Add Item</a> @@ -80,7 +33,7 @@ print str_replace( " ", " ", str_pad("", $p_count*4, " ", STR_PAD_LEFT) ); $num = $i+1; - PRINT "$num. <a class=\"item\" href=\"index.php?f_item_id=$v_item_id\">$v_item_title</a> [<a class=\"small\" href=\"edit_form.php?f_item_id=$v_item_id\">edit</a>]<br />"; + PRINT "$v_item_order. <a class=\"item\" href=\"index.php?f_item_id=$v_item_id\">$v_item_title</a> [<a class=\"small\" href=\"edit_form.php?f_item_id=$v_item_id\">edit</a>]<br />"; print_items( $v_item_id, $p_count+1 ); } } @@ -141,7 +94,7 @@ $row = mysql_fetch_array( $result ); extract( $row, EXTR_PREFIX_ALL, "v" ); - PRINT ($i+1) . ". <a class=\"item\" href=\"index.php?f_item_id=$v_item_id\">$v_item_title</a> [<a class=\"small\" href=\"edit_form.php?f_item_id=$v_item_id\">edit</a>]<br />"; + PRINT "$v_item_order. <a class=\"item\" href=\"index.php?f_item_id=$v_item_id\">$v_item_title</a> [<a class=\"small\" href=\"edit_form.php?f_item_id=$v_item_id\">edit</a>]<br />"; } } |