<link rel="stylesheet" type="text/css" href="/css/jquery.autocomplete.css" /> <?php if ($local) { } else { } foreach ($tags as $tag) { $arr[] = $tag->strip; } ?> <?php $this->startCapture('js'); ?> data = <?php echo json_encode($arr); ?> ; $('#<?php echo $field; ?> ').autocomplete({source: data}); <?php $this->endCapture(); Mtpl::addJSinline($this->getCapture('js'));
<?php Mtpl::addJS('livesearch'); Mtpl::addCSS('livesearch'); Mtpl::addJSinline('$("#chooseTable input").livesearch({autosearch:true,url:"' . ROOT_ADMIN_URL . ROOT_ADMIN_SCRIPT . '?livesearch=1"' . ',minchar:2});', 'ready'); ?> <!DOCTYPE html> <html lang="<?php echo T::getLocale(); ?> "> <head> <meta charset="utf-8" /> <title><?php echo $adminTitle; ?> </title> <link rel="stylesheet" type="text/css" media="screen,print" href="/css/reset-fonts-grids.css" /> <link rel="stylesheet" type="text/css" media="screen,print" href="/css/styleforms.css" /> <link rel="stylesheet" type="text/css" media="screen,print" href="/css/style_admin.css" /> <?php foreach (Mtpl::getCSS() as $css) { echo '<link rel="stylesheet" type="text/css" media="' . $css['media'] . '" href="/css/' . $css['name'] . '.css" />'; } Mtpl::printJS(); ?> <script type="text/javascript"> /*<![CDATA[*/ <?php
public static function outputform(&$form, $template = 'bordered', $addwait = true) { if ($addwait) { $formId = $form->getAttribute('id'); Mtpl::addJSinline(' $("#' . $formId . ' input:submit").click(function() { $(\'<span><img src="images/indicator.gif" />' . __('Loading... Please wait') . '</span>\').prependTo($(this).parent()); }); ', 'ready'); } $options = PEAR::getStaticProperty('M_Office', 'options'); $tpl = Mreg::get('tpl')->instance(); $tpl->assignRef('form', $form); return $tpl->fetch('form-' . $template); }
function toHtml() { $this->_js = ''; if (!defined('HTML_QUICKFORM_ADVANDATE_EXISTS')) { $this->_js .= "\n\n\t\t\t var advandate_Update = function(groupName) {\n\t\t\t\t\t value=\$('select[name=\"'+groupName+'[firstselect]\"]').val();\n\t\t\t\t\t\tfirstD = \$('select[name^=\"'+groupName+'[firstdate]\"]');\n \$(firstD).hide();\n\t\t\t\t\t\tsecD = \$('select[name^=\"'+groupName+'[seconddate]\"]');\n \$(secD).hide();\n\t\t\t\t\t\tnbunits=\$('select[name=\"'+groupName+'[nbunits]\"]');\n \$(nbunits).hide();\n\t\t\t\t\t\tunit=\$('select[name=\"'+groupName+'[unit]\"]');\n \$(unit).hide();\n\t\t\t\t\t\tseparator=\$('#" . $this->_escapeString($this->getName()) . "_dates_separator');\n\t\t\t\t\t\tseparator.hide();\n\t\t\t\t if( value=='is' && \$(\"input[name='created_at[firstselect]']\").val() != 'is' )\n\t\t\t\t {\n today = new Date();\n \$(firstD[0]).val(today.getDate());\n \$(firstD[1]).val(today.getMonth()+1);\n \$(firstD[2]).val(today.getFullYear());\n\t\t\t\t }\n\t\t\t\t\tif(value=='before' || value=='after' || value=='is') {\n \$(firstD).show();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (value=='between'){\n \$(firstD).show();\n \$(secD).show();\n\t\t\t\t\t\t\tseparator.show();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (value=='inthelast'){\n \$(nbunits).show();\n \$(unit).show();\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (value=='lastmonth'){\n\t\t\t\t\t\t\t\t\t// Nothing to show\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}"; define('HTML_QUICKFORM_ADVANDATE_EXISTS', TRUE); } include_once 'HTML/QuickForm/Renderer/Default.php'; $renderer = new HTML_QuickForm_Renderer_Default(); $renderer->setElementTemplate('{element}'); parent::accept($renderer); if (class_exists('Mtpl')) { $script = (empty($this->_js) ? '' : $this->_js) . "\n\$(function(){advandate_Update('" . $this->_escapeString($this->getName()) . "');\n \$('select[name=\"" . $this->_escapeString($this->getName()) . "[firstselect]\"]').bind('change',function(){advandate_Update('" . $this->_escapeString($this->getName()) . "')});\n });"; Mtpl::addJSinline($script); return $renderer->toHtml(); } else { return "<script type=\"text/javascript\">\n//<![CDATA[\n" . (empty($this->_js) ? '' : $this->_js) . "\n\$(function(){advandate_Update('" . $this->_escapeString($this->getName()) . "');\n \$('select[name=\"" . $this->_escapeString($this->getName()) . "[firstselect]\"]').bind('change',function(){advandate_Update('" . $this->_escapeString($this->getName()) . "')});\n });//]]>\n</script>" . $renderer->toHtml(); } }