Commit 699fabfc authored by jcnventura's avatar jcnventura

Coder fixes

parent c5fbc6bf
......@@ -284,7 +284,7 @@ function _print_get_title($path) {
if (!empty($menu_item['title'])) {
return $menu_item['title'];
}
elseif (substr($menu_item['page_callback'], 0, 6) == 'views_') {
elseif (drupal_substr($menu_item['page_callback'], 0, 6) == 'views_') {
// It's a view, load the view to have access to the title
$view = views_get_view($menu_item['page_arguments']['0']);
return $view->get_title();
......
......@@ -156,7 +156,7 @@ function print_preprocess_print(&$variables) {
$logo_url = strip_tags(variable_get('print_logo_url', PRINT_LOGO_URL_DEFAULT));
break;
}
$logo_url = preg_replace('!^'. base_path() .'!', '', $logo_url);
$logo_url = preg_replace('!^' . base_path() . '!', '', $logo_url);
$variables['print_logo'] = $logo_url ? theme('image', array('path' => $logo_url, 'alt' => variable_get('site_name', 'Drupal'), 'attributes' => array('class' => 'print-logo', 'id' => 'logo'))) : NULL;
......
<?php
/**
* @file
* Printer-friendly version Views integration
*
* @ingroup print
*/
/**
* Implements hook_views_data().
*/
......
......@@ -89,7 +89,8 @@ function print_epub_controller() {
* @param string $path
* path of the page to convert to EPUB
* @param array $query
* (optional) array of key/value pairs as used in the url() function for the query
* (optional) array of key/value pairs as used in the url() function for the
* query
* @param int $cid
* (optional) comment ID of the comment to render.
* @param string $epub_filename
......
<?php
/**
* @file
* EPUB Version Views integration
*
* @ingroup print
*/
/**
* Implements hook_views_data().
*/
......
<?php
/**
* @file
* Custom Views integration join for the page counters
*
* @ingroup print
*/
class print_join_page_counter extends views_join {
// PHP 4 doesn't call constructors of the base class automatically from a
// constructor of a derived class. It is your responsibility to propagate
......
......@@ -62,7 +62,7 @@ function print_mail_form($form, &$form_state) {
* @ingroup forms
*/
function print_mail_form_for_path($form, &$form_state, $path, $query = NULL, $user = NULL) {
if($user === NULL) {
if ($user === NULL) {
global $user;
}
......@@ -87,10 +87,10 @@ function print_mail_form_for_path($form, &$form_state, $path, $query = NULL, $us
if ($print_mail_user_recipients_default) {
$options = array();
if (module_exists('realname')) {
$sql = "SELECT u.mail, r.realname AS name from {users} u LEFT JOIN {realname} r ON u.uid = r.uid WHERE u.uid != :uid ORDER BY name ASC";
$sql = "SELECT u.mail, r.realname AS name from {users} u LEFT JOIN {realname} r ON u.uid = r.uid WHERE u.uid <> :uid ORDER BY name ASC";
}
else {
$sql = "SELECT mail, name from {users} WHERE uid != :uid ORDER BY name ASC";
$sql = "SELECT mail, name from {users} WHERE uid <> :uid ORDER BY name ASC";
}
$recipients = db_query($sql, array(':uid' => drupal_anonymous_user()->uid));
foreach ($recipients as $recipient) {
......@@ -261,7 +261,7 @@ function theme_print_mail_form($variables) {
* @ingroup print_themeable
*/
function theme_print_mail_sendlink_plain($params) {
return $params['message'] .'\n\n'. $params['link'];
return $params['message'] . '\n\n' . $params['link'];
}
/**
......@@ -276,7 +276,7 @@ function theme_print_mail_sendlink_plain($params) {
* @ingroup print_themeable
*/
function theme_print_mail_sendlink_html($params) {
return $params['message'] .'<br/><br/>'. l($params['title'], $params['link']);
return $params['message'] . '<br/><br/>' . l($params['title'], $params['link']);
}
/**
......
<?php
/**
* @file
* Send by email Views integration
*
* @ingroup print
*/
/**
* Implements hook_views_data().
*/
......
......@@ -73,7 +73,7 @@ function print_pdf_wkhtmltopdf_print_pdf_generate($html, $meta, $paper_size = NU
return $pdf;
}
else {
drupal_set_message('Unable to generate PDF file.', 'error');
drupal_set_message(t('Unable to generate PDF file.'), 'error');
drupal_goto($meta['url']);
return NULL;
}
......
......@@ -201,8 +201,8 @@ function print_pdf_update_7202(&$sandbox) {
}
/**
* Add Size and Orientation fields for per content type Size and Orientation
*/
* Add Size and Orientation fields for per content type Size and Orientation
*/
function print_pdf_update_7203(&$sandbox) {
$spec = array(
'type' => 'varchar',
......
......@@ -83,7 +83,7 @@ function print_pdf_init() {
}
/**
* Implements hook_flush_caches()
* Implements hook_flush_caches().
*/
function print_pdf_flush_caches() {
print_pdf_cache_delete();
......@@ -429,7 +429,7 @@ function print_pdf_cache_clean() {
foreach ($files as $file) {
// For all files in the cache directory, see when they were last accessed
$result = db_query("SELECT timestamp FROM {print_pdf_page_counter} WHERE path = :path", array(':path' => 'node/' . $file->name))
->fetchField();
->fetchField();
// Keep the file only if the last access was within the cache max life value
if (($result === FALSE) || ($result + $lifetime < REQUEST_TIME)) {
......
......@@ -89,7 +89,8 @@ function print_pdf_controller() {
* @param string $path
* path of the page to convert to PDF
* @param array $query
* (optional) array of key/value pairs as used in the url() function for the query
* (optional) array of key/value pairs as used in the url() function for the
* query
* @param int $cid
* (optional) comment ID of the comment to render.
* @param string $pdf_filename
......
<?php
/**
* @file
* PDF Version Views integration
*
* @ingroup print
*/
/**
* Implements hook_views_data().
*/
......
......@@ -386,7 +386,7 @@ function print_ui_form_alter(&$form, &$form_state, $form_id) {
$form['print']['print_' . $link['format']] = array(
'#type' => 'fieldset',
'#title' => $link['text'],
'#title' => check_plain($link['text']),
'#collapsible' => TRUE,
);
......
......@@ -99,7 +99,7 @@ class PrintBasicTest extends DrupalWebTestCase {
$url[10] = '';
$rel_url[10] = '';
$abs_url[10] = $base_url .'/'. $this->getq;
$abs_url[10] = $base_url . '/' . $this->getq;
$size = count($url);
for ($i = 0; $i < $size; $i++) {
......
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