Conditions | 3 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 8 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
38 | public function getBodyHtml() |
||
39 | { |
||
40 | $facebookInsightsObjectId = Facebook::$plugin->getSettings()->facebookInsightsObjectId; |
||
41 | |||
42 | if (Facebook::$plugin->isConfigured() && $facebookInsightsObjectId) { |
||
43 | Craft::$app->getView()->registerAssetBundle(InsightsWidgetAsset::class); |
||
44 | Craft::$app->getView()->registerJs('new Craft.FacebookInsightsWidget("widget'.$this->id.'");'); |
||
45 | |||
46 | return Craft::$app->getView()->renderTemplate('facebook/_components/widgets/Insights/body'); |
||
47 | } |
||
48 | |||
49 | return Craft::$app->getView()->renderTemplate('facebook/_components/widgets/Insights/not-configured'); |
||
50 | } |
||
51 | } |