From e16ea1ae0568238fa4c2236d1f050ef4a85749c7 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 4 Jan 2023 14:25:46 +0000 Subject: pdl editor for addon iitial commit --- Zotlabs/Module/Pdledit.php | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Module/Pdledit.php') diff --git a/Zotlabs/Module/Pdledit.php b/Zotlabs/Module/Pdledit.php index 3b94c9611..e0bbc31d0 100644 --- a/Zotlabs/Module/Pdledit.php +++ b/Zotlabs/Module/Pdledit.php @@ -78,6 +78,23 @@ class Pdledit extends Controller { } } + // addons + $o .= '

Addons

'; + + $addons = plugins_installed_list(); + + foreach ($addons as $addon) { + + $path = 'addon/' . $addon . '/Mod_' . ucfirst($addon) . '.php'; + + if (!file_exists($path)) + continue; + + $o .= '' . $addon . '' . ((in_array($addon, $edited)) ? ' ' . t('(modified)') . ' ' . t('Reset') . '': '' ) . '
'; + + } + + $o .= ''; // list module pdl files @@ -85,11 +102,25 @@ class Pdledit extends Controller { } $t = get_pconfig(local_channel(),'system',$module); - $s = file_get_contents(theme_include($module)); - if(! $t) { + $s = ''; + + if(!$t) { + $sys_path = theme_include($module); + + if ($sys_path) { + $s = file_get_contents($sys_path); + } + else { + $addon_path = 'addon/' . argv(1) . '/' . $module; + if (file_exists($addon_path)) { + $s = file_get_contents($addon_path); + } + } + $t = $s; } - if(! $t) { + + if(!$t) { notice( t('Layout not found.') . EOL); return ''; } -- cgit v1.2.3