Dodanie obsługi dodatkowych danych producenta oraz informacji o bezpieczeństwie w klasach ShopProducer i ShopProduct

This commit is contained in:
2026-01-04 21:22:28 +01:00
parent f955fdbd54
commit 56fab94f47
10 changed files with 158 additions and 104 deletions

View File

@@ -9,11 +9,11 @@ class Languages
global $mdb;
return $mdb -> delete( 'pp_langs_translations', [ 'id' => $translation_id ] );
}
public static function translation_save( $translation_id, $text, $languages )
{
global $mdb;
if ( $translation_id )
{
$mdb -> update( 'pp_langs_translations', [ 'text' => $text ], [ 'id' => $translation_id ] );
@@ -38,13 +38,13 @@ class Languages
return $translation_id;
}
}
public static function translation_details( $translation_id )
{
global $mdb;
return $mdb -> get( 'pp_langs_translations', '*', [ 'id' => $translation_id ] );
}
public static function language_delete( $language_id )
{
global $mdb;
@@ -127,10 +127,15 @@ class Languages
return $mdb -> get( 'pp_langs', '*', [ 'id' => $language_id ] );
}
public static function languages_list()
public static function languages_list( $only_active = false )
{
global $mdb;
return $mdb -> select( 'pp_langs', '*', [ 'ORDER' => [ 'o' => 'ASC' ] ] );
$where = [];
if ( $only_active )
$where['status'] = 1;
return $mdb -> select( 'pp_langs', '*', array_merge( [ 'ORDER' => [ 'o' => 'ASC' ] ], $where ) );
}
}
?>