/** * @file * Functions to support theming in the Bartik theme. */ use Drupal\Component\Utility\Html; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\StringTranslation\ByteSizeMarkup; use Drupal\Core\Template\Attribute; use Drupal\views\Form\ViewsForm; /** * Implements hook_preprocess_HOOK() for HTML document templates. * * Adds body classes if certain regions have content. */ function bartik_preprocess_html(&$variables) { // Add information about the number of sidebars. if (!empty($variables['page']['sidebar_first']) && !empty($variables['page']['sidebar_second'])) { $variables['attributes']['class'][] = 'layout-two-sidebars'; } elseif (!empty($variables['page']['sidebar_first'])) { $variables['attributes']['class'][] = 'layout-one-sidebar'; $variables['attributes']['class'][] = 'layout-sidebar-first'; } elseif (!empty($variables['page']['sidebar_second'])) { $variables['attributes']['class'][] = 'layout-one-sidebar'; $variables['attributes']['class'][] = 'layout-sidebar-second'; } else { $variables['attributes']['class'][] = 'layout-no-sidebars'; } if (!empty($variables['page']['featured_top'])) { $variables['attributes']['class'][] = 'has-featured-top'; } } /** * Implements hook_preprocess_HOOK() for page title templates. */ function bartik_preprocess_page_title(&$variables) { // Since the title and the shortcut link are both block level elements, // positioning them next to each other is much simpler with a wrapper div. if (!empty($variables['title_suffix']['add_or_remove_shortcut']) && $variables['title']) { // Add a wrapper div using the title_prefix and title_suffix render // elements. $variables['title_prefix']['shortcut_wrapper'] = [ '#markup' => '
', '#weight' => 100, ]; $variables['title_suffix']['shortcut_wrapper'] = [ '#markup' => '
', '#weight' => -99, ]; // Make sure the shortcut link is the first item in title_suffix. $variables['title_suffix']['add_or_remove_shortcut']['#weight'] = -100; } } /** * Implements hook_preprocess_HOOK() for maintenance-page.html.twig. */ function bartik_preprocess_maintenance_page(&$variables) { // By default, site_name is set to Drupal if no db connection is available // or during site installation. Setting site_name to an empty string makes // the site and update pages look cleaner. // @see template_preprocess_maintenance_page if (!$variables['db_is_active']) { $variables['site_name'] = ''; } // Bartik has custom styling for the maintenance page. $variables['#attached']['library'][] = 'bartik/maintenance_page'; } /** * Implements hook_preprocess_HOOK() for node.html.twig. */ function bartik_preprocess_node(&$variables) { // Remove the "Add new comment" link on teasers or when the comment form is // displayed on the page. if ($variables['teaser'] || !empty($variables['content']['comments']['comment_form'])) { unset($variables['content']['links']['comment']['#links']['comment-add']); } } /** * Implements hook_preprocess_HOOK() for block.html.twig. */ function bartik_preprocess_block(&$variables) { // Add a clearfix class to system branding blocks. if ($variables['plugin_id'] == 'system_branding_block') { $variables['attributes']['class'][] = 'clearfix'; } } /** * Implements hook_preprocess_HOOK() for menu.html.twig. */ function bartik_preprocess_menu(&$variables) { $variables['attributes']['class'][] = 'clearfix'; } /** * Implements hook_theme_suggestions_HOOK_alter() for form templates. */ function bartik_theme_suggestions_form_alter(array &$suggestions, array $variables) { if ($variables['element']['#form_id'] == 'search_block_form') { $suggestions[] = 'form__search_block_form'; } } /** * Implements hook_form_alter(). */ function bartik_form_alter(&$form, FormStateInterface $form_state, $form_id) { // Add classes to the search form. if (in_array($form_id, ['search_block_form', 'search_form'])) { $key = ($form_id == 'search_block_form') ? 'actions' : 'basic'; if (!isset($form[$key]['submit']['#attributes'])) { $form[$key]['submit']['#attributes'] = new Attribute(); } $form[$key]['submit']['#attributes']->addClass('search-form__submit'); } $form_object = $form_state->getFormObject(); // Add class to the Media Library views form. if ($form_object instanceof ViewsForm && strpos($form_object->getBaseFormId(), 'views_form_media_library') === 0) { // The conditional below exists because the media-library-views-form class // is currently added by Classy, but Umami will eventually not use Classy as // a base theme. // @todo remove conditional, keep class addition in // https://drupal.org/node/3110137 // @see https://www.drupal.org/node/3109287 // @see classy_form_alter() if (!isset($form['#attributes']['class']) || !in_array('media-library-views-form', $form['#attributes']['class'])) { $form['#attributes']['class'][] = 'media-library-views-form'; } } } /** * Implements hook_preprocess_links__media_library_menu(). * * This targets the menu of available media types in the media library's modal * dialog. * * @todo Do this in the relevant template once * https://www.drupal.org/project/drupal/issues/3088856 is resolved. */ function bartik_preprocess_links__media_library_menu(array &$variables) { foreach ($variables['links'] as &$link) { // This conditional exists because the media-library-menu__link class is // currently added by Classy, but Bartik will eventually not use Classy as a // base theme. // @todo remove conditional, keep class addition in // https://drupal.org/node/3110137 // @see https://www.drupal.org/node/3109287 // @see classy_preprocess_links__media_library_menu() if (!isset($link['link']['#options']['attributes']['class']) || !in_array('media-library-menu__link', $link['link']['#options']['attributes']['class'])) { $link['link']['#options']['attributes']['class'][] = 'media-library-menu__link'; } } } /** * Implements hook_preprocess_image_widget(). * * @todo Revisit in https://drupal.org/node/3117430 */ function bartik_preprocess_image_widget(&$variables) { if (!empty($variables['element']['fids']['#value'])) { $file = reset($variables['element']['#files']); $variables['data']["file_{$file->id()}"]['filename']['#suffix'] = ' (' . ByteSizeMarkup::create($file->getSize()) . ') '; } } /** * Implements template_preprocess_links(). * * This makes it so array keys of #links items are added as a class. This * functionality was removed in Drupal 8.1, but still necessary in some * instances. * * @todo remove in https://drupal.org/node/3120962 */ function bartik_preprocess_links(&$variables) { if (!empty($variables['links'])) { foreach ($variables['links'] as $key => $value) { if (!is_numeric($key)) { $class = Html::getClass($key); $variables['links'][$key]['attributes']->addClass($class); } } } } Jaroslav Hašek — The Author of Švejk

Most people who never leave the geographical and social circuit of their own national culture and its constituent elements cannot even begin to imagine what Jaroslav Hašek underwent, as a real person, a thinking and feeling being on his anabasis through Europe and Asia between his joining the army and his return home.

 

 

Jarmila, Hašek’s wife, said this of her maligned husband:


"The honesty of Hašek’s work lies in that he would descend for his art all the way to the level of his [character] types to come to understand their relation to people and things. He sacrificed himself, a mother, a wife, a child, a friend – he laid everything he had on the altar of truth – and she revealed herself to him such as she is, a laughably crippled wretch, without trinkets and without a veil."

 

 


 

Nothing Will Happen to Anyone: The Romance/Novel of Jaroslav Hašek and Jarmila Mayerová

Presentation by Sergey Soloukh  
during
Session IV: Hašek, Švejk as Seen by Authors of Prose Fiction
of the The World of Jaroslav Hašek conference
Harriman Institute at Columbia University
on Saturday, April 22, 2023 

 


 

What they say about Jaroslav Hašek
(on the Internet, that is ...)

Wikipedia

 

English broadcast of the Czech Radio


Listen in RealAudio: 
 Jaroslav Hašek RealAudio
 

by Nick Carey
As heard on the Czech Radio on 11/29/00

 

 České vysílání Českého rozhlasu (Czech language broadcast of the Czech Radio)
Před 80 lety zemřel Jaroslav Hašek (text)
 

 listen RealAudio
 

 

autor Vilém Faltýnek
06-01-2003

 


 

The [Political] Sins of Jaroslav Hašek
Stanislav Jíra

 

 


Jaroslav Hašek as an Austro-Hungarian soldier in 1915

 

 

 


Writing for the Čechoslovan [Czechoslav] in Kiev while a member of the Czecho-Slovak Legions

 
 

The tall building on the left is the Kiev Hotel Praga (Prague) where Hašek  lived and worked as an editor of the Čechoslovan magazine.

 
 

Hašek's letter of resignation from the Czecho-Slovak Legions.
(see translated version below)

 
 

To the Branch of the Czechoslovak National Council.

     I hereby let it be known that I do not agree with the policy of the Branch of the Czechoslovak National Council and with the departure of our corps to France.


     Therefore I declare that I am leaving the Czechoslovak corps until such time that both within the corps and the whole leadership of the National Council a new direction prevails.


     I request that this decision of mine be noted. I will even now continue to work for a revolution in Austria and the liberation of our nation.

 

 

Jaroslav Hašek, in own hand

 

Read at the meeting 4/18/18
(illegible initials and signature)

 

 
 

Human fates of Jaroslav Gashek

A photograph posted on the site of
Omsk State University in Russia

 
 

 

"Politruki" ", i.e. "political leaders", of the 5th Army of the Soviet Red Army (Hašek sitting in the front row, third from the right. Detail image of Hašek below.)

 

 

 

Hašek as a propagandist of the 5th Army.

 

 

 


 

 

 

 

With wife Jarmila and son Richard

 

 

 


The cottage Hašek bought in 1921 and moved into in summer 1922,
located across the street from the pub in Lipnice on the Sázava river
where he wrote Švejk books 2, 3 and 4.

 

 

Jaroslav Hašek and his Russian wife Shura
in Lipnice.

 

 

The last photograph of Jaroslav Hašek, December 1922.

 

 

 
Commemorative stamp from the USSR
 
Czechoslovak commemorative stamp