public function process($pParams)
 {
     extract($pParams);
     if (!isset($name)) {
         throw new CopixTemplateTagException('[AutoComplete] Required parameter name');
     }
     if (!isset($field)) {
         $field = $name;
     }
     if (!isset($id)) {
         $id = $name;
     }
     if (!isset($value)) {
         $value = "";
     }
     if (!isset($onSelect)) {
         $onSelect = "";
     }
     if (!isset($onRequest)) {
         $onRequest = '';
     }
     if (!isset($extra)) {
         $extra = '';
     }
     if (!isset($pParams['datasource'])) {
         $pParams['datasource'] = 'dao';
     }
     $toMaj = '';
     $onSelectTemp = '';
     if (isset($maj)) {
         $onSelectTemp .= "eleme.selected.id = 'selector_autocomplete';";
         foreach ($maj as $key => $field) {
             $onSelectTemp .= "\n                        \$\$('#selector_autocomplete .{$key}').each (function (el) {\n                            \$('{$field}').value = el.innerHTML;\n                        });\n                    ";
             $toMaj .= $key . ';';
         }
     }
     $onSelect = $onSelectTemp . $onSelect;
     $url = 'generictools|ajax|getAutoComplete';
     if (isset($pParams['url'])) {
         $url = $pParams['url'];
     }
     $length = isset($length) ? $length : 1;
     $pParams['view'] = isset($pParams['view']) ? $pParams['view'] : $field;
     $tab = array();
     foreach ($pParams as $key => $param) {
         $tab[$key] = $param;
     }
     $tab['nb'] = 10;
     $tab['tomaj'] = $toMaj;
     $js = new CopixJSWidget();
     $js->tag_autocomplete($id, $name, $length, $tab, _url($url), $js->function_(null, 'el', $onRequest), $js->function_(null, 'el,eleme,element', $onSelect));
     CopixHTMLHeader::addJSDOMReadyCode($js);
     CopixHTMLHeader::addJSLink(_resource('js/taglib/tag_autocomplete.js'));
     _eTag("mootools", array('plugin' => "observer;autocompleter"));
     $toReturn = '<input type="text" id="' . $name . '" name="' . $name . '" value="' . $value . '" ' . $extra . ' /><span id="autocompleteload_' . $name . '"><img src="' . CopixUrl::getResource('img/tools/load.gif') . '" /></span>';
     return $toReturn;
 }
_etag('i18n', 'install.database.test');
?>
" />
<?php 
if ($ppo->valid) {
    ?>
<input type="submit" id="record" name="btn"
    value="<?php 
    _etag('i18n', 'install.database.save');
    ?>
" />
<?php 
}
?>
</form>
<a href="<?php 
echo CopixURL::get("admin||");
?>
"> <input type="button" value="<?php 
_eTag('i18n', "copix:common.buttons.back");
?>
" /></a>

<?php 
_etag('copixtips', array('warning' => $ppo->importantTips, 'tips' => $ppo->tips, 'titlei18n' => 'install.tips.title'));
?>

<?php 
_eTag('mootools');
$jsCode = "\n\nwindow.addEvent('domready', function () {\n    \$\$('.bdd input,.bdd select').each(function (el) {\n        el.addEvent('change',function () {\n            \$('record').setStyle('display','none');\n        });\n    });\n});\n\n";
CopixHTMLHeader::addJSCode($jsCode);
Ejemplo n.º 3
0
<form action="<?php 
echo _url('log|show');
?>
" method="POST">
<?php 
_eTag('select', array('values' => $ppo->profils, 'name' => 'profile', 'selected' => $ppo->profil));
?>
&nbsp;
<br/>
<?php 
// Input du nombre d'élements à afficher
echo _i18n('logs.show.nblines');
echo '&nbsp;';
_eTag('inputtext', array('value' => $ppo->nbitems, 'name' => 'nbitems', 'size' => 3));
?>
&nbsp;
<input type="submit" value="<?php 
echo _i18n('copix:common.buttons.show');
?>
" />
</form>

<br />
<?php 
if (isset($ppo->profil)) {
    echo CopixZone::process('ShowLog', array('profil' => $ppo->profil, 'nbitems' => $ppo->nbitems));
}
?>

<br />
<a href="<?php