Commit 970eaff4 authored by jcnventura's avatar jcnventura

Remove some PHP warnings in non-content pages

parent 2096205a
......@@ -140,10 +140,15 @@ function print_preprocess_print_node(&$variables) {
*/
function print_preprocess_print(&$variables) {
$format = $variables['type'];
$type = $variables['node']->type;
$variables['show_blocks'] = FALSE;
$variables['page']['#show_messages'] = FALSE;
template_preprocess_page($variables);
if (isset($variables['node']->type)) {
$type = $variables['node']->type;
$variables['show_blocks'] = FALSE;
$variables['page']['#show_messages'] = FALSE;
template_preprocess_page($variables);
}
else {
$type = '';
}
$variables['theme_hook_suggestions'][] = "print";
$variables['theme_hook_suggestions'][] = "print__node_{$type}";
$variables['theme_hook_suggestions'][] = "print__{$format}";
......
......@@ -452,6 +452,10 @@ function _print_friendly_urls($url = 0) {
* TRUE if URL list should be displayed, FALSE otherwise
*/
function _print_url_list_enabled($node, $format = PRINT_HTML_FORMAT) {
if (!isset($node->type)) {
return TRUE;
}
switch ($format) {
case PRINT_HTML_FORMAT:
$node_urllist = isset($node->print_display_urllist) ? $node->print_display_urllist : variable_get('print_display_urllist_' . $node->type, PRINT_TYPE_URLLIST_DEFAULT);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment