protected static function looper($id, $flowid) { $trees = array(); $child = Step::where('parentid', '=', $id)->where('flowid', '=', $flowid)->get(); foreach ($child as $cvalue) { if (!empty($cvalue)) { $trees[$cvalue->stepid]['desc'] = $cvalue->step; $trees[$cvalue->stepid]['child'] = self::looper($cvalue->stepid, $flowid); } } return $trees; }
public static function listSteppages($current = NULL) { $pagelist = Page::all(); $arrayPages['data'] = array('Sila Pilih'); foreach ($pagelist as $value) { $regnav = Step::where('page', '=', $value->modulpageid)->first(); if (isset($value->action) && $value->actionalias != '' && $value->visible == 1 && (empty($regnav) or !empty($regnav) && $current != NULL ? $regnav->stepid == $current : empty($regnav))) { $arrayPages['data'][$value->modulpageid] = $value->actionalias; if (!empty($regnav) && $regnav->stepid == $current) { $arrayPages['selected'] = $regnav->page; } } } return $arrayPages; }
public function post_deletestep() { $input = Input::get(); Log::write('User', 'Delete Step ID ' . Step::find($input['id'])->step . ' by ' . Auth::user()->username); Step::find($input['id'])->delete(); Step::where('parentid', '=', $input['id'])->delete(); return Menu::flowtree($input['flowid']); }