Benutzer-Werkzeuge

Webseiten-Werkzeuge


edv:typo3_ts_tabellen_sort-filter-liste

typo3 TS Tabellen 2) sort-filter-liste

  • Mit reinem typoScript eine sortierbare Liste programmieren.
  • Filter duch input-Felder realisiert.
  • Daten aus einer DB-Tabelle mit Daten aus zwei Muttertabellen verknüpfen.
  • Bei Auswahlfelder mit index-werten die entsprechenden Locallang-Einträge ausgeben.
  • alles in der Datei setup.txt, es wird kein php verwendet.
  • für ajax wird noch eine js-datei eingebunden

:!: Mit Filter- und Sortierfunktion: sehr raffinierteres TS-Skript einfacher...

t3x_mff_stundenplan-0_0_0-z-201302102236.t3x

Filter-Objekte

## FILTER - OBJEKT
plugin.tx_mffstundenplan_pi1.filter = COA
plugin.tx_mffstundenplan_pi1.filter {
  5 = COA
  5.10 = TEXT
  5.10.data = TSFE:id
  5.10.wrap = <form action="?id=|
  5.20 =  TEXT
  5.20.data = field:uid
  5.20.wrap = #planid_|" target="_top" method="post">

  10 = COA

  10.5 =  TEXT
  10.5.data = GP:tx_mffstundenplan_pi1|s
  10.5.wrap = <input type="hidden" name="tx_mffstundenplan_pi1[s]" value="|">

  10.21 = CONTENT
  10.21 {
	wrap = <select name="tx_mffstundenplan_pi1[flt][fachbereich]" id="fachbereich_select"><option value="">fb...</option>|</select>
	table = tx_mffstundenplan_klassen
	select {
	  pidInList = {$plugin.stundenplan.kls_pid}
	  selectFields = tx_mffstundenplan_klassen.fachbereich, tx_mffstundenplan_klassen.kurz 
	  join = tx_mffstundenplan_plan ON (tx_mffstundenplan_plan.klasse = tx_mffstundenplan_klassen.uid) 
	  orderBy = fachbereich
	  groupBy = fachbereich
	}
	renderObj = COA
	renderObj {
		5 = TEXT
		5 {
		  field = fachbereich
		  wrap = <option value="|"  selected>
		  if.value.field = fachbereich
		  if.equals.data = GPvar:tx_mffstundenplan_pi1|flt|fachbereich
		  if.negate = 0
		}
		7 = TEXT
		7 {
		  field = fachbereich
		  wrap = <option value="|">
		  if.value.field = fachbereich
		  if.equals.data = GPvar:tx_mffstundenplan_pi1|flt|fachbereich
		  if.negate = 1
		}
		10 = TEXT
		10 {
		  insertData = 1
		  field = fachbereich
		  wrap = {LLL:EXT:mff_stundenplan/locallang_db.xml:tx_mffstundenplan_klassen.fachbereich.I.|}
		}
		15 = TEXT
		15.value =  </option>
	}
  }
  

  10.30 = CONTENT
  10.30 {
	wrap = <select name="tx_mffstundenplan_pi1[flt][klasse]" id="klasse_select"><option value="">kls..</option>|</select>
	table = tx_mffstundenplan_klassen
	select {
	  pidInList = {$plugin.stundenplan.kls_pid}
	  selectFields = tx_mffstundenplan_klassen.kurz, tx_mffstundenplan_klassen.uid
	  rightjoin =  tx_mffstundenplan_plan  ON (tx_mffstundenplan_plan.klasse = tx_mffstundenplan_klassen.uid) 
	  groupBy = kurz
	}
	renderObj = COA
	renderObj {
		5 = TEXT
		5 {
		  field = uid
		  wrap = <option value="|"  selected>
		  if.value.field = uid
		  if.equals.data = GPvar:tx_mffstundenplan_pi1|flt|klasse
		  if.negate = 0
		}
		7 = TEXT
		7 {
		  field = uid
		  wrap = <option value="|">
		  if.value.field = uid
		  if.equals.data = GPvar:tx_mffstundenplan_pi1|flt|klasse
		  if.negate = 1
		}
		11 = TEXT
		11 {
		  field = kurz
		  wrap = |
		}
		15 = TEXT
		15.value =  </option>
	}
  }

  10.40 = TEXT
  10.40 {
	wrap = <select title="semester" id="semester_select" name="tx_mffstundenplan_pi1[flt][sem]" class="filterentry"><option value="">Sem...</option>|</select>
	value = 1,2,3,4,5,6,7,8
	split{
		token = ,
		cObjNum = 1 |*| 2 || 2 |*| 2
		1 {
		  10 = TEXT
		  10.current = 1
		  10.stdWrap {
			insertData =1
			wrap = <option value="{register:SPLIT_COUNT}" selected>|. Sem. &larr;</option>
			if {
			  value.data = register:SPLIT_COUNT
			  equals.data = GPvar:tx_mffstundenplan_pi1|flt|sem
			  negate = 0
			}          
		  }
		  15 < .10
		  15.stdWrap.if.negate = 1
		  15.stdWrap.wrap =  <option value="{register:SPLIT_COUNT}">|. Semester</option>
		}
		2 < .1
	}
  }

  55 = COA
  55.10 = TEXT
  55.10.value = <input type="submit" name="filtern" value="ok">

  95 = TEXT
  95.value = </form>
}

Titel und Tabellen-wrap

## HAUPT-RAHMEN
plugin.tx_mffstundenplan_pi1.liste = COA
plugin.tx_mffstundenplan_pi1.liste {
  3 =  COA
  3.10 =  TEXT
  3.10.value = <div class="tx-mffstundenplan-pi1">
  3.15 =  TEXT
  3.15.value = <h1>Stundenplan</h1>
  3.20 =  TEXT
  3.20.data = field:uid
  3.20.wrap = <DIV id="planid_|">

  4 = COA
  4.10 = COA
  4.10 < plugin.tx_mffstundenplan_pi1.filter

  5 =  TEXT
  5.value = <TABLE class="tx-mffstundenplan-pi1" border="0" cellpadding="0" cellspacing="0">

  25 =  TEXT
  25.value = </TABLE>

  27 =  COA
  27.10 =  TEXT
  27.10.value = </DIV>
  27.20 =  TEXT
  27.20.value = </div>
}

Tabellen-Kopfzeile

## TABELLE HEAD
plugin.tx_mffstundenplan_pi1.liste.10 =  COA
plugin.tx_mffstundenplan_pi1.liste.10 {
  wrap = <thead><TR class="head">|</TR></thead>
  10 = TEXT
  10 {
	wrap =  <th> | </th>
	value = uid&nbsp;&nbsp;
	typolink.addQueryString = 1
	typolink.parameter.data = TSFE:id
	typolink.section.data = field:uid
	typolink.section.wrap = planid_|
    typolink.additionalParams.cObject = COA
    typolink.additionalParams.cObject {
		5 = TEXT
		5.value = &type=&tx_mffstundenplan_pi1[s]=1

		20 = TEXT
		20.data = GP:tx_mffstundenplan_pi1|flt|fachbereich
		20.wrap = &tx_mffstundenplan_pi1[flt][fachbereich]=|
		20.required = 1

		30 = TEXT
		30.data = GP:tx_mffstundenplan_pi1|flt|klasse
		30.wrap = &tx_mffstundenplan_pi1[flt][klasse]=|
		30.required = 1

		40 = TEXT
		40.data = GP:tx_mffstundenplan_pi1|flt|sem
		40.wrap = &tx_mffstundenplan_pi1[flt][sem]=|
		40.required = 1
	}
	typolink.ATagParams.data = field:uid
	typolink.ATagParams.wrap.insertData = 1
	typolink.ATagParams.wrap = class="nosort"
	override {
	  cObject = COA
	  cObject {
		10 = TEXT
		10 {
		  value = uid&uarr;
		  typolink.addQueryString = 1
		  typolink.parameter.data = TSFE:id
		  typolink.section.data = field:uid
		  typolink.section.wrap = planid_|
		  typolink.additionalParams.cObject = COA
		  typolink.additionalParams.cObject {
			  5 = TEXT
			  5.value = &type=&tx_mffstundenplan_pi1[s]=-1

			  20 = TEXT
			  20.data = GP:tx_mffstundenplan_pi1|flt|fachbereich
			  20.wrap = &tx_mffstundenplan_pi1[flt][fachbereich]=|
			  20.required = 1

			  30 = TEXT
			  30.data = GP:tx_mffstundenplan_pi1|flt|klasse
			  30.wrap = &tx_mffstundenplan_pi1[flt][klasse]=|
			  30.required = 1

			  40 = TEXT
			  40.data = GP:tx_mffstundenplan_pi1|flt|sem
			  40.wrap = &tx_mffstundenplan_pi1[flt][sem]=|
			  40.required = 1
		  }
		  typolink.ATagParams.data = field:uid
		  typolink.ATagParams.wrap.insertData = 1
		  typolink.ATagParams.wrap = class="upsort"
		  if.value = 1
		  if.equals.data = GPvar:tx_mffstundenplan_pi1|s
		}
		20 < .10
		20 {
		  value = uid&darr;
		  typolink.additionalParams.cObject.5.value=&type=&tx_mffstundenplan_pi1[s]=-1
		  typolink.ATagParams.wrap = class="dnsort"
		  if.value = -1
		}
	  }
	}
  }

  20 < .10
  20 {
	value = Fb
	typolink.additionalParams.cObject.5.value=&type=&tx_mffstundenplan_pi1[s]=2
	override.cObject.10.value = Fb&uarr;
	override.cObject.10.typolink.additionalParams.cObject.5.value=&type=&tx_mffstundenplan_pi1[s]=-2
	override.cObject.10.if.value = 2
	override.cObject.20.value = Fb&darr;
	override.cObject.20.if.value = -2
  }
 

  30 < .10
  30 {
    wrap =  <th class="kurz"> | </th>
	value = Kls
	typolink.additionalParams.cObject.5.value=&type=&tx_mffstundenplan_pi1[s]=3
	override.cObject.10.value = Kls&uarr;
	override.cObject.10.typolink.additionalParams.cObject.5.value=&type=&tx_mffstundenplan_pi1[s]=-3
	override.cObject.10.if.value = 3
	override.cObject.20.value = Kls&darr;
	override.cObject.20.if.value = -3
  }
 
  40 < .30
  40 {
	value = S
	override.cObject.10.value = S
	override.cObject.20.value = S
  }
 
  50 < .30
  50 {
	value = B
	override.cObject.10.value = B
	override.cObject.20.value = B
  }

  60 < .10
  60 {
	value = Lp 
	typolink.additionalParams.cObject.5.value=&type=&tx_mffstundenplan_pi1[s]=6
	override.cObject.10.value = Lp&uarr;
	override.cObject.10.typolink.additionalParams.cObject.5.value=&type=&tx_mffstundenplan_pi1[s]=-6
	override.cObject.10.if.value = 6
	override.cObject.20.value = Lp&darr;
	override.cObject.20.if.value = -6
  }

  70 < .10
  70 {
	value = Tag&nbsp;&nbsp; 
	typolink.additionalParams.cObject.5.value=&type=&tx_mffstundenplan_pi1[s]=7
	override.cObject.10.value = Tag&uarr;
	override.cObject.10.typolink.additionalParams.cObject.5.value=&type=&tx_mffstundenplan_pi1[s]=-7
	override.cObject.10.if.value = 7
	override.cObject.20.value = Tag&darr;
	override.cObject.20.if.value = -7
  }

  80 < .10
  80 {
    wrap =  <th colspan="3"> | </th>
	value = Zeit 
	typolink.additionalParams.cObject.5.value=&type=&tx_mffstundenplan_pi1[s]=8
	override.cObject.10.value = Zeit&uarr;
	override.cObject.10.typolink.additionalParams.cObject.5.value=&type=&tx_mffstundenplan_pi1[s]=-8
	override.cObject.10.if.value = 8
	override.cObject.20.value = Zeit&darr;
	override.cObject.20.if.value = -8
  }

  90 < .10
  90 {
	value = Zimmer 
	typolink.additionalParams.cObject.5.value=&type=&tx_mffstundenplan_pi1[s]=9
	override.cObject.10.value = Zimmer&uarr;
	override.cObject.10.typolink.additionalParams.cObject.5.value=&type=&tx_mffstundenplan_pi1[s]=-9
	override.cObject.10.if.value = 9
	override.cObject.20.value = Zimmer&darr;
	override.cObject.20.if.value = -9
  }

  100 < .10
  100 {
	value = Bemerkung 
	typolink.additionalParams.cObject.5.value=&type=&tx_mffstundenplan_pi1[s]=10
	override.cObject.10.value = Bemerkung&uarr;
	override.cObject.10.typolink.additionalParams.cObject.5.value=&type=&tx_mffstundenplan_pi1[s]=-10
	override.cObject.10.if.value = 10
	override.cObject.20.value = Bemerkung&darr;
	override.cObject.20.if.value = -10
  }
 
}

mit JS ergänzen

# add js-possibility to TABELLE HEAD
page.includeJS.mffstundenplan = typo3conf/ext/mff_stundenplan/lib/ajax_js.js
page.headerData.913 = COA
page.headerData.913 {
  10 = TEXT
  10.value = <script type="text/javascript">
  20 = TEXT
  20.value = function putContent(uid,srt) {
  70 = TEXT
  70.value = return getContent('http://daten.verarbeitung.ch?type=100&cnt=' + uid + '
  72 = TEXT
  72.data = field:uid
  72.wrap = &id=|
  74 = COA
  74.20 = TEXT
  74.20.data = GP:tx_mffstundenplan_pi1|flt|fachbereich
  74.20.wrap = &tx_mffstundenplan_pi1[flt][fachbereich]=|
  74.20.required = 1
  74.30 = TEXT
  74.30.data = GP:tx_mffstundenplan_pi1|flt|klasse
  74.30.wrap = &tx_mffstundenplan_pi1[flt][klasse]=|
  74.30.required = 1
  74.40 = TEXT
  74.40.data = GP:tx_mffstundenplan_pi1|flt|sem
  74.40.wrap = &tx_mffstundenplan_pi1[flt][sem]=|
  74.40.required = 1
  76 = TEXT
  76.value = &tx_mffstundenplan_pi1[s]=' + srt
  90 = TEXT
  90.value = ,'#planid_' + uid);}</script>
}
plugin.tx_mffstundenplan_pi1.liste.10 {
  10{
	  typolink.ATagParams.wrap = class="nosort" onClick="return putContent(|,1);"
	  override.cObject.10.typolink.ATagParams.wrap = class="upsort" onClick="return putContent(|,-1);"
	  override.cObject.20.typolink.ATagParams.wrap = class="dnsort" onClick="return putContent(|,0);"
  }
  20{
	  typolink.ATagParams.wrap = class="nosort" onClick="return putContent(|,2);"
	  override.cObject.10.typolink.ATagParams.wrap = class="upsort" onClick="return putContent(|,-2);"
	  override.cObject.20.typolink.ATagParams.wrap = class="dnsort" onClick="return putContent(|,0);"
  }
  30{
	  typolink.ATagParams.wrap = class="nosort" onClick="return putContent(|,3);"
	  override.cObject.10.typolink.ATagParams.wrap = class="upsort" onClick="return putContent(|,-3);"
	  override.cObject.20.typolink.ATagParams.wrap = class="dnsort" onClick="return putContent(|,0);"
  }
  40{
	  typolink.ATagParams.wrap = class="nosort" onClick="return putContent(|,3);"
	  override.cObject.10.typolink.ATagParams.wrap = class="upsort" onClick="return putContent(|,-3);"
	  override.cObject.20.typolink.ATagParams.wrap = class="dnsort" onClick="return putContent(|,0);"
  }
  50{
	  typolink.ATagParams.wrap = class="nosort" onClick="return putContent(|,3);"
	  override.cObject.10.typolink.ATagParams.wrap = class="upsort" onClick="return putContent(|,-3);"
	  override.cObject.20.typolink.ATagParams.wrap = class="dnsort" onClick="return putContent(|,0);"
  }
  60{
	  typolink.ATagParams.wrap = class="nosort" onClick="return putContent(|,6);"
	  override.cObject.10.typolink.ATagParams.wrap = class="upsort" onClick="return putContent(|,-6);"
	  override.cObject.20.typolink.ATagParams.wrap = class="dnsort" onClick="return putContent(|,0);"
  }
  70{
	  typolink.ATagParams.wrap = class="nosort" onClick="return putContent(|,7);"
	  override.cObject.10.typolink.ATagParams.wrap = class="upsort" onClick="return putContent(|,-7);"
	  override.cObject.20.typolink.ATagParams.wrap = class="dnsort" onClick="return putContent(|,0);"
  }
  80{
	  typolink.ATagParams.wrap = class="nosort" onClick="return putContent(|,8);"
	  override.cObject.10.typolink.ATagParams.wrap = class="upsort" onClick="return putContent(|,-8);"
	  override.cObject.20.typolink.ATagParams.wrap = class="dnsort" onClick="return putContent(|,0);"
  }
  90{
	  typolink.ATagParams.wrap = class="nosort" onClick="return putContent(|,9);"
	  override.cObject.10.typolink.ATagParams.wrap = class="upsort" onClick="return putContent(|,-9);"
	  override.cObject.20.typolink.ATagParams.wrap = class="dnsort" onClick="return putContent(|,0);"
  }
  100{
	  typolink.ATagParams.wrap = class="nosort" onClick="return putContent(|,10);"
	  override.cObject.10.typolink.ATagParams.wrap = class="upsort" onClick="return putContent(|,-10);"
	  override.cObject.20.typolink.ATagParams.wrap = class="dnsort" onClick="return putContent(|,0);"
  }
}
# add js-possibility END

Tabellen-Fusszeile

Tabellen-Fusszeile aus Kopfzeile kopieren

# TABELLE - FOOTER (copy from header)
plugin.tx_mffstundenplan_pi1.liste {
  15 < plugin.tx_mffstundenplan_pi1.liste.10
  15.wrap = <tfoot><TR class="foot">|</TR></tfoot>
}

Tabellen-Zeilen


# TABELLE BODY
plugin.tx_mffstundenplan_pi1.liste.20 = COA
plugin.tx_mffstundenplan_pi1.liste.20 {
  wrap = <tbody>|</tbody>
  20 = CONTENT
  20 {
	table = tx_mffstundenplan_plan
	select {
	  pidInList = {$plugin.stundenplan.std_pid}
	  selectFields = tx_mffstundenplan_plan.*, tx_mffstundenplan_klassen.kurz, tx_mffstundenplan_klassen.fachbereich, fe_users.name
	  join = tx_mffstundenplan_klassen ON (tx_mffstundenplan_klassen.uid = tx_mffstundenplan_plan.klasse) JOIN fe_users ON (fe_users.uid = tx_mffstundenplan_plan.lehrperson) 
	  orderBy = fachbereich,kurz,tag,ab
	  andWhere.cObject = COA
	  andWhere.cObject {
		5 = TEXT
		5.value = tx_mffstundenplan_plan.pid={$plugin.stundenplan.std_pid}
		5.insertData = 1
		20 = TEXT
		20.data = GP:tx_mffstundenplan_pi1|flt|fachbereich
		20.noTrimWrap = | AND fachbereich=| |
		20.required = 1
		30 = TEXT
		30.data = GP:tx_mffstundenplan_pi1|flt|klasse
		30.noTrimWrap = | AND klasse=| |
		30.required = 1
		40 = TEXT
		40.data = GP:tx_mffstundenplan_pi1|flt|sem
		40.noTrimWrap = | AND sem=| |
		40.required = 1
	  }
	}
	renderObj = COA
	renderObj {
		1 = LOAD_REGISTER
		1.rowClass.cObject = TEXT
		1.rowClass.cObject.dataWrap = {REGISTER:rowClass}+1
		1.rowClass.override = 1
		1.rowClass.override.if.isLessThan = 1
		1.rowClass.override.if.value.data = REGISTER:rowClass
		1.rowClass.prioriCalc = intval

		5 = TEXT
		5.value =  <tr class="row_{REGISTER:rowClass}">
		5.insertData=1

		wrap =  |</tr>

		10 = TEXT
		10 {
		  field = uid
		  wrap = <td class="uid">|</td>
		}

		20 = COA
		20 {
		  21 = COA
		  21 {
			5 = TEXT
			5 {
			  field = fachbereich
			  wrap = <td class="fachbereich" title="{LLL:EXT:mff_stundenplan/locallang_db.xml:tx_mffstundenplan_klassen.fachbereich.I.|}">
			  insertData=1
			}
		  }
		  25 = COA
		  25 {
			5 = TEXT
			5 {
			  field = fachbereich
			  wrap = {LLL:EXT:mff_stundenplan/locallang_db.xml:tx_mffstundenplan_klassen.fachbereich.I.|}
			  insertData=1
			}
			stdWrap.crop=10
		  }
		  27 = TEXT
		  27.value=</td>
		}

		30 = TEXT
		30 {
		  field = kurz
		  wrap = <td class="kurz">|</td>
		}

		40 = TEXT
		40 {
		  field = sem
		  wrap = <td class="sem">{LLL:EXT:mff_stundenplan/locallang_db.xml:tx_mffstundenplan_plan.sem.I.|}</td>
		  insertData=1
		}

		50 = TEXT
		50 {
		  field = bez
		  wrap = <td class="bez">{LLL:EXT:mff_stundenplan/locallang_db.xml:tx_mffstundenplan_plan.bez.I.|}</td>
		  insertData=1
		}

		60 = COA
		60 {
		  5 = TEXT
		  5.value = <td class="lehrperson">
		  10 = COA
		  10 {
			2 = TEXT
			2 {
			  field = lehrperson
			  wrap = {DB:fe_users:|:name}
			  insertData=1
			}
			wrap = |
			stdWrap.split{
			  token.char =  32
				cObjNum = 1 |*| 2 || 2 |*| 2
				1.current = 1
				1.dataWrap =  |
				1.crop =1
				1.insertData=1
				2.current = 1
				2.wrap = | 
				2.crop =2
				2.case = lower
				2.insertData=1
			}
		  }
		  15 = TEXT
		  15.value = </td>
		}

		70 = COA
		70 {
		  5 = TEXT
		  5.value = <td class="tag">
		  10 = COA
		  10 {
			5 = TEXT
			5 {
			  field = tag
			  wrap = {LLL:EXT:mff_stundenplan/locallang_db.xml:tx_mffstundenplan_plan.tag.I.|}
			  insertData=1
			}
			stdWrap.crop = 3
		  }
		  15 = TEXT
		  15.value = </td>
		}

		80 = COA
		80 {
		  81 = TEXT
		  81.value = <td class="ab">
		  83 = COA
		  83 {
			5 = TEXT
			5 {
			  field = ab
			  wrap = {LLL:EXT:mff_stundenplan/locallang_db.xml:tx_mffstundenplan_plan.ab.I.|}
			  insertData=1
			}
			wrap = |
			stdWrap.split{
			  token = -
			  cObjNum = 1
			  returnKey = 0
			}
		  }
		  85 = TEXT
		  85.value =  </td><td class="bindestrich">-</td><td class="dauer">
		  87 = COA
		  87 {
			5 = TEXT
			5 {
			  wrap = {LLL:EXT:mff_stundenplan/locallang_db.xml:tx_mffstundenplan_plan.ab.I.|} 
			  insertData=1
			  current = 1
			  setCurrent.field = dauer
			  setCurrent.dataWrap = | + {field:ab}
			  prioriCalc = intval
			}
			wrap = |</td>
			stdWrap.split{
			  token = -
			  cObjNum = 1
			  returnKey = 1
			}
		  }
		}

		90 = COA
		90 {
		  91 = TEXT
		  91.value = <td class="zimmer" title="
		  92 = COA
		  92 {
			10 = TEXT
			10 {
			  field = zimmer
			  wrap = {LLL:EXT:mff_stundenplan/locallang_db.xml:tx_mffstundenplan_zimmer.haus.I.|}
			  insertData=1
			  split{
				  token = ,
				  cObjNum = 1
				  max = 1
				  1.current = 1
				  1.wrap = {DB:tx_mffstundenplan_zimmer:|:haus}
				  1.insertData=1
			  }
			}
			stdWrap.split{
			  token.char =  32
			  cObjNum = 1
			  returnKey = 1
			}
		  }
		  93 = TEXT
		  93.value = ">
		  95 = COA
		  95 {
			10 = TEXT
			10 {
			  field = zimmer
			  wrap = {LLL:EXT:mff_stundenplan/locallang_db.xml:tx_mffstundenplan_zimmer.haus.I.|}
			  insertData=1
			  split{
				  token = ,
				  cObjNum = 1
				  max = 1
				  1.current = 1
				  1.wrap = {DB:tx_mffstundenplan_zimmer:|:haus}
				  1.insertData=1
			  }
			}
			stdWrap.split{
			  token.char =  32
			  cObjNum = 1
			  returnKey = 0
			}
		  }
		  97 = TEXT
		  97{
			  field = zimmer
			  wrap = &nbsp;|</td>
			  split{
				  token = ,
				  cObjNum = 1 |*| 2 || 2 |*| 2
				  1.current = 1
				  1.dataWrap =  |/
				  1.wrap = {DB:tx_mffstundenplan_zimmer:|:zimmer}
				  1.insertData=1
				  2.current = 1
				  2.dataWrap = | 
				  2.wrap = {DB:tx_mffstundenplan_zimmer:|:zimmer}
				  2.insertData=1
			  }
		  }
		}

		100 = TEXT
		100 {
		  field = bemerkung
		  wrap = <td class="bemerkung">|</td>
		}

	}
  }
}

Bedingungen

Titel wenn gefiltert

Fachbereich

[globalVar = GP:tx_mffstundenplan_pi1|flt|fachbereich >0] || [globalVar = GP:tx_mffstundenplan_pi1|flt|fachbereich===0 ]
plugin.tx_mffstundenplan_pi1.liste {
  4.20 =  TEXT
  4.20.data = GP:tx_mffstundenplan_pi1|flt|fachbereich
  4.20.insertData = 1
  4.20.wrap = <H5>Fachbereich {LLL:EXT:mff_stundenplan/locallang_db.xml:tx_mffstundenplan_klassen.fachbereich.I.|}</h5>

  10.20 >
  15.20 >
  20.20.renderObj.20 >
}
[global]

Klasse

[globalVar = GP:tx_mffstundenplan_pi1|flt|klasse >0] || [globalVar = GP:tx_mffstundenplan_pi1|flt|klasse===0 ]
plugin.tx_mffstundenplan_pi1.liste {
  4.30 =  TEXT
  4.30.data = GP:tx_mffstundenplan_pi1|flt|klasse
  4.30.insertData = 1
  4.30.wrap = <H5>Klasse {DB:tx_mffstundenplan_klassen:|:kurz}</h5>

  10.30 >
  15.30 >
  20.20.renderObj.30 >
}
[global]

Semester

[globalVar = GP:tx_mffstundenplan_pi1|flt|sem >0] || [globalVar = GP:tx_mffstundenplan_pi1|flt|sem===0 ]
plugin.tx_mffstundenplan_pi1.liste {
  4.40 =  TEXT
  4.40.data = GP:tx_mffstundenplan_pi1|flt|sem
  4.40.insertData = 1
  4.40.wrap = <H5>{LLL:EXT:mff_stundenplan/locallang_db.xml:tx_mffstundenplan_plan.sem.I.|}. Semester</h5>

  10.40 >
  15.40 >
  20.20.renderObj.40 >
}
[global]

JS Ajax-Abfrage

[globalVar = GP:type = 100]
plugin.tx_mffstundenplan_pi1.liste.3 >
plugin.tx_mffstundenplan_pi1.liste.27 >
plugin.tx_mffstundenplan_pi1.filter >
[global]

Sortierbedingung

[globalVar = GP:tx_mffstundenplan_pi1|s = 1]
plugin.tx_mffstundenplan_pi1.liste.20.20.select.orderBy = uid
[else]
[globalVar = GP:tx_mffstundenplan_pi1|s = -1]
plugin.tx_mffstundenplan_pi1.liste.20.20.select.orderBy = uid DESC
[else]
[globalVar = GP:tx_mffstundenplan_pi1|s = 2]
plugin.tx_mffstundenplan_pi1.liste.20.20.select.orderBy = fachbereich
[else]
[globalVar = GP:tx_mffstundenplan_pi1|s = -2]
plugin.tx_mffstundenplan_pi1.liste.20.20.select.orderBy = fachbereich DESC
[else]
[globalVar = GP:tx_mffstundenplan_pi1|s = 3]
plugin.tx_mffstundenplan_pi1.liste.20.20.select.orderBy = kurz,bez,sem
[else]
[globalVar = GP:tx_mffstundenplan_pi1|s = -3]
plugin.tx_mffstundenplan_pi1.liste.20.20.select.orderBy = kurz DESC,bez DESC,sem DESC
[else]
[globalVar = GP:tx_mffstundenplan_pi1|s = 6]
plugin.tx_mffstundenplan_pi1.liste.20.20.select.orderBy = name
[else]
[globalVar = GP:tx_mffstundenplan_pi1|s = -6]
plugin.tx_mffstundenplan_pi1.liste.20.20.select.orderBy = name DESC
[else]
[globalVar = GP:tx_mffstundenplan_pi1|s = 7]
plugin.tx_mffstundenplan_pi1.liste.20.20.select.orderBy = tag,ab
[else]
[globalVar = GP:tx_mffstundenplan_pi1|s = -7]
plugin.tx_mffstundenplan_pi1.liste.20.20.select.orderBy = tag DESC,ab DESC
[else]
[globalVar = GP:tx_mffstundenplan_pi1|s = 8]
plugin.tx_mffstundenplan_pi1.liste.20.20.select.orderBy = ab
[else]
[globalVar = GP:tx_mffstundenplan_pi1|s = -8]
plugin.tx_mffstundenplan_pi1.liste.20.20.select.orderBy = ab DESC
[else]
[globalVar = GP:tx_mffstundenplan_pi1|s = 9]
plugin.tx_mffstundenplan_pi1.liste.20.20.select.orderBy = zimmer
[else]
[globalVar = GP:tx_mffstundenplan_pi1|s = -9]
plugin.tx_mffstundenplan_pi1.liste.20.20.select.orderBy = zimmer DESC
[else]
[globalVar = GP:tx_mffstundenplan_pi1|s = 10]
plugin.tx_mffstundenplan_pi1.liste.20.20.select.orderBy = bemerkung 
[else]
[globalVar = GP:tx_mffstundenplan_pi1|s = -10]
plugin.tx_mffstundenplan_pi1.liste.20.20.select.orderBy = bemerkung DESC
[global]

CSS

## CSS
plugin.tx_mffstundenplan_pi1._CSS_DEFAULT_STYLE (
  /* css zu Stundenplan-plugin */
  DIV.tx-mffstundenplan-pi1 DIV {padding:0px;margin:0;border:0px solid #c9ff00;border-width:0 1px 1px 1px;}
  DIV.tx-mffstundenplan-pi1 H5 {padding:3px;margin:0;font-size:100%;}
  TABLE.tx-mffstundenplan-pi1 {border:1px solid black;margin:0;padding:0 3px;}
  TABLE.tx-mffstundenplan-pi1 TH {padding:2px;text-align:left;}
  TABLE.tx-mffstundenplan-pi1 TD {padding:2px;text-align:left;}
  TABLE.tx-mffstundenplan-pi1 TR.head TH {border-bottom:1px solid black;}
  TABLE.tx-mffstundenplan-pi1 TR.foot TH {border-top:   1px solid black;padding:3px 2px 1px 2px;}
  TR.row_1 TD{background:#d0d0d0;}
  TR.row_2 TD{background:#e0e0e0;}
  td.uid {}
  td.fachbereich {}
  th.kurz, td.kurz {}
  td.bez {}
  td.lehrperson {}
  td.tag {}
  td.bemerkung {}
  TABLE.tx-mffstundenplan-pi1 td.bindestrich {padding:2px 0;}
  TABLE.tx-mffstundenplan-pi1 td.ab {text-align:right;padding:2px 0 2px 2px;}
  TABLE.tx-mffstundenplan-pi1 td.dauer {text-align:right;padding:2px 2px 2px 0;}
  td.zimmer {}
  .selected A{color:blue;}
  INPUT.filterentry[type=text]{width:20px;}
  SELECT#fachbereich_select{width:100px;}
  SELECT#semester_select{width:60px;}
  SELECT#klasse_select{width:60px;}
  /*eigenes template*/
  .i_content H1 {margin-bottom:0;}
  .i_content A.nosort,.i_content A.nosort:visited{padding:0;margin:0;}
  .i_content A.upsort,.i_content A.upsort:visited{color:#04f;padding:0;margin:0;}
  .i_content A.dnsort,.i_content A.dnsort:visited{color:#fa0;padding:0;margin:0;}
)

JS-Datei

Inhalt der js-Datei. Eingebunden wird sie in der ersten Zeile bei mit JS ergänzen.

function getContent(url,insel) {
	$(insel).css("opacity", "0.4");
	$.ajax({
		url: url ,
		dataType: "html",
		success: function(html) {
			$(insel)
				.css("opacity", "1")
				.css("display", "none")
				.html(html)
				.fadeIn();
			location.hash = insel;
		}
	});
	return false;
}

PHP

Den Code braucht es nur, um den Inhalt auszugeben. Könnte man mit TS lösen.

class tx_mffstundenplan_pi1 extends tslib_pibase {
	var $prefixId      = 'tx_mffstundenplan_pi1';		// Same as class name
	var $scriptRelPath = 'pi1/class.tx_mffstundenplan_pi1.php';	// Path to this script relative to the extension dir.
	var $extKey        = 'mff_stundenplan';	// The extension key.
	var $pi_checkCHash = true;
	
	/**
	 * The main method of the PlugIn
	 *
	 * @param	string		$content: The PlugIn content
	 * @param	array		$conf: The PlugIn configuration
	 * @return	The content that is displayed on the website
	 */
	function main($content, $conf) {
		$this->conf = $conf;
		$this->pi_setPiVarDefaults();
		$this->pi_loadLL();
		$this->pi_USER_INT_obj = 1;

		return $this->cObj->cObjGetSingle($conf['liste'],$conf['liste.']);

	}
}

Diskussion

Geben Sie Ihren Kommentar ein. Wiki-Syntax ist zugelassen:
 
edv/typo3_ts_tabellen_sort-filter-liste.txt · Zuletzt geändert: 26.01.2018 20:39 (Externe Bearbeitung)