Code Duplication    Length = 36-36 lines in 2 locations

public-album.php 1 location

@@ 62-97 (lines=36) @@
59
 *
60
 * @return array|string
61
 */
62
function convertorderbytrans($SortbyOrderby)
63
{
64
    $orderbyTrans = [];
65
    if ($SortbyOrderby === 'photo_date DESC') {
66
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_DATEASC;
67
    }
68
    if ($SortbyOrderby === 'photo_date ASC') {
69
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_DATEDESC;
70
    }
71
    if ($SortbyOrderby === 'photo_title ASC') {
72
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_TITREASC;
73
    }
74
    if ($SortbyOrderby === 'photo_title DESC') {
75
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_TITREDESC;
76
    }
77
    if ($SortbyOrderby === 'uid ASC') {
78
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_DESIGNERASC;
79
    }
80
    if ($SortbyOrderby === 'uid DESC') {
81
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_DESIGNERDESC;
82
    }
83
    if ($SortbyOrderby === 'photo_hits DESC') {
84
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_HITSASC;
85
    }
86
    if ($SortbyOrderby === 'photo_hits ASC') {
87
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_HITSDESC;
88
    }
89
    if ($SortbyOrderby === 'photo_rating DESC') {
90
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_NOTEASC;
91
    }
92
    if ($SortbyOrderby === 'photo_rating ASC') {
93
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_NOTEDESC;
94
    }
95
96
    return $orderbyTrans;
97
}
98
99
// Check the access permission
100
$permHandler = ExtgalleryPublicPermHandler::getInstance();

public-useralbum.php 1 location

@@ 65-100 (lines=36) @@
62
 *
63
 * @return array|string
64
 */
65
function convertorderbytrans($SortbyOrderby)
66
{
67
    $orderbyTrans = [];
68
    if ($SortbyOrderby === 'photo_date DESC') {
69
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_DATEASC;
70
    }
71
    if ($SortbyOrderby === 'photo_date ASC') {
72
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_DATEDESC;
73
    }
74
    if ($SortbyOrderby === 'photo_title ASC') {
75
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_TITREASC;
76
    }
77
    if ($SortbyOrderby === 'photo_title DESC') {
78
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_TITREDESC;
79
    }
80
    if ($SortbyOrderby === 'uid ASC') {
81
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_DESIGNERASC;
82
    }
83
    if ($SortbyOrderby === 'uid DESC') {
84
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_DESIGNERDESC;
85
    }
86
    if ($SortbyOrderby === 'photo_hits DESC') {
87
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_HITSASC;
88
    }
89
    if ($SortbyOrderby === 'photo_hits ASC') {
90
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_HITSDESC;
91
    }
92
    if ($SortbyOrderby === 'photo_rating DESC') {
93
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_NOTEASC;
94
    }
95
    if ($SortbyOrderby === 'photo_rating ASC') {
96
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_NOTEDESC;
97
    }
98
99
    return $orderbyTrans;
100
}
101
102
/** @var ExtgalleryPublicPhotoHandler $photoHandler */
103
$photoHandler = xoops_getModuleHandler('publicphoto', 'extgallery');