/**
  * 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.');
 }
Example #2
0
 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;
 }
Example #3
0
 protected function getLabel()
 {
     if ($this->getInput()) {
         return parent::getLabel();
     }
     return "";
 }
Example #4
0
File: Color.php Project: akeeba/fof
 /**
  * Method to get certain otherwise inaccessible properties from the form field
  * object.
  *
  * @access	public
  * @param	string	$name	The property name for which to the the value.
  *
  *
  * @since	2.0
  *
  * @return	mixed	The property value or null.
  */
 public function __get($name)
 {
     switch ($name) {
         case 'static':
             if (empty($this->static)) {
                 $this->static = $this->getStatic();
             }
             return $this->static;
             break;
         case 'repeatable':
             if (empty($this->repeatable)) {
                 $this->repeatable = $this->getRepeatable();
             }
             return $this->repeatable;
             break;
         default:
             return parent::__get($name);
     }
 }
Example #5
0
require_once JPATH_PLUGINS . '/system/nnframework/helpers/versions.php';
$client = $this->state->get('filter.client_id') ? 'administrator' : 'site';
$user = JFactory::getUser();
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$trashed = $this->state->get('filter.state') == -2 ? true : false;
$canOrder = $user->authorise('core.edit.state', 'com_modules');
$saveOrder = $listOrder == 'ordering';
if ($saveOrder) {
    $saveOrderingUrl = 'index.php?option=com_advancedmodules&task=modules.saveOrderAjax&tmpl=component';
    JHtml::_('sortablelist.sortable', 'moduleList', 'adminForm', strtolower($listDirn), $saveOrderingUrl);
}
$showcolors = $client == 'site' && $this->config->show_color;
if ($showcolors) {
    require_once JPATH_LIBRARIES . '/joomla/form/fields/color.php';
    $colorfield = new JFormFieldColor();
    $script = "\n\t\tfunction setColor(id, el)\n\t\t{\n\t\t\tvar f = document.getElementById('adminForm');\n\t\t\tf.setcolor.value = jQuery(el).val();\n\t\t\tlistItemTask(id, 'modules.setcolor');\n\t\t}\n\t";
    JFactory::getDocument()->addScriptDeclaration($script);
}
$sortFields = $this->getSortFields();
$script = "\n\tJoomla.orderTable = function()\n\t{\n\t\ttable = document.getElementById('sortTable');\n\t\tdirection = document.getElementById('directionTable');\n\t\torder = table.options[table.selectedIndex].value;\n\t\tif (order != '" . $listOrder . "')\n\t\t{\n\t\t\tdirn = 'asc';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdirn = direction.options[direction.selectedIndex].value;\n\t\t}\n\t\tJoomla.tableOrdering(order, dirn, '');\n\t};\n";
JFactory::getDocument()->addScriptDeclaration($script);
JHtml::stylesheet('nnframework/style.min.css', false, true);
?>
<form action="<?php 
echo JRoute::_('index.php?option=com_advancedmodules');
?>
" method="post" name="adminForm" id="adminForm">
	<div id="j-sidebar-container" class="span2">
		<?php 
echo $this->sidebar;
Example #6
0
 protected function getLabel()
 {
     return parent::getLabel();
 }