diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-05-29 15:32:37 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-05-29 15:32:37 +0100 |
| commit | 6b0a62a5a356e1dd3274e3966552d73f155e8936 (patch) | |
| tree | b8b86daf5dbbf84f557833072f14c71712b0d619 | |
| parent | c401680a7cbe4ffffbcd496fa671e319a4967fc1 (diff) | |
| download | liberty-6b0a62a5a356e1dd3274e3966552d73f155e8936.tar.gz liberty-6b0a62a5a356e1dd3274e3966552d73f155e8936.tar.bz2 liberty-6b0a62a5a356e1dd3274e3966552d73f155e8936.zip | |
Add enrichXrefDisplay hook and xkey_ext to value edit template
- LibertyContent: add enrichXrefDisplay() no-op hook; call it in edit_xref.php
so packages can inject display-only data (e.g. component title) into xrefInfo
- edit_xref_value_item.tpl: add Notes (xkey_ext) field alongside Value (xkey)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| -rw-r--r-- | edit_xref.php | 2 | ||||
| -rwxr-xr-x | includes/classes/LibertyContent.php | 2 | ||||
| -rw-r--r-- | templates/edit_xref_value_item.tpl | 7 |
3 files changed, 11 insertions, 0 deletions
diff --git a/edit_xref.php b/edit_xref.php index b58044a..bd4d161 100644 --- a/edit_xref.php +++ b/edit_xref.php @@ -49,6 +49,8 @@ if( !empty( $_REQUEST['fSaveXref'] ) ) { $xrefInfo = $gContent->mInfo['xref_store']['data'] ?? []; } +$gContent->enrichXrefDisplay( $xrefInfo ); + $gBitSmarty->assign( 'gContent', $gContent ); $gBitSmarty->assign( 'xrefInfo', $xrefInfo ); $gBitSmarty->assign( 'errors', $gContent->mErrors ); diff --git a/includes/classes/LibertyContent.php b/includes/classes/LibertyContent.php index 58894be..61b5d42 100755 --- a/includes/classes/LibertyContent.php +++ b/includes/classes/LibertyContent.php @@ -2155,6 +2155,8 @@ class LibertyContent extends LibertyBase implements BitCacheable { * @param number $pContentId a valid content id * @param array $pMixed a hash of params to add to the url */ + public function enrichXrefDisplay( array &$pXrefInfo ): void {} + public function getXrefListTemplate( ?string $pTemplate = null ): string { if( $pTemplate ) { $package = $this->mType['handler_package'] ?? 'liberty'; diff --git a/templates/edit_xref_value_item.tpl b/templates/edit_xref_value_item.tpl index 0418d1e..99e2541 100644 --- a/templates/edit_xref_value_item.tpl +++ b/templates/edit_xref_value_item.tpl @@ -24,6 +24,13 @@ {/forminput} </div> + <div class="form-group"> + {formlabel label="Notes" for="xkey_ext"} + {forminput} + <input type="text" class="form-control input-small" name="xkey_ext" id="xkey_ext" value="{$xrefInfo.xkey_ext|escape}" /> + {/forminput} + </div> + <div class="form-group submit"> <input type="submit" class="btn btn-default" name="fCancel" value="{tr}Cancel{/tr}" /> <input type="submit" class="btn btn-primary" name="fSaveXref" value="{tr}Save{/tr}" /> |
