Skip to content

Commit d27a4a5

Browse files
author
shreesh arora
committed
Using ->_path while including js and css
1 parent 8a5c66f commit d27a4a5

31 files changed

+38
-84
lines changed

controllers/front/ProductController.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ public function setMedia()
4646
$this->addCSS(_THEME_CSS_DIR_.'product.css');
4747
$this->addCSS(_THEME_CSS_DIR_.'print.css', 'print');
4848
$this->addJqueryPlugin(array('fancybox', 'idTabs', 'scrollTo', 'serialScroll', 'bxslider'));
49-
// for the search block By webkul
50-
$this->addCSS(_PS_MODULE_DIR_.'hotelreservationsystem/views/css/datepickerCustom.css');
49+
$this->addCSS(_THEME_CSS_DIR_.'datepicker.css');
5150
$this->addJS(array(
5251
_THEME_JS_DIR_.'tools.js', // retro compat themes 1.5
5352
_THEME_JS_DIR_.'product.js'

modules/hotelreservationsystem/libs/datatable/index.php renamed to js/datatable/index.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* 2010-2020 Webkul.
3+
* 2010-2021 Webkul.
44
*
55
* NOTICE OF LICENSE
66
*
@@ -14,7 +14,7 @@
1414
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
1515
*
1616
* @author Webkul IN <[email protected]>
17-
* @copyright 2010-2020 Webkul IN
17+
* @copyright 2010-2021 Webkul IN
1818
* @license https://store.webkul.com/license.html
1919
*/
2020

@@ -25,5 +25,5 @@
2525
header('Cache-Control: post-check=0, pre-check=0', false);
2626
header('Pragma: no-cache');
2727

28-
header('Location: ../../../');
28+
header('Location: ../../');
2929
exit;

modules/hotelreservationsystem/libs/index.php renamed to js/owl-carousel/index.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* 2010-2020 Webkul.
3+
* 2010-2021 Webkul.
44
*
55
* NOTICE OF LICENSE
66
*
@@ -14,7 +14,7 @@
1414
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
1515
*
1616
* @author Webkul IN <[email protected]>
17-
* @copyright 2010-2020 Webkul IN
17+
* @copyright 2010-2021 Webkul IN
1818
* @license https://store.webkul.com/license.html
1919
*/
2020

@@ -25,5 +25,5 @@
2525
header('Cache-Control: post-check=0, pre-check=0', false);
2626
header('Pragma: no-cache');
2727

28-
header('Location: ../../../');
28+
header('Location: ../../');
2929
exit;

modules/blocknavigationmenu/blocknavigationmenu.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ public function hookDisplayTopSubSecondaryBlock($params)
5353
'currentPage' => Tools::getValue('controller')
5454
)
5555
);
56-
$this->context->controller->addJS(_PS_MODULE_DIR_.$this->name.'/views/js/htlnevigationmenu.js');
57-
$this->context->controller->addCSS(_PS_MODULE_DIR_.$this->name.'/views/css/blocknavigation.css');
56+
$this->context->controller->addJS($this->_path.'/views/js/htlnevigationmenu.js');
57+
$this->context->controller->addCSS($this->_path.'/views/css/blocknavigation.css');
5858

5959
$objCustomNavigationLink = new WkCustomNavigationLink();
6060
if ($navigationLinks = $objCustomNavigationLink->getCustomNavigationLinks(1, false, 1)) {
@@ -78,7 +78,7 @@ public function hookFooter()
7878
$link['link'] = $this->context->link->getPageLink($link['link']);
7979
}
8080
}
81-
$this->context->controller->addCSS(_PS_MODULE_DIR_.$this->name.'/views/css/wkFooterNavigationBlock.css');
81+
$this->context->controller->addCSS($this->_path.'/views/css/wkFooterNavigationBlock.css');
8282
$this->context->smarty->assign('navigation_links', $navigationLinks);
8383
return $this->display(__FILE__, 'wkFooterNavigationBlock.tpl');
8484
}

modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php

+2-9
Original file line numberDiff line numberDiff line change
@@ -601,15 +601,8 @@ public function setMedia()
601601
parent::setMedia();
602602

603603
HotelHelper::assignDataTableVariables();
604-
$this->context->controller->addJS(
605-
_MODULE_DIR_.$this->module->name.'/libs/datatable/jquery.dataTables.min.js'
606-
);
607-
$this->context->controller->addJS(
608-
_MODULE_DIR_.$this->module->name.'/libs/datatable/dataTables.bootstrap.js'
609-
);
610-
$this->context->controller->addCSS(
611-
_MODULE_DIR_.$this->module->name.'/views/css/libs/datatable/datatable_bootstrap.css'
612-
);
604+
$this->context->controller->addJS(_PS_JS_DIR_.'/datatable/jquery.dataTables.min.js');
605+
$this->context->controller->addJS(_PS_JS_DIR_.'/datatable/dataTables.bootstrap.js');
613606

614607
Media::addJsDef(
615608
array(

modules/hotelreservationsystem/controllers/admin/AdminHotelFeaturePricesSettings.php

-1
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,6 @@ public function ajaxProcessSearchProductByName()
458458
public function setMedia()
459459
{
460460
parent::setMedia();
461-
$this->addCSS(_MODULE_DIR_.'hotelreservationsystem/views/css/datepickerCustom.css');
462461
$this->addCSS(_MODULE_DIR_.'hotelreservationsystem/views/css/HotelReservationAdmin.css');
463462
$this->addJs(_MODULE_DIR_.'hotelreservationsystem/views/js/HotelReservationAdmin.js');
464463
}

modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,6 @@ public function setMedia()
676676
parent::setMedia();
677677

678678
$this->addCSS(array(_MODULE_DIR_.'hotelreservationsystem/views/css/HotelReservationAdmin.css'));
679-
$this->addJs(_PS_MODULE_DIR_.$this->module->name.'/views/js/HotelReservationAdmin.js');
679+
$this->addJs(_MODULE_DIR_.$this->module->name.'/views/js/HotelReservationAdmin.js');
680680
}
681681
}

modules/hotelreservationsystem/hotelreservationsystem.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ public function hookDisplayHeader()
9595
}
9696
}
9797
//End
98-
$this->context->controller->addCSS(_PS_MODULE_DIR_.$this->name.'/views/css/HotelReservationFront.css');
99-
$this->context->controller->addJS(_PS_MODULE_DIR_.$this->name.'/views/js/HotelReservationFront.js');
98+
$this->context->controller->addCSS($this->_path.'/views/css/HotelReservationFront.css');
99+
$this->context->controller->addJS($this->_path.'/views/js/HotelReservationFront.js');
100100
}
101101

102102
public function hookDisplayAfterHookTop()

modules/hotelreservationsystem/libs/owl.carousel/assets/index.php

-10
This file was deleted.

modules/hotelreservationsystem/libs/owl.carousel/index.php

-10
This file was deleted.

modules/wkabouthotelblock/wkabouthotelblock.php

+5-12
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,11 @@ public function __construct()
4545

4646
public function hookDisplayHome()
4747
{
48-
// owl.carousel Plug-in files
49-
$this->context->controller->addCSS(
50-
_PS_MODULE_DIR_.'hotelreservationsystem/libs/owl.carousel/assets/owl.carousel.min.css'
51-
);
52-
$this->context->controller->addCSS(
53-
_PS_MODULE_DIR_.'hotelreservationsystem/libs/owl.carousel/assets/owl.theme.default.min.css'
54-
);
55-
$this->context->controller->addJS(
56-
_PS_MODULE_DIR_.'hotelreservationsystem/libs/owl.carousel/owl.carousel.min.js'
57-
);
58-
$this->context->controller->addCSS(_PS_MODULE_DIR_.$this->name.'/views/css/WkAboutHotelBlockFront.css');
59-
$this->context->controller->addJS(_PS_MODULE_DIR_.$this->name.'/views/js/WkAboutHotelBlockFront.js');
48+
$this->context->controller->addCSS(_PS_JS_DIR_.'owl-carousel/assets/owl.carousel.min.css');
49+
$this->context->controller->addCSS(_PS_JS_DIR_.'owl-carousel/assets/owl.theme.default.min.css');
50+
$this->context->controller->addJS(_PS_JS_DIR_.'owl-carousel/owl.carousel.min.js');
51+
$this->context->controller->addCSS($this->_path.'/views/css/WkAboutHotelBlockFront.css');
52+
$this->context->controller->addJS($this->_path.'/views/js/WkAboutHotelBlockFront.js');
6053

6154
$HOTEL_INTERIOR_HEADING = Configuration::get('HOTEL_INTERIOR_HEADING', $this->context->language->id);
6255
$HOTEL_INTERIOR_DESCRIPTION = Configuration::get('HOTEL_INTERIOR_DESCRIPTION', $this->context->language->id);

modules/wkfooteraboutblock/wkfooteraboutblock.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function hookFooter($params)
4646
array('WK_HTL_SHORT_DESC' => Configuration::get('WK_HTL_SHORT_DESC', $this->context->language->id))
4747
);
4848

49-
$this->context->controller->addCSS(_PS_MODULE_DIR_.$this->name.'/views/css/wkFooterAboutBlockFront.css');
49+
$this->context->controller->addCSS($this->_path.'/views/css/wkFooterAboutBlockFront.css');
5050
return $this->display(__FILE__, 'wkFooterAboutBlock.tpl');
5151
}
5252

modules/wkfooterpaymentblock/wkfooterpaymentblock.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function hookFooter($params)
4949
$objPaymentBlockInfo = new WkFooterPaymentBlockInfo();
5050
if ($allPaymentBlocks = $objPaymentBlockInfo->getAllPaymentBlocks(1, 'position')) {
5151
$this->context->smarty->assign('allPaymentBlocks', $allPaymentBlocks);
52-
$this->context->controller->addCSS(_PS_MODULE_DIR_.$this->name.'/views/css/wkFooterPaymentBlockFront.css');
52+
$this->context->controller->addCSS($this->_path.'/views/css/wkFooterPaymentBlockFront.css');
5353
return $this->display(__FILE__, 'wkFooterPaymentBlock.tpl');
5454
}
5555
}

modules/wkhotelfeaturesblock/wkhotelfeaturesblock.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public function __construct()
4444

4545
public function hookDisplayHome()
4646
{
47-
$this->context->controller->addCSS(_PS_MODULE_DIR_.$this->name.'/views/css/wkHotelFeaturesBlockFront.css');
48-
$this->context->controller->addJS(_PS_MODULE_DIR_.$this->name.'/views/js/wkHotelFeaturesBlockFront.js');
47+
$this->context->controller->addCSS($this->_path.'/views/css/wkHotelFeaturesBlockFront.css');
48+
$this->context->controller->addJS($this->_path.'/views/js/wkHotelFeaturesBlockFront.js');
4949

5050
$objFeaturesData = new WkHotelFeaturesData();
5151
$hotelAmenities = $objFeaturesData->getHotelAmenities(1);

modules/wkhotelfilterblock/wkhotelfilterblock.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ public function hookDisplayLeftColumn()
200200
if ($this->context->controller->php_self == 'category') {
201201
Media::addJsDef(array('noRoomAvailTxt' => $this->l('No room available')));
202202

203-
$this->context->controller->addJS(_PS_MODULE_DIR_.$this->name.'/views/js/wkhotelfilterblock.js');
204-
$this->context->controller->addCSS(_PS_MODULE_DIR_.$this->name.'/views/css/wkhotelfilterblock.css');
203+
$this->context->controller->addJS($this->_path.'/views/js/wkhotelfilterblock.js');
204+
$this->context->controller->addCSS($this->_path.'/views/css/wkhotelfilterblock.css');
205205
$id_lang = $this->context->language->id;
206206
$all_feat = FeatureCore::getFeatures($id_lang);
207207

modules/wkhotelroom/wkhotelroom.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function hookDisplayHome()
9898
)
9999
);
100100

101-
$this->context->controller->addCSS(_PS_MODULE_DIR_.$this->name.'/views/css/WkHotelRoomBlockFront.css');
101+
$this->context->controller->addCSS($this->_path.'/views/css/WkHotelRoomBlockFront.css');
102102

103103
return $this->display(__FILE__, 'hotelRoomDisplayBlock.tpl');
104104
}

modules/wkroomsearchblock/wkroomsearchblock.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ public function hookActionFrontControllerSetMedia()
5151
|| 'index' == $controller
5252
|| 'product' == $controller
5353
) {
54-
$this->context->controller->addCSS(_PS_MODULE_DIR_.'hotelreservationsystem/views/css/datepickerCustom.css');
55-
$this->context->controller->addCSS(_PS_MODULE_DIR_.$this->name.'/views/css/wk-global-search.css');
56-
$this->context->controller->addJS(_PS_MODULE_DIR_.$this->name.'/views/js/wk-room-search-block.js');
54+
$this->context->controller->addCSS($this->_path.'/views/css/wk-global-search.css');
55+
$this->context->controller->addJS($this->_path.'/views/js/wk-room-search-block.js');
56+
$this->context->controller->addCSS(_THEME_CSS_DIR_.'datepicker.css');
5757

5858
Media::addJsDef(
5959
array (

modules/wktestimonialblock/wktestimonialblock.php

+6-16
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,12 @@ public function hookDisplayAddModuleSettingLink()
5353

5454
public function hookDisplayHome()
5555
{
56-
// These files are already included in "wkabouthotelblock" module
57-
if (!(Module::isInstalled('wkabouthotelblock') && Module::isEnabled('wkabouthotelblock'))) {
58-
// owl.carousel Plug-in files
59-
$this->context->controller->addCSS(
60-
_PS_MODULE_DIR_.'hotelreservationsystem/libs/owl.carousel/assets/owl.carousel.min.css'
61-
);
62-
$this->context->controller->addCSS(
63-
_PS_MODULE_DIR_.'hotelreservationsystem/libs/owl.carousel/assets/owl.theme.default.min.css'
64-
);
65-
$this->context->controller->addJS(
66-
_PS_MODULE_DIR_.'hotelreservationsystem/libs/owl.carousel/owl.carousel.min.js'
67-
);
68-
}
69-
/*---- Module Files ----*/
70-
$this->context->controller->addCSS(_PS_MODULE_DIR_.$this->name.'/views/css/WkTestimonialBlockFront.css');
71-
$this->context->controller->addJS(_PS_MODULE_DIR_.$this->name.'/views/js/WkTestimonialBlockFront.js');
56+
$this->context->controller->addCSS(_PS_JS_DIR_.'/owl-carousel/assets/owl.carousel.min.css');
57+
$this->context->controller->addCSS(_PS_JS_DIR_.'/owl-carousel/assets/owl.theme.default.min.css');
58+
$this->context->controller->addJS(_PS_JS_DIR_.'/owl-carousel/owl.carousel.min');
59+
60+
$this->context->controller->addCSS($this->_path.'/views/css/WkTestimonialBlockFront.css');
61+
$this->context->controller->addJS($this->_path.'/views/js/WkTestimonialBlockFront.js');
7262

7363
$HOTEL_TESIMONIAL_BLOCK_HEADING = Configuration::get(
7464
'HOTEL_TESIMONIAL_BLOCK_HEADING',

modules/hotelreservationsystem/views/css/datepickerCustom.css renamed to themes/hotel-reservation-theme/css/datepicker.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* 2010-2020 Webkul.
2+
* 2010-2021 Webkul.
33
*
44
* NOTICE OF LICENSE
55
*
@@ -13,7 +13,7 @@
1313
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
1414
*
1515
* @author Webkul IN <[email protected]>
16-
* @copyright 2010-2020 Webkul IN
16+
* @copyright 2010-2021 Webkul IN
1717
* @license https://store.webkul.com/license.html
1818
*/
1919

0 commit comments

Comments
 (0)