Proyectos de Subversion Moodle

Rev

Rev 1128 | Rev 1130 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1128 Rev 1129
Línea 162... Línea 162...
162
        $course_ids                 = [];
162
        $course_ids                 = [];
163
        $course_category_ids        = [];
163
        $course_category_ids        = [];
164
        $courseAvailableForAutoRol  = [];
164
        $courseAvailableForAutoRol  = [];
Línea 165... Línea -...
165
 
-
 
166
 
-
 
167
        $total_courses = 0;
-
 
168
        $total_pages = ceil($total_courses / $perpage);
-
 
169
        $searchterms = array();
-
 
170
        $sort = "c.sortorder DESC";
165
 
171
        $page = isset($page) ? max(1, min($page, $total_pages)) : 1;
-
 
172
 
-
 
173
        $max_links = 3;
-
 
174
        $start_page = max(1, $page - floor($max_links / 2));
-
 
175
        $end_page = min($total_pages, $start_page + $max_links - 1);
-
 
176
 
-
 
177
        if ($end_page - $start_page + 1 < $max_links) {
-
 
Línea 178... Línea 166...
178
            $start_page = max(1, $end_page - $max_links + 1);
166
 
179
        }
167
     
180
 
168
 
181
        if ($is_admin) {
169
        if ($is_admin) {
Línea 210... Línea 198...
210
            }
198
            }
Línea 211... Línea 199...
211
            
199
            
212
            return true;
200
            return true;
Línea -... Línea 201...
-
 
201
        });
-
 
202
        
-
 
203
        /*
-
 
204
         $searchterms = array();
-
 
205
         $sort = "c.sortorder DESC";
-
 
206
         */
-
 
207
        
-
 
208
        $total_courses = count($mycourses);
-
 
209
        $total_pages = ceil($total_courses / $perpage);
-
 
210
        if($total_pages * $perpage < $total_courses) {
-
 
211
            $total_pages++;
-
 
212
        }
-
 
213
        
-
 
214
        $page = isset($page) ? max(1, min($page, $total_pages)) : 1;
-
 
215
            
-
 
216
        $max_links = 3;
-
 
217
        $start_page = max(1, $page - floor($max_links / 2));
-
 
218
        $end_page = min($total_pages, $start_page + $max_links - 1);
-
 
219
            
-
 
220
        if ($end_page - $start_page + 1 < $max_links) {
-
 
221
            $start_page = max(1, $end_page - $max_links + 1);
-
 
222
        }
-
 
223
        
-
 
224
        
Línea 213... Línea 225...
213
        });
225
        $start  = $page == 1 ? 0 : ($page - 1) * $perpage;
214
        
226
        $mycourses = array_slice($mycourses, $start, $perpage);