Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/script-loader.php on line 757
Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/script-loader.php on line 757
Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/script-loader.php on line 758
Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/script-loader.php on line 758
Notice: require(): read of 12700 bytes failed with errno=12 Cannot allocate memory in /var/www/html/ticnews.com.br/web/wp-content/plugins/google-maps-easy/functions.php on line 44
Notice: require(): read of 12700 bytes failed with errno=12 Cannot allocate memory in /var/www/html/ticnews.com.br/web/wp-content/plugins/google-maps-easy/functions.php on line 44
=> $v)
$options[$k] = $v;
$method = 'selectbox';
$this->htmlParams['optionsGmp'] = $options;
}
}
$htmlContent = htmlGmp::$method($this->name, $this->htmlParams);
if(!empty($this->errorEl)) {
if(is_bool($this->errorEl))
$errorEl = '';
else //if it is string
$errorEl = $this->errorEl;
$htmlContent .= $errorEl;
}
return $htmlContent;
}
return false;
}
public function displayValue() {
$value = '';
switch($this->html) {
case 'countryList':
$value = fieldAdapterGmp::displayCountry($this->value);
break;
case 'statesList':
$value = fieldAdapterGmp::displayState($this->value);
break;
case 'checkboxlist':
$options = $this->getHtmlParam('optionsGmp');
$value = array();
if(!empty($options) && is_array($options)) {
foreach($options as $opt) {
if(isset($opt['checked']) && $opt['checked']) {
$value[] = $opt['text'];
}
}
}
if(empty($value))
$value = __('N/A', GMP_LANG_CODE);
else
$value = implode(' ', $value);
break;
case 'selectbox': case 'radiobuttons':
$options = $this->getHtmlParam('optionsGmp');
if(!empty($options) && !empty($options[ $this->value ])) {
$value = $options[ $this->value ];
} else {
$value = __('N/A', GMP_LANG_CODE);
}
break;
default:
if ($this->value == '') {
$value = __('N/A', GMP_LANG_CODE);
} else {
if(is_array($this->value)) {
$options = $this->getHtmlParam('optionsGmp');
if(!empty($options) && is_array($options)) {
$valArr = array();
foreach($this->value as $v) {
$valArr[] = $options[$v];
}
$value = recImplode(' ', $valArr);
} else {
$value = recImplode(' ', $this->value);
}
} else
$value = $this->value;
}
break;
}
if($echo)
echo $value;
else
return $value;
}
public function showValue() {
echo $this->displayValue();
}
public function display($tag = 1, $id = 0) {
echo $this->drawHtml($tag, $id);
}
public function addHtmlParam($name, $value) {
$this->htmlParams[$name] = $value;
}
/**
* Alias for addHtmlParam();
*/
public function setHtmlParam($name, $value) {
$this->addHtmlParam($name, $value);
}
public function setHtmlParams($params) {
$this->htmlParams = $params;
}
public function getHtmlParam($name) {
return isset($this->htmlParams[$name]) ? $this->htmlParams[$name] : false;
}
/**
* Function to display userfields in front-end
*
* @param string $name
* @param mixed $fieldValue
* @return string
*/
public function viewField($name, $fieldValue = '') {
$method = $this->html;
$options = frameGmp::_()->getModule('optionsGmp')->getHelper()->getOptions($this->id);
$attrs = '';
if (is_object($this->htmlParams['attr']) && count($this->htmlParams['attr']) > 0) {
foreach ($this->htmlParams['attr'] as $attribute=>$value) {
if ($value != '') {
$attrs .= $attribute.'="'.$value.'" ';
}
}
}
if ($fieldValue == $this->default_value) {
$checked = 1;
} else {
$checked = 0;
}
if ($fieldValue == '') {
$fieldValue = $this->default_value;
}
$params = array('optionsGmp'=>$options, 'attrs' => $attrs, 'value' => $fieldValue, 'checked' => $checked);
$output = '';
if(method_exists('htmlGmp', $method)) {
$output .= htmlGmp::$method($name, $params);
$output .= htmlGmp::hidden('extra_field['.$this->name.']',array('value'=>$this->id));
}
return $output;
}
/**
* 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 .= '
';
$method = $configOptions[$key]['type'];
$name = 'params['.$i.']['.$key.']';
$options = array();
// if the values attribute is set
if ($configOptions[$key]['values'] != ''){
$extract_options = explode(',', $configOptions[$key]['values']);
if (count($extract_options) > 1) {
foreach ($extract_options as $item=>$string) {
if(strpos($string, '=>')) {
$keyVal = array_map('trim', explode('=>', $string));
$options[ $keyVal[0] ] = $keyVal[1];
} else {
$options[$string] = $string;
}
}
} else {
$fieldValue = $configOptions[$key]['default'];
}
// if helper is needed to render the object
} elseif ($configOptions[$key]['helper'] != '') {
$helper_name = $configOptions[$key]['helper'];
// is helper from current module or other?
if ($configOptions[$key]['module'] != '') {
$hmodule = $configOptions[$key]['module'];
} else {
$hmodule = $module;
}
// calling the helper class
$helper = frameGmp::_()->getModule($hmodule)->getHelper();
if ($helper) {
// calling the helper method for current option
if (method_exists($helper, $helper_name))
$options = $helper->$helper_name();
}
}
if (isset($param[$key])) {
$fieldValue = $param[$key];
} else {
if ($fieldValue == '')
$fieldValue = $configOptions[$key]['default'];
}
// filling the parameters to build html element
$htmlParams = array('value'=>$fieldValue,'optionsGmp'=>$options);
if($method == 'checkbox') {
$htmlParams['value'] = 1;
$htmlParams['checked'] = (bool)$fieldValue;
}
if(!empty($configOptions[$key]['htmlParams']) && is_array($configOptions[$key]['htmlParams'])) {
$htmlParams = array_merge($htmlParams, $configOptions[$key]['htmlParams']);
}
// output label and html element
$output .= ' ';
$output .= htmlGmp::$method($name,$htmlParams).' ';
$output .= '
';
}
$i++;
$output .= '
';
}
}
return $output;
}
public function displayConfig($module) {
echo $this->drawConfig($module);
}
/**
* This method will prepare internal value to it's type
* @see $this->type
* @return mixed - prepared value on the basis of $this->type
*/
public function valToType() {
switch($this->type) {
case 'int':
case 'mediumint':
case 'smallint':
$this->value = (int) $this->value;
break;
case 'float':
$this->value = (float) $this->value;
break;
case 'double':
case 'decimal':
$this->value = (double) $this->value;
break;
}
return $this->type;
}
}
Notice: require(): read of 17324 bytes failed with errno=12 Cannot allocate memory in /var/www/html/ticnews.com.br/web/wp-content/plugins/google-maps-easy/functions.php on line 44