Commit f11607a5 authored by Sigrid Suski's avatar Sigrid Suski

Extended ordering without position implemented

parent d3dae87c
...@@ -223,6 +223,8 @@ class SPTemplateCtrl extends SPConfigAdmCtrl ...@@ -223,6 +223,8 @@ class SPTemplateCtrl extends SPConfigAdmCtrl
} }
$view->setCtrl( $this ); $view->setCtrl( $this );
$entriesOrdering = $view->namesFields( null, true ); $entriesOrdering = $view->namesFields( null, true );
$params = [ 'position.asc', 'position.desc' ];
$entriesOrderingPlain = $view->namesFields( $params, true );
$entriesFields = $view->entryFields( true ); $entriesFields = $view->entryFields( true );
$categoryFields = $view->categoryFields( true ); $categoryFields = $view->categoryFields( true );
$sid = Sobi::Section(); $sid = Sobi::Section();
...@@ -231,6 +233,7 @@ class SPTemplateCtrl extends SPConfigAdmCtrl ...@@ -231,6 +233,7 @@ class SPTemplateCtrl extends SPConfigAdmCtrl
->assign( $sid, 'sid' ) ->assign( $sid, 'sid' )
->assign( $templateSettings, 'settings' ) ->assign( $templateSettings, 'settings' )
->assign( $entriesOrdering, 'entriesOrdering' ) ->assign( $entriesOrdering, 'entriesOrdering' )
->assign( $entriesOrderingPlain, 'entriesOrderingPlain' )
->assign( $entriesFields, 'entriesFields' ) ->assign( $entriesFields, 'entriesFields' )
->assign( $categoryFields, 'categoryFields' ) ->assign( $categoryFields, 'categoryFields' )
->assign( $plugins, 'apps' ) ->assign( $plugins, 'apps' )
......
...@@ -272,6 +272,7 @@ class SPConfigAdmView extends SPAdmView implements SPView ...@@ -272,6 +272,7 @@ class SPConfigAdmView extends SPAdmView implements SPView
* @param bool $ordering * @param bool $ordering
* *
* @return array * @return array
* @throws \Sobi\Error\Exception
*/ */
public function namesFields( $params = null, $ordering = false ) public function namesFields( $params = null, $ordering = false )
{ {
...@@ -311,23 +312,29 @@ class SPConfigAdmView extends SPAdmView implements SPView ...@@ -311,23 +312,29 @@ class SPConfigAdmView extends SPAdmView implements SPView
Sobi::Txt( 'SEC.CFG.ENTRY_ORDER_BY_FIELDS' ) => $fData, Sobi::Txt( 'SEC.CFG.ENTRY_ORDER_BY_FIELDS' ) => $fData,
]; ];
} }
if ( $params ) { // params will not be used for a long time
$p = [ 'select', $params[ 1 ], $fData, $params[ 2 ], false ]; // 11.2.19: reactivated with different meaning
if ( isset( $params[ 3 ] ) ) { if ( $params && is_array( $params ) ) {
$p[] = $params[ 3 ]; foreach ( $params as $param ) {
} unset ( $fData[ $param ] );
if ( isset( $params[ 4 ] ) ) {
$p[] = $params[ 4 ];
}
if ( isset( $params[ 5 ] ) ) {
$p[] = $params[ 5 ];
} }
// $p = [ 'select', $params[ 1 ], $fData, $params[ 2 ], false ];
return $p; // if ( isset( $params[ 3 ] ) ) {
} // $p[] = $params[ 3 ];
else { // }
return $fData; // if ( isset( $params[ 4 ] ) ) {
// $p[] = $params[ 4 ];
// }
// if ( isset( $params[ 5 ] ) ) {
// $p[] = $params[ 5 ];
// }
//
// return $p;
} }
// else {
return $fData;
// }
} }
/** /**
......
...@@ -690,7 +690,7 @@ ...@@ -690,7 +690,7 @@
</values> </values>
</field> </field>
<field type="select" label="TP.CONFIG.LST_ORDERING" name="settings[config][collection][entries_ordering]" <field type="select" label="TP.CONFIG.LST_ORDERING" name="settings[config][collection][entries_ordering]"
values="entriesOrdering" selected="settings.config.collection.entries_ordering" values="entriesOrderingPlain" selected="settings.config.collection.entries_ordering"
class="input-large"/> <!-- SobiPro setting! --> class="input-large"/> <!-- SobiPro setting! -->
<field type="toggle" name="settings[config][collection][comparison]" value="settings.config.collection.comparison" <field type="toggle" name="settings[config][collection][comparison]" value="settings.config.collection.comparison"
label="TP.CONFIG.APPCOL_COMP" prefix="yes_no"/> label="TP.CONFIG.APPCOL_COMP" prefix="yes_no"/>
......
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