Public Member Functions | |
tslib_pibase () | |
Class Constructor (true constructor) Initializes $this->piVars if $this->prefixId is set to any value Will also set $this->LLkey based on the config.language setting. | |
pi_setPiVarDefaults () | |
If internal TypoScript property "_DEFAULT_PI_VARS." is set then it will merge the current $this->piVars array onto these default values. | |
pi_getPageLink ($id, $target='', $urlParameters=array()) | |
Get URL to some page. | |
pi_linkToPage ($str, $id, $target='', $urlParameters=array()) | |
Link a string to some page. | |
pi_linkTP ($str, $urlParameters=array(), $cache=0, $altPageId=0) | |
Link string to the current page. | |
pi_linkTP_keepPIvars ($str, $overrulePIvars=array(), $cache=0, $clearAnyway=0, $altPageId=0) | |
Link a string to the current page while keeping currently set values in piVars. | |
pi_linkTP_keepPIvars_url ($overrulePIvars=array(), $cache=0, $clearAnyway=0, $altPageId=0) | |
Get URL to the current page while keeping currently set values in piVars. | |
pi_list_linkSingle ($str, $uid, $cache=FALSE, $mergeArr=array(), $urlOnly=FALSE, $altPageId=0) | |
Wraps the $str in a link to a single display of the record (using piVars[showUid]) Uses pi_linkTP for the linking. | |
pi_openAtagHrefInJSwindow ($str, $winName='', $winParams='width=670, height=500, status=0, menubar=0, scrollbars=1, resizable=1') | |
Will change the href value from in the input string and turn it into an onclick event that will open a new window with the URL. | |
pi_list_browseresults ($showResultCount=1, $tableParams='') | |
Returns a results browser. | |
pi_list_searchBox ($tableParams='') | |
Returns a Search box, sending search words to piVars "sword" and setting the "no_cache" parameter as well in the form. | |
pi_list_modeSelector ($items=array(), $tableParams='') | |
Returns a mode selector; a little menu in a table normally put in the top of the page/list. | |
pi_list_makelist ($res, $tableParams='') | |
Returns the list of items based on the input SQL result pointer For each result row the internal var, $this->internal['currentRow'], is set with the row returned. | |
pi_list_row ($c) | |
Returns a list row. | |
pi_list_header () | |
Returns a list header row. | |
pi_getClassName ($class) | |
Returns a class-name prefixed with $this->prefixId and with all underscores substituted to dashes (-). | |
pi_classParam ($class) | |
Returns the class-attribute with the correctly prefixed classname Using pi_getClassName(). | |
pi_wrapInBaseClass ($str) | |
Wraps the input string in a tag with the class attribute set to the prefixId. | |
pi_getEditPanel ($row='', $tablename='', $label='', $conf=Array()) | |
Returns the Backend User edit panel for the $row from $tablename. | |
pi_getEditIcon ($content, $fields, $title='', $row='', $tablename='', $oConf=array()) | |
Adds edit-icons to the input content. | |
pi_getLL ($key, $alt='', $hsc=FALSE) | |
Returns the localized label of the LOCAL_LANG key, $key Notice that for debugging purposes prefixes for the output values can be set with the internal vars ->LLtestPrefixAlt and ->LLtestPrefix. | |
pi_loadLL () | |
Loads local-language values by looking for a "locallang.php" file in the plugin class directory ($this->scriptRelPath) and if found includes it. | |
pi_list_query ($table, $count=0, $addWhere='', $mm_cat='', $groupBy='', $orderBy='', $query='', $returnQueryArray=FALSE) | |
Makes a standard query for listing of records based on standard input vars from the 'browser' ($this->internal['results_at_a_time'] and $this->piVars['pointer']) and 'searchbox' ($this->piVars['sword'] and $this->internal['searchFieldList']) Set $count to 1 if you wish to get a count(*) query for selecting the number of results. | |
pi_exec_query ($table, $count=0, $addWhere='', $mm_cat='', $groupBy='', $orderBy='', $query='') | |
Executes a standard SELECT query for listing of records based on standard input vars from the 'browser' ($this->internal['results_at_a_time'] and $this->piVars['pointer']) and 'searchbox' ($this->piVars['sword'] and $this->internal['searchFieldList']) Set $count to 1 if you wish to get a count(*) query for selecting the number of results. | |
pi_getRecord ($table, $uid, $checkPage=0) | |
Returns the row $uid from $table (Simply calling $GLOBALS['TSFE']->sys_page->checkRecord()). | |
pi_getPidList ($pid_list, $recursive=0) | |
Returns a commalist of page ids for a query (eg. | |
pi_prependFieldsWithTable ($table, $fieldList) | |
Having a comma list of fields ($fieldList) this is prepended with the $table.'.' name. | |
pi_getCategoryTableContents ($table, $pid, $whereClause='', $groupBy='', $orderBy='', $limit='') | |
Will select all records from the "category table", $table, and return them in an array. | |
pi_isOnlyFields ($fList, $lowerThan=-1) | |
Returns true if the piVars array has ONLY those fields entered that is set in the $fList (commalist) AND if none of those fields value is greater than $lowerThan field if they are integers. | |
pi_autoCache ($inArray) | |
Returns true if the array $inArray contains only values allowed to be cached based on the configuration in $this->pi_autoCacheFields Used by ->pi_linkTP_keepPIvars This is an advanced form of evaluation of whether a URL should be cached or not. | |
pi_RTEcssText ($str) | |
Will process the input string with the parseFunc function from tslib_cObj based on configuration set in "lib.parseFunc_RTE" in the current TypoScript template. | |
pi_initPIflexForm () | |
Converts $this->cObj->data['pi_flexform'] from XML string to flexForm array. | |
pi_getFFvalue ($T3FlexForm_array, $fieldName, $sheet='sDEF', $lang='lDEF', $value='vDEF') | |
Return value from somewhere inside a FlexForm structure. | |
pi_getFFvalueFromSheetArray ($sheetArray, $fieldNameArr, $value) | |
Returns part of $sheetArray pointed to by the keys in $fieldNameArray. | |
Public Attributes | |
$cObj | |
$prefixId | |
$scriptRelPath | |
$extKey | |
$piVars | |
$internal | |
$LOCAL_LANG = Array() | |
$LOCAL_LANG_loaded = 0 | |
$LLkey = 'default' | |
$LLtestPrefix = '' | |
$LLtestPrefixAlt = '' | |
$pi_isOnlyFields = 'modepointer' | |
$pi_alwaysPrev = 0 | |
$pi_lowerThan = 5 | |
$pi_moreParams = '' | |
$pi_listFields = '*' | |
$pi_autoCacheFields = array() | |
$pi_autoCacheEn = 0 | |
$pi_USER_INT_obj = 0 | |
$conf = Array() | |
Should normally be set in the main function with the TypoScript content passed to the method. | |
$pi_EPtemp_cObj | |
$pi_tmpPageId = 0 |
|
Class Constructor (true constructor) Initializes $this->piVars if $this->prefixId is set to any value Will also set $this->LLkey based on the config.language setting.
Definition at line 211 of file class.tslib_pibase.php. 00211 { 00212 if ($this->prefixId) { 00213 $this->piVars = t3lib_div::GParrayMerged($this->prefixId); 00214 } 00215 if ($GLOBALS['TSFE']->config['config']['language']) { 00216 $this->LLkey = $GLOBALS['TSFE']->config['config']['language']; 00217 } 00218 }
|
|
Returns true if the array $inArray contains only values allowed to be cached based on the configuration in $this->pi_autoCacheFields Used by ->pi_linkTP_keepPIvars This is an advanced form of evaluation of whether a URL should be cached or not.
Definition at line 1135 of file class.tslib_pibase.php. Referenced by pi_linkTP_keepPIvars(). 01135 { 01136 if (is_array($inArray)) { 01137 reset($inArray); 01138 while(list($fN,$fV)=each($inArray)) { 01139 if (!strcmp($inArray[$fN],'')) { 01140 unset($inArray[$fN]); 01141 } elseif (is_array($this->pi_autoCacheFields[$fN])) { 01142 if (is_array($this->pi_autoCacheFields[$fN]['range']) 01143 && intval($inArray[$fN])>=intval($this->pi_autoCacheFields[$fN]['range'][0]) 01144 && intval($inArray[$fN])<=intval($this->pi_autoCacheFields[$fN]['range'][1])) { 01145 unset($inArray[$fN]); 01146 } 01147 if (is_array($this->pi_autoCacheFields[$fN]['list']) 01148 && in_array($inArray[$fN],$this->pi_autoCacheFields[$fN]['list'])) { 01149 unset($inArray[$fN]); 01150 } 01151 } 01152 } 01153 } 01154 if (!count($inArray)) return 1; 01155 }
|
|
Returns the class-attribute with the correctly prefixed classname Using pi_getClassName().
Definition at line 659 of file class.tslib_pibase.php. Referenced by pi_list_browseresults(), pi_list_modeSelector(), and pi_list_row(). 00659 { 00660 return ' class="'.$this->pi_getClassName($class).'"'; 00661 }
|
|
Executes a standard SELECT query for listing of records based on standard input vars from the 'browser' ($this->internal['results_at_a_time'] and $this->piVars['pointer']) and 'searchbox' ($this->piVars['sword'] and $this->internal['searchFieldList']) Set $count to 1 if you wish to get a count(*) query for selecting the number of results. Notice that the query will use $this->conf['pidList'] and $this->conf['recursive'] to generate a PID list within which to search for records.
Definition at line 1000 of file class.tslib_pibase.php. References pi_list_query(), and table(). 01000 { 01001 $queryParts = $this->pi_list_query($table,$count,$addWhere,$mm_cat,$groupBy,$orderBy,$query, TRUE); 01002 01003 return $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts); 01004 }
|
|
Will select all records from the "category table", $table, and return them in an array.
Definition at line 1071 of file class.tslib_pibase.php. References table(). 01071 { 01072 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery( 01073 '*', 01074 $table, 01075 'pid='.intval($pid). 01076 $this->cObj->enableFields($table).' '. 01077 $whereClause, // whereClauseMightContainGroupOrderBy 01078 $groupBy, 01079 $orderBy, 01080 $limit 01081 ); 01082 $outArr = array(); 01083 while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { 01084 $outArr[$row['uid']] = $row; 01085 } 01086 $GLOBALS['TYPO3_DB']->sql_free_result($res); 01087 return $outArr; 01088 }
|
|
Returns a class-name prefixed with $this->prefixId and with all underscores substituted to dashes (-).
Definition at line 647 of file class.tslib_pibase.php. 00647 { 00648 return str_replace('_','-',$this->prefixId).($this->prefixId?'-':'').$class; 00649 }
|
|
Adds edit-icons to the input content. tslib_cObj::editIcons used for rendering
Definition at line 775 of file class.tslib_pibase.php. References $conf, and $content. 00775 { 00776 if ($GLOBALS['TSFE']->beUserLogin){ 00777 if (!$row || !$tablename) { 00778 $row = $this->internal['currentRow']; 00779 $tablename = $this->internal['currentTable']; 00780 } 00781 $conf=array_merge(array( 00782 'beforeLastTag'=>1, 00783 'iconTitle' => $title 00784 ),$oConf); 00785 $content=$this->cObj->editIcons($content,$tablename.':'.$fields,$conf,$tablename.':'.$row['uid'],$row,'&viewUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))); 00786 } 00787 return $content; 00788 }
|
|
Returns the Backend User edit panel for the $row from $tablename.
Definition at line 733 of file class.tslib_pibase.php. References $conf, and table(). 00733 { 00734 $panel=''; 00735 if (!$row || !$tablename) { 00736 $row = $this->internal['currentRow']; 00737 $tablename = $this->internal['currentTable']; 00738 } 00739 00740 if ($GLOBALS['TSFE']->beUserLogin) { 00741 // Create local cObj if not set: 00742 if (!is_object($this->pi_EPtemp_cObj)) { 00743 $this->pi_EPtemp_cObj = t3lib_div::makeInstance('tslib_cObj'); 00744 $this->pi_EPtemp_cObj->setParent($this->cObj->data,$this->cObj->currentRecord); 00745 } 00746 00747 // Initialize the cObj object with current row 00748 $this->pi_EPtemp_cObj->start($row,$tablename); 00749 00750 // Setting TypoScript values in the $conf array. See documentation in TSref for the EDITPANEL cObject. 00751 $conf['allow'] = 'edit,new,delete,move,hide'; 00752 $panel = $this->pi_EPtemp_cObj->cObjGetSingle('EDITPANEL',$conf,'editpanel'); 00753 } 00754 00755 if ($panel) { 00756 if ($label) { 00757 return '<!-- BEGIN: EDIT PANEL --><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td valign="top">'.$label.'</td><td valign="top" align="right">'.$panel.'</td></tr></table><!-- END: EDIT PANEL -->'; 00758 } else return '<!-- BEGIN: EDIT PANEL -->'.$panel.'<!-- END: EDIT PANEL -->'; 00759 } else return $label; 00760 }
|
|
Return value from somewhere inside a FlexForm structure.
Definition at line 1205 of file class.tslib_pibase.php. References pi_getFFvalueFromSheetArray(). 01205 { 01206 $sheetArray = $T3FlexForm_array['data'][$sheet][$lang]; 01207 if (is_array($sheetArray)) { 01208 return $this->pi_getFFvalueFromSheetArray($sheetArray,explode('/',$fieldName),$value); 01209 } 01210 }
|
|
Returns part of $sheetArray pointed to by the keys in $fieldNameArray.
Definition at line 1222 of file class.tslib_pibase.php. Referenced by pi_getFFvalue(). 01222 { 01223 01224 $tempArr=$sheetArray; 01225 foreach($fieldNameArr as $k => $v) { 01226 if (t3lib_div::testInt($v)) { 01227 if (is_array($tempArr)) { 01228 $c=0; 01229 foreach($tempArr as $values) { 01230 if ($c==$v) { 01231 #debug($values); 01232 $tempArr=$values; 01233 break; 01234 } 01235 $c++; 01236 } 01237 } 01238 } else { 01239 $tempArr = $tempArr[$v]; 01240 } 01241 } 01242 return $tempArr[$value]; 01243 }
|
|
Returns the localized label of the LOCAL_LANG key, $key Notice that for debugging purposes prefixes for the output values can be set with the internal vars ->LLtestPrefixAlt and ->LLtestPrefix.
Definition at line 822 of file class.tslib_pibase.php. Referenced by pi_list_browseresults(). 00822 { 00823 if (isset($this->LOCAL_LANG[$this->LLkey][$key])) { 00824 $word = $GLOBALS['TSFE']->csConv($this->LOCAL_LANG[$this->LLkey][$key]); 00825 } elseif (isset($this->LOCAL_LANG['default'][$key])) { 00826 $word = $this->LOCAL_LANG['default'][$key]; 00827 } else { 00828 $word = $this->LLtestPrefixAlt.$alt; 00829 } 00830 00831 $output = $this->LLtestPrefix.$word; 00832 if ($hsc) $output = htmlspecialchars($output); 00833 00834 return $output; 00835 }
|
|
Get URL to some page. Returns the URL to page $id with $target and an array of additional url-parameters, $urlParameters Simple example: $this->pi_getPageLink(123) to get the URL for page-id 123. The function basically calls $this->cObj->getTypoLink_URL()
Definition at line 264 of file class.tslib_pibase.php. 00264 { 00265 return $this->cObj->getTypoLink_URL($id,$urlParameters,$target); // ?$target:$GLOBALS['TSFE']->sPre 00266 }
|
|
Returns a commalist of page ids for a query (eg. 'WHERE pid IN (...)')
Definition at line 1026 of file class.tslib_pibase.php. References $val. Referenced by pi_list_query(). 01026 { 01027 if (!strcmp($pid_list,'')) $pid_list = $GLOBALS['TSFE']->id; 01028 $recursive = t3lib_div::intInRange($recursive,0); 01029 01030 $pid_list_arr = array_unique(t3lib_div::trimExplode(',',$pid_list,1)); 01031 $pid_list = array(); 01032 01033 foreach($pid_list_arr as $val) { 01034 $val = t3lib_div::intInRange($val,0); 01035 if ($val) { 01036 $_list = $this->cObj->getTreeList(-1*$val, $recursive); 01037 if ($_list) $pid_list[] = $_list; 01038 } 01039 } 01040 01041 return implode(',', $pid_list); 01042 }
|
|
Returns the row $uid from $table (Simply calling $GLOBALS['TSFE']->sys_page->checkRecord()).
Definition at line 1015 of file class.tslib_pibase.php. References table(). 01015 {
01016 return $GLOBALS['TSFE']->sys_page->checkRecord($table,$uid,$checkPage);
01017 }
|
|
Converts $this->cObj->data['pi_flexform'] from XML string to flexForm array.
Definition at line 1187 of file class.tslib_pibase.php. 01187 { 01188 // Converting flexform data into array: 01189 if (!is_array($this->cObj->data['pi_flexform']) && $this->cObj->data['pi_flexform']) { 01190 $this->cObj->data['pi_flexform'] = t3lib_div::xml2array($this->cObj->data['pi_flexform']); 01191 if (!is_array($this->cObj->data['pi_flexform'])) $this->cObj->data['pi_flexform']=array(); 01192 } 01193 }
|
|
Returns true if the piVars array has ONLY those fields entered that is set in the $fList (commalist) AND if none of those fields value is greater than $lowerThan field if they are integers. Notice that this function will only work as long as values are integers.
Definition at line 1115 of file class.tslib_pibase.php. Referenced by pi_list_browseresults(). 01115 { 01116 $lowerThan = $lowerThan==-1 ? $this->pi_lowerThan : $lowerThan; 01117 01118 $fList = t3lib_div::trimExplode(',',$fList,1); 01119 $tempPiVars = $this->piVars; 01120 while(list(,$k)=each($fList)) { 01121 if (!t3lib_div::testInt($tempPiVars[$k]) || $tempPiVars[$k]<$lowerThan) unset($tempPiVars[$k]); 01122 } 01123 if (!count($tempPiVars)) return 1; 01124 }
|
|
Link a string to some page. Like pi_getPageLink() but takes a string as first parameter which will in turn be wrapped with the URL including target attribute Simple example: $this->pi_linkToPage('My link', 123) to get something like My link (or My link if simulateStaticDocuments is set)
Definition at line 280 of file class.tslib_pibase.php. 00280 { 00281 return $this->cObj->getTypoLink($str,$id,$urlParameters,$target); // ?$target:$GLOBALS['TSFE']->sPre 00282 }
|
|
Link string to the current page. Returns the $str wrapped in -tags with a link to the CURRENT page, but with $urlParameters set as extra parameters for the page.
Definition at line 295 of file class.tslib_pibase.php. References $conf. Referenced by pi_linkTP_keepPIvars(), and pi_list_linkSingle(). 00295 { 00296 $conf=array(); 00297 $conf['useCacheHash'] = $this->pi_USER_INT_obj ? 0 : $cache; 00298 $conf['no_cache'] = $this->pi_USER_INT_obj ? 0 : !$cache; 00299 $conf['parameter'] = $altPageId ? $altPageId : ($this->pi_tmpPageId ? $this->pi_tmpPageId : $GLOBALS['TSFE']->id); 00300 $conf['additionalParams'] = $this->conf['parent.']['addParams'].t3lib_div::implodeArrayForUrl('',$urlParameters,'',1).$this->pi_moreParams; 00301 00302 return $this->cObj->typoLink($str, $conf); 00303 }
|
|
Link a string to the current page while keeping currently set values in piVars. Like pi_linkTP, but $urlParameters is by default set to $this->piVars with $overrulePIvars overlaid. This means any current entries from this->piVars are passed on (except the key "DATA" which will be unset before!) and entries in $overrulePIvars will OVERRULE the current in the link.
Definition at line 318 of file class.tslib_pibase.php. References $piVars, pi_autoCache(), and pi_linkTP(). Referenced by pi_linkTP_keepPIvars_url(), pi_list_browseresults(), pi_list_linkSingle(), and pi_list_modeSelector(). 00318 { 00319 if (is_array($this->piVars) && is_array($overrulePIvars) && !$clearAnyway) { 00320 $piVars = $this->piVars; 00321 unset($piVars['DATA']); 00322 $overrulePIvars = t3lib_div::array_merge_recursive_overrule($piVars,$overrulePIvars); 00323 if ($this->pi_autoCacheEn) { 00324 $cache = $this->pi_autoCache($overrulePIvars); 00325 } 00326 } 00327 $res = $this->pi_linkTP($str,Array($this->prefixId=>$overrulePIvars),$cache,$altPageId); 00328 return $res; 00329 }
|
|
Get URL to the current page while keeping currently set values in piVars. Same as pi_linkTP_keepPIvars but returns only the URL from the link.
Definition at line 342 of file class.tslib_pibase.php. References pi_linkTP_keepPIvars(). 00342 { 00343 $this->pi_linkTP_keepPIvars('|',$overrulePIvars,$cache,$clearAnyway,$altPageId); 00344 return $this->cObj->lastTypoLinkUrl; 00345 }
|
|
Returns a results browser. This means a bar of page numbers plus a "previous" and "next" link. For each entry in the bar the piVars "pointer" will be pointing to the "result page" to show. Using $this->piVars['pointer'] as pointer to the page to display Using $this->internal['res_count'], $this->internal['results_at_a_time'] and $this->internal['maxPages'] for count number, how many results to show and the max number of pages to include in the browse bar.
Definition at line 428 of file class.tslib_pibase.php. References $a, pi_classParam(), pi_getLL(), pi_isOnlyFields(), pi_linkTP_keepPIvars(), and table(). 00428 { 00429 00430 // Initializing variables: 00431 $pointer=$this->piVars['pointer']; 00432 $count=$this->internal['res_count']; 00433 $results_at_a_time = t3lib_div::intInRange($this->internal['results_at_a_time'],1,1000); 00434 $maxPages = t3lib_div::intInRange($this->internal['maxPages'],1,100); 00435 $max = t3lib_div::intInRange(ceil($count/$results_at_a_time),1,$maxPages); 00436 $pointer=intval($pointer); 00437 $links=array(); 00438 00439 // Make browse-table/links: 00440 if ($this->pi_alwaysPrev>=0) { 00441 if ($pointer>0) { 00442 $links[]=' 00443 <td nowrap="nowrap"><p>'.$this->pi_linkTP_keepPIvars($this->pi_getLL('pi_list_browseresults_prev','< Previous',TRUE),array('pointer'=>($pointer-1?$pointer-1:'')),0).'</p></td>'; 00444 } elseif ($this->pi_alwaysPrev) { 00445 $links[]=' 00446 <td nowrap="nowrap"><p>'.$this->pi_getLL('pi_list_browseresults_prev','< Previous',TRUE).'</p></td>'; 00447 } 00448 } 00449 for($a=0;$a<$max;$a++) { 00450 $links[]=' 00451 <td'.($pointer==$a?$this->pi_classParam('browsebox-SCell'):'').' nowrap="nowrap"><p>'. 00452 $this->pi_linkTP_keepPIvars(trim($this->pi_getLL('pi_list_browseresults_page','Page',TRUE).' '.($a+1)),array('pointer'=>($a?$a:'')),$this->pi_isOnlyFields($this->pi_isOnlyFields)). 00453 '</p></td>'; 00454 } 00455 if ($pointer<ceil($count/$results_at_a_time)-1) { 00456 $links[]=' 00457 <td nowrap="nowrap"><p>'. 00458 $this->pi_linkTP_keepPIvars($this->pi_getLL('pi_list_browseresults_next','Next >',TRUE),array('pointer'=>$pointer+1)). 00459 '</p></td>'; 00460 } 00461 00462 $pR1 = $pointer*$results_at_a_time+1; 00463 $pR2 = $pointer*$results_at_a_time+$results_at_a_time; 00464 $sTables = ' 00465 00466 <!-- 00467 List browsing box: 00468 --> 00469 <div'.$this->pi_classParam('browsebox').'>'. 00470 ($showResultCount ? ' 00471 <p>'. 00472 ($this->internal['res_count'] ? 00473 sprintf( 00474 str_replace('###SPAN_BEGIN###','<span'.$this->pi_classParam('browsebox-strong').'>',$this->pi_getLL('pi_list_browseresults_displays','Displaying results ###SPAN_BEGIN###%s to %s</span> out of ###SPAN_BEGIN###%s</span>')), 00475 $this->internal['res_count'] > 0 ? $pR1 : 0, 00476 min(array($this->internal['res_count'],$pR2)), 00477 $this->internal['res_count'] 00478 ) : 00479 $this->pi_getLL('pi_list_browseresults_noResults','Sorry, no items were found.')).'</p>':'' 00480 ). 00481 ' 00482 00483 <'.trim('table '.$tableParams).'> 00484 <tr> 00485 '.implode('',$links).' 00486 </tr> 00487 </table> 00488 </div>'; 00489 00490 return $sTables; 00491 }
|
|
Returns a list header row. (Dummy) Notice: This function should ALWAYS be defined in the extension class of the plugin since it is directly concerned with the specific layout of the listing for your plugins purpose.
Definition at line 616 of file class.tslib_pibase.php. References header(). Referenced by pi_list_makelist(). 00616 { 00617 return '<tr'.$this->pi_classParam('listrow-header').'><td><p>[dummy header row]</p></td></tr>'; 00618 }
|
|
Wraps the $str in a link to a single display of the record (using piVars[showUid]) Uses pi_linkTP for the linking.
Definition at line 360 of file class.tslib_pibase.php. References pi_linkTP(), and pi_linkTP_keepPIvars(). 00360 { 00361 if ($this->prefixId) { 00362 if ($cache) { 00363 $overrulePIvars=$uid?array('showUid'=>$uid):Array(); 00364 $overrulePIvars=array_merge($overrulePIvars,$mergeArr); 00365 $str = $this->pi_linkTP($str,Array($this->prefixId=>$overrulePIvars),$cache,$altPageId); 00366 } else { 00367 $overrulePIvars=array('showUid'=>$uid?$uid:''); 00368 $overrulePIvars=array_merge($overrulePIvars,$mergeArr); 00369 $str = $this->pi_linkTP_keepPIvars($str,$overrulePIvars,$cache,0,$altPageId); 00370 } 00371 00372 // If urlOnly flag, return only URL as it has recently be generated. 00373 if ($urlOnly) { 00374 $str = $this->cObj->lastTypoLinkUrl; 00375 } 00376 } 00377 return $str; 00378 }
|
|
Returns the list of items based on the input SQL result pointer For each result row the internal var, $this->internal['currentRow'], is set with the row returned. $this->pi_list_header() makes the header row for the list $this->pi_list_row() is used for rendering each row Notice that these two functions are typically ALWAYS defined in the extension class of the plugin since they are directly concerned with the specific layout for that plugins purpose.
Definition at line 569 of file class.tslib_pibase.php. References $out, $tRows, pi_list_header(), pi_list_row(), and table(). 00569 { 00570 // Make list table header: 00571 $tRows=array(); 00572 $this->internal['currentRow']=''; 00573 $tRows[] = $this->pi_list_header(); 00574 00575 // Make list table rows 00576 $c=0; 00577 while($this->internal['currentRow'] = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { 00578 $tRows[] = $this->pi_list_row($c); 00579 $c++; 00580 } 00581 00582 $out = ' 00583 00584 <!-- 00585 Record list: 00586 --> 00587 <div'.$this->pi_classParam('listrow').'> 00588 <'.trim('table '.$tableParams).'> 00589 '.implode('',$tRows).' 00590 </table> 00591 </div>'; 00592 00593 return $out; 00594 }
|
|
Returns a mode selector; a little menu in a table normally put in the top of the page/list.
Definition at line 531 of file class.tslib_pibase.php. References $cells, menu(), pi_classParam(), pi_linkTP_keepPIvars(), and table(). 00531 { 00532 $cells=array(); 00533 reset($items); 00534 while(list($k,$v)=each($items)) { 00535 $cells[]=' 00536 <td'.($this->piVars['mode']==$k?$this->pi_classParam('modeSelector-SCell'):'').'><p>'. 00537 $this->pi_linkTP_keepPIvars(htmlspecialchars($v),array('mode'=>$k),$this->pi_isOnlyFields($this->pi_isOnlyFields)). 00538 '</p></td>'; 00539 } 00540 00541 $sTables = ' 00542 00543 <!-- 00544 Mode selector (menu for list): 00545 --> 00546 <div'.$this->pi_classParam('modeSelector').'> 00547 <'.trim('table '.$tableParams).'> 00548 <tr> 00549 '.implode('',$cells).' 00550 </tr> 00551 </table> 00552 </div>'; 00553 00554 return $sTables; 00555 }
|
|
Makes a standard query for listing of records based on standard input vars from the 'browser' ($this->internal['results_at_a_time'] and $this->piVars['pointer']) and 'searchbox' ($this->piVars['sword'] and $this->internal['searchFieldList']) Set $count to 1 if you wish to get a count(*) query for selecting the number of results. Notice that the query will use $this->conf['pidList'] and $this->conf['recursive'] to generate a PID list within which to search for records.
Definition at line 908 of file class.tslib_pibase.php. References pi_getPidList(), and table(). Referenced by pi_exec_query(). 00908 { 00909 00910 // Begin Query: 00911 if (!$query) { 00912 // Fetches the list of PIDs to select from. 00913 // TypoScript property .pidList is a comma list of pids. If blank, current page id is used. 00914 // TypoScript property .recursive is a int+ which determines how many levels down from the pids in the pid-list subpages should be included in the select. 00915 $pidList = $this->pi_getPidList($this->conf['pidList'],$this->conf['recursive']); 00916 if (is_array($mm_cat)) { 00917 $query='FROM '.$table.','.$mm_cat['table'].','.$mm_cat['mmtable'].chr(10). 00918 ' WHERE '.$table.'.uid='.$mm_cat['mmtable'].'.uid_local AND '.$mm_cat['table'].'.uid='.$mm_cat['mmtable'].'.uid_foreign '.chr(10). 00919 (strcmp($mm_cat['catUidList'],'')?' AND '.$mm_cat['table'].'.uid IN ('.$mm_cat['catUidList'].')':'').chr(10). 00920 ' AND '.$table.'.pid IN ('.$pidList.')'.chr(10). 00921 $this->cObj->enableFields($table).chr(10); // This adds WHERE-clauses that ensures deleted, hidden, starttime/endtime/access records are NOT selected, if they should not! Almost ALWAYS add this to your queries! 00922 } else { 00923 $query='FROM '.$table.' WHERE pid IN ('.$pidList.')'.chr(10). 00924 $this->cObj->enableFields($table).chr(10); // This adds WHERE-clauses that ensures deleted, hidden, starttime/endtime/access records are NOT selected, if they should not! Almost ALWAYS add this to your queries! 00925 } 00926 } 00927 00928 // Split the "FROM ... WHERE" string so we get the WHERE part and TABLE names separated...: 00929 list($TABLENAMES,$WHERE) = spliti('WHERE', trim($query), 2); 00930 $TABLENAMES = trim(substr(trim($TABLENAMES),5)); 00931 $WHERE = trim($WHERE); 00932 00933 // Add '$addWhere' 00934 if ($addWhere) {$WHERE.=' '.$addWhere.chr(10);} 00935 00936 // Search word: 00937 if ($this->piVars['sword'] && $this->internal['searchFieldList']) { 00938 $WHERE.=$this->cObj->searchWhere($this->piVars['sword'],$this->internal['searchFieldList'],$table).chr(10); 00939 } 00940 00941 if ($count) { 00942 $queryParts = array( 00943 'SELECT' => 'count(*)', 00944 'FROM' => $TABLENAMES, 00945 'WHERE' => $WHERE, 00946 'GROUPBY' => '', 00947 'ORDERBY' => '', 00948 'LIMIT' => '' 00949 ); 00950 } else { 00951 // Order by data: 00952 if (!$orderBy) { 00953 if (t3lib_div::inList($this->internal['orderByList'],$this->internal['orderBy'])) { 00954 $orderBy = 'ORDER BY '.$table.'.'.$this->internal['orderBy'].($this->internal['descFlag']?' DESC':''); 00955 } 00956 } 00957 00958 // Limit data: 00959 $pointer = $this->piVars['pointer']; 00960 $pointer = intval($pointer); 00961 $results_at_a_time = t3lib_div::intInRange($this->internal['results_at_a_time'],1,1000); 00962 $LIMIT = ($pointer*$results_at_a_time).','.$results_at_a_time; 00963 00964 // Add 'SELECT' 00965 $queryParts = array( 00966 'SELECT' => $this->pi_prependFieldsWithTable($table,$this->pi_listFields), 00967 'FROM' => $TABLENAMES, 00968 'WHERE' => $WHERE, 00969 'GROUPBY' => $GLOBALS['TYPO3_DB']->stripGroupBy($groupBy), 00970 'ORDERBY' => $GLOBALS['TYPO3_DB']->stripOrderBy($orderBy), 00971 'LIMIT' => $LIMIT 00972 ); 00973 } 00974 00975 $query = $GLOBALS['TYPO3_DB']->SELECTquery ( 00976 $queryParts['SELECT'], 00977 $queryParts['FROM'], 00978 $queryParts['WHERE'], 00979 $queryParts['GROUPBY'], 00980 $queryParts['ORDERBY'], 00981 $queryParts['LIMIT'] 00982 ); 00983 return $returnQueryArray ? $queryParts : $query; 00984 }
|
|
Returns a list row. Get data from $this->internal['currentRow']; (Dummy) Notice: This function should ALWAYS be defined in the extension class of the plugin since it is directly concerned with the specific layout of the listing for your plugins purpose.
Definition at line 604 of file class.tslib_pibase.php. References pi_classParam(). Referenced by pi_list_makelist(). 00604 { 00605 // Dummy 00606 return '<tr'.($c%2 ? $this->pi_classParam('listrow-odd') : '').'><td><p>[dummy row]</p></td></tr>'; 00607 }
|
|
Returns a Search box, sending search words to piVars "sword" and setting the "no_cache" parameter as well in the form. Submits the search request to the current REQUEST_URI
Definition at line 500 of file class.tslib_pibase.php. References table(). 00500 { 00501 // Search box design: 00502 $sTables = ' 00503 00504 <!-- 00505 List search box: 00506 --> 00507 <div'.$this->pi_classParam('searchbox').'> 00508 <form action="'.htmlspecialchars(t3lib_div::getIndpEnv('REQUEST_URI')).'" method="post" style="margin: 0 0 0 0;"> 00509 <'.trim('table '.$tableParams).'> 00510 <tr> 00511 <td><input type="text" name="'.$this->prefixId.'[sword]" value="'.htmlspecialchars($this->piVars['sword']).'"'.$this->pi_classParam('searchbox-sword').' /></td> 00512 <td><input type="submit" value="'.$this->pi_getLL('pi_list_searchBox_search','Search',TRUE).'"'.$this->pi_classParam('searchbox-button').' />'. 00513 '<input type="hidden" name="no_cache" value="1" />'. 00514 '<input type="hidden" name="'.$this->prefixId.'[pointer]" value="" />'. 00515 '</td> 00516 </tr> 00517 </table> 00518 </form> 00519 </div>'; 00520 00521 return $sTables; 00522 }
|
|
Loads local-language values by looking for a "locallang.php" file in the plugin class directory ($this->scriptRelPath) and if found includes it. Also locallang values set in the TypoScript property "_LOCAL_LANG" are merged onto the values found in the "locallang.php" file.
Definition at line 843 of file class.tslib_pibase.php. References t3lib_extMgm::siteRelPath(). 00843 { 00844 if (!$this->LOCAL_LANG_loaded && $this->scriptRelPath) { 00845 $basePath = t3lib_extMgm::siteRelPath($this->extKey).dirname($this->scriptRelPath).'/locallang.php'; 00846 if (@is_file($basePath)) { 00847 include('./'.$basePath); 00848 $this->LOCAL_LANG = $LOCAL_LANG; 00849 if (is_array($this->conf['_LOCAL_LANG.'])) { 00850 reset($this->conf['_LOCAL_LANG.']); 00851 while(list($k,$lA)=each($this->conf['_LOCAL_LANG.'])) { 00852 if (is_array($lA)) { 00853 $k = substr($k,0,-1); 00854 $this->LOCAL_LANG[$k] = t3lib_div::array_merge_recursive_overrule(is_array($this->LOCAL_LANG[$k])?$this->LOCAL_LANG[$k]:array(), $lA); 00855 } 00856 } 00857 } 00858 } 00859 } 00860 $this->LOCAL_LANG_loaded = 1; 00861 }
|
|
Will change the href value from in the input string and turn it into an onclick event that will open a new window with the URL.
Definition at line 388 of file class.tslib_pibase.php. 00388 { 00389 if (eregi('(.*)(<a[^>]*>)(.*)',$str,$match)) { 00390 $aTagContent = t3lib_div::get_tag_attributes($match[2]); 00391 $match[2]='<a href="#" onclick="'. 00392 htmlspecialchars('vHWin=window.open(\''.$GLOBALS['TSFE']->baseUrlWrap($aTagContent['href']).'\',\''.($winName?$winName:md5($aTagContent['href'])).'\',\''.$winParams.'\');vHWin.focus();return false;'). 00393 '">'; 00394 $str=$match[1].$match[2].$match[3]; 00395 } 00396 return $str; 00397 }
|
|
Having a comma list of fields ($fieldList) this is prepended with the $table.'.' name.
Definition at line 1051 of file class.tslib_pibase.php. 01051 { 01052 $list=t3lib_div::trimExplode(',',$fieldList,1); 01053 $return=array(); 01054 while(list(,$listItem)=each($list)) { 01055 $return[]=$table.'.'.$listItem; 01056 } 01057 return implode(',',$return); 01058 }
|
|
Will process the input string with the parseFunc function from tslib_cObj based on configuration set in "lib.parseFunc_RTE" in the current TypoScript template. This is useful for rendering of content in RTE fields where the transformation mode is set to "ts_css" or so. Notice that this requires the use of "css_styled_content" to work right.
Definition at line 1166 of file class.tslib_pibase.php. 01166 { 01167 $parseFunc = $GLOBALS['TSFE']->tmpl->setup['lib.']['parseFunc_RTE.']; 01168 if (is_array($parseFunc)) $str = $this->cObj->parseFunc($str, $parseFunc); 01169 return $str; 01170 }
|
|
If internal TypoScript property "_DEFAULT_PI_VARS." is set then it will merge the current $this->piVars array onto these default values.
Definition at line 225 of file class.tslib_pibase.php. 00225 {
00226 if (is_array($this->conf['_DEFAULT_PI_VARS.'])) {
00227 $this->piVars = t3lib_div::array_merge_recursive_overrule($this->conf['_DEFAULT_PI_VARS.'],is_array($this->piVars)?$this->piVars:array());
00228 }
00229 }
|
|
Wraps the input string in a tag with the class attribute set to the prefixId.
All content returned from your plugins should be returned through this function so all content from your plugin is encapsulated in a -tag nicely identifying the content of your plugin.
Definition at line 684 of file class.tslib_pibase.php. 00684 { 00685 return ' 00686 00687 00688 <!-- 00689 00690 BEGIN: Content of extension "'.$this->extKey.'", plugin "'.$this->prefixId.'" 00691 00692 --> 00693 <div class="'.str_replace('_','-',$this->prefixId).'"> 00694 '.$str.' 00695 </div> 00696 <!-- END: Content of extension "'.$this->extKey.'", plugin "'.$this->prefixId.'" --> 00697 00698 '; 00699 }
|
|
Definition at line 135 of file class.tslib_pibase.php. |
|
Should normally be set in the main function with the TypoScript content passed to the method. $conf[LOCAL_LANG][_key_] is reserved for Local Language overrides. $conf[userFunc] / $conf[includeLibs] reserved for setting up the USER / USER_INT object. See TSref Definition at line 176 of file class.tslib_pibase.php. Referenced by pi_getEditIcon(), pi_getEditPanel(), and pi_linkTP(). |
|
Definition at line 138 of file class.tslib_pibase.php. |
|
Initial value: Array( // Used internally for general storage of values between methods 'res_count' => 0, // Total query count 'results_at_a_time' => 20, // pi_list_browseresults(): Show number of results at a time 'maxPages' => 10, // pi_list_browseresults(): Max number of 'Page 1 - Page 2 - ...' in the list browser 'currentRow' => Array(), // Current result row 'currentTable' => '', // Current table ) Definition at line 145 of file class.tslib_pibase.php. |
|
Definition at line 155 of file class.tslib_pibase.php. |
|
Definition at line 156 of file class.tslib_pibase.php. |
|
Definition at line 157 of file class.tslib_pibase.php. |
|
Definition at line 153 of file class.tslib_pibase.php. |
|
Definition at line 154 of file class.tslib_pibase.php. |
|
Definition at line 160 of file class.tslib_pibase.php. |
|
Definition at line 166 of file class.tslib_pibase.php. |
|
Definition at line 165 of file class.tslib_pibase.php. |
|
Definition at line 179 of file class.tslib_pibase.php. |
|
Definition at line 159 of file class.tslib_pibase.php. |
|
Definition at line 163 of file class.tslib_pibase.php. |
|
Definition at line 161 of file class.tslib_pibase.php. |
|
Definition at line 162 of file class.tslib_pibase.php. |
|
Definition at line 180 of file class.tslib_pibase.php. |
|
Definition at line 168 of file class.tslib_pibase.php. |
|
Initial value: Array ( // This is the incomming array by name $this->prefixId merged between POST and GET, POST taking precedence. Eg. if the class name is 'tx_myext' then the content of this array will be whatever comes into &tx_myext[...]=... 'pointer' => '', // Used as a pointer for lists 'mode' => '', // List mode 'sword' => '', // Search word 'sort' => '', // [Sorting column]:[ASC=0/DESC=1] ) Definition at line 139 of file class.tslib_pibase.php. Referenced by pi_linkTP_keepPIvars(). |
|
Definition at line 136 of file class.tslib_pibase.php. |
|
Definition at line 137 of file class.tslib_pibase.php. |