@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | { |
108 | 108 | $x23 = false; |
109 | 109 | $xv = str_replace('XOOPS ', '', XOOPS_VERSION); |
110 | - if ((int)substr($xv, 2, 1) >= 3) { |
|
110 | + if ((int) substr($xv, 2, 1) >= 3) { |
|
111 | 111 | $x23 = true; |
112 | 112 | } |
113 | 113 | |
@@ -147,15 +147,15 @@ discard block |
||
147 | 147 | // Only for Xoops 2.0.x |
148 | 148 | switch ($editor_option) { |
149 | 149 | case 'fckeditor': |
150 | - if (is_readable(XOOPS_ROOT_PATH . '/class/fckeditor/formfckeditor.php')) { |
|
151 | - require_once(XOOPS_ROOT_PATH . '/class/fckeditor/formfckeditor.php'); |
|
150 | + if (is_readable(XOOPS_ROOT_PATH.'/class/fckeditor/formfckeditor.php')) { |
|
151 | + require_once(XOOPS_ROOT_PATH.'/class/fckeditor/formfckeditor.php'); |
|
152 | 152 | $editor = new XoopsFormFckeditor($caption, $name, $value); |
153 | 153 | } |
154 | 154 | break; |
155 | 155 | |
156 | 156 | case 'htmlarea': |
157 | - if (is_readable(XOOPS_ROOT_PATH . '/class/htmlarea/formhtmlarea.php')) { |
|
158 | - require_once(XOOPS_ROOT_PATH . '/class/htmlarea/formhtmlarea.php'); |
|
157 | + if (is_readable(XOOPS_ROOT_PATH.'/class/htmlarea/formhtmlarea.php')) { |
|
158 | + require_once(XOOPS_ROOT_PATH.'/class/htmlarea/formhtmlarea.php'); |
|
159 | 159 | $editor = new XoopsFormHtmlarea($caption, $name, $value); |
160 | 160 | } |
161 | 161 | break; |
@@ -170,15 +170,15 @@ discard block |
||
170 | 170 | |
171 | 171 | case 'tinyeditor': |
172 | 172 | case 'tinymce': |
173 | - if (is_readable(XOOPS_ROOT_PATH . '/class/xoopseditor/tinyeditor/formtinyeditortextarea.php')) { |
|
174 | - require_once XOOPS_ROOT_PATH . '/class/xoopseditor/tinyeditor/formtinyeditortextarea.php'; |
|
173 | + if (is_readable(XOOPS_ROOT_PATH.'/class/xoopseditor/tinyeditor/formtinyeditortextarea.php')) { |
|
174 | + require_once XOOPS_ROOT_PATH.'/class/xoopseditor/tinyeditor/formtinyeditortextarea.php'; |
|
175 | 175 | $editor = new XoopsFormTinyeditorTextArea(array('caption' => $caption, 'name' => $name, 'value' => $value, 'width' => '100%', 'height' => '400px')); |
176 | 176 | } |
177 | 177 | break; |
178 | 178 | |
179 | 179 | case 'koivi': |
180 | - if (is_readable(XOOPS_ROOT_PATH . '/class/wysiwyg/formwysiwygtextarea.php')) { |
|
181 | - require_once(XOOPS_ROOT_PATH . '/class/wysiwyg/formwysiwygtextarea.php'); |
|
180 | + if (is_readable(XOOPS_ROOT_PATH.'/class/wysiwyg/formwysiwygtextarea.php')) { |
|
181 | + require_once(XOOPS_ROOT_PATH.'/class/wysiwyg/formwysiwygtextarea.php'); |
|
182 | 182 | $editor = new XoopsFormWysiwygTextArea($caption, $name, $value, $width, $height, ''); |
183 | 183 | } |
184 | 184 | break; |
@@ -200,9 +200,9 @@ discard block |
||
200 | 200 | public static function javascriptLinkConfirm($message, $form = false) |
201 | 201 | { |
202 | 202 | if (!$form) { |
203 | - return "onclick=\"javascript:return confirm('" . str_replace("'", ' ', $message) . "')\""; |
|
203 | + return "onclick=\"javascript:return confirm('".str_replace("'", ' ', $message)."')\""; |
|
204 | 204 | } else { |
205 | - return "onSubmit=\"javascript:return confirm('" . str_replace("'", ' ', $message) . "')\""; |
|
205 | + return "onSubmit=\"javascript:return confirm('".str_replace("'", ' ', $message)."')\""; |
|
206 | 206 | } |
207 | 207 | } |
208 | 208 | |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | public static function sendEmailFromTpl($tplName, $recipients, $subject, $variables) |
283 | 283 | { |
284 | 284 | global $xoopsConfig; |
285 | - require_once XOOPS_ROOT_PATH . '/class/xoopsmailer.php'; |
|
285 | + require_once XOOPS_ROOT_PATH.'/class/xoopsmailer.php'; |
|
286 | 286 | if (!is_array($recipients)) { |
287 | 287 | if (trim($recipients) == '') { |
288 | 288 | return false; |
@@ -295,11 +295,11 @@ discard block |
||
295 | 295 | if (function_exists('xoops_getMailer')) { |
296 | 296 | $xoopsMailer = xoops_getMailer(); |
297 | 297 | } else { |
298 | - $xoopsMailer =& getMailer(); |
|
298 | + $xoopsMailer = & getMailer(); |
|
299 | 299 | } |
300 | 300 | |
301 | 301 | $xoopsMailer->useMail(); |
302 | - $xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH . '/modules/' . self::MODULE_NAME . '/language/' . $xoopsConfig['language'] . '/mail_template'); |
|
302 | + $xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH.'/modules/'.self::MODULE_NAME.'/language/'.$xoopsConfig['language'].'/mail_template'); |
|
303 | 303 | $xoopsMailer->setTemplate($tplName); |
304 | 304 | $xoopsMailer->setToEmails($recipients); |
305 | 305 | // TODO: Change ! |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | } |
312 | 312 | $res = $xoopsMailer->send(); |
313 | 313 | unset($xoopsMailer); |
314 | - $filename = XOOPS_UPLOAD_PATH . '/logmail_' . self::MODULE_NAME . '.php'; |
|
314 | + $filename = XOOPS_UPLOAD_PATH.'/logmail_'.self::MODULE_NAME.'.php'; |
|
315 | 315 | if (!file_exists($filename)) { |
316 | 316 | $fp = @fopen($filename, 'a'); |
317 | 317 | if ($fp) { |
@@ -322,16 +322,16 @@ discard block |
||
322 | 322 | $fp = @fopen($filename, 'a'); |
323 | 323 | |
324 | 324 | if ($fp) { |
325 | - fwrite($fp, str_repeat('-', 120) . "\n"); |
|
326 | - fwrite($fp, date('d/m/Y H:i:s') . "\n"); |
|
327 | - fwrite($fp, 'Template name : ' . $tplName . "\n"); |
|
328 | - fwrite($fp, 'Email subject : ' . $subject . "\n"); |
|
325 | + fwrite($fp, str_repeat('-', 120)."\n"); |
|
326 | + fwrite($fp, date('d/m/Y H:i:s')."\n"); |
|
327 | + fwrite($fp, 'Template name : '.$tplName."\n"); |
|
328 | + fwrite($fp, 'Email subject : '.$subject."\n"); |
|
329 | 329 | if (is_array($recipients)) { |
330 | - fwrite($fp, 'Recipient(s) : ' . implode(',', $recipients) . "\n"); |
|
330 | + fwrite($fp, 'Recipient(s) : '.implode(',', $recipients)."\n"); |
|
331 | 331 | } else { |
332 | - fwrite($fp, 'Recipient(s) : ' . $recipients . "\n"); |
|
332 | + fwrite($fp, 'Recipient(s) : '.$recipients."\n"); |
|
333 | 333 | } |
334 | - fwrite($fp, 'Transmited variables : ' . implode(',', $variables) . "\n"); |
|
334 | + fwrite($fp, 'Transmited variables : '.implode(',', $variables)."\n"); |
|
335 | 335 | fclose($fp); |
336 | 336 | } |
337 | 337 | |
@@ -346,17 +346,17 @@ discard block |
||
346 | 346 | global $xoopsModule; |
347 | 347 | $folder = $xoopsModule->getVar('dirname'); |
348 | 348 | $tpllist = array(); |
349 | - require_once XOOPS_ROOT_PATH . '/class/xoopsblock.php'; |
|
350 | - require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
349 | + require_once XOOPS_ROOT_PATH.'/class/xoopsblock.php'; |
|
350 | + require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
351 | 351 | $tplfile_handler = xoops_getHandler('tplfile'); |
352 | 352 | $tpllist = $tplfile_handler->find(null, null, null, $folder); |
353 | - xoops_template_clear_module_cache($xoopsModule->getVar('mid')); // Clear module's blocks cache |
|
353 | + xoops_template_clear_module_cache($xoopsModule->getVar('mid')); // Clear module's blocks cache |
|
354 | 354 | |
355 | 355 | foreach ($tpllist as $onetemplate) { // Remove cache for each page. |
356 | 356 | if ($onetemplate->getVar('tpl_type') === 'module') { |
357 | 357 | // Note, I've been testing all the other methods (like the one of Smarty) and none of them run, that's why I have used this code |
358 | 358 | $files_del = array(); |
359 | - $files_del = glob(XOOPS_CACHE_PATH . '/*' . $onetemplate->getVar('tpl_file') . '*'); |
|
359 | + $files_del = glob(XOOPS_CACHE_PATH.'/*'.$onetemplate->getVar('tpl_file').'*'); |
|
360 | 360 | if (count($files_del) > 0 && is_array($files_del)) { |
361 | 361 | foreach ($files_del as $one_file) { |
362 | 362 | if (is_file($one_file)) { |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | if (!isset($mymodule)) { |
393 | 393 | global $xoopsModule; |
394 | 394 | if (isset($xoopsModule) && is_object($xoopsModule) && $xoopsModule->getVar('dirname') == REFERENCES_DIRNAME) { |
395 | - $mymodule =& $xoopsModule; |
|
395 | + $mymodule = & $xoopsModule; |
|
396 | 396 | } else { |
397 | 397 | $hModule = xoops_getHandler('module'); |
398 | 398 | $mymodule = $hModule->getByDirname(REFERENCES_DIRNAME); |
@@ -510,12 +510,12 @@ discard block |
||
510 | 510 | */ |
511 | 511 | public static function getCurrentSQLDate() |
512 | 512 | { |
513 | - return date('Y-m-d'); // 2007-05-02 |
|
513 | + return date('Y-m-d'); // 2007-05-02 |
|
514 | 514 | } |
515 | 515 | |
516 | 516 | public static function getCurrentSQLDateTime() |
517 | 517 | { |
518 | - return date('Y-m-d H:i:s'); // 2007-05-02 |
|
518 | + return date('Y-m-d H:i:s'); // 2007-05-02 |
|
519 | 519 | } |
520 | 520 | |
521 | 521 | /** |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | */ |
543 | 543 | public static function timestampToMysqlDate($timestamp) |
544 | 544 | { |
545 | - return date('Y-m-d', (int)$timestamp); |
|
545 | + return date('Y-m-d', (int) $timestamp); |
|
546 | 546 | } |
547 | 547 | |
548 | 548 | /** |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | } |
581 | 581 | if (strpos(strtolower(XOOPS_VERSION), 'legacy') === false) { |
582 | 582 | $xv = xoops_trim(str_replace('XOOPS ', '', XOOPS_VERSION)); |
583 | - if ((int)substr($xv, 4, 2) >= 17) { |
|
583 | + if ((int) substr($xv, 4, 2) >= 17) { |
|
584 | 584 | return false; |
585 | 585 | } |
586 | 586 | } |
@@ -643,25 +643,25 @@ discard block |
||
643 | 643 | } |
644 | 644 | $ext = basename($fileName); |
645 | 645 | $ext = explode('.', $ext); |
646 | - $ext = '.' . $ext[count($ext) - 1]; |
|
646 | + $ext = '.'.$ext[count($ext) - 1]; |
|
647 | 647 | $true = true; |
648 | 648 | while ($true) { |
649 | 649 | $ipbits = explode('.', $_SERVER['REMOTE_ADDR']); |
650 | 650 | list($usec, $sec) = explode(' ', microtime()); |
651 | - $usec = (integer)($usec * 65536); |
|
652 | - $sec = ((integer)$sec) & 0xFFFF; |
|
651 | + $usec = (integer) ($usec * 65536); |
|
652 | + $sec = ((integer) $sec)&0xFFFF; |
|
653 | 653 | |
654 | 654 | if ($trimName) { |
655 | - $uid = sprintf('%06x%04x%04x', ($ipbits[0] << 24) | ($ipbits[1] << 16) | ($ipbits[2] << 8) | $ipbits[3], $sec, $usec); |
|
655 | + $uid = sprintf('%06x%04x%04x', ($ipbits[0] << 24)|($ipbits[1] << 16)|($ipbits[2] << 8)|$ipbits[3], $sec, $usec); |
|
656 | 656 | } else { |
657 | - $uid = sprintf('%08x-%04x-%04x', ($ipbits[0] << 24) | ($ipbits[1] << 16) | ($ipbits[2] << 8) | $ipbits[3], $sec, $usec); |
|
657 | + $uid = sprintf('%08x-%04x-%04x', ($ipbits[0] << 24)|($ipbits[1] << 16)|($ipbits[2] << 8)|$ipbits[3], $sec, $usec); |
|
658 | 658 | } |
659 | - if (!file_exists($workingfolder . $uid . $ext)) { |
|
659 | + if (!file_exists($workingfolder.$uid.$ext)) { |
|
660 | 660 | $true = false; |
661 | 661 | } |
662 | 662 | } |
663 | 663 | |
664 | - return $uid . $ext; |
|
664 | + return $uid.$ext; |
|
665 | 665 | } |
666 | 666 | |
667 | 667 | /** |
@@ -676,135 +676,135 @@ discard block |
||
676 | 676 | $chaine = html_entity_decode($chaine); |
677 | 677 | |
678 | 678 | for ($i = 0; $i <= 255; ++$i) { |
679 | - $search[] = '&#' . $i . ';'; |
|
679 | + $search[] = '&#'.$i.';'; |
|
680 | 680 | $replace[] = chr($i); |
681 | 681 | } |
682 | - $replace[]='...'; $search[]='…'; |
|
683 | - $replace[]="'"; $search[]='‘'; |
|
684 | - $replace[]="'"; $search[]= '’'; |
|
685 | - $replace[]='-'; $search[] = '•'; // $replace[] = '•'; |
|
686 | - $replace[]='—'; $search[]='—'; |
|
687 | - $replace[]='-'; $search[]='–'; |
|
688 | - $replace[]='-'; $search[]='­'; |
|
689 | - $replace[]='"'; $search[]='"'; |
|
690 | - $replace[]='&'; $search[]='&'; |
|
691 | - $replace[]='ˆ'; $search[]='ˆ'; |
|
692 | - $replace[]='¡'; $search[]='¡'; |
|
693 | - $replace[]='¦'; $search[]='¦'; |
|
694 | - $replace[]='¨'; $search[]='¨'; |
|
695 | - $replace[]='¯'; $search[]='¯'; |
|
696 | - $replace[]='´'; $search[]='´'; |
|
697 | - $replace[]='¸'; $search[]='¸'; |
|
698 | - $replace[]='¿'; $search[]='¿'; |
|
699 | - $replace[]='˜'; $search[]='˜'; |
|
700 | - $replace[]="'"; $search[]='‘'; // $replace[]='‘'; |
|
701 | - $replace[]="'"; $search[]='’'; // $replace[]='’'; |
|
702 | - $replace[]='‚'; $search[]='‚'; |
|
703 | - $replace[]="'"; $search[]='“'; // $replace[]='“'; |
|
704 | - $replace[]="'"; $search[]='”'; // $replace[]='”'; |
|
705 | - $replace[]='„'; $search[]='„'; |
|
706 | - $replace[]='‹'; $search[]='‹'; |
|
707 | - $replace[]='›'; $search[]='›'; |
|
708 | - $replace[]='<'; $search[]='<'; |
|
709 | - $replace[]='>'; $search[]='>'; |
|
710 | - $replace[]='±'; $search[]='±'; |
|
711 | - $replace[]='«'; $search[]='«'; |
|
712 | - $replace[]='»'; $search[]='»'; |
|
713 | - $replace[]='×'; $search[]='×'; |
|
714 | - $replace[]='÷'; $search[]='÷'; |
|
715 | - $replace[]='¢'; $search[]='¢'; |
|
716 | - $replace[]='£'; $search[]='£'; |
|
717 | - $replace[]='¤'; $search[]='¤'; |
|
718 | - $replace[]='¥'; $search[]='¥'; |
|
719 | - $replace[]='§'; $search[]='§'; |
|
720 | - $replace[]='©'; $search[]='©'; |
|
721 | - $replace[]='¬'; $search[]='¬'; |
|
722 | - $replace[]='®'; $search[]='®'; |
|
723 | - $replace[]='°'; $search[]='°'; |
|
724 | - $replace[]='µ'; $search[]='µ'; |
|
725 | - $replace[]='¶'; $search[]='¶'; |
|
726 | - $replace[]='·'; $search[]='·'; |
|
727 | - $replace[]='†'; $search[]='†'; |
|
728 | - $replace[]='‡'; $search[]='‡'; |
|
729 | - $replace[]='‰'; $search[]='‰'; |
|
730 | - $replace[]='Euro'; $search[]='€'; // $replace[]='€' |
|
731 | - $replace[]='¼'; $search[]='¼'; |
|
732 | - $replace[]='½'; $search[]='½'; |
|
733 | - $replace[]='¾'; $search[]='¾'; |
|
734 | - $replace[]='¹'; $search[]='¹'; |
|
735 | - $replace[]='²'; $search[]='²'; |
|
736 | - $replace[]='³'; $search[]='³'; |
|
737 | - $replace[]='á'; $search[]='á'; |
|
738 | - $replace[]='Á'; $search[]='Á'; |
|
739 | - $replace[]='â'; $search[]='â'; |
|
740 | - $replace[]='Â'; $search[]='Â'; |
|
741 | - $replace[]='à'; $search[]='à'; |
|
742 | - $replace[]='À'; $search[]='À'; |
|
743 | - $replace[]='å'; $search[]='å'; |
|
744 | - $replace[]='Å'; $search[]='Å'; |
|
745 | - $replace[]='ã'; $search[]='ã'; |
|
746 | - $replace[]='Ã'; $search[]='Ã'; |
|
747 | - $replace[]='ä'; $search[]='ä'; |
|
748 | - $replace[]='Ä'; $search[]='Ä'; |
|
749 | - $replace[]='ª'; $search[]='ª'; |
|
750 | - $replace[]='æ'; $search[]='æ'; |
|
751 | - $replace[]='Æ'; $search[]='Æ'; |
|
752 | - $replace[]='ç'; $search[]='ç'; |
|
753 | - $replace[]='Ç'; $search[]='Ç'; |
|
754 | - $replace[]='ð'; $search[]='ð'; |
|
755 | - $replace[]='Ð'; $search[]='Ð'; |
|
756 | - $replace[]='é'; $search[]='é'; |
|
757 | - $replace[]='É'; $search[]='É'; |
|
758 | - $replace[]='ê'; $search[]='ê'; |
|
759 | - $replace[]='Ê'; $search[]='Ê'; |
|
760 | - $replace[]='è'; $search[]='è'; |
|
761 | - $replace[]='È'; $search[]='È'; |
|
762 | - $replace[]='ë'; $search[]='ë'; |
|
763 | - $replace[]='Ë'; $search[]='Ë'; |
|
764 | - $replace[]='ƒ'; $search[]='ƒ'; |
|
765 | - $replace[]='í'; $search[]='í'; |
|
766 | - $replace[]='Í'; $search[]='Í'; |
|
767 | - $replace[]='î'; $search[]='î'; |
|
768 | - $replace[]='Î'; $search[]='Î'; |
|
769 | - $replace[]='ì'; $search[]='ì'; |
|
770 | - $replace[]='Ì'; $search[]='Ì'; |
|
771 | - $replace[]='ï'; $search[]='ï'; |
|
772 | - $replace[]='Ï'; $search[]='Ï'; |
|
773 | - $replace[]='ñ'; $search[]='ñ'; |
|
774 | - $replace[]='Ñ'; $search[]='Ñ'; |
|
775 | - $replace[]='ó'; $search[]='ó'; |
|
776 | - $replace[]='Ó'; $search[]='Ó'; |
|
777 | - $replace[]='ô'; $search[]='ô'; |
|
778 | - $replace[]='Ô'; $search[]='Ô'; |
|
779 | - $replace[]='ò'; $search[]='ò'; |
|
780 | - $replace[]='Ò'; $search[]='Ò'; |
|
781 | - $replace[]='º'; $search[]='º'; |
|
782 | - $replace[]='ø'; $search[]='ø'; |
|
783 | - $replace[]='Ø'; $search[]='Ø'; |
|
784 | - $replace[]='õ'; $search[]='õ'; |
|
785 | - $replace[]='Õ'; $search[]='Õ'; |
|
786 | - $replace[]='ö'; $search[]='ö'; |
|
787 | - $replace[]='Ö'; $search[]='Ö'; |
|
788 | - $replace[]='œ'; $search[]='œ'; |
|
789 | - $replace[]='Œ'; $search[]='Œ'; |
|
790 | - $replace[]='š'; $search[]='š'; |
|
791 | - $replace[]='Š'; $search[]='Š'; |
|
792 | - $replace[]='ß'; $search[]='ß'; |
|
793 | - $replace[]='þ'; $search[]='þ'; |
|
794 | - $replace[]='Þ'; $search[]='Þ'; |
|
795 | - $replace[]='ú'; $search[]='ú'; |
|
796 | - $replace[]='Ú'; $search[]='Ú'; |
|
797 | - $replace[]='û'; $search[]='û'; |
|
798 | - $replace[]='Û'; $search[]='Û'; |
|
799 | - $replace[]='ù'; $search[]='ù'; |
|
800 | - $replace[]='Ù'; $search[]='Ù'; |
|
801 | - $replace[]='ü'; $search[]='ü'; |
|
802 | - $replace[]='Ü'; $search[]='Ü'; |
|
803 | - $replace[]='ý'; $search[]='ý'; |
|
804 | - $replace[]='Ý'; $search[]='Ý'; |
|
805 | - $replace[]='ÿ'; $search[]='ÿ'; |
|
806 | - $replace[]='Ÿ'; $search[]='Ÿ'; |
|
807 | - $chaine = str_replace($search, $replace, $chaine); |
|
682 | + $replace[] = '...'; $search[] = '…'; |
|
683 | + $replace[] = "'"; $search[] = '‘'; |
|
684 | + $replace[] = "'"; $search[] = '’'; |
|
685 | + $replace[] = '-'; $search[] = '•'; // $replace[] = '•'; |
|
686 | + $replace[] = '—'; $search[] = '—'; |
|
687 | + $replace[] = '-'; $search[] = '–'; |
|
688 | + $replace[] = '-'; $search[] = '­'; |
|
689 | + $replace[] = '"'; $search[] = '"'; |
|
690 | + $replace[] = '&'; $search[] = '&'; |
|
691 | + $replace[] = 'ˆ'; $search[] = 'ˆ'; |
|
692 | + $replace[] = '¡'; $search[] = '¡'; |
|
693 | + $replace[] = '¦'; $search[] = '¦'; |
|
694 | + $replace[] = '¨'; $search[] = '¨'; |
|
695 | + $replace[] = '¯'; $search[] = '¯'; |
|
696 | + $replace[] = '´'; $search[] = '´'; |
|
697 | + $replace[] = '¸'; $search[] = '¸'; |
|
698 | + $replace[] = '¿'; $search[] = '¿'; |
|
699 | + $replace[] = '˜'; $search[] = '˜'; |
|
700 | + $replace[] = "'"; $search[] = '‘'; // $replace[]='‘'; |
|
701 | + $replace[] = "'"; $search[] = '’'; // $replace[]='’'; |
|
702 | + $replace[] = '‚'; $search[] = '‚'; |
|
703 | + $replace[] = "'"; $search[] = '“'; // $replace[]='“'; |
|
704 | + $replace[] = "'"; $search[] = '”'; // $replace[]='”'; |
|
705 | + $replace[] = '„'; $search[] = '„'; |
|
706 | + $replace[] = '‹'; $search[] = '‹'; |
|
707 | + $replace[] = '›'; $search[] = '›'; |
|
708 | + $replace[] = '<'; $search[] = '<'; |
|
709 | + $replace[] = '>'; $search[] = '>'; |
|
710 | + $replace[] = '±'; $search[] = '±'; |
|
711 | + $replace[] = '«'; $search[] = '«'; |
|
712 | + $replace[] = '»'; $search[] = '»'; |
|
713 | + $replace[] = '×'; $search[] = '×'; |
|
714 | + $replace[] = '÷'; $search[] = '÷'; |
|
715 | + $replace[] = '¢'; $search[] = '¢'; |
|
716 | + $replace[] = '£'; $search[] = '£'; |
|
717 | + $replace[] = '¤'; $search[] = '¤'; |
|
718 | + $replace[] = '¥'; $search[] = '¥'; |
|
719 | + $replace[] = '§'; $search[] = '§'; |
|
720 | + $replace[] = '©'; $search[] = '©'; |
|
721 | + $replace[] = '¬'; $search[] = '¬'; |
|
722 | + $replace[] = '®'; $search[] = '®'; |
|
723 | + $replace[] = '°'; $search[] = '°'; |
|
724 | + $replace[] = 'µ'; $search[] = 'µ'; |
|
725 | + $replace[] = '¶'; $search[] = '¶'; |
|
726 | + $replace[] = '·'; $search[] = '·'; |
|
727 | + $replace[] = '†'; $search[] = '†'; |
|
728 | + $replace[] = '‡'; $search[] = '‡'; |
|
729 | + $replace[] = '‰'; $search[] = '‰'; |
|
730 | + $replace[] = 'Euro'; $search[] = '€'; // $replace[]='€' |
|
731 | + $replace[] = '¼'; $search[] = '¼'; |
|
732 | + $replace[] = '½'; $search[] = '½'; |
|
733 | + $replace[] = '¾'; $search[] = '¾'; |
|
734 | + $replace[] = '¹'; $search[] = '¹'; |
|
735 | + $replace[] = '²'; $search[] = '²'; |
|
736 | + $replace[] = '³'; $search[] = '³'; |
|
737 | + $replace[] = 'á'; $search[] = 'á'; |
|
738 | + $replace[] = 'Á'; $search[] = 'Á'; |
|
739 | + $replace[] = 'â'; $search[] = 'â'; |
|
740 | + $replace[] = 'Â'; $search[] = 'Â'; |
|
741 | + $replace[] = 'à'; $search[] = 'à'; |
|
742 | + $replace[] = 'À'; $search[] = 'À'; |
|
743 | + $replace[] = 'å'; $search[] = 'å'; |
|
744 | + $replace[] = 'Å'; $search[] = 'Å'; |
|
745 | + $replace[] = 'ã'; $search[] = 'ã'; |
|
746 | + $replace[] = 'Ã'; $search[] = 'Ã'; |
|
747 | + $replace[] = 'ä'; $search[] = 'ä'; |
|
748 | + $replace[] = 'Ä'; $search[] = 'Ä'; |
|
749 | + $replace[] = 'ª'; $search[] = 'ª'; |
|
750 | + $replace[] = 'æ'; $search[] = 'æ'; |
|
751 | + $replace[] = 'Æ'; $search[] = 'Æ'; |
|
752 | + $replace[] = 'ç'; $search[] = 'ç'; |
|
753 | + $replace[] = 'Ç'; $search[] = 'Ç'; |
|
754 | + $replace[] = 'ð'; $search[] = 'ð'; |
|
755 | + $replace[] = 'Ð'; $search[] = 'Ð'; |
|
756 | + $replace[] = 'é'; $search[] = 'é'; |
|
757 | + $replace[] = 'É'; $search[] = 'É'; |
|
758 | + $replace[] = 'ê'; $search[] = 'ê'; |
|
759 | + $replace[] = 'Ê'; $search[] = 'Ê'; |
|
760 | + $replace[] = 'è'; $search[] = 'è'; |
|
761 | + $replace[] = 'È'; $search[] = 'È'; |
|
762 | + $replace[] = 'ë'; $search[] = 'ë'; |
|
763 | + $replace[] = 'Ë'; $search[] = 'Ë'; |
|
764 | + $replace[] = 'ƒ'; $search[] = 'ƒ'; |
|
765 | + $replace[] = 'í'; $search[] = 'í'; |
|
766 | + $replace[] = 'Í'; $search[] = 'Í'; |
|
767 | + $replace[] = 'î'; $search[] = 'î'; |
|
768 | + $replace[] = 'Î'; $search[] = 'Î'; |
|
769 | + $replace[] = 'ì'; $search[] = 'ì'; |
|
770 | + $replace[] = 'Ì'; $search[] = 'Ì'; |
|
771 | + $replace[] = 'ï'; $search[] = 'ï'; |
|
772 | + $replace[] = 'Ï'; $search[] = 'Ï'; |
|
773 | + $replace[] = 'ñ'; $search[] = 'ñ'; |
|
774 | + $replace[] = 'Ñ'; $search[] = 'Ñ'; |
|
775 | + $replace[] = 'ó'; $search[] = 'ó'; |
|
776 | + $replace[] = 'Ó'; $search[] = 'Ó'; |
|
777 | + $replace[] = 'ô'; $search[] = 'ô'; |
|
778 | + $replace[] = 'Ô'; $search[] = 'Ô'; |
|
779 | + $replace[] = 'ò'; $search[] = 'ò'; |
|
780 | + $replace[] = 'Ò'; $search[] = 'Ò'; |
|
781 | + $replace[] = 'º'; $search[] = 'º'; |
|
782 | + $replace[] = 'ø'; $search[] = 'ø'; |
|
783 | + $replace[] = 'Ø'; $search[] = 'Ø'; |
|
784 | + $replace[] = 'õ'; $search[] = 'õ'; |
|
785 | + $replace[] = 'Õ'; $search[] = 'Õ'; |
|
786 | + $replace[] = 'ö'; $search[] = 'ö'; |
|
787 | + $replace[] = 'Ö'; $search[] = 'Ö'; |
|
788 | + $replace[] = 'œ'; $search[] = 'œ'; |
|
789 | + $replace[] = 'Œ'; $search[] = 'Œ'; |
|
790 | + $replace[] = 'š'; $search[] = 'š'; |
|
791 | + $replace[] = 'Š'; $search[] = 'Š'; |
|
792 | + $replace[] = 'ß'; $search[] = 'ß'; |
|
793 | + $replace[] = 'þ'; $search[] = 'þ'; |
|
794 | + $replace[] = 'Þ'; $search[] = 'Þ'; |
|
795 | + $replace[] = 'ú'; $search[] = 'ú'; |
|
796 | + $replace[] = 'Ú'; $search[] = 'Ú'; |
|
797 | + $replace[] = 'û'; $search[] = 'û'; |
|
798 | + $replace[] = 'Û'; $search[] = 'Û'; |
|
799 | + $replace[] = 'ù'; $search[] = 'ù'; |
|
800 | + $replace[] = 'Ù'; $search[] = 'Ù'; |
|
801 | + $replace[] = 'ü'; $search[] = 'ü'; |
|
802 | + $replace[] = 'Ü'; $search[] = 'Ü'; |
|
803 | + $replace[] = 'ý'; $search[] = 'ý'; |
|
804 | + $replace[] = 'Ý'; $search[] = 'Ý'; |
|
805 | + $replace[] = 'ÿ'; $search[] = 'ÿ'; |
|
806 | + $replace[] = 'Ÿ'; $search[] = 'Ÿ'; |
|
807 | + $chaine = str_replace($search, $replace, $chaine); |
|
808 | 808 | |
809 | 809 | return $chaine; |
810 | 810 | } |
@@ -821,11 +821,11 @@ discard block |
||
821 | 821 | { |
822 | 822 | $s = "ÀÁÂÃÄÅÒÓÔÕÖØÈÉÊËÇÌÍÎÏÙÚÛÜŸÑàáâãäåòóôõöøèéêëçìíîïùúûüÿñ '()"; |
823 | 823 | $r = 'AAAAAAOOOOOOEEEECIIIIUUUUYNaaaaaaooooooeeeeciiiiuuuuyn----'; |
824 | - $content = self::unhtml($content); // First, remove html entities |
|
824 | + $content = self::unhtml($content); // First, remove html entities |
|
825 | 825 | $content = strtr($content, $s, $r); |
826 | 826 | $content = strip_tags($content); |
827 | 827 | $content = strtolower($content); |
828 | - $content = htmlentities($content); // TODO: Vérifier |
|
828 | + $content = htmlentities($content); // TODO: Vérifier |
|
829 | 829 | $content = preg_replace('/&([a-zA-Z])(uml|acute|grave|circ|tilde);/', '$1', $content); |
830 | 830 | $content = html_entity_decode($content); |
831 | 831 | $content = eregi_replace('quot', ' ', $content); |
@@ -840,7 +840,7 @@ discard block |
||
840 | 840 | $keywords = ''; |
841 | 841 | foreach ($words as $word) { |
842 | 842 | if (strlen($word) >= $urw) { |
843 | - $keywords .= '-' . trim($word); |
|
843 | + $keywords .= '-'.trim($word); |
|
844 | 844 | } |
845 | 845 | } |
846 | 846 | if (!$keywords) { |
@@ -875,7 +875,7 @@ discard block |
||
875 | 875 | $limit = $_SESSION['references_keywords_limit']; |
876 | 876 | } else { |
877 | 877 | $config_handler = xoops_getHandler('config'); |
878 | - $xoopsConfigSearch =& $config_handler->getConfigsByCat(XOOPS_CONF_SEARCH); |
|
878 | + $xoopsConfigSearch = & $config_handler->getConfigsByCat(XOOPS_CONF_SEARCH); |
|
879 | 879 | $limit = $xoopsConfigSearch['keyword_min']; |
880 | 880 | $_SESSION['references_keywords_limit'] = $limit; |
881 | 881 | } |
@@ -923,7 +923,7 @@ discard block |
||
923 | 923 | if (!isset($config_handler) || !is_object($config_handler)) { |
924 | 924 | $config_handler = xoops_getHandler('config'); |
925 | 925 | } |
926 | - $xoopsConfigMetaFooter =& $config_handler->getConfigsByCat(XOOPS_CONF_METAFOOTER); |
|
926 | + $xoopsConfigMetaFooter = & $config_handler->getConfigsByCat(XOOPS_CONF_METAFOOTER); |
|
927 | 927 | if (isset($xoopsConfigMetaFooter['meta_keywords'])) { |
928 | 928 | return $xoopsConfigMetaFooter['meta_keywords']; |
929 | 929 | } else { |
@@ -945,10 +945,10 @@ discard block |
||
945 | 945 | */ |
946 | 946 | public static function uploadFile($indice, $dstpath = XOOPS_UPLOAD_PATH, $mimeTypes = null, $uploadMaxSize = null, $maxWidth = null, $maxHeight = null) |
947 | 947 | { |
948 | - require_once XOOPS_ROOT_PATH . '/class/uploader.php'; |
|
948 | + require_once XOOPS_ROOT_PATH.'/class/uploader.php'; |
|
949 | 949 | global $destname; |
950 | 950 | if (isset($_POST['xoops_upload_file'])) { |
951 | - require_once XOOPS_ROOT_PATH . '/class/uploader.php'; |
|
951 | + require_once XOOPS_ROOT_PATH.'/class/uploader.php'; |
|
952 | 952 | $fldname = ''; |
953 | 953 | $fldname = $_FILES[$_POST['xoops_upload_file'][$indice]]; |
954 | 954 | $fldname = get_magic_quotes_gpc() ? stripslashes($fldname['name']) : $fldname['name']; |
@@ -972,7 +972,7 @@ discard block |
||
972 | 972 | if ($uploader->upload()) { |
973 | 973 | return true; |
974 | 974 | } else { |
975 | - return _ERRORS . ' ' . htmlentities($uploader->getErrors()); |
|
975 | + return _ERRORS.' '.htmlentities($uploader->getErrors()); |
|
976 | 976 | } |
977 | 977 | } else { |
978 | 978 | return htmlentities($uploader->getErrors()); |
@@ -1055,9 +1055,9 @@ discard block |
||
1055 | 1055 | $workingBreadcrumb = array(); |
1056 | 1056 | if (is_array($path)) { |
1057 | 1057 | $moduleName = self::getModuleName(); |
1058 | - $workingBreadcrumb[] = "<a href='" . REFERENCES_URL . "' title='" . self::makeHrefTitle($moduleName) . "'>" . $moduleName . '</a>'; |
|
1058 | + $workingBreadcrumb[] = "<a href='".REFERENCES_URL."' title='".self::makeHrefTitle($moduleName)."'>".$moduleName.'</a>'; |
|
1059 | 1059 | foreach ($path as $url => $title) { |
1060 | - $workingBreadcrumb[] = "<a href='" . $url . "'>" . $title . '</a>'; |
|
1060 | + $workingBreadcrumb[] = "<a href='".$url."'>".$title.'</a>'; |
|
1061 | 1061 | } |
1062 | 1062 | $cnt = count($workingBreadcrumb); |
1063 | 1063 | for ($i = 0; $i < $cnt; ++$i) { |
@@ -1096,7 +1096,7 @@ discard block |
||
1096 | 1096 | |
1097 | 1097 | $complete_tags = array_reverse($complete_tags); |
1098 | 1098 | for ($i = 0; $i < count($complete_tags); ++$i) { |
1099 | - $string .= '</' . $complete_tags[$i] . '>'; |
|
1099 | + $string .= '</'.$complete_tags[$i].'>'; |
|
1100 | 1100 | } |
1101 | 1101 | } |
1102 | 1102 | |
@@ -1117,7 +1117,7 @@ discard block |
||
1117 | 1117 | $string = self::close_tags($string); |
1118 | 1118 | } |
1119 | 1119 | |
1120 | - return $string . $etc; |
|
1120 | + return $string.$etc; |
|
1121 | 1121 | } else { |
1122 | 1122 | return $string; |
1123 | 1123 | } |
@@ -1149,7 +1149,7 @@ discard block |
||
1149 | 1149 | public static function getMimeType($filename) |
1150 | 1150 | { |
1151 | 1151 | if (function_exists('finfo_open')) { |
1152 | - $pathToMagic = REFERENCES_PATH . 'mime/magic'; |
|
1152 | + $pathToMagic = REFERENCES_PATH.'mime/magic'; |
|
1153 | 1153 | $finfo = new finfo(FILEINFO_MIME, $pathToMagic); |
1154 | 1154 | $mimetype = $finfo->file($filename); |
1155 | 1155 | finfo_close($finfo); |
@@ -1179,7 +1179,7 @@ discard block |
||
1179 | 1179 | sort($xoopsUsersIDs); |
1180 | 1180 | if (count($xoopsUsersIDs) > 0) { |
1181 | 1181 | $member_handler = xoops_getHandler('user'); |
1182 | - $criteria = new Criteria('uid', '(' . implode(',', $xoopsUsersIDs) . ')', 'IN'); |
|
1182 | + $criteria = new Criteria('uid', '('.implode(',', $xoopsUsersIDs).')', 'IN'); |
|
1183 | 1183 | $criteria->setSort('uid'); |
1184 | 1184 | $users = $member_handler->getObjects($criteria, true); |
1185 | 1185 | } |
@@ -1217,7 +1217,7 @@ discard block |
||
1217 | 1217 | } else { |
1218 | 1218 | if ($uid > 0) { |
1219 | 1219 | $member_handler = xoops_getHandler('member'); |
1220 | - $buffer[$uid] = $member_handler->getGroupsByUser($uid, false); // Renvoie un tableau d'ID (de groupes) |
|
1220 | + $buffer[$uid] = $member_handler->getGroupsByUser($uid, false); // Renvoie un tableau d'ID (de groupes) |
|
1221 | 1221 | } else { |
1222 | 1222 | $buffer[$uid] = array(XOOPS_GROUP_ANONYMOUS); |
1223 | 1223 | } |
@@ -1244,7 +1244,7 @@ discard block |
||
1244 | 1244 | $retval = $buffer[$group]; |
1245 | 1245 | } else { |
1246 | 1246 | $member_handler = xoops_getHandler('member'); |
1247 | - $groups = $member_handler->getGroupsByUser($uid, false); // Renvoie un tableau d'ID (de groupes) |
|
1247 | + $groups = $member_handler->getGroupsByUser($uid, false); // Renvoie un tableau d'ID (de groupes) |
|
1248 | 1248 | $retval = in_array($group, $groups); |
1249 | 1249 | $buffer[$group] = $retval; |
1250 | 1250 | } |
@@ -1284,7 +1284,7 @@ discard block |
||
1284 | 1284 | static $cache = -1; |
1285 | 1285 | if ($cache == -1) { |
1286 | 1286 | global $xoopsDB; |
1287 | - $sql = 'SELECT COUNT(*) FROM ' . $xoopsDB->prefix('groups'); |
|
1287 | + $sql = 'SELECT COUNT(*) FROM '.$xoopsDB->prefix('groups'); |
|
1288 | 1288 | $result = $xoopsDB->query($sql); |
1289 | 1289 | if (!$result) { |
1290 | 1290 | return false; |
@@ -1305,7 +1305,7 @@ discard block |
||
1305 | 1305 | { |
1306 | 1306 | if (!is_dir($folder)) { |
1307 | 1307 | mkdir($folder, 0777); |
1308 | - file_put_contents($folder . '/index.html', '<script>history.go(-1);</script>'); |
|
1308 | + file_put_contents($folder.'/index.html', '<script>history.go(-1);</script>'); |
|
1309 | 1309 | } else { |
1310 | 1310 | if (!is_writable($folder)) { |
1311 | 1311 | chmod($folder, 0777); |
@@ -1326,10 +1326,10 @@ discard block |
||
1326 | 1326 | if (strstr($languageFile, $defaultExtension) === false) { |
1327 | 1327 | $languageFile .= $defaultExtension; |
1328 | 1328 | } |
1329 | - if (file_exists($root . 'language' . DIRECTORY_SEPARATOR . $xoopsConfig['language'] . DIRECTORY_SEPARATOR . $languageFile)) { |
|
1330 | - require_once $root . 'language' . DIRECTORY_SEPARATOR . $xoopsConfig['language'] . DIRECTORY_SEPARATOR . $languageFile; |
|
1329 | + if (file_exists($root.'language'.DIRECTORY_SEPARATOR.$xoopsConfig['language'].DIRECTORY_SEPARATOR.$languageFile)) { |
|
1330 | + require_once $root.'language'.DIRECTORY_SEPARATOR.$xoopsConfig['language'].DIRECTORY_SEPARATOR.$languageFile; |
|
1331 | 1331 | } else { // Fallback |
1332 | - require_once $root . 'language' . DIRECTORY_SEPARATOR . 'english' . DIRECTORY_SEPARATOR . $languageFile; |
|
1332 | + require_once $root.'language'.DIRECTORY_SEPARATOR.'english'.DIRECTORY_SEPARATOR.$languageFile; |
|
1333 | 1333 | } |
1334 | 1334 | } |
1335 | 1335 | |
@@ -1367,10 +1367,10 @@ discard block |
||
1367 | 1367 | $left = $top = 0; |
1368 | 1368 | if (is_array($pictureDimensions)) { |
1369 | 1369 | if ($pictureWidth > $param_width) { |
1370 | - $left = (int)(($pictureWidth / 2) - ($param_width / 2)); |
|
1370 | + $left = (int) (($pictureWidth / 2) - ($param_width / 2)); |
|
1371 | 1371 | } |
1372 | 1372 | if ($pictureHeight > $param_height) { |
1373 | - $top = (int)(($pictureHeight / 2) - ($param_height / 2)); |
|
1373 | + $top = (int) (($pictureHeight / 2) - ($param_height / 2)); |
|
1374 | 1374 | } |
1375 | 1375 | } |
1376 | 1376 | $result = $img->crop($left, $top, $param_width, $param_height); |
@@ -1410,7 +1410,7 @@ discard block |
||
1410 | 1410 | $selected = " selected = 'selected'"; |
1411 | 1411 | } |
1412 | 1412 | } |
1413 | - $ret[] = '<option value=0' . $selected . '>---</option>'; |
|
1413 | + $ret[] = '<option value=0'.$selected.'>---</option>'; |
|
1414 | 1414 | } |
1415 | 1415 | |
1416 | 1416 | foreach ($array as $index => $label) { |
@@ -1424,7 +1424,7 @@ discard block |
||
1424 | 1424 | $selected = " selected = 'selected'"; |
1425 | 1425 | } |
1426 | 1426 | } |
1427 | - $ret[] = "<option value=\"" . $index . "\"" . $selected . '>' . $label . '</option>'; |
|
1427 | + $ret[] = "<option value=\"".$index."\"".$selected.'>'.$label.'</option>'; |
|
1428 | 1428 | } |
1429 | 1429 | |
1430 | 1430 | return implode("\n", $ret); |
@@ -1446,14 +1446,14 @@ discard block |
||
1446 | 1446 | public static function htmlSelect($selectName, $array, $default, $withNull = true, $style = '', $multiple = false, $size = 1, $extra = '') |
1447 | 1447 | { |
1448 | 1448 | $ret = ''; |
1449 | - $ret .= "<select name='" . $selectName . "' id='" . $selectName . "'"; |
|
1449 | + $ret .= "<select name='".$selectName."' id='".$selectName."'"; |
|
1450 | 1450 | if (xoops_trim($style) != '') { |
1451 | - $ret .= " style='" . $style . "' "; |
|
1451 | + $ret .= " style='".$style."' "; |
|
1452 | 1452 | } |
1453 | 1453 | if (xoops_trim($multiple) != '') { |
1454 | - $ret .= " multiple = 'multiple' size='" . $size . "' "; |
|
1454 | + $ret .= " multiple = 'multiple' size='".$size."' "; |
|
1455 | 1455 | } |
1456 | - $ret .= $extra . ">\n"; |
|
1456 | + $ret .= $extra.">\n"; |
|
1457 | 1457 | $ret .= self::htmlSelectOptions($array, $default, $withNull); |
1458 | 1458 | $ret .= "</select>\n"; |
1459 | 1459 | |
@@ -1528,16 +1528,16 @@ discard block |
||
1528 | 1528 | { |
1529 | 1529 | global $xoopsDB; |
1530 | 1530 | define('REFERENCES_MAINTAIN', true); |
1531 | - require self::MODULE_PATH . 'xoops_version.php'; |
|
1531 | + require self::MODULE_PATH.'xoops_version.php'; |
|
1532 | 1532 | $tables = array(); |
1533 | 1533 | foreach ($modversion['tables'] as $table) { |
1534 | 1534 | $tables[] = $xoopsDB->prefix($table); |
1535 | 1535 | } |
1536 | 1536 | if (count($tables) > 0) { |
1537 | 1537 | $list = implode(',', $tables); |
1538 | - $xoopsDB->queryF('CHECK TABLE ' . $list); |
|
1539 | - $xoopsDB->queryF('ANALYZE TABLE ' . $list); |
|
1540 | - $xoopsDB->queryF('OPTIMIZE TABLE ' . $list); |
|
1538 | + $xoopsDB->queryF('CHECK TABLE '.$list); |
|
1539 | + $xoopsDB->queryF('ANALYZE TABLE '.$list); |
|
1540 | + $xoopsDB->queryF('OPTIMIZE TABLE '.$list); |
|
1541 | 1541 | } |
1542 | 1542 | self::updateCache(); |
1543 | 1543 | $handlers = references_handler::getInstance(); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | protected function _getIdForCache($query, $start, $limit) |
129 | 129 | { |
130 | - $id = md5($query . '-' . (string)$start . '-' . (string)$limit); |
|
130 | + $id = md5($query.'-'.(string) $start.'-'.(string) $limit); |
|
131 | 131 | |
132 | 132 | return $id; |
133 | 133 | } |
@@ -162,17 +162,17 @@ discard block |
||
162 | 162 | $criteria = new CriteriaCompo(); |
163 | 163 | $vnb = count($this->keyName); |
164 | 164 | for ($i = 0; $i < $vnb; ++$i) { |
165 | - $criteria->add(new Criteria($this->keyName[$i], (int)$id[$i])); |
|
165 | + $criteria->add(new Criteria($this->keyName[$i], (int) $id[$i])); |
|
166 | 166 | } |
167 | 167 | } else { |
168 | - $criteria = new Criteria($this->keyName, (int)$id); |
|
168 | + $criteria = new Criteria($this->keyName, (int) $id); |
|
169 | 169 | } |
170 | 170 | $criteria->setLimit(1); |
171 | 171 | $obj_array = $this->getObjects($criteria, false, $as_object); |
172 | 172 | if (count($obj_array) != 1) { |
173 | 173 | $ret = null; |
174 | 174 | } else { |
175 | - $ret =& $obj_array[0]; |
|
175 | + $ret = & $obj_array[0]; |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | return $ret; |
@@ -191,19 +191,19 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function &getObjects(CriteriaElement $criteria = null, $id_as_key = false, $as_object = true, $fields = '*', $autoSort = true) |
193 | 193 | { |
194 | - require_once __DIR__ . '/lite.php'; |
|
194 | + require_once __DIR__.'/lite.php'; |
|
195 | 195 | $ret = array(); |
196 | 196 | $limit = $start = 0; |
197 | - $sql = 'SELECT ' . $fields . ' FROM ' . $this->table; |
|
197 | + $sql = 'SELECT '.$fields.' FROM '.$this->table; |
|
198 | 198 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
199 | - $sql .= ' ' . $criteria->renderWhere(); |
|
199 | + $sql .= ' '.$criteria->renderWhere(); |
|
200 | 200 | if ($criteria->groupby != '') { |
201 | 201 | $sql .= $criteria->getGroupby(); |
202 | 202 | } |
203 | 203 | if ($criteria->getSort() != '') { |
204 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
204 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
205 | 205 | } elseif ($this->identifierName != '' && $autoSort) { |
206 | - $sql .= ' ORDER BY ' . $this->identifierName; |
|
206 | + $sql .= ' ORDER BY '.$this->identifierName; |
|
207 | 207 | } |
208 | 208 | $limit = $criteria->getLimit(); |
209 | 209 | $start = $criteria->getStart(); |
@@ -239,11 +239,11 @@ discard block |
||
239 | 239 | { |
240 | 240 | $ret = array(); |
241 | 241 | while ($myrow = $this->db->fetchArray($result)) { |
242 | - $obj =& $this->create(false); |
|
242 | + $obj = & $this->create(false); |
|
243 | 243 | $obj->assignVars($myrow); |
244 | 244 | if (!$id_as_key) { |
245 | 245 | if ($as_object) { |
246 | - $ret[] =& $obj; |
|
246 | + $ret[] = & $obj; |
|
247 | 247 | } else { |
248 | 248 | $row = array(); |
249 | 249 | $vars = $obj->getVars(); |
@@ -256,9 +256,9 @@ discard block |
||
256 | 256 | } else { |
257 | 257 | if ($as_object) { |
258 | 258 | if ($fields === '*') { |
259 | - $ret[$myrow[$this->keyName]] =& $obj; |
|
259 | + $ret[$myrow[$this->keyName]] = & $obj; |
|
260 | 260 | } else { |
261 | - $ret[] =& $obj; |
|
261 | + $ret[] = & $obj; |
|
262 | 262 | } |
263 | 263 | } else { |
264 | 264 | $row = array(); |
@@ -284,20 +284,20 @@ discard block |
||
284 | 284 | */ |
285 | 285 | public function getIds($criteria = null) |
286 | 286 | { |
287 | - require_once __DIR__ . '/lite.php'; |
|
287 | + require_once __DIR__.'/lite.php'; |
|
288 | 288 | $limit = $start = 0; |
289 | 289 | |
290 | 290 | $Cache_Lite = new references_Cache_Lite($this->cacheOptions); |
291 | - $sql = 'SELECT ' . $this->keyName . ' FROM ' . $this->table; |
|
291 | + $sql = 'SELECT '.$this->keyName.' FROM '.$this->table; |
|
292 | 292 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
293 | - $sql .= ' ' . $criteria->renderWhere(); |
|
293 | + $sql .= ' '.$criteria->renderWhere(); |
|
294 | 294 | if ($criteria->groupby != '') { |
295 | 295 | $sql .= $criteria->getGroupby(); |
296 | 296 | } |
297 | 297 | if ($criteria->getSort() != '') { |
298 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
298 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
299 | 299 | } elseif ($this->identifierName != '') { |
300 | - $sql .= ' ORDER BY ' . $this->identifierName; |
|
300 | + $sql .= ' ORDER BY '.$this->identifierName; |
|
301 | 301 | } |
302 | 302 | $limit = $criteria->getLimit(); |
303 | 303 | $start = $criteria->getStart(); |
@@ -327,26 +327,26 @@ discard block |
||
327 | 327 | */ |
328 | 328 | public function getList($criteria = null) |
329 | 329 | { |
330 | - require_once __DIR__ . '/lite.php'; |
|
330 | + require_once __DIR__.'/lite.php'; |
|
331 | 331 | $limit = $start = 0; |
332 | 332 | $Cache_Lite = new references_Cache_Lite($this->cacheOptions); |
333 | 333 | |
334 | 334 | $ret = array(); |
335 | 335 | |
336 | - $sql = 'SELECT ' . $this->keyName; |
|
336 | + $sql = 'SELECT '.$this->keyName; |
|
337 | 337 | if (!empty($this->identifierName)) { |
338 | - $sql .= ', ' . $this->identifierName; |
|
338 | + $sql .= ', '.$this->identifierName; |
|
339 | 339 | } |
340 | - $sql .= ' FROM ' . $this->table; |
|
340 | + $sql .= ' FROM '.$this->table; |
|
341 | 341 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
342 | - $sql .= ' ' . $criteria->renderWhere(); |
|
342 | + $sql .= ' '.$criteria->renderWhere(); |
|
343 | 343 | if ($criteria->groupby != '') { |
344 | 344 | $sql .= $criteria->getGroupby(); |
345 | 345 | } |
346 | 346 | if ($criteria->getSort() != '') { |
347 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
347 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
348 | 348 | } elseif ($this->identifierName != '') { |
349 | - $sql .= ' ORDER BY ' . $this->identifierName; |
|
349 | + $sql .= ' ORDER BY '.$this->identifierName; |
|
350 | 350 | } |
351 | 351 | $limit = $criteria->getLimit(); |
352 | 352 | $start = $criteria->getStart(); |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | $ret = array(); |
388 | 388 | if (is_array($ids) && count($ids) > 0) { |
389 | 389 | $criteria = new CriteriaCompo(); |
390 | - $criteria->add(new Criteria($this->keyName, '(' . implode(',', $ids) . ')', 'IN')); |
|
390 | + $criteria->add(new Criteria($this->keyName, '('.implode(',', $ids).')', 'IN')); |
|
391 | 391 | if (!is_null($additionnal)) { |
392 | 392 | $criteria->add($additionnal); |
393 | 393 | } |
@@ -408,17 +408,17 @@ discard block |
||
408 | 408 | $field = ''; |
409 | 409 | $groupby = false; |
410 | 410 | $limit = $start = 0; |
411 | - require_once __DIR__ . '/lite.php'; |
|
411 | + require_once __DIR__.'/lite.php'; |
|
412 | 412 | |
413 | 413 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
414 | 414 | if ($criteria->groupby != '') { |
415 | 415 | $groupby = true; |
416 | - $field = $criteria->groupby . ', '; //Not entirely secure unless you KNOW that no criteria's groupby clause is going to be mis-used |
|
416 | + $field = $criteria->groupby.', '; //Not entirely secure unless you KNOW that no criteria's groupby clause is going to be mis-used |
|
417 | 417 | } |
418 | 418 | } |
419 | - $sql = 'SELECT ' . $field . 'COUNT(*) FROM ' . $this->table; |
|
419 | + $sql = 'SELECT '.$field.'COUNT(*) FROM '.$this->table; |
|
420 | 420 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
421 | - $sql .= ' ' . $criteria->renderWhere(); |
|
421 | + $sql .= ' '.$criteria->renderWhere(); |
|
422 | 422 | if ($criteria->groupby != '') { |
423 | 423 | $sql .= $criteria->getGroupby(); |
424 | 424 | } |
@@ -465,11 +465,11 @@ discard block |
||
465 | 465 | public function getSum($field, $criteria = null) |
466 | 466 | { |
467 | 467 | $limit = $start = 0; |
468 | - require_once __DIR__ . '/lite.php'; |
|
468 | + require_once __DIR__.'/lite.php'; |
|
469 | 469 | |
470 | - $sql = 'SELECT Sum(' . $field . ') as cpt FROM ' . $this->table; |
|
470 | + $sql = 'SELECT Sum('.$field.') as cpt FROM '.$this->table; |
|
471 | 471 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
472 | - $sql .= ' ' . $criteria->renderWhere(); |
|
472 | + $sql .= ' '.$criteria->renderWhere(); |
|
473 | 473 | if ($criteria->groupby != '') { |
474 | 474 | $sql .= $criteria->getGroupby(); |
475 | 475 | } |
@@ -510,13 +510,13 @@ discard block |
||
510 | 510 | $clause = array(); |
511 | 511 | $vnb = count($this->keyName); |
512 | 512 | for ($i = 0; $i < $vnb; ++$i) { |
513 | - $clause[] = $this->keyName[$i] . ' = ' . $obj->getVar($this->keyName[$i]); |
|
513 | + $clause[] = $this->keyName[$i].' = '.$obj->getVar($this->keyName[$i]); |
|
514 | 514 | } |
515 | 515 | $whereclause = implode(' AND ', $clause); |
516 | 516 | } else { |
517 | - $whereclause = $this->keyName . ' = ' . $obj->getVar($this->keyName); |
|
517 | + $whereclause = $this->keyName.' = '.$obj->getVar($this->keyName); |
|
518 | 518 | } |
519 | - $sql = 'DELETE FROM ' . $this->table . ' WHERE ' . $whereclause; |
|
519 | + $sql = 'DELETE FROM '.$this->table.' WHERE '.$whereclause; |
|
520 | 520 | if (false != $force) { |
521 | 521 | $result = $this->db->queryF($sql); |
522 | 522 | } else { |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | { |
544 | 544 | $object = $this->create(true); |
545 | 545 | $object->setVars($vars); |
546 | - $retval =& $this->insert($object, $force); |
|
546 | + $retval = & $this->insert($object, $force); |
|
547 | 547 | unset($object); |
548 | 548 | |
549 | 549 | // Clear cache |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | * @TODO: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5 |
575 | 575 | */ |
576 | 576 | if (!is_a($obj, $this->className)) { |
577 | - $obj->setErrors(get_class($obj) . ' Differs from ' . $this->className); |
|
577 | + $obj->setErrors(get_class($obj).' Differs from '.$this->className); |
|
578 | 578 | |
579 | 579 | return false; |
580 | 580 | } |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | } |
594 | 594 | foreach ($obj->cleanVars as $k => $v) { |
595 | 595 | if ($obj->vars[$k]['data_type'] == XOBJ_DTYPE_INT) { |
596 | - $cleanvars[$k] = (int)$v; |
|
596 | + $cleanvars[$k] = (int) $v; |
|
597 | 597 | } elseif (is_array($v)) { |
598 | 598 | $cleanvars[$k] = $this->db->quoteString(implode(',', $v)); |
599 | 599 | } else { |
@@ -606,16 +606,16 @@ discard block |
||
606 | 606 | if ($obj->isNew()) { |
607 | 607 | if (!is_array($this->keyName)) { |
608 | 608 | if ($cleanvars[$this->keyName] < 1) { |
609 | - $cleanvars[$this->keyName] = $this->db->genId($this->table . '_' . $this->keyName . '_seq'); |
|
609 | + $cleanvars[$this->keyName] = $this->db->genId($this->table.'_'.$this->keyName.'_seq'); |
|
610 | 610 | } |
611 | 611 | } |
612 | 612 | $ignore = ''; |
613 | 613 | if ($ignoreInsert) { |
614 | 614 | $ignore = 'IGNORE'; |
615 | 615 | } |
616 | - $sql = "INSERT $ignore INTO " . $this->table . ' (' . implode(',', array_keys($cleanvars)) . ') VALUES (' . implode(',', array_values($cleanvars)) . ')'; |
|
616 | + $sql = "INSERT $ignore INTO ".$this->table.' ('.implode(',', array_keys($cleanvars)).') VALUES ('.implode(',', array_values($cleanvars)).')'; |
|
617 | 617 | } else { |
618 | - $sql = 'UPDATE ' . $this->table . ' SET'; |
|
618 | + $sql = 'UPDATE '.$this->table.' SET'; |
|
619 | 619 | foreach ($cleanvars as $key => $value) { |
620 | 620 | if ((!is_array($this->keyName) && $key == $this->keyName) || (is_array($this->keyName) && in_array($key, $this->keyName))) { |
621 | 621 | continue; |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | if (isset($notfirst)) { |
624 | 624 | $sql .= ','; |
625 | 625 | } |
626 | - $sql .= ' ' . $key . ' = ' . $value; |
|
626 | + $sql .= ' '.$key.' = '.$value; |
|
627 | 627 | $notfirst = true; |
628 | 628 | } |
629 | 629 | if (is_array($this->keyName)) { |
@@ -633,12 +633,12 @@ discard block |
||
633 | 633 | if ($i > 0) { |
634 | 634 | $whereclause .= ' AND '; |
635 | 635 | } |
636 | - $whereclause .= $this->keyName[$i] . ' = ' . $obj->getVar($this->keyName[$i]); |
|
636 | + $whereclause .= $this->keyName[$i].' = '.$obj->getVar($this->keyName[$i]); |
|
637 | 637 | } |
638 | 638 | } else { |
639 | - $whereclause = $this->keyName . ' = ' . $obj->getVar($this->keyName); |
|
639 | + $whereclause = $this->keyName.' = '.$obj->getVar($this->keyName); |
|
640 | 640 | } |
641 | - $sql .= ' WHERE ' . $whereclause; |
|
641 | + $sql .= ' WHERE '.$whereclause; |
|
642 | 642 | } |
643 | 643 | |
644 | 644 | if (false != $force) { |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | */ |
673 | 673 | public function updateAll($fieldname, $fieldvalue, $criteria = null, $force = false) |
674 | 674 | { |
675 | - $set_clause = $fieldname . ' = '; |
|
675 | + $set_clause = $fieldname.' = '; |
|
676 | 676 | if (is_numeric($fieldvalue)) { |
677 | 677 | $set_clause .= $fieldvalue; |
678 | 678 | } elseif (is_array($fieldvalue)) { |
@@ -680,9 +680,9 @@ discard block |
||
680 | 680 | } else { |
681 | 681 | $set_clause .= $this->db->quoteString($fieldvalue); |
682 | 682 | } |
683 | - $sql = 'UPDATE ' . $this->table . ' SET ' . $set_clause; |
|
683 | + $sql = 'UPDATE '.$this->table.' SET '.$set_clause; |
|
684 | 684 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
685 | - $sql .= ' ' . $criteria->renderWhere(); |
|
685 | + $sql .= ' '.$criteria->renderWhere(); |
|
686 | 686 | } |
687 | 687 | if ($force) { |
688 | 688 | $result = $this->db->queryF($sql); |
@@ -730,8 +730,8 @@ discard block |
||
730 | 730 | public function deleteAll($criteria = null) |
731 | 731 | { |
732 | 732 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
733 | - $sql = 'DELETE FROM ' . $this->table; |
|
734 | - $sql .= ' ' . $criteria->renderWhere(); |
|
733 | + $sql = 'DELETE FROM '.$this->table; |
|
734 | + $sql .= ' '.$criteria->renderWhere(); |
|
735 | 735 | if (!$this->db->queryF($sql)) { |
736 | 736 | return false; |
737 | 737 | } |
@@ -777,15 +777,15 @@ discard block |
||
777 | 777 | */ |
778 | 778 | public function getDistincts($field, $criteria = null, $format = 's') |
779 | 779 | { |
780 | - require_once __DIR__ . '/lite.php'; |
|
780 | + require_once __DIR__.'/lite.php'; |
|
781 | 781 | $limit = $start = 0; |
782 | - $sql = 'SELECT ' . $this->keyName . ', ' . $field . ' FROM ' . $this->table; |
|
782 | + $sql = 'SELECT '.$this->keyName.', '.$field.' FROM '.$this->table; |
|
783 | 783 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
784 | - $sql .= ' ' . $criteria->renderWhere(); |
|
784 | + $sql .= ' '.$criteria->renderWhere(); |
|
785 | 785 | $limit = $criteria->getLimit(); |
786 | 786 | $start = $criteria->getStart(); |
787 | 787 | } |
788 | - $sql .= ' GROUP BY ' . $field . ' ORDER BY ' . $field; |
|
788 | + $sql .= ' GROUP BY '.$field.' ORDER BY '.$field; |
|
789 | 789 | |
790 | 790 | $Cache_Lite = new references_Cache_Lite($this->cacheOptions); |
791 | 791 | $id = $this->_getIdForCache($sql, $start, $limit); |
@@ -843,7 +843,7 @@ discard block |
||
843 | 843 | */ |
844 | 844 | public function forceCacheClean() |
845 | 845 | { |
846 | - require_once __DIR__ . '/lite.php'; |
|
846 | + require_once __DIR__.'/lite.php'; |
|
847 | 847 | $Cache_Lite = new references_Cache_Lite($this->cacheOptions); |
848 | 848 | $Cache_Lite->clean(); |
849 | 849 | } |