diff options
author | Mario <mario@mariovavti.com> | 2023-01-04 14:25:46 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-01-04 14:25:46 +0000 |
commit | e16ea1ae0568238fa4c2236d1f050ef4a85749c7 (patch) | |
tree | 950f23a52ad95d46b2f4cb46d821850b5c347740 /Zotlabs/Module/Pdledit.php | |
parent | 941135a0a63d72d6300ab93a608cd5c8354d9e0a (diff) | |
download | volse-hubzilla-e16ea1ae0568238fa4c2236d1f050ef4a85749c7.tar.gz volse-hubzilla-e16ea1ae0568238fa4c2236d1f050ef4a85749c7.tar.bz2 volse-hubzilla-e16ea1ae0568238fa4c2236d1f050ef4a85749c7.zip |
pdl editor for addon iitial commit
Diffstat (limited to 'Zotlabs/Module/Pdledit.php')
-rw-r--r-- | Zotlabs/Module/Pdledit.php | 37 |
1 files changed, 34 insertions, 3 deletions
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 .= '<h2>Addons</h2>'; + + $addons = plugins_installed_list(); + + foreach ($addons as $addon) { + + $path = 'addon/' . $addon . '/Mod_' . ucfirst($addon) . '.php'; + + if (!file_exists($path)) + continue; + + $o .= '<a href="pdledit/' . $addon . '" >' . $addon . '</a>' . ((in_array($addon, $edited)) ? ' ' . t('(modified)') . ' <a href="pdledit/' . $addon . '/reset" >' . t('Reset') . '</a>': '' ) . '<br />'; + + } + + $o .= '</div>'; // 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 ''; } |