$key = strtolower(str_replace('.', '_', $key)); $unitAttributes[$key] = $key; } // dd($unitAttributes); $_aTitles = Entity::where("type", "jobconf")->where("format", $_format)->distinct("content.title")->get(); $_aTitles = array_flatten($_aTitles->toArray()); foreach ($_aTitles as $key => $value) { $pos = strpos($value, '[['); if ($pos > 0) { $t = trim(substr($value, 0, $pos)); if (!array_key_exists($t, $aTitles)) { $aTitles[$t] = $t; } } } $_aTypes = Template::distinct('type')->get(); $_aTypes = array_flatten($_aTypes->toArray()); foreach ($_aTypes as $key => $value) { if (!isset($aTypes[$value])) { $aTypes[$value] = $value; } } if ($phpres = Session::get('templatetype')) { if (!isset($aTypes[$phpres])) { $phpres = null; } } if ($phprest = Session::get('title')) { $pos = strpos($phprest, '[['); if ($pos > 0) { $phprest = trim(substr($phprest, 0, $pos));