Skip to content

Commit

Permalink
Update label & content
Browse files Browse the repository at this point in the history
  • Loading branch information
haitv282 committed Dec 18, 2018
1 parent 75a9be0 commit 90d863a
Show file tree
Hide file tree
Showing 17 changed files with 105 additions and 21 deletions.
4 changes: 4 additions & 0 deletions Block/Adminhtml/System/Snippet.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;

/**
* Class Snippet
* @package Mageplaza\FacebookPlugin\Block\Adminhtml\System
*/
class Snippet extends Field
{
/**
Expand Down
5 changes: 4 additions & 1 deletion Block/Facebook.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
use Magento\Widget\Block\BlockInterface;
use Mageplaza\FacebookPlugin\Helper\Data as helperData;

/**
* Class Facebook
* @package Mageplaza\FacebookPlugin\Block
*/
abstract class Facebook extends Template implements BlockInterface
{
/**
Expand Down Expand Up @@ -88,5 +92,4 @@ public function getAppId()

return $appId;
}

}
6 changes: 5 additions & 1 deletion Block/Product/TabComment.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@

namespace Mageplaza\FacebookPlugin\Block\Product;


use Magento\Framework\Locale\Resolver;
use Magento\Framework\Registry;
use Magento\Framework\View\Element\Template;
use Mageplaza\FacebookPlugin\Block\Facebook;
use Mageplaza\FacebookPlugin\Helper\Data as helperData;

/**
* Class TabComment
* @package Mageplaza\FacebookPlugin\Block\Product
*/
class TabComment extends Facebook
{
/**
Expand Down Expand Up @@ -58,6 +61,7 @@ public function __construct(
)
{
$this->registry = $registry;

parent::__construct($context, $helperData, $resolver, $data);
$this->setTabTitle();
}
Expand Down
8 changes: 8 additions & 0 deletions Block/Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,20 @@
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/

namespace Mageplaza\FacebookPlugin\Block;

use Mageplaza\FacebookPlugin\Model\Config\Source\Options;

/**
* Class Widget
* @package Mageplaza\FacebookPlugin\Block
*/
class Widget extends Facebook
{
/**
* @var string
*/
protected $_template = "facebookpage.phtml";

/**
Expand Down
4 changes: 4 additions & 0 deletions Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@

use Mageplaza\Core\Helper\AbstractData;

/**
* Class Data
* @package Mageplaza\FacebookPlugin\Helper
*/
class Data extends AbstractData
{
const CONFIG_MODULE_PATH = 'mpfbplugin';
Expand Down
5 changes: 4 additions & 1 deletion Model/Config/Source/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@

namespace Mageplaza\FacebookPlugin\Model\Config\Source;


use Magento\Framework\Option\ArrayInterface;

/**
* Class Options
* @package Mageplaza\FacebookPlugin\Model\Config\Source
*/
class Options implements ArrayInterface
{
const CONFIG = 0;
Expand Down
6 changes: 5 additions & 1 deletion Model/Config/Source/Tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/

namespace Mageplaza\FacebookPlugin\Model\Config\Source;

use Magento\Framework\Option\ArrayInterface;

/**
* Class Tabs
* @package Mageplaza\FacebookPlugin\Model\Config\Source
*/
class Tabs implements ArrayInterface
{
const TIMELINE = 'timeline';
Expand Down Expand Up @@ -51,6 +56,5 @@ public function toOptionArray()
];

return $options;

}
}
5 changes: 4 additions & 1 deletion Model/Config/Source/TrueFalse.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@

use Magento\Framework\Option\ArrayInterface;

/**
* Class TrueFalse
* @package Mageplaza\FacebookPlugin\Model\Config\Source
*/
class TrueFalse implements ArrayInterface
{
/**
Expand All @@ -44,6 +48,5 @@ public function toOptionArray()
];

return $options;

}
}
6 changes: 4 additions & 2 deletions Setup/InstallData.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

/**
* Class InstallData
* @package Mageplaza\FacebookPlugin\Setup
*/
class InstallData implements InstallDataInterface
{


/**
* @var \Magento\Eav\Setup\EavSetupFactory
*/
Expand Down
4 changes: 4 additions & 0 deletions Setup/Uninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\Setup\UninstallInterface;

/**
* Class Uninstall
* @package Mageplaza\FacebookPlugin\Setup
*/
class Uninstall implements UninstallInterface
{
/**
Expand Down
Binary file modified UserGuide.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"mageplaza/module-core": "^1.4.0"
},
"type": "magento2-module",
"version": "1.0.0",
"version": "1.0.1",
"license": "proprietary",
"authors": [
{
Expand Down
3 changes: 3 additions & 0 deletions etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<mpfbplugin>
<module>
<type>1</type>
</module>
<general>
<enabled>1</enabled>
</general>
Expand Down
43 changes: 43 additions & 0 deletions i18n/en_US.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"Use the following code to show facebook plugin in any places which you want.","Use the following code to show facebook plugin in any places which you want."
"CMS Page/Static Block","CMS Page/Static Block"
"Template .phtml file","Template .phtml file"
"Layout file","Layout file"
title,title
"Use Config","Use Config"
Custom,Custom
Timeline,Timeline
Events,Events
Messages,Messages
No,No
Yes,Yes
"Disabled Facebook Comments","Disabled Facebook Comments"
"Facebook Plugin","Facebook Plugin"
General,General
Enable,Enable
"Facebook App ID","Facebook App ID"
"Facebook URL","Facebook URL"
Tabs,Tabs
Width,Width
Height,Height
"Hide cover photo","Hide cover photo"
"Show profile photo","Show profile photo"
"Hide the custom Call To Action","Hide the custom Call To Action"
"Small header","Small header"
"Adapt Width","Adapt Width"
"Snippet Code","Snippet Code"
"Facebook Comments","Facebook Comments"
"Enable Facebook Comment","Enable Facebook Comment"
Title,Title
"Number of Posts","Number of Posts"
"Mageplaza Facebook Plugin","Mageplaza Facebook Plugin"
"Create facebook plugin to store.","Create facebook plugin to store."
"Facebook widget options","Facebook widget options"
"The URL of the Facebook Page.","The URL of the Facebook Page."
"The pixel width of the plugin. Min. is 180 px and Max. is 500 px. Default: 340 px","The pixel width of the plugin. Min. is 180 px and Max. is 500 px. Default: 340 px"
"The pixel height of the plugin. Min. is 70 px.","The pixel height of the plugin. Min. is 70 px."
"Hide cover photo in the header. Default: No","Hide cover photo in the header. Default: No"
"Show the profile photo when friends like this.","Show the profile photo when friends like this."
"Hide the custom Call To Action button (if available).","Hide the custom Call To Action button (if available)."
"Use the small header instead.","Use the small header instead."
"Adapt width","Adapt width"
"Try to fit inside the frame width. Default: Yes.","Try to fit inside the frame width. Default: Yes."
1 change: 0 additions & 1 deletion view/frontend/templates/product/head.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@

/** @var Mageplaza\FacebookPlugin\Block\Product\TabComment $block */
?>

<meta property="fb:app_id" content="<?php echo $block->getAppId() ?>"/>
5 changes: 2 additions & 3 deletions view/frontend/templates/product/tabcomment.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
?>

<?php /** @var Mageplaza\FacebookPlugin\Block\Product\TabComment $block */
/** @var Mageplaza\FacebookPlugin\Block\Product\TabComment $block */
if ($block->isEnabled()) : ?>
<?php $options = $block->getHelperData()->getFbCommentsConfig() ?>
<div class="fb-comments"
data-href="<?php echo $block->getRequest()->getUriString() ?>"
data-numposts="<?php echo isset($options['num_posts']) ? $options['num_posts'] : 5 ?>"
data-width ="<?php echo $options['width']?>
data-width="<?php echo $options['width'] ?>
">
</div>
<?php endif; ?>
19 changes: 10 additions & 9 deletions view/frontend/templates/sdk.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@

/** @var Mageplaza\FacebookPlugin\Block\Facebook $block */
if ($block->getHelperData()->isEnabled()) : ?>
<?php $src = 'https://connect.facebook.net/'.$block->getLanguage().'/sdk.js#xfbml=1&version=v3.2&appId='.$block->getAppId().'&autoLogAppEvents=1'?>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = '<?php echo $src ?>';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<?php $src = 'https://connect.facebook.net/' . $block->getLanguage() . '/sdk.js#xfbml=1&version=v3.2&appId=' . $block->getAppId() . '&autoLogAppEvents=1' ?>
<div id="fb-root"></div>
<script>(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.src = '<?php echo $src ?>';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<?php endif; ?>

0 comments on commit 90d863a

Please sign in to comment.