public static function getInstance($template = '') { if ($template == JFactory::getApplication()->getTemplate()) { print 'You should NOT set "' . $template . '" as Default Template.'; die; } if (!self::$instance) { self::$instance = new CCK_Rendering(); } return self::$instance; }
<?php /** * @version SEBLOD 3.x Core ~ $Id: index.php alexandrelapoux $ * @package SEBLOD (App Builder & CCK) // SEBLOD nano (Form Builder) * @url http://www.seblod.com * @editor Octopoos - www.octopoos.com * @copyright Copyright (C) 2013 SEBLOD. All Rights Reserved. * @license GNU General Public License version 2 or later; see _LICENSE.php **/ defined('_JEXEC') or die; // -- Initialize require_once dirname(__FILE__) . '/config.php'; $cck = CCK_Rendering::getInstance($this->template); if ($cck->initialize() === false) { return; } // -- Prepare $attributes = $cck->id_attributes ? ' ' . $cck->id_attributes : ''; $attributes = $cck->replaceLive($attributes); $nLeft = $cck->countFields('left', true); $nRight = $cck->countFields('right', true); if ($nLeft && $nRight) { $css = '#' . $cck->id . '_m100.cck-m100 {margin: 0 ' . $cck->getStyleParam('position_right') . 'px 0 ' . $cck->getStyleParam('position_left') . 'px !important;}' . "\n"; $css .= '#' . $cck->id . ' .cck-line-left {width: ' . $cck->getStyleParam('position_left') . 'px;}' . "\n"; $css .= '#' . $cck->id . ' .cck-line-right {width: ' . $cck->getStyleParam('position_right') . 'px; margin-left: -' . ($cck->getStyleParam('position_left') + $cck->getStyleParam('position_right')) . 'px;}'; } elseif ($nLeft) { $css = '#' . $cck->id . '_m100.cck-m100 {margin: 0 0 0 ' . $cck->getStyleParam('position_left') . 'px !important;}' . "\n"; $css .= '#' . $cck->id . ' .cck-line-left {width: ' . $cck->getStyleParam('position_left') . 'px;}'; } elseif ($nRight) { $css = '#' . $cck->id . '_m100.cck-m100 {margin: 0 ' . $cck->getStyleParam('position_right') . 'px 0 0 !important;}' . "\n";