Exemplo n.º 1
0
 /**
  * Initializes EasyBlog's javascript framework
  *
  * @since	4.0
  * @access	public
  * @return
  */
 public static function init($section = 'site')
 {
     $doc = JFactory::getDocument();
     // Get the cdn url
     $cdnRoot = EB::getCdnUrl();
     if ($cdnRoot) {
         FD50_FoundryFramework::defineComponentCDNConstants('EASYBLOG', $cdnRoot, $passiveCdn);
     }
     // Determines if we should compile the javascripts on the site
     $app = JFactory::getApplication();
     $input = $app->input;
     $compile = $input->get('compile', false, 'bool');
     if (EB::isSiteAdmin() && $compile) {
         // Determines if we need to minify the js
         $minify = $input->get('minify', false, 'bool');
         // Get section if not default one
         $section = $input->get('section', $section, 'cmd');
         // Get the compiler
         $compiler = EB::compiler();
         $result = $compiler->compile($section, $minify);
         if ($result !== false) {
             EB::info()->set('Javascript library recompiled successfully.', 'success');
             return $app->redirect(EBR::_('index.php?option=com_easyblog'));
         }
     }
     // If this is a non html view, skip this altogether
     if ($doc->getType() !== 'html') {
         return;
     }
     if (!self::$headersLoaded) {
         $url = EB::getBaseUrl();
         // Get configuration instance
         $configuration = EB::configuration();
         // Attach configuration to headers
         $configuration->attach($section);
         self::$headersLoaded = true;
     }
     return self::$headersLoaded;
 }
Exemplo n.º 2
0
define('EASYBLOG_POST_ARCHIVED', 2);
// Post source
define('EASYBLOG_POST_SOURCE_SITEWIDE', 'easyblog.sitewide');
define('EASYBLOG_POST_SOURCE_TEAM', 'easyblog.team');
define('EASYBLOG_POST_SOURCE_JOMSOCIAL_GROUP', 'jomsocial.group');
define('EASYBLOG_POST_SOURCE_JOMSOCIAL_EVENT', 'jomsocial.event');
define('EASYBLOG_POST_SOURCE_EASYSOCIAL_EVENT', 'easysocial.event');
define('EASYBLOG_POST_SOURCE_EASYSOCIAL_GROUP', 'easysocial.group');
// Block type
define('EASYBLOG_BLOCK_MODE_DIFF', 'compare');
define('EASYBLOG_BLOCK_MODE_VIEWABLE', 'viewable');
define('EASYBLOG_BLOCK_MODE_EDITABLE', 'editable');
define('EASYBLOG_POST_DOCTYPE_LEGACY', 'legacy');
// Blog rendering modes
define('EASYBLOG_VIEW_ENTRY', 'entry');
define('EASYBLOG_VIEW_LIST', 'list');
define('EASYBLOG_NO_DATE', '0000-00-00 00:00:00');
//no. of teamblog post to retrive for each team in team listing page.
define('EASYBLOG_TEAMBLOG_LISTING_NO_POST', 5);
// Post properties
define('EASYBLOG_STRIP_TAGS', true);
// Composer blocks publishing state
define('EASYBLOG_COMPOSER_BLOCKS_UNPUBLISHED', 0);
define('EASYBLOG_COMPOSER_BLOCKS_PUBLISHED', 1);
define('EASYBLOG_COMPOSER_BLOCKS_NOT_VISIBLE', 2);
define('EASYBLOG_POST_TEMPLATE_CORE', 1);
define('EASYBLOG_POST_TEMPLATE_NOT_CORE', 0);
// Foundry
require_once JPATH_ROOT . '/media/foundry/5.0/joomla/framework.php';
FD50_FoundryFramework::defineComponentConstants('EasyBlog');
Exemplo n.º 3
0
 public static function defineComponentCDNConstants($ns = '', $cdnRoot, $passiveCdn = false)
 {
     $NS = $ns . '_';
     // Also define framework constant
     FD50_FoundryFramework::defineFrameworkCDNConstants('FD50_FOUNDRY', $cdnRoot, $passiveCdn);
     // Joomla
     define($NS . 'JOOMLA_CDN', rtrim($cdnRoot, '/'));
     define($NS . 'JOOMLA_ADMIN_CDN', constant($NS . 'JOOMLA_CDN') . '/administrator');
     define($NS . 'JOOMLA_SITE_TEMPLATES_CDN', constant($NS . 'JOOMLA_CDN') . '/templates');
     define($NS . 'JOOMLA_ADMIN_TEMPLATES_CDN', constant($NS . 'JOOMLA_ADMIN_CDN') . '/templates');
     define($NS . 'JOOMLA_MODULES_CDN', constant($NS . 'JOOMLA_CDN') . '/modules');
     // Foundry
     define($NS . 'FOUNDRY_CDN', constant($NS . 'JOOMLA_CDN') . '/media/foundry/' . constant($NS . 'FOUNDRY_VERSION'));
     // Component
     define($NS . 'SITE_CDN', constant($NS . 'JOOMLA_CDN') . '/components/' . constant($NS . 'COMPONENT_NAME'));
     define($NS . 'ADMIN_CDN', constant($NS . 'JOOMLA_ADMIN_CDN') . '/components/' . constant($NS . 'COMPONENT_NAME'));
     define($NS . 'MEDIA_CDN', constant($NS . 'JOOMLA_CDN') . '/media/' . constant($NS . 'COMPONENT_NAME'));
     define($NS . 'SCRIPTS_CDN', constant($NS . 'MEDIA_CDN') . '/scripts');
     define($NS . 'RESOURCES_CDN', constant($NS . 'MEDIA_CDN') . '/resources');
     define($NS . 'CONFIG_CDN', constant($NS . 'MEDIA_CDN') . '/config');
     define($NS . 'PASSIVE_CDN', $passiveCdn);
     // Themes
     define($NS . 'SITE_THEMES_CDN', constant($NS . 'SITE_CDN') . '/themes');
     define($NS . 'ADMIN_THEMES_CDN', constant($NS . 'ADMIN_CDN') . '/themes');
     define($NS . 'USER_THEMES_CDN', constant($NS . 'MEDIA_CDN') . '/themes');
 }