diff options
author | zotlabs <mike@macgirvin.com> | 2017-10-10 16:05:10 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-10-10 16:05:10 -0700 |
commit | 6a2c5e07310e723d020e4b6d4123181db5c805db (patch) | |
tree | 2eec46c9ec6e05d3a23b837d0fbb8c129ff3fca3 | |
parent | 335536bbbf0069442a445b9b641a5f51208fca86 (diff) | |
download | volse-hubzilla-6a2c5e07310e723d020e4b6d4123181db5c805db.tar.gz volse-hubzilla-6a2c5e07310e723d020e4b6d4123181db5c805db.tar.bz2 volse-hubzilla-6a2c5e07310e723d020e4b6d4123181db5c805db.zip |
pdledit usability improvements
-rw-r--r-- | Zotlabs/Module/Pdledit.php | 26 | ||||
-rw-r--r-- | view/tpl/pdledit.tpl | 3 |
2 files changed, 26 insertions, 3 deletions
diff --git a/Zotlabs/Module/Pdledit.php b/Zotlabs/Module/Pdledit.php index 618444480..f8af470ac 100644 --- a/Zotlabs/Module/Pdledit.php +++ b/Zotlabs/Module/Pdledit.php @@ -14,7 +14,7 @@ class Pdledit extends \Zotlabs\Web\Controller { if(! trim($_REQUEST['content'])) { del_pconfig(local_channel(),'system','mod_' . $_REQUEST['module'] . '.pdl'); - goaway(z_root() . '/pdledit/' . $_REQUEST['module']); + goaway(z_root() . '/pdledit'); } set_pconfig(local_channel(),'system','mod_' . $_REQUEST['module'] . '.pdl',escape_tags($_REQUEST['content'])); build_sync_packet(); @@ -34,19 +34,38 @@ class Pdledit extends \Zotlabs\Web\Controller { notice( t('Feature disabled.') . EOL); return; } - + + if(argc() > 2 && argv(2) === 'reset') { + del_pconfig(local_channel(),'system','mod_' . argv(1) . '.pdl'); + goaway(z_root() . '/pdledit'); + } + if(argc() > 1) $module = 'mod_' . argv(1) . '.pdl'; else { $o .= '<div class="generic-content-wrapper-styled">'; $o .= '<h1>' . t('Edit System Page Description') . '</h1>'; + + $edited = []; + + $r = q("select k from pconfig where uid = %d and cat = 'system' and k like '%s' ", + intval(local_channel()), + dbesc('mod_%.pdl') + ); + + if($r) { + foreach($r as $rv) { + $edited[] = substr(str_replace('.pdl','',$rv['k']),4); + } + } + $files = glob('Zotlabs/Module/*.php'); if($files) { foreach($files as $f) { $name = lcfirst(basename($f,'.php')); $x = theme_include('mod_' . $name . '.pdl'); if($x) { - $o .= '<a href="pdledit/' . $name . '" >' . $name . '</a><br />'; + $o .= '<a href="pdledit/' . $name . '" >' . $name . '</a>' . ((in_array($name,$edited)) ? ' ' . t('(modified)') . ' <a href="pdledit/' . $name . '/reset" >' . t('Reset') . '</a>': '' ) . '<br />'; } } } @@ -69,6 +88,7 @@ class Pdledit extends \Zotlabs\Web\Controller { '$header' => t('Edit System Page Description'), '$mname' => t('Module Name:'), '$help' => t('Layout Help'), + '$another' => t('Edit another layout'), '$module' => argv(1), '$content' => htmlspecialchars($t,ENT_COMPAT,'UTF-8'), '$submit' => t('Submit') diff --git a/view/tpl/pdledit.tpl b/view/tpl/pdledit.tpl index cef93d324..2ea89b6c1 100644 --- a/view/tpl/pdledit.tpl +++ b/view/tpl/pdledit.tpl @@ -5,6 +5,9 @@ <br /> <a href="help/comanche" target="hubzilla-help">{{$help}}</a> +<br> +<br> +<a href="pdledit">{{$another}}</a> <br /> <br /> |