';
foreach($panels as$panel){
$children=dune_sections_children((int)$panel['fid'],$all);
$html.='

'.dune_sections_escape(strip_tags($panel['description'])).'
SUBCATEGORY ';
$previous=$mybb->settings['hideprivateforums'];$mybb->settings['hideprivateforums']=1;
try{
- if($children){$html.='Forums'.dune_sections_links($children).'
';$rows=build_forumbits((int)$panel['fid'],2);}
+ if($children){$rows=build_forumbits((int)$panel['fid'],2);}
elseif($panel['type']==='f'){
$copy=$panel;$copy['name']='Discussions';$copy['description']='';$virtual=-991;
$before=$fcache[$virtual]??null;$fcache[$virtual]=[0=>[(int)$panel['fid']=>$copy]];
@@ -47,6 +47,7 @@ function dune_sections_index(){
}else $rows=null;
}finally{$mybb->settings['hideprivateforums']=$previous;}
if($rows&&!empty($rows['forum_list']))$html.='| Forum | Threads | Posts | Last post |
'.$rows['forum_list'].'
';
+ else if($children)$html.='Forums'.dune_sections_links($children).'
';
else $html.='No visible forums in this section.
';
$html.='';
}
diff --git a/website/ops/publish-realm-design.py b/website/ops/publish-realm-design.py
index 6a20f2d2..3b5ae881 100644
--- a/website/ops/publish-realm-design.py
+++ b/website/ops/publish-realm-design.py
@@ -6,8 +6,8 @@ release=pathlib.Path('/home/dunerealms/apps/dunerealms/current').resolve(strict=
assert release.name=='ci-'+args.expected_release
base=pathlib.Path('/home/dunerealms/apps/integrations').resolve(strict=True)
node='/home/dunerealms/.nvm/versions/node/v22.23.3/bin/node'
-result=subprocess.run([node,'--input-type=module','-e',"import {SHARED_HEADER,SHARED_HEAD} from './scripts/portal-navigation.mjs';console.log(JSON.stringify({header:SHARED_HEADER,head:SHARED_HEAD}));"],cwd=release,capture_output=True,text=True,check=True)
-chrome=json.loads(result.stdout);script=(release/'web/realm-design.js').read_text();css=(release/'web/realm-design.css').read_text();assert '__duneRealmDesign' in script and 'dr-native' in css and 'dr-header-brand' in chrome['header']
+result=subprocess.run([node,'--input-type=module','-e',"import {SHARED_HEADER,SHARED_HEAD} from './scripts/portal-navigation.mjs';import {sharedHomepageHeaderScript} from './scripts/homepage-header.mjs';console.log(JSON.stringify({header:SHARED_HEADER,head:SHARED_HEAD,runtime:sharedHomepageHeaderScript()}));"],cwd=release,capture_output=True,text=True,check=True)
+chrome=json.loads(result.stdout);script=(release/'web/realm-design.js').read_text()+chrome['runtime'];support_css=(release/'scripts/osticket-presentation.css').read_text();forum_css=(release/'scripts/mybb-presentation.css').read_text();css=(release/'web/realm-design.css').read_text()+'\n'+(release/'scripts/homepage-header.css').read_text()+'\n'+support_css+'\n'+forum_css;assert '__duneRealmDesign' in script and 'dr-native' in css and 'data-shared-header-source="homepage"' in chrome['header']
start='/* DUNE REALM DESIGN START */';end='/* DUNE REALM DESIGN END */'
def append(old,content):
if start in old:
@@ -19,12 +19,17 @@ native_head=chrome['head'].replace('href="/portal-navigation.css"','href="https:
# already includes realm-design.js. Keep their existing script security policy.
native_head=re.sub(r'','',native_head)
changes={'shared-header.html':chrome['header'],'shared-header-head.html':native_head}
-hook=base/'shared-header.php';original_hook=hook.read_text();assert 'v=canonical-362' in original_hook or 'v=realm-design-1' in original_hook
-changes['shared-header.php']=original_hook.replace('v=canonical-362','v=realm-design-1')
+hook=base/'shared-header.php';original_hook=hook.read_text();assert any(v in original_hook for v in ('v=canonical-362','v=realm-design-1','v=template-fix-6000'))
+changes['shared-header.php']=original_hook.replace('v=canonical-362','v=template-fix-6000').replace('v=realm-design-1','v=template-fix-6000').replace('dune-osticket-theme.css?v=20261103-alpha','dune-osticket-theme.css?v=template-fix-6000').replace('dune-forum-polish.css?v=328-1','dune-forum-polish.css?v=template-fix-6000')
for app in ['mybb','osticket']:
for ext,content in [('js',(release/'dist/shared-chrome/portal-navigation.js').read_text()),('css',(release/'dist/shared-chrome/portal-navigation.css').read_text()+'\n'+re.sub(r'^@import[^;]+;\s*','',css))]:
relative=app+'/dune-navigation.'+ext;target=(base/relative).resolve(strict=True);assert target.is_relative_to(base)
changes[relative]=content
+support_theme=(base/'osticket/dune-osticket-theme.css').resolve(strict=True);assert support_theme.is_relative_to(base)
+changes['osticket/dune-osticket-theme.css']=append(support_theme.read_text(),support_css)
+forum_theme=(base/'mybb/dune-forum-polish.css').resolve(strict=True);assert forum_theme.is_relative_to(base)
+changes['mybb/dune-forum-polish.css']=append(forum_theme.read_text(),forum_css)
+changes['mybb/inc/plugins/dune_sections.php']=(release/'integrations/mybb/inc/plugins/dune_sections.php').read_text()
targets={name:(base/name).resolve(strict=True) for name in changes}
assert all(target.is_relative_to(base) for target in targets.values())
# The standalone shop host keeps its own document and iframe bridge.
diff --git a/website/scripts/build.mjs b/website/scripts/build.mjs
index 798305ce..22687e87 100644
--- a/website/scripts/build.mjs
+++ b/website/scripts/build.mjs
@@ -1,5 +1,6 @@
import {applySharedHeader,applySharedFooter,SHARED_FOOTER_SCRIPT,cleanLegacyChromeScript,assertSharedChrome} from './site-chrome.mjs';
import {SHARED_HEADER} from './portal-navigation.mjs';
+import {sharedHomepageHeaderScript} from './homepage-header.mjs';
import {applyRealmPageDesign} from './realm-page-design.mjs';
import {publishExchangeAssets} from './public-exchange-assets.mjs';
import {createHash} from 'node:crypto';
@@ -13,8 +14,10 @@ import{updatePortalNavigation}from'./portal-navigation.mjs';
import {readFileSync,writeFileSync as writePlain,renameSync,unlinkSync,openSync,writeSync,closeSync,readdirSync,statSync,mkdirSync,existsSync,rmSync,cpSync} from 'node:fs';import path from 'node:path';import {fileURLToPath} from 'node:url';
function writeFileSync(file,content){const temporary=file+'.build-'+process.pid;writePlain(temporary,content);renameSync(temporary,file);}
const root=path.resolve(path.dirname(fileURLToPath(import.meta.url)),'..'),web=path.join(root,'web'),dist=path.join(root,'dist');
+const sharedRealmRuntime=readFileSync(path.join(web,'realm-design.js'),'utf8')+sharedHomepageHeaderScript();
+const sharedRealmCSS=Buffer.concat([readFileSync(path.join(web,'realm-design.css')),readFileSync(new URL('./homepage-header.css',import.meta.url)),readFileSync(new URL('./osticket-presentation.css',import.meta.url)),readFileSync(new URL('./mybb-presentation.css',import.meta.url))]);
// Embedded workspaces execute the same runtime through their permitted origin.
-writeFileSync(path.join(root,'control-panel/public/cp-v2/cp-v2-realm-design.mjs'),readFileSync(path.join(web,'realm-design.js')));
+writeFileSync(path.join(root,'control-panel/public/cp-v2/cp-v2-realm-design.mjs'),sharedRealmRuntime);
// CP entry documents are served directly by the existing CP process. Compile their
// shared chrome from the same templates as public pages, without altering forms.
function compileCPChrome(directory){for(const entry of readdirSync(directory,{withFileTypes:true})){const file=path.join(directory,entry.name);if(entry.isDirectory()){if(entry.name!=='native-editor')compileCPChrome(file);continue;}if(!entry.name.endsWith('.html'))continue;const old=readFileSync(file,'utf8');if(!old.includes('dune-site-header'))continue;const next=assertSharedChrome(applySharedFooter(applySharedHeader(old,SHARED_HEADER)),SHARED_HEADER,file);if(next!==old)writeFileSync(file,next);}}
@@ -38,10 +41,10 @@ if(!legalNotice)throw Error('Homepage legal notice is missing');
function preparePublicHtml(html,file){
html=applyRealmPageDesign(html,file);
// A single template owns the chrome; page content and service forms remain local.
- html=applySharedHeader(html,SHARED_HEADER);
+ html=applySharedHeader(html,SHARED_HEADER,file);
html=applySharedFooter(html);
// All page families retain one shared notice, including generated documents.
- let result=//.test(html)?html:updatePortalNavigation(html);
+ let result=file==='index.html'||//.test(html)?html:updatePortalNavigation(html);
if(!result.includes('class="legal-notice"')){
if(!result.includes(''))throw Error('Public HTML page missing closing body');
result=result.replace('',legalNotice+'