Exemplo n.º 1
0
 /**
  * @param string $json_column_array
  * @param string $json_argument_array
  * @param string $get_array
  * @param string $css_page_id
  * @param string $css_row_sort_id
  * @param string $entries_per_page
  * @param string $page
  * @param string $sortvalue
  * @param string $sortmethod
  * @return string
  * @throws BaseUserAccessDeniedException
  */
 public static function list_registry($json_column_array, $json_argument_array, $get_array, $css_page_id, $css_row_sort_id, $entries_per_page, $page, $sortvalue, $sortmethod)
 {
     global $user;
     if ($user->is_admin()) {
         if ($get_array) {
             $_GET = unserialize($get_array);
         }
         $list_request = new ListRequest_IO();
         $list_request->set_column_array($json_column_array);
         if (!is_numeric($entries_per_page) or $entries_per_page < 1) {
             $entries_per_page = 20;
         }
         $list_array = System_Wrapper::list_base_registry($sortvalue, $sortmethod, $page * $entries_per_page - $entries_per_page, $page * $entries_per_page);
         if (is_array($list_array) and count($list_array) >= 1) {
             foreach ($list_array as $key => $value) {
                 $list_array[$key]['icon'] = "<img src='images/icons/registry.png' alt='' style='border: 0;' />";
                 $list_array[$key]['edit'] = "<a href='#'><img src='images/icons/edit.png' alt='E' style='border: 0;' /></a>";
             }
         } else {
             $list_request->empty_message("<span class='italic'>No results found!</span>");
         }
         $list_request->set_array($list_array);
         return $list_request->get_page($page);
     } else {
         throw new BaseUserAccessDeniedException();
     }
 }