11<?php
22/**
33 * @package API
4- * @version 1.5
5- * @author Brian Edgerton
6- * @link http://www.edgewebworks .com
7- * @copyright Copyright (C) 2011 Edge Web Works, LLC . All rights reserved.
4+ * @version 1.5.1
5+ * @author Techjoomla
6+ * @link http://techjoomla .com
7+ * @copyright Copyright (C) 2014 Techjoomla . All rights reserved.
88 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
99 */
1010
@@ -18,9 +18,22 @@ public function __construct(&$subject, $config = array())
1818 {
1919 parent ::__construct ($ subject , $ config = array ());
2020
21+ $ easyblog = JPATH_ROOT . '/administrator/components/com_easyblog/easyblog.php ' ;
22+ if (!JFile::exists ($ easyblog )) {
23+ ApiError::raiseError (404 , 'Easyblog not installed ' );
24+ return ;
25+ }
26+
27+ // Set resources & access
2128 ApiResource::addIncludePath (dirname (__FILE__ ).'/easyblog ' );
2229 $ this ->setResourceAccess ('latest ' , 'public ' , 'get ' );
2330 $ this ->setResourceAccess ('category ' , 'public ' , 'get ' );
2431 $ this ->setResourceAccess ('blog ' , 'public ' , 'get ' );
32+
33+ // Load Easyblog language & bootstrap files
34+ $ language = JFactory::getLanguage ();
35+ $ language ->load ('com_easyblog ' );
36+ require_once ( JPATH_ROOT . '/components/com_easyblog/constants.php ' );
37+ require_once ( EBLOG_HELPERS . '/helper.php ' );
2538 }
2639}
0 commit comments