diff --git a/themes/blueprint/templates/record/sms.phtml b/themes/blueprint/templates/record/sms.phtml index b97407834b1a83eded7cc08e1684386e58a866c0..683c2c06cc87919289f2ca7339d1df9afd291fd3 100644 --- a/themes/blueprint/templates/record/sms.phtml +++ b/themes/blueprint/templates/record/sms.phtml @@ -16,13 +16,18 @@ onblur="if (this.value=='') this.value='<?=$this->transEsc('sms_phone_number')?>'" class="<?=$this->jqueryValidation(array('required'=>'This field is required', 'phoneUS'=>'Invalid phone number.'))?>"/> <br/> - <label class="span-2" for="sms_provider"><?=$this->transEsc('Provider')?>:</label> - <select id="sms_provider" name="provider" class="<?=$this->jqueryValidation(array('required'=>'This field is required'))?>"> - <option selected="selected" value=""><?=$this->transEsc('Select your carrier')?></option> - <? foreach ($this->carriers as $val => $details): ?> - <option<?=(isset($this->provider) && $val == $this->provider) ? ' selected="selected"' : ''?> value="<?=$this->escapeHtml($val)?>"><?=$this->escapeHtml($details['name'])?></option> - <? endforeach; ?> - </select> - <br/> + <? if (is_array($this->carriers) && count($this->carriers) > 1): ?> + <label class="span-2" for="sms_provider"><?=$this->transEsc('Provider')?>:</label> + <select id="sms_provider" name="provider" class="<?=$this->jqueryValidation(array('required'=>'This field is required'))?>"> + <option selected="selected" value=""><?=$this->transEsc('Select your carrier')?></option> + <? foreach ($this->carriers as $val => $details): ?> + <option<?=(isset($this->provider) && $val == $this->provider) ? ' selected="selected"' : ''?> value="<?=$this->escapeHtml($val)?>"><?=$this->escapeHtml($details['name'])?></option> + <? endforeach; ?> + </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')?>"/> </form> diff --git a/themes/jquerymobile/templates/record/sms.phtml b/themes/jquerymobile/templates/record/sms.phtml index bfba21bbe73f7c13fae56cfc81e2cf4fd95ea6c8..057059afc26911d742bd83af81f4936839fbb608 100644 --- a/themes/jquerymobile/templates/record/sms.phtml +++ b/themes/jquerymobile/templates/record/sms.phtml @@ -12,13 +12,18 @@ <div data-role="fieldcontain"> <label for="sms_to"><?=$this->transEsc('Number')?>:</label> <input id="sms_to" type="text" name="to" value="<?=isset($this->to) ? $this->to : ''?>" /> - <label for="sms_provider"><?=$this->transEsc('Provider')?>:</label> - <select id="sms_provider" name="provider" class="<?=$this->jqueryValidation(array('required'=>'This field is required'))?>"> - <option selected="selected" value=""><?=$this->transEsc('Select your carrier')?></option> - <? foreach ($this->carriers as $val => $details): ?> - <option<?=(isset($this->provider) && $val == $this->provider) ? ' selected="selected"' : ''?> value="<?=$this->escapeHtml($val)?>"><?=$this->escapeHtml($details['name'])?></option> - <? endforeach; ?> - </select> + <? if (is_array($this->carriers) && count($this->carriers) > 1): ?> + <label for="sms_provider"><?=$this->transEsc('Provider')?>:</label> + <select id="sms_provider" name="provider" class="<?=$this->jqueryValidation(array('required'=>'This field is required'))?>"> + <option selected="selected" value=""><?=$this->transEsc('Select your carrier')?></option> + <? foreach ($this->carriers as $val => $details): ?> + <option<?=(isset($this->provider) && $val == $this->provider) ? ' selected="selected"' : ''?> value="<?=$this->escapeHtml($val)?>"><?=$this->escapeHtml($details['name'])?></option> + <? 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 data-role="fieldcontain"> <input class="button" type="submit" name="submit" value="<?=$this->transEsc('Send')?>"/>