Example #1
0
 /**
  * Effectively bootstraps Tracks
  *
  * @return void
  */
 public static function bootstrap()
 {
     if (!defined('TRACKS_BOOTSTRAPPED')) {
         // Sets bootstrapped variable, to avoid bootstrapping rEDEVENT twice
         define('TRACKS_BOOTSTRAPPED', 1);
         // For Joomla! 2.5 compatibility we load bootstrap2
         if (version_compare(JVERSION, '3.0', '<') && JFactory::getApplication()->input->get('view') == 'config') {
             RHtmlMedia::setFramework('bootstrap2');
         }
     }
 }
Example #2
0
 /**
  * Method to inject needed script
  *
  * @return  void
  */
 public static function init()
 {
     // Only load once
     if (isset(static::$loaded[__METHOD__])) {
         return;
     }
     // Depends on Bootstrap
     RHtmlMedia::loadFrameworkJs();
     JFactory::getDocument()->addScriptDeclaration("\n\t\t\t(function(\$){\n\t\t\t\t\$(document).ready(function (){\n\t\t\t\t\t\$('.has-context')\n\t\t\t\t\t.mouseenter(function (){\n\t\t\t\t\t\t\$('.btn-group',\$(this)).show();\n\t\t\t\t\t})\n\t\t\t\t\t.mouseleave(function (){\n\t\t\t\t\t\t\$('.btn-group',\$(this)).hide();\n\t\t\t\t\t\t\$('.btn-group',\$(this)).removeClass('open');\n\t\t\t\t\t});\n\n\t\t\t\t\tcontextAction =function (cbId, task)\n\t\t\t\t\t{\n\t\t\t\t\t\t\$('input[name=\"cid[]\"]').removeAttr('checked');\n\t\t\t\t\t\t\$('#' + cbId).attr('checked','checked');\n\t\t\t\t\t\tJoomla.submitbutton(task);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t})(jQuery);\n\t\t\t");
     // Set static array
     static::$loaded[__METHOD__] = true;
     return;
 }
Example #3
0
 /**
  * Load the entire bootstrap framework
  *
  * @param   mixed    $debug    Is debugging mode on? [optional]
  * @param   boolean  $loadCss  Load bootstrap CSS ?
  *
  * @return  void
  */
 public static function framework($debug = null, $loadCss = false)
 {
     JHtml::_('rjquery.framework');
     $isAdmin = JFactory::getApplication()->isAdmin();
     // Load Bootstrap in administration, or if it's frontend site and it has been asked via plugin parameters
     if ($isAdmin || !$isAdmin && RBootstrap::$loadFrontendCSS) {
         if ($loadCss) {
             RHtmlMedia::loadFrameworkCss();
         }
         RHtmlMedia::loadFrameworkJs();
     } elseif (!$isAdmin && !RBootstrap::$loadFrontendCSS && !version_compare(JVERSION, '3.0', '<')) {
         JHtml::_('bootstrap.framework');
     }
 }
Example #4
0
 /**
  * Set the framework
  *
  * @param   string  $framework  Framework name
  * @param   array   $options    Framework options
  *
  * @return  void
  *
  * @since   1.4
  */
 public static function setFramework($framework = 'bootstrap2', $options = array())
 {
     self::$framework = $framework;
     if ($framework == 'bootstrap3') {
         self::$frameworkSuffix = 'bs3';
         self::$frameworkOptions = array('disableMootools' => true);
     } elseif ($framework == 'foundation5') {
         self::$frameworkSuffix = 'fd5';
         self::$frameworkOptions = array('disableMootools' => false);
     } else {
         self::$frameworkSuffix = '';
         self::$frameworkOptions = array('disableMootools' => false);
     }
     if (!empty($options)) {
         self::$frameworkOptions = array_merge(self::$frameworkOptions, $options);
     }
 }
Example #5
0
 /**
  * Display method
  *
  * @param   string  $tpl  The template name
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     /** @var RedcoreModelConfig $model */
     $model = $this->getModel('Config');
     $option = JFactory::getApplication()->input->getString('component', 'com_redcore');
     $lang = JFactory::getLanguage();
     // Load component language files
     $lang->load($option, JPATH_ADMINISTRATOR, 'en-GB', false, false) || $lang->load($option, JPATH_ADMINISTRATOR . '/components/' . $option, 'en-GB', false, false);
     $this->form = $model->getForm();
     $this->component = $model->getComponent($option);
     $this->return = JFactory::getApplication()->input->get('return', '', 'Base64');
     $this->componentTitle = RText::getTranslationIfExists($this->component->xml->name, '', '');
     $this->contentElements = $model->loadContentElements($option);
     $this->missingContentElements = $model->loadMissingContentElements($option, $this->contentElements);
     RLayoutHelper::$defaultBasePath = JPATH_ADMINISTRATOR . '/components/' . $option . '/layouts';
     $extensionXml = RComponentHelper::getComponentManifestFile($option);
     if (isset($extensionXml->redcore)) {
         $attributes = $extensionXml->redcore->attributes();
         if (!empty($attributes['defaultFramework'])) {
             RHtmlMedia::setFramework((string) $attributes['defaultFramework']);
         }
     }
     parent::display($tpl);
 }
Example #6
0
    $view = $data['view'];
    if (!$view instanceof RViewBase) {
        throw new InvalidArgumentException(sprintf('Invalid view %s specified for the component layout', get_class($view)));
    }
    $toolbar = $view->getToolbar();
    // Get the view template.
    $tpl = $data['tpl'];
    // Get the view render.
    return $view->loadTemplate($tpl);
}
$templateComponent = 'component' === $input->get('tmpl');
$input->set('tmpl', 'component');
$input->set('redcore', true);
// Load bootstrap + fontawesome
RHtmlMedia::loadFrameworkCss();
RHtmlMedia::loadFrameworkJs();
RHelperAsset::load('component.min.js', 'redcore');
// Load a custom CSS option for this component if exists
if ($comOption = $input->get('option', null)) {
    RHelperAsset::load($comOption . '.css', $comOption);
}
// For Joomla! 2.5 we will add bootstrap alert messages
if (version_compare(JVERSION, '3.0', '<') && JFactory::getApplication()->isAdmin()) {
    // Require the message renderer as it doesn't respect the naming convention.
    $messageRendererPath = JPATH_LIBRARIES . '/redcore/joomla/document/renderer/message.php';
    if (file_exists($messageRendererPath)) {
        require_once $messageRendererPath;
    }
}
// Do we have to display the sidebar ?
$displaySidebar = false;
Example #7
0
    /** @var RView $view */
    $view = $data['view'];
    if (!$view instanceof RViewBase) {
        throw new InvalidArgumentException(sprintf('Invalid view %s specified for the component layout', get_class($view)));
    }
    $toolbar = $view->getToolbar();
    // Get the view template.
    $tpl = $data['tpl'];
    // Get the view render.
    return $view->loadTemplate($tpl);
}
$input->set('redcore', true);
// Load bootstrap + fontawesome
RHtmlMedia::loadFrameworkJs();
RHelperAsset::load('component.min.js', 'redcore');
RHtmlMedia::loadFrameworkCss();
// Load a custom CSS option for this component if exists
if ($comOption = $input->get('option', null)) {
    RHelperAsset::load($comOption . '.css', $comOption);
}
// For Joomla! 2.5 we will add bootstrap alert messages
if (version_compare(JVERSION, '3.0', '<') && JFactory::getApplication()->isAdmin()) {
    // Require the message renderer as it doesn't respect the naming convention.
    $messageRendererPath = JPATH_LIBRARIES . '/redcore/joomla/document/renderer/message.php';
    if (file_exists($messageRendererPath)) {
        require_once $messageRendererPath;
    }
}
// The view to render.
if (!isset($data['view'])) {
    throw new InvalidArgumentException('No view specified in the component layout.');
Example #8
0
 /**
  * Check if the view asked to disable mootools
  *
  * @return  boolean
  */
 private function disableMootools()
 {
     $app = JFactory::getApplication();
     $disable = $app->input->get('disable_mootools', false);
     if (!$disable) {
         $disable = RHtmlMedia::isMootoolsDisabled();
     }
     return $disable;
 }