Beispiel #1
0
 function fetchElement()
 {
     $this->_translateable = N2XmlHelper::getAttribute($this->_xml, 'translateable');
     $this->_translateable = $this->_translateable === '0' ? false : true;
     $html = '';
     foreach ($this->_xml->param as $element) {
         $class = N2Form::importElement(N2XmlHelper::getAttribute($element, 'type'));
         $el = new $class($this->_form, $this, $element);
         list($label, $field) = $el->render($this->control_name, $this->_translateable);
         $html .= N2Html::tag('div', array('class' => 'n2-mixed-group ' . N2XmlHelper::getAttribute($element, 'class')), N2Html::tag('div', array('class' => 'n2-mixed-label'), $label) . N2Html::tag('div', array('class' => 'n2-mixed-element'), $field));
         if (N2XmlHelper::getAttribute($element, 'post') == 'break') {
             $html .= '<br class="' . N2XmlHelper::getAttribute($element, 'class') . '" />';
         }
     }
     return N2Html::tag('div', array('class' => 'n2-form-element-mixed', 'style' => N2XmlHelper::getAttribute($this->_xml, 'style')), $html);
 }
Beispiel #2
0
 function initElements()
 {
     $this->_elements = array();
     foreach ($this->_xml->param as $element) {
         $test = N2XmlHelper::getAttribute($element, 'test');
         if ($this->_form->makeTest($test)) {
             $class = N2Form::importElement(N2XmlHelper::getAttribute($element, 'type'));
             if (!class_exists($class, false)) {
                 throw new Exception($class . ' missing in ' . $this->_form->_xmlfile);
                 n2_exit(true);
             }
             $field = new $class($this->_form, $this, $element);
             if ($field->_name) {
                 $this->_elements[$field->_name] = $field;
             } else {
                 $this->_elements[] = $field;
             }
         }
     }
 }
Beispiel #3
0
 function fetchElement()
 {
     $this->_translateable = N2XmlHelper::getAttribute($this->_xml, 'translateable');
     $this->_translateable = $this->_translateable === '0' ? false : true;
     $default = explode($this->_separator, $this->_default);
     $value = explode($this->_separator, $this->getValue());
     $value = $value + $default;
     $html = "<div class='n2-form-element-mixed' style='" . N2XmlHelper::getAttribute($this->_xml, 'style') . "'>";
     $this->_elements = array();
     $i = 0;
     foreach ($this->_xml->param as $element) {
         $html .= "<div class='n2-mixed-group " . N2XmlHelper::getAttribute($element, 'class') . "' style='" . N2XmlHelper::getAttribute($element, 'mixedstyle') . "'>";
         $class = N2Form::importElement(N2XmlHelper::getAttribute($element, 'type'));
         $element->addAttribute('name', $this->_name . '_' . $i);
         $element->addAttribute('hidename', 1);
         if (isset($value[$i])) {
             $element->addAttribute('default', $value[$i]);
         }
         $el = new $class($this->_form, $this, $element);
         $el->parent =& $this;
         $elementHtml = $el->render($this->_name . $this->control_name, $this->_translateable);
         $html .= "<div class='n2-mixed-label'>";
         $html .= $elementHtml[0];
         $html .= "</div>";
         $html .= "<div class='n2-mixed-element'>";
         $html .= $elementHtml[1];
         $html .= "</div>";
         $this->_elements[$i] = $el->_id;
         $i++;
         $html .= "</div>";
     }
     $hidden = new N2ElementHidden($this->_form, $this->_tab, $this->_xml);
     $hiddenhtml = $hidden->render($this->control_name, false);
     $html .= $hiddenhtml[1];
     $html .= "</div>";
     N2JS::addInline('new NextendElementMixed("' . $this->_id . '", ' . json_encode($this->_elements) . ', "' . $this->_separator . '");');
     return $html;
 }
<?php

N2Form::importElement('hidden');
N2Loader::import('libraries.backgroundanimation.manager', 'smartslider');
class N2ElementBackgroundAnimation extends N2ElementHidden
{
    public $_tooltip = true;
    function fetchElement()
    {
        N2Localization::addJS(array('Disabled', 'Multiple animations', 'Single animation'));
        N2JS::addInline('new NextendElementAnimationManager("' . $this->_id . '", "backgroundanimationManager");');
        return N2Html::tag('div', array('class' => 'n2-form-element-option-chooser n2-border-radius'), parent::fetchElement() . N2Html::tag('input', array('type' => 'text', 'class' => 'n2-h5', 'style' => 'width: 130px;' . N2XmlHelper::getAttribute($this->_xml, 'css'), 'disabled' => 'disabled'), false) . N2Html::tag('a', array('href' => '#', 'class' => 'n2-form-element-clear'), N2Html::tag('i', array('class' => 'n2-i n2-it n2-i-empty n2-i-grey-opacity'), '')) . N2Html::tag('a', array('href' => '#', 'class' => 'n2-form-element-button n2-h5 n2-uc'), n2_('Animations')));
    }
}