Index: /trunk/css/admin.inc.css
===================================================================
--- /trunk/css/admin.inc.css	(revision 740)
+++ /trunk/css/admin.inc.css	(revision 741)
@@ -1,9 +1,9 @@
-/**
- * admin.inc.css
- *
- * CSS for a Strangecode administration site.
- */
+/*
+* admin.inc.css
+*/
 
-/*_____________________ GLOBAL ____________________*/
+/*
+GLOBAL
+*/
 body {
     background: #fff;
@@ -13,19 +13,13 @@
     color: #000;
 }
-
 a:link,
 a:visited { color: #336; text-decoration: underline; }
 a:hover   { color: #C30; text-decoration: none; }
 a:active  { color: #336; }
-
 pre { margin: 0; }
-
-/*_____________________ MISC ____________________*/
-
-/* The following are here in addition to in utilities.inc.css only because I want the font size 70%. Is there a more general way to do this? There currently are NO font-size specifications in utilities.inc.css or codebase.inc.css. That seems safest, but requires that they are redefined anyways (like here for eg). Have you figured out how to do font sizes correctly? */
-
-/* Why does having a form change the presentation of the page? Don't do that. */
+/*
+MISC
+*/
 form { margin: 0; }
-
 form label {
     font-size: 70%;
@@ -33,10 +27,8 @@
     font-weight: bold;
 }
-
 .help,
 .sc-help,
 .commandtext,
 .commanditem { font-size: 70%; }
-
 /* For fv err applied to tds. */
 td.sc-msg-warning,
@@ -48,7 +40,7 @@
 	border: none;
 }
-
-
-/*_____________________ HEADER ____________________*/
+/*
+HEADER
+*/
 #userinfo {
     width: 98%;
@@ -58,10 +50,8 @@
     text-align: right;
 }
-
 #userinfo p {
     margin: 0;
     padding: 0;
 }
-
 #container {
     width: 98%;
@@ -70,5 +60,4 @@
     border: 1px solid gray;
 }
-
 #top {
     border-bottom: 1px solid gray;
@@ -76,5 +65,4 @@
     padding: .5em;
 }
-
 #top h1 {
     margin: 0;
@@ -83,6 +71,7 @@
     color: #000;
 }
-
-/*_____________________ NAVIGATION ____________________*/
+/*
+NAVIGATION
+*/
 #leftnav {
     float: left;
@@ -93,5 +82,4 @@
     background-color: #EEE;
 }
-
 #leftnav ul {
     padding: 0;
@@ -99,5 +87,4 @@
     width: 9em;
 }
-
 #leftnav #navlist li {
     list-style: none;
@@ -109,10 +96,8 @@
     font-weight: bold;
 }
-
 #leftnav #navlist li a {
     text-decoration: none;
     padding: 1px;
 }
-
 #leftnav #navlist li.label {
     color: #999;
@@ -121,19 +106,17 @@
     font-weight: bold;
 }
-
 #leftnav a.addlink {
     margin-left: 0.5em;
     font-weight: normal;
 }
-
 #leftnav #navlist li a:link, #navlist li a:visited {
     color: #336;
 }
-
 #leftnav #navlist li a:hover, #navlist li a:active {
     color: #C00;
 }
-
-/*_____________________ CONTENT ____________________*/
+/*
+CONTENT
+*/
 #content {
     margin-left: 9em;
@@ -142,5 +125,4 @@
     background-color: #FFF;
 }
-
 #content h1, #content h2, #content h3, #content h4, #content h5 {
     margin: 0 0 .5em 0;
@@ -150,5 +132,4 @@
 #content h3 { font-size: 90%; }
 #content h4 { font-size: 75%; }
-
 #content p {
     margin: 0 0 .5em 0;
@@ -156,5 +137,4 @@
     line-height: 130%;
 }
-
 #content li {
     margin: 0 0 0 0;
@@ -162,7 +142,7 @@
     line-height: 100%;
 }
-
-/*_____________________ TABLES ____________________*/
-/* BEAU: I copied this from NEXT. Please help! */
+/*
+TABLES
+*/
 table {
 	border-size: 1px;
@@ -170,5 +150,4 @@
 	border-spacing: 0;
 }
-
 th {
 	padding: 2px;
@@ -177,10 +156,8 @@
 	white-space: nowrap;
 }
-
 td {
 	vertical-align: top;
     padding: 8px 6px 0 0;
 }
-
 table.list {
 	border-size: 1px;
@@ -188,5 +165,4 @@
 	margin: 4px 0;
 }
-
 table.list th {
 	padding: 0 6px 1px 2px;
@@ -195,7 +171,5 @@
     border-bottom: 2px solid #eee;
     background-color: #ddd;
-/*  border-bottom: 1px solid #000; */
-}
-
+}
 table.list td, #commandbox table td {
 	font-size: 70%;
@@ -204,49 +178,10 @@
 	vertical-align: top;
 }
-
 table.list tr:hover, #commandbox table tr:hover {
     background: #FAF8C7;
 }
-
-
-/* BEAU: The old stuff that was here...
-#content table {
-         background-color: #FFF;
-}
-
-#content th {
-    padding: 2px;
-    text-align: left;
-    vertical-align: middle;
-    white-space: nowrap;
-}
-
-#content td {
-    vertical-align: top;
-}
-
-#content table.list {
-    width: 99%;
-    margin: 4px 0;
-    background-color: #FFF;
-}
-
-#content table.list th {
-    padding-right: 6px;
-    font-size: 70%;
-    background-color: #CCC;
-    border-bottom: 1px solid #000;
-}
-
-#content table.list td {
-    font-size: 70%;
-    padding: 2px;
-    border-bottom: 1px dotted #000;
-}
-*/
-
-/*_____________________ COMMANDS ____________________*/
-
-/* Should this be an ID??? */
+/*
+COMMANDS
+*/
 #commandbox, .commandbox
 {
@@ -257,5 +192,4 @@
 	color: inherit;
 }
-
 .commanditem
 {
@@ -263,15 +197,11 @@
 	white-space: nowrap;
 }
-
 #commandbox .form, .commandbox .form, #commandbox form, .commandbox form, {
     margin-top: 8px;
 }
-
-/* I replaced all instances of commandtext with commanditem on the SC admin, but leave it here for sites I didn't. */
 .commandtext
 {
 	padding-right: 1em;
 }
-
 .command_left
 {
@@ -279,5 +209,4 @@
 	white-space: nowrap;
 }
-
 .command_right
 {
@@ -287,7 +216,7 @@
 	float: right;
 }
-
-
-/*_____________________ FOOTER ____________________*/
+/*
+FOOTER
+*/
 #footer {
     clear: both;
@@ -300,5 +229,4 @@
     line-height: 100%;
 }
-
 #footer a:link,
 #footer a:visited {
@@ -306,5 +234,4 @@
     text-decoration: none;
 }
-
 #footer a:active,
 #footer a:hover {
Index: /trunk/css/admin2.inc.css
===================================================================
--- /trunk/css/admin2.inc.css	(revision 740)
+++ /trunk/css/admin2.inc.css	(revision 741)
@@ -1,9 +1,9 @@
-/**
- * admin2.inc.css
- *
- * CSS for the Strangecode administration sites.
- */
+/*
+* admin2.inc.css
+*/
 
-/*_____________________ GLOBAL ____________________*/
+/*
+GLOBAL
+*/
 body {
     background: #fff;
@@ -13,30 +13,16 @@
     color: #000;
 }
-
 a:link,
 a:visited   { color: #227899; text-decoration: none; border: none; }
 a:hover     { color: #000; text-decoration: none; border: none; }
 a:active    { color: #00b8ff; text-decoration: none; border: none; }
-
 pre { margin: 0; }
-
-/*_____________________ MISC ____________________*/
-
-/* The following are here in addition to in utilities.inc.css only because I want the font size 70%. Is there a more general way to do this? There currently are NO font-size specifications in utilities.inc.css or codebase.inc.css. That seems safest, but requires that they are redefined anyways (like here for eg). Have you figured out how to do font sizes correctly? */
-
-/* Why does having a form change the presentation of the page? Don't do that. */
-/* form { margin: 0; }
-
-form label {
-    font-size: 70%;
-    max-width: 25em;
-    font-weight: bold;
-}
- */
+/*
+MISC
+*/
 .help,
 .sc-help,
 .commandtext,
 .commanditem { font-size: 0.7rem; }
-
 /* For fv err applied to tds. */
 td.sc-msg-warning,
@@ -48,15 +34,14 @@
 	border: none;
 }
-
 img {
     border: 0;
 	vertical-align: middle;
 }
-
 #container-columns {
     width: 100%;
 }
-
-/*_____________________ HEADER ____________________*/
+/*
+HEADER
+*/
 #userinfo {
     width: 98%;
@@ -65,10 +50,8 @@
     text-align: right;
 }
-
 #userinfo p {
     margin: 0;
     padding: 0;
 }
-
 #container {
     width: 98%;
@@ -77,5 +60,4 @@
     border: 1px solid gray;
 }
-
 #top {
     border-bottom: 1px solid gray;
@@ -83,5 +65,4 @@
     padding: .5em;
 }
-
 #top h1 {
     margin: 0;
@@ -90,6 +71,7 @@
     color: #000;
 }
-
-/*_____________________ NAVIGATION ____________________*/
+/*
+NAVIGATION
+*/
 #leftnav {
 /*     float: left; */
@@ -101,10 +83,8 @@
     background-color: #EEE;
 }
-
 #leftnav ul {
     padding: 0;
     margin: 0;
 }
-
 #leftnav #navlist li {
     list-style: none;
@@ -116,10 +96,8 @@
     font-weight: bold;
 }
-
 #leftnav #navlist li a {
     text-decoration: none;
     padding: 1px;
 }
-
 #leftnav #navlist li.label {
     color: #999;
@@ -128,32 +106,18 @@
     font-weight: bold;
 }
-
 #leftnav a.addlink {
     margin-left: 0.25em;
     font-weight: normal;
 }
-
-#leftnav #navlist li a:link, #navlist li a:visited {
-    /* color: #336; */
-}
-
-#leftnav #navlist li a:hover, #navlist li a:active {
-    /* color: #C00; */
-}
-
-/*_____________________ CONTENT ____________________*/
-
+/*
+CONTENT
+*/
 #content-table {
     width: 100%;
 }
-
 #content {
-/*     width: 100%; */
-/*     margin-left: 1em; */
-/*     border-left: 1px solid gray; */
     padding: 0.75em 0.5em 15px 0.75em;
     background-color: #FFF;
 }
-
 #content h1, #content h2, #content h3, #content h4, #content h5 {
     margin: 0 0 .5em 0;
@@ -163,5 +127,4 @@
 #content h3 { font-size: 0.9rem; }
 #content h4 { font-size: 0.75rem; }
-
 #content p,
 #content ul,
@@ -171,10 +134,4 @@
     line-height: 130%;
 }
-
-/* li:not(.ui-tab) {
-    list-style-position: inside;
-    list-style: disc;
-    margin-left: 1.2em;
-} */
 ul.normal li,
 ol.normal li {
@@ -183,6 +140,7 @@
     margin-left: 1.2em;
 }
-
-/*_____________________ TABLES ____________________*/
+/*
+TABLES
+*/
 table {
 	border-size: 1px;
@@ -190,5 +148,4 @@
 	border-spacing: 0;
 }
-
 th {
 	padding: 2px;
@@ -197,10 +154,8 @@
 	white-space: nowrap;
 }
-
 td {
 	vertical-align: top;
     padding: 8px 6px 0 0;
 }
-
 table.list {
 	border-size: 1px;
@@ -208,5 +163,4 @@
 	margin: 6px 0;
 }
-
 table.list th {
 	padding: 0 6px 1px 2px;
@@ -215,7 +169,5 @@
     border-bottom: 2px solid #eee;
     background-color: #ddd;
-/*  border-bottom: 1px solid #000; */
-}
-
+}
 table.list td, #commandbox table td, .commandbox table td {
 	font-size: 0.7rem;
@@ -224,12 +176,10 @@
 	vertical-align: top;
 }
-
 table.list tr:hover, #commandbox table tr:hover, .commandbox table tr:hover {
     background: #FAF8C7 !important;
 }
-
-/*_____________________ COMMANDS ____________________*/
-
-/* We were using an ID, now using class. */
+/*
+COMMANDS
+*/
 #commandbox, .commandbox
 {
@@ -240,5 +190,4 @@
 	color: inherit;
 }
-
 .commanditem
 {
@@ -246,15 +195,12 @@
 	white-space: nowrap;
 }
-
 #commandbox form, .commandbox form {
     margin: 8px 0 0 0;
 }
-
-/* I replaced all instances of commandtext with commanditem on the SC admin, but leave it here for sites I didn't. */
+/* Keep for backwards-compatibility. */
 .commandtext
 {
 	padding-right: 1em;
 }
-
 .command_left
 {
@@ -262,5 +208,4 @@
 	white-space: nowrap;
 }
-
 .command_right
 {
@@ -270,7 +215,7 @@
 	float: right;
 }
-
-
-/*_____________________ FOOTER ____________________*/
+/*
+FOOTER
+*/
 #footer {
     clear: both;
@@ -283,5 +228,4 @@
     line-height: 100%;
 }
-
 #footer a:link,
 #footer a:visited {
@@ -289,5 +233,4 @@
     text-decoration: none;
 }
-
 #footer a:active,
 #footer a:hover {
@@ -295,17 +238,15 @@
     text-decoration: underline;
 }
-
-/* Form Defaults ---------------------------------------------------- */
-
+/*
+Form Defaults
+*/
 .sc-form {
     width: 100%;
     margin: 1em 0;
 }
-
 .sc-form-row {
     margin: .5em 0;
 }
 .sc-form-row:after { content: " "; display: block; visibility: hidden; clear: both; height: 0.1px; font-size: 0.1em; line-height: 0; } /* clear floats - Ydnar Hack */
-
 fieldset {
     margin: 1em 0 0 0;
@@ -313,5 +254,4 @@
 	border: 0;
 }
-
 legend {
     font-size: 90%;
@@ -320,5 +260,4 @@
 	margin: 0;
 }
-
 .sc-form textarea,
 .sc-tiny,
@@ -340,15 +279,12 @@
     border: none;
 }
-
 textarea {
     padding: 0 2px;
 }
-
 .sc-form-row label {
     font-size: 0.7rem;
     padding-top: 0.25em;
 }
-
-.sc-form-row label { /* Modified by Matt. Was .sc-form-row>label:first-child */
+.sc-form-row label {
     display: block;
     width: 120px;
@@ -358,5 +294,4 @@
     font-style: italic;
 }
-
 .sc-form-row label.sc-label-secondary {
     display: inline;
@@ -367,14 +302,7 @@
     font-style: normal;
 }
-
 .sc-form label span {
     visibility: hidden;
 }
-
-/*.sc-form-row input + input {
-    margin-top: .5rem;
-    margin-bottom: .5rem;
-} */
-
 input[type="submit"],
 input[type="button"] {
@@ -384,5 +312,4 @@
     background-color: #eee;
 }
-
 .sc-submit-buttons {
     margin: 20px 0 20px 130px;
@@ -391,9 +318,7 @@
     margin-left: 130px;
 }
-
 label.sc-radio-label {
     width: auto;
 }
-
 /* Hide foundation elements for sites still using old admin css. */
 .sc-msg .close {
Index: /trunk/css/codebase.inc.css
===================================================================
--- /trunk/css/codebase.inc.css	(revision 740)
+++ /trunk/css/codebase.inc.css	(revision 741)
@@ -1,14 +1,14 @@
-/**
- * codebase.inc.css
- *
- * CSS used in codebase templates and scripts that generate HTML. Do not arbitrarily
- * edit this code! This file is used between many sites and modifying it may result
- * in something breaking. Instead, overwrite these values in a specific site by
- * adding new definitions to a screen.css file.
- */
+/*
+* codebase.inc.css
+*
+* CSS used in codebase templates and scripts that generate HTML. Do not arbitrarily
+* edit this code! This file is used between many sites and modifying it may result
+* in something breaking. Instead, overwrite these values in a specific site by
+* adding new definitions to a screen.css file.
+*/
 
-/* App.inc.php ------------------------------------------------------ */
+/* App.inc.php */
 .sc-msg {
-    z-index: 2000000000;  /* Close to the maximum of a 32-bit integer. */
+    z-index: 2000000000; /* Close to the maximum of a 32-bit integer. */
     margin: 1em 0;
     background: #fafafa;
@@ -43,6 +43,5 @@
 .sc-msg > .sc-msg-warning { background-color: #9200AE; }
 .sc-msg > .sc-msg-error { background-color: #b34; }
-
-/* PEdit.inc.php ---------------------------------------------------- */
+/* PEdit.inc.php */
 .sc-pedit-form {}
 .sc-pedit-item,
@@ -64,12 +63,10 @@
     white-space: nowrap;
 }
-
-/* Utilities.inc.php ------------------------------------------------ */
+/* Utilities.inc.php */
 .sc-highlightwords {
     background-color: #EBFE00;
     color: #000;
 }
-
-/* Captcha.inc.php -------------------------------------------------- */
+/* Captcha.inc.php */
 #sc-captcha {
     font-size: 0.5em;
Index: /trunk/css/utilities.inc.css
===================================================================
--- /trunk/css/utilities.inc.css	(revision 740)
+++ /trunk/css/utilities.inc.css	(revision 741)
@@ -1,13 +1,10 @@
 /**
- * utilities.inc.css
- *
- * CSS used often in Strangecode applications. Do not arbitrarily
- * edit this code! This file is used between many sites and modifying it may result
- * in something breaking. Instead, overwrite these values in a specific site by
- * adding new definitions to a screen.css file.
- */
+* utilities.inc.css
+* Global utility styles often in Strangecode applications.
+*/
 
-/*_____________________ FORMS ____________________*/
-
+/*
+FORMS
+*/
 input.sc-micro, textarea.sc-micro, select.sc-micro,
 input.sc-tiny, textarea.sc-tiny, select.sc-tiny,
@@ -19,5 +16,4 @@
     box-sizing: border-box;
 }
-
 /*
 The following widths are calculated to include a small right-margin and be equally divisible so the right edges align.
@@ -39,11 +35,11 @@
 input.sc-large, textarea.sc-large, select.sc-large, label.sc-large      { width: 43.5rem; }
 input.sc-full, textarea.sc-full, select.sc-full, label.sc-full          { width: 100%; }
-
 textarea.sc-twolines, select.sc-twolines              { height: 3.5rem; }
 textarea.sc-short, select.sc-short                    { height: 8rem; }
 textarea.sc-tall, select.sc-tall                      { height: 25rem; }
 textarea.sc-fullscreen, select.sc-fullscreen          { height: 40rem; }
-
-/*_____________________ UTILITIES ____________________*/
+/*
+UTILITIES
+*/
 .sc-center { text-align: center; }
 .sc-clearboth { clear: both; }
@@ -77,5 +73,4 @@
     text-overflow: ellipsis;
 }
-
 /* .sc-pkg class wraps enclosing block element around inner floated elements */
 .sc-pkg:after { content: " "; display: block; visibility: hidden; clear: both; height: 0.1px; font-size: 0.1em; line-height: 0.0; }
Index: /trunk/lib/Cart.inc.php
===================================================================
--- /trunk/lib/Cart.inc.php	(revision 740)
+++ /trunk/lib/Cart.inc.php	(revision 741)
@@ -40,5 +40,5 @@
         if ($p = mysql_fetch_assoc($qid)) {
             $cart->add($product_id, $p['price'], 1, array(
-                'title' => $p['title'],
+                'name' => $p['name'],
                 'shipping' => $p['shipping'],
                 'weight' => $p['weight'],
@@ -62,5 +62,5 @@
     // User views cart.
     foreach ($cart->getList() as $item) {
-        printf("Item: %s\nQty: %s\nPrice: %s\n\n", $item['title'], $item['quantity'], $item['price']);
+        printf("Item: %s\nQty: %s\nPrice: %s\n\n", $item['name'], $item['quantity'], $item['price']);
     }
     break;
@@ -132,5 +132,5 @@
     * @param    float   $price      Price-per-quantity-unit for the item
     * @param    float   $quantity   Quantity of items (can be fractional unites?)
-    * @param    array   $specs      An array of additional specifications (title, weight, etc)
+    * @param    array   $specs      An array of additional specifications (name, weight, etc)
     * @return   float               The new adjusted quantity of this item.
     * @author   Quinn Comendant <quinn@strangecode.com>
Index: /trunk/lib/Utilities.inc.php
===================================================================
--- /trunk/lib/Utilities.inc.php	(revision 740)
+++ /trunk/lib/Utilities.inc.php	(revision 741)
@@ -1683,2 +1683,18 @@
     }
 }
+
+/*
+* Test if a string is valid json.
+* https://stackoverflow.com/questions/6041741/fastest-way-to-check-if-a-string-is-json-in-php
+*
+* @access   public
+* @param    string  $str  The string to test.
+* @return   boolean       True if the string is valid json.
+* @author   Quinn Comendant <quinn@strangecode.com>
+* @since    06 Dec 2020 18:41:51
+*/
+function isJSON($str)
+{
+    json_decode($str);
+    return (json_last_error() === JSON_ERROR_NONE);
+}
