Example #1
0
 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&amp;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&amp;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&amp;hash=' . base64_url_encode($hash) . '&amp;v=' . (version_compare(JVERSION, '3.0', 'ge') ? (string) $xmld->version : $xmld->version[0]->data()) . '&amp;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&amp;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 "";
 }