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 8604 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 8604 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
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; } }