Esempio n. 1
0
 public function __construct()
 {
     EB::loadLanguages(JPATH_ADMINISTRATOR);
     // Load our own js library
     EB::init('admin');
     // $this->doc = JFactory::getDocument();
     // $this->doc->addStylesheet(rtrim(JURI::base(), '/') . '/components/com_easyblog/themes/default/css/elements.css');
     JHTML::_('behavior.modal');
     $this->app = JFactory::getApplication();
 }
<?php

/**
* @package      EasyBlog
* @copyright    Copyright (C) 2010 - 2015 Stack Ideas Sdn Bhd. All rights reserved.
* @license      GNU/GPL, see LICENSE.php
* EasyBlog is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Restricted access');
jimport('joomla.filesystem.file');
$engine = JPATH_ADMINISTRATOR . '/components/com_easyblog/includes/easyblog.php';
$my = JFactory::getUser();
$config = EB::config();
if (!JFile::exists($engine) || $my->guest || !$config->get('main_microblog')) {
    return;
}
require_once $engine;
// Ensure that all script are loaded
EB::init('module');
// Attach modules stylesheet
EB::stylesheet('module')->attach();
JFactory::getLanguage()->load('com_easyblog', JPATH_ROOT);
require JModuleHelper::getLayoutPath('mod_easyblogquickpost');
Esempio n. 3
0
 /**
  * Responsible to render the css files on the head
  *
  * @since   4.0
  * @access  public
  * @param   string
  * @return
  */
 public function renderHeaders()
 {
     // Load js stuffs
     $view = $this->input->get('view', '', 'cmd');
     // Determines which js section to initialize
     $section = 'site';
     if ($view == 'dashboard' || $view == 'composer') {
         $section = $view;
     }
     EB::init($section);
     // Get the theme on the site
     $theme = $this->config->get('theme_site');
     // @since 4.0
     // Attach the theme's css
     $stylesheet = EB::stylesheet('site', $theme);
     $stylesheet->attach();
 }
Esempio n. 4
0
 /**
  * Override parent's implementation
  *
  * @since	1.2
  * @access	public
  * @param	string
  * @return
  */
 public function display($tpl = null)
 {
     // Set the appropriate namespace
     $namespace = 'admin/' . $tpl;
     // Get the child contents
     $output = $this->theme->output($namespace);
     // Get the sidebar
     $sidebar = $this->getSidebar();
     // Determine if this is a tmpl view
     $tmpl = $this->input->get('tmpl', '', 'word');
     // Prepare the structure
     $theme = EB::getTemplate();
     // Get current version
     $version = EB::getLocalVersion();
     // Render a different structure prefix when tmpl=component
     $prefix = $tmpl == 'component' ? 'eb-window' : '';
     // Initialize all javascript frameworks
     EB::init('admin');
     // Collect all javascripts attached so that we can output them at the bottom of the page
     $scripts = EB::scripts()->getScripts();
     $theme->set('info', $this->info);
     $theme->set('prefix', $prefix);
     $theme->set('version', $version);
     $theme->set('heading', $this->heading);
     $theme->set('desc', $this->desc);
     $theme->set('output', $output);
     $theme->set('tmpl', $tmpl);
     $theme->set('sidebar', $sidebar);
     $theme->set('jscripts', $scripts);
     $contents = $theme->output('admin/structure/default');
     // If the toolbar registration exists, load it up
     if (method_exists($this, 'registerToolbar')) {
         $this->registerToolbar();
     }
     echo $contents;
 }
Esempio n. 5
0
 private function prepareUpdateBlogStream(&$item)
 {
     $post = EB::post($item->contextId);
     // Format the likes for the stream
     $likes = Foundry::likes();
     $likes->get($item->contextId, 'blog', 'update');
     $item->likes = $likes;
     $url = EBR::_('index.php?option=com_easyblog&view=entry&id=' . $post->id);
     // Apply comments on the stream
     $item->comments = Foundry::comments($item->contextId, 'blog', 'update', SOCIAL_APPS_GROUP_USER, array('url' => $url));
     // We might want to use some javascript codes.
     EB::init('site');
     $date = EB::date($post->created);
     $config = EB::config();
     $source = $config->get('integrations_easysocial_stream_newpost_source', 'intro');
     $content = isset($post->{$source}) && !empty($post->{$source}) ? $post->{$source} : $post->intro;
     $content = $this->truncateContent($content);
     $appParams = $this->getParams();
     $alignment = 'pull-' . $appParams->get('imagealignment', 'right');
     $this->set('alignment', $alignment);
     // See if there's any audio files to process.
     $audios = EB::audio()->getItems($content);
     // Get videos attached in the content
     $video = $this->getVideo($content);
     // Remove videos from the source
     $content = EB::videos()->strip($content);
     // Remove audios from the content
     $content = EB::audio()->strip($content);
     $catUrl = EBR::_('index.php?option=com_easyblog&view=categories&layout=listings&id=' . $post->category_id, true, null, false, true);
     $this->set('categorypermalink', $catUrl);
     $this->set('video', $video);
     $this->set('audios', $audios);
     $this->set('date', $date);
     $this->set('permalink', $url);
     $this->set('blog', $post);
     $this->set('actor', $item->actor);
     $this->set('content', $content);
     $item->title = parent::display('streams/' . $item->verb . '.title');
     $item->content = parent::display('streams/' . $item->verb . '.content');
     // Add image to the og:image
     if ($post->getImage()) {
         $item->opengraph->addImage($post->getImage('frontpage'));
     }
     $item->opengraph->addDescription($content);
 }