authorise('core.create', 'com_pagebuilderck') || (count($user->getAuthorisedCategories('com_pagebuilderck', 'core.create')))); if ($authorised !== true) { throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403); return false; } $url = 'https://media.joomlack.fr/api/pagebuilderck/pages'; // for local test purpose only // if ($input->getInt('sandbox' == '1')) { // $url = 'https://localhost/media.joomlack.fr'; // } // store the library in the session to avoid to much request to the external server // $session = JFactory::getSession(); // if (! $this->itemsCats = $session->get('pagebuilderck_library_categories')) { // try { // $itemsCats = file_get_contents($url); // } catch (Exception $e) { // echo 'ERROR : Unable To connect to the library server. Check your internet connection and retry later. ', $e->getMessage(), "\n"; // exit(); // } // $this->itemsCats = json_decode($itemsCats); // $session->set('pagebuilderck_library_categories', $this->itemsCats); // } parent::display($tpl); exit(); } }