=A few more phpStorm suggestions, mainly in PHPDocs
| | |
| | | this.shareListModal.querySelector('#share-email').value = ''; |
| | | |
| | | // Update shared users list |
| | | this.loadSharedUsers(this.state.currentListId); |
| | | await this.loadSharedUsers(this.state.currentListId); |
| | | |
| | | // Show success message |
| | | showToast(`Invitation sent to ${email}`); |
| | |
| | | |
| | | while (this.popupQueue.length > 0) { |
| | | const notification = this.popupQueue.shift(); |
| | | await this.showToast(notification.message, notification.type, notification.actions); |
| | | this.showToast(notification.message, notification.type, notification.actions); |
| | | |
| | | // Small delay between notifications |
| | | if (this.popupQueue.length > 0) { |
| | |
| | | if (target) { |
| | | target.append(element.element); |
| | | if (groupId) { |
| | | await this.handleReorder(upload.field, groupId); |
| | | this.handleReorder(upload.field, groupId); |
| | | } |
| | | } |
| | | await this.stores.uploads.save(upload); |
| | |
| | | await this.addToGroup(uploadId, targetGroupId); |
| | | } |
| | | |
| | | await this.handleReorder(fieldId, targetGroupId); |
| | | this.handleReorder(fieldId, targetGroupId); |
| | | this.selectionHandlers.get(fieldId)?.clearSelection(); |
| | | } |
| | | |
| | |
| | | this.trackedChanges = new Map(); |
| | | this.hasChanges = false; |
| | | |
| | | this.loadItems(); |
| | | await this.loadItems(); |
| | | |
| | | // Notify user of successful save |
| | | this.a11y.announce(`Changes saved successfully`); |
| | |
| | | } |
| | | |
| | | // Initialize gallery |
| | | this.initializeGalleryFromData(); |
| | | await this.initializeGalleryFromData(); |
| | | } catch (error) { |
| | | console.error('Gallery initialization failed:', error); |
| | | this.handleInitializationError(); |
| | |
| | | protected static Membership $membershipConfig; |
| | | protected static Site $instance; |
| | | protected static string $icons = 'regular'; |
| | | /** |
| | | * @var array Dashboard config |
| | | */ |
| | | |
| | | protected static string $dashboardTitle; |
| | | |
| | | /** |
| | |
| | | // jvbInlineStyles('style'); |
| | | ?> |
| | | <style> |
| | | :root{ |
| | | /* Layout */ |
| | | --narrow: min(500px, 50vw); |
| | | --maxWidth: min(768px, 65vw); |
| | | --alignWide: min(1024px, 90vw); |
| | | --alignMed: min(962px, 82.5vw); |
| | | :root { |
| | | /***************************** |
| | | Layout |
| | | *****************************/ |
| | | --half: min(384px, 17.5vw); |
| | | --narrow: min(500px, 62.5vw); |
| | | --content: min(768px, 65vw); |
| | | --wider: min(900px, 75vw); |
| | | --wide: min(1024px, 90vw); |
| | | --full: 100vw; |
| | | /* Margin */ |
| | | --mr: auto; |
| | | --ml: auto; |
| | | --mt: 1rem; |
| | | --mb: 1rem; |
| | | --setMargin: var(--mt) var(--mr) var(--mb) var(--ml); |
| | | --insetMargin: var(--mt) calc((var(--content) - var(--narrow)) / 2 + var(--mr)) var(--mb) var(--ml); |
| | | --height: 4rem; |
| | | --doubleHeight: 8rem; |
| | | --offHeight: 5rem; |
| | | --maxHeight: calc(100vh - var(--height) - var(--height)); |
| | | --offScreen: -200vw; |
| | | |
| | | --gap: .5rem; |
| | | --wrap: wrap; |
| | | --aside: min(500px, calc(100vw - 2rem)); |
| | | |
| | | /***************************** |
| | | Sizing |
| | | *****************************/ |
| | | --chip: 1.5rem; |
| | | --chipchip: 3rem; |
| | | --chip_: 2rem; |
| | | --btn: 4rem; |
| | | --btn_: 5rem; |
| | | --btnbtn: 8rem; |
| | | --maxHeight: calc(100vh - var(--btnbtn)); |
| | | |
| | | /***************************** |
| | | Flex |
| | | *****************************/ |
| | | --dir: row; |
| | | --justify: center; |
| | | --align: center; |
| | | --dir: row; |
| | | /* Typography */ |
| | | --w: 1.2em; /** Icon **/ |
| | | --wrap: wrap; |
| | | --gap: .5rem; |
| | | |
| | | --filter: grayscale(.3) sepia(.4); |
| | | /***************************** |
| | | Typography |
| | | *****************************/ |
| | | --w: 1.2em; /** For icons **/ |
| | | |
| | | --font-base: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif; |
| | | --heading: 'Aleo', var(--font-base); |
| | | --body: 'Josefin Slab', var(--font-base); |
| | | --hWeight: 900; |
| | | --hlight: 400; |
| | | --bWeight: 400; |
| | | --bBold: 700; |
| | | --bLight: 200; |
| | | /* Font sizes */ |
| | | --enormous: calc(26vh - 4rem); |
| | | --xxxlarge: clamp(2.5rem, 1.429rem + 2.857vw, 4rem); |
| | | --xxlarge: clamp(2rem, 1.286rem + 1.905vw, 3rem); |
| | | --xlarge: clamp(1.6rem, .957rem + 1.714vw, 2.5rem); |
| | | --large: clamp(1.3rem, .6rem + 1.867vw, 2rem); |
| | | --xmedium: clamp(1.4rem, .971rem + 1.143vw, 2rem); |
| | | --medium: clamp(1.1rem, .993rem + .286vw, 1.25rem); |
| | | --small: clamp(.95rem, .879rem + .19vw, 1.05rem); |
| | | --extra-small: clamp(.75rem, 1.1337rem + -1.2278vw, .059375rem); |
| | | /* Colours |
| | | For best results, generate colours from base colours using: https://uicolors.app/generate/ |
| | | or sass darken/lighten by 5%: http://scg.ar-ch.org/ |
| | | */ |
| | | --light-0: #fafafa; |
| | | --light-50: #fcfbfb; |
| | | --light-100: #f1eded; |
| | | --light-200: #e6dfdf; |
| | | --dark-0: #100404; |
| | | --dark-50: #201212; |
| | | --dark-100: #322423; |
| | | --dark-200: #443635; |
| | | --action-0: #B7332E; |
| | | --action-50: #a32d29; |
| | | --action-100: #8e2824; |
| | | --action-200: #7a221f; |
| | | --secondary-0: #E8A737; |
| | | --secondary-50: #e59d20; |
| | | --secondary-100: #d48f18; |
| | | --secondary-200: #bd7f16; |
| | | --fw-h-light: 400; |
| | | --fw-h: 900; |
| | | --fw-h-bold: 900; |
| | | --fw-b-light: 200; |
| | | --fw-b: 400; |
| | | --fw-b-bold: 700; |
| | | |
| | | --success: #4CAF50; |
| | | --warning: #E8A737; |
| | | --error: #B7332E; |
| | | --txt-small: clamp(.75rem, 1.1337rem + -1.2278vw, .059375rem); |
| | | --txt-x-small: clamp(.95rem, .879rem + .19vw, 1.05rem); |
| | | --txt-medium: clamp(1.1rem, .993rem + .286vw, 1.25rem); |
| | | --txt-x-medium: clamp(1.4rem, .971rem + 1.143vw, 2rem); |
| | | --txt-large: clamp(1.3rem, .6rem + 1.867vw, 2rem); |
| | | --txt-x-large:clamp(1.6rem, .957rem + 1.714vw, 2.5rem); |
| | | --txt-xx-large: clamp(2rem, 1.286rem + 1.905vw, 3rem); |
| | | --txt-xxx-large: clamp(2.5rem, 1.429rem + 2.857vw, 4rem); |
| | | --txt-enormous: calc(26vh - 4rem); |
| | | |
| | | /***************************** |
| | | Colours |
| | | *****************************/ |
| | | --filter: grayscale(.3) sepia(.4); |
| | | --filterNone: grayscale(0) sepia(0); |
| | | |
| | | --mix-blend-mode: darken; |
| | | --coverBlend: overlay; |
| | | --coverIndex: 2; |
| | | --light-0: 239,239,239; /* #efefef; */ |
| | | --light-50: 226,226,226; /* #e2e2e2; */ |
| | | --light-100: 213,213,213; /* #d5d5d5; */ |
| | | --light-200: 201,201,201; /* #c9c9c9; */ |
| | | |
| | | --dark-0: 21,21,21; /* #151515; */ |
| | | --dark-50: 34,34,34; /* #222222; */ |
| | | --dark-100: 46,46,46; /* #2e2e2e; */ |
| | | --dark-200: 59,59,59; /* #3b3b3b; */ |
| | | |
| | | --action-0: 255,0,128; /* #ff0080; */ |
| | | --action-50: 255,38,146; /* #ff2492; */ |
| | | --action-100: 255,71,164; /* #ff47a4; */ |
| | | --action-200: 255,107,181; /* #ff6bb5; */ |
| | | --action-contrast: var(--light-0); |
| | | --secondary-contrast: var(--light-0); |
| | | --light-rgb: 250,250,250; |
| | | --dark-rgb: 16,4,4; |
| | | --action-rgb: 183,51,46; |
| | | --secondary-rgb: 232,167,55; |
| | | |
| | | --rgba-subtle: rgba(var(--c),.5); |
| | | --rgba-subtle-hover: rgba(var(--c),.1); |
| | | --action-comp: oklch(from rgb(var(--action-0)) .8 .26 h); |
| | | --action-tri: oklch(from rgb(var(--action-0)) .82 .2 calc(h - 120)); |
| | | --action-mono: oklch(from rgb(var(--action-0)) .3 .04 h); |
| | | --secondary-0: 214,145,33; /* #D69121; */ |
| | | --secondary-50: 255,196,33; /* #ffc421; */ |
| | | --secondary-100: 255,205,68;/* #ffcd44; */ |
| | | --secondary-200: 255,215,104;/* #ffd768; */ |
| | | --secondary-contrast: var(--light-0); |
| | | --secondary-comp: oklch(from rgb(var(--secondary-0)) .8 .26 h); |
| | | --secondary-tri: oklch(from rgb(var(--secondary-0)) .82 .2 calc(h - 120)); |
| | | --secondary-mono: oklch(from rgb(var(--secondary-0)) .3 .04 h); |
| | | |
| | | --success: 76,175,80; /* #4CAF50; */ |
| | | --successLight: 234,246,235; /* #eaf6eb; */ |
| | | --successDark: 14,33,15; /* #0e210f; */ |
| | | --successBack: var(--successLight); |
| | | --successText: var(--successDark); |
| | | --warning: 232,167,55; /* #E8A737; */ |
| | | --warningLight: 253,247,238;/* #fdf7ee; */ |
| | | --warningDark: 52,35,6; /* #342306; */ |
| | | --warningBack: var(--warningLight); |
| | | --warningText: var(--warningDark); |
| | | --error: 183,51,46; /* #B7332E; */ |
| | | --errorLight: 250,235,234; /* #faebea; */ |
| | | --errorDark: 40,11,10; /* #280b0a; */ |
| | | --errorBack: var(--errorLight); |
| | | --errorText: var(--errorDark); |
| | | |
| | | --base: var(--light-0); |
| | | --base-50: var(--light-50); |
| | | --base-100: var(--light-100); |
| | | --base-200: var(--light-200); |
| | | |
| | | --contrast: var(--dark-0); |
| | | --contrast-50: var(--dark-50); |
| | | --contrast-100: var(--dark-100); |
| | | --contrast-200: var(--dark-200); |
| | | --c: var(--light-rgb); |
| | | --base-rgb: var(--light-rgb); |
| | | --contrast-rgb: var(--dark-rgb); |
| | | |
| | | /* Stacking */ |
| | | |
| | | |
| | | --contrast-comp: oklch(from rgb(var(--contrast)) .8 .26 h); |
| | | --contrast-tri: oklch(from rgb(var(--contrast)) .82 .2 calc(h - 120)); |
| | | --contrast-mono: oklch(from rgb(var(--contrast)) .3 .04 h); |
| | | --base-comp: oklch(from rgb(var(--base)) .8 .26 h); |
| | | --base-tri: oklch(from rgb(var(--base)) .82 .2 calc(h - 120)); |
| | | --base-mono: oklch(from rgb(var(--base)) .3 .04 h); |
| | | |
| | | |
| | | --tone-a: rgb(var(--contrast)); |
| | | --tone-b: rgb(var(--base)); |
| | | |
| | | --duo-dark: oklch(from var(--tone-a) .22 c h); |
| | | --duo-light: oklch(from var(--tone-b) .78 c h); |
| | | |
| | | --shimmer: rgba(var(--contrast),0) 0%, |
| | | rgba(var(--contrast),.05) 50%, |
| | | rgba(var(--contrast),0) 100%; |
| | | |
| | | --op-1: .05; |
| | | --op-2: .15; |
| | | --op-3: .25; |
| | | --op-45: .45; |
| | | --op-4: .66; |
| | | --op-5: .75; |
| | | --op-6: .85; |
| | | |
| | | /***************************** |
| | | Shadows |
| | | *****************************/ |
| | | --shdw-inset: inset 0 0 4px 1px; |
| | | --shdw: 0 0 4px; |
| | | --shdw-down: 0 6px 5px -5px; |
| | | --shdw-right: 6px 0 5px -5px; |
| | | --shdw-left: -6px 0 5px -5px; |
| | | --shdw-up: 0 -6px 5px -5px; |
| | | --shdw-subtle: 0 25px 20px -20px; |
| | | --shdw-subtle-right: 10px 0 20px -20px; |
| | | --shdw-none: transparent 0 0 0; |
| | | |
| | | /***************************** |
| | | Stacking |
| | | *****************************/ |
| | | --z-1: 5; |
| | | --z-2: 10; |
| | | --z-3: 15; |
| | | --z-4: 20; |
| | | --z-5: 50; |
| | | --z-6: 100; |
| | | --z-top: 999; |
| | | --zz-top: 999999; |
| | | /* Overlays */ |
| | | --rgb-light: .25; |
| | | --rgb-medium: .66; |
| | | --rgb-heavy: .85; |
| | | --overlay-light: rgba(var(--c), .25); |
| | | --overlay-medium: rgba(var(--c), .66); |
| | | --overlay-heavy: rgba(var(--c), .85); |
| | | --shimmer: rgba(var(--dark-rgb),0) 0%, |
| | | rgba(var(--dark-rgb),.05) 50%, |
| | | rgba(var(--dark-rgb),0) 100%; |
| | | /* Shadows */ |
| | | --shadow: rgba(var(--dark-rgb),.45) 0px 0px 4px; |
| | | --shadow-down: rgba(var(--dark-rgb),.45) 0 6px 5px -5px; /* Bottom */ |
| | | --shadow-right: rgba(var(--dark-rgb),.45) 6px 0 5px -5px; /* Right */ |
| | | --shadow-left: rgba(var(--dark-rgb), .45) -6px 0 5px -5px; /* Left */ |
| | | --shadow-up: rgba(var(--dark-rgb), .45) 0 -6px 5px -5px; /* Up */ |
| | | --subtle: rgba(var(--dark-rgb), .45) 0px 25px 20px -20px; |
| | | --subtleRight: rgba(var(--dark-rgb), .45) 10px 0 20px -20px; |
| | | --shadow-none: transparent 0px 0px 0px; |
| | | /* Rounding */ |
| | | --innerRadius: 4px; |
| | | --outerPadding: 1rem; |
| | | --outerRadius: calc(var(--innerRadius) + var(--outerPadding)); |
| | | /* Transitions */ |
| | | --function:cubic-bezier(.47,.24,.07,.47); |
| | | --timing: .25s; |
| | | --transition-base: var(--timing) var(--function); |
| | | --transition-color: background-color var(--transition-base), |
| | | color var(--transition-base), border var(--transition-base); |
| | | --transition-transform: transform var(--transition-base); |
| | | --transition-size: width var(--transition-base), |
| | | height var(--transition-base),max-width var(--transition-base), max-height var(--transition-base); |
| | | --z-7: 999; |
| | | --z-8: 1000; |
| | | --z-9: 999999; |
| | | --z-10: 9999999; |
| | | |
| | | --offScreen: -200vw; |
| | | /***************************** |
| | | Rounding |
| | | *****************************/ |
| | | --radius: 4px; |
| | | --p-outer: 1rem; |
| | | --radius-outer: calc(var(--radius) + var(--p-outer)); |
| | | --p-y: var(--sp1); |
| | | --p-x: var(--sp1); |
| | | /***************************** |
| | | Transitions |
| | | *****************************/ |
| | | --trans-fn: cubic-bezier(.47,.24,.07,.47); |
| | | --trans-t: .25s; |
| | | --trans-base: var(--trans-t) var(--trans-fn); |
| | | --trans-color: background-color var(--trans-base), |
| | | color var(--trans-base), border var(--trans-base); |
| | | --trans-transform: transform var(--trans-base); |
| | | --trans-size: width var(--trans-base), |
| | | height var(--trans-base),max-width var(--trans-base), max-height var(--trans-base); |
| | | --trans-vis: opacity var(--trans-base); |
| | | |
| | | /** Icons **/ |
| | | --minus: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="%23151515" viewBox="0 0 256 256"><path d="M208,36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36Zm4,172a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4Zm-40-80a4,4,0,0,1-4,4H88a4,4,0,0,1,0-8h80A4,4,0,0,1,172,128Z"></path></svg>'); |
| | | --plus: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="%23151515" viewBox="0 0 256 256"><path d="M208,36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36Zm4,172a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4Zm-40-80a4,4,0,0,1-4,4H132v36a4,4,0,0,1-8,0V132H88a4,4,0,0,1,0-8h36V88a4,4,0,0,1,8,0v36h36A4,4,0,0,1,172,128Z"></path></svg>'); |
| | | --close: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="%23151515" viewBox="0 0 256 256"><path d="M208,36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36Zm4,172a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4ZM162.83,98.83,133.66,128l29.17,29.17a4,4,0,0,1-5.66,5.66L128,133.66,98.83,162.83a4,4,0,0,1-5.66-5.66L122.34,128,93.17,98.83a4,4,0,0,1,5.66-5.66L128,122.34l29.17-29.17a4,4,0,1,1,5.66,5.66Z"></path></svg>'); |
| | | --chevron: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="%23151515" viewBox="0 0 256 256"><path d="M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm42.83-110.83a4,4,0,0,1,0,5.66l-40,40a4,4,0,0,1-5.66,0l-40-40a4,4,0,0,1,5.66-5.66L128,146.34l37.17-37.17A4,4,0,0,1,170.83,109.17Z"></path></svg>'); |
| | | --details: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="%23151515" viewBox="0 0 256 256"><path d="M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"></path></svg>'); |
| | | --shop: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="%23151515" viewBox="0 0 256 256"><path d="M28.15,95A3.81,3.81,0,0,0,28,96v16a36,36,0,0,0,16,29.92V216a4,4,0,0,0,4,4H208a4,4,0,0,0,4-4V141.92A36,36,0,0,0,228,112V96a3.81,3.81,0,0,0-.17-1.08L213.5,44.7A12,12,0,0,0,202,36H54A12,12,0,0,0,42.5,44.7Zm22-48.08A4,4,0,0,1,54,44H202a4,4,0,0,1,3.84,2.9L218.7,92H37.3ZM100,100h56v12a28,28,0,0,1-56,0ZM36,112V100H92v12a28,28,0,0,1-41.37,24.59,4,4,0,0,0-1.31-.76A28,28,0,0,1,36,112ZM204,212H52V145.94a36,36,0,0,0,44-17.48,36,36,0,0,0,64,0,36,36,0,0,0,44,17.48Zm2.68-76.17a3.94,3.94,0,0,0-1.3.76A28,28,0,0,1,164,112V100h56v12A28,28,0,0,1,206.68,135.83Z"></path></svg>'); |
| | | --style: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="%23151515" viewBox="0 0 256 256"><path d="M224,92H170.61l9.33-51.28a4,4,0,1,0-7.88-1.44L162.48,92H106.61l9.33-51.28a4,4,0,1,0-7.88-1.44L98.48,92H48a4,4,0,0,0,0,8H97L86.84,156H32a4,4,0,0,0,0,8H85.39l-9.33,51.28a4,4,0,0,0,3.22,4.65A3.65,3.65,0,0,0,80,220a4,4,0,0,0,3.94-3.29L93.52,164h55.87l-9.33,51.28a4,4,0,0,0,3.22,4.65,3.65,3.65,0,0,0,.72.07,4,4,0,0,0,3.94-3.29L157.52,164H208a4,4,0,0,0,0-8H159l10.19-56H224a4,4,0,0,0,0-8Zm-73.16,64H95l10.19-56H161Z"></path></svg>'); |
| | | --map: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="%23151515" viewBox="0 0 256 256"><path d="M128,68a36,36,0,1,0,36,36A36,36,0,0,0,128,68Zm0,64a28,28,0,1,1,28-28A28,28,0,0,1,128,132Zm0-112a84.09,84.09,0,0,0-84,84c0,30.42,14.17,62.79,41,93.62a250,250,0,0,0,40.73,37.66,4,4,0,0,0,4.58,0A250,250,0,0,0,171,197.62c26.81-30.83,41-63.2,41-93.62A84.09,84.09,0,0,0,128,20Zm37.1,172.23A254.62,254.62,0,0,1,128,227a254.62,254.62,0,0,1-37.1-34.81C73.15,171.8,52,139.9,52,104a76,76,0,0,1,152,0C204,139.9,182.85,171.8,165.1,192.23Z"></path></svg>'); |
| | | --theme: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="%23151515" viewBox="0 0 256 256"><path d="M241.72,113a11.88,11.88,0,0,0-9.73-5H212V88a12,12,0,0,0-12-12H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V208a4,4,0,0,0,4,4H211.09a4,4,0,0,0,3.79-2.74l28.49-85.47A11.86,11.86,0,0,0,241.72,113ZM40,60H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h72a4,4,0,0,1,4,4v20H69.76a12,12,0,0,0-11.38,8.21L36,183.35V64A4,4,0,0,1,40,60Zm195.78,61.26L208.2,204H37.55L66,118.74A4,4,0,0,1,69.76,116H232a4,4,0,0,1,3.79,5.26Z"></path></svg>'); |
| | | --arrow-up: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="%23151515" viewBox="0 0 256 256"><path d="M236,192a4,4,0,0,1-4,4H88a4,4,0,0,1-4-4V57.66L42.83,98.83a4,4,0,0,1-5.66-5.66l48-48a4,4,0,0,1,5.66,0l48,48a4,4,0,0,1-5.66,5.66L92,57.66V188H232A4,4,0,0,1,236,192Z"></path></svg>'); |
| | | --colour: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="%23151515" viewBox="0 0 256 256"><path d="M174,47.75a254.19,254.19,0,0,0-41.45-38.3,8,8,0,0,0-9.18,0A254.19,254.19,0,0,0,82,47.75C54.51,79.32,40,112.6,40,144a88,88,0,0,0,176,0C216,112.6,201.49,79.32,174,47.75Zm9.85,105.59a57.6,57.6,0,0,1-46.56,46.55A8.75,8.75,0,0,1,136,200a8,8,0,0,1-1.32-15.89c16.57-2.79,30.63-16.85,33.44-33.45a8,8,0,0,1,15.78,2.68Z"></path></svg>'); |
| | | --linkIcon:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="%23151515" viewBox="0 0 256 256"><path d="M236,88.12a50.44,50.44,0,0,1-14.81,34.31l-34.75,34.74A50.33,50.33,0,0,1,150.62,172h-.05A50.63,50.63,0,0,1,100,120a4,4,0,0,1,4-3.89h.11a4,4,0,0,1,3.89,4.11A42.64,42.64,0,0,0,150.58,164h0a42.32,42.32,0,0,0,30.14-12.49l34.75-34.74a42.63,42.63,0,1,0-60.29-60.28l-11,11a4,4,0,0,1-5.66-5.65l11-11A50.64,50.64,0,0,1,236,88.12ZM111.78,188.49l-11,11A42.33,42.33,0,0,1,70.6,212h0a42.63,42.63,0,0,1-30.11-72.77l34.75-34.74A42.63,42.63,0,0,1,148,135.82a4,4,0,0,0,8,.23A50.64,50.64,0,0,0,69.55,98.83L34.8,133.57A50.63,50.63,0,0,0,70.56,220h0a50.33,50.33,0,0,0,35.81-14.83l11-11a4,4,0,1,0-5.65-5.66Z"></path></svg>'); |
| | | --swipeRight: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgZmlsbD0iIzAwMDAwMCIgdmlld0JveD0iMCAwIDI1NiAyNTYiPjxwYXRoIGQ9Ik0yMTIsMTQwdjM2YzAsMjQuNjYtOC4wOCw0MS4xLTguNDIsNDEuNzlhNCw0LDAsMSwxLTcuMTYtMy41OGMuMDctLjE1LDcuNTgtMTUuNTUsNy41OC0zOC4yMVYxNDBhMTYsMTYsMCwwLDAtMzIsMHY0YTQsNCwwLDAsMS04LDBWMTI0YTE2LDE2LDAsMCwwLTMyLDB2MTJhNCw0LDAsMCwxLTgsMFY2OGExNiwxNiwwLDAsMC0zMiwwVjE3NmE0LDQsMCwwLDEtNy4zOSwyLjExbC0xOC42OC0zMGEuNzUuNzUsMCwwLDEtLjA3LS4xMiwxNiwxNiwwLDAsMC0yNy43MiwxNmwyOS4zMSw1MGE0LDQsMCwwLDEtNi45LDRMMzEuMjIsMTY4YTI0LDI0LDAsMCwxLDQxLjUyLTI0LjA5TDg0LDE2MlY2OGEyNCwyNCwwLDAsMSw0OCwwdjM4LjEzYTI0LDI0LDAsMCwxLDM5Ljk0LDE2LjA2QTI0LDI0LDAsMCwxLDIxMiwxNDBabTM4LjgzLTg2LjgzLTMyLTMyYTQsNCwwLDAsMC01LjY2LDUuNjZMMjM4LjM0LDUySDE3NmE0LDQsMCwwLDAsMCw4aDYyLjM0TDIxMy4xNyw4NS4xN2E0LDQsMCwwLDAsNS42Niw1LjY2bDMyLTMyQTQsNCwwLDAsMCwyNTAuODMsNTMuMTdaIj48L3BhdGg+PC9zdmc+'); |
| | | /***************************** |
| | | Spacing |
| | | *****************************/ |
| | | --sp1: clamp(0.5rem, 0.714vw + 0.321rem, 1rem); /* 8px → 16px */ |
| | | --sp2: clamp(0.75rem, 1.071vw + 0.482rem, 1.5rem); /* 12px → 24px */ |
| | | --sp3: clamp(1rem, 1.429vw + 0.643rem, 2rem); /* 16px → 32px */ |
| | | --sp4: clamp(1.5rem, 2.143vw + 0.964rem, 3rem); /* 24px → 48px */ |
| | | --sp5: clamp(2rem, 2.857vw + 1.286rem, 4rem); /* 32px → 64px */ |
| | | --sp6: clamp(3rem, 4.286vw + 1.929rem, 6rem); /* 48px → 96px */ |
| | | --sp7: clamp(4rem, 5.714vw + 2.571rem, 8rem); /* 64px → 128px */ |
| | | |
| | | /***************************** |
| | | Scrollbar |
| | | *****************************/ |
| | | --sb-width: 8px; |
| | | --sb-track: rgb(var(--base-100)); |
| | | --sb-thumb: rgb(var(--action-0)); |
| | | --sb-thumb-hover: rgb(var(--action-50)); |
| | | --sb-thumb-border: 2px solid rgb(var(--base-50)); |
| | | --sb-radius: 4px; |
| | | |
| | | --scrollbar-width: 8px; |
| | | --scrollbar-track-color: rgb(var(--base-100)); |
| | | --scrollbar-thumb-color: rgb(var(--action-0)); |
| | | --scrollbar-thumb-hover-color: rgb(var(--action-50)); |
| | | --scrollbar-thumb-border: 2px solid rgb(var(--base-50)); |
| | | --scrollbar-border-radius: 4px; |
| | | --details: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" fill="%232b1a0d" viewBox="0 0 256 256"><path d="M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"></path></svg>'); |
| | | --link: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" fill="%232b1a0d" viewBox="0 0 256 256"><path d="M238,88.18a52.42,52.42,0,0,1-15.4,35.66l-34.75,34.75A52.28,52.28,0,0,1,150.62,174h-.05A52.63,52.63,0,0,1,98,119.9a6,6,0,0,1,6-5.84h.17a6,6,0,0,1,5.83,6.16A40.62,40.62,0,0,0,150.58,162h0a40.4,40.4,0,0,0,28.73-11.9l34.75-34.74A40.63,40.63,0,0,0,156.63,57.9l-11,11a6,6,0,0,1-8.49-8.49l11-11a52.62,52.62,0,0,1,74.43,0A52.83,52.83,0,0,1,238,88.18Zm-127.62,98.9-11,11A40.36,40.36,0,0,1,70.6,210h0a40.63,40.63,0,0,1-28.7-69.36L76.62,105.9A40.63,40.63,0,0,1,146,135.77a6,6,0,0,0,5.83,6.16H152a6,6,0,0,0,6-5.84A52.63,52.63,0,0,0,68.14,97.42L33.38,132.16A52.63,52.63,0,0,0,70.56,222h0a52.26,52.26,0,0,0,37.22-15.42l11-11a6,6,0,1,0-8.49-8.48Z"></path></svg>'); |
| | | } |
| | | |
| | | |
| | | body:has(#theme-switcher:checked){ |
| | | /***************************** |
| | | Colours |
| | | *****************************/ |
| | | --mixBlendMode: lighten; |
| | | --coverBlend: multiply; |
| | | --coverIndex: 0; |
| | | |
| | | --action-50: 219,0,110; /* #db006e; */ |
| | | --action-100: 184,0.92; /* #b8005c; */ |
| | | --action-200: 148,0,74; /* #94004a; */ |
| | | |
| | | --secondary-50: 216,159,0; /* #d89f00; */ |
| | | --secondary-100: 181,133,0; /* #b58500; */ |
| | | --secondary-200: 145,106,0; /* #916a00; */ |
| | | |
| | | --contrast: var(--light-0); |
| | | --contrast-50: var(--light-50); |
| | | --contrast-100: var(--light-100); |
| | | --contrast-200: var(--light-200); |
| | | |
| | | --base: var(--dark-0); |
| | | --base-50: var(--dark-50); |
| | | --base-100: var(--dark-100); |
| | | --base-200: var(--dark-200); |
| | | |
| | | |
| | | --successBack: var(--successDark); |
| | | --successText: var(--successLight); |
| | | --warningBack: var(--warningDark); |
| | | --warningText: var(--warningLight); |
| | | --errorBack: var(--errorDark); |
| | | --errorText: var(--errorLight); |
| | | |
| | | --shimmer: rgba(var(--light-0),0) 0%, |
| | | rgba(var(--light-0),.05) 50%, |
| | | rgba(var(--light-0),0) 100%; |
| | | } |
| | | |
| | | .item-grid.integrations { |
| | | display: grid; |
| | | grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); |
| | |
| | | } |
| | | |
| | | .integration { |
| | | background: var(--bg-white, #EFEFEF); |
| | | border: 2px solid #ddd; |
| | | background: rgb(var(--base)); |
| | | border: 2px solid rgb(Var(--contrast-200)); |
| | | border-radius: 8px; |
| | | padding: 1.5rem; |
| | | position: relative; |
| | |
| | | } |
| | | |
| | | .integration.connected { |
| | | border-color: #22c55e; |
| | | box-shadow: 0 2px 8px rgba(34, 197, 94, 0.1); |
| | | border-color: rgb(var(--success)); |
| | | box-shadow: 0 2px 8px rgba(var(--successBack), .1); |
| | | } |
| | | |
| | | .integration.disconnected { |
| | | border-color: #ef4444; |
| | | box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1); |
| | | border-color: rgb(var(--error)); |
| | | box-shadow: 0 2px 8px rgba(var(--errorBack), 0.1); |
| | | } |
| | | |
| | | .integration[data-oauth="true"].disconnected { |
| | | border-color: #3b82f6; |
| | | box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1); |
| | | border-color: rgb(var(--warning)); |
| | | box-shadow: 0 2px 8px rgba(var(--warning), 0.1); |
| | | } |
| | | |
| | | .header { |
| | |
| | | align-items: center; |
| | | margin-bottom: 1rem; |
| | | padding-bottom: 1rem; |
| | | border-bottom: 2px solid #ddd; |
| | | border-bottom: 2px solid var(--contrast-200); |
| | | } |
| | | |
| | | .header h3 { |
| | |
| | | font-weight: bold; |
| | | text-transform: uppercase; |
| | | letter-spacing: 1px; |
| | | color: var(--bg-black, #1B1B1B); |
| | | color: rgb(var(--contrast)); |
| | | } |
| | | |
| | | .connection-status { |
| | |
| | | } |
| | | |
| | | .status-indicator.connected { |
| | | color: #22c55e; |
| | | color: rgb(var(--success)); |
| | | } |
| | | |
| | | .status-indicator.disconnected { |
| | | color: #ef4444; |
| | | color: rgb(var(--error)); |
| | | } |
| | | |
| | | .integration-meta { |
| | | margin-bottom: 1rem; |
| | | color: #666; |
| | | color: rgb(var(--contrast-100)); |
| | | font-size: 0.85rem; |
| | | } |
| | | |
| | |
| | | display: block; |
| | | font-weight: bold; |
| | | margin-bottom: 0.5rem; |
| | | color: var(--bg-black, #1B1B1B); |
| | | color: rgb(var(--contrast)); |
| | | text-transform: uppercase; |
| | | font-size: 0.85rem; |
| | | letter-spacing: 0.5px; |
| | | letter-spacing: .5px; |
| | | } |
| | | |
| | | .integration input, |
| | |
| | | .integration textarea { |
| | | width: 100%; |
| | | padding: 0.75rem; |
| | | border: 2px solid #ddd; |
| | | border: 2px solid rgb(var(--contrast-200)); |
| | | border-radius: 4px; |
| | | font-size: 0.9rem; |
| | | background: white; |
| | | background: rgb(var(--base-50)); |
| | | transition: border-color 0.3s ease; |
| | | } |
| | | |
| | |
| | | display: inline-block; |
| | | width: 90%; |
| | | margin: 0 .5rem; |
| | | background-color: #ddd; |
| | | border-color: white; |
| | | background-color: rgb(var(--base-50)); |
| | | border-color: rgb(var(--contrast-200)); |
| | | user-select: all; |
| | | } |
| | | |
| | |
| | | .integration select:focus, |
| | | .integration textarea:focus { |
| | | outline: none; |
| | | border-color: var(--action-color, #FF0080); |
| | | box-shadow: 0 0 0 3px rgba(255, 0, 128, 0.1); |
| | | border-color: rgb(var(--action-0)); |
| | | box-shadow: var(--shdw) rgba(var(--action-0),.1); |
| | | } |
| | | |
| | | .integration .hint { |
| | | font-size: 0.8rem; |
| | | color: #666; |
| | | color: ; |
| | | margin-top: 0.5rem; |
| | | line-height: 1.4; |
| | | } |
| | |
| | | cursor: pointer; |
| | | } |
| | | button:hover { |
| | | background: #FF0080; |
| | | color: #fff; |
| | | background: rgb(var(--action-0)); |
| | | color: rgb(var(--action-contrast)); |
| | | } |
| | | |
| | | .integration-actions .button-primary { |
| | | background: var(--action-color, #FF0080); |
| | | border-color: var(--action-color, #FF0080); |
| | | color: white; |
| | | background: rgb(var(--action-0)); |
| | | border-color: rgb(var(--action-0)); |
| | | color: rgb(var(--action-contrast)); |
| | | } |
| | | |
| | | .integration-actions .button-primary:hover { |
| | | background: #e6007a; |
| | | border-color: #e6007a; |
| | | background: rgb(var(--action-0)); |
| | | border-color: rgb(var(--action-200)); |
| | | } |
| | | |
| | | .integration-actions .button-link-delete { |
| | | color: #ef4444; |
| | | color: rgb(var(--action-0)); |
| | | border-color: transparent; |
| | | background: transparent; |
| | | } |
| | | |
| | | .integration-actions .button-link-delete:hover { |
| | | color: #dc2626; |
| | | color: rgb(var(--action-0)); |
| | | text-decoration: underline; |
| | | } |
| | | |
| | |
| | | position: absolute; |
| | | top: 10px; |
| | | right: 10px; |
| | | background: var(--action-color, #FF0080); |
| | | color: white; |
| | | background: rgb(var(--action-0)); |
| | | color: rgb(var(--action-contrast)); |
| | | padding: 0.25rem 0.5rem; |
| | | border-radius: 4px; |
| | | font-size: 0.7rem; |
| | |
| | | |
| | | @keyframes flash-success { |
| | | 0%, 100% { border-color: inherit; } |
| | | 50% { border-color: #22c55e; } |
| | | 50% { border-color: rgb(var(--success)); } |
| | | } |
| | | |
| | | @keyframes flash-error { |
| | | 0%, 100% { border-color: inherit; } |
| | | 50% { border-color: #ef4444; } |
| | | 50% { border-color: rgb(var(--error)); } |
| | | } |
| | | |
| | | @media (max-width: 768px) { |
| | |
| | | |
| | | @keyframes flash-success { |
| | | 0%, 100% { |
| | | background-color: var(--bg-white, #EFEFEF); |
| | | border-color: #22c55e; |
| | | background-color: rgb(var(--base)); |
| | | border-color: rgb(var(--success)); |
| | | } |
| | | 50% { |
| | | background-color: #dcfce7; |
| | | border-color: #22c55e; |
| | | box-shadow: 0 0 20px rgba(34, 197, 94, 0.3); |
| | | background-color: rgb(var(--successBack)); |
| | | border-color: rgb(var(--success)); |
| | | box-shadow: var(--shdw) rgba(var(--success), 0.3); |
| | | } |
| | | } |
| | | |
| | | @keyframes flash-error { |
| | | 0%, 100% { |
| | | background-color: var(--bg-white, #EFEFEF); |
| | | border-color: #ef4444; |
| | | background-color: rgb(var(--base)); |
| | | border-color: rgb(var(--error)); |
| | | } |
| | | 50% { |
| | | background-color: #fee2e2; |
| | | border-color: #ef4444; |
| | | box-shadow: 0 0 20px rgba(239, 68, 68, 0.3); |
| | | background-color: rgb(var(--errorBack)); |
| | | border-color: rgb(var(--error)); |
| | | box-shadow: var(--shdw) rgba(var(--error), .3); |
| | | } |
| | | } |
| | | |
| | |
| | | .unsaved-indicator { |
| | | display: inline-block; |
| | | padding: 2px 8px; |
| | | background: #fef3c7; |
| | | background: rgb(var(--base-200)); |
| | | border-radius: 4px; |
| | | font-size: 0.75rem; |
| | | font-weight: 500; |
| | |
| | | } |
| | | |
| | | .notification-success { |
| | | background-color: #d4edda; |
| | | border: 1px solid #c3e6cb; |
| | | color: #155724; |
| | | background-color: rgb(var(--successBack)); |
| | | border: 1px solid rgb(var(--success)); |
| | | color: rgb(var(--successText)); |
| | | } |
| | | |
| | | .notification-error { |
| | | background-color: #f8d7da; |
| | | border: 1px solid #f5c6cb; |
| | | color: #721c24; |
| | | background-color: rgb(var(--errorBack)); |
| | | border: 1px solid rgb(var(--error)); |
| | | color: rgb(var(--errorText)); |
| | | } |
| | | |
| | | .notification-info { |
| | | background-color: #d1ecf1; |
| | | border: 1px solid #bee5eb; |
| | | color: #0c5460; |
| | | background-color: rgb(var(--warningBack)); |
| | | border: 1px solid rgb(var(--warning)); |
| | | color: rgb(var(--warningText)); |
| | | } |
| | | |
| | | /* OAuth Status Indicators */ |
| | |
| | | } |
| | | |
| | | .status-invalid { |
| | | color: #856404; |
| | | background-color: #fff3cd; |
| | | color: rgb(var(--warning)); |
| | | background-color: rgb(var(--warningBack)); |
| | | padding: 5px 10px; |
| | | border-radius: 3px; |
| | | border: 1px solid #ffeaa7; |
| | | border: 1px solid rgb(var(--warningText)); |
| | | } |
| | | |
| | | /* Form Field Updates */ |
| | |
| | | transform: translateY(-50%); |
| | | width: 16px; |
| | | height: 16px; |
| | | border: 2px solid #f3f3f3; |
| | | border-top: 2px solid #3498db; |
| | | border: 2px solid rgb(var(--action-200)); |
| | | border-top: 2px solid rgb(var(--action-0)); |
| | | border-radius: 50%; |
| | | animation: spin 1s linear infinite; |
| | | } |
| | |
| | | |
| | | .generate-webhook-signature { |
| | | padding: 6px 12px; |
| | | background-color: #007cba; |
| | | color: white; |
| | | background-color: rgb(var(--secondary-0)); |
| | | color: rgb(var(--secondary-contrast)); |
| | | border: none; |
| | | border-radius: 3px; |
| | | cursor: pointer; |
| | |
| | | } |
| | | |
| | | .generate-webhook-signature:hover { |
| | | background-color: #005a87; |
| | | background-color: rgb(var(--action-0)); |
| | | } |
| | | |
| | | /* Save Button States */ |
| | | .save-credentials { |
| | | padding: 8px 16px; |
| | | background-color: #28a745; |
| | | color: white; |
| | | background-color: rgb(var(--action-0)); |
| | | color: rgb(var(--action-contrast)); |
| | | border: none; |
| | | border-radius: 4px; |
| | | cursor: pointer; |
| | |
| | | } |
| | | |
| | | .save-credentials:hover:not(:disabled) { |
| | | background-color: #218838; |
| | | background-color: rgb(var(--action-0)); |
| | | } |
| | | |
| | | .save-credentials:disabled { |
| | |
| | | } |
| | | |
| | | .connection-status.connected { |
| | | background-color: #d4edda; |
| | | color: #155724; |
| | | background-color: rgb(var(--successBack)); |
| | | color: rgb(var(--successText)); |
| | | } |
| | | |
| | | .connection-status.disconnected { |
| | | background-color: #f8d7da; |
| | | color: #721c24; |
| | | background-color: rgb(var(--errorBack)); |
| | | color: rgb(var(--errorText)); |
| | | } |
| | | |
| | | .connection-status.expired { |
| | | background-color: #fff3cd; |
| | | color: #856404; |
| | | background-color: rgb(var(--warningBack)); |
| | | color: rgb(var(--warningText)); |
| | | } |
| | | |
| | | /* Hidden location field that appears after account selection */ |
| | |
| | | |
| | | /** |
| | | * Renders sections based on what was set in the Content Registry |
| | | * @param object $handler |
| | | * @param int $ID |
| | | * @param string $contentType |
| | | * @param string $postType |
| | |
| | | 'Log in | North\'eh Smoke & Smash'; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Checks if the logged in user is one of us |
| | | * @param int|null $userID |
| | | * @return bool |
| | | */ |
| | | function isOurPeople(?int $userID = null):bool |
| | |
| | | * @param string $on |
| | | * @param string $off |
| | | * @param bool $hidden |
| | | * |
| | | * @param array $data |
| | | * @return string |
| | | */ |
| | | function jvbRenderToggleTextField( |
| | |
| | | * Format a date in relative time (e.g., "2 days ago") |
| | | * @param string $dateStr - Date string or DateTime object |
| | | * @return string - Formatted relative time |
| | | * @throws DateMalformedStringException |
| | | */ |
| | | function jvbFormatTimeAgo(string $dateStr):string |
| | | { |
| | |
| | | /** |
| | | * Check if business is currently open based on stored hours |
| | | * |
| | | * @param array $hours_data Array of hours data from wp_option |
| | | * @param array|null $hours_data Array of hours data from wp_option |
| | | * @param string $timezone Timezone string (default: 'America/Edmonton') |
| | | * @return bool True if currently open, false if closed |
| | | * @throws DateInvalidTimeZoneException |
| | | * @throws DateMalformedStringException |
| | | */ |
| | | function jvbIsCurrentlyOpen(?array $hours_data = null, string $timezone = 'America/Edmonton'):bool |
| | | { |
| | |
| | | * @param ?string $end_time End time in H:i format (e.g., '15:15') |
| | | * @param string $timezone Timezone string (default: 'America/Edmonton') |
| | | * @return bool True if current time is within range, false otherwise |
| | | * @throws DateInvalidTimeZoneException |
| | | * @throws DateMalformedStringException |
| | | */ |
| | | function jvbIsTimeBetween(?string $start_time = null, ?string $end_time = null, string $timezone = 'America/Edmonton'):bool { |
| | | if (!$start_time && !$end_time) { |
| | |
| | | * @param string $timezone Timezone string |
| | | * @return string Next opening time description or empty string if never opens |
| | | * @throws DateInvalidTimeZoneException |
| | | * @throws DateMalformedStringException |
| | | */ |
| | | function jvbGetNextOpeningTime(array $hours_data, string $timezone = 'America/Edmonton'):string { |
| | | if (!jvbHasOperatingHours($hours_data)) { |
| | |
| | | return $out; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Outputs the search bar (likely don't need anymore) |
| | | * @param string $placeholder |
| | | * @param string $id |
| | | * @param string $label |
| | | * @param string $buttonText |
| | | * @param bool $buttonInside |
| | | * @param bool $hideSearch |
| | | * @return string |
| | | */ |
| | | function jvbSearch(string $placeholder = 'Search...', string $id = 'search', string $label = '', string $buttonText = '', bool $buttonInside = false, bool $hideSearch = false):string |
| | |
| | | } |
| | | |
| | | /** |
| | | * Formats an image to match our image replacement formatting |
| | | * @param int|string $imgID |
| | | * Formats an image to match our image replacement formatting |
| | | * @param int $imgID |
| | | * @param string $start |
| | | * @param string $end |
| | | * |
| | | * @param bool $addLink |
| | | * @param string|null $postSlug |
| | | * @return string |
| | | */ |
| | | function jvbFormatImage(int $imgID, string $start = 'tiny', string $end = 'large', bool $addLink = true, ?string $postSlug = null):string |
| | |
| | | /** |
| | | * @param int $termID |
| | | * @param bool $update |
| | | * @param string $taxonomy |
| | | * @param array $settings |
| | | * @return void |
| | | */ |
| | |
| | | * Update business attributes (amenities, services, etc.) |
| | | */ |
| | | /** |
| | | * @param string $location_name |
| | | * @param array $attributes |
| | | * @return array As expected by OperationQueue.php processOperation |
| | | */ |
| | |
| | | * |
| | | * @param array $hours Array of periods with open/close times per day |
| | | * @return array Success status, according to OperationQueue.php |
| | | * @throws Exception |
| | | * @throws Exception |
| | | */ |
| | | public function updateBusinessHours(array $hours): array |
| | | { |
| | |
| | | * @param string $date |
| | | * @param array{open?: float, closed?:float, isClosed?: bool, location?: string} $options |
| | | * @return array Operation Queue [ 'success' => true/false, 'result' => $results] |
| | | * @throws Exception |
| | | * @throws Exception |
| | | */ |
| | | public function setSpecialHours(string $date, array $options = []):array |
| | | { |
| | |
| | | * Get reviews for the current location |
| | | * @param int $page_size Number of reviews to fetch (max 50) |
| | | * @return array|null |
| | | * @throws Exception |
| | | * @throws Exception |
| | | */ |
| | | public function getReviews(int $page_size = 5): ?array |
| | | { |
| | |
| | | |
| | | /** |
| | | * Fluent factory method |
| | | * |
| | | * @param string $tableName Table name without prefix/BASE |
| | | * @param string $tableName |
| | | * @param bool $user |
| | | * @param bool $auth |
| | | * @param bool $useTransactions |
| | | * @return self |
| | | * |
| | | * @example CustomTable::for('favourites')->insert($data); |
| | | */ |
| | | public static function for(string $tableName, bool $user = false, bool $auth = false, bool $useTransactions = false): self |
| | |
| | | |
| | | /** |
| | | * Find or create a record |
| | | * |
| | | * @param array $searchData Data to search for |
| | | * @param array $createData Optional additional data for creation |
| | | * @return array ['id' => int, 'created' => bool, 'record' => object] |
| | | * @return int|false The ID of the created record, or false |
| | | * |
| | | * @example |
| | | * $result = CustomTable::for('favourites')->findOrCreate( |
| | | * ['user_id' => 1, 'target_id' => 123], |
| | | * ['type' => 'tattoo'] |
| | | * ); |
| | | * // Returns: ['id' => 456, 'created' => false, 'record' => object] |
| | | * $result = CustomTable::for('favourites')->findOrCreate( |
| | | * ['user_id' => 1, 'target_id' => 123], |
| | | * ['type' => 'tattoo'] |
| | | * ); |
| | | */ |
| | | public function findOrCreate(array $searchData, array $createData = []):int|false |
| | | { |
| | |
| | | |
| | | /** |
| | | * Get multiple records |
| | | * |
| | | * @param array $args Query arguments: where, orderby, order, limit, offset |
| | | * @param bool $itemsOnly |
| | | * @param string $output OBJECT, ARRAY_A, or ARRAY_N |
| | | * @return array |
| | | * |
| | | * @example |
| | | * $favs = $table->getMany([ |
| | | * 'where' => ['user_id' => 1], |
| | | * 'orderby' => 'date_added', |
| | | * 'order' => 'DESC', |
| | | * 'per_page' => 20 |
| | | * ]); |
| | | * $favs = $table->getMany([ |
| | | * 'where' => ['user_id' => 1], |
| | | * 'orderby' => 'date_added', |
| | | * 'order' => 'DESC', |
| | | * 'per_page' => 20 |
| | | * ]); |
| | | */ |
| | | public function getMany(array $args = [], bool $itemsOnly = true, string $output = OBJECT): array |
| | | { |
| | |
| | | return sanitize_sql_orderby($orderby); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Get a specific column value from all matches |
| | | * @param string $column |
| | | * @param array $where |
| | | * @param string|null $orderby |
| | | * @param string|null $order |
| | | * @param int|null $limit |
| | | * @return array |
| | | */ |
| | | public function pluck(string $column, array $where = [], ?string $orderby = null, ?string $order = null, ?int $limit = null): array |
| | |
| | | |
| | | return $result; |
| | | } |
| | | /** |
| | | * Common email wrapper template |
| | | * @param string $content |
| | | * @param string $header |
| | | * |
| | | * @return string |
| | | */ |
| | | |
| | | /** |
| | | * Common email wrapper template |
| | | * @param string $content |
| | | * @param string $headerText |
| | | * @param string $preheader |
| | | * @return string |
| | | */ |
| | | private function getEmailTemplate(string $content, string $headerText = '', string $preheader = ''):string |
| | | { |
| | | $custom_logo_id = get_theme_mod( 'custom_logo' ); |
| | |
| | | * @param string $message |
| | | * @param string $key |
| | | * @param string $user_login |
| | | * @param WP_User $user_data |
| | | * @param WP_User $user |
| | | * |
| | | * @return string |
| | | */ |
| | |
| | | /** |
| | | * New email address confirmation |
| | | * @param string $email_text |
| | | * @param array $user |
| | | * @param array $new_user_email |
| | | * |
| | | * @return string |
| | | */ |
| | |
| | | /** |
| | | * User data request confirmation email |
| | | * @param string $content |
| | | * @param array $request_data |
| | | * @param array $email_data |
| | | * |
| | | * @return string |
| | | */ |
| | |
| | | * @param array $context Additional context (i.e: data that was attempted to be acted on) |
| | | * @param string $severity |
| | | * |
| | | * @return bool Whether it gets logged successfully |
| | | * @return array |
| | | */ |
| | | public function log(string $component, string $message, array $context = [], string $severity = 'error'): array |
| | | { |
| | |
| | | /** |
| | | * Generate the artist card |
| | | */ |
| | | /** |
| | | * @return array |
| | | */ |
| | | /** |
| | | * @return array |
| | | * @throws Exception |
| | | * @throws Exception |
| | | */ |
| | | public function generate():array |
| | | { |
| | | // Generate appropriate filename |
| | |
| | | ]; |
| | | } |
| | | |
| | | /** |
| | | * Create WordPress attachment from generated image |
| | | * @param string $file_path |
| | | * |
| | | * @return int|WP_Error |
| | | */ |
| | | /** |
| | | * Create WordPress attachment from generated image |
| | | * @param string $file_path |
| | | * |
| | | * @return int|WP_Error |
| | | * @throws Exception |
| | | * @throws Exception |
| | | */ |
| | | protected function createAttachment(string $file_path):int|WP_Error |
| | | { |
| | | // Get upload directory based on user/content structure |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Create gradient background with Imagick |
| | | * @param Imagick $canvas |
| | | * @param string $color Center color |
| | | * @return void |
| | | */ |
| | | /** |
| | | * Create gradient background with Imagick |
| | | * @param Imagick $canvas |
| | | * @param string $color Center color |
| | | * @return void |
| | | * @throws ImagickException |
| | | * @throws ImagickException |
| | | */ |
| | | protected function createGradientBackgroundImagick(Imagick $canvas, string $color): void |
| | | { |
| | | $width = $canvas->getImageWidth(); |
| | |
| | | * Get all artists with news post counts |
| | | * @return array |
| | | */ |
| | | public function getAllArtistsWithNews():int |
| | | public function getAllArtistsWithNews():array |
| | | { |
| | | global $wpdb; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * @param WP_Error $result |
| | | * @param WP_Error|array $result |
| | | * @param object $operation |
| | | * @param array $data |
| | | * |
| | |
| | | * |
| | | * @param object $operation The current operation |
| | | * |
| | | * @return bool|array false if not batched, the extracted data to process if batchable |
| | | * @return array false if not batched, the extracted data to process if batchable |
| | | */ |
| | | protected function getNextChunk(object $operation): array |
| | | { |
| | |
| | | * Display user's referral code and share options |
| | | * Use in templates or dashboard with: echo jvbReferralShareWidget(); |
| | | * |
| | | * @return string HTML output |
| | | * @return array HTML output |
| | | */ |
| | | public function outputShareWidget(array $actions):array |
| | | { |
| | |
| | | * Add referral settings subpage to admin menu |
| | | * Add referral settings subpage to admin menu |
| | | * |
| | | * @param array $subpages |
| | | * @return array |
| | | * @return void |
| | | */ |
| | | public static function addSubpage():void |
| | | { |
| | |
| | | */ |
| | | protected string $date; |
| | | |
| | | /** |
| | | * @throws DateMalformedStringException |
| | | */ |
| | | public function __construct(string $date) |
| | | { |
| | | $this->setDate($date); |
| | |
| | | class BusinessEntityType extends Enumeration { |
| | | protected string $type; |
| | | protected array $allowedType = [ |
| | | 'business' => 'http://purl.org/goodrelations/v1#Business', |
| | | 'endUser' => 'http://purl.org/goodrelations/v1#Enduser', |
| | | 'publicInstitution'=> 'http://purl.org/goodrelations/v1#PublicInstitution', |
| | | 'reseller' => 'http://purl.org/goodrelations/v1#Reseller' |
| | | 'business' => 'https://purl.org/goodrelations/v1#Business', |
| | | 'endUser' => 'https://purl.org/goodrelations/v1#Enduser', |
| | | 'publicInstitution'=> 'https://purl.org/goodrelations/v1#PublicInstitution', |
| | | 'reseller' => 'https://purl.org/goodrelations/v1#Reseller' |
| | | ]; |
| | | } |
| | | |
| | |
| | | class BusinessFunction extends Enumeration { |
| | | protected string $businessFunction; |
| | | protected array $allowedBusinessFunction = [ |
| | | 'constructionInstallation' => 'http://purl.org/goodrelations/v1#ConstructionInstallation', |
| | | 'dispose' => 'http://purl.org/goodrelations/v1#Dispose', |
| | | 'lease' => 'http://purl.org/goodrelations/v1#LeaseOut', |
| | | 'maintain' => 'http://purl.org/goodrelations/v1#Maintain', |
| | | 'provideService' => 'http://purl.org/goodrelations/v1#ProvideService', |
| | | 'repair' => 'http://purl.org/goodrelations/v1#Repair', |
| | | 'sell' => 'http://purl.org/goodrelations/v1#Sell', |
| | | 'buy' => 'http://purl.org/goodrelations/v1#Buy' |
| | | 'constructionInstallation' => 'https://purl.org/goodrelations/v1#ConstructionInstallation', |
| | | 'dispose' => 'https://purl.org/goodrelations/v1#Dispose', |
| | | 'lease' => 'https://purl.org/goodrelations/v1#LeaseOut', |
| | | 'maintain' => 'https://purl.org/goodrelations/v1#Maintain', |
| | | 'provideService' => 'https://purl.org/goodrelations/v1#ProvideService', |
| | | 'repair' => 'https://purl.org/goodrelations/v1#Repair', |
| | | 'sell' => 'https://purl.org/goodrelations/v1#Sell', |
| | | 'buy' => 'https://purl.org/goodrelations/v1#Buy' |
| | | ]; |
| | | } |
| | |
| | | 'OnSitePickup' => 'OnSitePickup', |
| | | 'ParcelService' => 'ParcelService', |
| | | 'LockerPickup' => 'LockerPickup', |
| | | 'directDownload' =>'http://purl.org/goodrelations/v1#DeliveryModeDirectDownload', |
| | | 'freight' => 'http://purl.org/goodrelations/v1#DeliveryModeFreight', |
| | | 'mail' => 'http://purl.org/goodrelations/v1#DeliveryModeMail', |
| | | 'ownFleet' => 'http://purl.org/goodrelations/v1#DeliveryModeOwnFleet', |
| | | 'pickUp' => 'http://purl.org/goodrelations/v1#DeliveryModePickUp', |
| | | 'DHL' => 'http://purl.org/goodrelations/v1#DHL', |
| | | 'FederalExpress' => 'http://purl.org/goodrelations/v1#FederalExpress', |
| | | 'UPS' => 'http://purl.org/goodrelations/v1#UPS' |
| | | 'directDownload' => 'https://purl.org/goodrelations/v1#DeliveryModeDirectDownload', |
| | | 'freight' => 'https://purl.org/goodrelations/v1#DeliveryModeFreight', |
| | | 'mail' => 'https://purl.org/goodrelations/v1#DeliveryModeMail', |
| | | 'ownFleet' => 'https://purl.org/goodrelations/v1#DeliveryModeOwnFleet', |
| | | 'pickUp' => 'https://purl.org/goodrelations/v1#DeliveryModePickUp', |
| | | 'DHL' => 'https://purl.org/goodrelations/v1#DHL', |
| | | 'FederalExpress' => 'https://purl.org/goodrelations/v1#FederalExpress', |
| | | 'UPS' => 'https://purl.org/goodrelations/v1#UPS' |
| | | ]; |
| | | } |
| | |
| | | class WarrantyScope extends Enumeration { |
| | | protected string $scope; |
| | | protected array $allowedScope = [ |
| | | 'labor' => 'http://purl.org/goodrelations/v1#Labor-BringIn', |
| | | 'partsLaborBring' => 'http://purl.org/goodrelations/v1#PartsAndLabor-BringIn', |
| | | 'partsLaborPick' => 'http://purl.org/goodrelations/v1#PartsAndLabor-PickUp' |
| | | 'labor' => 'https://purl.org/goodrelations/v1#Labor-BringIn', |
| | | 'partsLaborBring' => 'https://purl.org/goodrelations/v1#PartsAndLabor-BringIn', |
| | | 'partsLaborPick' => 'https://purl.org/goodrelations/v1#PartsAndLabor-PickUp' |
| | | ]; |
| | | } |
| | | |
| | |
| | | use ThingSchema; |
| | | protected StructuredValue|string $method; |
| | | protected array $allowedMethod = [ |
| | | 'bankTransfer' => 'http://purl.org/goodrelations/v1#ByBankTransferInAdvance', |
| | | 'invoice' => 'http://purl.org/goodrelations/v1#ByInvoice', |
| | | 'cash' => 'http://purl.org/goodrelations/v1#Cash', |
| | | 'check' => 'http://purl.org/goodrelations/v1#CheckInAdvance', |
| | | 'cod' => 'http://purl.org/goodrelations/v1#COD', |
| | | 'directDebit' => 'http://purl.org/goodrelations/v1#DirectDebit', |
| | | 'google' => 'http://purl.org/goodrelations/v1#GoogleCheckout', |
| | | 'paypal' => 'http://purl.org/goodrelations/v1#PayPal', |
| | | 'payswarm' => 'http://purl.org/goodrelations/v1#PaySwarm' |
| | | 'bankTransfer' => 'https://purl.org/goodrelations/v1#ByBankTransferInAdvance', |
| | | 'invoice' => 'https://purl.org/goodrelations/v1#ByInvoice', |
| | | 'cash' => 'https://purl.org/goodrelations/v1#Cash', |
| | | 'check' => 'https://purl.org/goodrelations/v1#CheckInAdvance', |
| | | 'cod' => 'https://purl.org/goodrelations/v1#COD', |
| | | 'directDebit' => 'https://purl.org/goodrelations/v1#DirectDebit', |
| | | 'google' => 'https://purl.org/goodrelations/v1#GoogleCheckout', |
| | | 'paypal' => 'https://purl.org/goodrelations/v1#PayPal', |
| | | 'payswarm' => 'https://purl.org/goodrelations/v1#PaySwarm' |
| | | ]; |
| | | |
| | | } |
| | |
| | | public function setDayOfWeek(DayOfWeek|array $dayOfWeek):void |
| | | { |
| | | if (is_array($dayOfWeek)) { |
| | | |
| | | //TODO |
| | | } |
| | | $this->dayOfWeek = $dayOfWeek; |
| | | } |
| | |
| | | protected array|string $paymentMethod; |
| | | |
| | | protected array $mappedMethods = [ |
| | | 'banktransfer' => 'http://purl.org/goodrelations/v1#ByBankTransferInAdvance', |
| | | 'invoice' => 'http://purl.org/goodrelations/v1#ByInvoice', |
| | | 'cash' => 'http://purl.org/goodrelations/v1#Cash', |
| | | 'check' => 'http://purl.org/goodrelations/v1#CheckInAdvance', |
| | | 'cod' => 'http://purl.org/goodrelations/v1#COD', |
| | | 'directdebit' => 'http://purl.org/goodrelations/v1#DirectDebit', |
| | | 'google' => 'http://purl.org/goodrelations/v1#GoogleCheckout', |
| | | 'paypal' => 'http://purl.org/goodrelations/v1#PayPal', |
| | | 'payswarm' => 'http://purl.org/goodrelations/v1#PaySwarm', |
| | | 'amex' => 'http://purl.org/goodrelations/v1#AmericanExpress', |
| | | 'dinersclub' => 'http://purl.org/goodrelations/v1#DinersClub', |
| | | 'discover' => 'http://purl.org/goodrelations/v1#Discover', |
| | | 'mastercard' => 'http://purl.org/goodrelations/v1#MasterCard', |
| | | 'visa' => 'http://purl.org/goodrelations/v1#VISA', |
| | | 'jcb' => 'http://purl.org/goodrelations/v1#JCB' |
| | | 'banktransfer' => 'https://purl.org/goodrelations/v1#ByBankTransferInAdvance', |
| | | 'invoice' => 'https://purl.org/goodrelations/v1#ByInvoice', |
| | | 'cash' => 'https://purl.org/goodrelations/v1#Cash', |
| | | 'check' => 'https://purl.org/goodrelations/v1#CheckInAdvance', |
| | | 'cod' => 'https://purl.org/goodrelations/v1#COD', |
| | | 'directdebit' => 'https://purl.org/goodrelations/v1#DirectDebit', |
| | | 'google' => 'https://purl.org/goodrelations/v1#GoogleCheckout', |
| | | 'paypal' => 'https://purl.org/goodrelations/v1#PayPal', |
| | | 'payswarm' => 'https://purl.org/goodrelations/v1#PaySwarm', |
| | | 'amex' => 'https://purl.org/goodrelations/v1#AmericanExpress', |
| | | 'dinersclub' => 'https://purl.org/goodrelations/v1#DinersClub', |
| | | 'discover' => 'https://purl.org/goodrelations/v1#Discover', |
| | | 'mastercard' => 'https://purl.org/goodrelations/v1#MasterCard', |
| | | 'visa' => 'https://purl.org/goodrelations/v1#VISA', |
| | | 'jcb' => 'https://purl.org/goodrelations/v1#JCB' |
| | | ]; |
| | | |
| | | public function getPaymentMethod():array|string|null |
| | |
| | | } |
| | | trait suggestedAnswerTrait { |
| | | /** |
| | | * @var Answer|ItemList The answer(s) that has been suggested as best, typically on a Question/Answer site. Sites vary in their selection mechanisms, e.g. drawing on community opinion and/or the view of the Question author. |
| | | * @var string The answer(s) that has been suggested as best, typically on a Question/Answer site. Sites vary in their selection mechanisms, e.g. drawing on community opinion and/or the view of the Question author. TODO: Answer|ItemList |
| | | */ |
| | | protected string $suggestedAnswer; |
| | | |
| | |
| | | add_filter(BASE.'handle_bulk_operation', [$this, 'processOperation'], 10, 3); |
| | | } |
| | | |
| | | |
| | | // Update relationships for a post |
| | | |
| | | /** |
| | | * @param int $post_id |
| | | * |
| | | * @return void |
| | | */ |
| | | /** |
| | | * Update relationships for a post |
| | | * @param int $post_id |
| | | * @param WP_Post $post |
| | | * @return void |
| | | */ |
| | | public function updatePostRelationships(int $post_id, WP_Post $post):void |
| | | { |
| | | // Skip autosaves and revisions |
| | |
| | | * @param int $userId User ID |
| | | * @param array $data Request data |
| | | * @param array $options { |
| | | * @type string $priority 'low', 'normal', 'high' |
| | | * @type int $delay Seconds to delay processing |
| | | * @type string $scheduled Specific datetime to process |
| | | * @type array|string $depends_on Operation IDs this depends on |
| | | * @type string|array $chunk_key Key(s) to chunk (overrides registry) |
| | | * @type int $chunk_size Chunk size (overrides registry) |
| | | * @type string $priority 'low', 'normal', 'high' |
| | | * @type int $delay Seconds to delay processing |
| | | * @type string $scheduled Specific datetime to process |
| | | * @type array|string $depends_on Operation IDs this depends on |
| | | * @type string|array $chunk_key Key(s) to chunk (overrides registry) |
| | | * @type int $chunk_size Chunk size (overrides registry) |
| | | * } |
| | | * @throws Throwable |
| | | * @throws Throwable |
| | | */ |
| | | public function add(string $type, int $userId, array $data, array $options = []): array|WP_Error |
| | | { |
| | |
| | | 'infinity' |
| | | ); |
| | | } |
| | | |
| | | /** |
| | | * @param WP_REST_Response $response |
| | | * @param WP_REST_Request $request |
| | | * @param string $action |
| | | * |
| | | * @return bool|WP_REST_Response |
| | | * @return WP_REST_Response|bool |
| | | */ |
| | | public function adminActionFilter(WP_REST_Response $response, WP_REST_Request $request, string $action):WP_REST_Response|bool |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @throws \DateMalformedStringException |
| | | */ |
| | | private function calculateTimeline(WP_POST $previous, WP_POST $current): ?string |
| | | { |
| | | $previousDate = strtotime($previous->post_date); |
| | |
| | | public bool $profile_link; |
| | | public bool $is_profile = false; |
| | | /** |
| | | * @var array|string |
| | | * @var array |
| | | */ |
| | | protected array $can_create = []; |
| | | /** |
| | |
| | | /** |
| | | * Instantiates for post types |
| | | * @param string $slug |
| | | * @param string $singular |
| | | * @param string $plural |
| | | * @return self |
| | | */ |
| | | public static function forPost(string $slug, string $singular, string $plural):self |
| | |
| | | /** |
| | | * Instantiates for term types |
| | | * @param string $slug |
| | | * @param string $singular |
| | | * @param string $plural |
| | | * @return self |
| | | */ |
| | | public static function forTerm(string $slug, string $singular, string $plural):self |
| | |
| | | /** |
| | | * Instantiates for user types |
| | | * @param string $slug |
| | | * @param string $singular |
| | | * @param string $plural |
| | | * @return self |
| | | */ |
| | | public static function forUser(string $slug, string $singular, string $plural):self |
| | |
| | | * |
| | | * @return bool|WP_Error Whether or not we can proceed |
| | | */ |
| | | public function checkPermission(WP_REST_Request $request):bool |
| | | public function checkPermission(WP_REST_Request $request):bool|WP_Error |
| | | { |
| | | // Check rate limits first |
| | | if (!$this->rate_limiter->checkLimit($request)) { |
| | |
| | | } |
| | | |
| | | // ========== HTTP CACHING METHODS ========== |
| | | |
| | | /** |
| | | * Check HTTP caching headers (ETag and If-Modified-Since) |
| | | * Returns 304 Not Modified if content hasn't changed |
| | | * |
| | | * @param WP_REST_Request $request The REST request |
| | | * @param string|array $content_types Content type(s) to check timestamps for |
| | | * @param array $additional_params Additional params for ETag uniqueness (e.g., user_id, filters) |
| | | * @return WP_REST_Response|null Returns 304 response if not modified, null to continue processing |
| | | * @param WP_REST_Request $request |
| | | * @param int|string|array $key Content type(s) to check timestamps for |
| | | * @param string|array $group Additional params for ETag uniqueness (e.g., user_id, filters) |
| | | * @return WP_REST_Response|false Returns 304 response if not modified, null to continue processing |
| | | */ |
| | | protected function checkHeaders( |
| | | WP_REST_Request $request, |
| | |
| | | } |
| | | |
| | | /** |
| | | * @param WP_Post $post the post object |
| | | * |
| | | * @param WP_Post $post |
| | | * @param bool $skip |
| | | * @param bool $fields |
| | | * @return array |
| | | */ |
| | | protected function preparePost(WP_Post $post, bool $skip = false, bool $fields = true): array |
| | |
| | | } |
| | | |
| | | /** |
| | | * @param WP_Term $post the post object |
| | | * |
| | | * @param WP_Term $post |
| | | * @param bool $fields |
| | | * @return array |
| | | */ |
| | | protected function prepareTerm(WP_Term $post, bool $fields = true): array |
| | |
| | | } |
| | | |
| | | /** |
| | | * Formats an item |
| | | * @param int $postID |
| | | * |
| | | * @param string $type |
| | | * @param $skip |
| | | * @return array |
| | | */ |
| | | protected function formatItem(int $postID, string $type = 'post', $skip = false): array |
| | |
| | | * @param array $items Formatted Args for WP_Query |
| | | * @param array $data parsed Request Data |
| | | * |
| | | * @return array|null |
| | | * @return array |
| | | */ |
| | | protected function processHighlightedItem(array $items, array $data): array |
| | | { |
| | |
| | | |
| | | /** |
| | | * @param array $args |
| | | * @param array $filters |
| | | * @param array $data |
| | | * |
| | | * @return array |
| | | */ |
| | |
| | | |
| | | // Remove sensitive data |
| | | // Remove sensitive configuration |
| | | $public_forms = array_map(function ($config) use ($field) { |
| | | $public_forms = array_map(function ($config) { |
| | | return [ |
| | | 'title' => $config['title'], |
| | | 'description' => $config['description'], |
| | |
| | | } |
| | | |
| | | try { |
| | | /** @var Square $square */ |
| | | $square = Square::getInstance(); |
| | | if (!method_exists($square, 'getOrCreateSquareCustomer') || |
| | | !method_exists($square, 'createSquareOrder') || |
| | |
| | | * Build the main $context for UploadManager from the $request params |
| | | * @param WP_REST_Request $request |
| | | * @return array |
| | | * @throws Exception |
| | | * @throws Exception |
| | | */ |
| | | protected function buildUploadArgs(WP_REST_Request $request):array |
| | | { |
| | |
| | | /** |
| | | * Get common terms for taxonomy |
| | | * @param string $taxonomy |
| | | * @param string|null $limit |
| | | * @return array |
| | | */ |
| | | protected function getCommonTerms(string $taxonomy, ?string $limit = null):array { |
| | |
| | | return $this->id; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Add a menu item |
| | | * |
| | | * @param string|null $text |
| | | * @param string|null $icon |
| | | * @return MenuItem |
| | | */ |
| | | public function addItem(?string $text = null, ?string $icon = null): MenuItem { |