本文整理匯總了PHP中FabrikHelperHTML::conditonList方法的典型用法代碼示例。如果您正苦於以下問題:PHP FabrikHelperHTML::conditonList方法的具體用法?PHP FabrikHelperHTML::conditonList怎麽用?PHP FabrikHelperHTML::conditonList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FabrikHelperHTML
的用法示例。
在下文中一共展示了FabrikHelperHTML::conditonList方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getAdvancedSearchRows
/**
* build an array of html data that gets inserted into the advanced search popup view
* @return array html lists/fields
*/
public function getAdvancedSearchRows()
{
if (isset($this->advancedSearchRows)) {
return $this->advancedSearchRows;
}
$statements = $this->getStatementsOpts();
$rows = array();
$first = false;
$elementModels =& $this->getElements();
list($fieldNames, $firstFilter) = $this->getAdvancedSearchElementList();
$type = "<input type=\"hidden\" name=\"fabrik___filter[list_{$this->getId()}][search_type][]\" value=\"advanced\" />";
$grouped = "<input type=\"hidden\" name=\"fabrik___filter[list_{$this->getId()}][grouped_to_previous][]\" value=\"0\" />";
$filters =& $this->getAdvancedFilterValues();
$counter = 0;
if (array_key_exists('key', $filters)) {
foreach ($filters['key'] as $key) {
foreach ($elementModels as $elementModel) {
$testkey = FabrikString::safeColName($elementModel->getFullName(false, false, false));
if ($testkey == $key) {
break;
}
}
$join = $filters['join'][$counter];
$condition = $filters['condition'][$counter];
$value = $filters['origvalue'][$counter];
$v2 = $filters['value'][$counter];
switch ($condition) {
case "<>":
$jsSel = '<>';
break;
case "=":
$jsSel = 'EQUALS';
break;
case "<":
$jsSel = '<';
break;
case ">":
$jsSel = '>';
break;
default:
$firstChar = substr($v2, 1, 1);
$lastChar = substr($v2, -2, 1);
switch ($firstChar) {
case "%":
$jsSel = $lastChar == "%" ? 'CONTAINS' : ($jsSel = 'ENDS WITH');
break;
default:
if ($lastChar == "%") {
$jsSel = 'BEGINS WITH';
}
break;
}
break;
}
$value = trim(trim($value, '"'), "%");
if ($counter == 0) {
$join = JText::_('COM_FABRIK_WHERE') . "<input type=\"hidden\" value=\"WHERE\" name=\"fabrik___filter[list_{$this->getState('list.id')}][join][]\" />";
} else {
$join = FabrikHelperHTML::conditonList($this->getId(), $join);
}
$lineElname = FabrikString::safeColName($elementModel->getFullName(false, true, false));
$orig = JRequest::getVar($lineElname);
JRequest::setVar($lineElname, array('value' => $value));
$filter =& $elementModel->getFilter($counter, false);
JRequest::setVar($lineElname, $orig);
$key = JHTML::_('select.genericlist', $fieldNames, 'fabrik___filter[list_' . $this->getId() . '][key][]', "class=\"inputbox key\" size=\"1\" ", 'value', 'text', $key);
$jsSel = JHTML::_('select.genericlist', $statements, 'fabrik___filter[list_' . $this->getId() . '][condition][]', "class=\"inputbox\" size=\"1\" ", 'value', 'text', $jsSel);
$rows[] = array('join' => $join, 'element' => $key, 'condition' => $jsSel, 'filter' => $filter, 'type' => $type, 'grouped' => $grouped);
$counter++;
}
}
if ($counter == 0) {
$join = JText::_('COM_FABRIK_WHERE') . "<input type=\"hidden\" name=\"fabrik___filter[list_{$this->getId()}][join][]\" value=\"WHERE\" />";
$key = JHTML::_('select.genericlist', $fieldNames, 'fabrik___filter[list_' . $this->getId() . '][key][]', "class=\"inputbox key\" size=\"1\" ", 'value', 'text', '');
$jsSel = JHTML::_('select.genericlist', $statements, 'fabrik___filter[list_' . $this->getId() . '][condition][]', "class=\"inputbox\" size=\"1\" ", 'value', 'text', '');
$rows[] = array('join' => $join, 'element' => $key, 'condition' => $jsSel, 'filter' => $firstFilter, 'type' => $type, 'grouped' => $grouped);
}
$this->advancedSearchRows =& $rows;
return $rows;
}