From aa9d25f51764c7bbd2922d6e91f609e89659b2f6 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 4 Mar 2014 18:12:27 -0800 Subject: add system PDL editor (lets you change/personalise the layout for any module which has a system PDL file.) --- mod/pdledit.php | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 mod/pdledit.php (limited to 'mod/pdledit.php') diff --git a/mod/pdledit.php b/mod/pdledit.php new file mode 100644 index 000000000..e3ff2292d --- /dev/null +++ b/mod/pdledit.php @@ -0,0 +1,61 @@ + 1) + $module = 'mod_' . argv(1) . '.pdl'; + else { + $o .= '

' . t('Edit System Page Description') . '

'; + $files = glob('mod/*'); + if($files) { + foreach($files as $f) { + $name = basename($f,'.php'); + $x = theme_include('mod_' . $name . '.pdl'); + if($x) { + $o .= '' . $name . '
'; + } + } + } + + // list module pdl files + return $o; + } + + $t = get_pconfig(local_user(),'system',$module); + if(! $t) + $t = file_get_contents(theme_include($module)); + if(! $t) { + notice( t('Layout not found.') . EOL); + return ''; + } + + $o = replace_macros(get_markup_template('pdledit.tpl'),array( + '$header' => t('Edit System Page Description'), + '$mname' => t('Module Name:'), + '$module' => argv(1), + '$content' => htmlspecialchars($t,ENT_COMPAT,'UTF-8'), + '$submit' => t('Submit') + )); + + return $o; +} -- cgit v1.2.3 From cdcbc5816e21d53172c5396083b38fce4ab0ba38 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 4 Mar 2014 21:03:56 -0800 Subject: add Comanche help link to pdledit --- mod/pdledit.php | 1 + 1 file changed, 1 insertion(+) (limited to 'mod/pdledit.php') diff --git a/mod/pdledit.php b/mod/pdledit.php index e3ff2292d..36b9a0c14 100644 --- a/mod/pdledit.php +++ b/mod/pdledit.php @@ -52,6 +52,7 @@ function pdledit_content(&$a) { $o = replace_macros(get_markup_template('pdledit.tpl'),array( '$header' => t('Edit System Page Description'), '$mname' => t('Module Name:'), + '$help' => t('Layout Help'), '$module' => argv(1), '$content' => htmlspecialchars($t,ENT_COMPAT,'UTF-8'), '$submit' => t('Submit') -- cgit v1.2.3