1 |
85ad3d82
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* @file
|
5 |
|
|
* Contains the functions to generate Printer-friendly pages.
|
6 |
|
|
*
|
7 |
|
|
* This file is included by the core PF module, and includes all the
|
8 |
|
|
* functions necessary to generate a PF version of the original page
|
9 |
|
|
* in HTML format.
|
10 |
|
|
*
|
11 |
|
|
* @ingroup print
|
12 |
|
|
*/
|
13 |
|
|
|
14 |
|
|
$_print_urls = PRINT_URLS_DEFAULT;
|
15 |
|
|
|
16 |
|
|
/**
|
17 |
76bdcd04
|
Assos Assos
|
* Generate an HTML version of the printer-friendly page.
|
18 |
85ad3d82
|
Assos Assos
|
*
|
19 |
|
|
* @see print_controller()
|
20 |
|
|
*/
|
21 |
|
|
function print_controller_html() {
|
22 |
|
|
$args = func_get_args();
|
23 |
|
|
$path = filter_xss(implode('/', $args));
|
24 |
76bdcd04
|
Assos Assos
|
$cid = isset($_GET['comment']) ? (int) $_GET['comment'] : NULL;
|
25 |
|
|
$link = print_print_link();
|
26 |
|
|
|
27 |
|
|
$node = print_controller($path, $link['format'], $cid);
|
28 |
|
|
if ($node) {
|
29 |
|
|
// Handle the query.
|
30 |
|
|
$query = $_GET;
|
31 |
|
|
unset($query['q']);
|
32 |
|
|
|
33 |
|
|
$html = theme('print', array(
|
34 |
|
|
'node' => $node,
|
35 |
|
|
'query' => $query,
|
36 |
|
|
'format' => $link['format'],
|
37 |
|
|
));
|
38 |
85ad3d82
|
Assos Assos
|
drupal_add_http_header('Content-Type', 'text/html; charset=utf-8');
|
39 |
|
|
drupal_send_headers();
|
40 |
|
|
print $html;
|
41 |
|
|
|
42 |
76bdcd04
|
Assos Assos
|
$nodepath = (isset($node->nid)) ? 'node/' . $node->nid : drupal_get_normal_path($path);
|
43 |
85ad3d82
|
Assos Assos
|
db_merge('print_page_counter')
|
44 |
1aa883a3
|
Assos Assos
|
->key(array('path' => substr($nodepath, 0, 255)))
|
45 |
85ad3d82
|
Assos Assos
|
->fields(array(
|
46 |
76bdcd04
|
Assos Assos
|
'totalcount' => 1,
|
47 |
|
|
'timestamp' => REQUEST_TIME,
|
48 |
85ad3d82
|
Assos Assos
|
))
|
49 |
|
|
->expression('totalcount', 'totalcount + 1')
|
50 |
|
|
->execute();
|
51 |
|
|
}
|
52 |
|
|
}
|
53 |
|
|
|
54 |
|
|
/**
|
55 |
76bdcd04
|
Assos Assos
|
* Select the print generator function based on the page type.
|
56 |
85ad3d82
|
Assos Assos
|
*
|
57 |
|
|
* Depending on the type of node, this functions chooses the appropriate
|
58 |
|
|
* generator function.
|
59 |
|
|
*
|
60 |
76bdcd04
|
Assos Assos
|
* @param string $path
|
61 |
|
|
* Path of the original page.
|
62 |
|
|
* @param string $format
|
63 |
|
|
* Format of the page being generated.
|
64 |
|
|
* @param int $cid
|
65 |
|
|
* Comment ID of the individual comment to be rendered.
|
66 |
|
|
* @param string $view_mode
|
67 |
|
|
* (Optional) view mode to be used when rendering the content.
|
68 |
|
|
*
|
69 |
|
|
* @return object
|
70 |
|
|
* node-like object to be used in the print template
|
71 |
|
|
*
|
72 |
85ad3d82
|
Assos Assos
|
* @see _print_generate_node()
|
73 |
|
|
* @see _print_generate_path()
|
74 |
|
|
* @see _print_generate_book()
|
75 |
76bdcd04
|
Assos Assos
|
* @see print_preprocess_print()
|
76 |
85ad3d82
|
Assos Assos
|
*/
|
77 |
76bdcd04
|
Assos Assos
|
function print_controller($path, $format, $cid = NULL, $view_mode = PRINT_VIEW_MODE) {
|
78 |
85ad3d82
|
Assos Assos
|
if (empty($path)) {
|
79 |
76bdcd04
|
Assos Assos
|
// If no path was provided, let's try to generate a page for the referer.
|
80 |
85ad3d82
|
Assos Assos
|
global $base_url;
|
81 |
|
|
|
82 |
|
|
$ref = $_SERVER['HTTP_REFERER'];
|
83 |
|
|
$path = preg_replace("!^$base_url/!", '', $ref);
|
84 |
|
|
if (($path === $ref) || empty($path)) {
|
85 |
|
|
$path = variable_get('site_frontpage', 'node');
|
86 |
|
|
}
|
87 |
|
|
}
|
88 |
|
|
if ($alias = drupal_lookup_path('source', $path)) {
|
89 |
|
|
// Indirect call with print/alias
|
90 |
76bdcd04
|
Assos Assos
|
// If there is a path alias with these arguments, generate a
|
91 |
|
|
// printer-friendly version for it.
|
92 |
85ad3d82
|
Assos Assos
|
$path = $alias;
|
93 |
|
|
}
|
94 |
|
|
$parts = explode('/', $path);
|
95 |
76bdcd04
|
Assos Assos
|
$node_router = variable_get('print_node_router', FALSE);
|
96 |
|
|
if (($parts[0] == 'node') && (count($parts) > 1) && ctype_digit($parts[1]) && !$node_router) {
|
97 |
85ad3d82
|
Assos Assos
|
array_shift($parts);
|
98 |
|
|
$path = implode('/', $parts);
|
99 |
|
|
}
|
100 |
76bdcd04
|
Assos Assos
|
$revision_view = preg_match('!^[\d]*/revisions/[\d]*/view$!', $path);
|
101 |
|
|
if (ctype_digit($parts[0]) && ((count($parts) == 1) || $revision_view) && !$node_router) {
|
102 |
|
|
$vid = $revision_view ? $parts[2] : NULL;
|
103 |
|
|
$node = _print_generate_node($path, $format, $vid, $cid, $view_mode);
|
104 |
85ad3d82
|
Assos Assos
|
}
|
105 |
|
|
else {
|
106 |
|
|
$ret = preg_match('!^book/export/html/(.*)!i', $path, $matches);
|
107 |
|
|
if ($ret == 1) {
|
108 |
76bdcd04
|
Assos Assos
|
// This is a book PF page link, handle trough the book handling functions.
|
109 |
|
|
$node = _print_generate_book($matches[1], $format);
|
110 |
85ad3d82
|
Assos Assos
|
}
|
111 |
|
|
else {
|
112 |
76bdcd04
|
Assos Assos
|
// If no content node was found, handle the page printing with the
|
113 |
|
|
// 'printable' engine.
|
114 |
|
|
$node = _print_generate_path($path, $format);
|
115 |
85ad3d82
|
Assos Assos
|
}
|
116 |
|
|
}
|
117 |
|
|
|
118 |
76bdcd04
|
Assos Assos
|
return $node;
|
119 |
|
|
}
|
120 |
|
|
|
121 |
|
|
/**
|
122 |
|
|
* Implements hook_preprocess_HOOK().
|
123 |
|
|
*/
|
124 |
|
|
function print_preprocess_print(&$variables) {
|
125 |
|
|
$node = $variables['node'];
|
126 |
|
|
$format = $variables['format'];
|
127 |
|
|
$path = drupal_get_path_alias(empty($node->nid) ? $node->path : "node/$node->nid");
|
128 |
|
|
|
129 |
|
|
static $hooks = NULL;
|
130 |
|
|
if (!isset($hooks)) {
|
131 |
|
|
drupal_theme_initialize();
|
132 |
|
|
$hooks = theme_get_registry();
|
133 |
|
|
}
|
134 |
|
|
|
135 |
|
|
$variables['page']['#show_messages'] = FALSE;
|
136 |
|
|
$variables['theme_hook_suggestions'] = array();
|
137 |
|
|
|
138 |
|
|
// Stolen from theme() so that ALL preprocess functions are called.
|
139 |
|
|
$hook = 'page';
|
140 |
|
|
$info = $hooks[$hook];
|
141 |
|
|
if (isset($info['preprocess functions']) || isset($info['process functions'])) {
|
142 |
|
|
foreach (array('preprocess functions', 'process functions') as $phase) {
|
143 |
|
|
if (!empty($info[$phase])) {
|
144 |
|
|
foreach ($info[$phase] as $processor_function) {
|
145 |
|
|
if (function_exists($processor_function)) {
|
146 |
|
|
// We don't want a poorly behaved process function changing $hook.
|
147 |
|
|
$hook_clone = $hook;
|
148 |
|
|
$processor_function($variables, $hook_clone);
|
149 |
|
|
}
|
150 |
|
|
}
|
151 |
|
|
}
|
152 |
|
|
}
|
153 |
|
|
}
|
154 |
|
|
|
155 |
|
|
$logo_url = FALSE;
|
156 |
|
|
switch (variable_get('print_logo_options', PRINT_LOGO_OPTIONS_DEFAULT)) {
|
157 |
|
|
// Theme logo.
|
158 |
|
|
case 1:
|
159 |
|
|
$logo_url = theme_get_setting('logo');
|
160 |
|
|
break;
|
161 |
|
|
|
162 |
|
|
// User-specifed logo.
|
163 |
|
|
case 2:
|
164 |
|
|
$logo_url = strip_tags(variable_get('print_logo_url', PRINT_LOGO_URL_DEFAULT));
|
165 |
|
|
break;
|
166 |
|
|
}
|
167 |
|
|
$logo_url = preg_replace('!^' . base_path() . '!', '', $logo_url);
|
168 |
|
|
|
169 |
|
|
$variables['print_logo'] = $logo_url ? theme('image', array(
|
170 |
|
|
'path' => $logo_url,
|
171 |
|
|
'alt' => variable_get('site_name', 'Drupal'),
|
172 |
|
|
'attributes' => array(
|
173 |
|
|
'class' => array('print-logo'),
|
174 |
|
|
'id' => 'logo',
|
175 |
|
|
),
|
176 |
|
|
)) : NULL;
|
177 |
|
|
|
178 |
|
|
$variables['print_node'] = $node;
|
179 |
|
|
$variables['content'] = $node->content;
|
180 |
|
|
$variables['scripts'] = drupal_get_js();
|
181 |
|
|
$variables['footer_scripts'] = drupal_get_js('footer');
|
182 |
|
|
$variables['sourceurl_enabled'] = variable_get('print_sourceurl_enabled', PRINT_SOURCEURL_ENABLED_DEFAULT);
|
183 |
|
|
$variables['url'] = url($path, array('absolute' => TRUE, 'query' => $variables['query']));
|
184 |
|
|
$variables['source_url'] = url(variable_get('print_sourceurl_forcenode', PRINT_SOURCEURL_FORCENODE_DEFAULT) ? drupal_get_normal_path($path) : $path, array(
|
185 |
|
|
'alias' => TRUE,
|
186 |
|
|
'absolute' => TRUE,
|
187 |
|
|
'query' => $variables['query'],
|
188 |
|
|
));
|
189 |
|
|
$variables['cid'] = isset($node->cid) ? $node->cid : NULL;
|
190 |
|
|
$variables['print_title'] = check_plain($node->title);
|
191 |
|
|
$variables['head'] = drupal_get_html_head();
|
192 |
|
|
$variables['robots_meta'] = _print_robots_meta_generator();
|
193 |
|
|
$variables['css'] = _print_css_generator($variables['expand_css']);
|
194 |
|
|
|
195 |
|
|
if (variable_get('print_html_sendtoprinter', PRINT_HTML_SENDTOPRINTER_DEFAULT) && ($format == 'html')) {
|
196 |
1aa883a3
|
Assos Assos
|
drupal_add_js('misc/drupal.js', array('group' => JS_LIBRARY));
|
197 |
76bdcd04
|
Assos Assos
|
|
198 |
|
|
$window_close = (variable_get('print_html_new_window', PRINT_HTML_NEW_WINDOW_DEFAULT) && variable_get('print_html_windowclose', PRINT_HTML_WINDOWCLOSE_DEFAULT)) ? 'setTimeout(function(){window.close();}, 1);' : '';
|
199 |
|
|
$variables['sendtoprinter'] = '<script type="text/javascript">(function ($) { Drupal.behaviors.print = {attach: function() {$(window).load(function() {window.print();' . $window_close . '})}}})(jQuery);</script>';
|
200 |
|
|
}
|
201 |
|
|
|
202 |
|
|
$type = (isset($node->type)) ? $node->type : '';
|
203 |
|
|
$nid = (isset($node->nid)) ? $node->nid : '';
|
204 |
|
|
|
205 |
|
|
$variables['theme_hook_suggestions'][] = "print__node__{$type}";
|
206 |
|
|
$variables['theme_hook_suggestions'][] = "print__node__{$type}__{$nid}";
|
207 |
|
|
$variables['theme_hook_suggestions'][] = "print__{$format}";
|
208 |
|
|
$variables['theme_hook_suggestions'][] = "print__{$format}__node__{$type}";
|
209 |
|
|
$variables['theme_hook_suggestions'][] = "print__{$format}__node__{$type}__{$nid}";
|
210 |
|
|
}
|
211 |
|
|
|
212 |
|
|
/**
|
213 |
|
|
* Returns HTML for the published line of the print template.
|
214 |
|
|
*
|
215 |
|
|
* @param array $vars
|
216 |
|
|
* An empty associative array.
|
217 |
|
|
*
|
218 |
|
|
* @return string
|
219 |
|
|
* HTML text with the published line
|
220 |
|
|
*
|
221 |
|
|
* @ingroup themeable
|
222 |
|
|
* @ingroup print_themeable
|
223 |
|
|
*/
|
224 |
|
|
function theme_print_published($vars) {
|
225 |
|
|
global $base_url;
|
226 |
|
|
|
227 |
|
|
$published_site = variable_get('site_name', 0);
|
228 |
|
|
return $published_site ? t('Published on %site_name', array('%site_name' => $published_site)) . ' (' . l($base_url, $base_url) . ')' : '';
|
229 |
|
|
}
|
230 |
|
|
|
231 |
|
|
/**
|
232 |
|
|
* Returns HTML for the breadcrumb line of the print template.
|
233 |
|
|
*
|
234 |
|
|
* @param array $vars
|
235 |
|
|
* An associative array containing:
|
236 |
|
|
* - $node: the node object.
|
237 |
|
|
*
|
238 |
|
|
* @return string
|
239 |
|
|
* HTML text with the breadcrumb
|
240 |
|
|
*
|
241 |
|
|
* @ingroup themeable
|
242 |
|
|
* @ingroup print_themeable
|
243 |
|
|
*/
|
244 |
|
|
function theme_print_breadcrumb($vars) {
|
245 |
|
|
$node = $vars['node'];
|
246 |
|
|
$old_path = $_GET['q'];
|
247 |
|
|
|
248 |
|
|
$path = empty($node->nid) ? $node->path : "node/$node->nid";
|
249 |
|
|
menu_set_active_item($path);
|
250 |
|
|
$breadcrumb = drupal_get_breadcrumb();
|
251 |
|
|
if (!empty($breadcrumb)) {
|
252 |
|
|
$breadcrumb[] = menu_get_active_title();
|
253 |
|
|
menu_set_active_item($old_path);
|
254 |
|
|
return filter_xss(implode(' > ', $breadcrumb));
|
255 |
|
|
}
|
256 |
|
|
else {
|
257 |
|
|
menu_set_active_item($old_path);
|
258 |
|
|
return '';
|
259 |
|
|
}
|
260 |
|
|
}
|
261 |
|
|
|
262 |
|
|
/**
|
263 |
|
|
* Returns HTML for the footer of the print template.
|
264 |
|
|
*
|
265 |
|
|
* @param array $vars
|
266 |
|
|
* An empty associative array.
|
267 |
|
|
*
|
268 |
|
|
* @return string
|
269 |
|
|
* HTML text with the footer
|
270 |
|
|
*
|
271 |
|
|
* @ingroup themeable
|
272 |
|
|
* @ingroup print_themeable
|
273 |
|
|
*/
|
274 |
|
|
function theme_print_footer($vars) {
|
275 |
|
|
$footer = '';
|
276 |
|
|
|
277 |
|
|
switch (variable_get('print_footer_options', PRINT_FOOTER_OPTIONS_DEFAULT)) {
|
278 |
|
|
// Theme footer.
|
279 |
|
|
case 1:
|
280 |
|
|
$footer_blocks = block_get_blocks_by_region('footer');
|
281 |
|
|
$footer = variable_get('site_footer', FALSE) . "\n" . drupal_render($footer_blocks);
|
282 |
|
|
break;
|
283 |
|
|
|
284 |
|
|
// User-specified footer.
|
285 |
|
|
case 2:
|
286 |
|
|
$footer = variable_get('print_footer_user', PRINT_FOOTER_USER_DEFAULT);
|
287 |
|
|
break;
|
288 |
|
|
}
|
289 |
|
|
// Delete the contextual links.
|
290 |
|
|
$footer = preg_replace('!\s*<div class="contextual-links-wrapper">.*?</div>!sim', '', $footer);
|
291 |
|
|
|
292 |
|
|
return filter_xss_admin($footer);
|
293 |
|
|
}
|
294 |
|
|
|
295 |
|
|
/**
|
296 |
|
|
* Returns HTML for the source URL line of the print template.
|
297 |
|
|
*
|
298 |
|
|
* @param array $vars
|
299 |
|
|
* An associative array containing:
|
300 |
|
|
* - $url: the URL to the full node view.
|
301 |
|
|
* - $node: the node object.
|
302 |
|
|
* - $cid; comment ID of the comment to display.
|
303 |
|
|
*
|
304 |
|
|
* @return string
|
305 |
|
|
* HTML text with the footer
|
306 |
|
|
*
|
307 |
|
|
* @ingroup themeable
|
308 |
|
|
* @ingroup print_themeable
|
309 |
|
|
*/
|
310 |
|
|
function theme_print_sourceurl($vars) {
|
311 |
|
|
$sourceurl_date = variable_get('print_sourceurl_date', PRINT_SOURCEURL_DATE_DEFAULT);
|
312 |
|
|
$url = is_int($vars['cid']) ? $vars['url'] . '#comment-' . $vars['cid'] : $vars['url'];
|
313 |
|
|
|
314 |
|
|
$output = '<strong>' . t('Source URL');
|
315 |
|
|
if ($sourceurl_date && isset($vars['node'])) {
|
316 |
|
|
$output .= ' (';
|
317 |
|
|
$date = format_date($vars['node']->changed, 'short');
|
318 |
|
|
|
319 |
|
|
$output .= empty($vars['node']->nid) ? t('retrieved on !date', array('!date' => $date)) : t('modified on !date', array('!date' => $date));
|
320 |
|
|
|
321 |
|
|
$output .= ')';
|
322 |
|
|
}
|
323 |
|
|
$output .= ':</strong> ' . $url;
|
324 |
|
|
|
325 |
|
|
return $output;
|
326 |
|
|
}
|
327 |
|
|
|
328 |
|
|
/**
|
329 |
|
|
* Returns HTML for the URL list of the print template.
|
330 |
|
|
*
|
331 |
|
|
* @param array $vars
|
332 |
|
|
* An empty associative array.
|
333 |
|
|
*
|
334 |
|
|
* @return string
|
335 |
|
|
* HTML text with the URL list
|
336 |
|
|
*
|
337 |
|
|
* @ingroup themeable
|
338 |
|
|
* @ingroup print_themeable
|
339 |
|
|
*/
|
340 |
|
|
function theme_print_url_list($vars) {
|
341 |
|
|
global $_print_urls;
|
342 |
|
|
|
343 |
|
|
// Display the collected links at the bottom of the page. Code once taken from
|
344 |
|
|
// Kjartan Mannes' project.module.
|
345 |
|
|
if (!empty($_print_urls)) {
|
346 |
|
|
$urls = _print_friendly_urls();
|
347 |
|
|
$url_list = '';
|
348 |
|
|
foreach ($urls as $key => $url) {
|
349 |
|
|
drupal_alter('print_url_list', $url);
|
350 |
|
|
$url_list .= '[' . ($key + 1) . '] ' . check_plain($url) . "<br />\n";
|
351 |
|
|
}
|
352 |
|
|
if (!empty($url_list)) {
|
353 |
|
|
return "<p><strong>" . t('Links') . "</strong><br />$url_list</p>";
|
354 |
|
|
}
|
355 |
|
|
}
|
356 |
|
|
return '';
|
357 |
85ad3d82
|
Assos Assos
|
}
|
358 |
|
|
|
359 |
|
|
/**
|
360 |
76bdcd04
|
Assos Assos
|
* Generates a robots meta tag to tell them what they may index.
|
361 |
85ad3d82
|
Assos Assos
|
*
|
362 |
76bdcd04
|
Assos Assos
|
* @return string
|
363 |
|
|
* meta robots tag
|
364 |
85ad3d82
|
Assos Assos
|
*/
|
365 |
|
|
function _print_robots_meta_generator() {
|
366 |
|
|
$robots_meta = array();
|
367 |
|
|
|
368 |
76bdcd04
|
Assos Assos
|
if (variable_get('print_robots_noindex', PRINT_ROBOTS_NOINDEX_DEFAULT)) {
|
369 |
85ad3d82
|
Assos Assos
|
$robots_meta[] = 'noindex';
|
370 |
|
|
}
|
371 |
76bdcd04
|
Assos Assos
|
if (variable_get('print_robots_nofollow', PRINT_ROBOTS_NOFOLLOW_DEFAULT)) {
|
372 |
85ad3d82
|
Assos Assos
|
$robots_meta[] = 'nofollow';
|
373 |
|
|
}
|
374 |
76bdcd04
|
Assos Assos
|
if (variable_get('print_robots_noarchive', PRINT_ROBOTS_NOARCHIVE_DEFAULT)) {
|
375 |
85ad3d82
|
Assos Assos
|
$robots_meta[] = 'noarchive';
|
376 |
|
|
}
|
377 |
|
|
|
378 |
|
|
if (count($robots_meta) > 0) {
|
379 |
1aa883a3
|
Assos Assos
|
return '<meta name="robots" content="' . implode(', ', $robots_meta) . '" />';
|
380 |
85ad3d82
|
Assos Assos
|
}
|
381 |
|
|
else {
|
382 |
76bdcd04
|
Assos Assos
|
return '';
|
383 |
85ad3d82
|
Assos Assos
|
}
|
384 |
|
|
}
|
385 |
|
|
|
386 |
|
|
/**
|
387 |
76bdcd04
|
Assos Assos
|
* Generates the CSS directive to include in the printer-friendly version.
|
388 |
|
|
*
|
389 |
|
|
* @param bool $expand
|
390 |
|
|
* If TRUE, the provided CSS will be expanded, instead of given as a list
|
391 |
|
|
* of includes.
|
392 |
|
|
*
|
393 |
|
|
* @return string
|
394 |
|
|
* applicable CSS
|
395 |
85ad3d82
|
Assos Assos
|
*/
|
396 |
76bdcd04
|
Assos Assos
|
function _print_css_generator($expand = FALSE) {
|
397 |
85ad3d82
|
Assos Assos
|
$print_css = variable_get('print_css', PRINT_CSS_DEFAULT);
|
398 |
|
|
|
399 |
|
|
if (!empty($print_css)) {
|
400 |
a2baadd1
|
Assos Assos
|
drupal_add_css(strtr($print_css, array('%t' => drupal_get_path('theme', variable_get('theme_default')))));
|
401 |
85ad3d82
|
Assos Assos
|
}
|
402 |
|
|
else {
|
403 |
|
|
drupal_add_css(drupal_get_path('module', 'print') . '/css/print.css');
|
404 |
|
|
}
|
405 |
|
|
$drupal_css = drupal_add_css();
|
406 |
76bdcd04
|
Assos Assos
|
if (!variable_get('print_keep_theme_css', PRINT_KEEP_THEME_CSS_DEFAULT)) {
|
407 |
85ad3d82
|
Assos Assos
|
foreach ($drupal_css as $key => $css_file) {
|
408 |
|
|
if ($css_file['group'] == CSS_THEME) {
|
409 |
76bdcd04
|
Assos Assos
|
// Unset the theme's CSS.
|
410 |
85ad3d82
|
Assos Assos
|
unset($drupal_css[$key]);
|
411 |
|
|
}
|
412 |
|
|
}
|
413 |
|
|
}
|
414 |
|
|
|
415 |
76bdcd04
|
Assos Assos
|
// Expand the CSS if requested.
|
416 |
|
|
if ($expand) {
|
417 |
85ad3d82
|
Assos Assos
|
$style = '';
|
418 |
|
|
$css_files = array_keys($drupal_css);
|
419 |
|
|
foreach ($css_files as $filename) {
|
420 |
76bdcd04
|
Assos Assos
|
if (file_exists($filename)) {
|
421 |
|
|
$style .= file_get_contents($filename, TRUE);
|
422 |
85ad3d82
|
Assos Assos
|
}
|
423 |
|
|
}
|
424 |
76bdcd04
|
Assos Assos
|
return "<style type='text/css' media='all'>$style</style>\n";
|
425 |
85ad3d82
|
Assos Assos
|
}
|
426 |
|
|
else {
|
427 |
76bdcd04
|
Assos Assos
|
return drupal_get_css($drupal_css);
|
428 |
85ad3d82
|
Assos Assos
|
}
|
429 |
|
|
}
|
430 |
|
|
|
431 |
|
|
/**
|
432 |
76bdcd04
|
Assos Assos
|
* Callback function for the preg_replace_callback for URL-capable patterns.
|
433 |
|
|
*
|
434 |
|
|
* Manipulate URLs to make them absolute in the URLs list, and add a [n]
|
435 |
|
|
* footnote marker.
|
436 |
85ad3d82
|
Assos Assos
|
*
|
437 |
76bdcd04
|
Assos Assos
|
* @param array $matches
|
438 |
|
|
* Array with the matched tag patterns, usually <a...>+text+</a>.
|
439 |
85ad3d82
|
Assos Assos
|
*
|
440 |
76bdcd04
|
Assos Assos
|
* @return string
|
441 |
|
|
* tag with re-written URL and, if applicable, the [n] index to the URL list
|
442 |
85ad3d82
|
Assos Assos
|
*/
|
443 |
|
|
function _print_rewrite_urls($matches) {
|
444 |
|
|
global $base_url, $base_root, $_print_urls;
|
445 |
|
|
|
446 |
|
|
$include_anchors = variable_get('print_urls_anchors', PRINT_URLS_ANCHORS_DEFAULT);
|
447 |
|
|
|
448 |
76bdcd04
|
Assos Assos
|
// First, split the html into the different tag attributes.
|
449 |
85ad3d82
|
Assos Assos
|
$pattern = '!\s*(\w+\s*=\s*"(?:\\\"|[^"])*")\s*|\s*(\w+\s*=\s*\'(?:\\\\\'|[^\'])*\')\s*|\s*(\w+\s*=\s*\w+)\s*|\s+!';
|
450 |
|
|
$attribs = preg_split($pattern, $matches[1], -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
|
451 |
|
|
foreach ($attribs as $key => $value) {
|
452 |
|
|
$attribs[$key] = preg_replace('!(\w)\s*=\s*(.*)!', '$1=$2', $value);
|
453 |
|
|
}
|
454 |
|
|
|
455 |
|
|
$size = count($attribs);
|
456 |
76bdcd04
|
Assos Assos
|
for ($i = 1; $i < $size; $i++) {
|
457 |
|
|
// If the attribute is href or src, rewrite the URL in the value.
|
458 |
85ad3d82
|
Assos Assos
|
if (preg_match('!^(?:href|src)\s*?=(.*)!i', $attribs[$i], $urls) > 0) {
|
459 |
|
|
$url = trim($urls[1], " \t\n\r\0\x0B\"'");
|
460 |
|
|
|
461 |
|
|
if (empty($url)) {
|
462 |
76bdcd04
|
Assos Assos
|
// If URL is empty, use current_url.
|
463 |
85ad3d82
|
Assos Assos
|
$path = explode('/', $_GET['q']);
|
464 |
|
|
unset($path[0]);
|
465 |
|
|
$path = implode('/', $path);
|
466 |
|
|
if (ctype_digit($path)) {
|
467 |
|
|
$path = "node/$path";
|
468 |
|
|
}
|
469 |
76bdcd04
|
Assos Assos
|
// Printer-friendly URLs is on, so we need to make it absolute.
|
470 |
|
|
$newurl = url($path, array(
|
471 |
|
|
'fragment' => drupal_substr($url, 1),
|
472 |
|
|
'absolute' => TRUE,
|
473 |
|
|
));
|
474 |
85ad3d82
|
Assos Assos
|
}
|
475 |
|
|
elseif (strpos(html_entity_decode($url), '://') || preg_match('!^mailto:.*?@.*?\..*?$!iu', html_entity_decode($url))) {
|
476 |
76bdcd04
|
Assos Assos
|
// URL is absolute, do nothing.
|
477 |
85ad3d82
|
Assos Assos
|
$newurl = $url;
|
478 |
|
|
}
|
479 |
|
|
elseif (strpos(html_entity_decode($url), '//') === 0) {
|
480 |
76bdcd04
|
Assos Assos
|
// URL is 'almost absolute', but it does not contain protocol; replace
|
481 |
|
|
// with base_path protocol.
|
482 |
85ad3d82
|
Assos Assos
|
$newurl = (empty($_SERVER['HTTPS']) ? 'http' : 'https') . ":" . $url;
|
483 |
|
|
$matches[1] = str_replace($url, $newurl, $matches[1]);
|
484 |
|
|
}
|
485 |
|
|
else {
|
486 |
|
|
if ($url[0] == '#') {
|
487 |
76bdcd04
|
Assos Assos
|
// URL is an anchor tag.
|
488 |
85ad3d82
|
Assos Assos
|
if ($include_anchors && (!empty($_print_urls))) {
|
489 |
|
|
$path = explode('/', $_GET['q']);
|
490 |
|
|
unset($path[0]);
|
491 |
|
|
$path = implode('/', $path);
|
492 |
|
|
if (ctype_digit($path)) {
|
493 |
|
|
$path = "node/$path";
|
494 |
|
|
}
|
495 |
76bdcd04
|
Assos Assos
|
// Printer-friendly URLs is on, so we need to make it absolute.
|
496 |
|
|
$newurl = url($path, array(
|
497 |
|
|
'fragment' => drupal_substr($url, 1),
|
498 |
|
|
'absolute' => TRUE,
|
499 |
|
|
));
|
500 |
85ad3d82
|
Assos Assos
|
}
|
501 |
|
|
// Because base href is the original page, change the link to
|
502 |
76bdcd04
|
Assos Assos
|
// still be usable inside the print page.
|
503 |
a2baadd1
|
Assos Assos
|
$matches[1] = str_replace($url, check_plain(base_path() . $_GET['q'] . $url), $matches[1]);
|
504 |
85ad3d82
|
Assos Assos
|
}
|
505 |
|
|
else {
|
506 |
76bdcd04
|
Assos Assos
|
// URL is relative, convert it into absolute URL.
|
507 |
85ad3d82
|
Assos Assos
|
if ($url[0] == '/') {
|
508 |
76bdcd04
|
Assos Assos
|
// If it starts with '/' just append it to the server name.
|
509 |
85ad3d82
|
Assos Assos
|
$newurl = $base_root . '/' . trim($url, '/');
|
510 |
|
|
}
|
511 |
|
|
elseif (preg_match('!^(?:index.php)?\?q=!i', $url)) {
|
512 |
76bdcd04
|
Assos Assos
|
// If it starts with ?q=, just prepend with the base URL.
|
513 |
85ad3d82
|
Assos Assos
|
$newurl = $base_url . '/' . trim($url, '/');
|
514 |
|
|
}
|
515 |
|
|
else {
|
516 |
|
|
$newurl = url(trim($url, '/'), array('absolute' => TRUE));
|
517 |
|
|
}
|
518 |
|
|
$matches[1] = str_replace($url, $newurl, $matches[1]);
|
519 |
|
|
}
|
520 |
|
|
}
|
521 |
|
|
}
|
522 |
|
|
}
|
523 |
|
|
|
524 |
|
|
$ret = '<' . $matches[1] . '>';
|
525 |
|
|
if (count($matches) == 4) {
|
526 |
|
|
$ret .= $matches[2] . $matches[3];
|
527 |
|
|
if ((!empty($_print_urls)) && (isset($newurl))) {
|
528 |
|
|
$ret .= ' <span class="print-footnote">[' . _print_friendly_urls(trim($newurl)) . ']</span>';
|
529 |
|
|
}
|
530 |
|
|
}
|
531 |
|
|
|
532 |
a2baadd1
|
Assos Assos
|
return filter_xss_admin($ret);
|
533 |
85ad3d82
|
Assos Assos
|
}
|
534 |
|
|
|
535 |
|
|
/**
|
536 |
|
|
* Auxiliary function to store the Printer-friendly URLs list as static.
|
537 |
|
|
*
|
538 |
76bdcd04
|
Assos Assos
|
* @param string|int $url
|
539 |
|
|
* Absolute URL to be inserted in the list.
|
540 |
|
|
*
|
541 |
|
|
* @return array|int
|
542 |
85ad3d82
|
Assos Assos
|
* list of URLs previously stored if $url is 0, or the current count
|
543 |
|
|
* otherwise.
|
544 |
|
|
*/
|
545 |
|
|
function _print_friendly_urls($url = 0) {
|
546 |
|
|
static $urls = array();
|
547 |
|
|
if ($url !== 0) {
|
548 |
|
|
$url_idx = array_search($url, $urls);
|
549 |
|
|
if ($url_idx !== FALSE) {
|
550 |
|
|
return ($url_idx + 1);
|
551 |
|
|
}
|
552 |
|
|
else {
|
553 |
|
|
$urls[] = $url;
|
554 |
|
|
return count($urls);
|
555 |
|
|
}
|
556 |
|
|
}
|
557 |
76bdcd04
|
Assos Assos
|
else {
|
558 |
|
|
$ret = $urls;
|
559 |
|
|
$urls = array();
|
560 |
|
|
return $ret;
|
561 |
|
|
}
|
562 |
85ad3d82
|
Assos Assos
|
}
|
563 |
|
|
|
564 |
|
|
/**
|
565 |
76bdcd04
|
Assos Assos
|
* Check URL list settings for this node.
|
566 |
85ad3d82
|
Assos Assos
|
*
|
567 |
76bdcd04
|
Assos Assos
|
* @param Object $node
|
568 |
|
|
* Node object.
|
569 |
|
|
* @param string $format
|
570 |
|
|
* Format of the page being generated.
|
571 |
|
|
*
|
572 |
|
|
* @return bool
|
573 |
85ad3d82
|
Assos Assos
|
* TRUE if URL list should be displayed, FALSE otherwise
|
574 |
|
|
*/
|
575 |
76bdcd04
|
Assos Assos
|
function _print_url_list_enabled($node, $format) {
|
576 |
85ad3d82
|
Assos Assos
|
if (!isset($node->type)) {
|
577 |
76bdcd04
|
Assos Assos
|
$node_urllist = variable_get('print_' . $format . '_display_sys_urllist', PRINT_TYPE_SYS_URLLIST_DEFAULT);
|
578 |
85ad3d82
|
Assos Assos
|
}
|
579 |
|
|
else {
|
580 |
76bdcd04
|
Assos Assos
|
$node_urllist = isset($node->{'print_' . $format . '_display_urllist'}) ? $node->{'print_' . $format . '_display_urllist'} : variable_get('print_' . $format . '_display_urllist_' . $node->type, PRINT_TYPE_URLLIST_DEFAULT);
|
581 |
85ad3d82
|
Assos Assos
|
}
|
582 |
|
|
|
583 |
76bdcd04
|
Assos Assos
|
// Get value of Printer-friendly URLs setting.
|
584 |
85ad3d82
|
Assos Assos
|
return (variable_get('print_urls', PRINT_URLS_DEFAULT) && ($node_urllist));
|
585 |
|
|
}
|
586 |
|
|
|
587 |
|
|
/**
|
588 |
76bdcd04
|
Assos Assos
|
* Prepare a Printer-friendly-ready node body for content nodes.
|
589 |
|
|
*
|
590 |
|
|
* @param int $nid
|
591 |
|
|
* Node ID of the node to be rendered into a printer-friendly page.
|
592 |
|
|
* @param string $format
|
593 |
|
|
* Format of the page being generated.
|
594 |
|
|
* @param int $vid
|
595 |
|
|
* (Optional) revision ID of the node to use.
|
596 |
|
|
* @param int $cid
|
597 |
|
|
* (Optional) comment ID of the individual comment to be rendered.
|
598 |
|
|
* @param string $view_mode
|
599 |
|
|
* (Optional) view mode to be used when rendering the content.
|
600 |
|
|
*
|
601 |
|
|
* @return object|bool
|
602 |
|
|
* filled node-like object to be used in the print template
|
603 |
85ad3d82
|
Assos Assos
|
*/
|
604 |
76bdcd04
|
Assos Assos
|
function _print_generate_node($nid, $format, $vid = NULL, $cid = NULL, $view_mode = PRINT_VIEW_MODE) {
|
605 |
85ad3d82
|
Assos Assos
|
global $_print_urls;
|
606 |
|
|
|
607 |
|
|
if (!isset($langcode)) {
|
608 |
|
|
$langcode = $GLOBALS['language_content']->language;
|
609 |
|
|
}
|
610 |
|
|
|
611 |
76bdcd04
|
Assos Assos
|
// We can take a node id.
|
612 |
|
|
$node = node_load($nid, $vid);
|
613 |
85ad3d82
|
Assos Assos
|
if (!$node) {
|
614 |
76bdcd04
|
Assos Assos
|
// Node not found.
|
615 |
85ad3d82
|
Assos Assos
|
drupal_not_found();
|
616 |
76bdcd04
|
Assos Assos
|
drupal_exit();
|
617 |
85ad3d82
|
Assos Assos
|
}
|
618 |
|
|
elseif (!node_access('view', $node)) {
|
619 |
76bdcd04
|
Assos Assos
|
// Access is denied.
|
620 |
85ad3d82
|
Assos Assos
|
drupal_access_denied();
|
621 |
76bdcd04
|
Assos Assos
|
drupal_exit();
|
622 |
85ad3d82
|
Assos Assos
|
}
|
623 |
|
|
drupal_set_title($node->title);
|
624 |
|
|
|
625 |
76bdcd04
|
Assos Assos
|
$build = array();
|
626 |
85ad3d82
|
Assos Assos
|
if ($cid === NULL) {
|
627 |
|
|
// Adapted (simplified) version of node_view
|
628 |
76bdcd04
|
Assos Assos
|
// Render the node content.
|
629 |
85ad3d82
|
Assos Assos
|
node_build_content($node, $view_mode);
|
630 |
|
|
|
631 |
76bdcd04
|
Assos Assos
|
// Disable the links area.
|
632 |
85ad3d82
|
Assos Assos
|
unset($node->content['links']);
|
633 |
|
|
|
634 |
|
|
$build = $node->content;
|
635 |
|
|
unset($node->content);
|
636 |
|
|
}
|
637 |
|
|
|
638 |
76bdcd04
|
Assos Assos
|
if (function_exists('comment_node_page_additions') &&
|
639 |
|
|
(($cid != NULL) || (variable_get('print_comments', PRINT_COMMENTS_DEFAULT)))) {
|
640 |
|
|
// Print only the requested comment (or if $cid is NULL, all of them).
|
641 |
85ad3d82
|
Assos Assos
|
$comments = comment_node_page_additions($node);
|
642 |
|
|
if (!empty($comments)) {
|
643 |
|
|
unset($comments['comment_form']);
|
644 |
|
|
foreach ($comments['comments'] as $key => &$comment) {
|
645 |
|
|
if (is_numeric($key)) {
|
646 |
|
|
if (($cid != NULL) && ($key != $cid)) {
|
647 |
|
|
unset($comments['comments'][$key]);
|
648 |
|
|
}
|
649 |
|
|
else {
|
650 |
|
|
unset($comment['links']);
|
651 |
|
|
}
|
652 |
|
|
}
|
653 |
|
|
}
|
654 |
|
|
|
655 |
|
|
$build['comments'] = $comments;
|
656 |
|
|
}
|
657 |
|
|
}
|
658 |
|
|
|
659 |
|
|
$build += array(
|
660 |
|
|
'#theme' => 'node',
|
661 |
|
|
'#node' => $node,
|
662 |
|
|
'#view_mode' => $view_mode,
|
663 |
|
|
'#language' => $langcode,
|
664 |
|
|
'#print_format' => $format,
|
665 |
|
|
);
|
666 |
|
|
|
667 |
|
|
$type = 'node';
|
668 |
|
|
drupal_alter(array('node_view', 'entity_view'), $build, $type);
|
669 |
|
|
|
670 |
|
|
$content = render($build);
|
671 |
|
|
|
672 |
76bdcd04
|
Assos Assos
|
// Get rid of any links before the content.
|
673 |
85ad3d82
|
Assos Assos
|
$parts = explode('<div class="content', $content, 2);
|
674 |
|
|
if (count($parts) == 2) {
|
675 |
|
|
$pattern = '!(.*?)<a [^>]*?>(.*?)</a>(.*?)!mis';
|
676 |
|
|
$parts[0] = preg_replace($pattern, '$1$2$3', $parts[0]);
|
677 |
|
|
$content = implode('<div class="content', $parts);
|
678 |
|
|
}
|
679 |
|
|
|
680 |
76bdcd04
|
Assos Assos
|
// Check URL list settings.
|
681 |
85ad3d82
|
Assos Assos
|
$_print_urls = _print_url_list_enabled($node, $format);
|
682 |
|
|
|
683 |
76bdcd04
|
Assos Assos
|
// Convert the a href elements.
|
684 |
85ad3d82
|
Assos Assos
|
$pattern = '!<(a\s[^>]*?)>(.*?)(</a>)!is';
|
685 |
|
|
$content = preg_replace_callback($pattern, '_print_rewrite_urls', $content);
|
686 |
|
|
|
687 |
76bdcd04
|
Assos Assos
|
$node->content = $content;
|
688 |
85ad3d82
|
Assos Assos
|
|
689 |
76bdcd04
|
Assos Assos
|
return $node;
|
690 |
85ad3d82
|
Assos Assos
|
}
|
691 |
|
|
|
692 |
|
|
/**
|
693 |
76bdcd04
|
Assos Assos
|
* Prepare a Printer-friendly-ready node body for non-content pages.
|
694 |
|
|
*
|
695 |
|
|
* @param string $path
|
696 |
|
|
* Path of the node to be rendered into a printer-friendly page.
|
697 |
|
|
* @param string $format
|
698 |
|
|
* Format of the page being generated.
|
699 |
|
|
*
|
700 |
|
|
* @return object|bool
|
701 |
|
|
* filled node-like object to be used in the print template
|
702 |
85ad3d82
|
Assos Assos
|
*/
|
703 |
76bdcd04
|
Assos Assos
|
function _print_generate_path($path, $format) {
|
704 |
85ad3d82
|
Assos Assos
|
global $_print_urls;
|
705 |
|
|
|
706 |
76bdcd04
|
Assos Assos
|
// Handle node tabs, or cases where the 'node_router' option is enabled.
|
707 |
85ad3d82
|
Assos Assos
|
$parts = explode('/', $path);
|
708 |
76bdcd04
|
Assos Assos
|
if (ctype_digit($parts[0]) && ((count($parts) > 1) || variable_get('print_node_router', FALSE))) {
|
709 |
85ad3d82
|
Assos Assos
|
$path = 'node/' . $path;
|
710 |
|
|
}
|
711 |
|
|
|
712 |
|
|
$path = drupal_get_normal_path($path);
|
713 |
|
|
|
714 |
|
|
menu_set_active_item($path);
|
715 |
|
|
// Adapted from index.php.
|
716 |
|
|
$node = new stdClass();
|
717 |
76bdcd04
|
Assos Assos
|
$node->content = menu_execute_active_handler($path, FALSE);
|
718 |
|
|
if (is_array($node->content)) {
|
719 |
|
|
$node->content = drupal_render($node->content);
|
720 |
85ad3d82
|
Assos Assos
|
}
|
721 |
|
|
|
722 |
76bdcd04
|
Assos Assos
|
if (is_int($node->content)) {
|
723 |
|
|
switch ($node->content) {
|
724 |
85ad3d82
|
Assos Assos
|
case MENU_NOT_FOUND:
|
725 |
|
|
drupal_not_found();
|
726 |
76bdcd04
|
Assos Assos
|
drupal_exit();
|
727 |
85ad3d82
|
Assos Assos
|
break;
|
728 |
76bdcd04
|
Assos Assos
|
|
729 |
85ad3d82
|
Assos Assos
|
case MENU_ACCESS_DENIED:
|
730 |
|
|
drupal_access_denied();
|
731 |
76bdcd04
|
Assos Assos
|
drupal_exit();
|
732 |
85ad3d82
|
Assos Assos
|
break;
|
733 |
|
|
}
|
734 |
|
|
}
|
735 |
|
|
|
736 |
|
|
$node->title = drupal_get_title();
|
737 |
|
|
$node->path = $path;
|
738 |
76bdcd04
|
Assos Assos
|
$node->changed = REQUEST_TIME;
|
739 |
|
|
$node->type = '';
|
740 |
85ad3d82
|
Assos Assos
|
|
741 |
76bdcd04
|
Assos Assos
|
// Delete any links area.
|
742 |
|
|
$node->content = preg_replace('!\s*<div class="links">.*?</div>!sim', '', $node->content);
|
743 |
85ad3d82
|
Assos Assos
|
|
744 |
76bdcd04
|
Assos Assos
|
// Delete the contextual links also.
|
745 |
a2baadd1
|
Assos Assos
|
$node->content = preg_replace('!\s*<div class="contextual-links-wrapper">.*?</div>!sim', '', $node->content);
|
746 |
|
|
|
747 |
76bdcd04
|
Assos Assos
|
// Check URL list settings.
|
748 |
85ad3d82
|
Assos Assos
|
$_print_urls = _print_url_list_enabled($node, $format);
|
749 |
|
|
|
750 |
76bdcd04
|
Assos Assos
|
// Convert the a href elements.
|
751 |
85ad3d82
|
Assos Assos
|
$pattern = '!<(a\s[^>]*?)>(.*?)(</a>)!is';
|
752 |
76bdcd04
|
Assos Assos
|
$node->content = preg_replace_callback($pattern, '_print_rewrite_urls', $node->content);
|
753 |
85ad3d82
|
Assos Assos
|
|
754 |
76bdcd04
|
Assos Assos
|
return $node;
|
755 |
85ad3d82
|
Assos Assos
|
}
|
756 |
|
|
|
757 |
|
|
/**
|
758 |
76bdcd04
|
Assos Assos
|
* Prepare a Printer-friendly-ready node body for book pages.
|
759 |
|
|
*
|
760 |
|
|
* @param int $nid
|
761 |
|
|
* Node ID of the node to be rendered into a printer-friendly page.
|
762 |
|
|
* @param string $format
|
763 |
|
|
* Format of the page being generated.
|
764 |
|
|
*
|
765 |
|
|
* @return object|bool
|
766 |
|
|
* filled node-like object to be used in the print template
|
767 |
85ad3d82
|
Assos Assos
|
*/
|
768 |
76bdcd04
|
Assos Assos
|
function _print_generate_book($nid, $format) {
|
769 |
85ad3d82
|
Assos Assos
|
global $_print_urls;
|
770 |
|
|
|
771 |
|
|
$node = node_load($nid);
|
772 |
|
|
if (!$node) {
|
773 |
76bdcd04
|
Assos Assos
|
// Node not found.
|
774 |
85ad3d82
|
Assos Assos
|
drupal_not_found();
|
775 |
76bdcd04
|
Assos Assos
|
drupal_exit();
|
776 |
85ad3d82
|
Assos Assos
|
}
|
777 |
|
|
elseif (!node_access('view', $node) || (!user_access('access printer-friendly version'))) {
|
778 |
76bdcd04
|
Assos Assos
|
// Access is denied.
|
779 |
85ad3d82
|
Assos Assos
|
drupal_access_denied();
|
780 |
76bdcd04
|
Assos Assos
|
drupal_exit();
|
781 |
85ad3d82
|
Assos Assos
|
}
|
782 |
|
|
|
783 |
|
|
$tree = book_menu_subtree_data($node->book);
|
784 |
76bdcd04
|
Assos Assos
|
$node->content = book_export_traverse($tree, 'book_node_export');
|
785 |
85ad3d82
|
Assos Assos
|
|
786 |
76bdcd04
|
Assos Assos
|
// Check URL list settings.
|
787 |
85ad3d82
|
Assos Assos
|
$_print_urls = _print_url_list_enabled($node, $format);
|
788 |
|
|
|
789 |
76bdcd04
|
Assos Assos
|
// Convert the a href elements.
|
790 |
85ad3d82
|
Assos Assos
|
$pattern = '!<(a\s[^>]*?)>(.*?)(</a>)!is';
|
791 |
76bdcd04
|
Assos Assos
|
$node->content = preg_replace_callback($pattern, '_print_rewrite_urls', $node->content);
|
792 |
85ad3d82
|
Assos Assos
|
|
793 |
76bdcd04
|
Assos Assos
|
return $node;
|
794 |
85ad3d82
|
Assos Assos
|
} |