Beispiel #1
0
 /**
  * AJAX, Lists paginated rights
  */
 public function executeList(sfWebRequest $request)
 {
     $params = $this->getUser()->getAttribute('permission', array(), 'person');
     $max_array = array(5, 10, 30, 50, 70, 100);
     if (in_array($request->getParameter('max'), $max_array)) {
         $max = $request->getParameter('max');
     } else {
         if (isset($params['max'])) {
             $max = $params['max'];
         } else {
             $max = sfConfig::get('app_max_permission_per_page', 50);
         }
     }
     $this->page = $page = $request->getParameter('page', 1);
     $this->max_array = array_combine($max_array, $max_array);
     $this->max = $params['max'] = $max;
     $this->pager = PermissionPeer::getPager($max, $page);
     $this->permission_list = $this->pager->getResults();
     $this->getUser()->setAttribute('permission', $params, 'person');
 }