added popup for option --sort-empty

This commit is contained in:
jygaulier
2013-01-30 16:24:44 +01:00
parent 4ff2b4a6b3
commit 2cdf93a31b

View File

@@ -85,6 +85,12 @@ class task_period_cindexer extends task_abstract
*/
protected $stem;
/**
*
* @var string
*/
protected $sortempty;
/**
*
* @var string
@@ -131,13 +137,13 @@ class task_period_cindexer extends task_abstract
$request = http_request::getInstance();
$parm2 = $request->get_parms(
'binpath', 'host', 'port', 'base', 'user', 'password', 'socket', 'use_sbas', 'nolog', 'clng', 'winsvc_run', 'charset', 'debugmask', 'stem'
'binpath', 'host', 'port', 'base', 'user', 'password', 'socket', 'use_sbas', 'nolog', 'clng', 'winsvc_run', 'charset', 'debugmask', 'stem', 'sortempty'
);
$dom = new DOMDocument();
$dom->formatOutput = true;
if ($dom->loadXML($oldxml)) {
$xmlchanged = false;
foreach (array("str:binpath", "str:host", "str:port", "str:base", "str:user", "str:password", "str:socket", "boo:use_sbas", "boo:nolog", "str:clng", "boo:winsvc_run", "str:charset", 'str:debugmask', 'str:stem') as $pname) {
foreach (array("str:binpath", "str:host", "str:port", "str:base", "str:user", "str:password", "str:socket", "boo:use_sbas", "boo:nolog", "str:clng", "boo:winsvc_run", "str:charset", 'str:debugmask', 'str:stem', 'str:sortempty') as $pname) {
$ptype = substr($pname, 0, 3);
$pname = substr($pname, 4);
$pvalue = $parm2[$pname];
@@ -207,6 +213,7 @@ class task_period_cindexer extends task_abstract
winsvc_run.checked = isyes(xml.find("winsvc_run").text());
charset.value = xml.find("charset").text();
stem.value = xml.find("stem").text();
sortempty.value = xml.find("sortempty").text();
debugmask.value = 0|xml.find("debugmask").text();
}
}
@@ -240,6 +247,8 @@ class task_period_cindexer extends task_abstract
cmd += " -c=" + clng.value;
if(stem.value)
cmd += " --stem=" + stem.value;
if(sortempty.value)
cmd += " --sort-empty=" + sortempty.value;
if(debugmask.value)
cmd += " -d=" + debugmask.value;
if(winsvc_run.checked)
@@ -303,9 +312,21 @@ class task_period_cindexer extends task_abstract
<?php echo _('task::cindexer:default language for new candidates') ?>&nbsp;:&nbsp;<input type="text" name="clng" style="width:50px;" value="">
<br/>
<?php echo _('task::cindexer:stemming languages') ?>&nbsp;:&nbsp;<input type="text" name="stem" style="width:200px;" value="">
<?php echo _('task::cindexer:stemming languages') ?>&nbsp;:&nbsp;<input type="text" name="stem" style="width:150px;" value="">
&nbsp;<?php echo _('task::cindexer:ex.: fr,en') ?>
<br/>
<!--
<?php echo _('task::cindexer:sort empty') ?>&nbsp;:&nbsp;<input type="text" name="sortempty" style="width:20px;" value="">
&nbsp;<?php echo _('task:: A | Z') ?>
<br/>
-->
<?php echo _('task::cindexer:sort records with an empty field') ?>&nbsp;
<select name="sortempty">
<option value=""><?php echo _('task::not shown') ?></option>
<option value="A"><?php echo _('task::at the beginning') ?></option>
<option value="Z"><?php echo _('task::at the end') ?></option>
</select>
<br/>
<input type="checkbox" name="nolog">&nbsp;<?php echo _('task::cindexer:do not (sys)log, but out to console)') ?>
<br/>
@@ -338,6 +359,7 @@ class task_period_cindexer extends task_abstract
$this->use_sbas = p4field::isyes(trim($sx_task_settings->use_sbas));
$this->charset = trim($sx_task_settings->charset);
$this->stem = trim($sx_task_settings->stem);
$this->sortempty = trim($sx_task_settings->sortempty);
$this->debugmask = (int) (trim($sx_task_settings->debugmask));
$this->nolog = p4field::isyes(trim($sx_task_settings->nolog));
$this->winsvc_run = p4field::isyes(trim($sx_task_settings->winsvc_run));
@@ -408,6 +430,10 @@ class task_period_cindexer extends task_abstract
$args[] = '--stem=' . $this->stem;
$args_nopwd[] = '--stem=' . $this->stem;
}
if ($this->sortempty) {
$args[] = '--sort-empty=' . $this->sortempty;
$args_nopwd[] = '--sort-empty=' . $this->sortempty;
}
if ($this->debugmask > 0) {
$args[] = '-d=' . $this->debugmask;
$args_nopwd[] = '-d=' . $this->debugmask;