Remove blockfacebook
This commit is contained in:
@@ -64,7 +64,6 @@
|
||||
<module action="disable" name="blockadvertising"/>
|
||||
<module action="disable" name="blockcmsinfo"/>
|
||||
<module action="disable" name="blockcustomerprivacy"/>
|
||||
<module action="disable" name="blockfacebook"/>
|
||||
<module action="disable" name="blocklayered"/>
|
||||
<module action="disable" name="blocklink"/>
|
||||
<module action="disable" name="pscleaner"/>
|
||||
|
||||
@@ -2090,7 +2090,6 @@ class AdminThemesControllerCore extends AdminController
|
||||
'blockcmsinfo',
|
||||
'blockcurrencies',
|
||||
'blockcustomerprivacy',
|
||||
'blockfacebook',
|
||||
'blocklanguages',
|
||||
'blocklayered',
|
||||
'blocklink',
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
2014-04-22 18:57:13 +0200 // Changelog updated
|
||||
2014-04-01 16:41:02 +0200 // fix bracket missing && ++version
|
||||
2014-04-01 14:13:46 +0200 Merge pull request #1 from f31n/patch-1
|
||||
2014-03-29 23:49:00 +0300 // full url is required for blockFacebook
|
||||
2014-03-28 09:56:54 +0100 logic in php
|
||||
2014-03-28 09:48:56 +0100 Update blockfacebook.tpl
|
||||
2014-03-25 21:21:01 +0100 accepting full url and only name
|
||||
2014-03-25 18:31:27 +0100 bug @ v0.1 didn't work on prestashop 1.6.0.5
|
||||
2014-03-24 11:43:28 +0100 / MO blockfacebook : ps_versions_compliancy modified (1.5.6.1 => 1.6)
|
||||
2014-03-24 11:02:17 +0100 // MO blockfacebook/ : ps_versions_compliancy added
|
||||
2014-03-20 14:22:40 +0100 Initial commit
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* 2007-2016 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2016 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
initfb(document, 'script', 'facebook-jssdk');
|
||||
});
|
||||
|
||||
function initfb(d, s, id)
|
||||
{
|
||||
var js, fjs = d.getElementsByTagName(s)[0];
|
||||
if (d.getElementById(id))
|
||||
return;
|
||||
js = d.createElement(s); js.id = id;
|
||||
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=334341610034299";
|
||||
fjs.parentNode.insertBefore(js, fjs);
|
||||
}
|
||||
@@ -1,170 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2016 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2016 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
class BlockFacebook extends Module
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'blockfacebook';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.4.1';
|
||||
$this->author = 'PrestaShop';
|
||||
|
||||
$this->bootstrap = true;
|
||||
parent::__construct();
|
||||
$this->displayName = $this->l('Facebook Like Box block');
|
||||
$this->description = $this->l('Displays a block for subscribing to your Facebook Page.');
|
||||
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.6.99.99');
|
||||
}
|
||||
|
||||
|
||||
public function install()
|
||||
{
|
||||
return parent::install() &&
|
||||
Configuration::updateValue('blockfacebook_url', 'https://www.facebook.com/prestashop') &&
|
||||
$this->registerHook('displayHome') &&
|
||||
$this->registerHook('displayHeader');
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
// Delete configuration
|
||||
return Configuration::deleteByName('blockfacebook_url') && parent::uninstall();
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
$html = '';
|
||||
// If we try to update the settings
|
||||
if (Tools::isSubmit('submitModule'))
|
||||
{
|
||||
Configuration::updateValue('blockfacebook_url', Tools::getValue('blockfacebook_url'));
|
||||
$html .= $this->displayConfirmation($this->l('Configuration updated'));
|
||||
$this->_clearCache('blockfacebook.tpl');
|
||||
Tools::redirectAdmin('index.php?tab=AdminModules&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules'));
|
||||
}
|
||||
|
||||
$html .= $this->renderForm();
|
||||
$facebookurl = Configuration::get('blockfacebook_url');
|
||||
if(!strstr($facebookurl, "facebook.com")) $facebookurl="https://www.facebook.com/".$facebookurl;
|
||||
$this->context->smarty->assign('facebookurl', $facebookurl);
|
||||
$this->context->smarty->assign('facebook_js_url', $this->_path.'blockfacebook.js');
|
||||
$this->context->smarty->assign('facebook_css_url', $this->_path.'css/blockfacebook.css');
|
||||
$html .= $this->context->smarty->fetch($this->local_path.'views/admin/_configure/preview.tpl');
|
||||
return $html;
|
||||
}
|
||||
|
||||
public function hookDisplayHome()
|
||||
{
|
||||
if (!$this->isCached('blockfacebook.tpl', $this->getCacheId()))
|
||||
{
|
||||
$facebookurl = Configuration::get('blockfacebook_url');
|
||||
if (!strstr($facebookurl, 'facebook.com'))
|
||||
$facebookurl = 'https://www.facebook.com/'.$facebookurl;
|
||||
$this->context->smarty->assign('facebookurl', $facebookurl);
|
||||
}
|
||||
return $this->display(__FILE__, 'blockfacebook.tpl', $this->getCacheId());
|
||||
}
|
||||
|
||||
public function hookDisplayLeftColumn()
|
||||
{
|
||||
if ($this->page_name !== 'index')
|
||||
$this->_assignMedia();
|
||||
return $this->hookDisplayHome();
|
||||
}
|
||||
|
||||
public function hookDisplayRightColumn()
|
||||
{
|
||||
if ($this->page_name !== 'index')
|
||||
$this->_assignMedia();
|
||||
return $this->hookDisplayHome();
|
||||
}
|
||||
|
||||
public function hookHeader()
|
||||
{
|
||||
$this->page_name = Dispatcher::getInstance()->getController();
|
||||
if ($this->page_name == 'index')
|
||||
$this->_assignMedia();
|
||||
}
|
||||
|
||||
protected function _assignMedia()
|
||||
{
|
||||
$this->context->controller->addCss(($this->_path).'css/blockfacebook.css');
|
||||
$this->context->controller->addJS(($this->_path).'blockfacebook.js');
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
$fields_form = array(
|
||||
'form' => array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Settings'),
|
||||
'icon' => 'icon-cogs'
|
||||
),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Facebook link (full URL is required)'),
|
||||
'name' => 'blockfacebook_url',
|
||||
),
|
||||
),
|
||||
'submit' => array(
|
||||
'title' => $this->l('Save')
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
$helper = new HelperForm();
|
||||
$helper->show_toolbar = false;
|
||||
$helper->table = $this->table;
|
||||
$lang = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
|
||||
$helper->default_form_language = $lang->id;
|
||||
$helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
|
||||
$this->fields_form = array();
|
||||
|
||||
$helper->identifier = $this->identifier;
|
||||
$helper->submit_action = 'submitModule';
|
||||
$helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;
|
||||
$helper->token = Tools::getAdminTokenLite('AdminModules');
|
||||
$helper->tpl_vars = array(
|
||||
'fields_value' => $this->getConfigFieldsValues(),
|
||||
'languages' => $this->context->controller->getLanguages(),
|
||||
'id_language' => $this->context->language->id
|
||||
);
|
||||
|
||||
return $helper->generateForm(array($fields_form));
|
||||
}
|
||||
|
||||
public function getConfigFieldsValues()
|
||||
{
|
||||
return array(
|
||||
'blockfacebook_url' => Tools::getValue('blockfacebook_url', Configuration::get('blockfacebook_url')),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
{*
|
||||
* 2007-2016 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2016 PrestaShop SA
|
||||
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
{if $facebookurl != ''}
|
||||
<div id="fb-root"></div>
|
||||
<div id="facebook_block" class="col-xs-4">
|
||||
<h4 >{l s='Follow us on Facebook' mod='blockfacebook'}</h4>
|
||||
<div class="facebook-fanbox">
|
||||
<div class="fb-like-box" data-href="{$facebookurl|escape:'html':'UTF-8'}" data-colorscheme="light" data-show-faces="true" data-header="false" data-stream="false" data-show-border="false">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -1,3 +0,0 @@
|
||||
.facebook-fanbox {
|
||||
overflow-x : hidden;
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2016 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2016 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
header("Location: ../");
|
||||
exit;
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 267 B |
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2016 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2016 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
@@ -1,17 +0,0 @@
|
||||
<script src="{$facebook_js_url}"></script>
|
||||
<link href="{$facebook_css_url}" rel="stylesheet">
|
||||
{if $facebookurl != ''}
|
||||
<div class="bootstrap panel">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-picture-o"></i> {l s='Preview' mod='blockfacebook'}
|
||||
</div>
|
||||
<div id="fb-root"></div>
|
||||
<div id="facebook_block">
|
||||
<h4 >{l s='Follow us on Facebook' mod='blockfacebook'}</h4>
|
||||
<div class="facebook-fanbox">
|
||||
<div class="fb-like-box" data-href="{$facebookurl|escape:'html':'UTF-8'}" data-colorscheme="light" data-show-faces="true" data-header="false" data-stream="false" data-show-border="false">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
Reference in New Issue
Block a user