function universalfetchElement($name, $value, &$node) { $document =& JFactory::getDocument(); $this->loadFiles(); $units = array(); $values = array(); $mode = 0; $url = JURI::base() . '../modules/' . $this->_moduleName . '/params/' . $this->_name . '/images/'; $attributes = $node->attributes(); $html = '<div class="offlajnswitcher"> <div class="offlajnswitcher_inner" id="offlajnswitcher_inner' . $this->id . '"></div> </div>'; $html .= '<input type="hidden" name="' . $name . '" id="' . $this->id . '" value="' . $value . '" />'; //$units = explode(" ", $attributes['units']); foreach ($node->children() as $child) { if (isset($child->_attributes['imsrc']) && $child->_attributes['imsrc']) { $units[] = $child->_attributes['imsrc']; $mode = 1; } else { $units[] = $child->data(); } $values[] = $child->_attributes['value']; } DojoLoader::addScript('dojo.addOnLoad(function(){ new OfflajnSwitcher({ id: "' . $this->id . '", units: ' . json_encode($units) . ', values: ' . json_encode($values) . ', map: ' . json_encode(array_flip($values)) . ', mode: ' . json_encode($mode) . ', url: ' . json_encode($url) . ' }); });'); return $html; }
function universalfetchElement($name, $value, &$node) { $size = $node->attributes('size') ? 'size="' . $node->attributes('size') . '"' : ''; $value = htmlspecialchars(html_entity_decode($value, ENT_QUOTES), ENT_QUOTES); $attrs = $node->attributes(); $oo = @$attrs['onoff'] === '0' ? 0 : 1; $document =& JFactory::getDocument(); DojoLoader::addScriptFile('/modules/' . $this->_moduleName . '/params/offlajnonoff/offlajnonoff/offlajnonoff.js'); DojoLoader::addScriptFile('/modules/' . $this->_moduleName . '/params/offlajngradient/offlajngradient/offlajngradient.js'); $document->addStyleSheet(JURI::base() . '../modules/' . $this->_moduleName . '/params/offlajngradient/offlajngradient/offlajngradient.css'); $document->addStyleSheet(JURI::base() . '../modules/' . $this->_moduleName . '/params/offlajncolor/offlajncolor/offlajncolor.css'); DojoLoader::addScript('jQuery.fn.jPicker.defaults.images.clientPath="' . JURI::base() . '../modules/' . $this->_moduleName . '/params/offlajncolor/offlajncolor/jpicker/images/";'); $id = $this->generateId($name); $v = explode('-', $value); $f = ""; $onoff = new JElementOfflajnOnOff(); $onoff->id = $onoff->generateId($id . 'onoff'); $f .= $onoff->universalfetchElement($onoff->id, $v[0], new JSimpleXMLElement('param')); $f .= '<div class="gradient_container"><div id="gradient' . $id . '" class="gradient_bg"><input type="hidden" name="' . $name . '" id="' . $id . '" value="' . $value . '"/>'; $f .= '<div class="gradient_left"><input type="text" name="a' . $name . '[start]" id="' . $id . 'start" value="' . @$v[1] . '" class="color" ' . $size . ' /></div>'; $f .= '<div class="gradient_right"><input type="text" name="a' . $name . '[stop]" id="' . $id . 'stop" value="' . @$v[2] . '" class="color" ' . $size . ' /></div>'; $f .= '<div style="clear: both;"></div></div></div><div style="clear: both;"></div>'; DojoLoader::addScript(' new OfflajnGradient({ hidden: dojo.byId("' . $id . '"), switcher: dojo.byId("' . $onoff->id . '"), onoff: ' . $oo . ', start: dojo.byId("' . $id . 'start"), end: dojo.byId("' . $id . 'stop") }); '); return $f; }
function universalfetchElement($name, $value, &$node) { $document =& JFactory::getDocument(); $html = ""; $el = ""; $this->values = array(); $this->mode = ""; $this->items = array(); $this->url = JURI::base() . '../modules/' . $this->_moduleName . '/params/' . $this->_name . '/images/'; if (defined('WP_ADMIN')) { $this->url = smartslider_translate_js_url($this->url); } $this->loadFiles(); $attrs = $node->attributes(); $class = ''; if (isset($attrs['mode'])) { $class = $attrs['mode']; } $html .= '<div class="offlajnradiocontainer' . $class . '" id="offlajnradiocontainer' . $this->id . '">'; $html .= $this->makeItemDivs($node->children(), $value); $html .= '</div>'; $html .= '<input type="hidden" id="' . $this->id . '" name="' . $name . '" value="' . $value . '"/>'; DojoLoader::addScript(' new OfflajnRadio({ id: "' . $this->id . '", values: ' . json_encode($this->values) . ', map: ' . json_encode(array_flip($this->values)) . ', mode: ' . json_encode($this->mode) . ' }); '); return $html; }
function universalfetchElement($name, $value, &$node) { $document =& JFactory::getDocument(); $this->loadFiles(); $attributes = $node->attributes(); $html = ""; $imgs = ""; $mode = ""; if (isset($attributes['mode'])) { $mode = $attributes['mode']; } $url = JURI::base() . '../modules/' . $this->_moduleName . '/params/' . $this->_name . '/images/'; if (defined('WP_ADMIN')) { $url = smartslider_translate_js_url($url); } if ($mode == "") { $html = '<div id="offlajnonoff' . $this->id . '" class="gk_hack onoff' . ($value ? '' : ' onoff-off') . '"></div>'; } else { if ($mode == "button") { $html = '<div id="offlajnonoff' . $this->id . '" class="gk_hack onoffbutton' . ($value ? ' selected' : '') . '"> <div class="gk_hack onoffbutton_img" style="background-image: url(' . $url . $attributes['imsrc'] . ');"></div> </div>'; } } $html .= '<input type="hidden" name="' . $name . '" id="' . $this->id . '" value="' . $value . '" />'; DojoLoader::addScript(' new OfflajnOnOff({ id: "' . $this->id . '", mode: "' . $mode . '", imgs: ' . json_encode($imgs) . ' }); '); return $html; }
function universalfetchElement($name, $value, &$node) { $attrs = $node->attributes(); $this->loadFiles(); $listnode = new JSimpleXMLElement('list'); $datas = array(); $listnode->addChild('option', array('value' => 'custom'))->setData(ucfirst('Custom')); foreach ($node->children() as $default) { if (!isset($this->_parent->theme)) { $this->_parent->theme = "default"; } $listnode->addChild('option', array('value' => $this->_parent->theme . '_' . $default->name()))->setData(ucfirst($default->name())); $datas[$this->_parent->theme . '_' . $default->name()] = array(); foreach ($default->_children as $c) { $datas[$this->_parent->theme . '_' . $default->name()][$c->name()] = $c->data(); } } preg_match('/(.*)\\[([a-zA-Z0-9]*)\\]$/', $name, $out); $control = $out[1]; $orig_name = $out[2]; $value = 'custom'; $html = parent::universalfetchElement($name, $value, $listnode); DojoLoader::addScript("\n window." . $orig_name . " = new OfflajnSkin({\n name: " . json_encode($orig_name) . ",\n id: " . json_encode($this->id) . ",\n data: " . json_encode($datas) . ",\n control: " . json_encode($control) . ",\n dependency: '" . (isset($attrs['dependency']) ? $attrs['dependency'] : "") . "'\n });\n "); return $html; }
public function universalfetchElement($name, $value, &$node) { $attrs = $node->attributes(); $this->value = $value; $this->fullText = "<br />"; $document =& JFactory::getDocument(); $html = ""; $el = ""; $this->options = array(); $this->elements = array(); $this->items = array(); $this->vals = array(); $fireshow = isset($attrs['fireshow']) ? $attrs['fireshow'] : 0; $this->loadFiles('offlajnlist', 'offlajnlist'); $this->loadFiles('offlajnscroller', 'offlajnlist'); $this->name = $this->generateId($name); $el .= '<div class="content">'; $this->onchange = ""; $this->items = $node->children(); $el .= $this->makeItemDivs(); $el .= '</div>'; $html .= '<div id="offlajnlistcontainer' . $this->name . '" class="gk_hack offlajnlistcontainer">'; $html .= '<div class="gk_hack offlajnlist">'; if (!is_array($value) && strlen($value) || !version_compare(JVERSION, '1.6.0', 'ge')) { if ($value == "" || !isset($this->elements[$value])) { @($html .= '<span class="offlajnlistcurrent">' . $this->elements[$this->vals[0]] . $this->fullText . '</span>'); } else { @($html .= '<span class="offlajnlistcurrent">' . $this->elements[$value] . $this->fullText . '</span>'); } } else { $html .= '<span class="offlajnlistcurrent">' . $this->elements[$this->vals[0]] . $this->fullText . '</span>'; } $html .= '<div class="offlajnlistbtn"><span></span></div>'; $html .= '</div>'; $html .= '<input type="hidden" name="' . $name . '" id="' . $this->generateId($name) . '" value="' . $this->options[$this->selectedIndex]['value'] . '"/>'; $html .= '</div>'; $n = strtolower($this->_name); $height = isset($attrs['height']) ? $attrs['height'] : (count($this->options) > 10 ? 10 : 0); DojoLoader::addScript(' new OfflajnList({ name: "' . $this->name . '", elements: ' . json_encode($el) . ', options: ' . json_encode($this->options) . ', selectedIndex: ' . $this->selectedIndex . ', height: ' . json_encode($height) . ', fireshow: ' . $fireshow . ' }); '); return "<div style='position:relative;'>" . $html . "</div>"; }
function universalfetchElement($name, $value, &$node) { $document =& JFactory::getDocument(); $this->loadFiles(); $attr = $node->attributes(); $units = $node->children(); $attachunit = ''; $mode = ""; $minus = 0; $scale = isset($attr['scale']) ? $attr['scale'] : ""; $onoff = isset($attr['onoff']) ? $attr['onoff'] : ""; $v = explode('||', $value); $html = '<div class="offlajntextcontainer" id="offlajntextcontainer' . $this->id . '">'; $html .= '<input ' . (isset($attr['disabled']) ? 'disabled="disabled"' : '') . ' size="' . (isset($attr['size']) ? $attr['size'] : 10) . '" class="offlajntext" type="text" id="' . $this->id . 'input" value="' . $v[0] . '">'; if (count($units) == 1) { $html .= '<div class="unit">' . $units[0]->data() . '</div>'; $attachunit = $units[0]->data(); } if (@$attr['mode'] == "increment" && ($attr['validation'] == "int" || $attr['validation'] == "float")) { $html .= '<div class="offlajntext_increment"> <div class="offlajntext_increment_up arrow"></div> <div class="offlajntext_increment_down arrow"></div> </div>'; $mode = "increment"; if ($attr['allowminus']) { $minus = $attr['allowminus']; } } $html .= '</div>'; if (count($units) == 2) { $node->addAttribute('type', 'offlajnswitcher'); $switcher = new JElementOfflajnSwitcher(); $switcher->id = $this->generateId($name . '[unit]'); $html .= $switcher->universalfetchElement($name . '[unit]', @$v[1], $node); } $html .= '<input type="hidden" name="' . $name . '" id="' . $this->id . '" value="' . $value . '">'; DojoLoader::addScript(' new OfflajnText({ id: "' . $this->id . '", validation: "' . (isset($attr['validation']) ? $attr['validation'] : '') . '", attachunit: "' . $attachunit . '", mode: ' . json_encode($mode) . ', scale: ' . json_encode($scale) . ', minus: ' . json_encode($minus) . ', onoff: ' . json_encode($onoff) . ' }); '); return $html; }
function universalfetchElement($name, $value, &$node) { $this->loadFiles(); $attrs = $node->attributes(); $imgs = JFolder::files(JPATH_SITE . $attrs['folder'], $filter = '([^\\s]+(\\.(?i)(jpg|png|gif|bmp))$)'); $this->loadFiles('offlajnscroller', 'offlajnlist'); $identifier = md5($name . $attrs['folder']); $_SESSION['offlajnupload'][$identifier] = JPATH_SITE . $attrs['folder']; $html = ""; $desc = isset($attrs['description']) && $attrs['description'] != "" ? $attrs['description'] : ""; $imgs = (array) $imgs; $url = ''; $upload = ''; if (defined('WP_ADMIN')) { $url = smartslider_url('joomla/'); $upload = 'admin.php?page=smartslider.php/slider&option=offlajnupload'; } else { $url = JURI::root(true); $upload = 'index.php?option=offlajnupload'; } //if(!in_array($value, $imgs)) $value = ''; DojoLoader::addScript(' new OfflajnImagemanager({ id: "' . $this->id . '", folder: "' . str_replace(DIRECTORY_SEPARATOR, '/', $attrs['folder']) . '", root: "' . $url . '", uploadurl: "' . $upload . '", imgs: ' . json_encode((array) $imgs) . ', active: "' . $value . '", identifier: "' . $identifier . '", description: "' . $desc . '", siteurl: "' . JURI::root() . '" }); '); $html = '<div id="offlajnimagemanager' . $this->id . '" class="offlajnimagemanager">'; $html .= '<div class="offlajnimagemanagerimg"> <div></div> </div>'; $html .= '<div class="offlajnimagemanagerbtn"></div>'; $html .= '<input type="hidden" name="' . $name . '" id="' . $this->id . '" value="' . $value . '"/>'; $html .= "</div>"; return $html; }
function universalfetchElement($name, $value, &$node) { $this->loadFiles(); $size = 'size="12"'; $value = htmlspecialchars(html_entity_decode($value, ENT_QUOTES), ENT_QUOTES); $id = $this->generateId($name); $alpha = $node->attributes('alpha') == 1 ? true : false; $width = !$alpha ? "wa" : ""; $url = ''; if (defined('WP_ADMIN')) { $url = smartslider_url('joomla/'); } else { $url = JURI::root(true); } //Load jQuery $document = JFactory::getDocument(); if (version_compare(JVERSION, '3.0.0', 'l')) { $document->addScript('https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js'); } else { JHtml::_('jquery.framework'); } DojoLoader::addScript(' var el = dojo.byId("' . $id . '"); jQuery.fn.jPicker.defaults.images.clientPath="' . $url . '/' . $this->_furl . '../offlajncolor/offlajncolor/jpicker/images/"; el.alphaSupport=' . ($alpha ? 'true' : 'false') . '; el.c = jQuery("#' . $id . '").jPicker({ window:{ expandable: true, alphaSupport: ' . ($alpha ? 'true' : 'false') . '} }); dojo.connect(el, "change", function(){ this.c[0].color.active.val("hex", this.value); }); '); return '<div class="offlajncolor"><input type="text" name="' . $name . '" id="' . $id . '" value="' . $value . '" class="color ' . $width . '" ' . $size . ' /></div>'; }
function universalfetchElement($name, $value, &$node) { $this->_node =& $node; $this->_googlefonts = array(); $this->_google = array(); $this->_googleName = array(); $this->init(); $html = ""; $attrs = $node->attributes(); $alpha = isset($attrs['alpha']) ? $attrs['alpha'] : 0; $tabs = explode('|', $attrs['tabs']); $s = json_decode($value); if (isset($attrs['tabs']) && $attrs['tabs'] != "") { @($def = (array) $s->{$tabs[0]}); } $elements = array(); $stack =& JsStack::getInstance(); $stack->startStack(); // TABS $elements['tab']['name'] = $name . 'tab'; $elements['tab']['id'] = $this->generateId($elements['tab']['name']); $tabxml = new JSimpleXML(); $tabxml->loadString('<param/>'); $tabxml = $tabxml->document; $tabxml->addAttribute('name', $elements['tab']['name']); $tabxml->addAttribute('type', 'offlajnradio'); $tabxml->addAttribute('mode', 'button'); foreach ($tabs as $t) { $tabxml->addChild('option', array('value' => $t))->setData($t); } $tab = new JElementOfflajnRadio(); $tab->id = $elements['tab']['id']; $elements['tab']['html'] = $tab->universalfetchElement($elements['tab']['name'], $tabs[0], $tabxml); // END TABS // TYPE $elements['type']['name'] = $name . 'type'; $elements['type']['id'] = $this->generateId($elements['type']['name']); $typexml = new JSimpleXML(); $typexml->loadString('<param/>'); $typexml = $typexml->document; $typexml->addAttribute('name', $elements['type']['name']); $typexml->addAttribute('type', 'offlajnlist'); $typexml->addChild('option', array('value' => '0'))->setData('Alternative fonts'); foreach ($this->_google as $t) { $typexml->addChild('option', array('value' => $t))->setData($t); $stack->startStack(); // FAMILY $elements['type'][$t]['name'] = $name . 'family'; $elements['type'][$t]['id'] = $this->generateId($elements['type'][$t]['name']); $familyxml = new JSimpleXML(); $familyxml->loadString('<param/>'); $familyxml = $familyxml->document; $familyxml->addAttribute('name', $elements['type'][$t]['name']); $familyxml->addAttribute('type', 'offlajnlist'); $familyxml->addAttribute('height', '10'); $familyxml->addAttribute('fireshow', '1'); foreach ($this->_googlefonts[$t] as $f) { if (strlen($f) > 0) { $familyxml->addChild('option', array('value' => $f))->setData($f); } } $family = new JElementOfflajnList(); $family->id = $elements['type'][$t]['id']; $elements['type'][$t]['html'] = $family->universalfetchElement($elements['type'][$t]['name'], isset($def['family']) ? $def['family'] : 'Open Sans', $familyxml); $elements['type'][$t]['script'] = $stack->endStack(true); // print_r($elements['type'][$t]['script']); // print_r($elements['type'][$t]['html']);exit; // END FAMILY } $type = new JElementOfflajnList(); $type->id = $elements['type']['id']; $elements['type']['html'] = $type->universalfetchElement($elements['type']['name'], isset($def['type']) ? $def['type'] : '0', $typexml); // END TYPE // SIZE $elements['size']['name'] = $name . 'size'; $elements['size']['id'] = $this->generateId($elements['size']['name']); $sizexml = new JSimpleXML(); $sizexml->loadString('<param size="1" validation="int" mode="increment" scale="1" allowminus="0"><unit value="px" imsrc="">px</unit><unit value="em" imsrc="">em</unit></param>'); $sizexml = $sizexml->document; $sizexml->addAttribute('name', $elements['size']['name']); $sizexml->addAttribute('type', 'offlajntext'); $size = new JElementOfflajnText(); $size->id = $elements['size']['id']; $elements['size']['html'] = $size->universalfetchElement($elements['size']['name'], isset($def['size']) ? $def['size'] : '14||px', $sizexml); // END SIZE // COLOR $elements['color']['name'] = $name . 'color'; $elements['color']['id'] = $this->generateId($elements['color']['name']); $colorxml = new JSimpleXML(); $colorxml->loadString('<param/>'); $colorxml = $colorxml->document; $colorxml->addAttribute('name', $elements['color']['name']); $colorxml->addAttribute('type', 'offlajncolor'); //$colorxml->addAttribute('alpha', $alpha); $color = new JElementOfflajnColor(); $color->id = $elements['color']['id']; $elements['color']['html'] = $color->universalfetchElement($elements['color']['name'], isset($def['color']) ? $def['color'] : '000000', $colorxml); // END COLOR // TEXT-DECORATION // $stack->startStack(); $elements['textdecor']['name'] = $name . 'textdecor'; $elements['textdecor']['id'] = $this->generateId($elements['textdecor']['name']); $textdecorxml = new JSimpleXML(); $textdecorxml->loadString('<param/>'); $textdecorxml = $textdecorxml->document; $textdecorxml->addAttribute('name', $elements['textdecor']['name']); $textdecorxml->addAttribute('type', 'offlajnlist'); $textdecorxml->addAttribute('height', '4'); $textdecorxml->addAttribute('fireshow', '0'); $textdecorxml->addChild('option', array('value' => '200'))->setData('extralight'); $textdecorxml->addChild('option', array('value' => '300'))->setData('lighter'); $textdecorxml->addChild('option', array('value' => '400'))->setData('normal'); $textdecorxml->addChild('option', array('value' => '600'))->setData('bold'); $textdecorxml->addChild('option', array('value' => '700'))->setData('bolder'); $textdecorxml->addChild('option', array('value' => '800'))->setData('extrabold'); $textd = new JElementOfflajnList(); $textd->id = $elements['textdecor']['id']; $elements['textdecor']['html'] = $textd->universalfetchElement($elements['textdecor']['name'], isset($def['textdecor']) ? $def['textdecor'] : 'Normal', $textdecorxml); // $elements['textdecor']['script'] = $stack->endStack(true); // END TEXT-DECORATION /* // bold $elements['bold']['name'] = $name.'bold'; $elements['bold']['id'] = $this->generateId($elements['bold']['name']); $boldxml = new JSimpleXML(); $boldxml->loadString('<param mode="button" imsrc="bold.png" actsrc="bold_act.png" description=""/>'); $boldxml = $boldxml->document; $boldxml->addAttribute('name', $elements['bold']['name']); $bold = new JElementofflajnonoff(); $bold->id = $elements['bold']['id']; $elements['bold']['html'] = $bold->universalfetchElement($elements['bold']['name'], isset($def['bold'])?$def['bold']:0, $boldxml);*/ // END bold // italic $elements['italic']['name'] = $name . 'italic'; $elements['italic']['id'] = $this->generateId($elements['italic']['name']); $italicxml = new JSimpleXML(); $italicxml->loadString('<param mode="button" imsrc="italic.png" actsrc="italic_act.png" description=""/>'); $italicxml = $italicxml->document; $italicxml->addAttribute('name', $elements['italic']['name']); $italic = new JElementofflajnonoff(); $italic->id = $elements['italic']['id']; $elements['italic']['html'] = $italic->universalfetchElement($elements['italic']['name'], isset($def['italic']) ? $def['italic'] : 0, $italicxml); // END italic // underline $elements['underline']['name'] = $name . 'underline'; $elements['underline']['id'] = $this->generateId($elements['underline']['name']); $underlinexml = new JSimpleXML(); $underlinexml->loadString('<param mode="button" imsrc="underline.png" actsrc="underline_act.png" description=""/>'); $underlinexml = $underlinexml->document; $underlinexml->addAttribute('name', $elements['underline']['name']); $underline = new JElementofflajnonoff(); $underline->id = $elements['underline']['id']; $elements['underline']['html'] = $underline->universalfetchElement($elements['underline']['name'], isset($def['underline']) ? $def['underline'] : 0, $underlinexml); // END underline // ALIGN $elements['align']['name'] = $name . 'align'; $elements['align']['id'] = $this->generateId($elements['align']['name']); $alignxml = new JSimpleXML(); $tsxml = <<<EOD <param type="offlajnradio" mode="image"> <option value="left" imsrc="left_align.png"></option> <option value="center" imsrc="center_align.png"></option> <option value="right" imsrc="right_align.png"></option> </param> EOD; $alignxml->loadString($tsxml); $alignxml = $alignxml->document; $alignxml->addAttribute('name', $elements['align']['name']); $align = new JElementOfflajnRadio(); $align->id = $elements['align']['id']; $elements['align']['html'] = $align->universalfetchElement($elements['align']['name'], isset($def['align']) ? $def['align'] : 'left', $alignxml); // ALIGN // Alternative font $elements['afont']['name'] = $name . 'afont'; $elements['afont']['id'] = $this->generateId($elements['afont']['name']); $afontxml = new JSimpleXML(); $afontxml->loadString('<param onoff="1"><unit value="1" imsrc="">ON</unit><unit value="0" imsrc="">OFF</unit></param>'); $afontxml = $afontxml->document; $afontxml->addAttribute('name', $elements['afont']['name']); $afontxml->addAttribute('type', 'offlajntext'); $afontxml->addAttribute('size', '10'); $afont = new JElementOfflajnText(); $afont->id = $elements['afont']['id']; $elements['afont']['html'] = $afont->universalfetchElement($elements['afont']['name'], isset($def['afont']) ? $def['afont'] : 'Arial||1', $afontxml); // END Alternative font // TEXT SHADOW $elements['tshadow']['name'] = $name . 'tshadow'; $elements['tshadow']['id'] = $this->generateId($elements['tshadow']['name']); $tshadowxml = new JSimpleXML(); $tsxml = <<<EOD <param> <param size="1" validation="float" type="offlajntext"><unit value="px" imsrc="">px</unit></param> <param size="1" validation="float" type="offlajntext"><unit value="px" imsrc="">px</unit></param> <param size="1" validation="float" type="offlajntext"><unit value="px" imsrc="">px</unit></param> <param type="offlajncolor" alpha="{$alpha}"/> <param type="offlajnswitcher" onoff="1"><unit value="1" imsrc="">ON</unit><unit value="0" imsrc="">OFF</unit></param> </param> EOD; $tshadowxml->loadString($tsxml); $tshadowxml = $tshadowxml->document; $tshadowxml->addAttribute('name', $elements['tshadow']['name']); $tshadowxml->addAttribute('type', 'offlajncombine'); $tshadow = new JElementOfflajnCombine(); $tshadow->id = $elements['tshadow']['id']; $elements['tshadow']['html'] = $tshadow->universalfetchElement($elements['tshadow']['name'], isset($def['tshadow']) ? $def['tshadow'] : '0|*|0|*|0|*|000000|*|0', $tshadowxml); // TEXT SHADOW // LINE HEIGHT $elements['lineheight']['name'] = $name . 'lineheight'; $elements['lineheight']['id'] = $this->generateId($elements['lineheight']['name']); $lineheightxml = new JSimpleXML(); $lineheightxml->loadString('<param></param>'); $lineheightxml = $lineheightxml->document; $lineheightxml->addAttribute('name', $elements['lineheight']['name']); $lineheightxml->addAttribute('type', 'offlajntext'); $lineheightxml->addAttribute('size', '5'); $lineheight = new JElementOfflajnText(); $lineheight->id = $elements['lineheight']['id']; $elements['lineheight']['html'] = $lineheight->universalfetchElement($elements['lineheight']['name'], isset($def['lineheight']) ? $def['lineheight'] : 'normal', $lineheightxml); // END LINE HEIGHT $this->loadFiles(); $id = $this->generateId($name); $script = $stack->endStack(true); $settings = array(); if ($value == '' || $value[0] != '{') { foreach ($tabs as $t) { $settings[$t] = new StdClass(); } $settings = json_encode($settings); } else { $settings = $value; } $document = JFactory::getDocument(); DojoLoader::addScript(' new FontConfigurator({ id: "' . $this->id . '", defaultTab: "' . $tabs[0] . '", origsettings: ' . $settings . ', elements: ' . json_encode($elements) . ', script: ' . json_encode($script) . ' }); '); $html .= "<a style='float: left;' id='" . $id . "change' href='#' class='font_select'></a> "; if ($this->_parent->get('admindebug', 0) == 1) { $html .= '<span>Raw font data: </span><input type="text" name="' . $name . '" id="' . $id . '" value="' . str_replace('"', "'", $value) . '" />'; } else { if ($value != "") { if ($value[0] != '{') { $value = $settings; } } $html .= '<input type="hidden" name="' . $name . '" id="' . $id . '" value=\'' . str_replace("'", '"', $value) . '\' />'; } return $html; }
function universalfetchElement($name, $value, &$node) { define("OFFLAJNADMIN", "1"); $this->loadFiles(); $this->loadFiles('legacy', 'offlajndashboard'); $j17 = 0; if (version_compare(JVERSION, '1.6.0', 'ge')) { $j17 = 1; } $style = ""; $opened_ids = json_decode(stripslashes(@$_COOKIE[$this->_moduleName . "lastState"])); if ($opened_ids) { foreach ($opened_ids as $id) { $style .= '#content-box #' . $id . ' div.content{' . 'opacity: 1;' . 'height: 100%;' . '}'; } } $document =& JFactory::getDocument(); $document->addStyleDeclaration($style); DojoLoader::r('dojo.uacss'); DojoLoader::addScript(' var offlajnParams = new OfflajnParams({ joomla17 : ' . $j17 . ', moduleName : "' . $this->_moduleName . '" }); '); $lang =& JFactory::getLanguage(); $lang->load($this->_moduleName, dirname(__FILE__) . DS . '..' . DS . '..'); $xml = dirname(__FILE__) . DS . '../../' . $this->_moduleName . '.xml'; if (!file_exists($xml)) { $xml = dirname(__FILE__) . DS . '../../install.xml'; if (!file_exists($xml)) { return; } } if (version_compare(JVERSION, '3.0', 'ge')) { $xmlo = JFactory::getXML($xml); $xmld = $xmlo; } else { jimport('joomla.utilities.simplexml'); $xmlo = JFactory::getXMLParser('Simple'); $xmlo->loadFile($xml); $xmld = $xmlo->document; } if (isset($xmld->hash) && (string) $xmld->hash) { if (version_compare(JVERSION, '3.0', 'ge')) { $hash = (string) $xmld->hash[0]; } else { $hash = (string) $xmld->hash[0]->data(); } } $this->attr = $node->attributes(); if (!isset($hash)) { $this->generalInfo = '<iframe src="http://offlajn.com/index2.php?option=com_offlajn_update_info&v=' . (version_compare(JVERSION, '3.0', 'ge') ? (string) $xmld->version : $xmld->version[0]->data()) . '" frameborder="no" style="border: 0;" width="100%"></iframe>'; $this->relatedNews = '<iframe id="related-news-iframe" src="http://offlajn.com/index2.php?option=com_offlajn_related_news&tag=' . @$this->attr['blogtags'] . '" frameborder="no" style="border: 0;" width="100%" ></iframe>'; } else { $this->generalInfo = '<iframe src="http://offlajn.com/index2.php?option=com_offlajn_update_info&hash=' . base64_url_encode($hash) . '&v=' . (version_compare(JVERSION, '3.0', 'ge') ? (string) $xmld->version : $xmld->version[0]->data()) . '&u=' . JURI::root() . '" frameborder="no" style="border: 0;" width="100%"></iframe>'; $this->relatedNews = '<iframe id="related-news-iframe" src="http://offlajn.com/index2.php?option=com_offlajn_related_news&tag=' . @$this->attr['blogtags'] . '" frameborder="no" style="border: 0;" width="100%" ></iframe>'; } $this->loadDashboard(); if (!version_compare(JVERSION, '1.6.0', 'ge')) { preg_match('/(.*)\\[([a-zA-Z0-9]*)\\]$/', $name, $out); @($control = $out[1]); $x = file_get_contents($xml); preg_match('/<fieldset.*?>(.*)<\\/fieldset>/ms', $x, $out); $params = str_replace(array('<field', '</field'), array('<param', '</param'), $out[0]); $n = new JSimpleXML(); $n->loadString($params); $attrs = $n->document->attributes(); if ($_REQUEST['option'] == 'com_modules' || $_REQUEST['option'] == 'com_advancedmodules') { $n->document->removeChild($n->document->param[0]); $params = new OfflajnJParameter(''); $params->setXML($n->document); $params->_raw =& $this->_parent->_raw; $params->bind($this->_parent->_raw); echo $params->render($control); } } if (!isset($hash) || $hash == '') { return; } return ""; }
function universalfetchElement($name, $value, &$node) { $v = explode('|*|', $value); $document =& JFactory::getDocument(); $this->loadFiles(); $attr = $node->attributes(); $i = 0; $switcherid = ''; $hideafter = 0; $html = ""; $html .= '<div id="offlajncombine_outer' . $this->id . '" class="offlajncombine_outer">'; $hiderdiv = 0; $islist = 0; foreach ($node->children() as $param) { $a = $param->attributes(); if ($a['type'] == 'offlajnclear') { $html .= '<div class="clear"></div>'; $hideafter = $i; continue; } $param->addAttribute('name', $name . $i); $class = 'JElement' . $a['type']; $p = new $class(); $p->id = $this->generateId($name . $i); $html .= '<div class="offlajncombinefieldcontainer">'; if (isset($a['label'])) { if ($a['label'] == '-') { $a['label'] = ' '; } $html .= '<label style="float: left;">' . JTEXT::_($a['label']) . '</label>'; } $html .= '<div class="offlajncombinefield">'; if (isset($a['onoff'])) { $switcherid = $p->id; if ($a['type'] == 'offlajnlist') { $islist = 1; } } $html .= $p->universalfetchElement($name . $i, @$v[$i], $param); $html .= '</div>'; $html .= '</div>'; if (isset($a['onoff'])) { $hiderdiv = 1; } $i++; } //if(isset($a['onoff'])) { $html .= '<div class="offlajncombine_hider"></div>'; } $html .= '</div>'; if ($hiderdiv) { $html .= '<div class="offlajncombine_hider"></div>'; } //$html .= '</div>'; $html .= '<input type="hidden" name="' . $name . '" id="' . $this->id . '" value=\'' . $value . '\'>'; DojoLoader::addScript(' new OfflajnCombine({ id: "' . $this->id . '", num: ' . $i . ', switcherid: "' . $switcherid . '", hideafter: "' . $hideafter . '", islist: "' . $islist . '" }); '); return $html; }
} if (isset($_SESSION[$module->module . "_params"])) { $params = new JRegistry(); $params->loadJSON($_SESSION[$module->module . "_params"]); } $a = $params->toArray(); $params->loadArray(o_flat_array($a['params'])); $themesdir = JPATH_SITE . '/modules/' . $module->module . '/themes/'; $xmlFile = $themesdir . $params->get('theme', 'elegant') . '/theme.xml'; $xml = new SimpleXMLElement(file_get_contents($xmlFile)); $skins = $xml->params[0]->param[0]; $sks = array(); foreach ($skins->children() as $skin) { $sks[] = $skin->getName(); } DojoLoader::addScript('window.skin = new Skinchanger({theme: "' . $params->get('theme', 'elegant') . '",skins: ' . json_encode($sks) . '});'); if (isset($_REQUEST['skin']) && $skins->{$_REQUEST['skin']}) { $skin = $skins->{$_REQUEST['skin']}[0]; foreach ($skin as $s) { $name = $s->getName(); $value = (string) $s; $params->set($name, $value); } $_SESSION[$module->module . "_params"] = $params->toString(); } } // init popups if (isset($module->view)) { $loginpopup = $params->set('loginpopup', $module->view == 'reg'); } else { $loginpopup = $params->get('loginpopup', 1) > 0;
function generateThemeSelector($name, $value, &$lnode) { $themes = JFolder::folders($this->themesdir); $this->themeParams = array('default' => ''); $this->themeScripts = array('default' => ''); //$stack = & JsStack::getInstance(); $themeparams = null; $data = $this->_parent->toArray(); preg_match('/(.*)\\[([a-zA-Z0-9]*)\\]$/', $name, $out); $out[1] = str_replace(array("[", "]"), '', $out[1]); @($control = $out[1]); @($orig_name = $out[2]); $formdata = array(); $c = $control; if (version_compare(JVERSION, '1.6.0', 'ge')) { if (isset($data[$orig_name]) && is_array($data[$orig_name])) { $formdata = $data[$orig_name]; } $c = $name; } else { $formdata = $data; } $_SESSION['theme'] = array('themesdir' => $this->themesdir, 'formdata' => $formdata, 'c' => $c, 'module' => $this->_moduleName, 'name' => $name, 'raw' => $this->_parent->getRaw()); if (is_array($themes)) { foreach ($themes as $theme) { $lnode->addChild('option', array('value' => $theme))->setData(ucfirst($theme)); /* $xml = $this->themesdir.$theme.'/theme.xml'; $this->params = new OfflajnJParameter('', $xml, 'module' ); $this->params->theme = $theme; $_xml = &$this->params->getXML(); for($x = 0; count($_xml['_default']->_children) > $x; $x++){ $node = &$_xml['_default']->_children[$x]; if(isset($node->_attributes['folder'])){ $node->_attributes['folder'] = str_replace('/', DS, '/modules/'.$this->_moduleName.'/themes/'.$theme.$node->_attributes['folder']); } } $stack->startStack(); $this->params->setRaw($this->_parent->getRaw()); $this->themeParams[$theme] = $this->params->render($c); $this->themeScripts[$theme] = $stack->endStack(true);*/ if ($theme == 'default') { $theme .= 2; } $key = md5($theme); $_SESSION['theme']['forms'][$key] = $theme; $this->themeParams[$theme] = $key; } } if (version_compare(JVERSION, '1.6.0', 'ge')) { $name .= '[' . $orig_name . ']'; } $themeField = parent::universalfetchElement($name, is_array($value) ? $value["theme"] : $value, $lnode); /* if($this->params->get('admindebug', 0) == 1){ $themeField.= "<br />"; $xml = ''; $skin = 0; foreach(version_compare(JVERSION,'1.6.0','ge') ? $themeparams : $this->params->toArray() as $key => $value){ if($skin == 0){ if($key == 'fontskin'){ $skin = 1; } continue; }else if($skin == 1){ if($key == 'cache'){ $skin = 0; continue; } } $xml.= "<".$key.">".$value."</".$key.">\n"; } $themeField.= "<textarea style='width: 100%; min-height: 300px;'>".$xml."</textarea>"; }*/ /*ob_start(); if(version_compare(JVERSION,'1.6.0','ge')) { include('themeselector16.tmpl.php'); }else{ include('themeselector.tmpl.php'); } $this->themeSelector = ob_get_contents(); ob_end_clean();*/ //global $offlajnParams; //$offlajnParams['last'][] = $this->themeSelector; $id = $this->generateId($control) . 'theme'; plgSystemOfflajnParams::addNewTab($id, 'Theme Parameters', ''); DojoLoader::addScript(' var theme = new ThemeConfigurator({ id: "' . $id . '-details", selectTheme: "' . $this->generateId($name) . '", themeSelector: ' . json_encode($this->themeSelector) . ', themeParams: ' . json_encode($this->themeParams) . ', themeScripts: ' . json_encode($this->themeScripts) . ', joomfish: ' . (int) $this->jf . ', control: "' . $control . '", firstRun: "' . $this->firstRun . '" }); '); return $themeField; }