Files
cmsPRO/autoload/view/class.Projects.php
2026-02-22 21:59:33 +01:00

84 lines
3.5 KiB
PHP

<?php
namespace view;
class Projects
{
public static function links_external( $project_id, $bs )
{
$count = \factory\Projects::count_links_external( $project_id );
$count = $count[0]['c'];
$ls = ceil( $count / \factory\Projects::$limit );
if ( $bs > $ls )
$bs = $ls;
if ( $bs < 1 )
$bs = 1;
$tpl = new \Tpl;
$tpl -> links_internal_all = \factory\Projects::count_links_internal_all( $project_id );
$tpl -> links_visited = \factory\Projects::links_visited( $project_id );
$tpl -> links_external = \factory\Projects::links_external( $bs, $project_id );
$tpl -> project = \factory\Projects::project_details( $project_id );
$tpl -> link_external_count = $count;
$pager = new \Paging( $ls, $bs, \factory\Projects::$limit, $count, '/projects/links_external/&id='. $project_id . '&' );
$tpl -> pager = $pager -> draw();
return $tpl -> render( 'projects/links-external' );
}
public static function details( $project_id, $bs, $filtr_mke = 0, $filtr_mde = 0, $filtr_mte = 0, $filtr_irb = 0, $filtr_grb = 0, $filtr_url = 0, $filtr_wor = 0, $filtr_wir = 0, $filtr_hid = 0,
$filtr_edf = 0, $filtr_edfrops = 0, $filtr_404 = 0, $filtr_tables = 0, $filtr_iframe = 0, $filtr_h1 = 0, $filtr_images_alt = 0 )
{
$count = \factory\Projects::count_links_internal(
$project_id, $filtr_mke, $filtr_mde, $filtr_mte, $filtr_irb, $filtr_grb, $filtr_url, $filtr_wor, $filtr_wir, $filtr_hid, $filtr_edf, $filtr_edfrops, $filtr_404, $filtr_tables, $filtr_iframe, $filtr_h1,
$filtr_images_alt
);
$count = $count[0]['c'];
$ls = ceil( $count / \factory\Projects::$limit );
if ( $bs > $ls )
$bs = $ls;
if ( $bs < 1 )
$bs = 1;
$tpl = new \Tpl;
$tpl -> project_id = $project_id;
$tpl -> filtr_mke = $filtr_mke;
$tpl -> filtr_mde = $filtr_mde;
$tpl -> filtr_mte = $filtr_mte;
$tpl -> filtr_irb = $filtr_irb;
$tpl -> filtr_grb = $filtr_grb;
$tpl -> filtr_url = $filtr_url;
$tpl -> filtr_wor = $filtr_wor;
$tpl -> filtr_wir = $filtr_wir;
$tpl -> filtr_hid = $filtr_hid;
$tpl -> filtr_edf = $filtr_edf;
$tpl -> filtr_iframe = $filtr_iframe;
$tpl -> filtr_tables = $filtr_tables;
$tpl -> filtr_edfrops = $filtr_edfrops;
$tpl -> filtr_images_alt = $filtr_images_alt;
$tpl -> filtr_h1 = $filtr_h1;
$tpl -> filtr_404 = $filtr_404;
$tpl -> links_interval_count = $count;
$tpl -> project = \factory\Projects::project_details( $project_id );
$tpl -> links_internal_all = \factory\Projects::count_links_internal_all( $project_id );
$tpl -> links_internal = \factory\Projects::links_internal_list(
$bs, $project_id, $filtr_mke, $filtr_mde, $filtr_mte, $filtr_irb, $filtr_grb, $filtr_url, $filtr_wor, $filtr_wir, $filtr_hid, $filtr_edf, $filtr_edfrops, $filtr_404, $filtr_tables, $filtr_iframe, $filtr_h1,
$filtr_images_alt
);
$tpl -> links_visited = \factory\Projects::links_visited( $project_id );
$pager = new \Paging( $ls, $bs, \factory\Projects::$limit, $count, '/projects/details/&id='. $project_id . '&' );
$tpl -> pager = $pager -> draw();
return $tpl -> render( 'projects/details' );
}
public static function view_list()
{
$tpl = new \Tpl;
return $tpl -> render( 'projects/view-list' );
}
}