Ejemplo n.º 1
0
 public static function navigationdata()
 {
     $testlist = array();
     $returndata = array();
     $navheader = Console_Header::order_by('step', 'asc')->get();
     foreach ($navheader as $key => $value) {
         $returndata[$key]['header'] = $value->navheader;
         $returndata[$key]['moduleid'] = $value->navheaderid;
         $testlist = Console_Header::find($value->navheaderid)->navpages()->order_by('parentstep', 'asc')->get();
         foreach ($testlist as $ckey => $cvalue) {
             $parent = Console_Page::find($cvalue->modulpageid);
             if (!empty($parent) && $cvalue->parentid == NULL) {
                 $returndata[$key]['parent'][$ckey]['alias'] = $parent->actionalias;
                 $returndata[$key]['parent'][$ckey]['pageid'] = $cvalue->navpageid;
                 $returndata[$key]['parent'][$ckey]['path'] = $parent->modul . '/' . $parent->controller . '/' . $parent->action;
                 $child = Console_Link::where('parentid', '=', $cvalue->navpageid)->get();
                 if (!empty($child)) {
                     foreach ($child as $childkey => $childvalue) {
                         $childpage = Console_Page::find($childvalue->modulpageid);
                         $returndata[$key]['parent'][$ckey]['child'][$childkey]['alias'] = $childpage->actionalias;
                         $returndata[$key]['parent'][$ckey]['child'][$childkey]['childid'] = $childvalue->navpageid;
                         $returndata[$key]['parent'][$ckey]['child'][$childkey]['path'] = $childpage->controller . '/' . $childpage->action;
                     }
                 }
             }
         }
     }
     return $returndata;
 }
Ejemplo n.º 2
0
 /**
  * sidebar function
  * Create sidebar
  * @return string
  * @author joharijumali
  **/
 public static function next()
 {
     $path = URI::segment(2) . '/' . URI::segment(3) . '/' . URI::segment(4);
     $page = Console_Page::where('modul', '=', URI::segment(2))->where('controller', '=', URI::segment(3))->where('action', '=', URI::segment(4))->first();
     if ($page) {
         try {
             $currentStep = Console_Step::where('page', '=', $page->modulpageid)->first();
             if (!empty($currentStep)) {
                 if ($currentStep->parentid == 0) {
                     return $currentStep->stepid;
                 } else {
                     $nextStep = Console_Step::where('flowid', '=', $currentStep->flowid)->where('parentid', '=', $currentStep->stepid)->first();
                     if ($nextStep) {
                         return $nextStep->stepid;
                     }
                 }
             }
         } catch (Exception $e) {
             Log::write('Flow', 'Status Retrieving Failed: ' . $e->getMessage());
         }
     } else {
         Log::write('Flow', 'Page Not Exist: ');
     }
 }