207 lines
6.0 KiB
PHP
207 lines
6.0 KiB
PHP
<?php
|
|
namespace controls;
|
|
|
|
class Projects
|
|
{
|
|
public static function clear_project()
|
|
{
|
|
if ( \factory\Projects::clear_project( \S::get( 'id' ) ) )
|
|
\S::alert( 'Linki zostały usunięte z projektu.' );
|
|
header( 'Location: /projects/view_list/' );
|
|
exit;
|
|
}
|
|
|
|
public static function refresh()
|
|
{
|
|
if ( \factory\Projects::refresh( \S::get( 'id' ) ) )
|
|
\S::alert( 'Projekt został wysłany do ponownego sprawdzenia.' );
|
|
header( 'Location: /projects/view_list/' );
|
|
exit;
|
|
}
|
|
|
|
public static function delete()
|
|
{
|
|
if ( \factory\Projects::delete_project( \S::get( 'gdelete' ) ) )
|
|
echo json_encode( array( 'status' => 'ok', 'msg' => 'Projekt został usunięty.' ) );
|
|
else
|
|
echo json_encode( array( 'status' => 'ok', 'msg' => 'Podczas usuwania projektu wystąpił błąd. Proszę spróbować ponownie.' ) );
|
|
exit;
|
|
}
|
|
|
|
public static function hide_url()
|
|
{
|
|
if ( \factory\Projects::hide_url( \S::get( 'id' ) ) )
|
|
\S::alert( 'Linki zostały ukryte.' );
|
|
header( 'Location: /projects/details/&id=' . \S::get( 'project_id' ) );
|
|
exit;
|
|
}
|
|
|
|
public static function view_list()
|
|
{
|
|
return \view\Projects::view_list();
|
|
}
|
|
|
|
public static function links_external()
|
|
{
|
|
if ( $_GET['bs'] != '' )
|
|
{
|
|
\S::set_session( 'project-bs', $_GET['bs'] );
|
|
header( 'Location: /projects/links_external/&id=' . \S::get( 'id' ) );
|
|
exit;
|
|
}
|
|
|
|
return \view\Projects::links_external( \S::get( 'id' ), \S::get_session( 'project-bs' ) );
|
|
}
|
|
|
|
public static function details()
|
|
{
|
|
if ( $_GET['mke'] != '' )
|
|
{
|
|
\S::set_session( 'project-filtr-mke', $_GET['mke'] );
|
|
header( 'Location: /projects/details/&id=' . \S::get( 'id' ) );
|
|
exit;
|
|
}
|
|
|
|
if ( $_GET['mde'] != '' )
|
|
{
|
|
\S::set_session( 'project-filtr-mde', $_GET['mde'] );
|
|
header( 'Location: /projects/details/&id=' . \S::get( 'id' ) );
|
|
exit;
|
|
}
|
|
|
|
if ( $_GET['mte'] != '' )
|
|
{
|
|
\S::set_session( 'project-filtr-mte', $_GET['mte'] );
|
|
header( 'Location: /projects/details/&id=' . \S::get( 'id' ) );
|
|
exit;
|
|
}
|
|
|
|
if ( $_GET['irb'] != '' )
|
|
{
|
|
\S::set_session( 'project-filtr-irb', $_GET['irb'] );
|
|
header( 'Location: /projects/details/&id=' . \S::get( 'id' ) );
|
|
exit;
|
|
}
|
|
|
|
if ( $_GET['grb'] != '' )
|
|
{
|
|
\S::set_session( 'project-filtr-grb', $_GET['grb'] );
|
|
header( 'Location: /projects/details/&id=' . \S::get( 'id' ) );
|
|
exit;
|
|
}
|
|
|
|
if ( $_GET['wor'] != '' )
|
|
{
|
|
\S::set_session( 'project-filtr-wor', $_GET['wor'] );
|
|
header( 'Location: /projects/details/&id=' . \S::get( 'id' ) );
|
|
exit;
|
|
}
|
|
|
|
if ( $_GET['wir'] != '' )
|
|
{
|
|
\S::set_session( 'project-filtr-wir', $_GET['wir'] );
|
|
header( 'Location: /projects/details/&id=' . \S::get( 'id' ) );
|
|
exit;
|
|
}
|
|
|
|
if ( $_GET['hid'] != '' )
|
|
{
|
|
\S::set_session( 'project-filtr-hid', $_GET['hid'] );
|
|
header( 'Location: /projects/details/&id=' . \S::get( 'id' ) );
|
|
exit;
|
|
}
|
|
|
|
if ( $_GET['edf'] != '' )
|
|
{
|
|
\S::set_session( 'project-filtr-edf', $_GET['edf'] );
|
|
header( 'Location: /projects/details/&id=' . \S::get( 'id' ) );
|
|
exit;
|
|
}
|
|
|
|
if ( \S::get( 'filtr_edfrops' ) != '' )
|
|
{
|
|
\S::set_session( 'project-filtr-edfrops', $_GET['filtr_edfrops'] );
|
|
header( 'Location: /projects/details/&id=' . \S::get( 'id' ) );
|
|
exit;
|
|
}
|
|
|
|
if ( $_POST['url'] != '' )
|
|
{
|
|
\S::set_session( 'project-filtr-url', $_POST['url'] );
|
|
header( 'Location: /projects/details/&id=' . \S::get( 'id' ) );
|
|
exit;
|
|
}
|
|
|
|
if ( $_GET['bs'] != '' )
|
|
{
|
|
\S::set_session( 'project-bs', $_GET['bs'] );
|
|
header( 'Location: /projects/details/&id=' . \S::get( 'id' ) );
|
|
exit;
|
|
}
|
|
|
|
if ( $_GET['f404'] != '' )
|
|
{
|
|
\S::set_session( 'project-filtr-f404', $_GET['f404'] );
|
|
header( 'Location: /projects/details/&id=' . \S::get( 'id' ) );
|
|
exit;
|
|
}
|
|
|
|
if ( $_GET['filtr_tables'] != '' )
|
|
{
|
|
\S::set_session( 'project-filtr-tables', $_GET['filtr_tables'] );
|
|
header( 'Location: /projects/details/&id=' . \S::get( 'id' ) );
|
|
exit;
|
|
}
|
|
|
|
if ( $_GET['filtr_iframe'] != '' )
|
|
{
|
|
\S::set_session( 'project-filtr-iframe', $_GET['filtr_iframe'] );
|
|
header( 'Location: /projects/details/&id=' . \S::get( 'id' ) );
|
|
exit;
|
|
}
|
|
|
|
if ( $_GET['filtr_h1'] != '' )
|
|
{
|
|
\S::set_session( 'project-filtr-h1', $_GET['filtr_h1'] );
|
|
header( 'Location: /projects/details/&id=' . \S::get( 'id' ) );
|
|
exit;
|
|
}
|
|
|
|
if ( $_GET['filtr_images_alt'] != '' )
|
|
{
|
|
\S::set_session( 'project-filtr-images-alt', $_GET['filtr_images_alt'] );
|
|
header( 'Location: /projects/details/&id=' . \S::get( 'id' ) );
|
|
exit;
|
|
}
|
|
|
|
if ( $_GET['furl'] == 'clear' )
|
|
{
|
|
\S::delete_session( 'project-filtr-url' );
|
|
header( 'Location: /projects/details/&id=' . \S::get( 'id' ) );
|
|
exit;
|
|
}
|
|
|
|
|
|
return \view\Projects::details(
|
|
\S::get( 'id' ),
|
|
\S::get_session( 'project-bs' ),
|
|
\S::get_session( 'project-filtr-mke' ),
|
|
\S::get_session( 'project-filtr-mde' ),
|
|
\S::get_session( 'project-filtr-mte' ),
|
|
\S::get_session( 'project-filtr-irb' ),
|
|
\S::get_session( 'project-filtr-grb' ),
|
|
\S::get_session( 'project-filtr-url' ),
|
|
\S::get_session( 'project-filtr-wor' ),
|
|
\S::get_session( 'project-filtr-wir' ),
|
|
\S::get_session( 'project-filtr-hid' ),
|
|
\S::get_session( 'project-filtr-edf' ),
|
|
\S::get_session( 'project-filtr-edfrops' ),
|
|
\S::get_session( 'project-filtr-f404' ),
|
|
\S::get_session( 'project-filtr-tables' ),
|
|
\S::get_session( 'project-filtr-iframe' ),
|
|
\S::get_session( 'project-filtr-h1' ),
|
|
\S::get_session( 'project-filtr-images-alt' )
|
|
);
|
|
}
|
|
}
|