/** * Function to get field params * * @param object $params */ public static function getFieldAttributes($params) { $output = ''; if (!empty($params->attr)) { foreach ($params->attr as $key => $value) { $output .= __($key) . ':<br />'; $output .= htmlGmp::text('params[attr][' . $key . ']', array('value' => $value)) . '<br />'; } } else { $output .= __('class', GMP_LANG_CODE) . ':<br />'; $output .= htmlGmp::text('params[attr][class]', array('value' => '')) . '<br />'; $output .= __('id', GMP_LANG_CODE) . ':<br />'; $output .= htmlGmp::text('params[attr][id]', array('value' => '')) . '<br />'; } return $output; }
</label>:</td><td><?php echo htmlGmp::text('email', array('attrs' => 'placeholder="' . langGmp::_('*****@*****.**') . '"')); ?> </td></tr> <tr><td valign="top"><label for="website"><?php langGmp::_e('Website'); ?> </label>:</td><td><?php echo htmlGmp::text('website', array('attrs' => 'placeholder="' . langGmp::_('http://yoursite.com') . '"')); ?> </td></tr> <tr><td valign="top"><label for="subject"><?php langGmp::_e('Subject'); ?> </label>:</td><td><?php echo htmlGmp::text('subject', array('attrs' => 'placeholder="' . langGmp::_('Subject') . '"')); ?> </td></tr> <tr><td valign="top"><label for="category"><?php langGmp::_e('Category'); ?> </label>:</td><td><?php echo htmlGmp::selectbox('category', array('optionsGmp' => $this->devQuestions)); ?> </td></tr> <tr><td valign="top"><label for="message"><?php langGmp::_e('Message'); ?> </label>:</td><td><?php echo htmlGmp::textarea('message', array('attrs' => 'placeholder="' . langGmp::_('Type your meassage here. If you have any troubles, please describe it accurately. If it`s possibe send us: (text of the errors, print screen of errors, link to the webpages where you try to insert products, and any other information)') . '"')); ?>
?> <label><?php echo htmlGmp::radiobutton('where_find_us', array('value' => $askId)); ?> <?php echo $askOpt['label']; ?> </label> <?php if ($askId == 4) { ?> <label id="toeFindUsUrlShell" style="display: none;"><?php _e('Please, post url', GMP_LANG_CODE); ?> : <?php echo htmlGmp::text('find_on_web_url'); ?> </label> <?php } elseif ($askId == 5) { ?> <label style="display: none;" id="toeOtherWayTextShell"><?php echo htmlGmp::textarea('other_way_desc'); ?> </label> <?php } ?> <?php } ?>
_e('Image width (in px)', GMP_LANG_CODE); ?> :</label> <?php echo htmlGmp::text($this->widget->get_field_name('img_width'), array('attrs' => 'id="' . $this->widget->get_field_id('img_width') . '"', 'value' => $this->data['img_width'])); ?> <br /> <label for="<?php echo $this->widget->get_field_id('img_height'); ?> "><?php _e('Image height (in px)', GMP_LANG_CODE); ?> :</label> <?php echo htmlGmp::text($this->widget->get_field_name('img_height'), array('attrs' => 'id="' . $this->widget->get_field_id('img_height') . '"', 'value' => $this->data['img_height'])); ?> <br /> </div> <script type="text/javascript"> // <!-- jQuery(function(){ function checkOpenImgParams() { if(jQuery('#<?php echo $this->widget->get_field_id('display_as_img'); ?> ').attr('checked')) { jQuery('#<?php echo $this->widget->get_field_id('img_params_shell'); ?> ').show();
<div class="shortcode-wrap"> <p id="shortcodeCode" style="display: none;"> <strong style="margin-top: 7px; font-size: 1.2em; float: left;"><?php _e('Map shortcode', GMP_LANG_CODE); ?> :</strong> <?php echo htmlGmp::text('gmpCopyTextCode', array('value' => '', 'attrs' => 'class="gmpCopyTextCode gmpMapShortCodeShell" style="float: right;"')); ?> <br style="clear: both;" /> <strong style="margin-top: 7px; font-size: 1.2em; float: left;"><?php _e('PHP code', GMP_LANG_CODE); ?> :</strong> <?php echo htmlGmp::text('gmpCopyTextCode', array('value' => '', 'attrs' => 'class="gmpCopyTextCode gmpMapPhpShortCodeShell" style="float: right;"')); ?> <br style="clear: both;" /> </p> <p id="shortcodeNotice" style="display: none;"><?php _e('Shortcode will appear after you save map.', GMP_LANG_CODE); ?> </p> </div> <div style="clear: both;"></div> </div> <div id="gmpMapMainBtns" class="row"> <div class="sup-col sup-w-50"> <button id="gmpMapSaveBtn" class="button button-primary" style="width: 100%;"> <i class="fa dashicons-before dashicons-admin-site"></i> <?php
/** * Function to process field params */ public function processParams($tag, $id) { return ''; if ($this->name == "params") { if (is_array($this->value) || is_object($this->value)) { $params = $this->value; } else { $params = json_decode($this->value); } $add_option = ''; switch ($tag) { case 5: $add_option = __('Add Checkbox', GMP_LANG_CODE); $options_tag = ''; $image_tag = ' style="display:none"'; break; case 9: $add_option = __('Add Item', GMP_LANG_CODE); $options_tag = ''; $image_tag = ' style="display:none"'; break; case 12: $add_option = __('Add Item', GMP_LANG_CODE); $options_tag = ''; $image_tag = ' style="display:none"'; break; case 10: $options_tag = ''; $add_option = __('Add Radio Button', GMP_LANG_CODE); $image_tag = ' style="display:none"'; break; case 8: $image_tag = ''; $options_tag = ' style="display:none"'; break; default: $options_tag = ' style="display:none"'; $image_tag = ' style="display:none"'; break; } if ($tag > 0 || $id == 0) { $output .= '<div class="options options_tag"' . $options_tag . '>'; $output .= '<span class="add_option">' . $add_option . '</span>'; $output .= fieldAdapterGmp::_($id, 'getExtraFieldOptions', fieldAdapterGmp::STR); $output .= '</div>'; $output .= '<div class="options image_tag"' . $image_tag . '>' . __('Dimensions', GMP_LANG_CODE) . ':<br />'; $params->width ? $width = $params->width : ''; $params->height ? $height = $params->height : ''; $output .= __('width', GMP_LANG_CODE) . ':<br />'; $output .= htmlGmp::text('params[width]', array('value' => $width)) . '<br />'; $output .= __('height', GMP_LANG_CODE) . ':<br />'; $output .= htmlGmp::text('params[height]', array('value' => $height)) . '<br />'; $output .= '</div>'; } if ($this->adapt['htmlParams']) { $output .= fieldAdapterGmp::_($this, $this->adapt['htmlParams'], fieldAdapterGmp::STR); } else { $output .= '<a href="javascript:void(0);" class="set_properties">' . __('Click to set field "id" and "class"', GMP_LANG_CODE) . '</a>'; $output .= '<div class="attributes" style="display:none;">' . __('Attributes', GMP_LANG_CODE) . ':<br />'; $output .= fieldAdapterGmp::_($params, 'getFieldAttributes', fieldAdapterGmp::STR); $output .= '</div>'; } return $output; } }
<div class="gmpFormElemCon"> <?php echo htmlGmp::text('map_opts[infowindow_width]', array('attrs' => 'class="gmpInputSmall gmpMapInfoWindowWidthOpt gmpHintElem" id="gmpNewMap_Infowindow_width"', 'hint' => langGmp::_('InfoWindow Width'), 'value' => '200')); ?> </div> <label for="gmpNewMap_Infowindow_width" class="gmpFormLabel"> <?php langGmp::_e('InfoWindow Width'); ?> </label> </div> <div class="gmpFormRow"> <div class="gmpFormElemCon"> <?php echo htmlGmp::text('map_opts[infowindow_height]', array('attrs' => 'class="gmpInputSmall gmpMapInfoWindowHeightOpt gmpHintElem" id="gmpNewMap_Infowindow_height"', 'hint' => langGmp::_('InfoWindow Height'), 'value' => '100')); ?> </div> <label for="gmpNewMap_Infowindow_height" class="gmpFormLabel"> <?php langGmp::_e('InfoWindow Height'); ?> </label> </div> </div> <?php dispatcherGmp::doAction('editMapFormEnd'); ?> <?php echo htmlGmp::hidden('map_opts[id]');
echo langGmp::_('Lat.'); ?> <div class="gmpFormElemCon"> <?php echo htmlGmp::text('marker_opts[coord_y]', array('attrs' => 'class="gmpInputSmall gmpMarkerCoordYOpt gmpHintElem" id="gmp_marker_coord_y"', 'hint' => 'Coordinate Y(Latitude)')); ?> </div> </div> <br /> <div> <?php echo langGmp::_('Lng.'); ?> <div class="gmpFormElemCon"> <?php echo htmlGmp::text('marker_opts[coord_x]', array('attrs' => 'class="gmpInputSmall gmpMarkerCoordXOpt gmpHintElem" id="gmp_marker_coord_x"', 'hint' => 'Coordinate X (Longitude)')); ?> </div> </div> </div> <div class="gmpFormRow"> <label for="marker_opts[params][more_info_link]"><?php langGmp::_e('Add "More info" in description window'); ?> </label> <div class="gmpFormElemCon"> <?php echo htmlGmp::checkboxHiddenVal('marker_opts[params][more_info_link]', array('attrs' => 'class="gmpHintElem"', 'hint' => langGmp::_('If enabled - in description window by default will be only image or part of description, and added "More Info" link, when click on it - there will be full descrtiption'))); ?> </div> </div>
public static function textFieldsDynamicTable($name, $params = array('value' => '', 'attrs' => '', 'options' => array())) { $res = ''; if (empty($params['options'])) { $params['options'] = array(0 => array('label' => '')); } if (!empty($params['options'])) { $pattern = array(); foreach ($params['options'] as $key => $p) { $pattern[$key] = htmlGmp::text($name . '[][' . $key . ']'); } $countOptions = count($params['options']); $remove = '<a href="#" onclick="toeRemoveTextFieldsDynamicTable(this); return false;">remove</a>'; $add = '<a href="#" onclick="toeAddTextFieldsDynamicTable(this, ' . $countOptions . '); return false;">add</a>'; $res = '<div class="toeTextFieldsDynamicTable">'; if (empty($params['value'])) { $params['value'] = array(); } elseif (!is_array($params['value'])) { $params['value'] = utilsGmp::jsonDecode($params['value']); //$params['value'] = $params['value'][0]; } $i = 0; do { $res .= '<div class="toeTextFieldDynamicRow">'; foreach ($params['options'] as $key => $p) { switch ($countOptions) { case 1: if (isset($params['value'][$i])) { $value = is_array($params['value'][$i]) ? $params['value'][$i][$key] : $params['value'][$i]; } else { $value = ''; } break; case 2: default: $value = isset($params['value'][$i][$key]) ? $params['value'][$i][$key] : ''; break; } $paramsForText = array('value' => $value); $res .= __($p['label']) . htmlGmp::text($name . '[' . $i . '][' . $key . ']', $paramsForText); } $res .= $remove . '</div>'; $i++; } while ($i < count($params['value'])); $res .= $add; $res .= '</div>'; } return $res; }
?> </a> <form id="gmpMgrForm"> <table class="form-table"> <tr> <th scope="row"> <label for="marker_group_title"> <?php _e('Marker Category', GMP_LANG_CODE); ?> : </label> </th> <td> <?php echo htmlGmp::text('marker_group[title]', array('value' => $this->editMarkerGroup ? $this->marker_group['title'] : '', 'attrs' => 'style="width: 60%;" id="marker_group_title"', 'required' => true)); ?> <button class="button" id="gmpMgrSaveBtn"> <i class="fa fa-save"></i> <?php _e('Save', GMP_LANG_CODE); ?> </button> </td> </tr> </table> <?php echo htmlGmp::hidden('mod', array('value' => 'marker_groups')); ?> <?php echo htmlGmp::hidden('action', array('value' => 'save'));