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 .= '
'; $output .= ''.$add_option.''; $output .= fieldAdapterGmp::_($id,'getExtraFieldOptions',fieldAdapterGmp::STR); $output .= '
'; $output .= '
'.__('Dimensions', GMP_LANG_CODE).':
'; $params->width?$width = $params->width:''; $params->height?$height = $params->height:''; $output .= __('width', GMP_LANG_CODE).':
'; $output .= htmlGmp::text('params[width]',array('value'=>$width)).'
'; $output .= __('height', GMP_LANG_CODE).':
'; $output .= htmlGmp::text('params[height]',array('value'=>$height)).'
'; $output .= '
'; } if($this->adapt['htmlParams']) { $output .= fieldAdapterGmp::_($this, $this->adapt['htmlParams'], fieldAdapterGmp::STR); } else { $output .= ''.__('Click to set field "id" and "class"', GMP_LANG_CODE).''; $output .= ''; } return $output; } } /** * Check if the element exists in array * @param array $param */ function checkVarFromParam($param, $element) { return utilsGmp::xmlAttrToStr($param, $element); /*if (isset($param[$element])) { // convert object element to string return (string)$param[$element]; } else { return ''; }*/ } /** * Prepares configuration options * * @param file $xml * @return array $config_params */ public function prepareConfigOptions($xml) { // load xml structure of parameters $config = simplexml_load_file($xml); $config_params = array(); foreach ($config->params->param as $param) { // read the variables $name = $this->checkVarFromParam($param,'name'); $type = $this->checkVarFromParam($param,'type'); $label = $this->checkVarFromParam($param,'label'); $helper = $this->checkVarFromParam($param,'helperGmp'); $module = $this->checkVarFromParam($param,'moduleGmp'); $values = $this->checkVarFromParam($param,'values'); $default = $this->checkVarFromParam($param,'default'); $description = $this->checkVarFromParam($param,'description'); if ($name == '') continue; // fill in the variables to configuration array $config_params[$name] = array('type'=>$type, 'label'=>$label, 'helperGmp'=>$helper, 'moduleGmp'=>$module, 'values'=>$values, 'default'=>$default, 'description'=>$description, ); } return $config_params; } public function setDescription($desc) { $this->description = $desc; } public function getDescription() { return $this->description; } /** * Displays the config options for given module * * @param string $module * @param array $addDefaultOptions - if you want to add some additionsl options - specify it here */ public function drawConfig($module, $additionalOptions = array()) { if(!frameGmp::_()->getModule($module)) return false; // check for xml file with params structure if(frameGmp::_()->getModule($module)->isExternal()) $config_xml = frameGmp::_()->getModule($module)->getModDir(). 'mod.xml'; else $config_xml = GMP_MODULES_DIR.$module.DS.'mod.xml'; if (!file_exists($config_xml)) { // if there is no configuration file for this $module return __('There are no configuration options for this module', GMP_LANG_CODE); } $output = ''; // reading params structure $configOptions = $this->prepareConfigOptions($config_xml); // reading params from database //bugodel2nia.............. if(is_string($this->value)) $params = Utils::jsonDecode($this->value); elseif(is_object($this->value) || is_array($this->value)) $params = toeObjectToArray($this->value); //if (!empty($params)) { if (!empty($configOptions)){ $i = 0; if (empty($params)) { $params = array('0'=>array()); } if(is_array($additionalOptions) && !empty($additionalOptions)) { $configOptions = array_merge($configOptions, $additionalOptions); } foreach ($params as $param) { $output .= '
'; foreach ($configOptions as $key=>$value){ $fieldValue = ''; $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