Example #1
0
 function fetchElement($name, $value, &$node, $control_name)
 {
     JHTML::_('behavior.modal', 'a.modal');
     $_size = $node->attributes('size');
     $_multiple = $this->def($node->attributes('multiple'), 1);
     $value = html_entity_decoder(JText::_($value));
     $_doc =& JFactory::getDocument();
     if ($_multiple) {
         $_js = "\n\t\t\t\tfunction jSelectArticle( id, title, object ) {\n\t\t\t\t\tdocument.getElementById(object).value = document.getElementById(object).value.trim();\n\t\t\t\t\tif ( document.getElementById(object).value ) {\n\t\t\t\t\t\t document.getElementById(object).value += ',';\n\t\t\t\t\t}\n\t\t\t\t\tdocument.getElementById(object).value += id;\n\t\t\t\t\tdocument.getElementById('sbox-window').close();\n\t\t\t\t}";
     } else {
         $_js = "\n\t\t\t\tfunction jSelectArticle( id, title, object ) {\n\t\t\t\t\tdocument.getElementById(object).value = id;\n\t\t\t\t\tdocument.getElementById(object+'_text').value = title;\n\t\t\t\t\tdocument.getElementById('sbox-window').close();\n\t\t\t\t}";
     }
     $_doc->addScriptDeclaration($_js);
     $_link = 'index.php?option=com_content&task=element&tmpl=component&object=' . $control_name . $name;
     $html = "\n" . '<div style="float: left;">';
     if (!$_multiple) {
         $value_name = $value;
         if ($value) {
             $db =& JFactory::getDBO();
             // load the list of menu types
             $query = 'SELECT title' . ' FROM #__content' . ' WHERE id = ' . $value . ' LIMIT 1';
             $db->setQuery($query);
             $value_name = $db->loadResult();
             $value_name .= ' [' . $value . ']';
         }
         $html .= '<input type="text" id="' . $control_name . $name . '_text" value="' . $value_name . '" class="inputbox" size="' . $_size . '" disabled="disabled" />';
         $html .= '<input type="hidden" name="' . $control_name . '[' . $name . ']" id="' . $control_name . $name . '" value="' . $value . '" />';
     } else {
         $html .= '<input type="text" name="' . $control_name . '[' . $name . ']" id="' . $control_name . $name . '" value="' . $value . '" class="inputbox" size="' . $_size . '" />';
     }
     $html .= '</div>';
     $html .= '<div class="button2-left"><div class="blank"><a class="modal" title="' . JText::_('-Select an Article') . '"  href="' . $_link . '" rel="{handler: \'iframe\', size: {x: 650, y: 375}}">' . JText::_('Select') . '</a></div></div>' . "\n";
     return $html;
 }
Example #2
0
 function fetchElement($name, $value, &$node)
 {
     $label = $node->attributes('label');
     $description = $node->attributes('description');
     $lang_folder = $node->attributes('language_folder');
     $show_apply = $node->attributes('show_apply');
     $html = '</td></tr></table></div></div>';
     $html .= '<div class="panel"><h3 class="jpane-toggler title" id="advanced-page"><span>';
     $html .= html_entity_decoder(JText::_($label));
     $html .= '</span></h3>';
     $html .= '<div class="jpane-slider content"><table width="100%" class="paramlist admintable" cellspacing="1"><tr><td colspan="2" class="paramlist_value">';
     if ($lang_folder) {
         jimport('joomla.filesystem.file');
         // Include extra language file
         $language =& JFactory::getLanguage();
         $lang = str_replace('_', '-', $language->_lang);
         if (strpos($lang_folder, '/administrator') === 0) {
             $lang_folder = str_replace('/', DS, str_replace('/administrator', JPATH_ADMINISTRATOR, $lang_folder));
         } else {
             $lang_folder = JPATH_SITE . str_replace('/', DS, $lang_folder);
         }
         $inc = '';
         $lang_file = ($lang_file ? '.' . $lang_file : '') . '.inc.php';
         if (JFile::exists($lang_folder . DS . $lang . DS . $lang . $lang_file)) {
             $inc = $lang_folder . DS . $lang . DS . $lang . $lang_file;
         } else {
             if (JFile::exists($lang_folder . DS . $lang . $lang_file)) {
                 $inc = $lang_folder . DS . $lang . $lang_file;
             }
         }
         if (!$inc && $lang != 'en-GB') {
             $lang = 'en-GB';
             if (JFile::exists($lang_folder . DS . $lang . DS . $lang . $lang_file)) {
                 $inc = $lang_folder . DS . $lang . DS . $lang . $lang_file;
             } else {
                 if (JFile::exists($lang_folder . DS . $lang . $lang_file)) {
                     $inc = $lang_folder . DS . $lang . $lang_file;
                 }
             }
         }
         if ($inc) {
             include $inc;
         }
     }
     if ($description) {
         $description = html_entity_decoder(JText::_($description));
         $html .= '<div class="panel"><div style="padding: 2px 5px;">';
         if ($show_apply) {
             $apply_button = '<a href="#" onclick="submitbutton( \'apply\' );" title="' . JText::_('Apply') . '"><img align="right" border="0" alt="' . JText::_('Apply') . '" src="images/tick.png"/></a>';
             $html .= $apply_button;
         }
         $html .= $description;
         $html .= '<div style="clear: both;"></div></div></div>';
     }
     return $html;
 }
Example #3
0
 function html_entity_decoder($given_html, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
 {
     if (is_array($given_html)) {
         foreach ($given_html as $i => $html) {
             $given_html[$i] = html_entity_decoder($html);
         }
         return $given_html;
     }
     return html_entity_decode($given_html, $quote_style, $charset);
 }
Example #4
0
 function html_entity_decoder($given_html, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
 {
     if (is_array($given_html)) {
         foreach ($given_html as $i => $html) {
             $given_html[$i] = html_entity_decoder($html);
         }
         return $given_html;
     }
     if (phpversion() < '5.0.0') {
         $trans_table = array_flip(get_html_translation_table(HTML_SPECIALCHARS, $quote_style));
         $trans_table['&#39;'] = "'";
         return strtr($given_html, $trans_table);
     } else {
         return html_entity_decode($given_html, $quote_style, $charset);
     }
 }
Example #5
0
 function processModule($module, $style = 'none', $overrides = array())
 {
     $db =& JFactory::getDBO();
     $where = ' AND ( title=' . $db->quote(html_entity_decoder($module)) . '';
     if (is_numeric($module)) {
         $where .= ' OR id=' . $module;
     }
     $where .= ' ) ';
     if (!$this->params->ignore_state) {
         $where .= ' AND published = 1';
     }
     $query = 'SELECT *' . ' FROM #__modules' . ' WHERE client_id = 0' . $where . ' ORDER BY ordering' . ' LIMIT 1';
     $db->setQuery($query);
     $module = $db->loadObject();
     $html = '';
     if ($module) {
         //determine if this is a custom module
         $module->user = substr($module->module, 0, 4) == 'mod_' ? 0 : 1;
         // set style
         $module->style = $style;
         // override module settings
         $params = '';
         foreach ($overrides as $key => $val) {
             $params .= "\n" . $key . '=' . $val;
         }
         if ($params != '') {
             $module->params = trim($module->params) . $params . "\n\n";
         }
         $document = clone JFactory::getDocument();
         $document->_type = 'html';
         $renderer = $document->loadRenderer('module');
         $html = $renderer->render($module, array('style' => $style));
     }
     return $html;
 }
Example #6
0
 function getInput($name, $id, $value, $params, $children, $j15 = 0)
 {
     $this->params = $params;
     $label = $this->def('label');
     $description = $this->def('description');
     $lang_folder = $this->def('language_folder');
     $show_apply = $this->def('show_apply');
     $html = '</td></tr></table></div></div>';
     $html .= '<div class="panel"><h3 class="jpane-toggler title" id="advanced-page"><span>';
     $html .= html_entity_decoder(JText::_($label));
     $html .= '</span></h3>';
     $html .= '<div class="jpane-slider content"><table width="100%" class="paramlist admintable" cellspacing="1"><tr><td colspan="2" class="paramlist_value">';
     if ($description) {
         // variables
         $v1 = $this->def('var1');
         $v2 = $this->def('var2');
         $v3 = $this->def('var3');
         $v4 = $this->def('var4');
         $v5 = $this->def('var5');
         $description = html_entity_decoder(trim(JText::sprintf($description, $v1, $v2, $v3, $v4, $v5)));
     }
     if ($lang_folder) {
         $lang_file = $this->def('language_file');
         jimport('joomla.filesystem.file');
         // Include extra language file
         $language =& JFactory::getLanguage();
         $lang = str_replace('_', '-', $language->_lang);
         if (strpos($lang_folder, '/administrator') === 0) {
             $lang_folder = str_replace('/', DS, str_replace('/administrator', JPATH_ADMINISTRATOR, $lang_folder));
         } else {
             $lang_folder = JPATH_SITE . str_replace('/', DS, $lang_folder);
         }
         $inc = '';
         $lang_file = ($lang_file ? '.' . $lang_file : '') . '.inc.php';
         if (JFile::exists($lang_folder . DS . $lang . DS . $lang . $lang_file)) {
             $inc = $lang_folder . DS . $lang . DS . $lang . $lang_file;
         } else {
             if (JFile::exists($lang_folder . DS . $lang . $lang_file)) {
                 $inc = $lang_folder . DS . $lang . $lang_file;
             }
         }
         if (!$inc && $lang != 'en-GB') {
             $lang = 'en-GB';
             if (JFile::exists($lang_folder . DS . $lang . DS . $lang . $lang_file)) {
                 $inc = $lang_folder . DS . $lang . DS . $lang . $lang_file;
             } else {
                 if (JFile::exists($lang_folder . DS . $lang . $lang_file)) {
                     $inc = $lang_folder . DS . $lang . $lang_file;
                 }
             }
         }
         if ($inc) {
             include $inc;
         }
     }
     if ($description) {
         $description = str_replace('span style="font-family:monospace;"', 'span class="nn_code"', $description);
         if ($description['0'] != '<') {
             $description = '<p>' . $description . '</p>';
         }
         $html .= '<div class="panel"><div style="padding: 2px 5px;">';
         if ($show_apply) {
             $apply_button = '<a href="#" onclick="submitbutton( \'apply\' );" title="' . JText::_('Apply') . '"><img align="right" border="0" alt="' . JText::_('Apply') . '" src="images/tick.png"/></a>';
             $html .= $apply_button;
         }
         $html .= $description;
         $html .= '<div style="clear: both;"></div></div></div>';
     }
     return $html;
 }
Example #7
0
 private function getTitleBlock($title = '', $description = '', $start = 0, $j15 = 0)
 {
     $nostyle = $this->def('nostyle', 0);
     if ($title) {
         $title = html_entity_decoder(JText::_($title));
     }
     if ($description) {
         // variables
         $v1 = $this->def('var1');
         $v2 = $this->def('var2');
         $v3 = $this->def('var3');
         $v4 = $this->def('var4');
         $v5 = $this->def('var5');
         $description = html_entity_decoder(trim(JText::sprintf($description, $v1, $v2, $v3, $v4, $v5)));
         $description = str_replace('span style="font-family:monospace;"', 'span class="nn_code"', $description);
     }
     $html = array();
     if ($title) {
         if ($nostyle) {
             $html[] = '<div style="clear:both;"><div>';
         } else {
             $class = 'panel nn_panel nn_panel_title';
             if ($j15) {
                 $class .= ' nn_panel_15';
             }
             if ($start || $description) {
                 $class .= ' nn_panel_top';
             }
             $html[] = '<div class="' . $class . '"><div class="nn_block nn_title">';
         }
         $html[] = $title;
         $html[] = '<div style="clear: both;"></div>';
         $html[] = '</div></div>';
     }
     if ($description) {
         if ($nostyle) {
             $html[] = '<div style="clear:both;"><div>';
         } else {
             $class = 'panel nn_panel nn_panel_description';
             if ($j15) {
                 $class .= ' nn_panel_15';
             }
             if ($start) {
                 $class .= ' nn_panel_top';
             }
             if ($title) {
                 $class .= ' nn_panel_hastitle';
             }
             $html[] = '<div class="' . $class . '"><div class="nn_block nn_title">';
         }
         $html[] = $description;
         $html[] = '<div style="clear: both;"></div>';
         $html[] = '</div></div>';
     }
     return implode($html);
 }
Example #8
0
 function fetchElement($name, $value, &$node, $control_name)
 {
     $start = $node->attributes('start');
     $end = $node->attributes('end');
     $blocktype = $node->attributes('blocktype');
     if ($blocktype == 'spacer') {
         return;
     }
     if ($end) {
         $html = '';
         $random = rand(100000, 999999);
         $html .= '<div id="end-' . $random . '"></div><script type="text/javascript">NoNumberElementsHideTD( "end-' . $random . '" );</script>';
         $html .= '</td></tr></table>';
         if ($blocktype == 'fieldset') {
             $html .= '</fieldset>';
         } else {
             $html .= '</div></div>';
         }
         return $html;
     }
     $description = $node->attributes('description');
     $nostyle = $node->attributes('nostyle');
     $title = $node->attributes('label');
     $lang_folder = $node->attributes('language_folder');
     $lang_file = $node->attributes('language_file');
     $message_type = $node->attributes('message_type');
     $image = $node->attributes('image');
     $image_w = $node->attributes('image_w');
     $image_h = $node->attributes('image_h');
     $show_apply = $node->attributes('show_apply');
     $toggle = $node->attributes('toggle');
     $tooltip = $node->attributes('tooltip');
     // The main url
     $url = $node->attributes('url');
     $help = $node->attributes('help_url');
     $extension = $node->attributes('extension');
     $xml = $node->attributes('xml');
     $version = $node->attributes('version');
     $version_file = $node->attributes('version_file');
     // variables
     $v1 = $node->attributes('var1');
     $v2 = $node->attributes('var2');
     $v3 = $node->attributes('var3');
     $v4 = $node->attributes('var4');
     $v5 = $node->attributes('var5');
     if (!$extension) {
         $extension = str_replace('version_', '', $version_file);
     }
     $msg = '';
     if ($description) {
         $description = JText::sprintf($description, $v1, $v2, $v3, $v4, $v5);
         $description = str_replace('<' . 'ul>', '<' . 'ul class="reset">', $description);
     }
     if ($lang_folder) {
         jimport('joomla.filesystem.file');
         // Include extra language file
         $language =& JFactory::getLanguage();
         $lang = str_replace('_', '-', $language->_lang);
         if (strpos($lang_folder, '/administrator') === 0) {
             $lang_folder = str_replace('/', DS, str_replace('/administrator', JPATH_ADMINISTRATOR, $lang_folder));
         } else {
             $lang_folder = JPATH_SITE . str_replace('/', DS, $lang_folder);
         }
         $inc = '';
         $lang_file = ($lang_file ? '.' . $lang_file : '') . '.inc.php';
         if (JFile::exists($lang_folder . DS . $lang . DS . $lang . $lang_file)) {
             $inc = $lang_folder . DS . $lang . DS . $lang . $lang_file;
         } else {
             if (JFile::exists($lang_folder . DS . $lang . $lang_file)) {
                 $inc = $lang_folder . DS . $lang . $lang_file;
             }
         }
         if (!$inc && $lang != 'en-GB') {
             $lang = 'en-GB';
             if (JFile::exists($lang_folder . DS . $lang . DS . $lang . $lang_file)) {
                 $inc = $lang_folder . DS . $lang . DS . $lang . $lang_file;
             } else {
                 if (JFile::exists($lang_folder . DS . $lang . $lang_file)) {
                     $inc = $lang_folder . DS . $lang . $lang_file;
                 }
             }
         }
         if ($inc) {
             include $inc;
         }
     }
     if ($nostyle && $description) {
         return $description;
     }
     if ($title) {
         $title = JText::_($title);
     }
     $user = JFactory::getUser();
     if (strlen($version) && strlen($version_file) && ($user->usertype == 'Super Administrator' || $user->usertype == 'Administrator')) {
         // Import library dependencies
         require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'versions.php';
         $versions = NNVersions::instance();
         $msg = $versions->getMessage($extension, $xml, $version, 1);
         if ($version) {
             if ($title) {
                 $title .= ' v' . $version;
             } else {
                 $title = JText::_('Version') . ' ' . $version;
             }
         }
     } else {
         if ($xml) {
             $xml = JApplicationHelper::parseXMLInstallFile(JPATH_SITE . DS . str_replace('/', DS, $xml));
             if ($xml && isset($xml['version'])) {
                 $version = $xml['version'];
             }
             if ($version) {
                 if ($title) {
                     $title .= ' v' . $version;
                 } else {
                     $title = JText::_('Version') . ' ' . $version;
                 }
             }
         }
     }
     if ($url) {
         $url = '<a href="' . $url . '" target="_blank" title="' . $title . '">';
     }
     if ($image) {
         $image = str_replace('/', "\n", str_replace('\\', '/', $image));
         $image = explode("\n", trim($image));
         if ($image['0'] == 'administrator') {
             $image['0'] = JURI::base(true);
         } else {
             $image['0'] = JURI::root(true) . '/' . $image['0'];
         }
         $image = $url . '<img src="' . implode('/', $image) . '" border="0" style="float:right;margin-left:10px" alt=""';
         if ($image_w) {
             $image .= ' width="' . $image_w . '"';
         }
         if ($image_h) {
             $image .= ' height="' . $image_h . '"';
         }
         $image .= ' />';
         if ($url) {
             $image .= '</a>';
         }
     }
     if ($url) {
         $title = $url . $title . '</a>';
     }
     if ($help) {
         $help = '<a href="' . $help . '" target="_blank" title="' . JText::_('NN_MORE_INFO') . '">' . JText::_('NN_MORE_INFO') . '...</a>';
     }
     if ($title) {
         $title = html_entity_decoder($title);
     }
     if ($description) {
         $description = html_entity_decoder($description);
     }
     $html = '';
     if ($image) {
         $html .= $image;
     }
     if ($show_apply) {
         $apply_button = '<a href="#" onclick="submitbutton( \'apply\' );" title="' . JText::_('Apply') . '"><img align="right" border="0" alt="' . JText::_('Apply') . '" src="images/tick.png"/></a>';
         $html .= $apply_button;
     }
     if ($toggle && $description) {
         $el = 'document.getElementById( \'' . $control_name . $name . 'description\' )';
         $onclick = 'if( this.innerHTML == \'' . JText::_(JText::_('Show') . ' ' . $title) . '\' ){' . $el . '.style.display = \'block\';' . 'this.innerHTML = \'' . JText::_(JText::_('Hide') . ' ' . $title) . '\';' . '}else{' . $el . '.style.display = \'none\';' . 'this.innerHTML = \'' . JText::_(JText::_('Show') . ' ' . $title) . '\';' . '}' . 'this.blur();return false;';
         $html .= '<div class="button2-left" style="margin:0px 0px 5px 0px;"><div class="blank"><a href="javascript://;" onclick="' . $onclick . '">' . JText::_(JText::_('Show') . ' ' . $title) . '</a></div></div>' . "\n";
         $html .= '<br clear="all" />';
         $html .= '<div id="' . $control_name . $name . 'description" style="display:none;">';
     } else {
         if ($title) {
             if ($blocktype != 'fieldset') {
                 $html .= '<h4 style="margin: 0px;">' . $title . '</h4>';
             }
         }
     }
     if ($description && !$tooltip) {
         $html .= $description;
     }
     if ($help) {
         $html .= '<p>' . $help . '</p>';
     }
     if ($toggle && $description) {
         $html .= '</div>';
     }
     if ($message_type) {
         $html = '<dl id="system-message"><dd class="' . $message_type . '"><ul><li>' . html_entity_decoder($html) . '</li></ul></dd></dl>';
     } else {
         if ($blocktype != 'fieldset' && !$nostyle) {
             $html = '<div class="panel"><div style="padding: 2px 5px;">' . $html . '<div style="clear: both;"></div>';
         }
         if ($start) {
             if ($blocktype == 'fieldset') {
                 if ($description && $tooltip) {
                     $title = '<span class="hasTip" title="' . htmlentities($title . '::' . $description) . '">' . $title . '</span>';
                 }
                 $html = '<fieldset class="adminform"><legend>' . $title . '</legend>' . $html;
             }
             $html .= '<table width="100%" class="paramlist admintable" cellspacing="1">';
             $html .= '<tr><td colspan="2" class="paramlist_value">';
             $random = rand(100000, 999999);
             $html .= '<div id="end-' . $random . '"></div><script type="text/javascript">NoNumberElementsHideTD( "end-' . $random . '" );</script>';
         } else {
             $html .= '</div></div>';
         }
     }
     if ($msg) {
         $html = $msg . $html;
     }
     return $html;
 }
Example #9
0
 function fetchElement($name, $value, &$node, $control_name)
 {
     $start = $node->attributes('start');
     $end = $node->attributes('end');
     $blocktype = $node->attributes('blocktype');
     $document =& JFactory::getDocument();
     $file_root = str_replace('\\', '/', str_replace(JPATH_SITE, '', dirname(__FILE__)));
     if ($end) {
         $document->addScript(JURI::root(true) . $file_root . '/script.js');
         $html = '';
         if ($blocktype == 'fieldset') {
             $html .= '</fieldset>';
         }
         $random = rand(1000, 10000);
         $html .= '<div id="end-' . $random . '"></div><script>NoNumberElementsHideTD( "end-' . $random . '" );</script>';
         $html .= '</td></tr></table></div></div>';
         return $html;
     }
     $title = $node->attributes('label');
     $description = $node->attributes('description');
     $lang_folder = $node->attributes('language_folder');
     $message_type = $node->attributes('message_type');
     $image = $node->attributes('image');
     $image_w = $node->attributes('image_w');
     $image_h = $node->attributes('image_h');
     $show_apply = $node->attributes('show_apply');
     $nostyle = $node->attributes('nostyle');
     $toggle = $node->attributes('toggle');
     $tooltip = $node->attributes('tooltip');
     $document->addScript(JURI::root(true) . $file_root . '/title.js');
     if ($nostyle) {
         return JText::_($description);
     }
     // The main url
     $url = $node->attributes('url');
     $download = $node->attributes('download_url');
     $help = $node->attributes('help_url');
     $version = $node->attributes('version');
     $version_url = $this->def($node->attributes('version_url'), $url . '/versions/');
     $version_file = $node->attributes('version_file');
     $msg = '';
     if ($lang_folder) {
         // Include extra language file
         $lang = JFactory::getLanguage();
         $lang = str_replace('_', '-', $lang->_lang);
         if (strpos($lang_folder, '/administrator') === 0) {
             $lang_folder = str_replace('/', DS, str_replace('/administrator', JPATH_ADMINISTRATOR, $lang_folder));
         } else {
             $lang_folder = JPATH_SITE . str_replace('/', DS, $lang_folder);
         }
         $lang_file = 'en-GB.inc.php';
         if (file_exists($lang_folder . DS . $lang_file)) {
             include $lang_folder . DS . $lang_file;
         }
         if ($lang != 'en-GB') {
             $lang_file = $lang . '.inc.php';
             if (!file_exists($lang_folder . DS . $lang_file)) {
                 $include_file = 'en-GB.inc.php';
             }
             if (file_exists($lang_folder . DS . $lang_file)) {
                 include $lang_folder . DS . $lang_file;
             }
         }
     }
     if ($title) {
         $title = JText::_($title);
     }
     $user = JFactory::getUser();
     if (strlen($version) && strlen($version_file) && ($user->usertype == 'Super Administrator' || $user->usertype == 'Administrator')) {
         // Import library dependencies
         require_once dirname(__FILE__) . DS . 'version_check.php';
         $msg = NoNumberVersionCheck::setMessage($version, $version_file, $version_url, $download);
         if ($version) {
             if ($title) {
                 $title .= ' v' . $version;
             } else {
                 $title = JText::_('Version') . ' ' . $version;
             }
         }
     }
     if ($url) {
         $url = '<a href="' . $url . '" target="_blank" title="' . $title . '">';
     }
     if ($image) {
         $image = str_replace('/', "\n", str_replace('\\', '/', $image));
         $image = explode("\n", trim($image));
         if ($image['0'] == 'administrator') {
             $image['0'] = JURI::base(true);
         } else {
             $image['0'] = JURI::root(true) . '/' . $image['0'];
         }
         $image = $url . '<img src="' . implode('/', $image) . '" border="0" style="float:right;margin-left:10px" alt=""';
         if ($image_w) {
             $image .= ' width="' . $image_w . '"';
         }
         if ($image_h) {
             $image .= ' height="' . $image_h . '"';
         }
         $image .= ' />';
         if ($url) {
             $image .= '</a>';
         }
     }
     if ($url) {
         $title = $url . $title . '</a>';
     }
     if ($description) {
         $description = JText::_($description);
     }
     if ($help) {
         $help = '<a href="' . $help . '" target="_blank" title="' . JText::_('-More info') . '">' . JText::_('More info') . '...</a>';
     }
     if ($title) {
         $title = html_entity_decoder($title);
     }
     if ($description) {
         $description = html_entity_decoder($description);
     }
     $html = '';
     if ($image) {
         $html .= $image;
     }
     if ($show_apply) {
         $apply_button = '<a href="#" onclick="submitbutton( \'apply\' );" title="' . JText::_('Apply') . '"><img align="right" border="0" alt="' . JText::_('Apply') . '" src="images/tick.png"/></a>';
         $html .= $apply_button;
     }
     if ($toggle && $description) {
         $el = 'document.getElementById( \'' . $control_name . $name . 'description\' )';
         $onclick = 'if( this.innerHTML == \'' . JText::_(JText::_('Show') . ' ' . $title) . '\' ){' . $el . '.style.display = \'block\';' . 'this.innerHTML = \'' . JText::_(JText::_('Hide') . ' ' . $title) . '\';' . '}else{' . $el . '.style.display = \'none\';' . 'this.innerHTML = \'' . JText::_(JText::_('Show') . ' ' . $title) . '\';' . '}' . 'this.blur();return false;';
         $html .= '<div class="button2-left" style="margin:0px 0px 5px 0px;"><div class="blank"><a href="javascript://;" onclick="' . $onclick . '">' . JText::_(JText::_('Show') . ' ' . $title) . '</a></div></div>' . "\n";
         $html .= '<br clear="all" />';
         $html .= '<div id="' . $control_name . $name . 'description" style="display:none;">';
     } else {
         if ($title) {
             if ($blocktype != 'fieldset') {
                 $html .= '<h4 style="margin: 0px;">' . $title . '</h4>';
             }
         }
     }
     if ($description && !$tooltip) {
         $html .= $description;
     }
     if ($help) {
         $html .= '<p>' . $help . '</p>';
     }
     if ($toggle && $description) {
         $html .= '</div>';
     }
     if ($message_type) {
         $html = '<dl id="system-message"><dd class="' . $message_type . '"><ul><li>' . html_entity_decoder($html) . '</li></ul></dd></dl>';
     } else {
         if ($blocktype != 'fieldset') {
             $html = '<div class="panel"><div style="padding: 2px 5px;">' . $html . '<div style="clear: both;"></div>';
         }
         if ($start) {
             $document->addScript(JURI::root(true) . $file_root . '/script.js');
             if ($blocktype == 'fieldset') {
                 if ($description && $tooltip) {
                     $title = '<span class="hasTip" title="' . $title . '::' . $description . '">' . $title . '</span>';
                 }
                 $html = '<fieldset class="adminform"><legend>' . $title . '</legend>' . $html;
             }
             $html .= '<table width="100%" class="paramlist admintable" cellspacing="1">';
             $html .= '<tr><td colspan="2">';
             $random = rand(1000, 10000);
             $html .= '<div id="end-' . $random . '"></div><script>NoNumberElementsHideTD( "end-' . $random . '" );</script>';
         } else {
             $html .= '</div></div>';
         }
     }
     if ($msg) {
         $html = $msg . $html;
     }
     return $html;
 }
Example #10
0
 function getInput($name, $id, $value, $params, $children, $j15 = 0)
 {
     $this->params = $params;
     $document =& JFactory::getDocument();
     $document->addStyleSheet(JURI::root(true) . '/plugins/system/nonumberelements/css/style.css');
     $title = $this->def('label');
     $description = $this->def('description');
     $xml = $this->def('xml');
     $lang_file = $this->def('language_file');
     $image = $this->def('image');
     $image_w = $this->def('image_w');
     $image_h = $this->def('image_h');
     $url = $this->def('url');
     $help_url = $this->def('help_url');
     if ($description) {
         // variables
         $v1 = $this->def('var1');
         $v2 = $this->def('var2');
         $v3 = $this->def('var3');
         $v4 = $this->def('var4');
         $v5 = $this->def('var5');
         $description = html_entity_decoder(trim(JText::sprintf($description, $v1, $v2, $v3, $v4, $v5)));
     }
     if ($lang_file) {
         jimport('joomla.filesystem.file');
         // Include extra language file
         $language =& JFactory::getLanguage();
         $lang = str_replace('_', '-', $language->getTag());
         $inc = '';
         $lang_path = 'language' . DS . $lang . DS . $lang . '.' . $lang_file . '.inc.php';
         if (JFile::exists(JPATH_ADMINISTRATOR . DS . $lang_path)) {
             $inc = JPATH_ADMINISTRATOR . DS . $lang_path;
         } else {
             if (JFile::exists(JPATH_SITE . DS . $lang_path)) {
                 $inc = JPATH_SITE . DS . $lang_path;
             }
         }
         if (!$inc && $lang != 'en-GB') {
             $lang = 'en-GB';
             $lang_path = 'language' . DS . $lang . DS . $lang . '.' . $lang_file . '.inc.php';
             if (JFile::exists(JPATH_ADMINISTRATOR . DS . $lang_path)) {
                 $inc = JPATH_ADMINISTRATOR . DS . $lang_path;
             } else {
                 if (JFile::exists(JPATH_SITE . DS . $lang_path)) {
                     $inc = JPATH_SITE . DS . $lang_path;
                 }
             }
         }
         if ($inc) {
             include $inc;
         }
     }
     if ($title) {
         $title = JText::_($title);
     }
     if ($description) {
         $description = str_replace('span style="font-family:monospace;"', 'span class="nn_code"', $description);
         if ($description['0'] != '<') {
             $description = '<p>' . $description . '</p>';
         }
     }
     if ($xml) {
         $xml = JApplicationHelper::parseXMLInstallFile(JPATH_SITE . DS . str_replace('/', DS, $xml));
         $version = 0;
         if ($xml && isset($xml['version'])) {
             $version = $xml['version'];
         }
         if ($version) {
             if ($title) {
                 $title .= ' v' . $version;
             } else {
                 $title = JText::_('Version') . ' ' . $version;
             }
         }
     }
     if ($url) {
         $url = '<a href="' . $url . '" target="_blank" title="' . $title . '">';
     }
     $html = array();
     $html[] = '<div class="panel nn_panel' . ($j15 ? ' nn_panel_15' : '') . '"><div class="nn_block nn_title">';
     if ($image) {
         $image = str_replace('/', "\n", str_replace('\\', '/', $image));
         $image = explode("\n", trim($image));
         if ($image['0'] == 'administrator') {
             $image['0'] = JURI::base(true);
         } else {
             $image['0'] = JURI::root(true) . '/' . $image['0'];
         }
         $image = '<img src="' . implode('/', $image) . '" border="0" style="float:right;margin-left:10px" alt=""';
         if ($image_w) {
             $image .= ' width="' . $image_w . '"';
         }
         if ($image_h) {
             $image .= ' height="' . $image_h . '"';
         }
         $image .= ' />';
         if ($url) {
             $image = $url . $image . '</a>';
         }
         $html[] = $image;
     }
     if ($title) {
         if ($url) {
             $title = $url . $title . '</a>';
         }
         $html[] = '<h4 style="margin: 0px;">' . html_entity_decoder($title) . '</h4>';
     }
     if ($description) {
         $html[] = $description;
     }
     if ($help_url) {
         $html[] = '<p><a href="' . $help_url . '" target="_blank" title="' . JText::_('NN_MORE_INFO') . '">' . JText::_('NN_MORE_INFO') . '...</a></p>';
     }
     $html[] = '<div style="clear: both;"></div>';
     $html[] = '</div></div>';
     return implode($html);
 }