'mysql', 'database_name' => $database['name'], 'server' => $database['host'], 'username' => $database['user'], 'password' => $database['password'], 'charset' => 'utf8' ] ); if ( !$lang_id = \S::get_session( 'current-lang' ) ) { $lang_id = \front\factory\Languages::default_language(); \S::set_session( 'current-lang', $lang_id ); } if ( !$lang = \S::get_session( 'lang' ) ) { $lang = \front\factory\Languages::lang_translations(); \S::set_session( 'lang', $lang ); } \front\controls\Site::check_url_params(); if ( !$settings = \S::get_session( 'settings' ) ) { $settings = \front\factory\Settings::settings_details(); \S::set_session( 'settings', $settings ); } if ( \S::get( 'a' ) == 'calendar' ) { echo \front\view\Site::calendar( \S::get( 'month' ), \S::get( 'year' ), true ); exit; } if ( \S::get( 'a' ) == 'widget-phone-now' ) { $response = [ 'status' => 'error' ]; if ( \S::get( 'phone' ) ) { if ( \S::send_email( $settings['contact_email'], 'Prośba o oddzwonienie', '
Nr telefonu: ' . \S::get( 'phone' ) . '
', $settings['contact_email'] ) ) $response = [ 'status' => 'ok' ]; } echo json_encode( $response ); exit; } if ( \S::get( 'a' ) == 'contact_form' ) { $response = [ 'status' => 'error' ]; if ( \S::get( 'email' ) ) { if ( \S::send_email( $settings['contact_email'], \S::get( 'subject' ), 'Nr telefonu: ' . \S::get( 'phone' ) . '
' . 'Email: ' . \S::get( 'email' ) . '
' . '' . \S::get( 'text' ) . '
', \S::get( 'email' ) ) ) { $mdb -> insert( 'pp_contact_emails', [ 'email' => \S::get( 'email' ), 'phone' => \S::get('phone' ), 'title' => \S::get( 'subject' ), 'mail' => \S::get( 'text' ), 'add_date' => date("Y-m-d, H:i") ]); $response = [ 'status' => 'ok' ]; } } echo json_encode( $response ); exit; } if ( \S::get( 'a' ) == 'cookie_close' ) { setcookie( "cookie_information", "true", mktime( 0, 0, 0, 12, 31, 2115 ) ); exit; } if ( \S::get( 'a' ) == 'banner_close' ) { \S::set_session( 'banner_close', true ); exit; } if ( \S::get( 'a' ) == 'contrast' ) { \S::set_session( 'contrast', !\S::get_session( 'contrast' ) ); exit; } if ( \S::get( 'a' ) == 'article_unlock' ) { \front\controls\Articles::article_unlock( \S::get( 'password' ), \S::get( 'article_id' ) ); exit; } if ( \S::get( 'a' ) == 'pixieset_gallery_download' ) { $url = \front\controls\Articles::images_download( \S::get( 'hash' ) ); echo json_encode( [ 'url' => $url ] ); exit; } if ( \S::get( 'a' ) == 'pixieset_image_favorite' ) { $status = \front\controls\Articles::pixieset_image_favorite( \S::get( 'image_id' ), \S::get( 'hash' ) ); echo json_encode( [ 'status' => $status ] ); exit; } if ( \S::get( 'a' ) == 'pixieset_save_favorite_images' ) { $result = \front\controls\Articles::pixieset_save_favorite_images( \S::get( 'hash' ) ); echo json_encode( [ 'status' => $result ] ); exit; } if ( \S::get( 'a' ) == 'inline-edit-save' ) { if ( strpos( \S::get( 'element_id' ), 'scontainer' ) !== false ) { $scontainer_id = str_replace( [ 'scontainer-', '-content' ], [ '', '' ], \S::get( 'element_id' ) ); \Scontainer::updateByFrontEditor( $scontainer_id, \S::get( 'element_value' ), \S::get( 'lang_id' ) ); \S::delete_cache(); exit; } else { if ( \S::get( 'alltemplates' ) ) $layouts = $mdb -> select( 'pp_layouts', 'id' ); else $layouts[] = \S::get( 'layout_id' ); foreach ( $layouts as $layout_id ) { $layout = \front\factory\Layouts::layout_details( $layout_id ); $html = $layout['html']; if ( strpos( $html, '[META_INDEX]' ) !== false ) { $meta_index = true; $html = str_replace( '[META_INDEX]', '', $html ); } if ( strpos( $html, '[CSS]' ) !== false ) { $css = true; $html = str_replace( '[CSS]', '', $html ); } if ( strpos( $html, '[JAVA_SCRIPT]' ) !== false ) { $java_script = true; $html = str_replace( '[JAVA_SCRIPT]', '', $html ); } $html = preg_replace( '/^[ \t]*[\r\n]+/m', '', $html ); \S::suSetHtmlById( $html, \S::get( 'element_id' ), \S::get( 'element_value' ) ); if ( $meta_index ) $html = str_replace( '', ' [META_INDEX]' . PHP_EOL . '', $html ); if ( $css ) $html = str_replace( '', ' [CSS]' . PHP_EOL . '', $html ); if ( $java_script ) $html = str_replace( '', ' [JAVA_SCRIPT]' . PHP_EOL . '', $html ); $html = str_replace( [ '%5B', '%5D', '%20', '%24' ], [ '[', ']', ' ', '$' ], $html ); $mdb -> update( 'pp_layouts', [ 'html' => $html ], [ 'id' => $layout_id ] ); } } \S::delete_cache(); } ?>