@@ -109,8 +109,7 @@ discard block |
||
| 109 | 109 | if (!empty($url_element['data-embed-url']) && $info = $this->urlEmbed()->getEmbed($url_element['data-embed-url'])) { |
| 110 | 110 | $url_element['data-url-provider'] = $info->getProviderName(); |
| 111 | 111 | } |
| 112 | - } |
|
| 113 | - catch (\Exception $e) { |
|
| 112 | + } catch (\Exception $e) { |
|
| 114 | 113 | watchdog_exception('url_embed', $e); |
| 115 | 114 | } |
| 116 | 115 | |
@@ -160,8 +159,7 @@ discard block |
||
| 160 | 159 | '#weight' => -10, |
| 161 | 160 | ); |
| 162 | 161 | $response->addCommand(new HtmlCommand('#url-embed-dialog-form', $form)); |
| 163 | - } |
|
| 164 | - else { |
|
| 162 | + } else { |
|
| 165 | 163 | $response->addCommand(new EditorDialogSave($values)); |
| 166 | 164 | $response->addCommand(new CloseModalDialogCommand()); |
| 167 | 165 | } |
@@ -77,8 +77,7 @@ discard block |
||
| 77 | 77 | $url_output = $info->getCode(); |
| 78 | 78 | $node->setAttribute('data-url-provider', $info->getProviderName()); |
| 79 | 79 | } |
| 80 | - } |
|
| 81 | - catch (\Exception $e) { |
|
| 80 | + } catch (\Exception $e) { |
|
| 82 | 81 | watchdog_exception('url_embed', $e); |
| 83 | 82 | } |
| 84 | 83 | |
@@ -100,8 +99,7 @@ discard block |
||
| 100 | 99 | <ul> |
| 101 | 100 | <li><code><drupal-url data-embed-url="https://www.youtube.com/watch?v=xxXXxxXxxxX" data-url-provider="YouTube" /></code></li> |
| 102 | 101 | </ul>'); |
| 103 | - } |
|
| 104 | - else { |
|
| 102 | + } else { |
|
| 105 | 103 | return $this->t('You can embed URLs.'); |
| 106 | 104 | } |
| 107 | 105 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | * {@inheritdoc} |
| 26 | 26 | */ |
| 27 | 27 | public function getFile() { |
| 28 | - return drupal_get_path('module', 'url_embed') . '/js/plugins/drupalurl/plugin.js'; |
|
| 28 | + return drupal_get_path('module', 'url_embed').'/js/plugins/drupalurl/plugin.js'; |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -23,6 +23,6 @@ |
||
| 23 | 23 | * {@inheritdoc} |
| 24 | 24 | */ |
| 25 | 25 | public function getDefaultIconUrl() { |
| 26 | - return file_create_url(drupal_get_path('module', 'url_embed') . '/js/plugins/drupalurl/urlembed.png'); |
|
| 26 | + return file_create_url(drupal_get_path('module', 'url_embed').'/js/plugins/drupalurl/urlembed.png'); |
|
| 27 | 27 | } |
| 28 | 28 | } |
@@ -66,9 +66,9 @@ |
||
| 66 | 66 | public function getEmbedDialog($filter_format_id = NULL, $embed_button_id = NULL) { |
| 67 | 67 | $url = 'url-embed/dialog'; |
| 68 | 68 | if (!empty($filter_format_id)) { |
| 69 | - $url .= '/' . $filter_format_id; |
|
| 69 | + $url .= '/'.$filter_format_id; |
|
| 70 | 70 | if (!empty($embed_button_id)) { |
| 71 | - $url .= '/' . $embed_button_id; |
|
| 71 | + $url .= '/'.$embed_button_id; |
|
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | return $this->drupalGet($url); |
@@ -22,13 +22,13 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | public function testFilter() { |
| 24 | 24 | // Tests url embed using sample flickr url. |
| 25 | - $content = '<drupal-url data-embed-url="' . static::FLICKR_URL . '">This placeholder should not be rendered.</drupal-url>'; |
|
| 25 | + $content = '<drupal-url data-embed-url="'.static::FLICKR_URL.'">This placeholder should not be rendered.</drupal-url>'; |
|
| 26 | 26 | $settings = array(); |
| 27 | 27 | $settings['type'] = 'page'; |
| 28 | 28 | $settings['title'] = 'Test url embed with sample flickr url'; |
| 29 | 29 | $settings['body'] = array(array('value' => $content, 'format' => 'custom_format')); |
| 30 | 30 | $node = $this->drupalCreateNode($settings); |
| 31 | - $this->drupalGet('node/' . $node->id()); |
|
| 31 | + $this->drupalGet('node/'.$node->id()); |
|
| 32 | 32 | $this->assertRaw(static::FLICKR_OUTPUT_WYSIWYG); |
| 33 | 33 | $this->assertNoText(strip_tags($content), 'Placeholder does not appear in the output when embed is successful.'); |
| 34 | 34 | |
@@ -39,27 +39,27 @@ discard block |
||
| 39 | 39 | $settings['title'] = 'Test that placeholder is retained when specified URL does not exists'; |
| 40 | 40 | $settings['body'] = array(array('value' => $content, 'format' => 'custom_format')); |
| 41 | 41 | $node = $this->drupalCreateNode($settings); |
| 42 | - $this->drupalGet('node/' . $node->id()); |
|
| 42 | + $this->drupalGet('node/'.$node->id()); |
|
| 43 | 43 | $this->assertNoText(strip_tags($content), 'Placeholder does not appear in the output when embed is unsuccessful.'); |
| 44 | 44 | |
| 45 | 45 | // Test that tag of container element is not replaced when it's not |
| 46 | 46 | // <drupal-url>. |
| 47 | - $content = '<not-drupal-url data-embed-url="' . static::FLICKR_URL . '" data-url-provider="Flickr">this placeholder should not be rendered.</not-drupal-url>'; |
|
| 47 | + $content = '<not-drupal-url data-embed-url="'.static::FLICKR_URL.'" data-url-provider="Flickr">this placeholder should not be rendered.</not-drupal-url>'; |
|
| 48 | 48 | $settings = array(); |
| 49 | 49 | $settings['type'] = 'page'; |
| 50 | 50 | $settings['title'] = 'test url embed with embed-url'; |
| 51 | 51 | $settings['body'] = array(array('value' => $content, 'format' => 'custom_format')); |
| 52 | 52 | $node = $this->drupalCreateNode($settings); |
| 53 | - $this->drupalget('node/' . $node->id()); |
|
| 53 | + $this->drupalget('node/'.$node->id()); |
|
| 54 | 54 | $this->assertRaw('</not-drupal-url>'); |
| 55 | - $content = '<div data-embed-url="' . static::FLICKR_URL . '">this placeholder should not be rendered.</div>'; |
|
| 55 | + $content = '<div data-embed-url="'.static::FLICKR_URL.'">this placeholder should not be rendered.</div>'; |
|
| 56 | 56 | $settings = array(); |
| 57 | 57 | $settings['type'] = 'page'; |
| 58 | 58 | $settings['title'] = 'test url embed with embed-url'; |
| 59 | 59 | $settings['body'] = array(array('value' => $content, 'format' => 'custom_format')); |
| 60 | 60 | $node = $this->drupalCreateNode($settings); |
| 61 | - $this->drupalget('node/' . $node->id()); |
|
| 62 | - $this->assertRaw('<div data-embed-url="' . static::FLICKR_URL . '"'); |
|
| 61 | + $this->drupalget('node/'.$node->id()); |
|
| 62 | + $this->assertRaw('<div data-embed-url="'.static::FLICKR_URL.'"'); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | } |