<commit_before><?php
namespace Zotlabs\Module;


class Pdledit extends \Zotlabs\Web\Controller {

	function post() {
		if(! local_channel())
			return;
		if(! $_REQUEST['module'])
			return;
		if(! trim($_REQUEST['content'])) {
			del_pconfig(local_channel(),'system','mod_' . $_REQUEST['module'] . '.pdl');
			goaway(z_root() . '/pdledit/' . $_REQUEST['module']);
		}
		set_pconfig(local_channel(),'system','mod_' . $_REQUEST['module'] . '.pdl',escape_tags($_REQUEST['content']));
		build_sync_packet();
		info( t('Layout updated.') . EOL);
		goaway(z_root() . '/pdledit/' . $_REQUEST['module']);
	}
	
	
		function get() {
	
		if(! local_channel()) {
			notice( t('Permission denied.') . EOL);
			return;
		}
	
		if(argc() > 1)
			$module = 'mod_' . argv(1) . '.pdl';
		else {
			$o .= '<div class="generic-content-wrapper-styled">';
			$o .= '<h1>' . t('Edit System Page Description') . '</h1>';
			$files = glob('mod/*');
			if($files) {
				foreach($files as $f) {
					$name = basename($f,'.php');
					$x = theme_include('mod_' . $name . '.pdl');
					if($x) {
						$o .= '<a href="pdledit/' . $name . '" >' . $name . '</a><br />';
					}
				}
			}
	
	                $o .= '</div>';
			
			// list module pdl files
			return $o;
		}
	
		$t = get_pconfig(local_channel(),'system',$module);
		if(! $t)
			$t = file_get_contents(theme_include($module));
		if(! $t) {
			notice( t('Layout not found.') . EOL);
			return '';
		}
	<commit_msg>fix pdledit list mode<commit_after><?php
namespace Zotlabs\Module;


class Pdledit extends \Zotlabs\Web\Controller {

	function post() {
		if(! local_channel())
			return;
		if(! $_REQUEST['module'])
			return;
		if(! trim($_REQUEST['content'])) {
			del_pconfig(local_channel(),'system','mod_' . $_REQUEST['module'] . '.pdl');
			goaway(z_root() . '/pdledit/' . $_REQUEST['module']);
		}
		set_pconfig(local_channel(),'system','mod_' . $_REQUEST['module'] . '.pdl',escape_tags($_REQUEST['content']));
		build_sync_packet();
		info( t('Layout updated.') . EOL);
		goaway(z_root() . '/pdledit/' . $_REQUEST['module']);
	}
	
	
	function get() {
	
		if(! local_channel()) {
			notice( t('Permission denied.') . EOL);
			return;
		}
	
		if(argc() > 1)
			$module = 'mod_' . argv(1) . '.pdl';
		else {
			$o .= '<div class="generic-content-wrapper-styled">';
			$o .= '<h1>' . t('Edit System Page Description') . '</h1>';
			$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 .= '</div>';
			
			// list module pdl files
			return $o;
		}
	
		$t = get_pconfig(local_channel(),'system',$module);
		if(! $t)
			$t = file_get_contents(theme_include($module));
		if(! $t) {
			notice( t('Layout not found.') . EOL);
			return '';
		}
	
{'fraction_non_alphanumeric': 0.234525447042641, 'fraction_numerical': 0.002751031636863824, 'mean_word_length': 3.0068870523415976, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1651441', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1087, 'n_words': 205}