-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5432f06
commit 1b1e0c6
Showing
12 changed files
with
642 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<?php | ||
/** | ||
* @package WebTolk plugin info field | ||
* @version 1.0.0 | ||
* @Author Sergey Tolkachyov, https://web-tolk.ru | ||
* @copyright Copyright (C) 2020 Sergey Tolkachyov | ||
* @license GNU/GPL http://www.gnu.org/licenses/gpl-2.0.html | ||
* @since 1.0.0 | ||
*/ | ||
|
||
defined('_JEXEC') or die; | ||
|
||
use Joomla\CMS\Form\FormHelper; | ||
use Joomla\CMS\HTML\HTMLHelper; | ||
use Joomla\CMS\Plugin\PluginHelper; | ||
use Joomla\CMS\Language\Text; | ||
use \Joomla\CMS\Factory; | ||
use Joomla\Registry\Registry; | ||
FormHelper::loadFieldClass('spacer'); | ||
|
||
class JFormFieldPlugininfo extends JFormFieldSpacer | ||
{ | ||
|
||
protected $type = 'plugininfo'; | ||
|
||
/** | ||
* Method to get the field input markup for a spacer. | ||
* The spacer does not have accept input. | ||
* | ||
* @return string The field input markup. | ||
* | ||
* @since 1.7.0 | ||
*/ | ||
protected function getInput() | ||
{ | ||
return ' '; | ||
} | ||
|
||
/** | ||
* @return string The field label markup. | ||
* | ||
* @since 1.7.0 | ||
*/ | ||
protected function getLabel() | ||
{ | ||
$data = $this->form->getData(); | ||
$element = $data->get('element'); | ||
$folder = $data->get('folder'); | ||
|
||
|
||
$doc = Factory::getDocument(); | ||
$doc->addStyleDeclaration(" | ||
.plugin-info-img-svg:hover * { | ||
cursor:pointer; | ||
} | ||
"); | ||
|
||
$wt_plugin_info = simplexml_load_file(JPATH_SITE."/plugins/".$folder."/".$element."/".$element.".xml"); | ||
|
||
|
||
|
||
?> | ||
|
||
<div class="d-flex shadow p-4"> | ||
<div class="flex-shrink-0"> | ||
<a href="https://web-tolk.ru" target="_blank"> | ||
<svg class="plugin-info-img-svg" width="200" height="50" xmlns="http://www.w3.org/2000/svg"> | ||
<g> | ||
<title>Go to https://web-tolk.ru</title> | ||
<text font-weight="bold" xml:space="preserve" text-anchor="start" | ||
font-family="Helvetica, Arial, sans-serif" font-size="32" id="svg_3" y="36.085949" | ||
x="8.152073" stroke-opacity="null" stroke-width="0" stroke="#000" | ||
fill="#0fa2e6">Web</text> | ||
<text font-weight="bold" xml:space="preserve" text-anchor="start" | ||
font-family="Helvetica, Arial, sans-serif" font-size="32" id="svg_4" y="36.081862" | ||
x="74.239105" stroke-opacity="null" stroke-width="0" stroke="#000" | ||
fill="#384148">Tolk</text> | ||
</g> | ||
</svg> | ||
</a> | ||
</div> | ||
<div class="flex-grow-1 ms-3"> | ||
<span class="badge bg-success text-white">v.<?php echo $wt_plugin_info->version; ?></span> | ||
<?php echo Text::_("PLG_".strtoupper($element)."_DESC"); ?> | ||
</div> | ||
</div> | ||
<?php | ||
|
||
} | ||
|
||
/** | ||
* Method to get the field title. | ||
* | ||
* @return string The field title. | ||
* | ||
* @since 1.7.0 | ||
*/ | ||
protected function getTitle() | ||
{ | ||
return $this->getLabel(); | ||
} | ||
|
||
} | ||
?> |
19 changes: 19 additions & 0 deletions
19
language/en-GB/en-GB.plg_system_wt_modules_in_jshopping_positions.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS="System - WT Modules in JShopping positions" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_DESC="The plugin allows you to display Joomla modules in positions on JoomShopping pages" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_PRODUCT_LIST_TMP_VAR_LABEL="Position in the product block <strong>in the list of products (type of category)</strong>" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_PRODUCT_LIST_TMP_VAR_DESC="You can display the module in front of the card, before or after the image, in three special positions for buttons, etc." | ||
|
||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_PRODUCT_TMP_VAR_LABEL="Position <strong>in the product</strong>" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_PRODUCT_TMP_VAR_DESC="You can display the button before or after the product information, before or after the main image or thumbnails, before videos, product files, attributes or characteristics, etc." | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_PRODUCT_VIEW="<h3>Product</h3>" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_PRODUCT_LIST_VIEW="<h3>Product list (category)</h3>" | ||
COM_MODULES_FIELD_POSITION_LABEL="Modules positions" | ||
COM_MODULES_NONE = "- No -" | ||
|
||
COM_PLUGINS_WT_MODULES_IN_JSHOPPING_POSITIONS_PRODUCT_FIELDSET_LABEL="JoomShopping product" | ||
COM_PLUGINS_WT_MODULES_IN_JSHOPPING_POSITIONS_CATEGORY_FIELDSET_LABEL="JoomShopping category" | ||
PLG_WT_MODULES_IN_JSHOPPING_CATEGORY_CATEGORY_OR_PRODUCT="Modules position in..." | ||
PLG_WT_MODULES_IN_JSHOPPING_CATEGORY_CATEGORY_OR_PRODUCT_PRODUCT="product" | ||
PLG_WT_MODULES_IN_JSHOPPING_CATEGORY_CATEGORY_OR_PRODUCT_CATEGORY="category" | ||
PLG_WT_MODULES_IN_JSHOPPING_CATEGORY_CUSTOM_POSITION_CATEGORY="Custom position in JoomShopping category" | ||
PLG_WT_MODULES_IN_JSHOPPING_CATEGORY_CUSTOM_POSITION_PRODUCT="Custom position in products of JoomShopping category" |
7 changes: 7 additions & 0 deletions
7
language/en-GB/en-GB.plg_system_wt_modules_in_jshopping_positions.sys.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS="System - WT Modules in JShopping positions" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_DESC="The plugin allows you to display Joomla modules in positions on JoomShopping pages" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_AFTER_INSTALL = "Thank you for intalling extension" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_AFTER_DISCOVER_INSTALL = "Thank you for intalling extension" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_AFTER_UPDATE = "Thank you for updating extension" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_MAYBE_INTERESTING="<h4>It might be interesting</h4><ul class=\"nav nav-tabs nav-stacked list-group\"><li class=\"list-group-item\"><a href=\"https://web-tolk.ru/en/dev/joomshopping/action-log-joomshopping.html\" target=\"_blank\" title=\"Go to https://web-tolk.ru\">Action log - JoomShopping - free plugin.</a></li><li class=\"list-group-item\"><a href=\"https://web-tolk.ru/en/dev/joomshopping/wt-sm-ozon-rocket-dlya-joomshopping.html\" target=\"_blank\" title=\"Go to https://web-tolk.ru\">WT SM Ozon Rocket for JoomShopping, shipping method.</a></li><li class=\"list-group-item\"><a href=\"https://web-tolk.ru/dev/joomshopping/joomshopping-russian-post-shipping-method-api.html\" target=\"_blank\" title=\"Go to https://web-tolk.ru\">JoomShopping Russian Post Shipping method (via API)</a></li><li class=\"list-group-item\"><a href=\"https://web-tolk.ru/en/dev/joomla-plugins/wt-joomshopping-bitrix24-pro.html\" target=\"_blank\" title=\"Go to https://web-tolk.ru\">WT JoomShopping Bitrix24 PRO, two-way integration plugin for JoomShopping online store and Bitrix24 CRM.</a></li></ul>" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_WHATS_NEW="<h3>v.1.0.0 What's new?</h3><h4>First extension version</h4>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<html><body bgcolor="#FFFFFF"></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<html><body bgcolor="#FFFFFF"></body></html> |
19 changes: 19 additions & 0 deletions
19
language/ru-RU/ru-RU.plg_system_wt_modules_in_jshopping_positions.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS="System - WT Modules in JShopping positions" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_DESC="Плагин позволяет выводить модули Joomla в позициях на страницах JoomShopping" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_PRODUCT_LIST_TMP_VAR_LABEL="Позиция в блоке товара <strong>в списке товаров (вид категории)</strong>" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_PRODUCT_LIST_TMP_VAR_DESC="Вы можете вывести модуль перед карточкой, перед или после изображения, в трех специальных позициях для кнопок и т.д." | ||
|
||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_PRODUCT_TMP_VAR_LABEL="Позиция <strong>в карточке товара</strong>" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_PRODUCT_TMP_VAR_DESC="Вы можете вывести кнопку перед или после информации о товаре, перед или после основного изображения или миниатюр, перед видео, файлами товара, атрибутами или характеристиками и т.д." | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_PRODUCT_VIEW="<h3>Карточка товара</h3>" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_PRODUCT_LIST_VIEW="<h3>Список товаров (категория)</h3>" | ||
COM_MODULES_FIELD_POSITION_LABEL="Позиция модулей" | ||
COM_MODULES_NONE = "- Нет -" | ||
|
||
COM_PLUGINS_WT_MODULES_IN_JSHOPPING_POSITIONS_PRODUCT_FIELDSET_LABEL="Товар JoomShopping" | ||
COM_PLUGINS_WT_MODULES_IN_JSHOPPING_POSITIONS_CATEGORY_FIELDSET_LABEL="Категория JoomShopping" | ||
PLG_WT_MODULES_IN_JSHOPPING_CATEGORY_CATEGORY_OR_PRODUCT="Позиция модуля в..." | ||
PLG_WT_MODULES_IN_JSHOPPING_CATEGORY_CATEGORY_OR_PRODUCT_PRODUCT="товаре" | ||
PLG_WT_MODULES_IN_JSHOPPING_CATEGORY_CATEGORY_OR_PRODUCT_CATEGORY="категории" | ||
PLG_WT_MODULES_IN_JSHOPPING_CATEGORY_CUSTOM_POSITION_CATEGORY="Пользовательская позиция в категории JoomShopping" | ||
PLG_WT_MODULES_IN_JSHOPPING_CATEGORY_CUSTOM_POSITION_PRODUCT="Пользовательская позиция в товаре категории JoomShopping" |
7 changes: 7 additions & 0 deletions
7
language/ru-RU/ru-RU.plg_system_wt_modules_in_jshopping_positions.sys.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS="System - WT Modules in JShopping positions" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_DESC="Плагин позволяет выводить модули Joomla в позициях на страницах JoomShopping" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_AFTER_INSTALL = "Спасибо за установку расширения" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_AFTER_DISCOVER_INSTALL = "Спасибо за установку расширения" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_AFTER_UPDATE = "Спасибо за обновление расширения" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_MAYBE_INTERESTING="<h4>Может быть интересно</h4><ul class=\"nav nav-tabs nav-stacked list-group\"><li class=\"list-group-item\"><a href=\"https://web-tolk.ru/dev/joomshopping/action-log-joomshopping.html\" target=\"_blank\" title=\"Перейти на https://web-tolk.ru\">Action log - JoomShopping - логирование действий пользователя в JoomShopping.</a></li><li class=\"list-group-item\"><a href=\"https://web-tolk.ru/dev/joomshopping/wt-sm-ozon-rocket-dlya-joomshopping.html\" target=\"_blank\" title=\"Перейти на https://web-tolk.ru\">WT SM Ozon Rocket для JoomShopping, расчет стоимости доставки.</a></li><li class=\"list-group-item\"><a href=\"https://web-tolk.ru/dev/joomshopping/wt-sm-otpravka-pochta-ru.html\" target=\"_blank\" title=\"Перейти на https://web-tolk.ru\">Интеграция JoomShopping с Почтой России для Бизнеса</a></li><li class=\"list-group-item\"><a href=\"https://web-tolk.ru/dev/joomshopping/wt-joomshopping-favorite.html\" target=\"_blank\" title=\"Перейти на https://web-tolk.ru\">WT JoomShopping Favorites, альтернативный список пожеланий (wishlist) для JoomShopping.</a></li><li class=\"list-group-item\"><a href=\"https://web-tolk.ru/dev/joomla-plugins/wt-joomshopping-schema-org.html\" target=\"_blank\" title=\"Перейти на https://web-tolk.ru\">WT JoomShopping Schema.Org, плагин добавляет на страницы товара и категории товара микроразметку Schema.org для категорий товаров, производителей и товаров JoomShopping в формате ld+json</a></li><li class=\"list-group-item\"><a href=\"https://web-tolk.ru/dev/joomshopping/shablon-joomshopping-na-bootstrap-4-6.html\" target=\"_blank\" title=\"Перейти на https://web-tolk.ru\">Шаблон Joomshopping на Bootstrap 4.6.</a></li><li class=\"list-group-item\"><a href=\"https://web-tolk.ru/dev/joomla-plugins/wt-joomshopping-bitrix24-pro.html\" target=\"_blank\" title=\"Перейти на https://web-tolk.ru\">WT JoomShopping Bitrix24 PRO, плагин двухсторонней интеграции интернет-магазина JoomShopping и CRM Битрикс24.</a></li></ul>" | ||
PLG_WT_MODULES_IN_JSHOPPING_POSITIONS_WHATS_NEW="<h3>v.1.0.0 Что нового?</h3><h4>Первая версия расширения</h4>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
<?php | ||
// No direct access to this file | ||
defined('_JEXEC') or die('Restricted access'); | ||
use Joomla\CMS\Factory; | ||
use Joomla\CMS\Installer\Installer; | ||
use Joomla\CMS\Installer\InstallerHelper; | ||
use Joomla\CMS\Language\Text; | ||
use Joomla\CMS\Plugin\PluginHelper; | ||
use Joomla\CMS\Version; | ||
/** | ||
* Script file of HelloWorld component. | ||
* | ||
* The name of this class is dependent on the component being installed. | ||
* The class name should have the component's name, directly followed by | ||
* the text InstallerScript (ex:. com_helloWorldInstallerScript). | ||
* | ||
* This class will be called by Joomla!'s installer, if specified in your component's | ||
* manifest file, and is used for custom automation actions in its installation process. | ||
* | ||
* In order to use this automation script, you should reference it in your component's | ||
* manifest file as follows: | ||
* <scriptfile>script.php</scriptfile> | ||
* | ||
* @package Joomla.Administrator | ||
* @subpackage com_helloworld | ||
* | ||
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
class plgSystemWt_modules_in_jshopping_positionsInstallerScript | ||
{ | ||
/** | ||
* This method is called after a component is installed. | ||
* | ||
* @param \stdClass $parent - Parent object calling this method. | ||
* | ||
* @return void | ||
*/ | ||
public function install($parent) | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* This method is called after a component is uninstalled. | ||
* | ||
* @param \stdClass $parent - Parent object calling this method. | ||
* | ||
* @return void | ||
*/ | ||
public function uninstall($parent) | ||
{ | ||
|
||
|
||
} | ||
|
||
/** | ||
* This method is called after a component is updated. | ||
* | ||
* @param \stdClass $parent - Parent object calling object. | ||
* | ||
* @return void | ||
*/ | ||
public function update($parent) | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* Runs just before any installation action is performed on the component. | ||
* Verifications and pre-requisites should run in this function. | ||
* | ||
* @param string $type - Type of PreFlight action. Possible values are: | ||
* - * install | ||
* - * update | ||
* - * discover_install | ||
* @param \stdClass $parent - Parent object calling object. | ||
* | ||
* @return void | ||
*/ | ||
public function preflight($type, $parent) | ||
{ | ||
|
||
} | ||
|
||
|
||
|
||
/** | ||
* Runs right after any installation action is performed on the component. | ||
* | ||
* @param string $type - Type of PostFlight action. Possible values are: | ||
* - * install | ||
* - * update | ||
* - * discover_install | ||
* @param \stdClass $parent - Parent object calling object. | ||
* | ||
* @return void | ||
*/ | ||
function postflight($type, $installer) | ||
{ | ||
|
||
|
||
$jversion = new Version(); | ||
|
||
// only for Joomla 3.x | ||
|
||
if (version_compare($jversion->getShortVersion(), '4.0', '<')) { | ||
|
||
$element = strtoupper($installer->get("element")); // ex. "$parent" | ||
$class = 'span'; | ||
$web_tolk_site_icon = "<i class='icon-share-alt'></i>"; | ||
|
||
} else { | ||
|
||
$element = strtoupper($installer->getElement()); | ||
$class = 'col-'; | ||
$web_tolk_site_icon = ''; | ||
} | ||
|
||
$smile = ''; | ||
if($type != 'uninstall'){ | ||
$smiles = ['☺','😀','😉','😍','😎','😊','🙏']; | ||
$smile_key = array_rand($smiles, 1); | ||
$smile = $smiles[$smile_key]; | ||
} | ||
|
||
echo " | ||
<div class='row bg-white' style='margin:25px auto; border:1px solid rgba(0,0,0,0.125); box-shadow:0px 0px 10px rgba(0,0,0,0.125); padding: 10px 20px;'> | ||
<div class='".$class."8 p-2'> | ||
<h2>".$smile.Text::_("PLG_".$element."_AFTER_".strtoupper($type))." <br/>".Text::_("PLG_".$element)."</h2> | ||
".Text::_("PLG_".$element."_DESC"); | ||
|
||
|
||
echo Text::_("PLG_".$element."_WHATS_NEW"); | ||
|
||
echo "</div> | ||
<div class='".$class."4' style='display:flex; flex-direction:column; justify-content:start;'> | ||
<img width='200' src='https://web-tolk.ru/web_tolk_logo_wide.png'> | ||
<p>Joomla Extensions</p> | ||
<p class='btn-group'> | ||
<a class='btn btn-sm btn-outline-primary' href='https://web-tolk.ru' target='_blank'>".$web_tolk_site_icon." https://web-tolk.ru</a> | ||
<a class='btn btn-sm btn-outline-primary' href='mailto:info@web-tolk.ru'><i class='icon-envelope'></i> info@web-tolk.ru</a> | ||
</p> | ||
<p><a class='btn btn-sm btn-outline-info' href='https://t.me/joomlaru' target='_blank'>Joomla Russian Community in Telegram</a></p> | ||
".Text::_("PLG_".$element."_MAYBE_INTERESTING")." | ||
</div> | ||
"; | ||
|
||
} | ||
} |
Oops, something went wrong.