* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
defined('_JEXEC') or die('Restricted access');
if (!defined('DS')) {
    define('DS', DIRECTORY_SEPARATOR);
}
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/logger.php';
require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'defines.php';
require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'utils.php';
require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'userAccess.php';
require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/helper.php';
//JHtmlBehavior::framework();
if (JHotelUtil::isJoomla3()) {
    JHtml::_('jquery.framework', true, true);
    //load jQuery before other js
} else {
    if (!defined('J_JQUERY_LOADED')) {
        JHotelUtil::includeFile('script', 'jquery.min.js', 'administrator/components/com_jhotelreservation/assets/js/');
        define('J_JQUERY_LOADED', 1);
    }
}
JHTML::_('script', 'administrator/components/' . getBookingExtName() . '/assets/js/utils.js');
JHTML::_('stylesheet', 'administrator/components/' . getBookingExtName() . '/assets/css/style.css');
JHTML::_('stylesheet', 'administrator/components/' . getBookingExtName() . '/assets/css/general.css');
JHTML::_('stylesheet', 'administrator/components/' . getBookingExtName() . '/assets/css/joomlatabs.css');
//JHTML::_('script',		'administrator/components/'.getBookingExtName().'/assets/jquery-ui.min.js');
//JHTML::_('script',		'administrator/components/'.getBookingExtName().'/assets/tooltip.js');
//JHTML::_('stylesheet', 	'administrator/components/'.getBookingExtName().'/assets/tooltip.css');
Ejemplo n.º 2
0
 private static function getJoomlaSession()
 {
     $session = JFactory::getSession();
     if (JHotelUtil::isJoomla3()) {
         $isActive = $session->isActive();
     } else {
         $isActive = $session->getState() == "active" ? true : false;
     }
     if (!$isActive) {
         $app = JFactory::getApplication();
         $app->enqueueMessage("Your session has expired", 'warning');
         $msg = "Your session has expired";
         $app->redirect('index.php?option=' . getBookingExtName() . '&task=hotels.searchHotels', $msg);
         $app->enqueueMessage("Your session has expired", 'warning');
     } else {
         return $session;
     }
 }