файл первого cusrom-
StepDescription.php
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('textarea');
/**
* Description of StepTitle
*
* @author admin
*/
class JFormFieldStepDescription extends JFormFieldTextarea {
public $type = 'StepDescription';
function getLabel() {
return parent::getLabel();
}
function getInput() {
$this->name .= '[]';
if (empty($this->value)) {
$this->value = '';
return parent::getInput();
} else {
$arr = array();
$values = $this->value;
$this->value = null;
foreach ($values as $key => $value) {
$this->value = $value;
$arr[] = parent::getInput();
}
return $arr;
}
}
}
второй файл настраиваемого поля-
StepTitle.php
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('text');
/**
* Description of StepTitle
*
* @author admin
*/
class JFormFieldStepTitle extends JFormFieldText {
function getLabel() {
return parent::getLabel();
}
function getInput() {
$this->name .= '[]';
if (empty($this->value)) {
$this->value = '';
return parent::getInput();
} else {
$arr = array();
foreach ($this->value as $key => $value) {
$this->value = $value;
$arr[] = parent::getInput();
}
return $arr;
}
}
}
вот форма, которую я использую
content.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id: login.xml 22059 2011-09-10 05:20:13Z infograf768 $ -->
<form>
<fieldset name="content"
label="Content"
>
<field name="jobname" type="text"
label="Job name"
size="25"
class="inputbox jobname"
required="true"
/>
<field name="projectortip" type="list"
label="Project or Tip"
class="selectbox"
required="true"
>
<option value="">Select</option>
<option value="1">Project</option>
<option value="2">Tip</option>
</field>
<field name="costestimate" type="text"
label="Cost estimate"
size="25"
class="inputbox"
/>
<field name="category" type="list"
label="Category"
class="selectbox"
required="true"
>
<option value="">Select</option>
<option value="1">cat1</option>
<option value="2">cat2</option>
</field>
<field name="timetaken" type="text"
label="Time Taken"
size="25"
class="inputbox"
/>
<field name="comment" type="checkbox"
label="Allow members to make comments"
default = "false"
class="checkbox"
/>
<field name="difficultylevel" type="list"
label="Difficulty Level"
class="selectbox"
required="true"
>
<option value="">Select</option>
<option value="1">easy</option>
<option value="2">medium</option>
<option value="3">hard</option>
</field>
<field name="emailcomment" type="checkbox"
label="Email me all member comments"
default = "false"
class="checkbox"
/>
<field name="metadata" type="textarea"
label="Metadata"
class="textarea"
/>
<field name="background_information" type="textarea"
label="Background Information"
class="textarea"
/>
<field name="tools_used" type="textarea"
label="Tools Used"
class="textarea"
/>
<field name="material_used" type="textarea"
label="Material Used"
class="textarea"
/>
</fieldset>
<fieldset name="step" label="Step" >
<field name="step_title" type="StepTitle"
label="Step Title"
required="true"
class="step_title"
/>
<field name="step_description" type="StepDescription"
label="Step Description"
class="step_description"
required="true"
/>
</fieldset>
<fieldset>
<field name="id" type="hidden" />
<field name="return" type="hidden" />
</fieldset>
</form>
StepTitle - это поле ввода, а StepDescription - это textarea, но и StepTitle, и StepDescription отображаются как поле ввода в форме компонента внешнего интерфейса. И эта проблема не локальная, а только когда я использую эти же файлы на сервере.