diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/AdvertisementsController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/AdvertisementsController.php
new file mode 100644
index 000000000..17d9397ad
--- /dev/null
+++ b/plugins/ahmadfatoni/apigenerator/controllers/api/AdvertisementsController.php
@@ -0,0 +1,36 @@
+Reklama = $Advertisement;
+ $this->helpers = $helpers;
+ }
+
+ public function index(){
+ $path = Config::get('app.cdn').Config::get('cms.storage.media.path');
+ //categories list
+ $data = $this->Reklama->select('id','title', 'url', DB::raw("IF(media_mobile<>'',concat('$path',media_mobile),media_mobile) as media_mobile"))
+ ->where('active',1)
+ ->paginate(5)
+ ->toArray();
+
+ return $this->helpers->apiArrayResponseBuilder(200, 'success', $data);
+ }
+
+
+}
diff --git a/plugins/ahmadfatoni/apigenerator/routes.php b/plugins/ahmadfatoni/apigenerator/routes.php
index 35feb607a..395aad3b9 100644
--- a/plugins/ahmadfatoni/apigenerator/routes.php
+++ b/plugins/ahmadfatoni/apigenerator/routes.php
@@ -5,6 +5,7 @@ Route::post('fatoni/update/api/{id}', array('as' => 'fatoni.update.api', 'uses'
Route::get('fatoni/delete/api/{id}', array('as' => 'fatoni.delete.api', 'uses' => 'AhmadFatoni\ApiGenerator\Controllers\ApiGeneratorController@deleteApi'));
//postlar bilen categorialar
Route::resource('api/categories', 'AhmadFatoni\ApiGenerator\Controllers\API\CategoriesController', ['except' => ['destroy', 'create', 'edit']]);
+Route::resource('api/advetisements', 'AhmadFatoni\ApiGenerator\Controllers\API\AdvertisementsController', ['except' => ['destroy', 'create', 'edit']]);
Route::resource('{locale}/api/posts', 'AhmadFatoni\ApiGenerator\Controllers\API\postsController', ['except' => ['destroy', 'create', 'edit']]);
Route::get('api/version',function (){
return '2.0.8';
diff --git a/plugins/tps/reklama/models/reklama/columns.yaml b/plugins/tps/reklama/models/reklama/columns.yaml
index 040bf9c73..0b419c198 100644
--- a/plugins/tps/reklama/models/reklama/columns.yaml
+++ b/plugins/tps/reklama/models/reklama/columns.yaml
@@ -33,3 +33,9 @@ columns:
media:
label: media
type: text
+ searchable: true
+ media_mobile:
+ label: 'Application ADV'
+ type: text
+ searchable: true
+ sortable: true
diff --git a/plugins/tps/reklama/models/reklama/fields.yaml b/plugins/tps/reklama/models/reklama/fields.yaml
index 3b7af943c..d17d9232a 100644
--- a/plugins/tps/reklama/models/reklama/fields.yaml
+++ b/plugins/tps/reklama/models/reklama/fields.yaml
@@ -60,7 +60,12 @@ fields:
span: auto
type: mediafinder
media_mobile:
- label: 'Media for mobile'
+ label: 'Application Reklama (600x140)'
mode: image
span: auto
type: mediafinder
+ web_media_mobile:
+ label: 'Web Media Mobile Version'
+ mode: image
+ span: left
+ type: mediafinder
diff --git a/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_5.php b/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_5.php
new file mode 100644
index 000000000..21e6d4cbe
--- /dev/null
+++ b/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_5.php
@@ -0,0 +1,23 @@
+boolean('is_banner')->default(true);
+ });
+ }
+
+ public function down()
+ {
+ Schema::table('tps_reklama_item', function($table)
+ {
+ $table->dropColumn('is_banner');
+ });
+ }
+}
diff --git a/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_6.php b/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_6.php
new file mode 100644
index 000000000..4fe794308
--- /dev/null
+++ b/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_6.php
@@ -0,0 +1,23 @@
+string('is_banner')->nullable(false)->unsigned(false)->default('true')->change();
+ });
+ }
+
+ public function down()
+ {
+ Schema::table('tps_reklama_item', function($table)
+ {
+ $table->boolean('is_banner')->nullable(false)->unsigned(false)->default(1)->change();
+ });
+ }
+}
diff --git a/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_7.php b/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_7.php
new file mode 100644
index 000000000..83774f4eb
--- /dev/null
+++ b/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_7.php
@@ -0,0 +1,23 @@
+boolean('is_banner')->nullable(false)->unsigned(false)->default(true)->change();
+ });
+ }
+
+ public function down()
+ {
+ Schema::table('tps_reklama_item', function($table)
+ {
+ $table->string('is_banner', 191)->nullable(false)->unsigned(false)->default('true')->change();
+ });
+ }
+}
diff --git a/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_8.php b/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_8.php
new file mode 100644
index 000000000..0d64016d6
--- /dev/null
+++ b/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_8.php
@@ -0,0 +1,23 @@
+dropColumn('is_banner');
+ });
+ }
+
+ public function down()
+ {
+ Schema::table('tps_reklama_item', function($table)
+ {
+ $table->boolean('is_banner')->default(1);
+ });
+ }
+}
diff --git a/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_9.php b/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_9.php
new file mode 100644
index 000000000..c91a9da88
--- /dev/null
+++ b/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_9.php
@@ -0,0 +1,23 @@
+string('web_media_mobile')->nullable();
+ });
+ }
+
+ public function down()
+ {
+ Schema::table('tps_reklama_item', function($table)
+ {
+ $table->dropColumn('web_media_mobile');
+ });
+ }
+}
diff --git a/plugins/tps/reklama/updates/version.yaml b/plugins/tps/reklama/updates/version.yaml
index 3480194fb..b0e73c1b5 100644
--- a/plugins/tps/reklama/updates/version.yaml
+++ b/plugins/tps/reklama/updates/version.yaml
@@ -27,3 +27,18 @@
1.0.10:
- 'Updated table tps_reklama_item'
- builder_table_update_tps_reklama_item_4.php
+1.0.11:
+ - 'Updated table tps_reklama_item'
+ - builder_table_update_tps_reklama_item_5.php
+1.0.12:
+ - 'Updated table tps_reklama_item'
+ - builder_table_update_tps_reklama_item_6.php
+1.0.13:
+ - 'Updated table tps_reklama_item'
+ - builder_table_update_tps_reklama_item_7.php
+1.0.14:
+ - 'Updated table tps_reklama_item'
+ - builder_table_update_tps_reklama_item_8.php
+1.0.15:
+ - 'Updated table tps_reklama_item'
+ - builder_table_update_tps_reklama_item_9.php
diff --git a/storage/framework/classes.php b/storage/framework/classes.php
index 5e19589f8..e7e8f6c72 100644
--- a/storage/framework/classes.php
+++ b/storage/framework/classes.php
@@ -462,4 +462,5 @@
'ToughDeveloper\\ImageResizer\\Classes\\Image' => 'plugins/toughdeveloper/imageresizer/classes/Image.php',
'ToughDeveloper\\ImageResizer\\Models\\Settings' => 'plugins/toughdeveloper/imageresizer/models/Settings.php',
'Rainlab\\Blog\\Models\\Category' => 'plugins/rainlab/blog/models/Category.php',
+ 'AhmadFatoni\\ApiGenerator\\Controllers\\API\\AdvertisementsController' => 'plugins/ahmadfatoni/apigenerator/controllers/api/AdvertisementsController.php',
);
\ No newline at end of file
diff --git a/themes/modern2/assets/js/menu.js b/themes/modern2/assets/js/menu.js
index 8ecb3d66d..810faa2ba 100644
--- a/themes/modern2/assets/js/menu.js
+++ b/themes/modern2/assets/js/menu.js
@@ -19,25 +19,16 @@ searchClose.onclick = function () {
searchModal.classList.remove("active");
};
// =============================================
-function addLink() {
- //Get the selected text and append the extra info
- var selection = window.getSelection();
- pagelink = ". Orient: " + document.location.href;
- copytext = selection + pagelink;
- //Create a new div to hold the prepared text
- newdiv = document.createElement('div');
+const copyListener = (e) => {
+ const range = window.getSelection().getRangeAt(0),
+ rangeContents = range.cloneContents(),
+ pageLink = `Orient Link: ${document.location.href}`,
+ helper = document.createElement("div");
- //hide the newly created container
- newdiv.style.position = 'absolute';
- newdiv.style.left = '-99999px';
+ helper.appendChild(rangeContents);
- //insert the container, fill it with the extended text, and define the new selection
- document.body.appendChild(newdiv);
- newdiv.innerHTML = copytext;
- selection.selectAllChildren(newdiv);
-
- window.setTimeout(function () {
- document.body.removeChild(newdiv);
- }, 100);
-}
-document.addEventListener('copy', addLink);
+ event.clipboardData.setData("text/plain", `${helper.innerText}\n${pageLink}`);
+ event.clipboardData.setData("text/html", `${helper.innerHTML}
${pageLink}`);
+ event.preventDefault();
+};
+document.addEventListener("copy", copyListener);
diff --git a/themes/modern2/content/static-pages-en/contact.htm b/themes/modern2/content/static-pages-en/contact.htm
index 1d9f133e4..13be870bc 100644
--- a/themes/modern2/content/static-pages-en/contact.htm
+++ b/themes/modern2/content/static-pages-en/contact.htm
@@ -9,5 +9,5 @@ title = "Contact us"