output = ''; if (!checkSecurityToken()) return; if(!empty($_REQUEST['help'])) { $this->output = '
' . shell_exec(METADISP_CMDL  .'-h') .'
'; return; } $commands = $_REQUEST['cmd']; //msg('
'.print_r($_REQUEST,1).'
'); $start_dir = $commands['namespace'] ? $commands['namespace'] : '.'; $cmdline = METADISP_CMDL .'-n ' . $start_dir; if(!empty($commands['page'])) { $cmdline .= " -p " . $commands['page']; if(!empty($commands['exact'])) { $cmdline .= " -e " . $commands['exact']; } else $cmdline .= " -e " . 'off'; } if(!empty($commands['search'])) { $this->search = $commands['search']; $this->stchecked_exact = ""; $this->stchecked_fuzzy = ""; if($commands['srch_type'] == 'fuzzy') { $cmdline .= " -f " . $this->search; $this->stchecked_fuzzy = 'checked'; } else { $cmdline .= " -s " . $this->search; $this->stchecked_exact = 'checked'; } $ltype = $_REQUEST['ltype']; if($ltype) { if($ltype == 'links') { $this->links_checked = 'checked'; } else if($ltype == 'media') { $this->media_checked = 'checked'; } else if($ltype == 'descr') { $this->descr_checked = 'checked'; } else if($ltype == 'creator') { $this->creator_checked = 'checked'; } else if($ltype == 'contrib') { $this->contrib_checked = 'checked'; if($commands['srch_type'] == 'fuzzy') { msg($this->getLang('nofuzzy'),2); } } $cmdline .= " -l $ltype "; } } if(!empty($commands['pcreated']) || !empty($commands['pmodified']) ) { $date_not_set = ""; if(empty($commands['year'] )) { $commands['year'] = date('Y'); $date_not_set = $commands['year'] ; } if(empty($commands['month'] )) { $date_not_set .= '1'; $commands['month'] = '1'; } if(empty($commands['day'] )) { $date_not_set .= '1'; $commands['day'] = '1'; } if($date_not_set) { $date_not_set = $commands['year'] . '-' . $commands['month'] . '-' . $commands['day'] = '1'; msg("Using defaults for missing date fields: $date_not_set" ,1); } $timestamp = $commands['year'] .'-'. $commands['month'] .'-'. $commands['day']; $w = (isset($_REQUEST['when']) && $_REQUEST['when'] == 'earlier') ? ' -b ': ' -a '; $cmdline .= $w . "$timestamp"; $dtm = $commands['pcreated']?'created':'modified'; $cmdline .= " --dtype $dtm"; $this->dtype = $dtm; } $cmdline .= ' -c html'; // msg('
'.print_r($commands,1).'
'); $this->year = $commands['year']; $this->month = $commands['month']; $this->day = $commands['day']; $this->start_dir = $start_dir; $this->page = (!empty($commands['page'])) ? $commands['page'] : ""; if(!$commands['testcl']) { $this->output =shell_exec($cmdline); } else { $this->CommandLine = preg_replace('#^'. METADISP_CMDL .'(.*?)-c html#','php plugin.php metadisplay '."$1",$cmdline); } } function html() { ptln('
'); // output hidden values to ensure dokuwiki will return back to this plugin ptln(' '); ptln(''); formSecurityToken(); /*Namespace/page*/ ptln('
Namespace: '); ptln('  Page: '); ptln('  ' .$this->getLang('exact').':  '); /*Date*/ ptln('
'); ptln($this->getLang('date') . ':  '); ptln(''); ptln(''); ptln(''); ptln('
  '); ptln($this->getLang('when') ); $dtype_c = ""; $dtype_m = ""; if($this->dtype == 'modified') { $dtype_m = 'checked'; ; } if($this->dtype == 'created') { $dtype_c = 'checked'; } ptln( ''); ptln($this->getLang('andor') . '
  • '); ptln('
  • '); /* Search */ ptln($this->getLang("search") . ':  '); $_fchecked = $this->stchecked_fuzzy; $_echecked = $this->stchecked_exact; ptln ('   '); ptln(' '); ptln('   links_checked .'>'); ptln(' media_checked .'>'); ptln(' descr_checked .'>'); ptln('   creator_checked .'>'); ptln(' contrib_checked .'>'); ptln('
    Test Command line: '. $this->CommandLine .'
    '); ptln(''); ptln('
    '); ptln('  
    '); ptln(''); ptln('

    '.$this->output.'
    '); } }