Commit f64257e4 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Fixes #4353 added path mask option to repositories

parent 5b54eacc
......@@ -73,6 +73,11 @@ class FAIRepositoryAttribute extends PipeSeparatedCompositeAttribute
'distribution', TRUE,
array('debian','centos')
),
new StringAttribute(
_('Path pattern'), _('How this repository is organized (only for RPM repositories)'),
'pathMask', FALSE,
'%RELEASE%/%SECTION%/%ARCH%/'
),
),
$acl,
$label
......@@ -97,8 +102,10 @@ class FAIRepositoryAttribute extends PipeSeparatedCompositeAttribute
serviceRepository::getReleaseList($this->attributes[7]->getValue())
);
$modeChoices = array_merge(array('install', 'update'), $releaseList);
$this->attributes[8]->setVisible(FALSE);
} else {
$modeChoices = array('install', 'update');
$this->attributes[8]->setVisible(TRUE);
}
$this->attributes[4]->setChoices($modeChoices);
}
......@@ -120,6 +127,15 @@ class FAIRepositoryAttribute extends PipeSeparatedCompositeAttribute
parent::setValue($values);
}
function readValues($value)
{
$values = parent::readValues($value);
if (!isset($values[8])) {
$values[8] = '%RELEASE%/%SECTION%/%ARCH%/';
}
return $values;
}
function resetToDefault ()
{
$this->attributes[7]->resetToDefault();
......
......@@ -55,7 +55,7 @@
<td>{eval var=$attributes.mirrorMode.input}</td>
{if isset($attributes.mirrorSections_inner)}
<td rowspan="2" title="{$attributes.mirrorSections_inner.description}">
<td rowspan="3" title="{$attributes.mirrorSections_inner.description}">
<label for="{$attributes.mirrorSections_inner.htmlid}">
{eval var=$attributes.mirrorSections_inner.label}
</label><br/>
......@@ -71,6 +71,16 @@
</td>
<td>{eval var=$attributes.mirrorLocal.input}</td>
</tr>
<tr>
{if isset($attributes.pathMask)}
<td title="{$attributes.pathMask.description}">
<label for="{$attributes.pathMask.htmlid}">
{eval var=$attributes.pathMask.label}
</label>
</td>
<td>{eval var=$attributes.pathMask.input}</td>
{/if}
</tr>
<tr>
<td title="{$attributes.FAIrepository_buttons.description}" colspan="3">
{eval var=$attributes.FAIrepository_buttons.input}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment