Gallery 2
Apache/2.0.59
PHP/4.4.5
Carbon Theme
Hi,
Now when a user selects the "Search" button (without entering first a text to search), the system shows a text displaying a msg, but I'd prefer to show for example an alert window.
Searching the Gallery code I've found the SearchBlock.tpl code but I don't know how to use it for example in the SearchShowAll code. At the moment the code I've got is:
<input type="text" size="35"
name="<?php echo $this->_reg_objects['g'][0]->formVar(array('var' => "form[searchCriteria]"), $this);?>
" value="<?php echo $this->_tpl_vars['form']['searchCriteria']; ?>
"/>
<script type="text/javascript">
document.getElementById('SearchShowAll')['<?php echo $this->_reg_objects['g'][0]->formVar(array('var' => "form[searchCriteria]"), $this);?>
'].focus();
</script></td>
<td align="left" valign="middle">
<input type="hidden"
name="<?php echo $this->_reg_objects['g'][0]->formVar(array('var' => "form[lastSearchCriteria]"), $this);?>
" value="<?php echo $this->_tpl_vars['form']['searchCriteria']; ?>
"/>
<input type="submit" class="inputTypeSubmit"
name="<?php echo $this->_reg_objects['g'][0]->formVar(array('var' => "form[action][search]"), $this);?>
" value="<?php echo $this->_reg_objects['g'][0]->text(array('text' => 'Search'), $this);?>
"/></td>
<td colspan="2">
<?php if (isset ( $this->_tpl_vars['form']['error']['searchCriteria']['missing'] )): ?>
<?php echo $this->_reg_objects['g'][0]->text(array('text' => "You must enter some text to search for!"), $this);?>
<?php endif; ?>
<?php $_from = $this->_tpl_vars['SearchShowAll']['moduleInfo']['options']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
foreach ($_from as $this->_tpl_vars['optionId'] => $this->_tpl_vars['optionInfo']):
?>
<input type="checkbox" id="cb_<?php echo $this->_tpl_vars['moduleId']; ?>
_<?php echo $this->_tpl_vars['optionId']; ?>
"
name="<?php echo $this->_reg_objects['g'][0]->formVar(array('var' => "form[options][".($this->_tpl_vars['SearchShowAll']['moduleId'])."][".($this->_tpl_vars['optionId'])."]"), $this);?>
"
<?php if (isset ( $this->_tpl_vars['form']['options'][$this->_tpl_vars['SearchShowAll']['moduleId']][$this->_tpl_vars['optionId']] )): ?>checked="checked"<?php endif; ?>/>
<?php endforeach; endif; unset($_from); ?>
Thanks.