Example #1
0
 public static function addScript($url, $type = "text/javascript", $defer = false, $async = false)
 {
     $app = JFactory::getApplication();
     if (!isset($app->cck_document)) {
         $app->cck_document = array();
     }
     // Make sure to have only one inclusion of special external scripts
     if (strpos($url, 'http') !== false) {
         if (strpos($url, '//maps.googleapis.com/maps/api/js?') !== false) {
             if (isset(self::$_urls['google_maps'])) {
                 $cur = self::$_urls['google_maps'];
                 $vars2 = JCckDevHelper::getUrlVars($url);
                 if (!$vars2->def('libraries')) {
                     return;
                 }
                 $vars = JCckDevHelper::getUrlVars($cur);
                 $libraries = array();
                 $libraries[$vars->get('libraries')] = '';
                 $libraries[$vars2->get('libraries')] = '';
                 $libraries = array_keys($libraries);
                 $url = str_replace('libraries=' . $vars2->get('libraries'), 'libraries=' . implode(',', $libraries), $url);
                 unset($app->cck_document['scripts'][$cur]);
             }
             self::$_urls['google_maps'] = $url;
         }
     }
     $app->cck_document['scripts'][$url]['mime'] = $type;
     $app->cck_document['scripts'][$url]['defer'] = $defer;
     $app->cck_document['scripts'][$url]['async'] = $async;
 }
Example #2
0
$layer = $app->input->getCmd('quicklayout', 'icon');
$lang = JFactory::getLanguage();
$market = 'http://www.seblod.com/download.html?tmpl=component';
$opts = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=685,height=600';
$quickadd = $app->input->getInt('quickadd', 0);
$type = '';
$variables = base64_decode($app->input->getBase64('variables'));
$return = base64_decode($app->input->getBase64('return'));
$user = JFactory::getUser();
if ($quickadd) {
    $legacy = 0;
    $url = 'none';
    $items = $layer == 'list' ? JCckDevIntegration::getForms($url, $type, 'folder') : JCckDevIntegration::getForms($url, $type);
} else {
    $legacy = 2;
    $url = JCckDevHelper::getUrlVars($return);
    $layer = JCck::getConfig_Param('integration_layout', 'icon');
    $items = $layer == 'list' ? JCckDevIntegration::getForms($url, $type, 'folder') : JCckDevIntegration::getForms($url, $type);
    if (strpos($type, ',') === false) {
        $options = JCckDatabase::loadResult('SELECT a.options FROM #__cck_core_objects AS a WHERE a.name = "' . $type . '"');
        $options = new JRegistry($options);
        $legacy = $options->get('add_alt', 2);
    }
}
if ($legacy == 1) {
    $legend = JText::sprintf('LIB_CCK_INTEGRATION_MODAL_BOX_LEGEND', '<a id="standard-content" href="javascript:void(0);" style="color:#808080">' . JString::strtolower(JText::_('LIB_CCK_INTEGRATION_CLICK_HERE')) . '</a>', '<span style="color:#808080">' . JString::strtolower(JText::_('LIB_CCK_INTEGRATION_SELECT_A_FORM')) . '</span>');
    $legend2 = '';
} elseif ($legacy == 2) {
    $legend = JText::_('LIB_CCK_INTEGRATION_SELECT_A_FORM');
    $legend2 = JText::sprintf('LIB_CCK_INTEGRATION_MODAL_BOX_LEGEND2', '<a id="standard-content" href="javascript:void(0);" style="color:#808080">' . JString::strtolower(JText::_('LIB_CCK_INTEGRATION_CLICK_HERE')) . '</a>');
} else {