Changeset 741
- Timestamp:
- Dec 29, 2020 3:18:44 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/css/admin.inc.css
r457 r741 1 /** 2 * admin.inc.css 3 * 4 * CSS for a Strangecode administration site. 5 */ 1 /* 2 * admin.inc.css 3 */ 6 4 7 /*_____________________ GLOBAL ____________________*/ 5 /* 6 GLOBAL 7 */ 8 8 body { 9 9 background: #fff; … … 13 13 color: #000; 14 14 } 15 16 15 a:link, 17 16 a:visited { color: #336; text-decoration: underline; } 18 17 a:hover { color: #C30; text-decoration: none; } 19 18 a:active { color: #336; } 20 21 19 pre { margin: 0; } 22 23 /*_____________________ MISC ____________________*/ 24 25 /* 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? */ 26 27 /* Why does having a form change the presentation of the page? Don't do that. */ 20 /* 21 MISC 22 */ 28 23 form { margin: 0; } 29 30 24 form label { 31 25 font-size: 70%; … … 33 27 font-weight: bold; 34 28 } 35 36 29 .help, 37 30 .sc-help, 38 31 .commandtext, 39 32 .commanditem { font-size: 70%; } 40 41 33 /* For fv err applied to tds. */ 42 34 td.sc-msg-warning, … … 48 40 border: none; 49 41 } 50 51 52 /*_____________________ HEADER ____________________*/42 /* 43 HEADER 44 */ 53 45 #userinfo { 54 46 width: 98%; … … 58 50 text-align: right; 59 51 } 60 61 52 #userinfo p { 62 53 margin: 0; 63 54 padding: 0; 64 55 } 65 66 56 #container { 67 57 width: 98%; … … 70 60 border: 1px solid gray; 71 61 } 72 73 62 #top { 74 63 border-bottom: 1px solid gray; … … 76 65 padding: .5em; 77 66 } 78 79 67 #top h1 { 80 68 margin: 0; … … 83 71 color: #000; 84 72 } 85 86 /*_____________________ NAVIGATION ____________________*/ 73 /* 74 NAVIGATION 75 */ 87 76 #leftnav { 88 77 float: left; … … 93 82 background-color: #EEE; 94 83 } 95 96 84 #leftnav ul { 97 85 padding: 0; … … 99 87 width: 9em; 100 88 } 101 102 89 #leftnav #navlist li { 103 90 list-style: none; … … 109 96 font-weight: bold; 110 97 } 111 112 98 #leftnav #navlist li a { 113 99 text-decoration: none; 114 100 padding: 1px; 115 101 } 116 117 102 #leftnav #navlist li.label { 118 103 color: #999; … … 121 106 font-weight: bold; 122 107 } 123 124 108 #leftnav a.addlink { 125 109 margin-left: 0.5em; 126 110 font-weight: normal; 127 111 } 128 129 112 #leftnav #navlist li a:link, #navlist li a:visited { 130 113 color: #336; 131 114 } 132 133 115 #leftnav #navlist li a:hover, #navlist li a:active { 134 116 color: #C00; 135 117 } 136 137 /*_____________________ CONTENT ____________________*/ 118 /* 119 CONTENT 120 */ 138 121 #content { 139 122 margin-left: 9em; … … 142 125 background-color: #FFF; 143 126 } 144 145 127 #content h1, #content h2, #content h3, #content h4, #content h5 { 146 128 margin: 0 0 .5em 0; … … 150 132 #content h3 { font-size: 90%; } 151 133 #content h4 { font-size: 75%; } 152 153 134 #content p { 154 135 margin: 0 0 .5em 0; … … 156 137 line-height: 130%; 157 138 } 158 159 139 #content li { 160 140 margin: 0 0 0 0; … … 162 142 line-height: 100%; 163 143 } 164 165 /*_____________________ TABLES ____________________*/ 166 /* BEAU: I copied this from NEXT. Please help!*/144 /* 145 TABLES 146 */ 167 147 table { 168 148 border-size: 1px; … … 170 150 border-spacing: 0; 171 151 } 172 173 152 th { 174 153 padding: 2px; … … 177 156 white-space: nowrap; 178 157 } 179 180 158 td { 181 159 vertical-align: top; 182 160 padding: 8px 6px 0 0; 183 161 } 184 185 162 table.list { 186 163 border-size: 1px; … … 188 165 margin: 4px 0; 189 166 } 190 191 167 table.list th { 192 168 padding: 0 6px 1px 2px; … … 195 171 border-bottom: 2px solid #eee; 196 172 background-color: #ddd; 197 /* border-bottom: 1px solid #000; */ 198 } 199 173 } 200 174 table.list td, #commandbox table td { 201 175 font-size: 70%; … … 204 178 vertical-align: top; 205 179 } 206 207 180 table.list tr:hover, #commandbox table tr:hover { 208 181 background: #FAF8C7; 209 182 } 210 211 212 /* BEAU: The old stuff that was here... 213 #content table { 214 background-color: #FFF; 215 } 216 217 #content th { 218 padding: 2px; 219 text-align: left; 220 vertical-align: middle; 221 white-space: nowrap; 222 } 223 224 #content td { 225 vertical-align: top; 226 } 227 228 #content table.list { 229 width: 99%; 230 margin: 4px 0; 231 background-color: #FFF; 232 } 233 234 #content table.list th { 235 padding-right: 6px; 236 font-size: 70%; 237 background-color: #CCC; 238 border-bottom: 1px solid #000; 239 } 240 241 #content table.list td { 242 font-size: 70%; 243 padding: 2px; 244 border-bottom: 1px dotted #000; 245 } 246 */ 247 248 /*_____________________ COMMANDS ____________________*/ 249 250 /* Should this be an ID??? */ 183 /* 184 COMMANDS 185 */ 251 186 #commandbox, .commandbox 252 187 { … … 257 192 color: inherit; 258 193 } 259 260 194 .commanditem 261 195 { … … 263 197 white-space: nowrap; 264 198 } 265 266 199 #commandbox .form, .commandbox .form, #commandbox form, .commandbox form, { 267 200 margin-top: 8px; 268 201 } 269 270 /* I replaced all instances of commandtext with commanditem on the SC admin, but leave it here for sites I didn't. */271 202 .commandtext 272 203 { 273 204 padding-right: 1em; 274 205 } 275 276 206 .command_left 277 207 { … … 279 209 white-space: nowrap; 280 210 } 281 282 211 .command_right 283 212 { … … 287 216 float: right; 288 217 } 289 290 291 /*_____________________ FOOTER ____________________*/218 /* 219 FOOTER 220 */ 292 221 #footer { 293 222 clear: both; … … 300 229 line-height: 100%; 301 230 } 302 303 231 #footer a:link, 304 232 #footer a:visited { … … 306 234 text-decoration: none; 307 235 } 308 309 236 #footer a:active, 310 237 #footer a:hover { -
trunk/css/admin2.inc.css
r731 r741 1 /** 2 * admin2.inc.css 3 * 4 * CSS for the Strangecode administration sites. 5 */ 1 /* 2 * admin2.inc.css 3 */ 6 4 7 /*_____________________ GLOBAL ____________________*/ 5 /* 6 GLOBAL 7 */ 8 8 body { 9 9 background: #fff; … … 13 13 color: #000; 14 14 } 15 16 15 a:link, 17 16 a:visited { color: #227899; text-decoration: none; border: none; } 18 17 a:hover { color: #000; text-decoration: none; border: none; } 19 18 a:active { color: #00b8ff; text-decoration: none; border: none; } 20 21 19 pre { margin: 0; } 22 23 /*_____________________ MISC ____________________*/ 24 25 /* 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? */ 26 27 /* Why does having a form change the presentation of the page? Don't do that. */ 28 /* form { margin: 0; } 29 30 form label { 31 font-size: 70%; 32 max-width: 25em; 33 font-weight: bold; 34 } 35 */ 20 /* 21 MISC 22 */ 36 23 .help, 37 24 .sc-help, 38 25 .commandtext, 39 26 .commanditem { font-size: 0.7rem; } 40 41 27 /* For fv err applied to tds. */ 42 28 td.sc-msg-warning, … … 48 34 border: none; 49 35 } 50 51 36 img { 52 37 border: 0; 53 38 vertical-align: middle; 54 39 } 55 56 40 #container-columns { 57 41 width: 100%; 58 42 } 59 60 /*_____________________ HEADER ____________________*/ 43 /* 44 HEADER 45 */ 61 46 #userinfo { 62 47 width: 98%; … … 65 50 text-align: right; 66 51 } 67 68 52 #userinfo p { 69 53 margin: 0; 70 54 padding: 0; 71 55 } 72 73 56 #container { 74 57 width: 98%; … … 77 60 border: 1px solid gray; 78 61 } 79 80 62 #top { 81 63 border-bottom: 1px solid gray; … … 83 65 padding: .5em; 84 66 } 85 86 67 #top h1 { 87 68 margin: 0; … … 90 71 color: #000; 91 72 } 92 93 /*_____________________ NAVIGATION ____________________*/ 73 /* 74 NAVIGATION 75 */ 94 76 #leftnav { 95 77 /* float: left; */ … … 101 83 background-color: #EEE; 102 84 } 103 104 85 #leftnav ul { 105 86 padding: 0; 106 87 margin: 0; 107 88 } 108 109 89 #leftnav #navlist li { 110 90 list-style: none; … … 116 96 font-weight: bold; 117 97 } 118 119 98 #leftnav #navlist li a { 120 99 text-decoration: none; 121 100 padding: 1px; 122 101 } 123 124 102 #leftnav #navlist li.label { 125 103 color: #999; … … 128 106 font-weight: bold; 129 107 } 130 131 108 #leftnav a.addlink { 132 109 margin-left: 0.25em; 133 110 font-weight: normal; 134 111 } 135 136 #leftnav #navlist li a:link, #navlist li a:visited { 137 /* color: #336; */ 138 } 139 140 #leftnav #navlist li a:hover, #navlist li a:active { 141 /* color: #C00; */ 142 } 143 144 /*_____________________ CONTENT ____________________*/ 145 112 /* 113 CONTENT 114 */ 146 115 #content-table { 147 116 width: 100%; 148 117 } 149 150 118 #content { 151 /* width: 100%; */152 /* margin-left: 1em; */153 /* border-left: 1px solid gray; */154 119 padding: 0.75em 0.5em 15px 0.75em; 155 120 background-color: #FFF; 156 121 } 157 158 122 #content h1, #content h2, #content h3, #content h4, #content h5 { 159 123 margin: 0 0 .5em 0; … … 163 127 #content h3 { font-size: 0.9rem; } 164 128 #content h4 { font-size: 0.75rem; } 165 166 129 #content p, 167 130 #content ul, … … 171 134 line-height: 130%; 172 135 } 173 174 /* li:not(.ui-tab) {175 list-style-position: inside;176 list-style: disc;177 margin-left: 1.2em;178 } */179 136 ul.normal li, 180 137 ol.normal li { … … 183 140 margin-left: 1.2em; 184 141 } 185 186 /*_____________________ TABLES ____________________*/ 142 /* 143 TABLES 144 */ 187 145 table { 188 146 border-size: 1px; … … 190 148 border-spacing: 0; 191 149 } 192 193 150 th { 194 151 padding: 2px; … … 197 154 white-space: nowrap; 198 155 } 199 200 156 td { 201 157 vertical-align: top; 202 158 padding: 8px 6px 0 0; 203 159 } 204 205 160 table.list { 206 161 border-size: 1px; … … 208 163 margin: 6px 0; 209 164 } 210 211 165 table.list th { 212 166 padding: 0 6px 1px 2px; … … 215 169 border-bottom: 2px solid #eee; 216 170 background-color: #ddd; 217 /* border-bottom: 1px solid #000; */ 218 } 219 171 } 220 172 table.list td, #commandbox table td, .commandbox table td { 221 173 font-size: 0.7rem; … … 224 176 vertical-align: top; 225 177 } 226 227 178 table.list tr:hover, #commandbox table tr:hover, .commandbox table tr:hover { 228 179 background: #FAF8C7 !important; 229 180 } 230 231 /*_____________________ COMMANDS ____________________*/ 232 233 /* We were using an ID, now using class. */ 181 /* 182 COMMANDS 183 */ 234 184 #commandbox, .commandbox 235 185 { … … 240 190 color: inherit; 241 191 } 242 243 192 .commanditem 244 193 { … … 246 195 white-space: nowrap; 247 196 } 248 249 197 #commandbox form, .commandbox form { 250 198 margin: 8px 0 0 0; 251 199 } 252 253 /* I replaced all instances of commandtext with commanditem on the SC admin, but leave it here for sites I didn't. */ 200 /* Keep for backwards-compatibility. */ 254 201 .commandtext 255 202 { 256 203 padding-right: 1em; 257 204 } 258 259 205 .command_left 260 206 { … … 262 208 white-space: nowrap; 263 209 } 264 265 210 .command_right 266 211 { … … 270 215 float: right; 271 216 } 272 273 274 /*_____________________ FOOTER ____________________*/217 /* 218 FOOTER 219 */ 275 220 #footer { 276 221 clear: both; … … 283 228 line-height: 100%; 284 229 } 285 286 230 #footer a:link, 287 231 #footer a:visited { … … 289 233 text-decoration: none; 290 234 } 291 292 235 #footer a:active, 293 236 #footer a:hover { … … 295 238 text-decoration: underline; 296 239 } 297 298 /* Form Defaults ---------------------------------------------------- */ 299 240 /* 241 Form Defaults 242 */ 300 243 .sc-form { 301 244 width: 100%; 302 245 margin: 1em 0; 303 246 } 304 305 247 .sc-form-row { 306 248 margin: .5em 0; 307 249 } 308 250 .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 */ 309 310 251 fieldset { 311 252 margin: 1em 0 0 0; … … 313 254 border: 0; 314 255 } 315 316 256 legend { 317 257 font-size: 90%; … … 320 260 margin: 0; 321 261 } 322 323 262 .sc-form textarea, 324 263 .sc-tiny, … … 340 279 border: none; 341 280 } 342 343 281 textarea { 344 282 padding: 0 2px; 345 283 } 346 347 284 .sc-form-row label { 348 285 font-size: 0.7rem; 349 286 padding-top: 0.25em; 350 287 } 351 352 .sc-form-row label { /* Modified by Matt. Was .sc-form-row>label:first-child */ 288 .sc-form-row label { 353 289 display: block; 354 290 width: 120px; … … 358 294 font-style: italic; 359 295 } 360 361 296 .sc-form-row label.sc-label-secondary { 362 297 display: inline; … … 367 302 font-style: normal; 368 303 } 369 370 304 .sc-form label span { 371 305 visibility: hidden; 372 306 } 373 374 /*.sc-form-row input + input {375 margin-top: .5rem;376 margin-bottom: .5rem;377 } */378 379 307 input[type="submit"], 380 308 input[type="button"] { … … 384 312 background-color: #eee; 385 313 } 386 387 314 .sc-submit-buttons { 388 315 margin: 20px 0 20px 130px; … … 391 318 margin-left: 130px; 392 319 } 393 394 320 label.sc-radio-label { 395 321 width: auto; 396 322 } 397 398 323 /* Hide foundation elements for sites still using old admin css. */ 399 324 .sc-msg .close { -
trunk/css/codebase.inc.css
r666 r741 1 /* *2 3 4 5 6 7 8 1 /* 2 * codebase.inc.css 3 * 4 * CSS used in codebase templates and scripts that generate HTML. Do not arbitrarily 5 * edit this code! This file is used between many sites and modifying it may result 6 * in something breaking. Instead, overwrite these values in a specific site by 7 * adding new definitions to a screen.css file. 8 */ 9 9 10 /* App.inc.php ------------------------------------------------------*/10 /* App.inc.php */ 11 11 .sc-msg { 12 z-index: 2000000000; 12 z-index: 2000000000; /* Close to the maximum of a 32-bit integer. */ 13 13 margin: 1em 0; 14 14 background: #fafafa; … … 43 43 .sc-msg > .sc-msg-warning { background-color: #9200AE; } 44 44 .sc-msg > .sc-msg-error { background-color: #b34; } 45 46 /* PEdit.inc.php ---------------------------------------------------- */ 45 /* PEdit.inc.php */ 47 46 .sc-pedit-form {} 48 47 .sc-pedit-item, … … 64 63 white-space: nowrap; 65 64 } 66 67 /* Utilities.inc.php ------------------------------------------------ */ 65 /* Utilities.inc.php */ 68 66 .sc-highlightwords { 69 67 background-color: #EBFE00; 70 68 color: #000; 71 69 } 72 73 /* Captcha.inc.php -------------------------------------------------- */ 70 /* Captcha.inc.php */ 74 71 #sc-captcha { 75 72 font-size: 0.5em; -
trunk/css/utilities.inc.css
r666 r741 1 1 /** 2 * utilities.inc.css 3 * 4 * CSS used often in Strangecode applications. Do not arbitrarily 5 * edit this code! This file is used between many sites and modifying it may result 6 * in something breaking. Instead, overwrite these values in a specific site by 7 * adding new definitions to a screen.css file. 8 */ 2 * utilities.inc.css 3 * Global utility styles often in Strangecode applications. 4 */ 9 5 10 /*_____________________ FORMS ____________________*/ 11 6 /* 7 FORMS 8 */ 12 9 input.sc-micro, textarea.sc-micro, select.sc-micro, 13 10 input.sc-tiny, textarea.sc-tiny, select.sc-tiny, … … 19 16 box-sizing: border-box; 20 17 } 21 22 18 /* 23 19 The following widths are calculated to include a small right-margin and be equally divisible so the right edges align. … … 39 35 input.sc-large, textarea.sc-large, select.sc-large, label.sc-large { width: 43.5rem; } 40 36 input.sc-full, textarea.sc-full, select.sc-full, label.sc-full { width: 100%; } 41 42 37 textarea.sc-twolines, select.sc-twolines { height: 3.5rem; } 43 38 textarea.sc-short, select.sc-short { height: 8rem; } 44 39 textarea.sc-tall, select.sc-tall { height: 25rem; } 45 40 textarea.sc-fullscreen, select.sc-fullscreen { height: 40rem; } 46 47 /*_____________________ UTILITIES ____________________*/ 41 /* 42 UTILITIES 43 */ 48 44 .sc-center { text-align: center; } 49 45 .sc-clearboth { clear: both; } … … 77 73 text-overflow: ellipsis; 78 74 } 79 80 75 /* .sc-pkg class wraps enclosing block element around inner floated elements */ 81 76 .sc-pkg:after { content: " "; display: block; visibility: hidden; clear: both; height: 0.1px; font-size: 0.1em; line-height: 0.0; } -
trunk/lib/Cart.inc.php
r611 r741 40 40 if ($p = mysql_fetch_assoc($qid)) { 41 41 $cart->add($product_id, $p['price'], 1, array( 42 ' title' => $p['title'],42 'name' => $p['name'], 43 43 'shipping' => $p['shipping'], 44 44 'weight' => $p['weight'], … … 62 62 // User views cart. 63 63 foreach ($cart->getList() as $item) { 64 printf("Item: %s\nQty: %s\nPrice: %s\n\n", $item[' title'], $item['quantity'], $item['price']);64 printf("Item: %s\nQty: %s\nPrice: %s\n\n", $item['name'], $item['quantity'], $item['price']); 65 65 } 66 66 break; … … 132 132 * @param float $price Price-per-quantity-unit for the item 133 133 * @param float $quantity Quantity of items (can be fractional unites?) 134 * @param array $specs An array of additional specifications ( title, weight, etc)134 * @param array $specs An array of additional specifications (name, weight, etc) 135 135 * @return float The new adjusted quantity of this item. 136 136 * @author Quinn Comendant <quinn@strangecode.com> -
trunk/lib/Utilities.inc.php
r738 r741 1683 1683 } 1684 1684 } 1685 1686 /* 1687 * Test if a string is valid json. 1688 * https://stackoverflow.com/questions/6041741/fastest-way-to-check-if-a-string-is-json-in-php 1689 * 1690 * @access public 1691 * @param string $str The string to test. 1692 * @return boolean True if the string is valid json. 1693 * @author Quinn Comendant <quinn@strangecode.com> 1694 * @since 06 Dec 2020 18:41:51 1695 */ 1696 function isJSON($str) 1697 { 1698 json_decode($str); 1699 return (json_last_error() === JSON_ERROR_NONE); 1700 }
Note: See TracChangeset
for help on using the changeset viewer.