@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | function wysiwyg_nicedit_settings($editor, $config, $theme) { |
| 63 | 63 | $settings = array( |
| 64 | - 'iconsPath' => base_path() . $editor['library path'] . '/nicEditorIcons.gif', |
|
| 64 | + 'iconsPath' => base_path().$editor['library path'].'/nicEditorIcons.gif', |
|
| 65 | 65 | ); |
| 66 | 66 | |
| 67 | 67 | // Add configured buttons or all available. |
@@ -77,9 +77,9 @@ discard block |
||
| 77 | 77 | // Add editor content stylesheet. |
| 78 | 78 | if (isset($config['css_setting'])) { |
| 79 | 79 | if ($config['css_setting'] == 'theme') { |
| 80 | - $css = path_to_theme() . '/style.css'; |
|
| 80 | + $css = path_to_theme().'/style.css'; |
|
| 81 | 81 | if (file_exists($css)) { |
| 82 | - $settings['externalCSS'] = base_path() . $css; |
|
| 82 | + $settings['externalCSS'] = base_path().$css; |
|
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | else if ($config['css_setting'] == 'self' && isset($config['css_path'])) { |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | 'title' => 'TinyMCE', |
| 16 | 16 | 'vendor url' => 'http://tinymce.moxiecode.com', |
| 17 | 17 | 'download url' => 'http://tinymce.moxiecode.com/download.php', |
| 18 | - 'library path' => wysiwyg_get_path('tinymce') . '/jscripts/tiny_mce', |
|
| 18 | + 'library path' => wysiwyg_get_path('tinymce').'/jscripts/tiny_mce', |
|
| 19 | 19 | 'libraries' => array( |
| 20 | 20 | '' => array( |
| 21 | 21 | 'title' => 'Minified', |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * The installed editor version. |
| 81 | 81 | */ |
| 82 | 82 | function wysiwyg_tinymce_version($editor) { |
| 83 | - $script = $editor['library path'] . '/tiny_mce.js'; |
|
| 83 | + $script = $editor['library path'].'/tiny_mce.js'; |
|
| 84 | 84 | if (!file_exists($script)) { |
| 85 | 85 | return; |
| 86 | 86 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | // 2.x: this.majorVersion="2";this.minorVersion="1.3" |
| 92 | 92 | // 3.x: majorVersion:'3',minorVersion:'2.0.1' |
| 93 | 93 | if (preg_match('@majorVersion[=:]["\'](\d).+?minorVersion[=:]["\']([\d\.]+)@', $line, $version)) { |
| 94 | - return $version[1] . '.' . $version[2]; |
|
| 94 | + return $version[1].'.'.$version[2]; |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | $settings['remove_linebreaks'] = $config['remove_linebreaks']; |
| 179 | 179 | } |
| 180 | 180 | if (isset($config['verify_html'])) { |
| 181 | - $settings['verify_html'] = (bool) $config['verify_html']; |
|
| 181 | + $settings['verify_html'] = (bool)$config['verify_html']; |
|
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | if (!empty($config['css_classes'])) { |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | $plugin['filename'] = array_pop($parts); |
| 325 | 325 | $plugin['path'] = implode('/', $parts); |
| 326 | 326 | } |
| 327 | - $settings[$name] = base_path() . $plugin['path'] . '/' . $plugin['filename']; |
|
| 327 | + $settings[$name] = base_path().$plugin['path'].'/'.$plugin['filename']; |
|
| 328 | 328 | } |
| 329 | 329 | } |
| 330 | 330 | } |
@@ -340,11 +340,11 @@ discard block |
||
| 340 | 340 | // Populate required plugin settings. |
| 341 | 341 | $settings[$name] = $plugin['dialog settings'] + array( |
| 342 | 342 | 'title' => $plugin['title'], |
| 343 | - 'icon' => base_path() . $plugin['icon path'] . '/' . $plugin['icon file'], |
|
| 343 | + 'icon' => base_path().$plugin['icon path'].'/'.$plugin['icon file'], |
|
| 344 | 344 | 'iconTitle' => $plugin['icon title'], |
| 345 | 345 | ); |
| 346 | 346 | if (isset($plugin['css file'])) { |
| 347 | - $settings[$name]['css'] = base_path() . $plugin['css path'] . '/' . $plugin['css file']; |
|
| 347 | + $settings[$name]['css'] = base_path().$plugin['css path'].'/'.$plugin['css file']; |
|
| 348 | 348 | } |
| 349 | 349 | } |
| 350 | 350 | return $settings; |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | function _wysiwyg_tinymce_plugin_name($op, $name) { |
| 365 | 365 | if ($op == 'add') { |
| 366 | 366 | if (strpos($name, '-') !== 0) { |
| 367 | - return '-' . $name; |
|
| 367 | + return '-'.$name; |
|
| 368 | 368 | } |
| 369 | 369 | return $name; |
| 370 | 370 | } |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | function wysiwyg_tinymce_plugins($editor) { |
| 383 | 383 | $plugins = array( |
| 384 | 384 | 'default' => array( |
| 385 | - 'path' => $editor['library path'] . '/themes/advanced', |
|
| 385 | + 'path' => $editor['library path'].'/themes/advanced', |
|
| 386 | 386 | 'buttons' => array( |
| 387 | 387 | 'bold' => t('Bold'), 'italic' => t('Italic'), 'underline' => t('Underline'), |
| 388 | 388 | 'strikethrough' => t('Strike-through'), |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | 'internal' => TRUE, |
| 407 | 407 | ), |
| 408 | 408 | 'advhr' => array( |
| 409 | - 'path' => $editor['library path'] . '/plugins/advhr', |
|
| 409 | + 'path' => $editor['library path'].'/plugins/advhr', |
|
| 410 | 410 | 'buttons' => array('advhr' => t('Advanced horizontal rule')), |
| 411 | 411 | 'extended_valid_elements' => array('hr[class|width|size|noshade]'), |
| 412 | 412 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr', |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | 'load' => TRUE, |
| 415 | 415 | ), |
| 416 | 416 | 'advimage' => array( |
| 417 | - 'path' => $editor['library path'] . '/plugins/advimage', |
|
| 417 | + 'path' => $editor['library path'].'/plugins/advimage', |
|
| 418 | 418 | 'extensions' => array('advimage' => t('Advanced image')), |
| 419 | 419 | 'extended_valid_elements' => array('img[src|alt|title|align|width|height|usemap|hspace|vspace|border|style|class|onmouseover|onmouseout|id|name]'), |
| 420 | 420 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage', |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | 'load' => TRUE, |
| 423 | 423 | ), |
| 424 | 424 | 'advlink' => array( |
| 425 | - 'path' => $editor['library path'] . '/plugins/advlink', |
|
| 425 | + 'path' => $editor['library path'].'/plugins/advlink', |
|
| 426 | 426 | 'extensions' => array('advlink' => t('Advanced link')), |
| 427 | 427 | 'extended_valid_elements' => array('a[name|href|target|title|class|onfocus|onblur|onclick|ondlbclick|onmousedown|onmouseup|onmouseover|onmouseout|onkeypress|onkeydown|onkeyup|id|style|rel]'), |
| 428 | 428 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', |
@@ -430,49 +430,49 @@ discard block |
||
| 430 | 430 | 'load' => TRUE, |
| 431 | 431 | ), |
| 432 | 432 | 'autosave' => array( |
| 433 | - 'path' => $editor['library path'] . '/plugins/autosave', |
|
| 433 | + 'path' => $editor['library path'].'/plugins/autosave', |
|
| 434 | 434 | 'extensions' => array('autosave' => t('Auto save')), |
| 435 | 435 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave', |
| 436 | 436 | 'internal' => TRUE, |
| 437 | 437 | 'load' => TRUE, |
| 438 | 438 | ), |
| 439 | 439 | 'contextmenu' => array( |
| 440 | - 'path' => $editor['library path'] . '/plugins/contextmenu', |
|
| 440 | + 'path' => $editor['library path'].'/plugins/contextmenu', |
|
| 441 | 441 | 'extensions' => array('contextmenu' => t('Context menu')), |
| 442 | 442 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu', |
| 443 | 443 | 'internal' => TRUE, |
| 444 | 444 | 'load' => TRUE, |
| 445 | 445 | ), |
| 446 | 446 | 'directionality' => array( |
| 447 | - 'path' => $editor['library path'] . '/plugins/directionality', |
|
| 447 | + 'path' => $editor['library path'].'/plugins/directionality', |
|
| 448 | 448 | 'buttons' => array('ltr' => t('Left-to-right'), 'rtl' => t('Right-to-left')), |
| 449 | 449 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality', |
| 450 | 450 | 'internal' => TRUE, |
| 451 | 451 | 'load' => TRUE, |
| 452 | 452 | ), |
| 453 | 453 | 'emotions' => array( |
| 454 | - 'path' => $editor['library path'] . '/plugins/emotions', |
|
| 454 | + 'path' => $editor['library path'].'/plugins/emotions', |
|
| 455 | 455 | 'buttons' => array('emotions' => t('Emotions')), |
| 456 | 456 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions', |
| 457 | 457 | 'internal' => TRUE, |
| 458 | 458 | 'load' => TRUE, |
| 459 | 459 | ), |
| 460 | 460 | 'font' => array( |
| 461 | - 'path' => $editor['library path'] . '/plugins/font', |
|
| 461 | + 'path' => $editor['library path'].'/plugins/font', |
|
| 462 | 462 | 'buttons' => array('formatselect' => t('HTML block format'), 'fontselect' => t('Font'), 'fontsizeselect' => t('Font size'), 'styleselect' => t('Font style')), |
| 463 | 463 | 'extended_valid_elements' => array('font[face|size|color|style],span[class|align|style]'), |
| 464 | 464 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/font', |
| 465 | 465 | 'internal' => TRUE, |
| 466 | 466 | ), |
| 467 | 467 | 'fullscreen' => array( |
| 468 | - 'path' => $editor['library path'] . '/plugins/fullscreen', |
|
| 468 | + 'path' => $editor['library path'].'/plugins/fullscreen', |
|
| 469 | 469 | 'buttons' => array('fullscreen' => t('Fullscreen')), |
| 470 | 470 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen', |
| 471 | 471 | 'internal' => TRUE, |
| 472 | 472 | 'load' => TRUE, |
| 473 | 473 | ), |
| 474 | 474 | 'inlinepopups' => array( |
| 475 | - 'path' => $editor['library path'] . '/plugins/inlinepopups', |
|
| 475 | + 'path' => $editor['library path'].'/plugins/inlinepopups', |
|
| 476 | 476 | 'extensions' => array('inlinepopups' => t('Inline popups')), |
| 477 | 477 | 'options' => array( |
| 478 | 478 | 'dialog_type' => array('modal'), |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | 'load' => TRUE, |
| 483 | 483 | ), |
| 484 | 484 | 'insertdatetime' => array( |
| 485 | - 'path' => $editor['library path'] . '/plugins/insertdatetime', |
|
| 485 | + 'path' => $editor['library path'].'/plugins/insertdatetime', |
|
| 486 | 486 | 'buttons' => array('insertdate' => t('Insert date'), 'inserttime' => t('Insert time')), |
| 487 | 487 | 'options' => array( |
| 488 | 488 | 'plugin_insertdate_dateFormat' => '%Y-%m-%d', |
@@ -493,49 +493,49 @@ discard block |
||
| 493 | 493 | 'load' => TRUE, |
| 494 | 494 | ), |
| 495 | 495 | 'layer' => array( |
| 496 | - 'path' => $editor['library path'] . '/plugins/layer', |
|
| 496 | + 'path' => $editor['library path'].'/plugins/layer', |
|
| 497 | 497 | 'buttons' => array('insertlayer' => t('Insert layer'), 'moveforward' => t('Move forward'), 'movebackward' => t('Move backward'), 'absolute' => t('Absolute')), |
| 498 | 498 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer', |
| 499 | 499 | 'internal' => TRUE, |
| 500 | 500 | 'load' => TRUE, |
| 501 | 501 | ), |
| 502 | 502 | 'paste' => array( |
| 503 | - 'path' => $editor['library path'] . '/plugins/paste', |
|
| 503 | + 'path' => $editor['library path'].'/plugins/paste', |
|
| 504 | 504 | 'buttons' => array('pastetext' => t('Paste text'), 'pasteword' => t('Paste from Word'), 'selectall' => t('Select all')), |
| 505 | 505 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste', |
| 506 | 506 | 'internal' => TRUE, |
| 507 | 507 | 'load' => TRUE, |
| 508 | 508 | ), |
| 509 | 509 | 'preview' => array( |
| 510 | - 'path' => $editor['library path'] . '/plugins/preview', |
|
| 510 | + 'path' => $editor['library path'].'/plugins/preview', |
|
| 511 | 511 | 'buttons' => array('preview' => t('Preview')), |
| 512 | 512 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview', |
| 513 | 513 | 'internal' => TRUE, |
| 514 | 514 | 'load' => TRUE, |
| 515 | 515 | ), |
| 516 | 516 | 'print' => array( |
| 517 | - 'path' => $editor['library path'] . '/plugins/print', |
|
| 517 | + 'path' => $editor['library path'].'/plugins/print', |
|
| 518 | 518 | 'buttons' => array('print' => t('Print')), |
| 519 | 519 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print', |
| 520 | 520 | 'internal' => TRUE, |
| 521 | 521 | 'load' => TRUE, |
| 522 | 522 | ), |
| 523 | 523 | 'searchreplace' => array( |
| 524 | - 'path' => $editor['library path'] . '/plugins/searchreplace', |
|
| 524 | + 'path' => $editor['library path'].'/plugins/searchreplace', |
|
| 525 | 525 | 'buttons' => array('search' => t('Search'), 'replace' => t('Replace')), |
| 526 | 526 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', |
| 527 | 527 | 'internal' => TRUE, |
| 528 | 528 | 'load' => TRUE, |
| 529 | 529 | ), |
| 530 | 530 | 'style' => array( |
| 531 | - 'path' => $editor['library path'] . '/plugins/style', |
|
| 531 | + 'path' => $editor['library path'].'/plugins/style', |
|
| 532 | 532 | 'buttons' => array('styleprops' => t('Style properties')), |
| 533 | 533 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style', |
| 534 | 534 | 'internal' => TRUE, |
| 535 | 535 | 'load' => TRUE, |
| 536 | 536 | ), |
| 537 | 537 | 'table' => array( |
| 538 | - 'path' => $editor['library path'] . '/plugins/table', |
|
| 538 | + 'path' => $editor['library path'].'/plugins/table', |
|
| 539 | 539 | 'buttons' => array('tablecontrols' => t('Table')), |
| 540 | 540 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table', |
| 541 | 541 | 'internal' => TRUE, |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | ); |
| 545 | 545 | if (version_compare($editor['installed version'], '3', '<')) { |
| 546 | 546 | $plugins['flash'] = array( |
| 547 | - 'path' => $editor['library path'] . '/plugins/flash', |
|
| 547 | + 'path' => $editor['library path'].'/plugins/flash', |
|
| 548 | 548 | 'buttons' => array('flash' => t('Flash')), |
| 549 | 549 | 'extended_valid_elements' => array('img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|obj|param|embed]'), |
| 550 | 550 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/flash', |
@@ -554,14 +554,14 @@ discard block |
||
| 554 | 554 | } |
| 555 | 555 | if (version_compare($editor['installed version'], '2.0.6', '>')) { |
| 556 | 556 | $plugins['media'] = array( |
| 557 | - 'path' => $editor['library path'] . '/plugins/media', |
|
| 557 | + 'path' => $editor['library path'].'/plugins/media', |
|
| 558 | 558 | 'buttons' => array('media' => t('Media')), |
| 559 | 559 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media', |
| 560 | 560 | 'internal' => TRUE, |
| 561 | 561 | 'load' => TRUE, |
| 562 | 562 | ); |
| 563 | 563 | $plugins['xhtmlxtras'] = array( |
| 564 | - 'path' => $editor['library path'] . '/plugins/xhtmlxtras', |
|
| 564 | + 'path' => $editor['library path'].'/plugins/xhtmlxtras', |
|
| 565 | 565 | 'buttons' => array('cite' => t('Citation'), 'del' => t('Deleted'), 'abbr' => t('Abbreviation'), 'acronym' => t('Acronym'), 'ins' => t('Inserted'), 'attribs' => t('HTML attributes')), |
| 566 | 566 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras', |
| 567 | 567 | 'internal' => TRUE, |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | } |
| 571 | 571 | if (version_compare($editor['installed version'], '3', '>')) { |
| 572 | 572 | $plugins['bbcode'] = array( |
| 573 | - 'path' => $editor['library path'] . '/plugins/bbcode', |
|
| 573 | + 'path' => $editor['library path'].'/plugins/bbcode', |
|
| 574 | 574 | 'extensions' => array('bbcode' => t('BBCode')), |
| 575 | 575 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode', |
| 576 | 576 | 'internal' => TRUE, |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | ); |
| 579 | 579 | if (version_compare($editor['installed version'], '3.3', '<')) { |
| 580 | 580 | $plugins['safari'] = array( |
| 581 | - 'path' => $editor['library path'] . '/plugins/safari', |
|
| 581 | + 'path' => $editor['library path'].'/plugins/safari', |
|
| 582 | 582 | 'extensions' => array('safari' => t('Safari compatibility')), |
| 583 | 583 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari', |
| 584 | 584 | 'internal' => TRUE, |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | } |
| 589 | 589 | if (version_compare($editor['installed version'], '3.2.5', '>=')) { |
| 590 | 590 | $plugins['autoresize'] = array( |
| 591 | - 'path' => $editor['library path'] . '/plugins/autoresize', |
|
| 591 | + 'path' => $editor['library path'].'/plugins/autoresize', |
|
| 592 | 592 | 'extensions' => array('autoresize' => t('Auto resize')), |
| 593 | 593 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize', |
| 594 | 594 | 'internal' => TRUE, |
@@ -597,7 +597,7 @@ discard block |
||
| 597 | 597 | } |
| 598 | 598 | if (version_compare($editor['installed version'], '3.3', '>=')) { |
| 599 | 599 | $plugins['advlist'] = array( |
| 600 | - 'path' => $editor['library path'] . '/plugins/advlist', |
|
| 600 | + 'path' => $editor['library path'].'/plugins/advlist', |
|
| 601 | 601 | 'extensions' => array('advlist' => t('Advanced list')), |
| 602 | 602 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist', |
| 603 | 603 | 'internal' => TRUE, |
@@ -606,7 +606,7 @@ discard block |
||
| 606 | 606 | } |
| 607 | 607 | if (version_compare($editor['installed version'], '3.2.6', '>=')) { |
| 608 | 608 | $plugins['wordcount'] = array( |
| 609 | - 'path' => $editor['library path'] . '/plugins/wordcount', |
|
| 609 | + 'path' => $editor['library path'].'/plugins/wordcount', |
|
| 610 | 610 | 'extensions' => array('wordcount' => t('Word count')), |
| 611 | 611 | 'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount', |
| 612 | 612 | 'internal' => TRUE, |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | function wysiwyg_help($path, $arg) { |
| 81 | 81 | switch ($path) { |
| 82 | 82 | case 'admin/settings/wysiwyg': |
| 83 | - $output = '<p>' . t('A Wysiwyg profile is associated with an input format. A Wysiwyg profile defines which client-side editor is loaded with a particular input format, what buttons or themes are enabled for the editor, how the editor is displayed, and a few other editor-specific functions.') . '</p>'; |
|
| 83 | + $output = '<p>'.t('A Wysiwyg profile is associated with an input format. A Wysiwyg profile defines which client-side editor is loaded with a particular input format, what buttons or themes are enabled for the editor, how the editor is displayed, and a few other editor-specific functions.').'</p>'; |
|
| 84 | 84 | return $output; |
| 85 | 85 | } |
| 86 | 86 | } |
@@ -179,9 +179,9 @@ discard block |
||
| 179 | 179 | if ($profile) { |
| 180 | 180 | $loaded = TRUE; |
| 181 | 181 | $editor = $profile->editor; |
| 182 | - $status = (int) wysiwyg_user_get_status($profile); |
|
| 182 | + $status = (int)wysiwyg_user_get_status($profile); |
|
| 183 | 183 | if (isset($profile->settings['show_toggle'])) { |
| 184 | - $toggle = (int) $profile->settings['show_toggle']; |
|
| 184 | + $toggle = (int)$profile->settings['show_toggle']; |
|
| 185 | 185 | } |
| 186 | 186 | // Check editor theme (and reset it if not/no longer available). |
| 187 | 187 | $theme = wysiwyg_get_editor_themes($profile, (isset($profile->settings['theme']) ? $profile->settings['theme'] : '')); |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | // Use a prefix/suffix for a single input format, or attach to input |
| 196 | 196 | // format selector radio buttons. |
| 197 | 197 | if (isset($element['format']['guidelines'])) { |
| 198 | - $element['format']['guidelines']['#prefix'] = '<div class="wysiwyg wysiwyg-format-' . $format . ' wysiwyg-editor-' . $editor . ' wysiwyg-field-' . $field['#id'] . ' wysiwyg-status-' . $status . ' wysiwyg-toggle-' . $toggle . $extra_class . '">'; |
|
| 198 | + $element['format']['guidelines']['#prefix'] = '<div class="wysiwyg wysiwyg-format-'.$format.' wysiwyg-editor-'.$editor.' wysiwyg-field-'.$field['#id'].' wysiwyg-status-'.$status.' wysiwyg-toggle-'.$toggle.$extra_class.'">'; |
|
| 199 | 199 | $element['format']['guidelines']['#suffix'] = '</div>'; |
| 200 | 200 | // Edge-case: Default format contains no input filters. |
| 201 | 201 | if (empty($element['format']['guidelines']['#value'])) { |
@@ -203,8 +203,8 @@ discard block |
||
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 | else { |
| 206 | - $element[$format]['#attributes']['class'] = (isset($element[$format]['#attributes']['class']) ? $element[$format]['#attributes']['class'] . ' ' : ''); |
|
| 207 | - $element[$format]['#attributes']['class'] .= 'wysiwyg wysiwyg-format-' . $format . ' wysiwyg-editor-' . $editor . ' wysiwyg-field-' . $field['#id'] . ' wysiwyg-status-' . $status . ' wysiwyg-toggle-' . $toggle . $extra_class; |
|
| 206 | + $element[$format]['#attributes']['class'] = (isset($element[$format]['#attributes']['class']) ? $element[$format]['#attributes']['class'].' ' : ''); |
|
| 207 | + $element[$format]['#attributes']['class'] .= 'wysiwyg wysiwyg-format-'.$format.' wysiwyg-editor-'.$editor.' wysiwyg-field-'.$field['#id'].' wysiwyg-status-'.$status.' wysiwyg-toggle-'.$toggle.$extra_class; |
|
| 208 | 208 | } |
| 209 | 209 | } |
| 210 | 210 | |
@@ -283,10 +283,10 @@ discard block |
||
| 283 | 283 | foreach ($files as $file => $options) { |
| 284 | 284 | if (is_array($options)) { |
| 285 | 285 | $options += array('type' => 'module', 'scope' => 'header', 'defer' => FALSE, 'cache' => TRUE, 'preprocess' => TRUE); |
| 286 | - drupal_add_js($editor['library path'] . '/' . $file, $options['type'], $options['scope'], $options['defer'], $options['cache'], $options['preprocess']); |
|
| 286 | + drupal_add_js($editor['library path'].'/'.$file, $options['type'], $options['scope'], $options['defer'], $options['cache'], $options['preprocess']); |
|
| 287 | 287 | } |
| 288 | 288 | else { |
| 289 | - drupal_add_js($editor['library path'] . '/' . $options); |
|
| 289 | + drupal_add_js($editor['library path'].'/'.$options); |
|
| 290 | 290 | } |
| 291 | 291 | } |
| 292 | 292 | // If editor defines an additional load callback, invoke it. |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | $files = $editor['js files']; |
| 301 | 301 | } |
| 302 | 302 | foreach ($files as $file) { |
| 303 | - drupal_add_js($editor['js path'] . '/' . $file); |
|
| 303 | + drupal_add_js($editor['js path'].'/'.$file); |
|
| 304 | 304 | } |
| 305 | 305 | // Load CSS stylesheets for this editor. |
| 306 | 306 | $files = array(); |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | $files = $editor['css files']; |
| 309 | 309 | } |
| 310 | 310 | foreach ($files as $file) { |
| 311 | - drupal_add_css($editor['css path'] . '/' . $file); |
|
| 311 | + drupal_add_css($editor['css path'].'/'.$file); |
|
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | drupal_add_js(array('wysiwyg' => array( |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | // @todo Move into (global) editor settings. |
| 317 | 317 | // If JS compression is enabled, at least TinyMCE is unable to determine |
| 318 | 318 | // its own base path and exec mode since it can't find the script name. |
| 319 | - 'editorBasePath' => base_path() . $editor['library path'], |
|
| 319 | + 'editorBasePath' => base_path().$editor['library path'], |
|
| 320 | 320 | 'execMode' => $library, |
| 321 | 321 | ))), |
| 322 | 322 | )), 'setting'); |
@@ -340,11 +340,11 @@ discard block |
||
| 340 | 340 | $path = drupal_get_path('module', 'wysiwyg'); |
| 341 | 341 | // Initialize our namespaces in the *header* to do not force editor |
| 342 | 342 | // integration scripts to check and define Drupal.wysiwyg on its own. |
| 343 | - drupal_add_js($path . '/wysiwyg.init.js', 'core'); |
|
| 343 | + drupal_add_js($path.'/wysiwyg.init.js', 'core'); |
|
| 344 | 344 | |
| 345 | 345 | // The 'none' editor is a special editor implementation, allowing us to |
| 346 | 346 | // attach and detach regular Drupal behaviors just like any other editor. |
| 347 | - drupal_add_js($path . '/editors/js/none.js'); |
|
| 347 | + drupal_add_js($path.'/editors/js/none.js'); |
|
| 348 | 348 | |
| 349 | 349 | // Add wysiwyg.js to the footer to ensure it's executed after the |
| 350 | 350 | // Drupal.settings array has been rendered and populated. Also, since editor |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | // and Drupal.wysiwygInit() must be executed AFTER editors registered |
| 353 | 353 | // their callbacks and BEFORE Drupal.behaviors are applied, this must come |
| 354 | 354 | // last. |
| 355 | - drupal_add_js($path . '/wysiwyg.js', 'module', 'footer'); |
|
| 355 | + drupal_add_js($path.'/wysiwyg.js', 'module', 'footer'); |
|
| 356 | 356 | |
| 357 | 357 | $settings_added = TRUE; |
| 358 | 358 | } |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | // drupal_to_js() does not properly convert numeric array keys, so we need |
| 372 | 372 | // to use a string instead of the format id. |
| 373 | 373 | if ($config) { |
| 374 | - drupal_add_js(array('wysiwyg' => array('configs' => array($profile->editor => array('format' . $profile->format => $config)))), 'setting'); |
|
| 374 | + drupal_add_js(array('wysiwyg' => array('configs' => array($profile->editor => array('format'.$profile->format => $config)))), 'setting'); |
|
| 375 | 375 | } |
| 376 | 376 | $formats[$profile->format] = TRUE; |
| 377 | 377 | } |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | $settings_native = call_user_func($editor['plugin settings callback'], $editor, $profile, $profile_plugins_native); |
| 449 | 449 | |
| 450 | 450 | if ($settings_native) { |
| 451 | - drupal_add_js(array('wysiwyg' => array('plugins' => array('format' . $profile->format => array('native' => $settings_native)))), 'setting'); |
|
| 451 | + drupal_add_js(array('wysiwyg' => array('plugins' => array('format'.$profile->format => array('native' => $settings_native)))), 'setting'); |
|
| 452 | 452 | } |
| 453 | 453 | } |
| 454 | 454 | |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | if (!isset($processed_plugins[$proxy][$plugin])) { |
| 464 | 464 | $profile_plugins_drupal[$plugin] = $processed_plugins[$proxy][$plugin] = $meta; |
| 465 | 465 | // Load the Drupal plugin's JavaScript. |
| 466 | - drupal_add_js($meta['js path'] . '/' . $meta['js file']); |
|
| 466 | + drupal_add_js($meta['js path'].'/'.$meta['js file']); |
|
| 467 | 467 | // Add plugin-specific settings. |
| 468 | 468 | if (isset($meta['settings'])) { |
| 469 | 469 | drupal_add_js(array('wysiwyg' => array('plugins' => array('drupal' => array($plugin => $meta['settings'])))), 'setting'); |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | $settings_drupal = call_user_func($editor['proxy plugin settings callback'], $editor, $profile, $profile_plugins_drupal); |
| 480 | 480 | |
| 481 | 481 | if ($settings_drupal) { |
| 482 | - drupal_add_js(array('wysiwyg' => array('plugins' => array('format' . $profile->format => array('drupal' => $settings_drupal)))), 'setting'); |
|
| 482 | + drupal_add_js(array('wysiwyg' => array('plugins' => array('format'.$profile->format => array('drupal' => $settings_drupal)))), 'setting'); |
|
| 483 | 483 | } |
| 484 | 484 | } |
| 485 | 485 | } |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | if ($media != 'print') { |
| 597 | 597 | foreach ($css['theme'] as $filepath => $preprocess) { |
| 598 | 598 | if (file_exists($filepath)) { |
| 599 | - $files[] = base_path() . $filepath; |
|
| 599 | + $files[] = base_path().$filepath; |
|
| 600 | 600 | } |
| 601 | 601 | } |
| 602 | 602 | } |
@@ -719,7 +719,7 @@ discard block |
||
| 719 | 719 | db_query("INSERT INTO {wysiwyg_user} (uid, format, status) VALUES (%d, %d, %d)", array( |
| 720 | 720 | $account->uid, |
| 721 | 721 | $format, |
| 722 | - (int) (bool) $status, |
|
| 722 | + (int)(bool)$status, |
|
| 723 | 723 | )); |
| 724 | 724 | } |
| 725 | 725 | } |
@@ -750,7 +750,7 @@ discard block |
||
| 750 | 750 | $status = isset($profile->settings['default']) ? $profile->settings['default'] : TRUE; |
| 751 | 751 | } |
| 752 | 752 | |
| 753 | - return (bool) $status; |
|
| 753 | + return (bool)$status; |
|
| 754 | 754 | } |
| 755 | 755 | |
| 756 | 756 | /** |
@@ -802,8 +802,8 @@ discard block |
||
| 802 | 802 | 'plugin callback' => NULL, |
| 803 | 803 | 'plugin settings callback' => NULL, |
| 804 | 804 | 'versions' => array(), |
| 805 | - 'js path' => $editors[$editor]['path'] . '/js', |
|
| 806 | - 'css path' => $editors[$editor]['path'] . '/css', |
|
| 805 | + 'js path' => $editors[$editor]['path'].'/js', |
|
| 806 | + 'css path' => $editors[$editor]['path'].'/css', |
|
| 807 | 807 | ); |
| 808 | 808 | // Check whether library is present. |
| 809 | 809 | if (!($editors[$editor]['installed'] = file_exists($editors[$editor]['library path']))) { |
@@ -855,12 +855,12 @@ discard block |
||
| 855 | 855 | $plugin += array( |
| 856 | 856 | 'title' => $plugin['name'], |
| 857 | 857 | 'vendor url' => '', |
| 858 | - 'js path' => $plugin['path'] . '/' . $plugin['name'], |
|
| 859 | - 'js file' => $plugin['name'] . '.js', |
|
| 860 | - 'css path' => $plugin['path'] . '/' . $plugin['name'], |
|
| 861 | - 'css file' => $plugin['name'] . '.css', |
|
| 862 | - 'icon path' => $plugin['path'] . '/' . $plugin['name'] . '/images', |
|
| 863 | - 'icon file' => $plugin['name'] . '.png', |
|
| 858 | + 'js path' => $plugin['path'].'/'.$plugin['name'], |
|
| 859 | + 'js file' => $plugin['name'].'.js', |
|
| 860 | + 'css path' => $plugin['path'].'/'.$plugin['name'], |
|
| 861 | + 'css file' => $plugin['name'].'.css', |
|
| 862 | + 'icon path' => $plugin['path'].'/'.$plugin['name'].'/images', |
|
| 863 | + 'icon file' => $plugin['name'].'.png', |
|
| 864 | 864 | 'dialog path' => $plugin['name'], |
| 865 | 865 | 'dialog settings' => array(), |
| 866 | 866 | 'settings callback' => NULL, |
@@ -868,10 +868,10 @@ discard block |
||
| 868 | 868 | ); |
| 869 | 869 | // Fill in default settings. |
| 870 | 870 | $plugin['settings'] += array( |
| 871 | - 'path' => base_path() . $plugin['path'] . '/' . $plugin['name'], |
|
| 871 | + 'path' => base_path().$plugin['path'].'/'.$plugin['name'], |
|
| 872 | 872 | ); |
| 873 | 873 | // Check whether library is present. |
| 874 | - if (!($plugin['installed'] = file_exists($plugin['js path'] . '/' . $plugin['js file']))) { |
|
| 874 | + if (!($plugin['installed'] = file_exists($plugin['js path'].'/'.$plugin['js file']))) { |
|
| 875 | 875 | continue; |
| 876 | 876 | } |
| 877 | 877 | } |
@@ -893,18 +893,18 @@ discard block |
||
| 893 | 893 | function wysiwyg_load_includes($type = 'editors', $hook = 'editor', $file = NULL) { |
| 894 | 894 | // Determine implementations. |
| 895 | 895 | $directories = wysiwyg_get_directories($type); |
| 896 | - $directories['wysiwyg'] = drupal_get_path('module', 'wysiwyg') . '/' . $type; |
|
| 896 | + $directories['wysiwyg'] = drupal_get_path('module', 'wysiwyg').'/'.$type; |
|
| 897 | 897 | $file_list = array(); |
| 898 | 898 | foreach ($directories as $module => $path) { |
| 899 | - $file_list[$module] = drupal_system_listing("$file" . '.inc$', $path, 'name', 0); |
|
| 899 | + $file_list[$module] = drupal_system_listing("$file".'.inc$', $path, 'name', 0); |
|
| 900 | 900 | } |
| 901 | 901 | |
| 902 | 902 | // Load implementations. |
| 903 | 903 | $info = array(); |
| 904 | 904 | foreach (array_filter($file_list) as $module => $files) { |
| 905 | 905 | foreach ($files as $file) { |
| 906 | - include_once './' . $file->filename; |
|
| 907 | - $result = _wysiwyg_process_include($module, $module . '_' . $file->name, dirname($file->filename), $hook); |
|
| 906 | + include_once './'.$file->filename; |
|
| 907 | + $result = _wysiwyg_process_include($module, $module.'_'.$file->name, dirname($file->filename), $hook); |
|
| 908 | 908 | if (is_array($result)) { |
| 909 | 909 | $info = array_merge($info, $result); |
| 910 | 910 | } |
@@ -934,7 +934,7 @@ discard block |
||
| 934 | 934 | } |
| 935 | 935 | if (!isset($libraries[$library])) { |
| 936 | 936 | // Most often, external libraries can be shared across multiple sites. |
| 937 | - return 'sites/all/libraries/' . $library; |
|
| 937 | + return 'sites/all/libraries/'.$library; |
|
| 938 | 938 | } |
| 939 | 939 | |
| 940 | 940 | $path = ($base_path ? base_path() : ''); |
@@ -984,7 +984,7 @@ discard block |
||
| 984 | 984 | } |
| 985 | 985 | |
| 986 | 986 | // Always search sites/all/*. |
| 987 | - $searchdir[] = 'sites/all/' . $directory; |
|
| 987 | + $searchdir[] = 'sites/all/'.$directory; |
|
| 988 | 988 | |
| 989 | 989 | // Also search sites/<domain>/*. |
| 990 | 990 | if (file_exists("$config/$directory")) { |
@@ -1028,7 +1028,7 @@ discard block |
||
| 1028 | 1028 | foreach (module_implements('wysiwyg_include_directory') as $module) { |
| 1029 | 1029 | $result = module_invoke($module, 'wysiwyg_include_directory', $plugintype); |
| 1030 | 1030 | if (isset($result) && is_string($result)) { |
| 1031 | - $directories[$module] = drupal_get_path('module', $module) . '/' . $result; |
|
| 1031 | + $directories[$module] = drupal_get_path('module', $module).'/'.$result; |
|
| 1032 | 1032 | } |
| 1033 | 1033 | } |
| 1034 | 1034 | return $directories; |
@@ -1045,7 +1045,7 @@ discard block |
||
| 1045 | 1045 | * The name of the hook being invoked. |
| 1046 | 1046 | */ |
| 1047 | 1047 | function _wysiwyg_process_include($module, $identifier, $path, $hook) { |
| 1048 | - $function = $identifier . '_' . $hook; |
|
| 1048 | + $function = $identifier.'_'.$hook; |
|
| 1049 | 1049 | if (!function_exists($function)) { |
| 1050 | 1050 | return NULL; |
| 1051 | 1051 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | if (!isset($plugins[$plugin])) { |
| 14 | 14 | return drupal_access_denied(); |
| 15 | 15 | } |
| 16 | - $callback = $plugin . '_wysiwyg_dialog'; |
|
| 16 | + $callback = $plugin.'_wysiwyg_dialog'; |
|
| 17 | 17 | if (!function_exists($callback)) { |
| 18 | 18 | return drupal_not_found(); |
| 19 | 19 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | 'url' => 'http://drupal.org/project/img_assist', |
| 46 | 46 | // The full path to the native editor plugin, no trailing slash. |
| 47 | 47 | // Ignored when 'internal' is set to TRUE below. |
| 48 | - 'path' => drupal_get_path('module', 'img_assist') . '/drupalimage', |
|
| 48 | + 'path' => drupal_get_path('module', 'img_assist').'/drupalimage', |
|
| 49 | 49 | // The name of the plugin's main JavaScript file. |
| 50 | 50 | // Ignored when 'internal' is set to TRUE below. |
| 51 | 51 | // Default value depends on which editor the plugin is for. |
@@ -150,13 +150,13 @@ discard block |
||
| 150 | 150 | 'icon title' => t('Do something'), |
| 151 | 151 | // An alternative path to the integration JavaScript; defaults to |
| 152 | 152 | // '[path-to-module]/[plugins-directory]/[plugin-name]'. |
| 153 | - 'js path' => drupal_get_path('module', 'mymodule') . '/awesomeness', |
|
| 153 | + 'js path' => drupal_get_path('module', 'mymodule').'/awesomeness', |
|
| 154 | 154 | // An alternative filename of the integration JavaScript; defaults to |
| 155 | 155 | // '[plugin-name].js'. |
| 156 | 156 | 'js file' => 'awesome.js', |
| 157 | 157 | // An alternative path to the integration stylesheet; defaults to |
| 158 | 158 | // '[path-to-module]/[plugins-directory]/[plugin-name]'. |
| 159 | - 'css path' => drupal_get_path('module', 'mymodule') . '/awesomeness', |
|
| 159 | + 'css path' => drupal_get_path('module', 'mymodule').'/awesomeness', |
|
| 160 | 160 | // An alternative filename of the integration stylesheet; defaults to |
| 161 | 161 | // '[plugin-name].css'. |
| 162 | 162 | 'css file' => 'awesome.css', |
@@ -18,13 +18,13 @@ discard block |
||
| 18 | 18 | $links['mark-read']['title'] = t('Mark all topics read'); |
| 19 | 19 | $links['mark-read']['href'] = "community/forum/{$tid}/read"; |
| 20 | 20 | |
| 21 | - return l(t('Mark all topics read') . '<span class="image-replace"></span>', "forum/markasread/$tid", array('html' => TRUE)); |
|
| 21 | + return l(t('Mark all topics read').'<span class="image-replace"></span>', "forum/markasread/$tid", array('html' => TRUE)); |
|
| 22 | 22 | } |
| 23 | 23 | else { |
| 24 | 24 | $links['mark-read']['title'] = t('Mark all forums read'); |
| 25 | 25 | $links['mark-read']['href'] = "community/forum/0/read"; |
| 26 | 26 | |
| 27 | - return l(t('Mark all forums read') . '<span class="image-replace"></span>', "forum/markasread", array('html' => TRUE)); |
|
| 27 | + return l(t('Mark all forums read').'<span class="image-replace"></span>', "forum/markasread", array('html' => TRUE)); |
|
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | drupal_set_message(t('All content in this forum has been marked as read')); |
| 65 | - drupal_goto('community/forum/' . $current_forum_id); |
|
| 65 | + drupal_goto('community/forum/'.$current_forum_id); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // We are on the forum overview, requesting all forums be marked read |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | function bbcode_filter_tips($delta, $format, $long = false) { |
| 10 | 10 | if ($long) { |
| 11 | - include_once(drupal_get_path('module', 'bbcode') .'/bbcode-help.inc'); |
|
| 11 | + include_once(drupal_get_path('module', 'bbcode').'/bbcode-help.inc'); |
|
| 12 | 12 | return _bbcode_filter_tip(); |
| 13 | 13 | } |
| 14 | 14 | else { |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | array( |
| 18 | 18 | '!BBCode' => l(t('BBCode'), "filter/tips/$format", |
| 19 | 19 | array( |
| 20 | - 'fragment' => 'filter-bbcode-' . $delta, |
|
| 20 | + 'fragment' => 'filter-bbcode-'.$delta, |
|
| 21 | 21 | 'attributes' => |
| 22 | 22 | array( |
| 23 | 23 | 'target'=>'_blank', |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | )) |
| 27 | 27 | )); |
| 28 | 28 | if (variable_get("bbcode_make_links_$format", FALSE)) { |
| 29 | - $output .= ' '. t('URLs will automatically be converted to links.'); |
|
| 29 | + $output .= ' '.t('URLs will automatically be converted to links.'); |
|
| 30 | 30 | } |
| 31 | 31 | return $output; |
| 32 | 32 | } |
@@ -41,14 +41,14 @@ discard block |
||
| 41 | 41 | return t('Converts BBCode to HTML.'); |
| 42 | 42 | |
| 43 | 43 | case 'process': |
| 44 | - include_once(drupal_get_path('module', 'bbcode') .'/bbcode-filter.inc'); |
|
| 44 | + include_once(drupal_get_path('module', 'bbcode').'/bbcode-filter.inc'); |
|
| 45 | 45 | if (variable_get("bbcode_debug_$format", 0)) { |
| 46 | 46 | $timing_start = explode(' ', microtime()); |
| 47 | 47 | $ret = _bbcode_filter_process($text, $format); |
| 48 | 48 | $timing_stop = explode(' ', microtime()); |
| 49 | 49 | $elapsed = $timing_stop[1] - $timing_start[1]; |
| 50 | 50 | $elapsed += $timing_stop[0] - $timing_start[0]; |
| 51 | - $ret .= '<hr />'. l('BBCode', "filter/tips/$format") .' parsed on '.date('r').'<br />Execution time: '.$elapsed.' seconds.<hr />'; |
|
| 51 | + $ret .= '<hr />'.l('BBCode', "filter/tips/$format").' parsed on '.date('r').'<br />Execution time: '.$elapsed.' seconds.<hr />'; |
|
| 52 | 52 | return $ret; |
| 53 | 53 | } |
| 54 | 54 | else |
@@ -102,14 +102,14 @@ discard block |
||
| 102 | 102 | * Alter icons if the quicktags module is enabled |
| 103 | 103 | */ |
| 104 | 104 | function bbcode_quicktags_alter($items) { |
| 105 | - $path = base_path() . drupal_get_path('module','quicktags') .'/'; |
|
| 105 | + $path = base_path().drupal_get_path('module', 'quicktags').'/'; |
|
| 106 | 106 | $items['ed_italic'] = array( |
| 107 | 107 | 'name' => 'italic', |
| 108 | 108 | 'prefix' => '[i]', |
| 109 | 109 | 'suffix' => '[/i]', |
| 110 | 110 | 'accesskey' => 'i', |
| 111 | 111 | 'weight' => 10, |
| 112 | - 'icon' => $path .'ed_italic.png', |
|
| 112 | + 'icon' => $path.'ed_italic.png', |
|
| 113 | 113 | ); |
| 114 | 114 | $items['ed_bold'] = array( |
| 115 | 115 | 'name' => 'bold', |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | 'suffix' => '[/b]', |
| 118 | 118 | 'accesskey' => 'b', |
| 119 | 119 | 'weight' => 20, |
| 120 | - 'icon' => $path .'ed_bold.png', |
|
| 120 | + 'icon' => $path.'ed_bold.png', |
|
| 121 | 121 | ); |
| 122 | 122 | $items['ed_code'] = array( |
| 123 | 123 | 'name' => 'code', |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | 'suffix' => '[/code]', |
| 126 | 126 | 'accesskey' => 'c', |
| 127 | 127 | 'weight' => 30, |
| 128 | - 'icon' => $path .'ed_code.png', |
|
| 128 | + 'icon' => $path.'ed_code.png', |
|
| 129 | 129 | ); |
| 130 | 130 | $items['ed_block'] = array( |
| 131 | 131 | 'name' => 'quote', |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | 'suffix' => '[/quote]', |
| 134 | 134 | 'accesskey' => 'q', |
| 135 | 135 | 'weight' => 40, |
| 136 | - 'icon' => $path .'ed_block.png', |
|
| 136 | + 'icon' => $path.'ed_block.png', |
|
| 137 | 137 | ); |
| 138 | 138 | $items['ed_link'] = array( |
| 139 | 139 | 'name' => 'link', |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | 'suffix' => '[/url]', |
| 142 | 142 | 'accesskey' => 'l', |
| 143 | 143 | 'weight' => 50, |
| 144 | - 'icon' => $path .'ed_link.png', |
|
| 144 | + 'icon' => $path.'ed_link.png', |
|
| 145 | 145 | ); |
| 146 | 146 | return $items; |
| 147 | 147 | } |
@@ -17,14 +17,14 @@ discard block |
||
| 17 | 17 | foreach ($code_tags as $code_tag) { |
| 18 | 18 | $code_tag[1] = str_replace(array('<', '>'), array('<', '>'), $code_tag[1]); |
| 19 | 19 | if (strpos($code_tag[1], "\n") === FALSE) |
| 20 | - $body = str_replace($code_tag[0], '<code class="bb-code">'. $code_tag[1] .'</code>', $body); |
|
| 20 | + $body = str_replace($code_tag[0], '<code class="bb-code">'.$code_tag[1].'</code>', $body); |
|
| 21 | 21 | elseif ($mode) { |
| 22 | 22 | // Strip preformatted code blocks from text during line break processing, replaced below |
| 23 | 23 | $body = str_replace($code_tag[0], "***pRe_sTrInG$i***", $body); |
| 24 | - $pre[$i++] = '<pre class="bb-code-block">'. $code_tag[1] .'</pre>'; |
|
| 24 | + $pre[$i++] = '<pre class="bb-code-block">'.$code_tag[1].'</pre>'; |
|
| 25 | 25 | } |
| 26 | 26 | else |
| 27 | - $body = str_replace($code_tag[0], '<pre class="bb-code-block">'. $code_tag[1] .'</pre>', $body); |
|
| 27 | + $body = str_replace($code_tag[0], '<pre class="bb-code-block">'.$code_tag[1].'</pre>', $body); |
|
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | |
@@ -38,14 +38,14 @@ discard block |
||
| 38 | 38 | $body = preg_replace("/(\r\n|\n|\r)/", "\n", $body); |
| 39 | 39 | $body = preg_replace("/\n\n+/", "\n\n", $body); |
| 40 | 40 | $parts = explode("\n\n", $body); |
| 41 | - for ($i=0; $i<sizeof($parts); $i++) { |
|
| 41 | + for ($i = 0; $i < sizeof($parts); $i++) { |
|
| 42 | 42 | // No linebreaks if paragraph starts with an HTML tag |
| 43 | - if ( !preg_match('/^<.*>/', $parts[$i]) ) |
|
| 43 | + if (!preg_match('/^<.*>/', $parts[$i])) |
|
| 44 | 44 | $parts[$i] = nl2br($parts[$i]); |
| 45 | 45 | |
| 46 | 46 | // Some tags should not be in paragraph blocks |
| 47 | - if ( !preg_match('/^(?:<|\[)(?:table|list|ol|ul|pre|select|form|blockquote|hr)/i', $parts[$i]) ) |
|
| 48 | - $parts[$i] = '<p>'. $parts[$i] .'</p>'; |
|
| 47 | + if (!preg_match('/^(?:<|\[)(?:table|list|ol|ul|pre|select|form|blockquote|hr)/i', $parts[$i])) |
|
| 48 | + $parts[$i] = '<p>'.$parts[$i].'</p>'; |
|
| 49 | 49 | } |
| 50 | 50 | $body = implode("\n\n", $parts); |
| 51 | 51 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | // Also add opening tags, if needed |
| 71 | 71 | for ($i = $unclosed; $i < 0; $i++) { |
| 72 | - $body = '[quote]' . $body; |
|
| 72 | + $body = '[quote]'.$body; |
|
| 73 | 73 | } |
| 74 | 74 | preg_match_all('/\[list/i', $body, $matches); |
| 75 | 75 | $opentags = count($matches['0']); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $body .= '[/list]'; |
| 80 | 80 | } |
| 81 | 81 | for ($i = $unclosed; $i < 0; $i++) { |
| 82 | - $body = '[list]' . $body; |
|
| 82 | + $body = '[list]'.$body; |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | // begin processing for [size] |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | } |
| 239 | 239 | else { |
| 240 | 240 | $body = preg_replace( |
| 241 | - array('#\[email(?::\w+)?\](.*?)\[/email(?::\w+)?\]#si','#\[email=(.*?)(?::\w+)?\]([\w\s]+)\[/email(?::\w+)?\]#si'), |
|
| 241 | + array('#\[email(?::\w+)?\](.*?)\[/email(?::\w+)?\]#si', '#\[email=(.*?)(?::\w+)?\]([\w\s]+)\[/email(?::\w+)?\]#si'), |
|
| 242 | 242 | array('<a href="mailto:\\1" class="bb-email">\\1</a>', '<a href="mailto:\\1" class="bb-email">\\2</a>'), |
| 243 | 243 | $body); |
| 244 | 244 | } |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | if (variable_get("bbcode_make_links_$format", 1)) { |
| 248 | 248 | |
| 249 | 249 | // pad with a space so we can match things at the start of the 1st line |
| 250 | - $ret = ' ' . $body; |
|
| 250 | + $ret = ' '.$body; |
|
| 251 | 251 | // padding to already filtered links |
| 252 | 252 | $ret = preg_replace('#(<a.+>)(.+</a>)#i', "$1\x07$2", $ret); |
| 253 | 253 | |
@@ -283,41 +283,41 @@ discard block |
||
| 283 | 283 | |
| 284 | 284 | function _bbcode_generate_heading($level, $text) { |
| 285 | 285 | $anchor = preg_replace('/([\s]+)/', '_', $text); |
| 286 | - $anchor = preg_replace('/([\W]+)/', '', $anchor); |
|
| 287 | - return '<h'. $level .'><a name="'. $anchor .'">'. $text .'</a></h'. $level .'>'; |
|
| 286 | + $anchor = preg_replace('/([\W]+)/', '', $anchor); |
|
| 287 | + return '<h'.$level.'><a name="'.$anchor.'">'.$text.'</a></h'.$level.'>'; |
|
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | function _bbcode_generate_index($body, $tag = 'ol') { |
| 291 | 291 | $level = 0; |
| 292 | - $index = '<'. $tag .">\n"; |
|
| 292 | + $index = '<'.$tag.">\n"; |
|
| 293 | 293 | $close_tags = 0; |
| 294 | 294 | |
| 295 | 295 | if (preg_match_all('#\[h([1-6]).*?\](.*?)\[/h([1-6]).*?\]#si', $body, $head_tags, PREG_SET_ORDER)) { |
| 296 | 296 | foreach ($head_tags as $head_tag) { |
| 297 | 297 | if ($level == 0) $level = $head_tag[1]; |
| 298 | 298 | $anchor = preg_replace('/([\s]+)/', '_', $head_tag[2]); |
| 299 | - $anchor = preg_replace('/([\W]+)/', '', $anchor); |
|
| 299 | + $anchor = preg_replace('/([\W]+)/', '', $anchor); |
|
| 300 | 300 | |
| 301 | 301 | if ($head_tag[1] > $level) { |
| 302 | - $index .= '<'. $tag .">\n"; |
|
| 303 | - $index .= '<li><a href="#'. $anchor .'">'. $head_tag[2] ."</a>\n"; |
|
| 302 | + $index .= '<'.$tag.">\n"; |
|
| 303 | + $index .= '<li><a href="#'.$anchor.'">'.$head_tag[2]."</a>\n"; |
|
| 304 | 304 | $close_tags++; |
| 305 | 305 | $level = $head_tag[1]; |
| 306 | 306 | } else if ($head_tag[1] < $level) { |
| 307 | 307 | while ($close_tags > 0) { |
| 308 | - $index .= '</'. $tag .">\n"; |
|
| 308 | + $index .= '</'.$tag.">\n"; |
|
| 309 | 309 | $close_tags--; |
| 310 | 310 | } |
| 311 | - $index .= '<li><a href="#'. $anchor .'">'. $head_tag[2] ."</a>\n"; |
|
| 311 | + $index .= '<li><a href="#'.$anchor.'">'.$head_tag[2]."</a>\n"; |
|
| 312 | 312 | $level = $head_tag[1]; |
| 313 | 313 | } else { |
| 314 | - $index .= '<li><a href="#'. $anchor .'">'. $head_tag[2] ."</a>\n"; |
|
| 314 | + $index .= '<li><a href="#'.$anchor.'">'.$head_tag[2]."</a>\n"; |
|
| 315 | 315 | $level = $head_tag[1]; |
| 316 | 316 | } |
| 317 | 317 | } |
| 318 | 318 | } |
| 319 | 319 | while ($close_tags >= 0) { |
| 320 | - $index .= '</'. $tag .">\n"; |
|
| 320 | + $index .= '</'.$tag.">\n"; |
|
| 321 | 321 | $close_tags--; |
| 322 | 322 | } |
| 323 | 323 | return $index; |
@@ -325,27 +325,27 @@ discard block |
||
| 325 | 325 | |
| 326 | 326 | function _bbcode_encode_mailto($matches) { |
| 327 | 327 | if (isset($matches[3])) |
| 328 | - $link = 'document.write(\'<a href="mailto:' . $matches[2].'@'.$matches[3] . '">' . $matches[2].'@'.$matches[3] . '</a>\');'; |
|
| 328 | + $link = 'document.write(\'<a href="mailto:'.$matches[2].'@'.$matches[3].'">'.$matches[2].'@'.$matches[3].'</a>\');'; |
|
| 329 | 329 | else |
| 330 | - $link = 'document.write(\'<a href="mailto:' . $matches[1] . '" class="bb-email">' . (isset($matches[2]) ? $matches[2] : $matches[1]) . '</a>\');'; |
|
| 330 | + $link = 'document.write(\'<a href="mailto:'.$matches[1].'" class="bb-email">'.(isset($matches[2]) ? $matches[2] : $matches[1]).'</a>\');'; |
|
| 331 | 331 | |
| 332 | 332 | $js_encode = ''; |
| 333 | 333 | for ($x = 0; $x < strlen($link); $x++) |
| 334 | - $js_encode .= '%' . bin2hex($link{$x}); |
|
| 334 | + $js_encode .= '%'.bin2hex($link{$x}); |
|
| 335 | 335 | |
| 336 | 336 | $link = '<script type="text/javascript">eval(unescape(\''.$js_encode.'\'))</script>'; |
| 337 | 337 | if (isset($matches[3])) |
| 338 | - $link = $matches[1] . $link; |
|
| 338 | + $link = $matches[1].$link; |
|
| 339 | 339 | |
| 340 | 340 | return $link; |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | function _bbcode_notag_tag($text = NULL) { |
| 344 | - return str_replace( array('[', ']', '@'), array('[', ']', '@'), stripslashes($text)); |
|
| 344 | + return str_replace(array('[', ']', '@'), array('[', ']', '@'), stripslashes($text)); |
|
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | function _bbcode_php_tag($text = NULL) { |
| 348 | - return '<pre>'. highlight_string( str_replace('<br />', '', stripslashes($text)), true) .'</pre>'; |
|
| 348 | + return '<pre>'.highlight_string(str_replace('<br />', '', stripslashes($text)), true).'</pre>'; |
|
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | function _bbcode_round_size_val($size) { |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | function _bbcode_replace_nest_tag($arr = NULL) { |
| 361 | - $text = preg_replace('#(\[[/]*)'. $arr['tag'] .'(.*?\])#si', "$1\x07$2", $arr['text']); |
|
| 361 | + $text = preg_replace('#(\[[/]*)'.$arr['tag'].'(.*?\])#si', "$1\x07$2", $arr['text']); |
|
| 362 | 362 | // It will be better to use &count and do-while, if php 5 or higher. |
| 363 | 363 | while (preg_match($arr['pattern'], $text)) { |
| 364 | 364 | $text = preg_replace($arr['pattern'], $arr['replacement'], $text); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $field['active'] = 1; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - $field['columns'] = (array) module_invoke($module, 'field_settings', 'database columns', $field); |
|
| 45 | + $field['columns'] = (array)module_invoke($module, 'field_settings', 'database columns', $field); |
|
| 46 | 46 | // Ensure columns always default to NULL values. |
| 47 | 47 | foreach ($field['columns'] as $column_name => $column) { |
| 48 | 48 | $field['columns'][$column_name]['not null'] = FALSE; |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $field['db_storage'] = CONTENT_DB_STORAGE_PER_CONTENT_TYPE; |
| 54 | 54 | |
| 55 | 55 | // Make sure field settings all have an index in the array. |
| 56 | - $setting_names = (array) module_invoke($module, 'field_settings', 'save', $field); |
|
| 56 | + $setting_names = (array)module_invoke($module, 'field_settings', 'save', $field); |
|
| 57 | 57 | drupal_alter('field_settings', $setting_names, 'save', $field); |
| 58 | 58 | foreach ($setting_names as $setting) { |
| 59 | 59 | $field[$setting] = NULL; |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | // Make sure widget settings all have an index in the array. |
| 95 | - $settings_names = (array) module_invoke($module, 'widget_settings', 'save', $widget); |
|
| 95 | + $settings_names = (array)module_invoke($module, 'widget_settings', 'save', $widget); |
|
| 96 | 96 | drupal_alter('widget_settings', $settings_names, 'save', $widget); |
| 97 | 97 | $widget['widget_settings'] = array(); |
| 98 | 98 | foreach ($settings_names as $name) { |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | // initialize $widget_settings with default values, |
| 134 | 134 | if (isset($field['default_value']) && isset($field['default_value_php']) && |
| 135 | 135 | content_callback('widget', 'default value', $field) == CONTENT_CALLBACK_DEFAULT) { |
| 136 | - $field['widget']['default_value'] = !empty($field['default_value']) ? $field['default_value'] : NULL; |
|
| 136 | + $field['widget']['default_value'] = !empty($field['default_value']) ? $field['default_value'] : NULL; |
|
| 137 | 137 | $field['widget']['default_value_php'] = !empty($field['default_value_php']) ? $field['default_value_php'] : NULL; |
| 138 | 138 | unset($field['default_value']); |
| 139 | 139 | unset($field['default_value_php']); |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | * @see menu_rebuild() |
| 209 | 209 | */ |
| 210 | 210 | function content_field_instance_create($field, $rebuild = TRUE) { |
| 211 | - include_once('./'. drupal_get_path('module', 'content') .'/includes/content.admin.inc'); |
|
| 211 | + include_once('./'.drupal_get_path('module', 'content').'/includes/content.admin.inc'); |
|
| 212 | 212 | |
| 213 | 213 | $form_values = $field; |
| 214 | 214 | $field = content_field_instance_expand($field); |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | $field['db_storage'] = content_storage_type($field); |
| 256 | 256 | |
| 257 | 257 | // Get a fresh copy of the column information whenever a field is created. |
| 258 | - $field['columns'] = (array) module_invoke($field['module'], 'field_settings', 'database columns', $field); |
|
| 258 | + $field['columns'] = (array)module_invoke($field['module'], 'field_settings', 'database columns', $field); |
|
| 259 | 259 | |
| 260 | 260 | if (empty($prev_field['widget']) || $prior_instances < 1) { |
| 261 | 261 | // If this is the first instance, create the field. |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | * @see menu_rebuild() |
| 320 | 320 | */ |
| 321 | 321 | function content_field_instance_update($field, $rebuild = TRUE) { |
| 322 | - include_once('./'. drupal_get_path('module', 'content') .'/includes/content.admin.inc'); |
|
| 322 | + include_once('./'.drupal_get_path('module', 'content').'/includes/content.admin.inc'); |
|
| 323 | 323 | |
| 324 | 324 | // Ensure the field description is in the 'expanded' form. |
| 325 | 325 | $field = content_field_instance_expand($field); |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | |
| 346 | 346 | // Changes in field values may affect columns, or column |
| 347 | 347 | // information may have changed, get a fresh copy. |
| 348 | - $field['columns'] = (array) module_invoke($field['module'], 'field_settings', 'database columns', $field); |
|
| 348 | + $field['columns'] = (array)module_invoke($field['module'], 'field_settings', 'database columns', $field); |
|
| 349 | 349 | |
| 350 | 350 | // If the database storage has changed, update the field and previous instances. |
| 351 | 351 | $prior_instances = content_field_instance_read(array('field_name' => $field['field_name'])); |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | function _content_field_write($field, $op = 'update') { |
| 400 | 400 | // Rearrange the data to create the global_settings array. |
| 401 | 401 | $field['global_settings'] = array(); |
| 402 | - $setting_names = (array) module_invoke($field['module'], 'field_settings', 'save', $field); |
|
| 402 | + $setting_names = (array)module_invoke($field['module'], 'field_settings', 'save', $field); |
|
| 403 | 403 | drupal_alter('field_settings', $setting_names, 'save', $field); |
| 404 | 404 | |
| 405 | 405 | foreach ($setting_names as $setting) { |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | $field = content_field_instance_collapse($field); |
| 436 | 436 | |
| 437 | 437 | // Rearrange the data to create the widget_settings array. |
| 438 | - $setting_names = (array) module_invoke($field['widget_module'], 'widget_settings', 'save', $field); |
|
| 438 | + $setting_names = (array)module_invoke($field['widget_module'], 'widget_settings', 'save', $field); |
|
| 439 | 439 | drupal_alter('widget_settings', $setting_names, 'save', $field); |
| 440 | 440 | foreach ($setting_names as $setting) { |
| 441 | 441 | // In some cases (when the updated $field was originally read from |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | if (is_array($param)) { |
| 479 | 479 | // Turn the conditions into a query. |
| 480 | 480 | foreach ($param as $key => $value) { |
| 481 | - $cond[] = 'nfi.'. db_escape_string($key) ." = '%s'"; |
|
| 481 | + $cond[] = 'nfi.'.db_escape_string($key)." = '%s'"; |
|
| 482 | 482 | $args[] = $value; |
| 483 | 483 | } |
| 484 | 484 | } |
@@ -486,17 +486,17 @@ discard block |
||
| 486 | 486 | $cond[] = 'nf.active = 1'; |
| 487 | 487 | $cond[] = 'nfi.widget_active = 1'; |
| 488 | 488 | } |
| 489 | - $where = $cond ? ' WHERE '. implode(' AND ', $cond) : ''; |
|
| 489 | + $where = $cond ? ' WHERE '.implode(' AND ', $cond) : ''; |
|
| 490 | 490 | |
| 491 | - $db_result = db_query("SELECT * FROM {". content_instance_tablename() ."} nfi ". |
|
| 492 | - " JOIN {". content_field_tablename() ."} nf ON nfi.field_name = nf.field_name ". |
|
| 491 | + $db_result = db_query("SELECT * FROM {".content_instance_tablename()."} nfi ". |
|
| 492 | + " JOIN {".content_field_tablename()."} nf ON nfi.field_name = nf.field_name ". |
|
| 493 | 493 | "$where ORDER BY nfi.weight ASC, nfi.label ASC", $args); |
| 494 | 494 | |
| 495 | 495 | $fields = array(); |
| 496 | 496 | while ($instance = db_fetch_array($db_result)) { |
| 497 | 497 | // Unserialize arrays. |
| 498 | 498 | foreach (array('widget_settings', 'display_settings', 'global_settings', 'db_columns') as $key) { |
| 499 | - $instance[$key] = (!empty($instance[$key])) ? (array) unserialize($instance[$key]) : array(); |
|
| 499 | + $instance[$key] = (!empty($instance[$key])) ? (array)unserialize($instance[$key]) : array(); |
|
| 500 | 500 | } |
| 501 | 501 | // 'columns' is a reserved word in MySQL4, so our column is named 'db_columns'. |
| 502 | 502 | $instance['columns'] = $instance['db_columns']; |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | * @see menu_rebuild() |
| 545 | 545 | */ |
| 546 | 546 | function content_field_instance_delete($field_name, $type_name, $rebuild = TRUE) { |
| 547 | - include_once('./'. drupal_get_path('module', 'content') .'/includes/content.admin.inc'); |
|
| 547 | + include_once('./'.drupal_get_path('module', 'content').'/includes/content.admin.inc'); |
|
| 548 | 548 | |
| 549 | 549 | // Get the previous field value. |
| 550 | 550 | $field = array_pop(content_field_instance_read(array('field_name' => $field_name, 'type_name' => $type_name))); |
@@ -552,13 +552,13 @@ discard block |
||
| 552 | 552 | // Invoke hook_content_fieldapi(). |
| 553 | 553 | module_invoke_all('content_fieldapi', 'delete instance', $field); |
| 554 | 554 | |
| 555 | - db_query("DELETE FROM {". content_instance_tablename() . |
|
| 555 | + db_query("DELETE FROM {".content_instance_tablename(). |
|
| 556 | 556 | "} WHERE field_name = '%s' AND type_name = '%s'", $field['field_name'], $field['type_name']); |
| 557 | 557 | |
| 558 | 558 | // If no instances remain, delete the field entirely. |
| 559 | 559 | $instances = content_field_instance_read(array('field_name' => $field_name)); |
| 560 | 560 | if (sizeof($instances) < 1) { |
| 561 | - db_query("DELETE FROM {". content_field_tablename() ."} WHERE field_name = '%s'", $field['field_name']); |
|
| 561 | + db_query("DELETE FROM {".content_field_tablename()."} WHERE field_name = '%s'", $field['field_name']); |
|
| 562 | 562 | content_alter_schema($field, array()); |
| 563 | 563 | } |
| 564 | 564 | // If only one instance remains, we may need to change the database |
@@ -600,7 +600,7 @@ discard block |
||
| 600 | 600 | // If content module has been uninstalled first, all tables |
| 601 | 601 | // have already been dropped, and running that code will raise errors. |
| 602 | 602 | if (db_table_exists(content_instance_tablename())) { |
| 603 | - $results = db_query("SELECT field_name, type_name FROM {". content_instance_tablename() ."} WHERE widget_module = '%s'", $module); |
|
| 603 | + $results = db_query("SELECT field_name, type_name FROM {".content_instance_tablename()."} WHERE widget_module = '%s'", $module); |
|
| 604 | 604 | while ($field = db_fetch_array($results)) { |
| 605 | 605 | content_field_instance_delete($field['field_name'], $field['type_name'], FALSE); |
| 606 | 606 | } |
@@ -634,7 +634,7 @@ discard block |
||
| 634 | 634 | function content_type_update($info) { |
| 635 | 635 | if (!empty($info->old_type) && $info->old_type != $info->type) { |
| 636 | 636 | // Rename the content type in all fields that use changed content type. |
| 637 | - db_query("UPDATE {". content_instance_tablename() ."} SET type_name='%s' WHERE type_name='%s'", array($info->type, $info->old_type)); |
|
| 637 | + db_query("UPDATE {".content_instance_tablename()."} SET type_name='%s' WHERE type_name='%s'", array($info->type, $info->old_type)); |
|
| 638 | 638 | |
| 639 | 639 | // Rename the content fields table to match new content type name. |
| 640 | 640 | $old_type = content_types($info->old_type); |
@@ -648,9 +648,9 @@ discard block |
||
| 648 | 648 | } |
| 649 | 649 | |
| 650 | 650 | // Rename the variable storing weights for non-CCK fields. |
| 651 | - if ($extra = variable_get('content_extra_weights_'. $info->old_type, array())) { |
|
| 652 | - variable_set('content_extra_weights_'. $info->type, $extra); |
|
| 653 | - variable_del('content_extra_weights_'. $info->old_type); |
|
| 651 | + if ($extra = variable_get('content_extra_weights_'.$info->old_type, array())) { |
|
| 652 | + variable_set('content_extra_weights_'.$info->type, $extra); |
|
| 653 | + variable_del('content_extra_weights_'.$info->old_type); |
|
| 654 | 654 | } |
| 655 | 655 | } |
| 656 | 656 | |