diff -Nuar front-5.x-1.9/front_page.info front-6.x/front_page.info --- front-5.x-1.9/front_page.info 2007-07-06 12:15:05.000000000 +0200 +++ front-6.x/front_page.info 2007-09-09 19:43:50.000000000 +0200 @@ -12,3 +12,5 @@ project = "front" datestamp = "1183716905" +core = 6.x + diff -Nuar front-5.x-1.9/front_page.module front-6.x/front_page.module --- front-5.x-1.9/front_page.module 2007-07-06 12:06:52.000000000 +0200 +++ front-6.x/front_page.module 2007-09-09 22:44:47.000000000 +0200 @@ -19,8 +19,8 @@ * Implementation of hook_help(). * */ -function front_page_help($section) { - switch ($section) { +function front_page_help($path, $arg) { + switch ($path) { case 'admin/settings/front': $roles = user_roles(); $special_note = ''; @@ -30,31 +30,30 @@ foreach ($roles as $role_id => $role_name) { $special_note .= "". $role_id ." ". $role_name ." | "; } - $special_note .= '

'. t('

The default setting for new roles is SAME AS AUTHENTICATED USERS.

') . ''; + $special_note .= '

'. t('

The default setting for new roles is SAME AS AUTHENTICATED USERS.

') .''; } return t('

Setup custom front pages for your site. Click on the option to expand the form and customise your settings.

Anonymous User = visitor not logged in | Authenticated User = visitor who is logged in

') . $special_note; - } + } } /** * this function sets the necessary paths etc. so drupal * knows where to find the front_page */ -function front_page_menu($may_cache) { +function front_page_menu() { $items = array(); - if ($may_cache) { - $items[] = array('path' => 'admin/settings/front', - 'title' => t('Advanced front page settings'), - 'description' => t('Specify a unique layout or splash page based on role type - override your HOME and breadcrumb links - display a custom mission style notice for users who haven\'t visited in a while - disable site and display a \'temporarily offline\' message.'), - 'callback' => 'drupal_get_form', - 'callback arguments' => 'front_page_admin', - 'access' => user_access('administer menu')); - $items[] = array( - 'path' => 'front_page', - 'title' => t(''), - 'callback' => 'front_page', - 'access' => TRUE, - 'type' => MENU_SUGGESTED_ITEM); - } + $items['admin/settings/front'] = array( + 'title' => 'Advanced front page settings', + 'description' => 'Specify a unique layout or splash page based on role type - override your HOME and breadcrumb links - display a custom mission style notice for users who haven\'t visited in a while - disable site and display a \'temporarily offline\' message.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('front_page_admin'), + 'access arguments' => array('administer menu'), + ); + $items['front_page'] = array( + 'title' => '', + 'page callback' => 'front_page', + 'access arguments' => array('access content'), + 'type' => MENU_SUGGESTED_ITEM, + ); return $items; } /** @@ -90,7 +89,7 @@ '#default_value' => variable_get('front_'. $role .'_text', ''), '#cols' => 60, '#rows' => 20, - '#description' => t('Paste your HTML or TEXT here for visitors to your site who are already logged in.

You can paste in the full HTML code for a complete page and include a different style sheet in the HEAD of the document if you want a completely different layout and style to the rest of your site.'), + '#description' => t('Paste your HTML or TEXT here for visitors to your site who are already logged in.

You can paste in the full HTML code for a complete page and include a different style sheet in the HEAD of the document if you want a completely different layout and style to the rest of your site.'), ); // Set the type options common for all roles. @@ -149,8 +148,8 @@ $form[$role]['front_'. $role .'_php'] = array( '#type' => 'checkbox', - '#title' => t('Allow embedded PHP code in this front page'), - '#return_value' => 1, '#default_value' => variable_get('front_'. $role .'_php',0), + '#title' => t('Allow embedded PHP code in this front page'), + '#return_value' => 1, '#default_value' => variable_get('front_'. $role .'_php', 0), '#description' => t('If this option is enabled, the body text can have embedded <?php...?> tags with PHP code inside. Click on the special Handbook pages for tips on Using PHP snippets in your front_page.'), ); } @@ -185,18 +184,18 @@ ); $form['special_notice']['special_notice_time'] = array( - '#type' => 'select', - '#title' => t('Been away for'), - '#default_value' => variable_get('special_notice_time',''), - '#options' => array( - 'one day' =>t('one day') , - 'one week' =>t('one week') , - 'one month' =>t('one month'), - 'three months' => t('three months'), - 'six months' => t('six months'), - 'one year' => t('one year'),), - '#description' => t('

The length of time to check for when users see the special notice which will be displayed as a mission style notice on the front page.

'), - ); + '#type' => 'select', + '#title' => t('Been away for'), + '#default_value' => variable_get('special_notice_time', ''), + '#options' => array( + 'one day' => t('one day') , + 'one week' => t('one week') , + 'one month' => t('one month'), + 'three months' => t('three months'), + 'six months' => t('six months'), + 'one year' => t('one year'), ), + '#description' => t('

The length of time to check for when users see the special notice which will be displayed as a mission style notice on the front page.

'), + ); $form['special_notice']['special_notice_text'] = array( '#type' => 'textarea', @@ -218,7 +217,7 @@ '#type' => 'checkbox', '#title' => t('Redirect your site HOME links'), '#return_value' => 1, - '#default_value' => variable_get('front_page_breadcrumb',0), + '#default_value' => variable_get('front_page_breadcrumb', 0), '#description' => t('Check this box if you want to redirect users who click on any HOME links (including the HOME breadcrumb link). Useful if you have a splash page you don\'t want users brought back to when they click on HOME links from within your site.') ); @@ -228,7 +227,7 @@ '#default_value' => variable_get('front_page_breadcrumb_redirect', ''), '#cols' => 20, '#rows' => 1, '#description' => t('Specify where the user should be redirected to. An example would be node/12. Leave blank when you\'re not using HOME redirect.'), - '#field_prefix' => url(NULL, NULL, NULL, TRUE) . (variable_get('clean_url', 0) ? '' : '?q=') + '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q=') ); $form['site'] = array( @@ -244,11 +243,11 @@ '#default_value' => variable_get('site_frontpage', 'node'), '#size' => 40, '#description' => t('Change this setting to front_page to activate your front page settings.'), - '#field_prefix' => url(NULL, NULL, NULL, TRUE) . (variable_get('clean_url', 0) ? '' : '?q=') + '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q=') ); - return system_settings_form($form); + return system_settings_form($form); } @@ -262,7 +261,7 @@ $output = 'node'; // Set the time to check against the last access of the user by the variable set in settings. - switch(variable_get('front_special_notice_time','')){ + switch (variable_get('front_special_notice_time', '')) { case 'one day' : $check_time = (time() - (24 * 60 * 60)); break; @@ -284,9 +283,9 @@ } //this checks to see if you are overriding HOME links on the site - if (variable_get('front_page_breadcrumb',0)) { + if (variable_get('front_page_breadcrumb', 0)) { // This checks to see if the referer is an internal HOME link or not. - $newhome = variable_get('front_page_breadcrumb_redirect','node'); + $newhome = variable_get('front_page_breadcrumb_redirect', 'node'); $ref = $_SERVER["HTTP_REFERER"]; global $user, $base_url; $parsed_url=parse_url($base_url); @@ -348,7 +347,7 @@ if (variable_get("front_". $role_id ."_php", 0)) { $output = drupal_eval($output); } - $fptype = variable_get("front_". $role_id ."_type", "drupal"); //check whether it is a themed or full front page. + $fptype = variable_get("front_". $role_id ."_type", "drupal"); //check whether it is a themed or full front page. switch ($fptype) { case "themed": print theme('page', $output);