﻿<?xml version="1.0" encoding="UTF-8"?>
<modification>
	<name>DearSoft Auto URL Admin</name>
	<code>acrescentar-url-amigavel-automaticamente-a-marcas-categorias-produtos-informacoes</code>
	<version>1.4.4</version>
	<author>DearSoft</author>
	<link>http://dearsoft.bd</link>

	<file path="admin/controller/catalog/product.php|admin/controller/catalog/category.php|admin/controller/catalog/information.php">
		<operation>
			<search><![CDATA[$data['languages']]]></search>
			<add position="after">
				<![CDATA[
					$data['active_language'] = $this->config->get('config_language_id');
				]]>
			</add>
		</operation>
	</file>

	<file path="admin/view/template/common/header.twig">
		<operation>
			<search><![CDATA[</head>]]></search>
			<add position="before">
				<![CDATA[
					<script type="text/javascript" src="view/javascript/stringToSlug/speakingurl.min.js"></script>
					<script type="text/javascript" src="view/javascript/stringToSlug/jquery.stringToSlug.min.js"></script>
				]]>
			</add>
		</operation>
	</file>

	<file path="admin/view/template/catalog/product_form.twig">
		<operation>
			<search><![CDATA[var attribute_row = {{ attribute_row }};]]></search>
			<add position="after">
				<![CDATA[
					$(document).ready( function() {
						{% for language in languages %}
						var langS{{ language.language_id }} = '{{ language.code }}'.substr(0, 2);
						$('#title-slug{{ language.language_id }}').stringToSlug({
							setEvents: 'keyup keydown blur',
							getPut: '#slug-result{{ language.language_id }}',
							options: {
								lang: langS{{ language.language_id }},
								titleCase: false
							}
						});
						$('#title-slug{{ language.language_id }}').stringToSlug({
							setEvents: 'keyup keydown blur',
							space: ' ',
							options: {
								lang: langS{{ language.language_id }},
								titleCase: true
							},
							callback: function(str) {
								$('.cMeta{{ language.language_id }}').val($('#title-slug{{ language.language_id }}').val());
							}
						});
						{% endfor %}
					});
				]]>
			</add>
		</operation>
		<operation>
			<search><![CDATA[name="product_description[{{ language.language_id }}][name]"]]></search>
			<add position="replace">
				<![CDATA[id="title-slug{{ language.language_id }}" name="product_description[{{ language.language_id }}][name]"]]>
			</add>
		</operation>
		<operation>
			<search><![CDATA[id="input-meta-title{{ language.language_id }}" class="form-control"]]></search>
			<add position="replace">
				<![CDATA[id="input-meta-title{{ language.language_id }}" class="form-control cMeta{{ language.language_id }}"]]>
			</add>
		</operation>
		<operation>
			<search><![CDATA[name="product_seo_url[{{ store.store_id }}][{{ language.language_id }}]"]]></search>
			<add position="replace"><![CDATA[id="slug-result{{ language.language_id }}" name="product_seo_url[{{ store.store_id }}][{{ language.language_id }}]"]]></add>
		</operation>
	</file>

	<file path="admin/view/template/catalog/category_form.twig">
		<operation>
			<search index="0"><![CDATA[<script type="text/javascript">]]></search>
			<add position="after">
				<![CDATA[
					$(document).ready( function() {
					  {% for language in languages %}
					  var langS{{ language.language_id }} = '{{ language.code }}'.substr(0, 2);
            $('#title-slug{{ language.language_id }}').stringToSlug({
							setEvents: 'keyup keydown blur',
							getPut: '#slug-result{{ language.language_id }}',
							options: {
								lang: langS{{ language.language_id }},
								titleCase: false
							}
						});
						$('#title-slug{{ language.language_id }}').stringToSlug({
							setEvents: 'keyup keydown blur',
							space: ' ',
							options: {
								lang: langS{{ language.language_id }},
								titleCase: true
							},
							callback: function(str) {
								$('.cMeta{{ language.language_id }}').val($('#title-slug{{ language.language_id }}').val());
							}
						});
						{% endfor %}
					});
				]]>
			</add>
		</operation>
		<operation>
			<search><![CDATA[name="category_description[{{ language.language_id }}][name]"]]></search>
			<add position="replace">
				<![CDATA[id="title-slug{{ language.language_id }}" name="category_description[{{ language.language_id }}][name]"]]>
			</add>
		</operation>
		<operation>
			<search><![CDATA[id="input-meta-title{{ language.language_id }}" class="form-control"]]></search>
			<add position="replace">
				<![CDATA[id="input-meta-title{{ language.language_id }}" class="form-control cMeta{{ language.language_id }}"]]>
			</add>
		</operation>
		<operation>
			<search><![CDATA[name="category_seo_url[{{ store.store_id }}][{{ language.language_id }}]"]]></search>
			<add position="replace"><![CDATA[id="slug-result{{ language.language_id }}" name="category_seo_url[{{ store.store_id }}][{{ language.language_id }}]"]]></add>
		</operation>
	</file>

	<file path="admin/controller/catalog/manufacturer.php">
		<operation>
			<search><![CDATA[protected function getForm() {]]></search>
			<add position="after">
				<![CDATA[$data['lang'] = $this->language->get('code');]]>
			</add>
		</operation>
	</file>

	<file path="admin/view/template/catalog/manufacturer_form.twig">
		<operation>
			<search><![CDATA[{{ footer }}]]></search>
			<add position="before">
				<![CDATA[
					<script type="text/javascript">
						$(document).ready( function() {
						var langS = '{{ lang }}'.substr(0, 2);
							$('#title-slug{{ lang }}').stringToSlug({
								setEvents: 'keyup keydown blur',
								getPut: '.slug-result{{ lang }}',
								options: {
									lang: langS,
									titleCase: false
								}
							});
							$('#title-slug{{ lang }}').stringToSlug({
								setEvents: 'keyup keydown blur',
								space: ' ',
								options: {
									lang: langS,
									titleCase: true
								},
								callback: function(str) {
									$('.cMeta{{ lang }}').val($('#title-slug{{ lang }}').val());
								}
							});
						});
					</script>
				]]>
			</add>
		</operation>
		<operation>
			<search><![CDATA[name="name"]]></search>
			<add position="replace"><![CDATA[id="title-slug{{ lang }}" name="name"]]></add>
		</operation>
		<operation>
			<search><![CDATA[name="manufacturer_seo_url[{{ store.store_id }}][{{ language.language_id }}]"]]></search>
			<add position="replace"><![CDATA[class="form-control slug-result{{ lang }}" name="manufacturer_seo_url[{{ store.store_id }}][{{ language.language_id }}]"]]></add>
		</operation>
	</file>

	<file path="admin/view/template/catalog/information_form.twig">
		<operation>
			<search><![CDATA[<script type="text/javascript">]]></search>
			<add position="after">
				<![CDATA[
					$(document).ready( function() {
						{% for language in languages %}
					  var langS{{ language.language_id }} = '{{ language.code }}'.substr(0, 2);
						$("#title-slug{{ language.language_id }}").stringToSlug({
							setEvents: 'keyup keydown blur',
							getPut: '#slug-result{{ language.language_id }}',
							options: {
								lang: langS{{ language.language_id }},
								titleCase: false
							}
						});
						$("#title-slug{{ language.language_id }}").stringToSlug({
							setEvents: 'keyup keydown blur',
							space: ' ',
							options: {
								lang: langS{{ language.language_id }},
								titleCase: true
							},
							callback: function(str) {
								$('.cMeta{{ language.language_id }}').val($("#title-slug{{ language.language_id }}").val());
							}
						});
						{% endfor %}
					});
				]]>
			</add>
		</operation>
		<operation>
			<search><![CDATA[name="information_description[{{ language.language_id }}][title]"]]></search>
			<add position="replace">
				<![CDATA[id="title-slug{{ language.language_id }}" name="information_description[{{ language.language_id }}][title]"]]>
			</add>
		</operation>
		<operation>
			<search><![CDATA[id="input-meta-title{{ language.language_id }}" class="form-control"]]></search>
			<add position="replace">
				<![CDATA[id="input-meta-title{{ language.language_id }}" class="form-control cMeta{{ language.language_id }}"]]>
			</add>
		</operation>
		<operation>
			<search><![CDATA[name="information_seo_url[{{ store.store_id }}][{{ language.language_id }}]"]]></search>
			<add position="replace"><![CDATA[id="slug-result{{ language.language_id }}" name="information_seo_url[{{ store.store_id }}][{{ language.language_id }}]"]]></add>
		</operation>
	</file>
</modification>