Skip to content
This repository has been archived by the owner on Oct 23, 2020. It is now read-only.

Commit

Permalink
Merge pull request #95 from Deutsche-Digitale-Bibliothek/drupal-frontend
Browse files Browse the repository at this point in the history
User manual added
  • Loading branch information
mbuechner committed Feb 16, 2015
2 parents 4cd2fe0 + 7b36e1c commit 004bc66
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 3 deletions.
13 changes: 13 additions & 0 deletions drupal/ddb_pdc/css/ddb-pdc.css
Original file line number Diff line number Diff line change
Expand Up @@ -352,3 +352,16 @@ a.ddb-pdc-item:hover .ddb-pdc-item-title {
.paginationCurrent {
background: url(../images/pagination/page_active.png) no-repeat;
}

.ddb-pdc-usermanual .usermanual{
color: #a5003b;
font-family: KarbidWeb,Calibri,Arial,sans-serif;
font-size: 1.5em;
font-weight: bold;
text-decoration: none;
}

.ddb-pdc-usermanual h2, .ddb-pdc-usermanual .submitted{
display:none;
visibility:hidden;
}
36 changes: 33 additions & 3 deletions drupal/ddb_pdc/ddb_pdc.module
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
$serveradress = variable_get('ddb_pdc_serveradress', 'http://localhost:8080');
define('PDC_SERVERADRESS', $serveradress);

$usermanual = variable_get('ddb_pdc_usermanual', '1');
define('PDC_USERMANUAL', $usermanual);

define('DDB_PDC_NUM_GENERAL_ASSUMPTIONS', 6);

/**
Expand All @@ -13,8 +16,7 @@ function ddb_pdc_menu() {
$items['public-domain-calculator'] = array(
'title' => 'Public Domain Calculator',
'description' => 'Deutsche Digitale Bibliothek - Public Domain Calculator',
'page callback' => 'drupal_get_form',
'page arguments' => array('ddb_pdc_form'),
'page callback' => 'ddb_pdc_public_domain_calculator',
'menu_name' => 'main-menu',
'access callback' => TRUE
);
Expand Down Expand Up @@ -88,6 +90,12 @@ function ddb_pdc_theme() {
'ddbResultsAmount' => NULL
),
'template' => 'templates/pagination'
),
'public-domain-calculator' => array(
'variables' => array(
'usermanual' => NULL
),
'template' => 'templates/public-domain-calculator'
)
);
}
Expand All @@ -99,6 +107,7 @@ function ddb_pdc_theme() {
*/
function ddb_pdc_form($form, &$form_state, $vars = '') {
$form = array();

$form['#redirect'] = 'public-domain-calculator-results';

$form['search_input'] = array(
Expand Down Expand Up @@ -159,11 +168,22 @@ function ddb_pdc_is_item_id($input) {
* <?php print theme('ddb_pdc_form', ...); ?>
*/
function ddb_pdc_render_search_form($variables) {
$search_term = $variables['search_term'];
$search_term = isset($variables['search_term']) ? $variables['search_term'] : '';
$form = drupal_get_form('ddb_pdc_form', $search_term);
return drupal_render($form);
}

/**
* Renders the search form with the video tutorial.
*/
function ddb_pdc_public_domain_calculator() {
$template_options = array(
'usermanual' => node_view(node_load(PDC_USERMANUAL)),
);

return theme('public-domain-calculator', $template_options);
}

/**
* Renders the DBB item search results page.
*/
Expand Down Expand Up @@ -279,13 +299,23 @@ function ddb_pdc_admin() {
$current_server_address =
variable_get('ddb_pdc_serveradress','http://localhost:8080');

$current_usermanual =
variable_get('ddb_pdc_usermanual','1');

$form = array(
'ddb_pdc_serveraddress' => array(
'#type' => 'textfield',
'#title' => 'Backend-Adresse',
'#default_value' => $current_server_address,
'#description' => 'Adresse zum Erreichen des DDB-PDC-Backends.',
'#required' => TRUE
),
'ddb_pdc_usermanual' => array(
'#type' => 'textfield',
'#title' => 'Artikel-ID der Bedienungsanleitung',
'#default_value' => $current_usermanual,
'#description' => 'ID des als Bedienungsanleitung unter dem Suchformular anzuzeigenden Artikels in der Artikelliste.',
'#required' => TRUE
)
);

Expand Down
Binary file added drupal/ddb_pdc/images/user_manual_video.mp4
Binary file not shown.
21 changes: 21 additions & 0 deletions drupal/ddb_pdc/templates/public-domain-calculator.tpl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
* @file
* Displays the DDB search form with the user manual article.
*
* Available variables:
* - $usermanual: node view of the article with its id as parameter.
*/

?>

<div id="ddb-pdc-form">
<?php
print theme('ddb_pdc_search_form');
?>
</div>
<div class="ddb-pdc-usermanual">
<?php
print drupal_render($usermanual);
?>
</div>

0 comments on commit 004bc66

Please sign in to comment.