Jump to content

jodancer

New Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by jodancer

  1. Sorry, I did attach a file but it sems to have disappeared! <?php defined( 'cliff' ) or die( 'Restricted access' );?> <?php class GExtrafieldTextText extends GElement{ public function renderInput($name, $value, &$node, $control_name) { $parameters = & JRegistry::getInstance ($node); $parameters->loadJSON($node); $required = $parameters->get( 'required', 0 ) ; //$size = ($parameters->get('field_size') ? 'size="'.$parameters->get('field_size').'"' : ''); $default_value = $parameters->get( 'default_value', '' ) ; $prefix = $parameters->get( 'prefix_text', '' ) ; $suffix = $parameters->get( 'suffix_text', '' ) ; $required = $required ? ' validate[required]' : ''; $class = 'class="lbinputbox'.$required.$parameters->get('field_class').'"'; // Required to avoid a cycle of encoding & $value = htmlspecialchars(htmlspecialchars_decode($value, ENT_QUOTES), ENT_QUOTES, 'UTF-8'); if($value=="") { $value = $default_value; } $input = ""; $input .= "<span class=\"input\">"; $input .= $prefix; $input .= "</span>"; $input .= '<input type="text" name="'.$control_name.'['.$name.']" id="'.$control_name.$name.'" value="'.$value.'" '.$class.' />'; $input .= "<span class=\"input\">"; $input .= $suffix; $input .= "</span>"; return $input; } function renderValue($data) { $registry = & JRegistry::getInstance ($data->params); $registry->loadJSON($data->params ); $prefix = $registry->get( 'prefix_text_view', '' ) ; $suffix = $registry->get( 'suffix_text_view', '' ) ; // Required to avoid a cycle of encoding & $value = htmlspecialchars(htmlspecialchars_decode($data->actual_value, ENT_QUOTES), ENT_QUOTES, 'UTF-8'); $output = ""; if($prefix!="") { $output .= "<span class=\"input\">"; $output .= $prefix; $output .= "</span>"; } $output .= $value; if($suffix!="") { $output .= "<span class=\"input\">"; $output .= $suffix; $output .= "</span>"; } return $output; } function renderSearchInput($name, $value, &$node, $control_name) { $parameters = & JRegistry::getInstance ($node); $parameters->loadJSON($node); //$size = ($parameters->get('field_size') ? 'size="'.$parameters->get('field_size').'"' : ''); $default_value = $parameters->get( 'default_value', '' ) ; $prefix = $parameters->get( 'prefix_text', '' ) ; $suffix = $parameters->get( 'suffix_text', '' ) ; $class = 'class="lbinputbox'.$parameters->get('field_class').'"'; // Required to avoid a cycle of encoding & $value = htmlspecialchars(htmlspecialchars_decode($value, ENT_QUOTES), ENT_QUOTES, 'UTF-8'); if($value=="") { $value = $default_value; } $input = ""; $input .= "<span class=\"input\">"; $input .= $prefix; $input .= "</span>"; $input .= '<input type="text" name="'.$control_name.'['.$name.']" id="'.$control_name.$name.'" value="'.$value.'" '.$class.' />'; $input .= "<span class=\"input\">"; $input .= $suffix; $input .= "</span>"; return $input; } function beforeStoreInput($extrafield,&$data, $files) { $err_msg = ""; if(!is_null($data)) { if(key_exists($extrafield->fieldcode, $data)) { $registry = & JRegistry::getInstance ($extrafield->id); $registry->loadJSON($extrafield->params ); $required = $registry->get( 'required', 0 ) ; if($required && empty($data[$extrafield->fieldcode])) { $err_msg = JText::_('TEXT_EXTRAFIELD_REQUIRED'); } else { if($data[$extrafield->fieldcode]!="") { $filter = GFilter::factory('string'); $data[$extrafield->fieldcode] = $filter->sanitize($data[$extrafield->fieldcode]); } } } } return $err_msg; } } ?>
  2. Hi, Thanks for the reply. I have a number of fields and these have a title a possible suffix or prefix Example Number of Bedrooms: 4 Double In this case the Number of Bedrooms is the Title of the field 4 is the input value Double is the prefix If the field is not filled in (in this case 4) then I would like Number of bedrooms and Double hidden
  3. I have a text field which I am trying to hide the name, suffix and prefex when the field value is empty. Been trying for I just cannot make it work. (pretty useless I know!) Could anyone take a look and point me in the right direction? many thanks
  4. Thank you so much! Worked perfectly Have a great day
  5. Many hours later and I still can't get it into 3 columns, just one long column :'( Can any of you experts help? Thanks
  6. Thanks! No error now but I only have one column ?
  7. Thank you for the fast reply! It's giving and error and I can't find out why! I'll keep trying
  8. Hi, I'm quite new to this and I'm trying to get this to line up in a table with 3 columns (unlimited rows) I have searched and tried but I'm not having any luck. Can any one help? Thank you <?php echo '<div class="resultados_sub_cat">'; foreach($this->subcats as $key => $subcat) { $subcat->link = JRoute::_('index.php?option=classcliff&view=list&catid='.$subcat->id."&Itemid=".$this->Itemid); if ($key != 0) echo ' - '; echo '<a href="'.$subcat->link.'">'.$subcat->name.'</a>'; } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.