예제 #1
0
	/**
	 * Implements a form params-type field for showing a given plugin param
	 *
	 * @param  string              $name          The name of the form element
	 * @param  string              $value         The value of the element
	 * @param  SimpleXMLElement  $node          The xml element for the parameter
	 * @param  string              $control_name  The control name
	 * @return string                             The html for the element
	 */
	function _form_param( /** @noinspection PhpUnusedParameterInspection */ $name, $value, &$node, $control_name ) {
		$content	=	$this->_pluginParams->get( $node->attributes( 'value' ) );
		return $content;
	}
예제 #2
0
 /**
  * Creates the column references for the userlist query
  * @static
  *
  * @param  array              $columns
  * @param  FieldTable[]       $fields
  * @param  array              $tables
  * @param  array              $searchableFields
  * @param  RegistryInterface  $params
  * @return string
  */
 public static function getFieldsSQL(&$columns, &$fields, &$tables, &$searchableFields, &$params)
 {
     $colRefs = array();
     $newTableIndex = 0;
     $listSearch = (int) $params->get('list_search', 1);
     foreach ($columns as $i => $column) {
         foreach ($column->fields as $k => $colField) {
             $fieldId = isset($colField['fieldid']) ? $colField['fieldid'] : null;
             if ($fieldId && isset($fields[$fieldId])) {
                 $field = $fields[$fieldId];
                 if (!array_key_exists($field->table, $tables)) {
                     $newTableIndex++;
                     $tables[$field->table] = 't' . $newTableIndex;
                 }
                 if ($tables[$field->table][0] != 'u' && $field->name != 'NA') {
                     // CB 1.1 table compatibility : TBD: remove after CB 1.2
                     foreach ($field->getTableColumns() as $col) {
                         $colRefs[$col] = $tables[$field->table] . '.' . $field->getDbo()->NameQuote($col);
                     }
                 }
                 if ($field->searchable && $listSearch == 1) {
                     $searchableFields[] = $fields[$fieldId];
                 }
                 $fields[$fieldId]->_listed = true;
             } else {
                 // field unpublished or deleted but still in list: remove field from columns, so that we don't handle it:
                 unset($columns[$i]->fields[$k]);
             }
         }
     }
     if ($listSearch == 2) {
         foreach ($fields as $fieldId => $field) {
             if ($field->searchable) {
                 $searchableFields[] = $fields[$fieldId];
             }
         }
     }
     if ($listSearch == 3) {
         $listSearchFields = explode('|*|', $params->get('list_search_fields', null));
         if ($listSearchFields) {
             foreach ($fields as $fieldId => $field) {
                 if ($field->searchable && in_array($field->fieldid, $listSearchFields)) {
                     $searchableFields[] = $fields[$fieldId];
                 }
             }
         }
     }
     return implode(', ', $colRefs);
 }
예제 #3
0
 /**
  * Implements a form params-type field for showing a given plugin param
  *
  * @param  string              $name          The name of the form element
  * @param  string              $value         The value of the element
  * @param  SimpleXMLElement  $node          The xml element for the parameter
  * @param  string              $control_name  The control name
  * @return string                             The html for the element
  */
 function _form_param($name, $value, &$node, $control_name)
 {
     $content = $this->_pluginParams->get($node->attributes('value'));
     return $content;
 }