Advertisement
sathyashrayan

ctrl

Sep 21st, 2011
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.28 KB | None | 0 0
  1.         $threadConditions['conditions'] = array('Aco.parent_id !='=>NULL);     
  2.         $aroAlis = $this->Acl->Aro->Aco->find('threaded',$threadConditions);
  3.         $custmAlis = $this->_threaded_to_list_acos($aroAlis,'Aco'); //same function as a generatetreelist()
  4.        
  5.        
  6.         foreach($custmAlis as $keyPKrec => $keyPKId)
  7.         {
  8.             $rootCtrl = "";
  9.             $parentIDSarray = $this->Acl->Aro->Aco->getpath($keyPKrec);
  10.            
  11.             if(count($parentIDSarray)==2)
  12.             {
  13.                 $rootCtrlFirst = $parentIDSarray[1]['Aco']['alias'];
  14.             }
  15.             else if(count($parentIDSarray)==3 || count($parentIDSarray)==4)
  16.             {
  17.                 $rootCtrl .= $rootCtrlFirst."/".$parentIDSarray[2]['Aco']['alias']."/".$parentIDSarray[3]['Aco']['alias'];
  18.             }
  19.             $exploded = explode("/",$rootCtrl);
  20.            
  21.            
  22.            
  23.             if(count($exploded) == 3)
  24.             {  
  25.                
  26.                
  27.                 if($exploded[2] == 0)
  28.                 {
  29.                     $rootBuild[$keyPKrec] = $exploded[0]."/".$exploded[1];
  30.                 }
  31.                 if($exploded[0] == 'Acl' && ($exploded[1] == 'Acos' ))
  32.                 {              
  33.                     $rootBuild[$keyPKrec] = $exploded[0]."/".$exploded[1]."/".$exploded[2];
  34.                 }
  35.                 if($exploded[0] == 'Acl' && ($exploded[1] == 'Aros' ))
  36.                 {              
  37.                     $rootBuild[$keyPKrec] = $exploded[0]."/".$exploded[1]."/".$exploded[2];
  38.                 }
  39.                
  40.             }
  41.                
  42.         }
  43. $actions = $rootBuild;
  44.  // $actions = $this->AclReflector->get_all_actions();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement