Revision 564 | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed
<?phpnamespace App\Http\Controllers\online_shop;use App\Http\Controllers\Controller;use App\Models\Item;use Illuminate\Contracts\Foundation\Application;use Illuminate\Contracts\View\Factory;use Illuminate\Contracts\View\View;use Illuminate\Http\Request;class ItemController extends Controller{//public function __construct(){$gesperrte_felder = array();if ( $GLOBALS["web_rechte"]["online_shop"]["artikel"]["klonen_gesperrte_felder"] ){$gesperrte_felder = explode( ";", strtolower( $GLOBALS["web_rechte"]["online_shop"]["artikel"]["klonen_gesperrte_felder"] ) );}$preise = explode( ";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["preise"] );$cfg = array();foreach ( $preise as $id => $preis ){{//list( $name, $config ) = explode( ",", $preis,2 );$tmp = explode( ",", $preis );$name = $tmp[0];$config = array();unset( $tmp[0] );foreach ( $tmp as $str ){list( $key, $value ) = explode( "=", $str );if ( $value === null ){$value = 1;}$config[$key] = $value;}$cfg[$id + 1] = $config;$preise[$id + 1] = $name;}}$preis_anz = count( $preise );\View::share( "preise", $preise );\View::share( "config", $cfg );\View::share( "preis_anz", $preis_anz );\View::share( "gesperrte_felder", $gesperrte_felder );}public function edit( Item $item ): Factory|View|Application{$item->load( "medium.medium", "manufacturer", "price" );return view( "online_shop.item_edit", ["item" => $item,] );}}