Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 1585 | Revision 1588 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 1585 Revision 1587
Zeile 266... Zeile 266...
266
            return $pos;
266
            return $pos;
267
        }
267
        }
Zeile 268... Zeile 268...
268
 
268
 
269
        private function getPath_new( $root, $return_locked_folders = false ): array
269
        private function getPath_new( $root, $return_locked_folders = false ): array
270
        {
-
 
271
            $conn = $GLOBALS["shopDB"];
-
 
272
            if ( isset( $GLOBALS["remoteDB"] ) && is_object( $GLOBALS["remoteDB"] ) )
-
 
273
            {
-
 
274
                $conn = $GLOBALS["remoteDB"];
-
 
275
            }
-
 
276
            $ini = array();
-
 
277
            if ( !isset( $_SESSION["INI"] ) || !is_array( $_SESSION["INI"] ) )
-
 
278
            {
-
 
279
                if ( isset( $GLOBALS["INI"] ) )
-
 
280
                {
270
        {
281
                    $ini = $GLOBALS["INI"];
-
 
282
                }
-
 
283
            }
-
 
284
            else
-
 
285
            {
-
 
286
                $ini = $_SESSION["INI"];
-
 
287
            }
271
            $ini = $GLOBALS["INI"];
288
            $treeRoot = -1;
272
            $treeRoot = -1;
289
            if ( $ini["treeRoot"] )
273
            if ( $ini["treeRoot"] )
290
            {
274
            {
291
                $treeRoot = $ini["treeRoot"];
275
                $treeRoot = $ini["treeRoot"];
Zeile 292... Zeile 276...
292
            }
276
            }
293
 
277
 
294
            $path = array();
278
            $path = array();
295
            $father = $root;
279
            $father = $root;
296
            while ( $father != -1 && !is_null( $father ) )
-
 
297
            {
-
 
298
                $sql = "
-
 
299
                SELECT
-
 
300
                    *
-
 
301
                FROM
-
 
302
                    directory
-
 
303
                WHERE
-
 
304
                    ID=" . $father . "
-
 
305
                AND
-
 
306
                    language='" . $ini["language"] . "'
-
 
307
            ";
-
 
308
                $status_sql = "
-
 
309
                AND
-
 
310
                    status IN (0,2)
280
            while ( $father != -1 && !is_null( $father ) )
311
            ";
-
 
312
                if ( $return_locked_folders === false )
-
 
313
                {
-
 
314
                    $sql .= $status_sql;
-
 
315
                }
-
 
316
                $res = $conn->query( $sql );
-
 
317
                if ( !$res )
-
 
318
                {
-
 
319
                    return array();
-
 
320
                }
-
 
321
                $row = $res->fetch_assoc();
-
 
322
                if ( !is_array( $row ) )
-
 
323
                {
-
 
324
                    return array();
281
            {
325
                }
-
 
326
                $father = $row["Father"];
-
 
327
                foreach ( array(
-
 
328
                    "",
-
 
329
                    "2",
-
 
330
                    "3",
-
 
331
                ) as $i )
-
 
332
                {
-
 
333
                    if ( $row["bild_url" . $i] )
-
 
334
                    {
-
 
335
                        $row["bild_url" . $i . "_beurer"] = $ini['itemContainerKorrektur']["imagePath" . $i] . $row["bild_url" . $i];
-
 
336
                        $row["bild_url" . $i] = "<img src=" . $ini['itemContainerKorrektur']["imagePath" . $i] . $row["bild_url" . $i] . " >";
-
 
337
                    }
-
 
338
                    else
-
 
339
                    {
-
 
340
                        $row["bild_url" . $i] = "";
-
 
341
                    }
282
                $row = Directory::where("id",$father)->whereIn("status",[0,2])->firstOrFail();
342
                }
283
                $father = $row->directory_id;
343
                $path[] = $row;
284
                $path[] = $row;
344
            }
285
            }
345
            $path = array_reverse( $path );
286
            $path = $path->reverse();
346
            if ( $path[0]["Father"] != $treeRoot )
287
            if ( $path[0]->directory_id != $treeRoot )
347
            {
288
            {
348
                unset( $path[0] );
-
 
349
            }
-
 
350
            if ( !is_array( $path ) )
-
 
351
            {
-
 
352
                $path = array();
289
                unset( $path[0] );
353
            }
290
            }
Zeile 354... Zeile 291...
354
            return $path;
291
            return $path;