Example #1
0
 public function __construct($config = array())
 {
     $document = JFactory::getDocument();
     //load dialog stylesheet in backend
     KomentoDocumentHelper::loadHeaders();
     $config = Komento::getConfig();
     $konfig = Komento::getKonfig();
     $toolbar = JToolbar::getInstance('toolbar');
     $toolbar->addButtonPath(KOMENTO_ADMIN_ROOT . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'images');
     if ($document->getType() == 'html') {
         require_once KOMENTO_CLASSES . DIRECTORY_SEPARATOR . 'configuration.php';
         $configuration = KomentoConfiguration::getInstance();
         $configuration->attach();
     }
     $version = str_ireplace('.', '', Komento::komentoVersion());
     $document->addScript(rtrim(JURI::root(), '/') . '/administrator/components/com_komento/assets/js/admin.js?' . $version);
     $document->addStyleSheet(rtrim(JURI::root(), '/') . '/administrator/components/com_komento/assets/css/reset.css?' . $version);
     $document->addStyleSheet(rtrim(JURI::root(), '/') . '/components/com_komento/assets/css/common.css?' . $version);
     $document->addStyleSheet(rtrim(JURI::root(), '/') . '/administrator/components/com_komento/assets/css/style.css?' . $version);
     // For the sake of loading the core.js in Joomla 1.6 (1.6.2 onwards)
     if (Komento::joomlaVersion() >= '1.6') {
         JHTML::_('behavior.framework');
     }
     parent::__construct($config);
 }
Example #2
0
	/**
	 * Constructor
	 *
	 * @since 0.1
	 */
	function __construct($config = array())
	{
		// Load necessary css and javascript files.
		KomentoDocumentHelper::loadHeaders();

		// By default, we use the tables specified at the back end.
		JTable::addIncludePath( JPATH_ROOT . DIRECTORY_SEPARATOR . 'administrator' . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_komento' . DIRECTORY_SEPARATOR . 'tables');

		//load the content plugins so that the content trigger will work.
		JPluginHelper::importPlugin('content');

		parent::__construct($config);
	}
Example #3
0
 public static function loadHeaders()
 {
     if (!self::$loaded) {
         $url = KomentoDocumentHelper::getBaseUrl();
         $resourcePath = $url . '&tmpl=component&no_html=1&controller=foundry&task=getResource&kmtcomponent=' . JRequest::getCmd('option', '');
         $document = JFactory::getDocument();
         $config = Komento::getConfig();
         $konfig = Komento::getKonfig();
         $acl = Komento::getAcl();
         $guest = Komento::getProfile()->guest ? 1 : 0;
         if ($document->getType() != 'html') {
             return true;
         }
         // only temporary to load development css
         // waiting chang to finalise reset.css and comments.css
         self::addTemplateCss('common.css');
         // self::addTemplateCss( 'comments.css' );
         // Load KomentoConfiguration class
         require_once KOMENTO_CLASSES . DIRECTORY_SEPARATOR . 'configuration.php';
         // Get configuration instance
         $configuration = KomentoConfiguration::getInstance();
         // Attach configuration to headers
         $configuration->attach();
         if ($config->get('layout_inherit_kuro_css', 1) && $config->get('layout_theme') != 'wireframe') {
             $document->addStylesheet(JURI::root() . 'components/com_komento/themes/kuro/css/style.css');
         }
         // support for RTL sites
         // forcertl = 1 for dev purposes
         if (($document->direction == 'rtl' || JRequest::getInt('forcertl') == 1) && $config->get('layout_theme') != 'wireframe') {
             $document->addStylesheet(JURI::root() . 'components/com_komento/themes/kuro/css/style-rtl.css');
         }
         $document->addStylesheet(JURI::root() . 'media/foundry/3.1/styles/dialog/default.css');
         $document->addStylesheet(JURI::root() . 'media/foundry/3.1/styles/fancybox/default.css');
         self::load('style', 'css', 'themes');
         // load SH css if config is on
         if ($config->get('enable_syntax_highlighting')) {
             $shtheme = $config->get('syntaxhighlighter_theme', 'default');
             self::load('syntaxhighlighter/' . $shtheme, 'css', 'assets');
         }
         self::$loaded = true;
     }
     return self::$loaded;
 }
 */
defined('_JEXEC') or die('Restricted access');

jimport( 'joomla.filesystem.file' );

$helper	= JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_komento' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'helper.php';

if( !JFile::exists( $helper ) )
{
	return;
}

// load all dependencies
require_once( $helper );
// KomentoDocumentHelper::loadHeaders();
KomentoDocumentHelper::load( 'module', 'css', 'assets' );
JFactory::getLanguage()->load( 'com_komento' , JPATH_ROOT );

// initialise all data
$profile	= Komento::getProfile();
$config		= Komento::getConfig();
$konfig		= Komento::getKonfig();

/* $params
limit
component
sort = latest/likes
filtersticked
showtitle
showcomponent
showavatar