mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
Add Orderable to subdef Controller
This commit is contained in:
@@ -80,6 +80,7 @@ class SubdefsController extends Controller
|
||||
|
||||
$class = $request->request->get($post_sub . '_class');
|
||||
$downloadable = $request->request->get($post_sub . '_downloadable');
|
||||
$orderable = $request->request->get($post_sub . '_orderable');
|
||||
|
||||
$defaults = ['path', 'meta', 'mediatype'];
|
||||
|
||||
@@ -107,7 +108,7 @@ class SubdefsController extends Controller
|
||||
|
||||
$labels = $request->request->get($post_sub . '_label', []);
|
||||
|
||||
$subdefs->set_subdef($group, $name, $class, $downloadable, $options, $labels);
|
||||
$subdefs->set_subdef($group, $name, $class, $downloadable, $options, $labels, $orderable);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -223,10 +223,11 @@ class databox_subdefsStructure implements IteratorAggregate, Countable
|
||||
* @param boolean $downloadable
|
||||
* @param array $options
|
||||
* @param array $labels
|
||||
* @param bool $orderable
|
||||
* @return databox_subdefsStructure
|
||||
* @throws Exception
|
||||
*/
|
||||
public function set_subdef($group, $name, $class, $downloadable, $options, $labels)
|
||||
public function set_subdef($group, $name, $class, $downloadable, $options, $labels, $orderable = true)
|
||||
{
|
||||
$dom_struct = $this->databox->get_dom_structure();
|
||||
|
||||
@@ -234,6 +235,7 @@ class databox_subdefsStructure implements IteratorAggregate, Countable
|
||||
$subdef->setAttribute('class', $class);
|
||||
$subdef->setAttribute('name', mb_strtolower($name));
|
||||
$subdef->setAttribute('downloadable', ($downloadable ? 'true' : 'false'));
|
||||
$subdef->setAttribute('orderable', ($orderable ? 'true' : 'false'));
|
||||
|
||||
foreach ($labels as $code => $label) {
|
||||
$child = $dom_struct->createElement('label');
|
||||
|
@@ -230,6 +230,11 @@
|
||||
<td><input type="checkbox" name="{{subdefgroup}}_{{subdefname}}_downloadable" {% if subdef.isDownloadable() %}checked="checked"{% endif %} value="1" /></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ 'subdef.orderable' | trans }}</td>
|
||||
<td><input type="checkbox" name="{{subdefgroup}}_{{subdefname}}_orderable" {% if subdef.isOrderable() %}checked="checked"{% endif %} value="1" /></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{{ 'classe' | trans }}
|
||||
|
Reference in New Issue
Block a user