Public Member Functions | |
| getTable ($table, $id) | |
| Adds the code of a single table. | |
| getTable_pages ($id) | |
| Renders records from the pages table from page id (Used to get information about the page tree content by "Web>Info"!). | |
| getTable_tt_content ($id) | |
| Renders Content Elements from the tt_content table from page id. | |
| getTable_fe_users ($id) | |
| Renders Frontend Users from the fe_users table from page id. | |
| getTable_sys_note ($id) | |
| Renders records from the sys_notes table from page id NOTICE: Requires the sys_note extension to be loaded. | |
| getTable_tt_board ($id) | |
| Renders records from the tt_board table from page id NOTICE: Requires the tt_board extension to be loaded. | |
| getTable_tt_address ($id) | |
| Renders address records from the tt_address table from page id NOTICE: Requires the tt_address extension to be loaded. | |
| getTable_tt_links ($id) | |
| Renders link records from the tt_links table from page id NOTICE: Requires the tt_links extension to be loaded. | |
| getTable_tt_guest ($id) | |
| Renders link records from the tt_links table from page id NOTICE: Requires the tt_links extension to be loaded. | |
| getTable_tt_news ($id) | |
| Renders news items from the tt_news table from page id NOTICE: Requires the tt_news extension to be loaded. | |
| getTable_tt_calender ($id) | |
| Renders calender elements link records from the tt_calender table from page id NOTICE: Requires the tt_calender extension to be loaded. | |
| getTable_tt_products ($id) | |
| Renders shopping elements from the tt_products table from page id NOTICE: Requires the tt_products extension to be loaded. | |
| makeOrdinaryList ($table, $id, $fList, $icon=0, $addWhere='') | |
| Creates a standard list of elements from a table. | |
| dataFields ($fieldArr, $table, $row, $out=array()) | |
| Adds content to all data fields in $out array. | |
| headerFields ($fieldArr, $table, $out=array()) | |
| Header fields made for the listing of records. | |
| pages_getTree ($theRows, $pid, $qWhere, $treeIcons, $depth) | |
| Adds pages-rows to an array, selecting recursively in the page tree. | |
| pages_drawItem ($row, $fieldArr) | |
| Adds a list item for the pages-rendering. | |
| tt_content_drawColHeader ($colName, $editParams, $newParams) | |
| Draw header for a content element column:. | |
| tt_content_drawHeader ($row, $space=0, $disableMoveAndNewButtons=FALSE, $langMode=FALSE) | |
| Draw the header for a single tt_content element. | |
| tt_content_drawItem ($row, $isRTE=FALSE) | |
| Draws the preview content for a content element. | |
| getNonTranslatedTTcontentUids ($defLanguageCount, $id, $lP) | |
| Filters out all tt_content uids which are already translated so only non-translated uids is left. | |
| newLanguageButton ($defLanguageCount, $lP) | |
| Creates button which is used to create copies of records.. | |
| infoGif ($infoArr) | |
| Returns an icon, which has its title attribute set to a massive amount of information about the element. | |
| newContentElementOnClick ($id, $colPos, $sys_language) | |
| Creates onclick-attribute content for a new content element. | |
| linkEditContent ($str, $row) | |
| Will create a link on the input string and possible a big button after the string which links to editing in the RTE Used for content element content displayed so the user can click the content / "Edit in Rich Text Editor" button. | |
| linkRTEbutton ($row) | |
| Adds a button to edit the row in RTE wizard. | |
| languageSelector ($id) | |
| Make selector box for creating new translation in a language Displays only languages which are not yet present for the current page. | |
| getResult ($result) | |
| Traverse the result pointer given, adding each record to array and setting some internal values at the same time. | |
| tt_board_getTree ($theRows, $parent, $pid, $qWhere, $treeIcons) | |
| Traverses recursively a branch in a message board. | |
| tt_board_drawItem ($table, $row, $re) | |
| Adds an element to the tt_board listing:. | |
| numberOfRecords ($table, $pid) | |
| Counts and returns the number of records on the page with $pid. | |
| renderText ($input) | |
| Processing of larger amounts of text (usually from RTE/bodytext fields) with word wrapping etc. | |
| getIcon ($table, $row) | |
| Creates the icon image tag for record from table and wraps it in a link which will trigger the click menu. | |
| getProcessedValue ($table, $fieldList, $row, &$info) | |
| Creates processed values for all fieldnames in $fieldList based on values from $row array. | |
| isDisabled ($table, $row) | |
| Returns true, if the record given as parameters is NOT visible based on hidden/starttime/endtime (if available). | |
| wordWrapper ($content, $max=50, $char='-') | |
| Will perform "word-wrapping" on the input string. | |
| noEditIcon ($label='noEditItems') | |
| Returns icon for "no-edit" of a record. | |
| cleanTableNames () | |
| Function, which fills in the internal array, $this->allowedTableNames with all tables to which the user has access. | |
| isRTEforField ($table, $row, $field) | |
| Checking if the RTE is available/enabled for a certain table/field and if so, it returns true. | |
| getSpecConfForField ($table, $row, $field) | |
| Returns "special" configuration from the "types" configuration in TCA for the record given by tablename/fieldname. | |
| getPageInfoBox ($rec, $edit=0) | |
| Creates an info-box for the current page (identified by input record). | |
| getTableMenu ($id) | |
| Creates a menu of the tables that can be listed by this function Only tables which has records on the page will be included. | |
Public Attributes | |
| $stat_select_field = 'page_id' | |
| $stat_codes = array() | |
| $pI_showUser = 0 | |
| $pI_showStat = 1 | |
| $nextThree = 3 | |
| $pages_noEditColumns = 0 | |
| $option_showBigButtons = 1 | |
| $option_newWizard = 1 | |
| $ext_function = 0 | |
| $doEdit = 1 | |
| $agePrefixes = ' min| hrs| days| yrs' | |
| $externalTables = array() | |
| $descrTable | |
| $defLangBinding = FALSE | |
| $tt_contentConfig | |
| $allowedTableNames = array() | |
| $activeTables = array() | |
| $tt_contentData | |
| $CType_labels = array() | |
| $itemLabels = array() | |
|
|
Function, which fills in the internal array, $this->allowedTableNames with all tables to which the user has access. Also a set of standard tables (pages, static_template, sys_filemounts, etc...) are filtered out. So what is left is basically all tables which makes sense to list content from.
Definition at line 2210 of file class.tx_cms_layout.php. Referenced by getTable_pages(). 02210 {
02211 global $TCA;
02212
02213 // Get all table names:
02214 $tableNames=array_flip(array_keys($TCA));
02215
02216 // Unset common names:
02217 unset($tableNames['pages']);
02218 unset($tableNames['static_template']);
02219 unset($tableNames['sys_filemounts']);
02220 unset($tableNames['sys_action']);
02221 unset($tableNames['sys_workflows']);
02222 unset($tableNames['be_users']);
02223 unset($tableNames['be_groups']);
02224
02225 $this->allowedTableNames=array();
02226
02227 // Traverse table names and set them in allowedTableNames array IF they can be read-accessed by the user.
02228 if (is_array($tableNames)) {
02229 foreach($tableNames as $k => $v) {
02230 if ($GLOBALS['BE_USER']->check('tables_select',$k)) {
02231 $this->allowedTableNames['table_'.$k]=$k;
02232 }
02233 }
02234 }
02235 }
|
|
||||||||||||||||||||
|
Adds content to all data fields in $out array.
Definition at line 1200 of file class.tx_cms_layout.php. References $out, $TCA, and table(). 01200 {
01201 global $TCA;
01202
01203 // Check table validity:
01204 if ($TCA[$table]) {
01205 t3lib_div::loadTCA($table);
01206 $thumbsCol = $TCA[$table]['ctrl']['thumbnail'];
01207
01208 // Traverse fields:
01209 foreach($fieldArr as $fieldName) {
01210
01211 if ($TCA[$table]['columns'][$fieldName]) { // Each field has its own cell (if configured in TCA)
01212 if ($fieldName==$thumbsCol) { // If the column is a thumbnail column:
01213 $out[$fieldName] = $this->thumbCode($row,$table,$fieldName);
01214 } else { // ... otherwise just render the output:
01215 $out[$fieldName] = nl2br(htmlspecialchars(trim(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getProcessedValue($table,$fieldName,$row[$fieldName]),250))));
01216 }
01217 } else { // Each field is separated by <br /> and shown in the same cell (If not a TCA field, then explode the field name with ";" and check each value there as a TCA configured field)
01218 $theFields = explode(';',$fieldName);
01219
01220 // Traverse fields, separated by ";" (displayed in a single cell).
01221 foreach($theFields as $fName2) {
01222 if ($TCA[$table]['columns'][$fName2]) {
01223 $out[$fieldName].= '<b>'.$GLOBALS['LANG']->sL($TCA[$table]['columns'][$fName2]['label'],1).'</b>'.
01224 ' '.
01225 htmlspecialchars(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getProcessedValue($table,$fName2,$row[$fName2]),25)).
01226 '<br />';
01227 }
01228 }
01229 }
01230 // If no value, add a nbsp.
01231 if (!$out[$fieldName]) $out[$fieldName]=' ';
01232
01233 // Wrap in dimmed-span tags if record is "disabled"
01234 if ($this->isDisabled($table,$row)) {
01235 $out[$fieldName] = $GLOBALS['TBE_TEMPLATE']->dfw($out[$fieldName]);
01236 }
01237 }
01238 }
01239 return $out;
01240 }
|
|
||||||||||||
|
Creates the icon image tag for record from table and wraps it in a link which will trigger the click menu.
Definition at line 2123 of file class.tx_cms_layout.php. References t3lib_iconWorks::getIconImage(), t3lib_BEfunc::getRecordIconAltText(), and table(). Referenced by getTable_sys_note(). 02123 {
02124
02125 // Initialization
02126 $alttext = t3lib_BEfunc::getRecordIconAltText($row,$table);
02127 $iconImg = t3lib_iconWorks::getIconImage($table,$row,$this->backPath,'title="'.$alttext.'"');
02128 $this->counter++;
02129
02130 // The icon with link
02131 $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg,$table,$row['uid']);
02132
02133 return $theIcon;
02134 }
|
|
||||||||||||||||
|
Filters out all tt_content uids which are already translated so only non-translated uids is left. Selects across columns, but within in the same PID. Columns are expect to be the same for translations and original but this may be a conceptual error (?)
Definition at line 1780 of file class.tx_cms_layout.php. 01780 {
01781 if ($lP && count($defLanguageCount)) {
01782
01783 // Select all translations here:
01784 $queryParts = $this->makeQueryArray('tt_content', $id, 'AND sys_language_uid='.intval($lP).' AND l18n_parent IN ('.implode(',',$defLanguageCount).')');
01785 $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
01786
01787 // Flip uids:
01788 $defLanguageCount = array_flip($defLanguageCount);
01789
01790 // Traverse any selected elements and unset original UID if any:
01791 $rowArr = $this->getResult($result);
01792 foreach($rowArr as $row) {
01793 unset($defLanguageCount[$row['l18n_parent']]);
01794 }
01795
01796 // Flip again:
01797 $defLanguageCount = array_keys($defLanguageCount);
01798 }
01799
01800 return $defLanguageCount;
01801 }
|
|
||||||||||||
|
Creates an info-box for the current page (identified by input record).
Definition at line 2312 of file class.tx_cms_layout.php. References $a, $out, t3lib_BEfunc::blindUserNames(), t3lib_BEfunc::date(), t3lib_BEfunc::datetime(), t3lib_iconWorks::getIconImage(), t3lib_BEfunc::getUserNames(), t3lib_extMgm::isLoaded(), and table(). 02312 {
02313 global $LANG;
02314
02315 // If editing of the page header is allowed:
02316 if ($edit) {
02317 $params='&edit[pages]['.$rec['uid'].']=edit';
02318 $editIcon='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath)).'">'.
02319 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.$GLOBALS['LANG']->getLL('edit',1).'" alt="" />'.
02320 '</a>';
02321 } else {
02322 $editIcon=$this->noEditIcon('noEditPage');
02323 }
02324
02325 // Setting page icon, link, title:
02326 $outPutContent = t3lib_iconWorks::getIconImage('pages',$rec,$this->backPath,'title="'.htmlspecialchars(t3lib_BEfunc::titleAttribForPages($rec)).'"').
02327 $editIcon.
02328 ' '.
02329 htmlspecialchars($rec['title']);
02330
02331
02332 // Init array where infomation is accumulated as label/value pairs.
02333 $lines=array();
02334
02335 // Owner user/group:
02336 if ($this->pI_showUser) {
02337 // User:
02338 $users= t3lib_BEfunc::getUserNames('username,usergroup,usergroup_cached_list,uid,realName');
02339 $groupArray = explode(',',$GLOBALS['BE_USER']->user['usergroup_cached_list']);
02340 $users=t3lib_BEfunc::blindUserNames($users,$groupArray);
02341 $lines[]=array($LANG->getLL('pI_crUser').':',htmlspecialchars($users[$rec['cruser_id']]['username']).' ('.$users[$rec['cruser_id']]['realName'].')');
02342 }
02343
02344 // Created:
02345 $lines[]=array($LANG->getLL('pI_crDate').':', t3lib_BEfunc::datetime($rec['crdate']).' ('.t3lib_BEfunc::calcAge(time()-$rec['crdate'],$this->agePrefixes).')');
02346
02347 // Last change:
02348 $lines[]=array($LANG->getLL('pI_lastChange').':', t3lib_BEfunc::datetime($rec['tstamp']).' ('.t3lib_BEfunc::calcAge(time()-$rec['tstamp'],$this->agePrefixes).')');
02349
02350 // Last change of content:
02351 if ($rec['SYS_LASTCHANGED']) {
02352 $lines[]=array($LANG->getLL('pI_lastChangeContent').':', t3lib_BEfunc::datetime($rec['SYS_LASTCHANGED']).' ('.t3lib_BEfunc::calcAge(time()-$rec['SYS_LASTCHANGED'],$this->agePrefixes).')');
02353 }
02354
02355 // Spacer:
02356 $lines[]='';
02357
02358 // Display contents of certain page fields, if any value:
02359 $dfields = explode(',','alias,target,hidden,starttime,endtime,fe_group,no_cache,cache_timeout,newUntil,lastUpdated,subtitle,keywords,description,abstract,author,author_email');
02360 foreach($dfields as $fV) {
02361 if ($rec[$fV]) {
02362 $lines[]=array($GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('pages',$fV)), t3lib_BEfunc::getProcessedValue('pages',$fV,$rec[$fV]));
02363 }
02364 }
02365
02366 // Page hits (depends on "sys_stat" extension)
02367 if ($this->pI_showStat && t3lib_extMgm::isLoaded('sys_stat')) {
02368
02369 // Counting total hits:
02370 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'sys_stat', 'page_id='.intval($rec['uid']));
02371 $rrow = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
02372 if ($rrow[0]) {
02373
02374 // Get min/max
02375 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('min(tstamp) AS min,max(tstamp) AS max', 'sys_stat', 'page_id='.intval($rec['uid']));
02376 $rrow2 = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
02377
02378 $lines[]='';
02379 $lines[]=array($LANG->getLL('pI_hitsPeriod').':',t3lib_BEfunc::date($rrow2[0]).' - '.t3lib_BEfunc::date($rrow2[1]).' ('.t3lib_BEfunc::calcAge($rrow2[1]-$rrow2[0],$this->agePrefixes).')');
02380 $lines[]=array($LANG->getLL('pI_hitsTotal').':',$rrow[0]);
02381
02382
02383 // Last 10 days
02384 $nextMidNight = mktime (0,0,0)+1*3600*24;
02385
02386 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*), FLOOR(('.$nextMidNight.'-tstamp)/(24*3600)) AS day', 'sys_stat', 'page_id='.intval($rec['uid']).' AND tstamp>'.($nextMidNight-10*24*3600), 'day');
02387 $days=array();
02388 while($rrow = $GLOBALS['TYPO3_DB']->sql_fetch_row($res)) {
02389 $days[$rrow[1]] = $rrow[0];
02390 }
02391
02392 $headerH=array();
02393 $contentH=array();
02394 for($a=9;$a>=0;$a--) {
02395 $headerH[]='
02396 <td class="bgColor5" nowrap="nowrap"> '.date('d',$nextMidNight-($a+1)*24*3600).' </td>';
02397 $contentH[]='
02398 <td align="center">'.($days[$a] ? intval($days[$a]) : '-').'</td>';
02399 }
02400
02401 // Compile first hit-table (last 10 days)
02402 $hitTable='
02403 <table border="0" cellpadding="0" cellspacing="1" class="typo3-page-hits">
02404 <tr>'.implode('',$headerH).'</tr>
02405 <tr>'.implode('',$contentH).'</tr>
02406 </table>';
02407 $lines[]=array($LANG->getLL('pI_hits10days').':',$hitTable,1);
02408
02409
02410 // Last 24 hours
02411 $nextHour = mktime (date('H'),0,0)+3600;
02412 $hours=16;
02413
02414 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*), FLOOR(('.$nextHour.'-tstamp)/3600) AS hours', 'sys_stat', 'page_id='.intval($rec['uid']).' AND tstamp>'.($nextHour-$hours*3600), 'hours');
02415 $days=array();
02416 while($rrow = $GLOBALS['TYPO3_DB']->sql_fetch_row($res)) {
02417 $days[$rrow[1]]=$rrow[0];
02418 }
02419
02420 $headerH=array();
02421 $contentH=array();
02422 for($a=($hours-1);$a>=0;$a--) {
02423 $headerH[]='
02424 <td class="bgColor5" nowrap="nowrap"> '.intval(date('H',$nextHour-($a+1)*3600)).' </td>';
02425 $contentH[]='
02426 <td align="center">'.($days[$a] ? intval($days[$a]) : '-').'</td>';
02427 }
02428
02429 // Compile second hit-table (last 24 hours)
02430 $hitTable='
02431 <table border="0" cellpadding="0" cellspacing="1" class="typo3-page-stat">
02432 <tr>'.implode('',$headerH).'</tr>
02433 <tr>'.implode('',$contentH).'</tr>
02434 </table>';
02435 $lines[]=array($LANG->getLL('pI_hits24hours').':',$hitTable,1);
02436 }
02437 }
02438
02439
02440 // Finally, wrap the elements in the $lines array in table cells/rows
02441 foreach($lines as $fV) {
02442 if (is_array($fV)) {
02443 if (!$fV[2]) $fV[1]=htmlspecialchars($fV[1]);
02444 $out.='
02445 <tr>
02446 <td class="bgColor4" nowrap="nowrap"><strong>'.htmlspecialchars($fV[0]).' </strong></td>
02447 <td class="bgColor4">'.$fV[1].'</td>
02448 </tr>';
02449 } else {
02450 $out.='
02451 <tr>
02452 <td colspan="2"><img src="clear.gif" width="1" height="3" alt="" /></td>
02453 </tr>';
02454 }
02455 }
02456
02457 // Wrap table tags around...
02458 $outPutContent.='
02459
02460
02461
02462 <!--
02463 Page info box:
02464 -->
02465 <table border="0" cellpadding="0" cellspacing="1" id="typo3-page-info">
02466 '.$out.'
02467 </table>';
02468
02469 // ... and return it.
02470 return $outPutContent;
02471 }
|
|
||||||||||||||||||||
|
Creates processed values for all fieldnames in $fieldList based on values from $row array. The result is 'returned' through $info which is passed as a reference
Definition at line 2146 of file class.tx_cms_layout.php. References table(). Referenced by getTable_sys_note(). 02146 {
02147
02148 // Splitting values from $fieldList:
02149 $fieldArr = explode(',',$fieldList);
02150
02151 // Traverse fields from $fieldList:
02152 foreach($fieldArr as $field) {
02153 if ($row[$field]) {
02154 $info[]= htmlspecialchars($this->itemLabels[$field]).' '.htmlspecialchars(t3lib_BEfunc::getProcessedValue($table,$field,$row[$field]));
02155 }
02156 }
02157 }
|
|
|
Traverse the result pointer given, adding each record to array and setting some internal values at the same time.
Definition at line 1939 of file class.tx_cms_layout.php. References $a. Referenced by getTable_tt_content(). 01939 {
01940
01941 // Initialize:
01942 $editUidList='';
01943 $recs=Array();
01944 $nextTree = $this->nextThree;
01945 $c=0;
01946 $output=Array();
01947
01948 // Traverse the result:
01949 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
01950
01951 // Add the row to the array:
01952 $output[]=$row;
01953
01954 // Set an internal register:
01955 $recs[$c]=$row['uid'];
01956
01957 // Create the list of the next three ids (for editing links...)
01958 for($a=0;$a<$nextTree;$a++) {
01959 if(isset($recs[$c-$a])) {
01960 $this->tt_contentData['nextThree'][$recs[$c-$a]].=$row['uid'].',';
01961 }
01962 }
01963
01964 // Set next/previous ids:
01965 if (isset($recs[$c-1])) {
01966 if (isset($recs[$c-2])) {
01967 $this->tt_contentData['prev'][$row['uid']]=-$recs[$c-2];
01968 } else {
01969 $this->tt_contentData['prev'][$row['uid']]=$row['pid'];
01970 }
01971 $this->tt_contentData['next'][$recs[$c-1]]=-$row['uid'];
01972 }
01973 $c++;
01974 }
01975
01976 // Return selected records
01977 return $output;
01978 }
|
|
||||||||||||||||
|
Returns "special" configuration from the "types" configuration in TCA for the record given by tablename/fieldname. Used by isRTEforField() in the process of finding whether a field has RTE enabled or not.
Definition at line 2275 of file class.tx_cms_layout.php. References t3lib_BEfunc::getTCAtypes(), and table(). 02275 {
02276
02277 // Get types-configuration for the record:
02278 $types_fieldConfig = t3lib_BEfunc::getTCAtypes($table,$row);
02279
02280 // Find the given field and return the spec key value if found:
02281 if (is_array($types_fieldConfig)) {
02282 foreach($types_fieldConfig as $vconf) {
02283 if ($vconf['field']==$field) return $vconf['spec'];
02284 }
02285 }
02286 }
|
|
||||||||||||
|
Adds the code of a single table.
Definition at line 179 of file class.tx_cms_layout.php. References $out, getTable_fe_users(), getTable_pages(), getTable_sys_note(), getTable_tt_address(), getTable_tt_board(), getTable_tt_calender(), getTable_tt_content(), getTable_tt_guest(), getTable_tt_links(), getTable_tt_news(), getTable_tt_products(), makeOrdinaryList(), and table(). 00179 {
00180
00181 // Load full table definition:
00182 t3lib_div::loadTCA($table);
00183
00184 if (isset($this->externalTables[$table])) {
00185 $fList = $this->externalTables[$table][0]['fList']; // eg. "name;title;email;company,image"
00186 $icon = $this->externalTables[$table][0]['icon']; // Boolean,
00187
00188 // Create listing
00189 $out = $this->makeOrdinaryList($table, $id, $fList, $icon);
00190 return $out;
00191 } else {
00192 // Branch out based on table name:
00193 // Notice: Most of these tables belongs to other extensions than 'cms'. Each of these tables can be rendered only if the extensions they belong to is loaded.
00194 switch($table) {
00195 case 'pages':
00196 return $this->getTable_pages($id);
00197 break;
00198 case 'tt_content':
00199 return $this->getTable_tt_content($id);
00200 break;
00201 case 'fe_users':
00202 return $this->getTable_fe_users($id);
00203 break;
00204 case 'sys_note':
00205 return $this->getTable_sys_note($id);
00206 break;
00207 case 'tt_board':
00208 return $this->getTable_tt_board($id);
00209 break;
00210 case 'tt_address':
00211 return $this->getTable_tt_address($id);
00212 break;
00213 case 'tt_links':
00214 return $this->getTable_tt_links($id);
00215 break;
00216 case 'tt_guest':
00217 return $this->getTable_tt_guest($id);
00218 break;
00219 case 'tt_news':
00220 return $this->getTable_tt_news($id);
00221 break;
00222 case 'tt_calender':
00223 return $this->getTable_tt_calender($id);
00224 break;
00225 case 'tt_products':
00226 return $this->getTable_tt_products($id);
00227 break;
00228 }
00229 }
00230 }
|
|
|
Renders Frontend Users from the fe_users table from page id.
Definition at line 736 of file class.tx_cms_layout.php. References $out, and makeOrdinaryList(). Referenced by getTable(). 00736 {
00737
00738 $this->addElement_tdParams=array(
00739 'username'=>' nowrap="nowrap"',
00740 'password'=>' nowrap="nowrap"',
00741 'usergroup'=>' nowrap="nowrap"',
00742 'name'=>' nowrap="nowrap"',
00743 'address'=>' nowrap="nowrap"',
00744 'zip'=>' nowrap="nowrap"',
00745 'city'=>' nowrap="nowrap"',
00746 'email'=>' nowrap="nowrap"',
00747 'telephone'=>' nowrap="nowrap"'
00748 );
00749 $fList = 'username,password,usergroup,name,email,telephone,address,zip,city';
00750 $out = $this->makeOrdinaryList('fe_users',$id, $fList, 1);
00751 $this->addElement_tdParams=array();
00752 return $out;
00753 }
|
|
|
Renders records from the pages table from page id (Used to get information about the page tree content by "Web>Info"!).
Definition at line 239 of file class.tx_cms_layout.php. References $out, $TCA, cleanTableNames(), t3lib_BEfunc::cshItem(), t3lib_BEfunc::deleteClause(), pages_drawItem(), pages_getTree(), and table(). Referenced by getTable(). 00239 {
00240 global $TCA;
00241
00242 // Initializing:
00243 $out='';
00244 $delClause = t3lib_BEfunc::deleteClause('pages').' AND '.$GLOBALS['BE_USER']->getPagePermsClause(1); // Select clause for pages:
00245
00246 // Select current page:
00247 if (!$id) {
00248 $row = $GLOBALS['SOBE']->pageinfo; // The root has a pseudo record in pageinfo...
00249 } else {
00250 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'pages', 'uid='.intval($id).$delClause);
00251 $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
00252 }
00253
00254 // If there was found a page:
00255 if (is_array($row)) {
00256
00257 // Select which fields to show:
00258 $pKey = $GLOBALS['SOBE']->MOD_SETTINGS['function']=='tx_cms_webinfo_hits' ? 'hits' : $GLOBALS['SOBE']->MOD_SETTINGS['pages'];
00259 switch($pKey) {
00260 case 'hits':
00261 $this->fieldArray = explode(',','title,'.implode(',',$this->stat_codes));
00262 break;
00263 case 1:
00264 $this->cleanTableNames();
00265 $tableNames=$this->allowedTableNames;
00266 $this->fieldArray = explode(',','title,uid,'.implode(',',array_keys($tableNames)));
00267 break;
00268 case 2:
00269 $this->fieldArray = explode(',','title,uid,lastUpdated,newUntil,no_cache,cache_timeout,php_tree_stop,TSconfig,storage_pid,is_siteroot');
00270 break;
00271 default:
00272 $this->fieldArray = explode(',','title,uid,alias,starttime,endtime,fe_group,target,url,shortcut');
00273 break;
00274 }
00275
00276 // Getting select-depth:
00277 $depth=intval($GLOBALS['SOBE']->MOD_SETTINGS['pages_levels']);
00278
00279 // Half line is drawn
00280 $theData = Array();
00281 $theData['subject'] = $this->widthGif;
00282 $out.=$this->addelement(0,'',$theData);
00283
00284 // Overriding a few things:
00285 $this->no_noWrap=0;
00286 $this->oddColumnsTDParams=' class="bgColor3-20"';
00287
00288 // Items
00289 $this->eCounter=$this->firstElementNumber;
00290
00291 // Creating elements:
00292 list($flag,$code) = $this->fwd_rwd_nav();
00293 $out.=$code;
00294 $editUids=array();
00295 if ($flag) {
00296
00297 // Getting children:
00298 $theRows = Array();
00299 $theRows = $this->pages_getTree($theRows,$row['uid'],$delClause,'',$depth);
00300 if ($GLOBALS['BE_USER']->doesUserHaveAccess($row,2)) $editUids[]=$row['uid'];
00301 $out.=$this->pages_drawItem($row,$this->fieldArray);
00302
00303 // Traverse all pages selected:
00304 foreach($theRows as $n => $sRow) {
00305 if ($GLOBALS['BE_USER']->doesUserHaveAccess($sRow,2)) $editUids[]=$sRow['uid'];
00306 $out.=$this->pages_drawItem($sRow,$this->fieldArray);
00307 }
00308 $this->eCounter++;
00309 }
00310
00311 // Header line is drawn
00312 $theData = Array();
00313 $editIdList = implode(',', $editUids);
00314
00315 // Traverse fields (as set above) in order to create header values:
00316 foreach($this->fieldArray as $field) {
00317 if ($editIdList && isset($TCA['pages']['columns'][$field]) && $field!='uid' && !$this->pages_noEditColumns) {
00318 $params='&edit[pages]['.$editIdList.']=edit&columnsOnly='.$field.'&disHelp=1';
00319 $iTitle = sprintf($GLOBALS['LANG']->getLL('editThisColumn'),ereg_replace(':$','',trim($GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('pages',$field)))));
00320 $eI= '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,'')).'">'.
00321 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.htmlspecialchars($iTitle).'" alt="" />'.
00322 '</a>';
00323 } else $eI='';
00324 switch($field) {
00325 case 'title':
00326 $theData[$field] = ' <b>'.$GLOBALS['LANG']->sL($TCA['pages']['columns'][$field]['label']).'</b>'.$eI;
00327 break;
00328 case 'uid':
00329 $theData[$field] = ' <b>ID:</b>';
00330 break;
00331 default:
00332 if (substr($field,0,6)=='table_') {
00333 $f2 = substr($field,6);
00334 if ($TCA[$f2]) {
00335 $theData[$field] = ' '.t3lib_iconWorks::getIconImage($f2,array(),$this->backPath,'title="'.$GLOBALS['LANG']->sL($TCA[$f2]['ctrl']['title'],1).'"');
00336 }
00337 } elseif (substr($field,0,5)=='HITS_') {
00338 $fParts = explode(':',substr($field,5));
00339 switch($fParts[0]) {
00340 case 'days':
00341 $timespan = mktime (0,0,0)+intval($fParts[1])*3600*24;
00342 $theData[$field]=' '.date('d',$timespan);
00343 break;
00344 default:
00345 $theData[$field] = '';
00346 break;
00347 }
00348 } else {
00349 $theData[$field] = ' <b>'.$GLOBALS['LANG']->sL($TCA['pages']['columns'][$field]['label'],1).'</b>'.$eI;
00350 }
00351 break;
00352 }
00353 }
00354
00355 // Start table:
00356 $this->oddColumnsTDParams = '';
00357
00358 // CSH:
00359 $out = t3lib_BEfunc::cshItem($this->descrTable,'func_'.$pKey,$GLOBALS['BACK_PATH']).
00360 '
00361 <table border="0" cellpadding="0" cellspacing="0" class="typo3-page-pages">
00362 '.$this->addelement(1,'',$theData,' class="c-headLine"',20).
00363 $out.'
00364 </table>';
00365 }
00366 $this->oddColumnsTDParams = '';
00367 return $out;
00368 }
|
|
|
Renders records from the sys_notes table from page id NOTICE: Requires the sys_note extension to be loaded.
Definition at line 762 of file class.tx_cms_layout.php. References $out, t3lib_BEfunc::deleteClause(), getIcon(), getProcessedValue(), t3lib_extMgm::isLoaded(), message(), and table(). Referenced by getTable(). 00762 {
00763 global $TCA;
00764
00765 if (!t3lib_extMgm::isLoaded('sys_note')) return '';
00766
00767 // INIT:
00768 $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
00769 $tree = $this->getTreeObject($id,intval($GLOBALS['SOBE']->MOD_SETTINGS['pages_levels']),$perms_clause);
00770
00771 $this->itemLabels =array();
00772 foreach($TCA['sys_note']['columns'] as $name => $val) {
00773 $this->itemLabels[$name]=$GLOBALS['LANG']->sL($val['label']);
00774 }
00775
00776 // If page ids were found, select all sys_notes from the page ids:
00777 $out='';
00778 if (count($tree->ids)) {
00779 $delClause = t3lib_BEfunc::deleteClause('sys_note');
00780 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_note', 'pid IN ('.implode(',',$tree->ids).') AND (!personal OR cruser='.intval($GLOBALS['BE_USER']->user['uid']).')'.$delClause);
00781 $dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);
00782
00783 // If sys_notes were found, render them:
00784 if ($dbCount) {
00785 $this->fieldArray = explode(',','__cmds__,info,note');
00786
00787 // header line is drawn
00788 $theData = Array();
00789 $theData['__cmds__'] ='';
00790 $theData['info'] = '<b>Info</b><br /><img src="clear.gif" height="1" width="220" alt="" />';
00791 $theData['note'] = '<b>Note</b>';
00792 $out.=$this->addelement(1,'',$theData,' class="c-headLine"',20);
00793
00794 // half line is drawn
00795 $theData = Array();
00796 $theData['info'] = $this->widthGif;
00797 $out.=$this->addelement(0,'',$theData);
00798
00799 $this->no_noWrap=1;
00800
00801 // Items
00802 $this->eCounter=$this->firstElementNumber;
00803 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
00804 list($flag,$code) = $this->fwd_rwd_nav();
00805 $out.=$code;
00806 if ($flag) {
00807 $color = Array (
00808 0 => '', // No category
00809 1 => ' class="bgColor4"', // Instructions
00810 2 => ' class="bgColor2"', // Template
00811 3 => '', // Notes
00812 4 => ' class="bgColor5"' // To-do
00813 );
00814 $tdparams = $color[$row['category']];
00815 $info = Array();;
00816 $theData = Array();
00817 $this->getProcessedValue('sys_note','subject,category,author,email,personal',$row,$info);
00818 $cont=implode('<br />',$info);
00819 $head = '<b>Page:</b> '.t3lib_BEfunc::getRecordPath($row['pid'],$perms_clause,10).'<br />';
00820
00821 $theData['__cmds__']= $this->getIcon('sys_note',$row);
00822 $theData['info'] = $head.$cont;
00823 $theData['note'] = nl2br($row['message']);
00824
00825 $out.=$this->addelement(1,'',$theData,$tdparams,20);
00826
00827
00828 // half line is drawn
00829 $theData = Array();
00830 $theData['info'] = $this->widthGif;
00831 $out.=$this->addelement(0,'',$theData);
00832 }
00833 $this->eCounter++;
00834 }
00835
00836 // Wrap it all in a table:
00837 $out='
00838 <table border="0" cellpadding="1" cellspacing="2" width="480" class="typo3-page-sysnote">
00839 '.$out.'
00840 </table>';
00841 }
00842 }
00843 return $out;
00844 }
|
|
|
Renders address records from the tt_address table from page id NOTICE: Requires the tt_address extension to be loaded.
Definition at line 933 of file class.tx_cms_layout.php. References $out. Referenced by getTable(). 00933 {
00934
00935 // Define fieldlist to show:
00936 switch($GLOBALS['SOBE']->MOD_SETTINGS['tt_address']) {
00937 case 1:
00938 $icon = 0;
00939 $fList = 'name,address,zip,city,country';
00940 break;
00941 case 2:
00942 $icon = 1;
00943 $fList = 'name;title;email;company,image';
00944 break;
00945 default:
00946 $icon = 0;
00947 $fList = 'name,email,www,phone,fax,mobile';
00948 break;
00949 }
00950
00951 // Create listing
00952 $out = $this->makeOrdinaryList('tt_address',$id, $fList, $icon);
00953 return $out;
00954 }
|
|
|
Renders records from the tt_board table from page id NOTICE: Requires the tt_board extension to be loaded.
Definition at line 853 of file class.tx_cms_layout.php. References $out, t3lib_BEfunc::deleteClause(), and table(). Referenced by getTable(). 00853 {
00854
00855 // Initialize:
00856 $delClause = t3lib_BEfunc::deleteClause('tt_board');
00857 $queryParts = $this->makeQueryArray('tt_board', $id, 'AND parent=0');
00858 $this->setTotalItems($queryParts);
00859 $dbCount = 0;
00860
00861 // If items were selected, make query:
00862 if ($this->totalItems) {
00863 $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
00864 $dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);
00865 }
00866
00867 // If results came out of that, render the list:
00868 $out='';
00869 if ($dbCount) {
00870
00871 // Setting fields to display first:
00872 if ($GLOBALS['SOBE']->MOD_SETTINGS['tt_board']=='expand') {
00873 $this->fieldArray = explode(',','subject,author,date,age');
00874 } else {
00875 $this->fieldArray = explode(',','subject,author,date,age,replys');
00876 }
00877
00878 // Header line is drawn
00879 $theData = Array();
00880 $theData['subject'] = '<b>'.$GLOBALS['LANG']->getLL('tt_board_subject',1).'</b>';
00881 $theData['author'] = '<b>'.$GLOBALS['LANG']->getLL('tt_board_author',1).'</b>';
00882 $theData['date'] = '<b>'.$GLOBALS['LANG']->getLL('tt_board_date',1).'</b>';
00883 $theData['age'] = '<b>'.$GLOBALS['LANG']->getLL('tt_board_age',1).'</b>';
00884 if ($GLOBALS['SOBE']->MOD_SETTINGS['tt_board']!='expand') {
00885 $theData['replys'] = '<b>'.$GLOBALS['LANG']->getLL('tt_board_RE',1).'</b>';
00886 }
00887 $out.=$this->addelement(1,'',$theData,' class="c-headLine"',20);
00888
00889 // half line is drawn
00890 $theData = Array();
00891 $theData['subject'] = $this->widthGif;
00892 $out.=$this->addelement(0,'',$theData);
00893
00894 // Items
00895 $this->eCounter=$this->firstElementNumber;
00896 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
00897 list($flag,$code) = $this->fwd_rwd_nav();
00898 $out.=$code;
00899
00900 if ($flag) {
00901
00902 $theRows = Array();
00903 $theRows = $this->tt_board_getTree ($theRows,$row['uid'],$id,$delClause,'');
00904 $out.=$this->tt_board_drawItem('tt_board',$row,count($theRows));
00905
00906 if ($GLOBALS['SOBE']->MOD_SETTINGS['tt_board']=='expand') {
00907 reset($theRows);
00908 while(list($n,$sRow)=each($theRows)) {
00909 $out.=$this->tt_board_drawItem('tt_board',$sRow,0);
00910 }
00911 }
00912 }
00913 $this->eCounter++;
00914 }
00915
00916 // Wrap it all in a table:
00917 $out='
00918 <table border="0" cellpadding="0" cellspacing="0" class="typo3-page-listTTboard">
00919 '.$out.'
00920 </table>';
00921 }
00922
00923 return $out;
00924 }
|
|
|
Renders calender elements link records from the tt_calender table from page id NOTICE: Requires the tt_calender extension to be loaded.
Definition at line 1025 of file class.tx_cms_layout.php. References $out. Referenced by getTable(). 01025 {
01026
01027 $type=$GLOBALS['SOBE']->MOD_SETTINGS['tt_calender'];
01028 switch($type) {
01029 case 'date':
01030 // Date default
01031 $fList = 'date,title';
01032 $icon=0;
01033 $out = $this->makeOrdinaryList('tt_calender',$id, $fList, $icon, ' AND type=0');
01034 return $out;
01035 break;
01036 case 'date_ext':
01037 // Date extended
01038 $fList = 'title;date;time;datetext;link,note';
01039 $icon=1;
01040 $out = $this->makeOrdinaryList('tt_calender',$id, $fList, $icon, ' AND type=0');
01041 return $out;
01042 break;
01043 case 'todo':
01044 // Todo default
01045 $fList = 'title,complete,priority,date';
01046 $icon=0;
01047 $out = $this->makeOrdinaryList('tt_calender',$id, $fList, $icon, ' AND type=1');
01048 return $out;
01049 break;
01050 case 'todo_ext':
01051 // Todo extended
01052 $fList = 'title;complete;priority;date;workgroup;responsible;category,note';
01053 $icon=1;
01054 $out = $this->makeOrdinaryList('tt_calender',$id, $fList, $icon, ' AND type=1');
01055 return $out;
01056 break;
01057 default:
01058 // Overview, both todo and calender
01059 $fList = 'title,date,time,week';
01060 $icon=1;
01061 $out = $this->makeOrdinaryList('tt_calender',$id, $fList, $icon, ' AND type=0');
01062 $out.= $this->makeOrdinaryList('tt_calender',$id, $fList, $icon, ' AND type=1');
01063 return $out;
01064 break;
01065 }
01066 }
|
|
|
Renders Content Elements from the tt_content table from page id.
Definition at line 376 of file class.tx_cms_layout.php. References $content, $defLangBinding, $out, $val, t3lib_BEfunc::BEenableFields(), t3lib_BEfunc::cshItem(), t3lib_BEfunc::getRecordsByField(), getResult(), header(), isRTEforField(), languageSelector(), newContentElementOnClick(), table(), tt_content_drawColHeader(), tt_content_drawHeader(), and tt_content_drawItem(). Referenced by getTable(). 00376 {
00377 global $TCA;
00378
00379 $this->initializeLanguages();
00380
00381 // Initialize:
00382 $RTE = $GLOBALS['BE_USER']->isRTE();
00383 $lMarg=1;
00384 $showHidden = $this->tt_contentConfig['showHidden']?'':t3lib_BEfunc::BEenableFields('tt_content');
00385 $pageTitleParamForAltDoc='&recTitle='.rawurlencode(t3lib_BEfunc::getRecordTitle('pages',t3lib_BEfunc::getRecord('pages',$id),1));
00386
00387 // Get labels for CTypes and tt_content element fields in general:
00388 $this->CType_labels =array();
00389 foreach($TCA['tt_content']['columns']['CType']['config']['items'] as $val) {
00390 $this->CType_labels[$val[1]]=$GLOBALS['LANG']->sL($val[0]);
00391 }
00392 $this->itemLabels =array();
00393 foreach($TCA['tt_content']['columns'] as $name => $val) {
00394 $this->itemLabels[$name]=$GLOBALS['LANG']->sL($val['label']);
00395 }
00396
00397
00398 // Select display mode:
00399 if (!$this->tt_contentConfig['single']) { // MULTIPLE column display mode, side by side:
00400
00401 // Setting language list:
00402 $langList = $this->tt_contentConfig['sys_language_uid'];
00403 if ($this->tt_contentConfig['languageMode']) {
00404 if ($this->tt_contentConfig['languageColsPointer']) {
00405 $langList='0,'.$this->tt_contentConfig['languageColsPointer'];
00406 } else {
00407 $langList=implode(',',array_keys($this->tt_contentConfig['languageCols']));
00408 }
00409 $languageColumn = array();
00410 }
00411 $langListArr = explode(',',$langList);
00412 $defLanguageCount = array();
00413 $defLangBinding = array();
00414
00415 // For EACH languages... :
00416 foreach($langListArr as $lP) { // If NOT languageMode, then we'll only be through this once.
00417 $showLanguage = $this->defLangBinding && $lP==0 ? ' AND sys_language_uid IN (0,-1)' : ' AND sys_language_uid='.$lP;
00418 $cList = explode(',',$this->tt_contentConfig['cols']);
00419 $content = array();
00420 $head = array();
00421
00422 // For EACH column, render the content into a variable:
00423 foreach($cList as $key) {
00424 if (!$lP) $defLanguageCount[$key] = array();
00425
00426 // Select content elements from this column/language:
00427 $queryParts = $this->makeQueryArray('tt_content', $id, 'AND colPos='.intval($key).$showHidden.$showLanguage);
00428 $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
00429
00430 // If it turns out that there are not content elements in the column, then display a big button which links directly to the wizard script:
00431 if ($this->doEdit && $this->option_showBigButtons && !intval($key) && !$GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
00432 $onClick = "document.location='db_new_content_el.php?id=".$id.'&colPos='.intval($key).'&sys_language_uid='.$lP.'&uid_pid='.$id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';";
00433 $theNewButton = $GLOBALS['SOBE']->doc->t3Button($onClick,$GLOBALS['LANG']->getLL('newPageContent'));
00434 $content[$key].= '<img src="clear.gif" width="1" height="5" alt="" /><br />'.$theNewButton;
00435 }
00436
00437 // Traverse any selected elements and render their display code:
00438 $rowArr = $this->getResult($result);
00439
00440 foreach($rowArr as $row) {
00441 $singleElementHTML = '';
00442 if (!$lP) $defLanguageCount[$key][] = $row['uid'];
00443
00444 $editUidList.= $row['uid'].',';
00445 $singleElementHTML.= $this->tt_content_drawHeader($row,$this->tt_contentConfig['showInfo']?15:5, $this->defLangBinding && $lP>0, TRUE);
00446
00447 $isRTE = $RTE && $this->isRTEforField('tt_content',$row,'bodytext');
00448 $singleElementHTML.= $this->tt_content_drawItem($row,$isRTE);
00449
00450 if ($this->defLangBinding && $this->tt_contentConfig['languageMode']) {
00451 $defLangBinding[$key][$lP][$row[($lP ? 'l18n_parent' : 'uid')]] = $singleElementHTML;
00452 } else {
00453 $content[$key].= $singleElementHTML;
00454 }
00455 }
00456
00457 // Add new-icon link, header:
00458 $newP = $this->newContentElementOnClick($id,$key,$lP);
00459 $head[$key].= $this->tt_content_drawColHeader(t3lib_BEfunc::getProcessedValue('tt_content','colPos',$key), ($this->doEdit&&count($rowArr)?'&edit[tt_content]['.$editUidList.']=edit'.$pageTitleParamForAltDoc:''), $newP);
00460 $editUidList = '';
00461 }
00462
00463 // For EACH column, fit the rendered content into a table cell:
00464 $out='';
00465 foreach($cList as $k => $key) {
00466 if (!$k) {
00467 $out.= '
00468 <td><img src="clear.gif" width="'.$lMarg.'" height="1" alt="" /></td>';
00469 } else {
00470 $out.= '
00471 <td><img src="clear.gif" width="4" height="1" alt="" /></td>
00472 <td bgcolor="black"><img src="clear.gif" width="1" height="1" alt="" /></td>
00473 <td><img src="clear.gif" width="4" height="1" alt="" /></td>';
00474 }
00475 $out.= '
00476 <td valign="top">'.$head[$key].$content[$key].'</td>';
00477
00478 // Storing content for use if languageMode is set:
00479 if ($this->tt_contentConfig['languageMode']) {
00480 $languageColumn[$key][$lP] = $head[$key].$content[$key];
00481 if (!$this->defLangBinding) {
00482 $languageColumn[$key][$lP].='<br /><br />'.$this->newLanguageButton($this->getNonTranslatedTTcontentUids($defLanguageCount[$key],$id,$lP),$lP);
00483 }
00484 }
00485 }
00486
00487 // Wrap the cells into a table row:
00488 $out = '
00489 <table border="0" cellpadding="0" cellspacing="0" width="480" class="typo3-page-cols">
00490 <tr>'.$out.'
00491 </tr>
00492 </table>';
00493
00494 // CSH:
00495 $out.= t3lib_BEfunc::cshItem($this->descrTable,'columns_multi',$GLOBALS['BACK_PATH']);
00496 }
00497
00498 // If language mode, then make another presentation:
00499 // Notice that THIS presentation will override the value of $out! But it needs the code above to execute since $languageColumn is filled with content we need!
00500 if ($this->tt_contentConfig['languageMode']) {
00501
00502 // Get language selector:
00503 $languageSelector = $this->languageSelector($id);
00504
00505 // Reset out - we will make new content here:
00506 $out='';
00507 // Separator between language columns (black thin line)
00508 $midSep = '
00509 <td><img src="clear.gif" width="4" height="1" alt="" /></td>
00510 <td bgcolor="black"><img src="clear.gif" width="1" height="1" alt="" /></td>
00511 <td><img src="clear.gif" width="4" height="1" alt="" /></td>';
00512
00513 // Traverse languages found on the page and build up the table displaying them side by side:
00514 $cCont=array();
00515 $sCont=array();
00516 foreach($langListArr as $lP) {
00517
00518 // Header:
00519 $cCont[$lP]='
00520 <td valign="top" align="center" class="bgColor6"><strong>'.htmlspecialchars($this->tt_contentConfig['languageCols'][$lP]).'</strong></td>';
00521
00522 // "View page" icon is added:
00523 $viewLink = '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::viewOnClick($this->id,$this->backPath,t3lib_BEfunc::BEgetRootLine($this->id),'','','&L='.$lP)).'">'.
00524 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/zoom.gif','width="12" height="12"').' class="absmiddle" title="" alt="" />'.
00525 '</a>';
00526
00527 // Language overlay page header:
00528 if ($lP) {
00529
00530 list($lpRecord) = t3lib_BEfunc::getRecordsByField('pages_language_overlay','pid',$id,'AND sys_language_uid='.intval($lP));
00531 $params='&edit[pages_language_overlay]['.$lpRecord['uid'].']=edit&overrideVals[pages_language_overlay][sys_language_uid]='.$lP;
00532 $lPLabel = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon(t3lib_iconWorks::getIconImage('pages_language_overlay',$lpRecord,$this->backPath,' class="absmiddle"'),'pages_language_overlay',$lpRecord['uid']).
00533 $viewLink.
00534 ($GLOBALS['BE_USER']->check('tables_modify','pages_language_overlay') ? '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath)).'">'.
00535 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.$GLOBALS['LANG']->getLL('edit',1).'" class="absmiddle" alt="" />'.
00536 '</a>' : '').
00537 htmlspecialchars(t3lib_div::fixed_lgd_cs($lpRecord['title'],20));
00538 } else {
00539 $lPLabel = $viewLink;
00540 }
00541 $sCont[$lP]='
00542 <td nowrap="nowrap">'.$lPLabel.'</td>';
00543 }
00544 // Add headers:
00545 $out.='
00546 <tr>'.implode($midSep,$cCont).'
00547 </tr>';
00548 $out.='
00549 <tr>'.implode($midSep,$sCont).'
00550 </tr>';
00551
00552 // Traverse previously built content for the columns:
00553 foreach($languageColumn as $cKey => $cCont) {
00554 $out.='
00555 <tr>
00556 <td valign="top">'.implode('</td>'.$midSep.'
00557 <td valign="top">',$cCont).'</td>
00558 </tr>';
00559
00560 if ($this->defLangBinding) {
00561 // "defLangBinding" mode
00562 foreach($defLanguageCount[$cKey] as $defUid) {
00563 $cCont=array();
00564 foreach($langListArr as $lP) {
00565 $cCont[] = $defLangBinding[$cKey][$lP][$defUid].
00566 '<br/>'.$this->newLanguageButton($this->getNonTranslatedTTcontentUids(array($defUid),$id,$lP),$lP);
00567 }
00568 $out.='
00569 <tr>
00570 <td valign="top">'.implode('</td>'.$midSep.'
00571 <td valign="top">',$cCont).'</td>
00572 </tr>';
00573 }
00574
00575 // Create spacer:
00576 $cCont=array();
00577 foreach($langListArr as $lP) {
00578 $cCont[] = ' ';
00579 }
00580 $out.='
00581 <tr>
00582 <td valign="top">'.implode('</td>'.$midSep.'
00583 <td valign="top">',$cCont).'</td>
00584 </tr>';
00585 }
00586 }
00587
00588 // Finally, wrap it all in a table and add the language selector on top of it:
00589 $out = $languageSelector.'
00590 <table border="0" cellpadding="0" cellspacing="0" width="480" class="typo3-page-langMode">
00591 '.$out.'
00592 </table>';
00593
00594 // CSH:
00595 $out.= t3lib_BEfunc::cshItem($this->descrTable,'language_list',$GLOBALS['BACK_PATH']);
00596 }
00597 } else { // SINGLE column mode (columns shown beneath each other):
00598 #debug('single column');
00599 if ($this->tt_contentConfig['sys_language_uid']==0 || !$this->defLangBinding) {
00600
00601 // Initialize:
00602 $showLanguage = $this->defLangBinding && $this->tt_contentConfig['sys_language_uid']==0 ? ' AND sys_language_uid IN (0,-1)' : ' AND sys_language_uid='.$this->tt_contentConfig['sys_language_uid'];
00603
00604 $cList = explode(',',$this->tt_contentConfig['showSingleCol']);
00605 $content=array();
00606 $out='';
00607
00608 // Expand the table to some preset dimensions:
00609 $out.='
00610 <tr>
00611 <td><img src="clear.gif" width="'.$lMarg.'" height="1" alt="" /></td>
00612 <td valign="top"><img src="clear.gif" width="150" height="1" alt="" /></td>
00613 <td><img src="clear.gif" width="10" height="1" alt="" /></td>
00614 <td valign="top"><img src="clear.gif" width="300" height="1" alt="" /></td>
00615 </tr>';
00616
00617 // Traverse columns to display top-on-top
00618 while(list($counter,$key)=each($cList)) {
00619
00620 // Select content elements:
00621 $queryParts = $this->makeQueryArray('tt_content', $id, 'AND colPos='.intval($key).$showHidden.$showLanguage);
00622 $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
00623 $c = 0;
00624 $rowArr = $this->getResult($result);
00625 $rowOut = '';
00626
00627 // If it turns out that there are not content elements in the column, then display a big button which links directly to the wizard script:
00628 if ($this->doEdit && $this->option_showBigButtons && !intval($key) && !$GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
00629 $onClick="document.location='db_new_content_el.php?id=".$id.'&colPos='.intval($key).'&sys_language_uid='.$lP.'&uid_pid='.$id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';";
00630 $theNewButton=$GLOBALS['SOBE']->doc->t3Button($onClick,$GLOBALS['LANG']->getLL('newPageContent'));
00631 $theNewButton='<img src="clear.gif" width="1" height="5" alt="" /><br />'.$theNewButton;
00632 } else $theNewButton='';
00633
00634 // Traverse any selected elements:
00635 foreach($rowArr as $row) {
00636 $c++;
00637 $editUidList.=$row['uid'].',';
00638 $isRTE=$RTE && $this->isRTEforField('tt_content',$row,'bodytext');
00639
00640 // Create row output:
00641 $rowOut.='
00642 <tr>
00643 <td></td>
00644 <td valign="top">'.$this->tt_content_drawHeader($row).'</td>
00645 <td></td>
00646 <td valign="top">'.$this->tt_content_drawItem($row,$isRTE).'</td>
00647 </tr>';
00648
00649 // If the element was not the last element, add a divider line:
00650 if ($c != $GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
00651 $rowOut.='
00652 <tr>
00653 <td></td>
00654 <td colspan="3"><img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/stiblet_medium2.gif','width="468" height="1"').' class="c-divider" alt="" /></td>
00655 </tr>';
00656 }
00657 }
00658
00659 // Add spacer between sections in the vertical list
00660 if ($counter) {
00661 $out.='
00662 <tr>
00663 <td></td>
00664 <td colspan="3"><br /><br /><br /><br /></td>
00665 </tr>';
00666 }
00667
00668 // Add section header:
00669 $newP = $this->newContentElementOnClick($id,$key,$this->tt_contentConfig['sys_language_uid']);
00670 $out.='
00671
00672 <!-- Column header: -->
00673 <tr>
00674 <td></td>
00675 <td valign="top" colspan="3">'.
00676 $this->tt_content_drawColHeader(t3lib_BEfunc::getProcessedValue('tt_content','colPos',$key), ($this->doEdit&&count($rowArr)?'&edit[tt_content]['.$editUidList.']=edit'.$pageTitleParamForAltDoc:''), $newP).
00677 $theNewButton.
00678 '<br /></td>
00679 </tr>';
00680
00681 // Finally, add the content from the records in this column:
00682 $out.=$rowOut;
00683 }
00684
00685 // Finally, wrap all table rows in one, big table:
00686 $out = '
00687 <table border="0" cellpadding="0" cellspacing="0" width="400" class="typo3-page-columnsMode">
00688 '.$out.'
00689 </table>';
00690
00691 // CSH:
00692 $out.= t3lib_BEfunc::cshItem($this->descrTable,'columns_single',$GLOBALS['BACK_PATH']);
00693 } else {
00694 $out = '<br/><br/>'.$GLOBALS['SOBE']->doc->icons(1).'Sorry, you cannot view a single language in this localization mode (Default Language Binding is enabled)<br/><br/>';
00695 }
00696 }
00697
00698
00699 // Add the big buttons to page:
00700 if ($this->option_showBigButtons) {
00701 $bArray=array();
00702
00703 if (!$GLOBALS['SOBE']->current_sys_language) {
00704 if ($this->ext_CALC_PERMS&2) $bArray[0]=$GLOBALS['SOBE']->doc->t3Button(t3lib_BEfunc::editOnClick('&edit[pages]['.$id."]=edit",$this->backPath,''),$GLOBALS['LANG']->getLL('editPageTitle'));
00705 } else {
00706 if ($this->doEdit && $GLOBALS['BE_USER']->check('tables_modify','pages_language_overlay')) {
00707 list($languageOverlayRecord) = t3lib_BEfunc::getRecordsByField('pages_language_overlay','pid',$id,'AND sys_language_uid='.intval($GLOBALS['SOBE']->current_sys_language));
00708 $bArray[0]=$GLOBALS['SOBE']->doc->t3Button(t3lib_BEfunc::editOnClick('&edit[pages_language_overlay]['.$languageOverlayRecord['uid']."]=edit",$this->backPath,''),$GLOBALS['LANG']->getLL('editPageTitle_curLang'));
00709 }
00710 }
00711 if ($this->ext_CALC_PERMS&4 || $this->ext_CALC_PERMS&2) $bArray[1]=$GLOBALS['SOBE']->doc->t3Button("document.location='".$this->backPath."move_el.php?table=pages&uid=".$id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';",$GLOBALS['LANG']->getLL('move_page'));
00712 if ($this->ext_CALC_PERMS&8) $bArray[2]=$GLOBALS['SOBE']->doc->t3Button("document.location='".$this->backPath."db_new.php?id=".$id.'&pagesOnly=1&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';",$GLOBALS['LANG']->getLL('newPage2'));
00713 if ($this->doEdit && $this->ext_function==1) $bArray[3]=$GLOBALS['SOBE']->doc->t3Button("document.location='db_new_content_el.php?id=".$id.'&sys_language_uid='.$GLOBALS['SOBE']->current_sys_language.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';",$GLOBALS['LANG']->getLL('newPageContent2'));
00714 $out = '
00715 <table border="0" cellpadding="4" cellspacing="0" class="typo3-page-buttons">
00716 <tr>
00717 <td>'.implode('</td>
00718 <td>',$bArray).'</td>
00719 </tr>
00720 </table>
00721 <img src="clear.gif" width="1" height="5" alt="" /><br />
00722 '.t3lib_BEfunc::cshItem($this->descrTable,'button_panel',$GLOBALS['BACK_PATH']). // CSH
00723 $out;
00724 }
00725
00726 // Return content:
00727 return $out;
00728 }
|
|
|
Renders link records from the tt_links table from page id NOTICE: Requires the tt_links extension to be loaded.
Definition at line 989 of file class.tx_cms_layout.php. References $out. Referenced by getTable(). 00989 {
00990
00991 // Define fieldlist to show:
00992 $fList = 'title;cr_name;cr_email,note';
00993 $out = $this->makeOrdinaryList('tt_guest',$id, $fList, 1);
00994 return $out;
00995 }
|
|
|
Renders link records from the tt_links table from page id NOTICE: Requires the tt_links extension to be loaded.
Definition at line 963 of file class.tx_cms_layout.php. References $out. Referenced by getTable(). 00963 {
00964
00965 // Define fieldlist to show:
00966 switch($GLOBALS['SOBE']->MOD_SETTINGS['tt_links']) {
00967 case 1:
00968 $fList = 'title,hidden,url';
00969 break;
00970 case 2:
00971 $fList = 'title;url,note2';
00972 break;
00973 default:
00974 $fList = 'title;url,note';
00975 break;
00976 }
00977
00978 $out = $this->makeOrdinaryList('tt_links',$id, $fList,1);
00979 return $out;
00980 }
|
|
|
Renders news items from the tt_news table from page id NOTICE: Requires the tt_news extension to be loaded.
Definition at line 1004 of file class.tx_cms_layout.php. References $out. Referenced by getTable(). 01004 {
01005
01006 $this->addElement_tdParams=array(
01007 'title'=>' nowrap="nowrap"',
01008 'datetime'=>' nowrap="nowrap"',
01009 'starttime'=>' nowrap="nowrap"',
01010 'author'=>' nowrap="nowrap"'
01011 );
01012 $fList = 'title,author,author_email,datetime,starttime,category,image';
01013 $out = $this->makeOrdinaryList('tt_news',$id, $fList, 1);
01014 $this->addElement_tdParams=array();
01015 return $out;
01016 }
|
|
|
Renders shopping elements from the tt_products table from page id NOTICE: Requires the tt_products extension to be loaded.
Definition at line 1075 of file class.tx_cms_layout.php. References $out. Referenced by getTable(). 01075 {
01076
01077 $type = $GLOBALS['SOBE']->MOD_SETTINGS['tt_products'];
01078 switch($type) {
01079 case 'ext':
01080 $fList = 'title;itemnumber;price;price2;inStock;category,image,note';
01081 $icon=1;
01082 $out = $this->makeOrdinaryList('tt_products',$id, $fList, $icon);
01083 break;
01084 default:
01085 $fList = 'title,itemnumber,price,category,image';
01086 $icon=1;
01087 $out = $this->makeOrdinaryList('tt_products',$id, $fList, $icon);
01088 break;
01089 }
01090
01091 return $out;
01092 }
|
|
|
Creates a menu of the tables that can be listed by this function Only tables which has records on the page will be included. Notice: The function also fills in the internal variable $this->activeTables with icon/titles.
Definition at line 2481 of file class.tx_cms_layout.php. References $out, t3lib_iconWorks::getIconImage(), t3lib_extMgm::isLoaded(), menu(), and table(). 02481 {
02482 global $TCA;
02483
02484 // Initialize:
02485 $this->activeTables=array();
02486 $theTables = explode(',','tt_content,fe_users,tt_address,tt_links,tt_board,tt_guest,tt_calender,tt_products,tt_news'); // NOTICE: This serves double function: Both being tables names (all) and for most others also being extension keys for the extensions they are related to!
02487
02488 // External tables:
02489 if (is_array($this->externalTables)) {
02490 $theTables = array_unique(array_merge($theTables, array_keys($this->externalTables)));
02491 }
02492
02493 // Traverse tables to check:
02494 foreach($theTables as $tName) {
02495
02496 // Check access and whether the proper extensions are loaded:
02497 if ($GLOBALS['BE_USER']->check('tables_select',$tName) && (t3lib_extMgm::isLoaded($tName)||t3lib_div::inList('fe_users,tt_content',$tName) || isset($this->externalTables[$tName]))) {
02498
02499 // Make query to count records from page:
02500 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', $tName, 'pid='.intval($id).t3lib_BEfunc::deleteClause($tName));
02501 list($c) = $GLOBALS['TYPO3_DB']->sql_fetch_row($result);
02502
02503 // If records were found (or if "tt_content" is the table...):
02504 if ($c || t3lib_div::inList('tt_content',$tName)) {
02505
02506 // Add row to menu:
02507 $out.='
02508 <td><a href="#'.$tName.'"></a>'.
02509 t3lib_iconWorks::getIconImage($tName,Array(),$this->backPath,'title="'.$GLOBALS['LANG']->sL($TCA[$tName]['ctrl']['title'],1).'"').
02510 '</td>';
02511
02512 // ... and to the internal array, activeTables we also add table icon and title (for use elsewhere)
02513 $this->activeTables[$tName]=
02514 t3lib_iconWorks::getIconImage($tName,Array(),$this->backPath,'title="'.$GLOBALS['LANG']->sL($TCA[$tName]['ctrl']['title'],1).': '.$c.' '.$GLOBALS['LANG']->getLL('records',1).'" class="absmiddle"').
02515 ' '.
02516 $GLOBALS['LANG']->sL($TCA[$tName]['ctrl']['title'],1);
02517 }
02518 }
02519 }
02520
02521 // Wrap cells in table tags:
02522 $out = '
02523
02524
02525
02526 <!--
02527 Menu of tables on the page (table menu)
02528 -->
02529 <table border="0" cellpadding="0" cellspacing="0" id="typo3-page-tblMenu">
02530 <tr>'.$out.'
02531 </tr>
02532 </table>';
02533
02534 // Return the content:
02535 return $out;
02536 }
|
|
||||||||||||||||
|
Header fields made for the listing of records.
Definition at line 1251 of file class.tx_cms_layout.php. 01251 {
01252 global $TCA;
01253
01254 t3lib_div::loadTCA($table);
01255
01256 foreach($fieldArr as $fieldName) {
01257 $ll = $GLOBALS['LANG']->sL($TCA[$table]['columns'][$fieldName]['label'],1);
01258 $out[$fieldName] = '<b>'.($ll?$ll:' ').'</b>';
01259 }
01260 return $out;
01261 }
|
|
|
Returns an icon, which has its title attribute set to a massive amount of information about the element.
Definition at line 1831 of file class.tx_cms_layout.php. References $out. 01831 {
01832 if (count($infoArr) && $this->tt_contentConfig['showInfo']) {
01833 $out='<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/zoom2.gif','width="12" height="12"').' title="'.htmlspecialchars(implode(chr(10),$infoArr)).'" alt="" /> ';
01834 return $out;
01835 }
01836 }
|
|
||||||||||||
|
Returns true, if the record given as parameters is NOT visible based on hidden/starttime/endtime (if available).
Definition at line 2166 of file class.tx_cms_layout.php. References $TCA. 02166 {
02167 global $TCA;
02168 if (
02169 ($TCA[$table]['ctrl']['enablecolumns']['disabled'] && $row[$TCA[$table]['ctrl']['enablecolumns']['disabled']]) ||
02170 ($TCA[$table]['ctrl']['enablecolumns']['starttime'] && $row[$TCA[$table]['ctrl']['enablecolumns']['starttime']]>time() ) ||
02171 ($TCA[$table]['ctrl']['enablecolumns']['endtime'] && $row[$TCA[$table]['ctrl']['enablecolumns']['endtime']] && $row[$TCA[$table]['ctrl']['enablecolumns']['endtime']]<time())
02172 ) return true;
02173 }
|
|
||||||||||||||||
|
Checking if the RTE is available/enabled for a certain table/field and if so, it returns true. Used to determine if the RTE button should be displayed.
Definition at line 2246 of file class.tx_cms_layout.php. References t3lib_BEfunc::getSpecConfParametersFromArray(), t3lib_BEfunc::getTCAtypeValue(), getTSCpid(), RTEsetup(), and table(). Referenced by getTable_tt_content(). 02246 {
02247 $specConf = $this->getSpecConfForField($table,$row,$field);
02248 $p = t3lib_BEfunc::getSpecConfParametersFromArray($specConf['rte_transform']['parameters']);
02249 if (isset($specConf['richtext']) && (!$p['flag'] || !$row[$p['flag']])) {
02250 list($tscPID,$thePidValue) = t3lib_BEfunc::getTSCpid($table,$row['uid'],$row['pid']);
02251 if ($thePidValue>=0) { // If the pid-value is not negative (that is, a pid could NOT be fetched)
02252 $RTEsetup = $GLOBALS['BE_USER']->getTSConfig('RTE',t3lib_BEfunc::getPagesTSconfig($tscPID));
02253 $RTEtypeVal = t3lib_BEfunc::getTCAtypeValue($table,$row);
02254 $thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup['properties'],$table,$field,$RTEtypeVal);
02255 if (!$thisConfig['disabled']) {
02256 return TRUE;
02257 }
02258 }
02259 }
02260
02261 return FALSE;
02262 }
|
|
|
Make selector box for creating new translation in a language Displays only languages which are not yet present for the current page.
Definition at line 1904 of file class.tx_cms_layout.php. Referenced by getTable_tt_content(). 01904 {
01905 if ($GLOBALS['BE_USER']->check('tables_modify','pages_language_overlay')) {
01906
01907 // First, select all
01908 $res = $GLOBALS['SOBE']->exec_languageQuery(0);
01909 $langSelItems=array();
01910 $langSelItems[0]='
01911 <option value="0"></option>';
01912 while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
01913 $langSelItems[$row['uid']]='
01914 <option value="'.$row['uid'].'">'.htmlspecialchars($row['title']).'</option>';
01915 }
01916
01917 // Then, subtract the languages which are already on the page:
01918 $res = $GLOBALS['SOBE']->exec_languageQuery($id);
01919 while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
01920 unset($langSelItems[$row['uid']]);
01921 }
01922
01923 // If any languages are left, make selector:
01924 if (count($langSelItems)>1) {
01925 $onChangeContent = 'document.location=\''.$this->backPath.'alt_doc.php?&edit[pages_language_overlay]['.$id.']=new&overrideVals[pages_language_overlay][sys_language_uid]=\'+this.options[this.selectedIndex].value+\'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')).'\'';
01926 return $GLOBALS['LANG']->getLL('new_language',1).': <select name="createNewLanguage" onchange="'.htmlspecialchars($onChangeContent).'">
01927 '.implode('',$langSelItems).'
01928 </select><br /><br />';
01929 }
01930 }
01931 }
|
|
||||||||||||
|
Will create a link on the input string and possible a big button after the string which links to editing in the RTE Used for content element content displayed so the user can click the content / "Edit in Rich Text Editor" button.
Definition at line 1865 of file class.tx_cms_layout.php. References t3lib_BEfunc::editOnClick(). 01865 {
01866 $addButton='';
01867 $onClick = '';
01868
01869 if ($this->doEdit) {
01870 // Setting onclick action for content link:
01871 $onClick=t3lib_BEfunc::editOnClick('&edit[tt_content]['.$row['uid'].']=edit',$this->backPath);
01872 }
01873 // Return link
01874 return $onClick ? '<a href="#" onclick="'.htmlspecialchars($onClick).'" title="'.$GLOBALS['LANG']->getLL('edit',1).'">'.$str.'</a>'.$addButton : $str;
01875 }
|
|
|
Adds a button to edit the row in RTE wizard.
Definition at line 1883 of file class.tx_cms_layout.php. References table(). 01883 {
01884 $params = array();
01885 $params['table'] = 'tt_content';
01886 $params['uid'] = $row['uid'];
01887 $params['pid'] = $row['pid'];
01888 $params['field'] = 'bodytext';
01889 $params['returnUrl'] = t3lib_div::linkThisScript();
01890 $RTEonClick = "document.location='".$this->backPath."wizard_rte.php?".t3lib_div::implodeArrayForUrl('',array('P'=>$params))."';return false;";
01891 $addButton = $this->option_showBigButtons && $this->doEdit ? $GLOBALS['SOBE']->doc->t3Button($RTEonClick,$GLOBALS['LANG']->getLL('editInRTE')) : '';
01892
01893 return $addButton;
01894 }
|
|
||||||||||||||||||||||||
|
Creates a standard list of elements from a table.
Definition at line 1121 of file class.tx_cms_layout.php. Referenced by getTable(), and getTable_fe_users(). 01121 {
01122 global $TCA;
01123
01124 // Initialize:
01125 $out = '';
01126 $queryParts = $this->makeQueryArray($table, $id, $addWhere);
01127 $this->setTotalItems($queryParts);
01128 $dbCount = 0;
01129
01130 // Make query for records if there were any records found in the count operation:
01131 if ($this->totalItems) {
01132 $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
01133 $dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);
01134 }
01135
01136 // If records were found, render the list:
01137 $out = '';
01138 if ($dbCount) {
01139
01140 // Set fields
01141 $this->fieldArray = explode(',','__cmds__,'.$fList);
01142
01143 // Header line is drawn
01144 $theData = array();
01145 $theData = $this->headerFields($this->fieldArray,$table,$theData);
01146 $out.= $this->addelement(1,'',$theData,' class="c-headLine"',15);
01147
01148 // Render Items
01149 $this->eCounter = $this->firstElementNumber;
01150 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
01151 list($flag,$code) = $this->fwd_rwd_nav();
01152 $out.= $code;
01153 if ($flag) {
01154 $params = '&edit['.$table.']['.$row['uid'].']=edit';
01155 $Nrow = array();
01156
01157 // Setting icons/edit links:
01158 if ($icon) {
01159 $Nrow['__cmds__']= $this->getIcon($table,$row);
01160 }
01161 if ($this->doEdit) {
01162 $Nrow['__cmds__'].= '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath)).'">'.
01163 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.$GLOBALS['LANG']->getLL('edit',1).'" alt="" />'.
01164 '</a>';
01165 } else {
01166 $Nrow['__cmds__'].= $this->noEditIcon();
01167 }
01168
01169 // Get values:
01170 $Nrow = $this->dataFields($this->fieldArray,$table,$row,$Nrow);
01171 $tdparams = $this->eCounter%2 ? ' class="bgColor4"' : ' class="bgColor4-20"';
01172 $out.= $this->addelement(1,'',$Nrow,$tdparams);
01173 }
01174 $this->eCounter++;
01175 }
01176
01177 // Wrap it all in a table:
01178 $out='
01179
01180 <!--
01181 STANDARD LIST OF "'.$table.'"
01182 -->
01183 <table border="0" cellpadding="1" cellspacing="2" width="480" id="typo3-page-stdlist">
01184 '.$out.'
01185 </table>';
01186 }
01187 return $out;
01188 }
|
|
||||||||||||||||
|
Creates onclick-attribute content for a new content element.
Definition at line 1847 of file class.tx_cms_layout.php. References t3lib_BEfunc::editOnClick(). Referenced by getTable_tt_content(). 01847 {
01848 if ($this->option_newWizard) {
01849 $onClick="document.location='db_new_content_el.php?id=".$id.'&colPos='.$colPos.'&sys_language_uid='.$sys_language.'&uid_pid='.$id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';";
01850 } else {
01851 $onClick=t3lib_BEfunc::editOnClick('&edit[tt_content]['.$id.']=new&defVals[tt_content][colPos]='.$colPos.'&defVals[tt_content][sys_language_uid]='.$sys_language,$this->backPath);
01852 }
01853 return $onClick;
01854 }
|
|
||||||||||||
|
Creates button which is used to create copies of records..
Definition at line 1810 of file class.tx_cms_layout.php. 01810 {
01811 if ($this->doEdit && count($defLanguageCount) && $lP) {
01812
01813 $params = '';
01814 foreach($defLanguageCount as $uidVal) {
01815 $params.='&cmd[tt_content]['.$uidVal.'][localize]='.$lP;
01816 }
01817
01818 // Copy for language:
01819 $onClick = "document.location='".$GLOBALS['SOBE']->doc->issueCommand($params)."'; return false;";
01820 $theNewButton = $GLOBALS['SOBE']->doc->t3Button($onClick,$GLOBALS['LANG']->getLL('newPageContent_copyForLang').' ['.count($defLanguageCount).']');
01821 return $theNewButton;
01822 }
01823 }
|
|
|
Returns icon for "no-edit" of a record. Basically, the point is to signal that this record could have had an edit link if the circumstances were right. A placeholder for the regular edit icon...
Definition at line 2201 of file class.tx_cms_layout.php. 02201 {
02202 return '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2_d.gif','width="11" height="12"').' title="'.$GLOBALS['LANG']->getLL($label,1).'" alt="" />';
02203 }
|
|
||||||||||||
|
Counts and returns the number of records on the page with $pid.
Definition at line 2090 of file class.tx_cms_layout.php. 02090 {
02091 global $TCA;
02092
02093 $c=0;
02094 if ($TCA[$table]) {
02095 $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', $table, 'pid='.intval($pid).t3lib_BEfunc::deleteClause($table));
02096 if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_row($result)) {
02097 $c=$row[0];
02098 }
02099 }
02100 return $c;
02101 }
|
|
||||||||||||
|
Adds a list item for the pages-rendering.
Definition at line 1325 of file class.tx_cms_layout.php. References $TCA, and t3lib_extMgm::isLoaded(). Referenced by getTable_pages(). 01325 {
01326 global $TCA;
01327
01328 // Initialization
01329 $theIcon=$this->getIcon('pages',$row);
01330
01331 // Preparing and getting the data-array
01332 $theData = Array();
01333 foreach($fieldArr as $field) {
01334 switch($field) {
01335 case 'title':
01336 $red = $this->plusPages[$row['uid']] ? '<font color="red"><b>+ </b></font>' : '';
01337 $pTitle = htmlspecialchars(t3lib_BEfunc::getProcessedValue('pages',$field,$row[$field],20));
01338 if ($red) {
01339 $pTitle = '<a href="'.htmlspecialchars($this->script.'?id='.$row['uid']).'">'.$pTitle.'</a>';
01340 }
01341 $theData[$field]=$row['treeIcons'].$theIcon.$red.$pTitle.' ';
01342 break;
01343 case 'php_tree_stop':
01344 case 'TSconfig':
01345 $theData[$field] = $row[$field]?' <b>x</b>':' ';
01346 break;
01347 case 'uid':
01348 if ($GLOBALS['BE_USER']->doesUserHaveAccess($row,2)) {
01349 $params='&edit[pages]['.$row['uid'].']=edit';
01350 $eI= '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,'')).'">'.
01351 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.$GLOBALS['LANG']->getLL('editThisPage',1).'" alt="" />'.
01352 '</a>';
01353 } else $eI='';
01354 $theData[$field] = '<span align="right">'.$row['uid'].$eI.'</span>';
01355 break;
01356 default:
01357 if (substr($field,0,6)=='table_') {
01358 $f2 = substr($field,6);
01359 if ($TCA[$f2]) {
01360 $c = $this->numberOfRecords($f2,$row['uid']);
01361 $theData[$field] = ' '.($c?$c:'');
01362 }
01363 } elseif (substr($field,0,5)=='HITS_') {
01364 if (t3lib_extMgm::isLoaded('sys_stat')) {
01365 $fParts = explode(':',substr($field,5));
01366 switch($fParts[0]) {
01367 case 'days':
01368 $timespan = mktime (0,0,0)+intval($fParts[1])*3600*24;
01369 // Page hits
01370 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
01371 'count(*)',
01372 'sys_stat',
01373 $this->stat_select_field.'='.intval($row['uid']).'
01374 AND tstamp>='.intval($timespan).'
01375 AND tstamp<'.intval($timespan+3600*24)
01376 );
01377 list($number) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
01378 if ($number) {
01379 // Sessions
01380 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
01381 'count(*)',
01382 'sys_stat',
01383 $this->stat_select_field.'='.intval($row['uid']).'
01384 AND tstamp>='.intval($timespan).'
01385 AND tstamp<'.intval($timespan+3600*24).'
01386 AND surecookie!=""',
01387 'surecookie'
01388 );
01389 $scnumber = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
01390
01391 $number.= '/'.$scnumber;
01392 } else {
01393 $number='';
01394 }
01395 break;
01396 }
01397 $theData[$field]= ' '.$number;
01398 } else {
01399 $theData[$field]= ' ';
01400 }
01401 } else {
01402 $theData[$field]= ' '.htmlspecialchars(t3lib_BEfunc::getProcessedValue('pages',$field,$row[$field]));
01403 }
01404 break;
01405 }
01406 }
01407 return $this->addelement(1,'',$theData);
01408 }
|
|
||||||||||||||||||||||||
|
Adds pages-rows to an array, selecting recursively in the page tree.
Definition at line 1293 of file class.tx_cms_layout.php. Referenced by getTable_pages(). 01293 {
01294 $depth--;
01295 if ($depth>=0) {
01296 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'pages', 'pid='.intval($pid).$qWhere, '', 'sorting');
01297 $c=0;
01298 $rc = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
01299 while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
01300 $c++;
01301 $row['treeIcons'] = $treeIcons.'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/join'.($rc==$c?'bottom':'').'.gif','width="18" height="16"').' alt="" />';
01302 $theRows[]=$row;
01303
01304 // Get the branch
01305 $spaceOutIcons = '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.($rc==$c?'blank.gif':'line.gif'),'width="18" height="16"').' alt="" />';
01306 $theRows = $this->pages_getTree($theRows,$row['uid'],$qWhere,$treeIcons.$spaceOutIcons,$row['php_tree_stop']?0:$depth);
01307 }
01308 } else {
01309 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'pages', 'pid='.intval($pid).$qWhere);
01310 $row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
01311 if ($row[0]) {
01312 $this->plusPages[$pid]=$row[0];
01313 }
01314 }
01315 return $theRows;
01316 }
|
|
|
Processing of larger amounts of text (usually from RTE/bodytext fields) with word wrapping etc.
Definition at line 2109 of file class.tx_cms_layout.php. 02109 {
02110 $input = strip_tags($input);
02111 $input = t3lib_div::fixed_lgd_cs($input,1500);
02112 return nl2br(htmlspecialchars(trim($this->wordWrapper($input))));
02113 }
|
|
||||||||||||||||
|
Adds an element to the tt_board listing:.
Definition at line 2043 of file class.tx_cms_layout.php. References t3lib_BEfunc::calcAge(), and table(). 02043 {
02044
02045 // Building data-arary with content:
02046 $theData = Array();
02047 $theData['subject'] = t3lib_div::fixed_lgd_cs(htmlspecialchars($row['subject']),25).' ';
02048 $theData['author'] = t3lib_div::fixed_lgd_cs(htmlspecialchars($row['author']),15).' ';
02049 $theData['date'] = t3lib_div::fixed_lgd_cs(t3lib_BEfunc::datetime($row['crdate']),20).' ';
02050 $theData['age'] = t3lib_BEfunc::calcAge(time()-$row['crdate'], $this->agePrefixes).' ';
02051 if ($re) {
02052 $theData['replys'] = $re;
02053 }
02054
02055 // Subject is built:
02056 $theData['subject'] =
02057 $row['treeIcons'].
02058 $this->getIcon($table,$row).
02059 $theData['subject'];
02060
02061 // Adding element:
02062 return $this->addelement(1,'',$theData);
02063 }
|
|
||||||||||||||||||||||||
|
Traverses recursively a branch in a message board.
Definition at line 2008 of file class.tx_cms_layout.php. 02008 {
02009
02010 // Select tt_board elements:
02011 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_board', 'pid='.intval($pid).' AND parent='.intval($parent).$qWhere, '', 'crdate');
02012
02013 // Traverse the results:
02014 $c=0;
02015 $rc = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
02016 while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
02017 $c++;
02018 $row['treeIcons'] = $treeIcons.'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.($rc==$c ? 'joinbottom.gif' : 'join.gif'),'width="18" height="16"').' alt="" />';
02019 $theRows[]=$row;
02020
02021 // Get the branch
02022 $theRows = $this->tt_board_getTree(
02023 $theRows,
02024 $row['uid'],
02025 $row['pid'],
02026 $qWhere,
02027 $treeIcons.'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.($rc==$c ? 'blank.gif' : 'line.gif'),'width="18" height="16"').' alt="" />'
02028 );
02029 }
02030
02031 // Return modified rows:
02032 return $theRows;
02033 }
|
|
||||||||||||||||
|
Draw header for a content element column:.
Definition at line 1435 of file class.tx_cms_layout.php. Referenced by getTable_tt_content(). 01435 {
01436
01437 // Create header row:
01438 $out = '
01439 <tr>
01440 <td class="bgColor2" nowrap="nowrap"><img src="clear.gif" width="1" height="2" alt="" /><br /><div align="center"><b>'.htmlspecialchars(strtoupper($colName)).'</b></div><img src="clear.gif" width="1" height="2" alt="" /></td>
01441 </tr>';
01442
01443 // Create command links:
01444 if ($this->tt_contentConfig['showCommands']) {
01445 // Start cell:
01446 $out.= '
01447 <tr>
01448 <td class="bgColor5">';
01449
01450 // Edit whole of column:
01451 if ($editParams) {
01452 $out.='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($editParams,$this->backPath)).'">'.
01453 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.$GLOBALS['LANG']->getLL('editColumn',1).'" alt="" />'.
01454 '</a>';
01455 }
01456 // New record:
01457 if ($newParams) {
01458 $out.='<a href="#" onclick="'.htmlspecialchars($newParams).'">'.
01459 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/new_record.gif','width="16" height="12"').' title="'.$GLOBALS['LANG']->getLL('newInColumn',1).'" alt="" />'.
01460 '</a>';
01461 }
01462 // End cell:
01463 $out.= '
01464 </td>
01465 </tr>';
01466 }
01467
01468 // Wrap and return:
01469 return '
01470 <table border="0" cellpadding="0" cellspacing="0" width="100%" class="typo3-page-colHeader">'.($space?'
01471 <tr>
01472 <td><img src="clear.gif" height="'.$space.'" alt="" /></td>
01473 </tr>':'').
01474 $out.'
01475 </table>';
01476 }
|
|
||||||||||||||||||||
|
Draw the header for a single tt_content element.
Definition at line 1487 of file class.tx_cms_layout.php. References $out, $TCA, t3lib_BEfunc::editOnClick(), t3lib_BEfunc::isRecordLocked(), and table(). Referenced by getTable_tt_content(). 01487 {
01488 global $TCA;
01489
01490 // Load full table description:
01491 t3lib_div::loadTCA('tt_content');
01492
01493 // Get record locking status:
01494 if ($lockInfo=t3lib_BEfunc::isRecordLocked('tt_content',$row['uid'])) {
01495 $lockIcon='<a href="#" onclick="'.htmlspecialchars('alert('.$GLOBALS['LANG']->JScharCode($lockInfo['msg']).');return false;').'">'.
01496 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/recordlock_warning3.gif','width="17" height="12"').' title="'.htmlspecialchars($lockInfo['msg']).'" alt="" />'.
01497 '</a>';
01498 } else $lockIcon='';
01499
01500 // Create header with icon/lock-icon/title:
01501 $header = $this->getIcon('tt_content',$row).
01502 $lockIcon.
01503 ($langMode ? $this->languageFlag($row['sys_language_uid']) : '').
01504 ' <b>'.htmlspecialchars($this->CType_labels[$row['CType']]).'</b>';
01505 $out = '
01506 <tr>
01507 <td class="bgColor4">'.$header.'</td>
01508 </tr>';
01509
01510 // If show info is set...;
01511 if ($this->tt_contentConfig['showInfo']) {
01512
01513 // Get processed values:
01514 $info = Array();
01515 $this->getProcessedValue('tt_content','hidden,starttime,endtime,fe_group,spaceBefore,spaceAfter,section_frame,sectionIndex,linkToTop',$row,$info);
01516
01517 // Render control panel for the element:
01518 if ($this->tt_contentConfig['showCommands'] && $this->doEdit) {
01519
01520 // Start control cell:
01521 $out.= '
01522 <!-- Control Panel -->
01523 <tr>
01524 <td class="bgColor5">';
01525
01526 // Edit content element:
01527 $params='&edit[tt_content]['.$this->tt_contentData['nextThree'][$row['uid']].']=edit';
01528 $out.='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath)).'">'.
01529 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.htmlspecialchars($this->nextThree>1?sprintf($GLOBALS['LANG']->getLL('nextThree'),$this->nextThree):$GLOBALS['LANG']->getLL('edit')).'" alt="" />'.
01530 '</a>';
01531
01532 if (!$disableMoveAndNewButtons) {
01533 // New content element:
01534 if ($this->option_newWizard) {
01535 $onClick="document.location='db_new_content_el.php?id=".$row['pid'].'&sys_language_uid='.$row['sys_language_uid'].'&colPos='.$row['colPos'].'&uid_pid='.(-$row['uid']).'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';";
01536 } else {
01537 $params='&edit[tt_content]['.(-$row['uid']).']=new';
01538 $onClick = t3lib_BEfunc::editOnClick($params,$this->backPath);
01539 }
01540 $out.='<a href="#" onclick="'.htmlspecialchars($onClick).'">'.
01541 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/new_record.gif','width="16" height="12"').' title="'.$GLOBALS['LANG']->getLL('newAfter',1).'" alt="" />'.
01542 '</a>';
01543
01544 // Move element up:
01545 if ($this->tt_contentData['prev'][$row['uid']]) {
01546 $params='&cmd[tt_content]['.$row['uid'].'][move]='.$this->tt_contentData['prev'][$row['uid']];
01547 $out.='<a href="'.htmlspecialchars($GLOBALS['SOBE']->doc->issueCommand($params)).'">'.
01548 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/button_up.gif','width="11" height="10"').' title="'.$GLOBALS['LANG']->getLL('moveUp',1).'" alt="" />'.
01549 '</a>';
01550 } else {
01551 $out.='<img src="clear.gif" '.t3lib_iconWorks::skinImg($this->backPath,'gfx/button_up.gif','width="11" height="10"',2).' alt="" />';
01552 }
01553 // Move element down:
01554 if ($this->tt_contentData['next'][$row['uid']]) {
01555 $params='&cmd[tt_content]['.$row['uid'].'][move]='.$this->tt_contentData['next'][$row['uid']];
01556 $out.='<a href="'.htmlspecialchars($GLOBALS['SOBE']->doc->issueCommand($params)).'">'.
01557 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/button_down.gif','width="11" height="10"').' title="'.$GLOBALS['LANG']->getLL('moveDown',1).'" alt="" />'.
01558 '</a>';
01559 } else {
01560 $out.='<img src="clear.gif" '.t3lib_iconWorks::skinImg($this->backPath,'gfx/button_down.gif','width="11" height="10"',2).' alt="" />';
01561 }
01562 }
01563
01564 // Hide element:
01565 $hiddenField = $TCA['tt_content']['ctrl']['enablecolumns']['disabled'];
01566 if ($hiddenField && $TCA['tt_content']['columns'][$hiddenField] && (!$TCA['tt_content']['columns'][$hiddenField]['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields','tt_content:'.$hiddenField))) {
01567 if ($row[$hiddenField]) {
01568 $params='&data[tt_content]['.$row['uid'].']['.$hiddenField.']=0';
01569 $out.='<a href="'.htmlspecialchars($GLOBALS['SOBE']->doc->issueCommand($params)).'">'.
01570 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/button_unhide.gif','width="11" height="10"').' title="'.$GLOBALS['LANG']->getLL('unHide',1).'" alt="" />'.
01571 '</a>';
01572 } else {
01573 $params='&data[tt_content]['.$row['uid'].']['.$hiddenField.']=1';
01574 $out.='<a href="'.htmlspecialchars($GLOBALS['SOBE']->doc->issueCommand($params)).'">'.
01575 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/button_hide.gif','width="11" height="10"').' title="'.$GLOBALS['LANG']->getLL('hide',1).'" alt="" />'.
01576 '</a>';
01577 }
01578 }
01579
01580 // Delete
01581 $params='&cmd[tt_content]['.$row['uid'].'][delete]=1';
01582 $out.='<a href="'.htmlspecialchars($GLOBALS['SOBE']->doc->issueCommand($params)).'" onclick="'.htmlspecialchars('return confirm('.$GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL('deleteWarning')).');').'">'.
01583 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/garbage.gif','width="11" height="12"').' title="'.$GLOBALS['LANG']->getLL('deleteItem',1).'" alt="" />'.
01584 '</a>';
01585
01586 // End cell:
01587 $out.= '
01588 </td>
01589 </tr>';
01590 }
01591
01592 // Display info from records fields:
01593 if (count($info)) {
01594 $out.= '
01595 <tr>
01596 <td class="bgColor4-20">'.implode('<br />',$info).'</td>
01597 </tr>';
01598 }
01599 }
01600 // Wrap the whole header in a table:
01601 return '
01602 <table border="0" cellpadding="0" cellspacing="0" class="typo3-page-ceHeader">'.($space?'
01603 <tr>
01604 <td><img src="clear.gif" height="'.$space.'" alt="" /></td>
01605 </tr>':'').
01606 $out.'
01607 </table>';
01608 }
|
|
||||||||||||
|
Draws the preview content for a content element.
Definition at line 1617 of file class.tx_cms_layout.php. References $out, header(), menu(), and table(). Referenced by getTable_tt_content(). 01617 {
01618 global $TCA;
01619
01620 $out='';
01621 $outHeader='';
01622
01623 // Make header:
01624 if ($row['header'] && $row['header_layout']!=100) {
01625 $infoArr = Array();
01626 $this->getProcessedValue('tt_content','header_position,header_layout,header_link',$row,$infoArr);
01627
01628 $outHeader= ($row['date'] ? htmlspecialchars($this->itemLabels['date'].' '.t3lib_BEfunc::date($row['date'])).'<br />':'').
01629 $this->infoGif($infoArr).
01630 '<b>'.$this->linkEditContent($this->renderText($row['header']),$row).'</b><br />';
01631 }
01632
01633 // Make content:
01634 $infoArr=Array();
01635 switch($row['CType']) {
01636 case 'header':
01637 if ($row['subheader']) {
01638 $this->getProcessedValue('tt_content','layout',$row,$infoArr);
01639 $out.= $this->infoGif($infoArr).
01640 $this->linkEditContent($this->renderText($row['subheader']),$row).'<br />';
01641 }
01642 break;
01643 case 'text':
01644 case 'textpic':
01645 case 'image':
01646 if ($row['CType']=='text' || $row['CType']=='textpic') {
01647 if ($row['bodytext']) {
01648 $this->getProcessedValue('tt_content','text_align,text_face,text_size,text_color,text_properties',$row,$infoArr);
01649 $out.= $this->infoGif($infoArr).
01650 $this->linkEditContent($this->renderText($row['bodytext']),$row).'<br />';
01651 }
01652 }
01653 if ($row['CType']=='textpic' || $row['CType']=='image') {
01654 if ($row['image']) {
01655 $infoArr=Array();
01656 $this->getProcessedValue('tt_content','imageorient,imagecols,image_noRows,imageborder,imageheight,image_link,image_zoom,image_compression,image_effects,image_frames',$row,$infoArr);
01657 $out.= $this->infoGif($infoArr).
01658 $this->thumbCode($row,'tt_content','image').'<br />';
01659
01660 if ($row['imagecaption']) {
01661 $infoArr=Array();
01662 $this->getProcessedValue('tt_content','imagecaption_position',$row,$infoArr);
01663 $out.= $this->infoGif($infoArr).
01664 $this->linkEditContent($this->renderText($row['imagecaption']),$row).'<br />';
01665 }
01666 }
01667 }
01668 break;
01669 case 'bullets':
01670 if ($row['bodytext']) {
01671 $this->getProcessedValue('tt_content','layout,text_align,text_face,text_size,text_color,text_properties',$row,$infoArr);
01672 $out.= $this->infoGif($infoArr).
01673 $this->linkEditContent($this->renderText($row['bodytext']),$row).'<br />';
01674 }
01675 break;
01676 case 'table':
01677 if ($row['bodytext']) {
01678 $this->getProcessedValue('tt_content','table_bgColor,table_border,table_cellspacing,cols,layout,text_align,text_face,text_size,text_color,text_properties',$row,$infoArr);
01679 $out.= $this->infoGif($infoArr).
01680 $this->linkEditContent($this->renderText($row['bodytext']),$row).'<br />';
01681 }
01682 break;
01683 case 'uploads':
01684 if ($row['media']) {
01685 $this->getProcessedValue('tt_content','media,select_key,layout,filelink_size,table_bgColor,table_border,table_cellspacing',$row,$infoArr);
01686 $out.= $this->infoGif($infoArr).
01687 $this->linkEditContent($this->renderText($row['bodytext']),$row).'<br />';
01688 }
01689 break;
01690 case 'multimedia':
01691 if ($row['multimedia']) {
01692 $out.= $this->renderText($row['multimedia']).'<br />';
01693 $out.= $this->renderText($row['parameters']).'<br />';
01694 }
01695 break;
01696 case 'mailform':
01697 if ($row['bodytext']) {
01698 $this->getProcessedValue('tt_content','pages,subheader',$row,$infoArr);
01699 $out.= $this->infoGif($infoArr).
01700 $this->linkEditContent($this->renderText($row['bodytext']),$row).'<br />';
01701 }
01702 break;
01703 case 'splash':
01704 if ($row['bodytext']) {
01705 $out.= $this->linkEditContent($this->renderText($row['bodytext']),$row).'<br />';
01706 }
01707 if ($row['image']) {
01708 $infoArr=Array();
01709 $this->getProcessedValue('tt_content','imagewidth',$row,$infoArr);
01710 $out.= $this->infoGif($infoArr).
01711 $this->thumbCode($row,'tt_content','image').'<br />';
01712 }
01713 break;
01714 case 'menu':
01715 if ($row['pages']) {
01716 $this->getProcessedValue('tt_content','menu_type',$row,$infoArr);
01717 $out.= $this->infoGif($infoArr).
01718 $this->linkEditContent($row['pages'],$row).'<br />';
01719 }
01720 break;
01721 case 'shortcut':
01722 if ($row['records']) {
01723 $this->getProcessedValue('tt_content','layout',$row,$infoArr);
01724 $out.= $this->infoGif($infoArr).
01725 $this->linkEditContent($row['shortcut'],$row).'<br />';
01726 }
01727 break;
01728 case 'list':
01729 $this->getProcessedValue('tt_content','layout',$row,$infoArr);
01730 $out.= $this->infoGif($infoArr).
01731 $GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('tt_content','list_type'),1).' '.
01732 $GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content','list_type',$row['list_type']),1).'<br />';
01733
01734 $out.= $GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('tt_content','select_key'),1).' '.$row['select_key'].'<br />';
01735
01736 $infoArr=Array();
01737 $this->getProcessedValue('tt_content','recursive',$row,$infoArr);
01738 $out.= $this->infoGif($infoArr).
01739 $GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content','pages',$row['pages']),1).'<br />';
01740 break;
01741 case 'script':
01742 $out.= $GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('tt_content','select_key'),1).' '.$row['select_key'].'<br />';
01743 $out.= '<br />'.$this->linkEditContent($this->renderText($row['bodytext']),$row).'<br />';
01744 $out.= '<br />'.$this->linkEditContent($this->renderText($row['imagecaption']),$row).'<br />';
01745 break;
01746 default:
01747 if ($row['bodytext']) {
01748 $out.=$this->linkEditContent($this->renderText($row['bodytext']),$row).'<br />';
01749 }
01750 break;
01751 }
01752
01753 // Wrap span-tags:
01754 $out = '
01755 <span class="exampleContent">'.$out.'</span>';
01756 // Add header:
01757 $out = $outHeader.$out;
01758 // Add RTE button:
01759 if ($isRTE) {
01760 $out.= $this->linkRTEbutton($row);
01761 }
01762
01763 // Return values:
01764 if ($this->isDisabled('tt_content',$row)) {
01765 return $GLOBALS['TBE_TEMPLATE']->dfw($out);
01766 } else {
01767 return $out;
01768 }
01769 }
|
|
||||||||||||||||
|
Will perform "word-wrapping" on the input string. What it does is to split by space or linebreak, then find any word longer than $max and if found, a hyphen is inserted. Works well on normal texts, little less well when HTML is involved (since much HTML will have long strings that will be broken).
Definition at line 2184 of file class.tx_cms_layout.php. References $content. 02184 {
02185 $array = split(' |'.chr(10),$content);
02186 foreach($array as $val) {
02187 if (strlen($val)>$max) {
02188 $content=str_replace($val,substr(chunk_split($val,$max,$char),0,-1),$content);
02189 }
02190 }
02191 return $content;
02192 }
|
|
|
Definition at line 151 of file class.tx_cms_layout.php. |
|
|
Definition at line 129 of file class.tx_cms_layout.php. |
|
|
Definition at line 150 of file class.tx_cms_layout.php. |
|
|
Definition at line 157 of file class.tx_cms_layout.php. |
|
|
Definition at line 132 of file class.tx_cms_layout.php. Referenced by getTable_tt_content(). |
|
|
Definition at line 131 of file class.tx_cms_layout.php. |
|
|
Definition at line 128 of file class.tx_cms_layout.php. |
|
|
Definition at line 127 of file class.tx_cms_layout.php. |
|
|
Definition at line 130 of file class.tx_cms_layout.php. |
|
|
Definition at line 158 of file class.tx_cms_layout.php. |
|
|
Definition at line 123 of file class.tx_cms_layout.php. |
|
|
Definition at line 126 of file class.tx_cms_layout.php. |
|
|
Definition at line 125 of file class.tx_cms_layout.php. |
|
|
Definition at line 124 of file class.tx_cms_layout.php. |
|
|
Definition at line 122 of file class.tx_cms_layout.php. |
|
|
Definition at line 121 of file class.tx_cms_layout.php. |
|
|
Definition at line 118 of file class.tx_cms_layout.php. |
|
|
Definition at line 117 of file class.tx_cms_layout.php. |
|
|
Initial value: Array (
'showInfo' => 1, // Boolean: Display info-marks or not
'showCommands' => 1, // Boolean: Display up/down arrows and edit icons for tt_content records
'showCommands_info' => 1, // Boolean: Displays infoGif with the command buttons
'single' => 1, // Boolean: If set, the content of column(s) $this->tt_contentConfig['showSingleCol'] is shown in the total width of the page
'showSingleCol' => 0, // The column(s) to show if single mode (under each other)
'languageCols' => 0,
'languageMode' => 0,
'languageColsPointer' => 0,
'showHidden' => 1, // Displays hidden records as well
'sys_language_uid' => 0, // Which language
'cols' => '1,0,2,3' // The order of the rows: Default is left(1), Normal(0), right(2), margin(3)
)
Definition at line 135 of file class.tx_cms_layout.php. |
|
|
Initial value: Array(
'nextThree' => Array(),
'prev' => Array(),
'next' => Array()
)
Definition at line 152 of file class.tx_cms_layout.php. |
1.3.8-20040913