Initial commit

This commit is contained in:
2020-01-27 08:56:08 +01:00
commit b7525048d6
27129 changed files with 3409855 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="config.xml" server="51.254.220.106//web/" local="131360681400000000" remote="131360681400000000" />
<file name="module.xml" server="51.254.220.106//web/" local="131360681400000000" remote="131360681400000000" />
<file name="routing.xml" server="51.254.220.106//web/" local="131360681400000000" remote="131360681400000000" />
</dwsync>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" ?>
<config xmlns="http://thelia.net/schema/dic/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://thelia.net/schema/dic/config http://thelia.net/schema/dic/config/thelia-1.0.xsd">
<hooks>
<hook id="opengraph.hook" class="OpenGraph\Hook\OpenGraphHook" scope="request">
<tag name="hook.event_listener" event="module.configuration" type="back" method="onModuleConfiguration" />
<tag name="hook.event_listener" event="main.head-bottom" type="front" method="onMainHeadBottom" />
<tag name="hook.event_listener" event="main.body-bottom" type="front" method="openGraphSharingButtons" />
<tag name="hook.event_listener" event="main.stylesheet" type="front" method="onMainStylesheet" />
</hook>
</hooks>
<forms>
<form name="open.graph.configuration.form" class="OpenGraph\Form\OpenGraphConfigurationForm" />
</forms>
</config>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="http://thelia.net/schema/dic/module"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://thelia.net/schema/dic/module http://thelia.net/schema/dic/module/module-2_1.xsd">
<fullnamespace>OpenGraph\OpenGraph</fullnamespace>
<descriptive locale="en_US">
<title>Social media sharing management module</title>
</descriptive>
<descriptive locale="fr_FR">
<title>Module de gestion de partage sur les réseaux sociaux</title>
</descriptive>
<languages>
<language>en_US</language>
<language>fr_FR</language>
</languages>
<version>1.0.1</version>
<author>
<name>Thomas Arnaud</name>
<email>tarnaud@openstudio.fr</email>
</author>
<type>classic</type>
<thelia>2.1.7</thelia>
<stability>beta</stability>
</module>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<routes xmlns="http://symfony.com/schema/routing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
<route id="open.graph.config.save" path="/admin/module/OpenGraph/save" methods="post">
<default key="_controller">OpenGraph\Controller\OpenGraphController::saveAction</default>
</route>
</routes>

View File

@@ -0,0 +1,94 @@
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace OpenGraph\Controller;
use OpenGraph\Model\Config\OpenGraphConfigValue;
use OpenGraph\OpenGraph;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Thelia\Controller\Admin\BaseAdminController;
use Thelia\Core\Security\AccessManager;
use Thelia\Core\Security\Resource\AdminResources;
use Thelia\Form\Exception\FormValidationException;
use Thelia\Model\ConfigQuery;
use Thelia\Tools\URL;
/**
* Class OpenGraphController
* @package OpenGraph\Controller
* @author Thomas Arnaud <tarnaud@openstudio.fr>
*/
class OpenGraphController extends BaseAdminController
{
/**
* Redirect to the configuration page
*/
protected function redirectToConfigurationPage()
{
return RedirectResponse::create(URL::getInstance()->absoluteUrl('/admin/module/OpenGraph'));
}
/**
* Fill the form with the configuration data
*/
public function saveAction()
{
if (null !== $response = $this->checkAuth(AdminResources::MODULE, [OpenGraph::DOMAIN_NAME], AccessManager::UPDATE)) {
return $response;
}
// Create the form from the request
$form = $this->createForm('open.graph.configuration.form');
// Initialize the potential error
$error_message = null;
try {
// Check the form against constraints violations
$validateForm = $this->validateForm($form);
// Get the form field values
$data = $validateForm->getData();
OpenGraph::setConfigValue(
OpenGraphConfigValue::ENABLE_SHARING_BUTTONS,
is_bool($data["enable_sharing_buttons"])
? (int) ($data["enable_sharing_buttons"])
: $data["enable_sharing_buttons"]
);
foreach ($data as $name => $value) {
ConfigQuery::write("opengraph_" . $name, $value, false, true);
}
// Redirect to the configuration page if everything is OK
return $this->redirectToConfigurationPage();
} catch (FormValidationException $e) {
// Form cannot be validated. Create the error message using
// the BaseAdminController helper method.
$error_message = $this->createStandardFormValidationErrorMessage($e);
}
if (null !== $error_message) {
$this->setupFormErrorContext(
'configuration',
$error_message,
$form
);
$response = $this->render("module-configure", ['module_code' => 'OpenGraph']);
}
return $response;
}
}

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="OpenGraphController.php" server="51.254.220.106//web/" local="131360681400000000" remote="131360681400000000" />
</dwsync>

View File

@@ -0,0 +1,130 @@
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace OpenGraph\Form;
use OpenGraph\Model\Config\Base\OpenGraphConfigValue;
use OpenGraph\OpenGraph;
use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Core\Translation\Translator;
use Thelia\Form\BaseForm;
use Thelia\Model\ConfigQuery;
/**
* Class ConfigurationForm
* @package OpenGraph\Form
* @author Thomas Arnaud <tarnaud@openstudio.fr>
*/
class OpenGraphConfigurationForm extends BaseForm
{
protected function buildForm()
{
$form = $this->formBuilder;
$definitions = [
[
"id" => "company_name",
"label" => $this->trans("Your company's name"),
"constraints" => []
],
[
"id" => "twitter_company_name",
"label" => $this->trans("Your company's name on twitter"),
"constraints" => [
new Callback(
[
"methods" => [
[
$this,
"verifyValue"
]
]
]
)
],
],
[
"id" => "twitter_creator_name",
"label" => $this->trans("The creator's name on twitter"),
"constraints" => [
new Callback(
[
"methods" => [
[
$this,
"verifyValue"
]
]
]
)
]
]
];
foreach ($definitions as $field) {
$value = ConfigQuery::read("opengraph_" . $field["id"], "");
$form
->add(
$field["id"],
"text",
array(
"constraints" => $field["constraints"],
"data" => $value,
"label" => $field["label"],
"label_attr" => array(
"for" => $field["id"]
),
)
)
->add(
"enable_sharing_buttons",
"checkbox",
array(
"label" => "Enable the sharing buttons",
"label_attr" => [
"for" => "enable_sharing_buttons",
"help" => Translator::getInstance()->trans(
'Check if you want to activate the sharing buttons in the front office',
[],
OpenGraph::DOMAIN_NAME
)
],
"required" => false,
"constraints" => array(
),
"value" => OpenGraph::getConfigValue(OpenGraphConfigValue::ENABLE_SHARING_BUTTONS, 1),
)
);
}
}
/**
* @return string the name of you form. This name must be unique
*/
public function getName()
{
return "opengraph";
}
protected function trans($str, $params = [])
{
return Translator::getInstance()->trans($str, $params, OpenGraph::DOMAIN_NAME);
}
public function verifyValue($value, ExecutionContextInterface $context)
{
if (!preg_match("#^@[a-zA-Z_]*$#", $value)) {
$context->addViolation($this->trans("enter a valid twitter alias"));
}
}
}

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="OpenGraphConfigurationForm.php" server="51.254.220.106//web/" local="131360681400000000" remote="131360681400000000" />
</dwsync>

View File

@@ -0,0 +1,60 @@
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace OpenGraph\Hook;
use OpenGraph\Model\Config\Base\OpenGraphConfigValue;
use OpenGraph\OpenGraph;
use Thelia\Core\Event\Hook\HookRenderEvent;
use Thelia\Core\Hook\BaseHook;
/**
* Class OpenGraphHook
* @package OpenGraph\Hook
* @author Thomas Arnaud <tarnaud@openstudio.fr>
*/
class OpenGraphHook extends BaseHook
{
public function onMainHeadBottom(HookRenderEvent $event)
{
$acceptedTypes = ['category', 'product', 'folder', 'content'];

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="OpenGraphHook.php" server="51.254.220.106//web/" local="131360681400000000" remote="131360681400000000" />
</dwsync>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="en_US.php" server="51.254.220.106//web/" local="131360681400000000" remote="131360681400000000" />
<file name="fr_FR.php" server="51.254.220.106//web/" local="131360681400000000" remote="131360681400000000" />
</dwsync>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="en_US.php" server="51.254.220.106//web/" local="131360681400000000" remote="131360681400000000" />
<file name="fr_FR.php" server="51.254.220.106//web/" local="131360681400000000" remote="131360681400000000" />
</dwsync>

View File

@@ -0,0 +1,7 @@
<?php
return array(
'Edit your social media datas.' => 'Edit your social media datas.',
'Must be a valid twitter alias ( ex : @openstudio )' => 'Must be a valid twitter alias ( ex : @openstudio )',
'Save' => 'Save',
);

View File

@@ -0,0 +1,7 @@
<?php
return array(
'Edit your social media datas.' => 'Editez vos données de partage sur les réseaux sociaux ',
'Must be a valid twitter alias ( ex : @openstudio )' => 'Doit être un pseudo twitter valide ( ex : @openstudio )',
'Save' => 'Sauvegarder',
);

View File

@@ -0,0 +1,7 @@
<?php
return array(
'The creator\'s name on twitter' => 'The creator\'s name on twitter',
'Your company\'s name' => 'Your company\'s name',
'Your company\'s name on twitter' => 'Your company\'s name on twitter',
);

View File

@@ -0,0 +1,9 @@
<?php
return array(
'The article author\'s name' => 'Le nom de l\'auteur ou du créateur du contenu partagé',
'The creator\'s name on twitter' => 'Le pseudo du créateur du produit sur twitter',
'Your company\'s name' => 'Le nom de votre entreprise',
'Your company\'s name on twitter' => 'Le pseudo de votre entreprise sur twitter',
'enter a valid twitter alias' => 'entrez un pseudo twitter valide',
);

View File

@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@@ -0,0 +1,23 @@
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace OpenGraph\Model\Config\Base;
/**
* Class OpenGraphConfigValue
* @package OpenGraph\Model\Config\Base
* @author Thomas Arnaud <tarnaud@openstudio.fr>
*/
class OpenGraphConfigValue
{
const ENABLE_SHARING_BUTTONS = "enable_sharing_buttons";
}

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="OpenGraphConfigValue.php" server="51.254.220.106//web/" local="131360681400000000" remote="131360681400000000" />
</dwsync>

View File

@@ -0,0 +1,24 @@
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace OpenGraph\Model\Config;
use OpenGraph\Model\Config\Base\OpenGraphConfigValue as BaseOpenGraphConfigValue;
/**
* Class OpenGraphConfigValue
* @package OpenGraph\Model\Config
* @author Thomas Arnaud <tarnaud@openstudio.fr>
*/
class OpenGraphConfigValue extends BaseOpenGraphConfigValue
{
}

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="OpenGraphConfigValue.php" server="51.254.220.106//web/" local="131360681400000000" remote="131360681400000000" />
</dwsync>

View File

@@ -0,0 +1,32 @@
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace OpenGraph;
use OpenGraph\Model\Config\OpenGraphConfigValue;
use Propel\Runtime\Connection\ConnectionInterface;
use Thelia\Module\BaseModule;
/**
* Class OpenGraph
* @package OpenGraph
* @author Thomas Arnaud <tarnaud@openstudio.fr>
*/
class OpenGraph extends BaseModule
{
const DOMAIN_NAME = 'opengraph';
public function postActivation(ConnectionInterface $con = null)
{
self::setConfigValue(OpenGraphConfigValue::ENABLE_SHARING_BUTTONS, 0);
}
}

View File

@@ -0,0 +1,32 @@
# OpenGraph
This module is for Thelia 2.2.1 or greater and 2.1.7 or greater.
## Installation
### Manually
* Copy the module into ```<thelia_root>/local/modules/``` directory and be sure that the name of the module is OpenGraph.
* Activate it in your thelia administration panel
### Composer
Add it in your main Thelia composer.json file
```
composer require thelia/open-graph-module:~1.0
```
## Description
Add meta tags in the code of some pages to configure what will be displayed when you share the url on social medias.
Works with Facebook, Twitter, Google+ and Pinterest and concerns the folder, content, product and category pages only.
For more informations about the Open Graph protocol visit this site : http://opengraphprotocol.org/
## Usage
Configure the module by adding your company name, your alias on twitter (@openstudio for example) and the alias of the creator of the product you want to share.
Share different pages of your site on the social networks and the different fields like title, description and price will be filled automatically.
Pinterest needs a special validation on its development website : https://developers.pinterest.com/tools/url-debugger/, follow the procedure, your page will be approved and you will receive a confirmation mail.

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="LICENSE.txt" server="51.254.220.106//web/" local="131360681400000000" remote="131360681400000000" />
<file name="OpenGraph.php" server="51.254.220.106//web/" local="131360681400000000" remote="131360681400000000" />
<file name="Readme.md" server="51.254.220.106//web/" local="131360681400000000" remote="131360681400000000" />
<file name="composer.json" server="51.254.220.106//web/" local="131360681400000000" remote="131360681400000000" />
</dwsync>

View File

@@ -0,0 +1,11 @@
{
"name": "thelia/open-graph-module",
"license": "LGPL-3.0+",
"type": "thelia-module",
"require": {
"thelia/installer": "~1.1"
},
"extra": {
"installer-name": "OpenGraph"
}
}

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="module_configuration.html" server="51.254.220.106//web/" local="131360681400000000" remote="131360681400000000" />
</dwsync>

View File

@@ -0,0 +1,64 @@
<div class="general-block-decorator">
<div class="row">
<div class="col-md-12 title title-without-tabs">
{intl l='Edit your social media datas.' d='opengraph.bo.default'}
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-container">
{form name="open.graph.configuration.form"}
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
<form method="POST" action="{url path="/admin/module/OpenGraph/save"}" {form_enctype form=$form} class="clearfix">
{form_hidden_fields form=$form}
{form_field form=$form field='company_name'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{config key='opengraph_company_name'}" title="{$label}">
</div>
{/form_field}
{$twitterLink="<a href='https://twitter.com/theliaecommerce' target='_blank'>@theliaecommerce</a>"}
{form_field form=$form field='twitter_company_name'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{config key='opengraph_twitter_company_name'}" title="{$label}">
<span class="help-block">{intl l='Must be a valid twitter username ( ex : %link )' link=$twitterLink d='opengraph.bo.default'}</span>
</div>
{/form_field}
{form_field form=$form field='twitter_creator_name'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{config key='opengraph_twitter_creator_name'}" title="{$label}">
<span class="help-block">{intl l='Must be a valid twitter username ( ex : %link )' link=$twitterLink d='opengraph.bo.default'}</span>
</div>
{/form_field}
{form_field form=$form field="enable_sharing_buttons"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
<input type="checkbox" name="{$name}" id="{$label_attr.for}" {if $value}checked{/if} />
{$label}
{form_error form=$form field="enable_sharing_buttons"}
<br />
<span class="error">{$message}</span>
{/form_error}
</label>
{if ! empty($label_attr.help)}
<span class="help-block">{$label_attr.help}</span>
{/if}
</div>
{/form_field}
<button type="submit" name="opengraph_save" value="save" class="form-submit-button btn btn-sm btn-default" title="{intl d='opengraph.bo.default' l='Save'}">{intl d='opengraph.bo.default' l='Save'}</button>
</form>
{/form}
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="open_graph.html" server="51.254.220.106//web/" local="131360681400000000" remote="131360681400000000" />
<file name="open_graph_sharing_button.html" server="51.254.220.106//web/" local="131360681400000000" remote="131360681400000000" />
</dwsync>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="styles.css" server="51.254.220.106//web/" local="131360681400000000" remote="131360681400000000" />
</dwsync>

View File

@@ -0,0 +1,86 @@
.og-share-container {
height: 32px;
}
.og-share-box {
position: fixed;
z-index: 1000;
bottom: 0;
left: 0;
height: 32px;
width: 100%;
}
.og-share-btn {
float: left;
width: 25%;
height: 32px;
}
.og-share-link {
display: block;
height: 32px;
line-height: 32px !important;
text-align: center;
color: #fff;
text-decoration: none;
}
.og-share-link:hover {
color: #fff;
text-decoration: none;
}
.og-share-link.fa-facebook-official,
.og-share-link.fa-facebook-official:hover {
background: #3d5fa6;
}
.og-share-link.fa-twitter,
.og-share-link.fa-twitter:hover {
background: #53b1f0;
}
.og-share-link.fa-google-plus,
.og-share-link.fa-google-plus:hover {
background: #dd4b39;
}
.og-share-link.fa-pinterest,
.og-share-link.fa-pinterest:hover {
background: #bd081c;
}
@media (min-width: 768px) {
.og-share-container {
height: 0;
}
.og-share-box {
top: 20%;
bottom: auto;
left: 0;
width: 32px;
}
.og-share-btn {
float: none;
width: 32px;
}
.og-share-link.fa {
display: block;
margin-bottom: 1px;
width: 32px;
background: #666 !important;
}
.og-share-link:hover {
width: 42px;
}
.og-share-link.fa-facebook-official:hover {
background: #3d5fa6 !important;
}
.og-share-link.fa-twitter:hover {
background: #53b1f0 !important;
}
.og-share-link.fa-google-plus:hover {
background: #dd4b39 !important;
}
.og-share-link.fa-pinterest:hover {
background: #bd081c !important;
}
}

View File

@@ -0,0 +1,89 @@
{$object_id=''}
{if $view_value == 'content'}
{$object_id={content attr="id"}}
{/if}
{if $view_value == 'folder'}
{$object_id={folder attr="id"}}
{/if}
{if $view_value == 'category'}
{$object_id={category attr="id"}}
{/if}
{if $view_value == 'product'}
{$object_id={product attr="id"}}
{/if}
{if $object_id !== ''}
{ifloop rel={$view_value}}
{$og_type='article'}
{$title=''}
{$description=''}
{$image_src=''}
{$price=''}
{$url=''}
{loop name={$view_value} type={$view_value} id=$object_id limit="1"}
{$title = $TITLE}
{if $META_DESCRIPTION}
{$description=$META_DESCRIPTION}
{elseif $CHAPO}
{$description=$CHAPO|truncate:150:""}
{/if}
{$url={$URL nofilter}}
{ifloop rel="image"}
{loop type="image" name="image" source={$view_value} source_id={$ID} width="400" height="300" resize_mode="borders" limit="1"}
{$image_src = $IMAGE_URL}
{/loop}
{/ifloop}
{if $view_value == 'product'}
{$price = $PRICE}
{$og_type='product'}

View File

@@ -0,0 +1,45 @@
{$url={navigate to='current' noamp=1}}
{$object_id=''}
{if $view_value == 'content'}
{$object_id={content attr="id"}}
{/if}
{if $view_value == 'folder'}
{$object_id={folder attr="id"}}
{/if}
{if $view_value == 'category'}
{$object_id={category attr="id"}}
{/if}
{if $view_value == 'product'}
{$object_id={product attr="id"}}
{/if}
{$image_src=''}
{ifloop rel="image"}
{loop name={$view_value} type={$view_value} id=$object_id limit="1"}
{loop type="image" name="image" source={$view_value} source_id={$ID} width="400" height="300" resize_mode="borders" limit="1"}
{$image_src = $IMAGE_URL}
{/loop}
{/loop}
{/ifloop}
<div class="og-share-container">
<div class="og-share-box">
<div class="og-share-btn">
<a class="og-share-link fa fa-lg fa-facebook-official" href="http://www.facebook.com/sharer.php?u={$url|escape:'url'}" target="_blank">
</a>
</div>
<div class="og-share-btn">
<a class="og-share-link fa fa-lg fa-twitter" href="https://twitter.com/intent/tweet?source=webclient&amp;url={$url|escape:'url'}" target="_blank">
</a>
</div>
<div class="og-share-btn">
<a class="og-share-link fa fa-lg fa-google-plus" href="https://plus.google.com/share?url={$url|escape:'url'}" target="_blank">
</a>
</div>
<div class="og-share-btn">
<a class="og-share-link fa fa-lg fa-pinterest" href="https://www.pinterest.com/pin/create/button/?url={$url|escape:'url'}&amp;media={$image_src|escape:'url'}" target="_blank">
</a>
</div>
</div>
</div>