/**
  * Plugin that loads DJ-Mediatools gallery within content
  *
  * @param	string	The context of the content being passed to the plugin.
  * @param	object	The article object.  Note $article->text is also available
  * @param	object	The article params
  * @param	int		The 'page' number
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $lang = JFactory::getLanguage();
     $lang->load('com_djmediatools', JPATH_SITE, 'en-GB', false, false);
     $lang->load('com_djmediatools', JPATH_SITE . '/components/com_djmediatools', 'en-GB', false, false);
     $lang->load('com_djmediatools', JPATH_SITE, null, true, false);
     $lang->load('com_djmediatools', JPATH_SITE . '/components/com_djmediatools', null, true, false);
     jimport('joomla.application.module.helper');
     // Include the syndicate functions only once
     require_once JPATH_ROOT . '/components/com_djmediatools/helpers/helper.php';
     JModelLegacy::addIncludePath(JPATH_ROOT . '/components/com_djmediatools/models', 'DJMediatoolsModel');
     JModelLegacy::addTablePath(JPATH_ADMINISTRATOR . '/components/com_djmediatools/tables');
 }
Example #2
0
 protected function _load($cid)
 {
     if (!isset(self::$galleries[$cid])) {
         self::$galleries[$cid] = '';
         jimport('joomla.application.module.helper');
         // Include the syndicate functions only once
         require_once JPATH_ROOT . '/components/com_djmediatools/helpers/helper.php';
         JModelLegacy::addIncludePath(JPATH_ROOT . '/components/com_djmediatools/models');
         JModelLegacy::addTablePath(JPATH_ADMINISTRATOR . '/components/com_djmediatools/tables');
         $model = JModelLegacy::getInstance('Categories', 'DJMediatoolsModel', array('ignore_request' => true));
         $model->setState('category.id', $cid);
         $model->setState('filter.published', 1);
         $params = $model->getParams(false);
         $category = $model->getItem();
         if ($category === false) {
             //JError::raiseError(404, JText::_('COM_DJMEDIATOOLS_ERROR_CATEGORY_NOT_FOUND'));
             return null;
         }
         $lang = JFactory::getLanguage();
         $lang->load('com_djmediatools', JPATH_SITE, 'en-GB', false, false);
         $lang->load('com_djmediatools', JPATH_SITE . '/components/com_djmediatools', 'en-GB', false, false);
         $lang->load('com_djmediatools', JPATH_SITE, null, true, false);
         $lang->load('com_djmediatools', JPATH_SITE . '/components/com_djmediatools', null, true, false);
         // get gallery slides and layout
         $helper = DJMediatoolsLayoutHelper::getInstance($params->get('layout', 'slideshow'));
         $mid = $category->id . 'p';
         $params->set('gallery_id', $mid);
         $params->set('category', $category->id);
         $params->set('source', $category->source);
         $params = $helper->getParams($params);
         $slides = $helper->getSlides($params);
         if ($slides) {
             $helper->addScripts($params);
             $helper->addStyles($params);
             $navigation = $helper->getNavigation($params);
         } else {
             return JText::_('COM_DJMEDIATOOLS_EMPTY_CATEGORY');
         }
         ob_start();
         require JModuleHelper::getLayoutPath('mod_djmediatools', $params->get('layout', 'slideshow'));
         self::$galleries[$cid] = ob_get_clean();
     }
     return self::$galleries[$cid];
 }
Example #3
0
 *
 * DJ-MediaTools is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with DJ-MediaTools. If not, see <http://www.gnu.org/licenses/>.
 *
 */
// no direct access
defined('_JEXEC') or die('Restricted access');
// Include the syndicate functions only once
require_once JPATH_ROOT . '/components/com_djmediatools/helpers/helper.php';
JModelLegacy::addIncludePath(JPATH_ROOT . '/components/com_djmediatools/models', 'DJMediatoolsModel');
JModelLegacy::addTablePath(JPATH_ADMINISTRATOR . '/components/com_djmediatools/tables');
$lang = JFactory::getLanguage();
$lang->load('com_djmediatools', JPATH_SITE, 'en-GB', false, false);
$lang->load('com_djmediatools', JPATH_SITE . '/components/com_djmediatools', 'en-GB', false, false);
$lang->load('com_djmediatools', JPATH_SITE, null, true, false);
$lang->load('com_djmediatools', JPATH_SITE . '/components/com_djmediatools', null, true, false);
$model = JModelLegacy::getInstance('Categories', 'DJMediatoolsModel', array('ignore_request' => true));
$model->setState('category.id', $params->get('catid'));
$model->setState('filter.published', 1);
$cparams = $model->getParams(false);
$category = $model->getItem($params->get('catid'));
$cparams->merge($params);
$params = $cparams;
if ($category === false) {
    //JError::raiseError(404, JText::_('COM_DJMEDIATOOLS_ERROR_CATEGORY_NOT_FOUND'));
    return false;
Example #4
0
 /**
  * Tests the addTablePath method.
  *
  * @since   12.3
  *
  * @return  void
  */
 public function testAddTablePath()
 {
     // Just make sure this is null, since nothing is returned
     $this->assertNull(JModelLegacy::addTablePath('dummy/path'));
 }