Skip to content
Snippets Groups Projects
Commit aac271d3 authored by Demian Katz's avatar Demian Katz
Browse files

Hide SMS provider dialog when only one option is present.

parent 624506a9
No related merge requests found
...@@ -16,13 +16,18 @@ ...@@ -16,13 +16,18 @@
onblur="if (this.value=='') this.value='<?=$this->transEsc('sms_phone_number')?>'" onblur="if (this.value=='') this.value='<?=$this->transEsc('sms_phone_number')?>'"
class="<?=$this->jqueryValidation(array('required'=>'This field is required', 'phoneUS'=>'Invalid phone number.'))?>"/> class="<?=$this->jqueryValidation(array('required'=>'This field is required', 'phoneUS'=>'Invalid phone number.'))?>"/>
<br/> <br/>
<label class="span-2" for="sms_provider"><?=$this->transEsc('Provider')?>:</label> <? if (is_array($this->carriers) && count($this->carriers) > 1): ?>
<select id="sms_provider" name="provider" class="<?=$this->jqueryValidation(array('required'=>'This field is required'))?>"> <label class="span-2" for="sms_provider"><?=$this->transEsc('Provider')?>:</label>
<option selected="selected" value=""><?=$this->transEsc('Select your carrier')?></option> <select id="sms_provider" name="provider" class="<?=$this->jqueryValidation(array('required'=>'This field is required'))?>">
<? foreach ($this->carriers as $val => $details): ?> <option selected="selected" value=""><?=$this->transEsc('Select your carrier')?></option>
<option<?=(isset($this->provider) && $val == $this->provider) ? ' selected="selected"' : ''?> value="<?=$this->escapeHtml($val)?>"><?=$this->escapeHtml($details['name'])?></option> <? foreach ($this->carriers as $val => $details): ?>
<? endforeach; ?> <option<?=(isset($this->provider) && $val == $this->provider) ? ' selected="selected"' : ''?> value="<?=$this->escapeHtml($val)?>"><?=$this->escapeHtml($details['name'])?></option>
</select> <? endforeach; ?>
<br/> </select>
<br/>
<? else: ?>
<? $keys = is_array($this->carriers) ? array_keys($this->carriers) : array(); ?>
<input type="hidden" name="provider" value="<?=isset($keys[0]) ? $keys[0] : ''?>" />
<? endif; ?>
<input class="button" type="submit" name="submit" value="<?=$this->transEsc('Send')?>"/> <input class="button" type="submit" name="submit" value="<?=$this->transEsc('Send')?>"/>
</form> </form>
...@@ -12,13 +12,18 @@ ...@@ -12,13 +12,18 @@
<div data-role="fieldcontain"> <div data-role="fieldcontain">
<label for="sms_to"><?=$this->transEsc('Number')?>:</label> <label for="sms_to"><?=$this->transEsc('Number')?>:</label>
<input id="sms_to" type="text" name="to" value="<?=isset($this->to) ? $this->to : ''?>" /> <input id="sms_to" type="text" name="to" value="<?=isset($this->to) ? $this->to : ''?>" />
<label for="sms_provider"><?=$this->transEsc('Provider')?>:</label> <? if (is_array($this->carriers) && count($this->carriers) > 1): ?>
<select id="sms_provider" name="provider" class="<?=$this->jqueryValidation(array('required'=>'This field is required'))?>"> <label for="sms_provider"><?=$this->transEsc('Provider')?>:</label>
<option selected="selected" value=""><?=$this->transEsc('Select your carrier')?></option> <select id="sms_provider" name="provider" class="<?=$this->jqueryValidation(array('required'=>'This field is required'))?>">
<? foreach ($this->carriers as $val => $details): ?> <option selected="selected" value=""><?=$this->transEsc('Select your carrier')?></option>
<option<?=(isset($this->provider) && $val == $this->provider) ? ' selected="selected"' : ''?> value="<?=$this->escapeHtml($val)?>"><?=$this->escapeHtml($details['name'])?></option> <? foreach ($this->carriers as $val => $details): ?>
<? endforeach; ?> <option<?=(isset($this->provider) && $val == $this->provider) ? ' selected="selected"' : ''?> value="<?=$this->escapeHtml($val)?>"><?=$this->escapeHtml($details['name'])?></option>
</select> <? endforeach; ?>
</select>
<? else: ?>
<? $keys = is_array($this->carriers) ? array_keys($this->carriers) : array(); ?>
<input type="hidden" name="provider" value="<?=isset($keys[0]) ? $keys[0] : ''?>" />
<? endif; ?>
</div> </div>
<div data-role="fieldcontain"> <div data-role="fieldcontain">
<input class="button" type="submit" name="submit" value="<?=$this->transEsc('Send')?>"/> <input class="button" type="submit" name="submit" value="<?=$this->transEsc('Send')?>"/>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment