/** * Test the getInput method. * * @return void * * @since 12.1 */ public function testGetInput() { $form = new JFormInspector('form1'); $this->assertThat($form->load('<form><field name="color" type="color" disabled="true" onchange="window.reload()" class="inputbox" /></form>'), $this->isTrue(), 'Line:' . __LINE__ . ' XML string should load successfully.'); $field = new JFormFieldColor($form); $this->assertThat($field->setup($form->getXml()->field, 'value'), $this->isTrue(), 'Line:' . __LINE__ . ' The setup method should return true.'); $this->assertThat(strlen($field->input), $this->greaterThan(0), 'Line:' . __LINE__ . ' The getInput method should return something without error.'); }
function displayAll($id, $map, $color) { if (HIKASHOP_J25) { $xmlConf = new SimpleXMLElement('<field name="' . $map . '" type="color" label=""></field>'); JFormHelper::loadFieldClass('color'); $jform = new JForm('hikashop'); $fieldTag = new JFormFieldColor(); $fieldTag->setForm($jform); $fieldTag->setup($xmlConf, $color); return $fieldTag->input; } $code = '<input type="text" name="' . $map . '" id="color' . $id . '" onchange=\'applyColorExample' . $id . '()\' class="inputbox" size="10" value="' . $color . '" />' . ' <input size="10" maxlength="0" style=\'cursor:pointer;background-color:' . $color . '\' onclick="if(document.getElementById(\'colordiv' . $id . '\').style.display == \'block\'){document.getElementById(\'colordiv' . $id . '\').style.display = \'none\';}else{document.getElementById(\'colordiv' . $id . '\').style.display = \'block\';}" id=\'colorexample' . $id . '\' />' . '<div id=\'colordiv' . $id . '\' style=\'display:none;position:absolute;background-color:white;border:1px solid grey;z-index:999\'>' . $this->display($id) . '</div>'; return $code; }
if ($showcolors) { ?> <td class="center inlist"> <?php $color = isset($item->params->color) && $item->params->color ? $color = str_replace('##', '#', $item->params->color) : 'none'; $element = new SimpleXMLElement('<field name="color_' . $i . '" type="color" control="simple" default="" colors="' . (isset($this->config->main_colors) ? $this->config->main_colors : '') . '" split="4" onchange="setColor(\'cb' . $i . '\', this)" />'); $element->value = $color; $colorfield->setup($element, $color); echo $colorfield->__get('input'); ?> </td> <?php } ?> <td class="has-context"> <div class="pull-left"> <?php if ($item->checked_out) { ?> <?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'modules.', $canCheckin); ?> <?php