00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120 require_once (PATH_typo3.'/class.db_list.inc');
00121 require_once (PATH_typo3.'/class.db_list_extra.inc');
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133 class TBE_browser_recordList extends localRecordList {
00134 var $thisScript = 'browse_links.php';
00135
00136
00137
00138
00139
00140
00141 function TBE_browser_recordList () {
00142 parent::__construct();
00143 $this->thisScript = t3lib_div::getIndpEnv('SCRIPT_NAME');
00144 }
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154 function listURL($altId='',$table=-1,$exclList='') {
00155 return $this->thisScript.
00156 '?id='.(strcmp($altId,'')?$altId:$this->id).
00157 '&table='.rawurlencode($table==-1?$this->table:$table).
00158 ($this->thumbs?'&imagemode='.$this->thumbs:'').
00159 ($this->searchString?'&search_field='.rawurlencode($this->searchString):'').
00160 ($this->searchLevels?'&search_levels='.rawurlencode($this->searchLevels):'').
00161 ((!$exclList || !t3lib_div::inList($exclList,'sortField')) && $this->sortField?'&sortField='.rawurlencode($this->sortField):'').
00162 ((!$exclList || !t3lib_div::inList($exclList,'sortRev')) && $this->sortRev?'&sortRev='.rawurlencode($this->sortRev):'').
00163
00164 $this->ext_addP()
00165 ;
00166 }
00167
00168
00169
00170
00171
00172
00173 function ext_addP() {
00174 $str = '&act='.$GLOBALS['SOBE']->browser->act.
00175 '&mode='.$GLOBALS['SOBE']->browser->mode.
00176 '&expandPage='.$GLOBALS['SOBE']->browser->expandPage.
00177 '&bparams='.rawurlencode($GLOBALS['SOBE']->browser->bparams);
00178 return $str;
00179 }
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190 function linkWrapItems($table,$uid,$code,$row) {
00191 global $TCA, $BACK_PATH;
00192
00193 if (!$code) {
00194 $code = '<i>['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.no_title',1).']</i>';
00195 } else {
00196 $code = t3lib_BEfunc::getRecordTitlePrep($code, $this->fixedL);
00197 }
00198
00199 $title = t3lib_BEfunc::getRecordTitle($table,$row,FALSE,TRUE);
00200 $ficon = t3lib_iconWorks::getIcon($table,$row);
00201 $aOnClick = "return insertElement('".$table."', '".$row['uid']."', 'db', ".t3lib_div::quoteJSvalue($title).", '', '', '".$ficon."');";
00202 $ATag = '<a href="#" onclick="'.$aOnClick.'">';
00203 $ATag_alt = substr($ATag,0,-4).',\'\',1);">';
00204 $ATag_e = '</a>';
00205
00206 return $ATag.
00207 '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/plusbullet2.gif','width="18" height="16"').' title="'.$GLOBALS['LANG']->getLL('addToList',1).'" alt="" />'.
00208 $ATag_e.
00209 $ATag_alt.
00210 $code.
00211 $ATag_e;
00212 }
00213
00214
00215
00216
00217
00218
00219
00220 function generateList() {
00221 $this->allFields = true;
00222 parent::generateList();
00223 }
00224 }
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238 class localPageTree extends t3lib_browseTree {
00239
00240
00241
00242
00243
00244 public $ext_showPageId = FALSE;
00245
00246
00247
00248
00249
00250
00251 function localPageTree() {
00252 $this->thisScript = t3lib_div::getIndpEnv('SCRIPT_NAME');
00253
00254 $this->init();
00255
00256 $this->clause = ' AND doktype!=255'.$this->clause;
00257 }
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267 function wrapTitle($title,$v,$ext_pArrPages='') {
00268 if ($this->ext_isLinkable($v['doktype'],$v['uid'])) {
00269 $aOnClick = "return link_typo3Page('".$v['uid']."');";
00270 return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$title.'</a>';
00271 } else {
00272 return '<span style="color: #666666;">'.$title.'</span>';
00273 }
00274 }
00275
00276
00277
00278
00279
00280
00281
00282 function printTree($treeArr='') {
00283 global $BACK_PATH;
00284 $titleLen=intval($GLOBALS['BE_USER']->uc['titleLen']);
00285 if (!is_array($treeArr)) $treeArr=$this->tree;
00286
00287 $out='';
00288 $c=0;
00289
00290 foreach($treeArr as $k => $v) {
00291 $c++;
00292 $bgColorClass = ($c+1)%2 ? 'bgColor' : 'bgColor-10';
00293 if ($GLOBALS['SOBE']->browser->curUrlInfo['act']=='page' && $GLOBALS['SOBE']->browser->curUrlInfo['pageid']==$v['row']['uid'] && $GLOBALS['SOBE']->browser->curUrlInfo['pageid']) {
00294 $arrCol='<td><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/blinkarrow_right.gif','width="5" height="9"').' class="c-blinkArrowR" alt="" /></td>';
00295 $bgColorClass='bgColor4';
00296 } else {
00297 $arrCol='<td></td>';
00298 }
00299
00300 $aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandPage='.$v['row']['uid'].'\');';
00301 $cEbullet = $this->ext_isLinkable($v['row']['doktype'],$v['row']['uid']) ?
00302 '<a href="#" onclick="'.htmlspecialchars($aOnClick).'"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/ol/arrowbullet.gif','width="18" height="16"').' alt="" /></a>' :
00303 '';
00304 $out.='
00305 <tr class="'.$bgColorClass.'">
00306 <td nowrap="nowrap"'.($v['row']['_CSSCLASS'] ? ' class="'.$v['row']['_CSSCLASS'].'"' : '').'>'.
00307 $v['HTML'].
00308 $this->wrapTitle($this->getTitleStr($v['row'],$titleLen),$v['row'],$this->ext_pArrPages).
00309 '</td>'.
00310 $arrCol.
00311 '<td>'.$cEbullet.'</td>
00312 </tr>';
00313 }
00314 $out='
00315
00316
00317 <!--
00318 Navigation Page Tree:
00319 -->
00320 <table border="0" cellpadding="0" cellspacing="0" id="typo3-tree">
00321 '.$out.'
00322 </table>';
00323 return $out;
00324 }
00325
00326
00327
00328
00329
00330
00331
00332
00333 function ext_isLinkable($doktype,$uid) {
00334 if ($uid && $doktype<199) {
00335 return true;
00336 }
00337 }
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347 function PM_ATagWrap($icon,$cmd,$bMark='') {
00348 if ($bMark) {
00349 $anchor = '#'.$bMark;
00350 $name=' name="'.$bMark.'"';
00351 }
00352 $aOnClick = "return jumpToUrl('".$this->thisScript.'?PM='.$cmd."','".$anchor."');";
00353
00354 return '<a href="#"'.$name.' onclick="'.htmlspecialchars($aOnClick).'">'.$icon.'</a>';
00355 }
00356
00357
00358
00359
00360
00361
00362
00363
00364 function wrapIcon($icon, $row) {
00365 $content = $this->addTagAttributes($icon, ' title="id=' . $row['uid'] . '"');
00366 if ($this->ext_showPageId) {
00367 $content .= '[' . $row['uid'] . '] ';
00368 }
00369 return $content;
00370 }
00371 }
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387 class rtePageTree extends localPageTree {
00388 }
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404 class TBE_PageTree extends localPageTree {
00405
00406
00407
00408
00409
00410
00411
00412
00413 function ext_isLinkable($doktype,$uid) {
00414 return true;
00415 }
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425 function wrapTitle($title,$v,$ext_pArrPages) {
00426 if ($ext_pArrPages) {
00427 $ficon=t3lib_iconWorks::getIcon('pages',$v);
00428 $onClick = "return insertElement('pages', '".$v['uid']."', 'db', ".t3lib_div::quoteJSvalue($v['title']).", '', '', '".$ficon."','',1);";
00429 } else {
00430 $onClick = htmlspecialchars('return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandPage='.$v['uid'].'\');');
00431 }
00432 return '<a href="#" onclick="'.$onClick.'">'.$title.'</a>';
00433 }
00434 }
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451 class localFolderTree extends t3lib_folderTree {
00452 var $ext_IconMode=1;
00453
00454
00455
00456
00457
00458
00459
00460 function localFolderTree() {
00461 $this->thisScript = t3lib_div::getIndpEnv('SCRIPT_NAME');
00462 $this->t3lib_folderTree();
00463 }
00464
00465
00466
00467
00468
00469
00470
00471
00472 function wrapTitle($title,$v) {
00473 if ($this->ext_isLinkable($v)) {
00474 $aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandFolder='.rawurlencode($v['path']).'\');';
00475 return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$title.'</a>';
00476 } else {
00477 return '<span class="typo3-dimmed">'.$title.'</span>';
00478 }
00479 }
00480
00481
00482
00483
00484
00485
00486
00487 function ext_isLinkable($v) {
00488 $webpath=t3lib_BEfunc::getPathType_web_nonweb($v['path']);
00489 if (strstr($v['path'],'_recycler_') || strstr($v['path'],'_temp_') || $webpath!='web') {
00490 return 0;
00491 }
00492 return 1;
00493 }
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504 function PM_ATagWrap($icon,$cmd,$bMark='') {
00505 if ($bMark) {
00506 $anchor = '#'.$bMark;
00507 $name=' name="'.$bMark.'"';
00508 }
00509 $aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?PM='.$cmd.'\',\''.$anchor.'\');';
00510 return '<a href="#"'.$name.' onclick="'.htmlspecialchars($aOnClick).'">'.$icon.'</a>';
00511 }
00512
00513
00514
00515
00516
00517
00518
00519 function printTree($treeArr='') {
00520 global $BACK_PATH;
00521 $titleLen=intval($GLOBALS['BE_USER']->uc['titleLen']);
00522
00523 if (!is_array($treeArr)) $treeArr=$this->tree;
00524
00525 $out='';
00526 $c=0;
00527
00528
00529 if (!$GLOBALS['SOBE']->browser->curUrlInfo['value']) {
00530 $cmpPath='';
00531 } else if (substr(trim($GLOBALS['SOBE']->browser->curUrlInfo['info']),-1)!='/') {
00532 $cmpPath=PATH_site.dirname($GLOBALS['SOBE']->browser->curUrlInfo['info']).'/';
00533 } else {
00534 $cmpPath=PATH_site.$GLOBALS['SOBE']->browser->curUrlInfo['info'];
00535 }
00536
00537
00538 foreach($treeArr as $k => $v) {
00539 $c++;
00540 $bgColorClass=($c+1)%2 ? 'bgColor' : 'bgColor-10';
00541
00542
00543 if (($GLOBALS['SOBE']->browser->curUrlInfo['act'] == 'file' || $GLOBALS['SOBE']->browser->curUrlInfo['act'] == 'folder') && $cmpPath == $v['row']['path']) {
00544 $arrCol='<td><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/blinkarrow_right.gif','width="5" height="9"').' class="c-blinkArrowR" alt="" /></td>';
00545 $bgColorClass='bgColor4';
00546 } else {
00547 $arrCol='<td></td>';
00548 }
00549
00550 $aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandFolder='.rawurlencode($v['row']['path']).'\');';
00551 $cEbullet = $this->ext_isLinkable($v['row']) ? '<a href="#" onclick="'.htmlspecialchars($aOnClick).'"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/ol/arrowbullet.gif','width="18" height="16"').' alt="" /></a>' : '';
00552
00553
00554 $out.='
00555 <tr class="'.$bgColorClass.'">
00556 <td nowrap="nowrap">'.$v['HTML'].$this->wrapTitle(t3lib_div::fixed_lgd_cs($v['row']['title'],$titleLen),$v['row']).'</td>
00557 '.$arrCol.'
00558 <td>'.$cEbullet.'</td>
00559 </tr>';
00560 }
00561
00562 $out='
00563
00564 <!--
00565 Folder tree:
00566 -->
00567 <table border="0" cellpadding="0" cellspacing="0" id="typo3-tree">
00568 '.$out.'
00569 </table>';
00570 return $out;
00571 }
00572 }
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586 class rteFolderTree extends localFolderTree {
00587 }
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602 class TBE_FolderTree extends localFolderTree {
00603 var $ext_noTempRecyclerDirs=0;
00604
00605
00606
00607
00608
00609
00610
00611 function ext_isLinkable($v) {
00612 if ($this->ext_noTempRecyclerDirs && (substr($v['path'],-7)=='_temp_/' || substr($v['path'],-11)=='_recycler_/')) {
00613 return 0;
00614 } return 1;
00615 }
00616
00617
00618
00619
00620
00621
00622
00623
00624 function wrapTitle($title,$v) {
00625 if ($this->ext_isLinkable($v)) {
00626 $aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandFolder='.rawurlencode($v['path']).'\');';
00627 return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$title.'</a>';
00628 } else {
00629 return '<span class="typo3-dimmed">'.$title.'</span>';
00630 }
00631 }
00632 }
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645 class browse_links {
00646
00647
00648 var $siteURL;
00649 var $thisScript;
00650 var $thisConfig;
00651 var $setTarget;
00652 var $setClass;
00653 var $setTitle;
00654 var $doc;
00655 var $elements = array();
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667
00668 var $mode;
00669
00670
00671
00672
00673
00674
00675 var $act;
00676
00677
00678
00679
00680 var $expandPage;
00681
00682
00683
00684
00685 var $expandFolder;
00686
00687
00688
00689
00690
00691
00692 var $P;
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712 var $bparams;
00713
00714
00715
00716
00717
00718 var $RTEtsConfigParams;
00719
00720
00721
00722
00723
00724
00725
00726 var $PM;
00727
00728
00729
00730
00731 var $pointer;
00732
00733
00734
00735
00736
00737
00738
00739 var $curUrlArray;
00740
00741
00742
00743
00744 var $curUrlInfo;
00745
00746
00747
00748
00749 protected $hookObjects = array();
00750
00751
00752
00753
00754
00755 public $fileProcessor;
00756
00757
00758
00759
00760
00761
00762
00763
00764 function init() {
00765 global $BE_USER,$BACK_PATH;
00766
00767
00768 $this->pointer = t3lib_div::_GP('pointer');
00769 $this->bparams = t3lib_div::_GP('bparams');
00770 $this->P = t3lib_div::_GP('P');
00771 $this->RTEtsConfigParams = t3lib_div::_GP('RTEtsConfigParams');
00772 $this->expandPage = t3lib_div::_GP('expandPage');
00773 $this->expandFolder = t3lib_div::_GP('expandFolder');
00774 $this->PM = t3lib_div::_GP('PM');
00775
00776
00777 $this->mode = t3lib_div::_GP('mode');
00778 if (!$this->mode) {
00779 $this->mode = 'rte';
00780 }
00781
00782 $this->doc = t3lib_div::makeInstance('template');
00783 $this->doc->backPath = $GLOBALS['BACK_PATH'];
00784
00785 $this->doc->getPageRenderer()->loadPrototype();
00786 $this->doc->loadJavascriptLib('js/browse_links.js');
00787
00788
00789 $this->hookObjects = array();
00790 if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.browse_links.php']['browseLinksHook'])) {
00791 foreach($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.browse_links.php']['browseLinksHook'] as $classData) {
00792 $processObject = t3lib_div::getUserObj($classData);
00793
00794 if(!($processObject instanceof t3lib_browseLinksHook)) {
00795 throw new UnexpectedValueException('$processObject must implement interface t3lib_browseLinksHook', 1195039394);
00796 }
00797
00798 $parameters = array();
00799 $processObject->init($this, $parameters);
00800 $this->hookObjects[] = $processObject;
00801 }
00802 }
00803
00804
00805 $this->siteURL = t3lib_div::getIndpEnv('TYPO3_SITE_URL');
00806
00807
00808 $this->thisScript = t3lib_div::getIndpEnv('SCRIPT_NAME');
00809
00810
00811 $this->fileProcessor = t3lib_div::makeInstance('t3lib_basicFileFunctions');
00812 $this->fileProcessor->init($GLOBALS['FILEMOUNTS'], $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']);
00813
00814
00815
00816 if ($this->mode == 'wizard') {
00817 $currentLinkParts = t3lib_div::unQuoteFilenames($this->P['currentValue'], TRUE);
00818 $initialCurUrlArray = array (
00819 'href' => $currentLinkParts[0],
00820 'target' => $currentLinkParts[1],
00821 'class' => $currentLinkParts[2],
00822 'title' => $currentLinkParts[3],
00823 );
00824 $this->curUrlArray = (is_array(t3lib_div::_GP('curUrl'))) ?
00825 array_merge($initialCurUrlArray, t3lib_div::_GP('curUrl')) :
00826 $initialCurUrlArray;
00827 $this->curUrlInfo = $this->parseCurUrl($this->siteURL.'?id='.$this->curUrlArray['href'], $this->siteURL);
00828 if ($this->curUrlInfo['pageid'] == 0 && $this->curUrlArray['href']) {
00829 if (file_exists(PATH_site.rawurldecode($this->curUrlArray['href']))) {
00830 if (t3lib_div::isFirstPartOfStr($this->curUrlArray['href'], PATH_site)) {
00831 $currentLinkParts[0] = substr($this->curUrlArray['href'], strlen(PATH_site));
00832 }
00833 $this->curUrlInfo = $this->parseCurUrl($this->siteURL.$this->curUrlArray['href'], $this->siteURL);
00834 } elseif (strstr($this->curUrlArray['href'], '@')) {
00835 if (t3lib_div::isFirstPartOfStr($this->curUrlArray['href'], 'mailto:')) {
00836 $currentLinkParts[0] = substr($this->curUrlArray['href'], 7);
00837 }
00838 $this->curUrlInfo = $this->parseCurUrl('mailto:'.$this->curUrlArray['href'], $this->siteURL);
00839 } else {
00840 if(strpos($this->curUrlArray['href'], ':
00841 $currentLinkParts[0] = 'http:
00842 }
00843 $this->curUrlInfo = $this->parseCurUrl($currentLinkParts[0], $this->siteURL);
00844 }
00845 } elseif (!$this->curUrlArray['href']) {
00846 $this->curUrlInfo = array();
00847 $this->act = 'page';
00848 } else {
00849 $this->curUrlInfo = $this->parseCurUrl($this->siteURL.'?id='.$this->curUrlArray['href'], $this->siteURL);
00850 }
00851 } else {
00852 $this->curUrlArray = t3lib_div::_GP('curUrl');
00853 if ($this->curUrlArray['all']) {
00854 $this->curUrlArray=t3lib_div::get_tag_attributes($this->curUrlArray['all']);
00855 }
00856 $this->curUrlInfo=$this->parseCurUrl($this->curUrlArray['href'],$this->siteURL);
00857 }
00858
00859
00860 $this->act=t3lib_div::_GP('act');
00861 if (!$this->act) {
00862 $this->act=$this->curUrlInfo['act'];
00863 }
00864
00865
00866 $addPassOnParams='';
00867 if ((string)$this->mode == 'rte') {
00868 $RTEtsConfigParts = explode(':',$this->RTEtsConfigParams);
00869 $addPassOnParams.='&RTEtsConfigParams='.rawurlencode($this->RTEtsConfigParams);
00870 $RTEsetup = $GLOBALS['BE_USER']->getTSConfig('RTE',t3lib_BEfunc::getPagesTSconfig($RTEtsConfigParts[5]));
00871 $this->thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup['properties'],$RTEtsConfigParts[0],$RTEtsConfigParts[2],$RTEtsConfigParts[4]);
00872 }
00873
00874
00875 $this->setTarget = ($this->curUrlArray['target'] != '-') ? $this->curUrlArray['target'] : '';
00876 if ($this->thisConfig['defaultLinkTarget'] && !isset($this->curUrlArray['target'])) {
00877 $this->setTarget=$this->thisConfig['defaultLinkTarget'];
00878 }
00879
00880
00881 $this->setClass = ($this->curUrlArray['class'] != '-') ? $this->curUrlArray['class'] : '';
00882
00883
00884 $this->setTitle = ($this->curUrlArray['title'] != '-') ? $this->curUrlArray['title'] : '';
00885
00886
00887 $JScode = '
00888
00889 var add_href="'.($this->curUrlArray['href']?'&curUrl[href]='.rawurlencode($this->curUrlArray['href']):'').'";
00890 var add_target="'.($this->setTarget?'&curUrl[target]='.rawurlencode($this->setTarget):'').'";
00891 var add_class="'.($this->setClass ? '&curUrl[class]='.rawurlencode($this->setClass) : '').'";
00892 var add_title="'.($this->setTitle?'&curUrl[title]='.rawurlencode($this->setTitle):'').'";
00893 var add_params="'.($this->bparams?'&bparams='.rawurlencode($this->bparams):'').'";
00894
00895 var cur_href="'.($this->curUrlArray['href']?$this->curUrlArray['href']:'').'";
00896 var cur_target="'.($this->setTarget?$this->setTarget:'').'";
00897 var cur_class = "'.($this->setClass ? $this->setClass : '-').'";
00898 var cur_title="'.($this->setTitle?$this->setTitle:'').'";
00899
00900 function browse_links_setTarget(target) {
00901 cur_target=target;
00902 add_target="&curUrl[target]="+escape(target);
00903 }
00904 function browse_links_setClass(cssClass) {
00905 cur_class = cssClass;
00906 add_class = "&curUrl[class]=" + escape(cssClass);
00907 }
00908 function browse_links_setTitle(title) {
00909 cur_title=title;
00910 add_title="&curUrl[title]="+escape(title);
00911 }
00912 function browse_links_setValue(value) {
00913 cur_href=value;
00914 add_href="&curUrl[href]="+value;
00915 }
00916 ';
00917
00918 if ($this->mode == 'wizard') {
00919 unset($this->P['fieldChangeFunc']['alert']);
00920 $update='';
00921 foreach ($this->P['fieldChangeFunc'] as $k => $v) {
00922 $update.= '
00923 window.opener.'.$v;
00924 }
00925
00926 $P2=array();
00927 $P2['itemName']=$this->P['itemName'];
00928 $P2['formName']=$this->P['formName'];
00929 $P2['fieldChangeFunc']=$this->P['fieldChangeFunc'];
00930 $P2['params']['allowedExtensions']=$this->P['params']['allowedExtensions'];
00931 $P2['params']['blindLinkOptions']=$this->P['params']['blindLinkOptions'];
00932 $addPassOnParams.=t3lib_div::implodeArrayForUrl('P',$P2);
00933
00934 $JScode.='
00935 function link_typo3Page(id,anchor) {
00936 updateValueInMainForm(id + (anchor ? anchor : ""));
00937 close();
00938 return false;
00939 }
00940 function link_folder(folder) {
00941 updateValueInMainForm(folder);
00942 close();
00943 return false;
00944 }
00945 function link_current() {
00946 if (cur_href!="http://" && cur_href!="mailto:") {
00947 returnBeforeCleaned = cur_href;
00948 if (returnBeforeCleaned.substr(0, 7) == "http://") {
00949 returnToMainFormValue = returnBeforeCleaned.substr(7);
00950 } else if (returnBeforeCleaned.substr(0, 7) == "mailto:") {
00951 if (returnBeforeCleaned.substr(0, 14) == "mailto:mailto:") {
00952 returnToMainFormValue = returnBeforeCleaned.substr(14);
00953 } else {
00954 returnToMainFormValue = returnBeforeCleaned.substr(7);
00955 }
00956 } else {
00957 returnToMainFormValue = returnBeforeCleaned;
00958 }
00959 updateValueInMainForm(returnToMainFormValue);
00960 close();
00961 }
00962 return false;
00963 }
00964 function checkReference() {
00965 if (window.opener && window.opener.document && window.opener.document.'.$this->P['formName'].' && window.opener.document.'.$this->P['formName'].'["'.$this->P['itemName'].'"] ) {
00966 return window.opener.document.'.$this->P['formName'].'["'.$this->P['itemName'].'"];
00967 } else {
00968 close();
00969 }
00970 }
00971 function updateValueInMainForm(input) {
00972 var field = checkReference();
00973 if (field) {
00974 if (cur_target == "" && (cur_title != "" || cur_class != "-")) {
00975 cur_target = "-";
00976 }
00977 if (cur_title == "" && cur_class == "-") {
00978 cur_class = "";
00979 }
00980 cur_class = cur_class.replace(/[\'\"]/g, "");
00981 if (cur_class.indexOf(" ") != -1) {
00982 cur_class = "\"" + cur_class + "\"";
00983 }
00984 cur_title = cur_title.replace(/(^\")|(\"$)/g, "");
00985 if (cur_title.indexOf(" ") != -1) {
00986 cur_title = "\"" + cur_title + "\"";
00987 }
00988 input = input + " " + cur_target + " " + cur_class + " " + cur_title;
00989 field.value = input;
00990 '.$update.'
00991 }
00992 }
00993 ';
00994 } else {
00995 $JScode.='
00996 function link_typo3Page(id,anchor) {
00997 var theLink = \''.$this->siteURL.'?id=\'+id+(anchor?anchor:"");
00998 self.parent.parent.renderPopup_addLink(theLink, cur_target, cur_class, cur_title);
00999 return false;
01000 }
01001 function link_folder(folder) {
01002 var theLink = \''.$this->siteURL.'\'+folder;
01003 self.parent.parent.renderPopup_addLink(theLink, cur_target, cur_class, cur_title);
01004 return false;
01005 }
01006 function link_spec(theLink) {
01007 self.parent.parent.renderPopup_addLink(theLink, cur_target, cur_class, cur_title);
01008 return false;
01009 }
01010 function link_current() {
01011 if (cur_href!="http://" && cur_href!="mailto:") {
01012 self.parent.parent.renderPopup_addLink(cur_href, cur_target, cur_class, cur_title);
01013 }
01014 return false;
01015 }
01016 ';
01017 }
01018
01019
01020 $JScode.='
01021 function jumpToUrl(URL,anchor) {
01022 var add_act = URL.indexOf("act=")==-1 ? "&act='.$this->act.'" : "";
01023 var add_mode = URL.indexOf("mode=")==-1 ? "&mode='.$this->mode.'" : "";
01024 var theLocation = URL + add_act + add_mode + add_href + add_target + add_class + add_title + add_params'.($addPassOnParams?'+"'.$addPassOnParams.'"':'').'+(anchor?anchor:"");
01025 window.location.href = theLocation;
01026 return false;
01027 }
01028 ';
01029
01030
01031
01032
01033
01034
01035 $pArr = explode('|',$this->bparams);
01036
01037
01038 $formFieldName = 'data['.$pArr[0].']['.$pArr[1].']['.$pArr[2].']';
01039
01040
01041 if ($pArr[4] && $pArr[5]) {
01042 $JScodeCheck = '
01043
01044 if (parent.window.opener) {
01045 var res = parent.window.opener.'.$pArr[5].'("'.addslashes($pArr[4]).'",table,uid,type);
01046 if (!res.passed) {
01047 if (res.message) alert(res.message);
01048 performAction = false;
01049 }
01050 } else {
01051 alert("Error - reference to main window is not set properly!");
01052 parent.close();
01053 }
01054 ';
01055 }
01056
01057 if ($pArr[4] && $pArr[6]) {
01058 $JScodeHelper = '
01059
01060 if (parent.window.opener) {
01061 parent.window.opener.'.$pArr[6].'("'.addslashes($pArr[4]).'",table,uid,type,"'.addslashes($pArr[0]).'");
01062 } else {
01063 alert("Error - reference to main window is not set properly!");
01064 parent.close();
01065 }
01066 ';
01067 }
01068
01069 if ($pArr[4] && $pArr[7]) {
01070
01071 $JScodeAction = '
01072 if (parent.window.opener) {
01073 parent.window.opener.'.$pArr[7].'("'.addslashes($pArr[4]).'",table,uid,type);
01074 focusOpenerAndClose(close);
01075 } else {
01076 alert("Error - reference to main window is not set properly!");
01077 parent.close();
01078 }
01079 ';
01080 } else if ($pArr[0] && !$pArr[1] && !$pArr[2]) {
01081 $JScodeAction = '
01082 addElement(filename,table+"_"+uid,fp,close);
01083 ';
01084 } else {
01085 $JScodeAction = '
01086 if (setReferences()) {
01087 parent.window.opener.group_change("add","'.$pArr[0].'","'.$pArr[1].'","'.$pArr[2].'",elRef,targetDoc);
01088 } else {
01089 alert("Error - reference to main window is not set properly!");
01090 }
01091 focusOpenerAndClose(close);
01092 ';
01093 }
01094
01095 $JScode.='
01096 var elRef="";
01097 var targetDoc="";
01098
01099 function launchView(url) {
01100 var thePreviewWindow="";
01101 thePreviewWindow = window.open("'.$BACK_PATH.'show_item.php?table="+url,"ShowItem","height=300,width=410,status=0,menubar=0,resizable=0,location=0,directories=0,scrollbars=1,toolbar=0");
01102 if (thePreviewWindow && thePreviewWindow.focus) {
01103 thePreviewWindow.focus();
01104 }
01105 }
01106 function setReferences() {
01107 if (parent.window.opener && parent.window.opener.content && parent.window.opener.content.document.editform && parent.window.opener.content.document.editform["'.$formFieldName.'"]) {
01108 targetDoc = parent.window.opener.content.document;
01109 elRef = targetDoc.editform["'.$formFieldName.'"];
01110 return true;
01111 } else {
01112 return false;
01113 }
01114 }
01115 function insertElement(table, uid, type, filename,fp,filetype,imagefile,action, close) {
01116 var performAction = true;
01117 '.$JScodeCheck.'
01118
01119 if (performAction) {
01120 '.$JScodeHelper.$JScodeAction.'
01121 }
01122 return false;
01123 }
01124 function addElement(elName,elValue,altElValue,close) {
01125 if (parent.window.opener && parent.window.opener.setFormValueFromBrowseWin) {
01126 parent.window.opener.setFormValueFromBrowseWin("'.$pArr[0].'",altElValue?altElValue:elValue,elName);
01127 focusOpenerAndClose(close);
01128 } else {
01129 alert("Error - reference to main window is not set properly!");
01130 parent.close();
01131 }
01132 }
01133 function focusOpenerAndClose(close) {
01134 BrowseLinks.focusOpenerAndClose(close);
01135 }
01136 ';
01137
01138
01139 $this->doc->JScode.= $this->doc->wrapScriptTags($JScode);
01140
01141
01142 if (FALSE) debug(array(
01143 'pointer' => $this->pointer,
01144 'act' => $this->act,
01145 'mode' => $this->mode,
01146 'curUrlInfo' => $this->curUrlInfo,
01147 'curUrlArray' => $this->curUrlArray,
01148 'P' => $this->P,
01149 'bparams' => $this->bparams,
01150 'RTEtsConfigParams' => $this->RTEtsConfigParams,
01151 'expandPage' => $this->expandPage,
01152 'expandFolder' => $this->expandFolder,
01153 'PM' => $this->PM,
01154 ),'Internal variables of Script Class:');
01155 }
01156
01157
01158
01159
01160
01161
01162
01163
01164
01165 function processSessionData($data) {
01166 $store = false;
01167
01168 switch((string)$this->mode) {
01169 case 'db':
01170 if (isset($this->expandPage)) {
01171 $data['expandPage']=$this->expandPage;
01172 $store = true;
01173 } else {
01174 $this->expandPage=$data['expandPage'];
01175 }
01176 break;
01177 case 'file':
01178 case 'filedrag':
01179 case 'folder':
01180 if (isset($this->expandFolder)) {
01181 $data['expandFolder']=$this->expandFolder;
01182 $store = true;
01183 } else {
01184 $this->expandFolder=$data['expandFolder'];
01185 }
01186 break;
01187 }
01188
01189 return array($data, $store);
01190 }
01191
01192
01193
01194
01195
01196
01197
01198
01199
01200
01201
01202
01203
01204
01205
01206
01207
01208
01209 function main_rte($wiz=0) {
01210 global $LANG, $BACK_PATH;
01211
01212
01213 $content=$this->doc->startPage('RTE link');
01214
01215
01216 $allowedItems = array_diff(
01217 explode(',','page,file,folder,url,mail,spec'),
01218 t3lib_div::trimExplode(',',$this->thisConfig['blindLinkOptions'],1)
01219 );
01220 $allowedItems = array_diff(
01221 $allowedItems,
01222 t3lib_div::trimExplode(',',$this->P['params']['blindLinkOptions'])
01223 );
01224
01225
01226 foreach($this->hookObjects as $hookObject) {
01227 $allowedItems = $hookObject->addAllowedItems($allowedItems);
01228 }
01229
01230 reset($allowedItems);
01231 if (!in_array($this->act,$allowedItems)) $this->act = current($allowedItems);
01232
01233
01234 $menuDef = array();
01235 if (!$wiz) {
01236 $menuDef['removeLink']['isActive'] = $this->act=='removeLink';
01237 $menuDef['removeLink']['label'] = $LANG->getLL('removeLink',1);
01238 $menuDef['removeLink']['url'] = '#';
01239 $menuDef['removeLink']['addParams'] = 'onclick="self.parent.parent.renderPopup_unLink();return false;"';
01240 }
01241 if (in_array('page',$allowedItems)) {
01242 $menuDef['page']['isActive'] = $this->act=='page';
01243 $menuDef['page']['label'] = $LANG->getLL('page',1);
01244 $menuDef['page']['url'] = '#';
01245 $menuDef['page']['addParams'] = 'onclick="jumpToUrl(\'?act=page\');return false;"';
01246 }
01247 if (in_array('file',$allowedItems)){
01248 $menuDef['file']['isActive'] = $this->act=='file';
01249 $menuDef['file']['label'] = $LANG->getLL('file',1);
01250 $menuDef['file']['url'] = '#';
01251 $menuDef['file']['addParams'] = 'onclick="jumpToUrl(\'?act=file\');return false;"';
01252 }
01253 if (in_array('folder',$allowedItems)){
01254 $menuDef['folder']['isActive'] = $this->act == 'folder';
01255 $menuDef['folder']['label'] = $LANG->getLL('folder', 1);
01256 $menuDef['folder']['url'] = '#';
01257 $menuDef['folder']['addParams'] = 'onclick="jumpToUrl(\'?act=folder\');return false;"';
01258 }
01259 if (in_array('url',$allowedItems)) {
01260 $menuDef['url']['isActive'] = $this->act=='url';
01261 $menuDef['url']['label'] = $LANG->getLL('extUrl',1);
01262 $menuDef['url']['url'] = '#';
01263 $menuDef['url']['addParams'] = 'onclick="jumpToUrl(\'?act=url\');return false;"';
01264 }
01265 if (in_array('mail',$allowedItems)) {
01266 $menuDef['mail']['isActive'] = $this->act=='mail';
01267 $menuDef['mail']['label'] = $LANG->getLL('email',1);
01268 $menuDef['mail']['url'] = '#';
01269 $menuDef['mail']['addParams'] = 'onclick="jumpToUrl(\'?act=mail\');return false;"';
01270 }
01271 if (is_array($this->thisConfig['userLinks.']) && in_array('spec',$allowedItems)) {
01272 $menuDef['spec']['isActive'] = $this->act=='spec';
01273 $menuDef['spec']['label'] = $LANG->getLL('special',1);
01274 $menuDef['spec']['url'] = '#';
01275 $menuDef['spec']['addParams'] = 'onclick="jumpToUrl(\'?act=spec\');return false;"';
01276 }
01277
01278
01279 foreach($this->hookObjects as $hookObject) {
01280 $menuDef = $hookObject->modifyMenuDefinition($menuDef);
01281 }
01282
01283 $content .= $this->doc->getTabMenuRaw($menuDef);
01284
01285
01286 $content.=$this->printCurrentUrl($this->curUrlInfo['info']).'<br />';
01287
01288
01289 switch($this->act) {
01290 case 'mail':
01291 $extUrl='
01292
01293 <!--
01294 Enter mail address:
01295 -->
01296 <form action="" name="lurlform" id="lurlform">
01297 <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkMail">
01298 <tr>
01299 <td style="width: 96px;">' . $GLOBALS['LANG']->getLL('emailAddress', 1) . ':</td>
01300 <td><input type="text" name="lemail"'.$this->doc->formWidth(20).' value="'.htmlspecialchars($this->curUrlInfo['act']=='mail'?$this->curUrlInfo['info']:'').'" /> '.
01301 '<input type="submit" value="' . $GLOBALS['LANG']->getLL('setLink', 1) . '" onclick="browse_links_setTarget(\'\');browse_links_setValue(\'mailto:\'+document.lurlform.lemail.value); return link_current();" /></td>
01302 </tr>
01303 </table>
01304 </form>';
01305 $content.=$extUrl;
01306 break;
01307 case 'url':
01308 $extUrl='
01309
01310 <!--
01311 Enter External URL:
01312 -->
01313 <form action="" name="lurlform" id="lurlform">
01314 <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkURL">
01315 <tr>
01316 <td style="width: 96px;">URL:</td>
01317 <td><input type="text" name="lurl"'.$this->doc->formWidth(30).' value="'.htmlspecialchars($this->curUrlInfo['act']=='url'?$this->curUrlInfo['info']:'http://').'" /> '.
01318 '<input type="submit" value="' . $GLOBALS['LANG']->getLL('setLink', 1) . '" onclick="browse_links_setValue(document.lurlform.lurl.value); return link_current();" /></td>
01319 </tr>
01320 </table>
01321 </form>';
01322 $content.=$extUrl;
01323 break;
01324 case 'file':
01325 case 'folder':
01326 $foldertree = t3lib_div::makeInstance('rteFolderTree');
01327 $foldertree->thisScript = $this->thisScript;
01328 $tree = $foldertree->getBrowsableTree();
01329
01330 if (!$this->curUrlInfo['value'] || $this->curUrlInfo['act'] != $this->act) {
01331 $cmpPath = '';
01332 } elseif (substr(trim($this->curUrlInfo['info']), -1) != '/') {
01333 $cmpPath = PATH_site.dirname($this->curUrlInfo['info']).'/';
01334 if (!isset($this->expandFolder)) {
01335 $this->expandFolder = $cmpPath;
01336 }
01337 } else {
01338 $cmpPath = PATH_site.$this->curUrlInfo['info'];
01339 if (!isset($this->expandFolder) && $this->curUrlInfo['act'] == 'folder') {
01340 $this->expandFolder = $cmpPath;
01341 }
01342 }
01343
01344 list(, , $specUid) = explode('_', $this->PM);
01345 $files = $this->expandFolder(
01346 $foldertree->specUIDmap[$specUid],
01347 $this->P['params']['allowedExtensions']
01348 );
01349 $content.= '
01350
01351 <!--
01352 Wrapper table for folder tree / file/folder list:
01353 -->
01354 <table border="0" cellpadding="0" cellspacing="0" id="typo3-linkFiles">
01355 <tr>
01356 <td class="c-wCell" valign="top">'.$this->barheader($GLOBALS['LANG']->getLL('folderTree').':').$tree.'</td>
01357 <td class="c-wCell" valign="top">'.$files.'</td>
01358 </tr>
01359 </table>
01360 ';
01361 break;
01362 case 'spec':
01363 if (is_array($this->thisConfig['userLinks.'])) {
01364 $subcats=array();
01365 $v=$this->thisConfig['userLinks.'];
01366 foreach ($v as $k2 => $value) {
01367 $k2i = intval($k2);
01368 if (substr($k2,-1)=='.' && is_array($v[$k2i.'.'])) {
01369
01370
01371 $title = trim($v[$k2i]);
01372 if (!$title) {
01373 $title=$v[$k2i.'.']['url'];
01374 } else {
01375 $title=$LANG->sL($title);
01376 }
01377
01378 $description=$v[$k2i.'.']['description'] ? $LANG->sL($v[$k2i.'.']['description'],1).'<br />' : '';
01379
01380
01381 $onClickEvent='';
01382 if (isset($v[$k2i.'.']['target'])) $onClickEvent.="browse_links_setTarget('".$v[$k2i.'.']['target']."');";
01383 $v[$k2i.'.']['url'] = str_replace('###_URL###',$this->siteURL,$v[$k2i.'.']['url']);
01384 if (substr($v[$k2i.'.']['url'],0,7)=='http:
01385 $onClickEvent.="cur_href=unescape('".rawurlencode($v[$k2i.'.']['url'])."');link_current();";
01386 } else {
01387 $onClickEvent.="link_spec(unescape('".$this->siteURL.rawurlencode($v[$k2i.'.']['url'])."'));";
01388 }
01389
01390
01391 $A=array('<a href="#" onclick="'.htmlspecialchars($onClickEvent).'return false;">','</a>');
01392
01393
01394 $subcats[$k2i]='
01395 <tr>
01396 <td class="bgColor4">'.$A[0].'<strong>'.htmlspecialchars($title).($this->curUrlInfo['info']==$v[$k2i.'.']['url']?'<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/blinkarrow_right.gif','width="5" height="9"').' class="c-blinkArrowR" alt="" />':'').'</strong><br />'.$description.$A[1].'</td>
01397 </tr>';
01398 }
01399 }
01400
01401
01402 ksort($subcats);
01403
01404
01405 $content.= '
01406
01407 <!--
01408 Special userdefined menu:
01409 -->
01410 <table border="0" cellpadding="1" cellspacing="1" id="typo3-linkSpecial">
01411 <tr>
01412 <td class="bgColor5" class="c-wCell" valign="top"><strong>'.$LANG->getLL('special',1).'</strong></td>
01413 </tr>
01414 '.implode('',$subcats).'
01415 </table>
01416 ';
01417 }
01418 break;
01419 case 'page':
01420 $pagetree = t3lib_div::makeInstance('rtePageTree');
01421 $pagetree->thisScript = $this->thisScript;
01422 $pagetree->ext_showPageId = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showPageIdWithTitle');
01423 $tree=$pagetree->getBrowsableTree();
01424 $cElements = $this->expandPage();
01425
01426
01427 if (intval($GLOBALS['BE_USER']->getSessionData('pageTree_temporaryMountPoint'))) {
01428 $link = '<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('setTempDBmount' => 0))) . '">' .
01429 $LANG->sl('LLL:EXT:lang/locallang_core.xml:labels.temporaryDBmount', 1) .
01430 '</a>';
01431 $flashMessage = t3lib_div::makeInstance(
01432 't3lib_FlashMessage',
01433 $link,
01434 '',
01435 t3lib_FlashMessage::INFO
01436 );
01437 $dbmount = $flashMessage->render();
01438 }
01439
01440 $content.= '
01441
01442 <!--
01443 Wrapper table for page tree / record list:
01444 -->
01445 <table border="0" cellpadding="0" cellspacing="0" id="typo3-linkPages">
01446 <tr>
01447 <td class="c-wCell" valign="top">' . $this->barheader($GLOBALS['LANG']->getLL('pageTree') . ':') . $dbmount . $tree . '</td>
01448 <td class="c-wCell" valign="top">'.$cElements.'</td>
01449 </tr>
01450 </table>
01451 ';
01452 break;
01453 default:
01454
01455 foreach($this->hookObjects as $hookObject) {
01456 $content .= $hookObject->getTab($this->act);
01457 }
01458 break;
01459 }
01460
01461 $content .= '
01462
01463 <!--
01464 Selecting class for link:
01465 -->
01466 <form action="" name="lclassform" id="lclassform">
01467 <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkClass">
01468 <tr>
01469 <td style="width: 96px;">' . $GLOBALS['LANG']->getLL('class', 1) . '</td>
01470 <td><input type="text" name="lclass" onchange="browse_links_setClass(this.value);" value="' . htmlspecialchars($this->setClass) . '"' . $this->doc->formWidth(10) . ' /></td>
01471 </tr>
01472 </table>
01473 </form>
01474
01475 <!--
01476 Selecting title for link:
01477 -->
01478 <form action="" name="ltitleform" id="ltitleform">
01479 <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkTitle">
01480 <tr>
01481 <td style="width: 96px;">' . $GLOBALS['LANG']->getLL('title', 1) . '</td>
01482 <td><input type="text" name="ltitle" onchange="browse_links_setTitle(this.value);" value="' . htmlspecialchars($this->setTitle) . '"' . $this->doc->formWidth(10) . ' /></td>
01483 </tr>
01484 </table>
01485 </form>
01486 ';
01487
01488
01489 if ($this->act!='mail') {
01490 $ltarget='
01491
01492
01493
01494 <!--
01495 Selecting target for link:
01496 -->
01497 <form action="" name="ltargetform" id="ltargetform">
01498 <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkTarget">
01499 <tr>
01500 <td>'.$GLOBALS['LANG']->getLL('target',1).':</td>
01501 <td><input type="text" name="ltarget" onchange="browse_links_setTarget(this.value);" value="' . htmlspecialchars($this->setTarget) . '"' . $this->doc->formWidth(10) . ' /></td>
01502 <td>
01503 <select name="ltarget_type" onchange="browse_links_setTarget(this.options[this.selectedIndex].value);document.ltargetform.ltarget.value=this.options[this.selectedIndex].value;this.selectedIndex=0;">
01504 <option></option>
01505 <option value="_top">'.$GLOBALS['LANG']->getLL('top',1).'</option>
01506 <option value="_blank">'.$GLOBALS['LANG']->getLL('newWindow',1).'</option>
01507 </select>
01508 </td>
01509 <td>';
01510 if (($this->curUrlInfo['act'] == 'page' || $this->curUrlInfo['act'] == 'file' || $this->curUrlInfo['act'] == 'folder') && $this->curUrlArray['href'] && $this->curUrlInfo['act'] == $this->act) {
01511 $ltarget.='
01512 <input type="submit" value="'.$GLOBALS['LANG']->getLL('update',1).'" onclick="return link_current();" />';
01513 }
01514
01515 $selectJS = '
01516 if (document.ltargetform.popup_width.options[document.ltargetform.popup_width.selectedIndex].value>0 && document.ltargetform.popup_height.options[document.ltargetform.popup_height.selectedIndex].value>0) {
01517 document.ltargetform.ltarget.value = document.ltargetform.popup_width.options[document.ltargetform.popup_width.selectedIndex].value+"x"+document.ltargetform.popup_height.options[document.ltargetform.popup_height.selectedIndex].value;
01518 browse_links_setTarget(document.ltargetform.ltarget.value);
01519 browse_links_setClass(document.lclassform.lclass.value);
01520 browse_links_setTitle(document.ltitleform.ltitle.value);
01521 document.ltargetform.popup_width.selectedIndex=0;
01522 document.ltargetform.popup_height.selectedIndex=0;
01523 }
01524 ';
01525
01526 $ltarget.=' </td>
01527 </tr>
01528 <tr>
01529 <td>'.$GLOBALS['LANG']->getLL('target_popUpWindow',1).':</td>
01530 <td colspan="3">
01531 <select name="popup_width" onchange="'.htmlspecialchars($selectJS).'">
01532 <option value="0">'.$GLOBALS['LANG']->getLL('target_popUpWindow_width',1).'</option>
01533 <option value="300">300</option>
01534 <option value="400">400</option>
01535 <option value="500">500</option>
01536 <option value="600">600</option>
01537 <option value="700">700</option>
01538 <option value="800">800</option>
01539 </select>
01540 x
01541 <select name="popup_height" onchange="'.htmlspecialchars($selectJS).'">
01542 <option value="0">'.$GLOBALS['LANG']->getLL('target_popUpWindow_height',1).'</option>
01543 <option value="200">200</option>
01544 <option value="300">300</option>
01545 <option value="400">400</option>
01546 <option value="500">500</option>
01547 <option value="600">600</option>
01548 </select>
01549 </td>
01550 </tr>
01551 </table>
01552 </form>';
01553
01554
01555 $content.=$ltarget;
01556
01557
01558 $content.='<br /><br />';
01559 }
01560
01561
01562 $content.= $this->doc->endPage();
01563 $content = $this->doc->insertStylesAndJS($content);
01564 return $content;
01565 }
01566
01567
01568
01569
01570
01571
01572 function main_db() {
01573
01574
01575 $content=$this->doc->startPage('TBE record selector');
01576
01577
01578 $pArr = explode('|',$this->bparams);
01579
01580
01581 $pagetree = t3lib_div::makeInstance('TBE_PageTree');
01582 $pagetree->thisScript=$this->thisScript;
01583 $pagetree->ext_pArrPages = !strcmp($pArr[3],'pages')?1:0;
01584 $pagetree->ext_showNavTitle = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showNavTitle');
01585 $pagetree->ext_showPageId = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showPageIdWithTitle');
01586 $pagetree->addField('nav_title');
01587 $tree=$pagetree->getBrowsableTree();
01588
01589
01590 $cElements = $this->TBE_expandPage($pArr[3]);
01591
01592
01593 $content.= '
01594
01595 <!--
01596 Wrapper table for page tree / record list:
01597 -->
01598 <table border="0" cellpadding="0" cellspacing="0" id="typo3-EBrecords">
01599 <tr>
01600 <td class="c-wCell" valign="top">'.$this->barheader($GLOBALS['LANG']->getLL('pageTree').':').$tree.'</td>
01601 <td class="c-wCell" valign="top">'.$cElements.'</td>
01602 </tr>
01603 </table>
01604 ';
01605
01606
01607 $content.='<br /><br />';
01608
01609
01610 $content.= $this->doc->endPage();
01611 $content = $this->doc->insertStylesAndJS($content);
01612 return $content;
01613 }
01614
01615
01616
01617
01618
01619
01620 function main_file() {
01621 global $BE_USER;
01622
01623
01624 $content.=$this->doc->startPage('TBE file selector');
01625
01626
01627 $pArr = explode('|',$this->bparams);
01628
01629
01630 $path=$this->expandFolder;
01631 if (!$path || !@is_dir($path)) {
01632
01633 $path = $this->fileProcessor->findTempFolder().'/';
01634 }
01635 if ($path!='/' && @is_dir($path)) {
01636 $uploadForm=$this->uploadForm($path);
01637 $createFolder=$this->createFolder($path);
01638 } else {
01639 $createFolder='';
01640 $uploadForm='';
01641 }
01642 if ($BE_USER->getTSConfigVal('options.uploadFieldsInTopOfEB')) $content.=$uploadForm;
01643
01644
01645 $noThumbs = $GLOBALS['BE_USER']->getTSConfigVal('options.noThumbsInEB');
01646
01647 if (!$noThumbs) {
01648
01649 $_MOD_MENU = array('displayThumbs' => '');
01650 $_MCONF['name']='file_list';
01651 $_MOD_SETTINGS = t3lib_BEfunc::getModuleData($_MOD_MENU, t3lib_div::_GP('SET'), $_MCONF['name']);
01652 $addParams = '&act='.$this->act.'&mode='.$this->mode.'&expandFolder='.rawurlencode($path).'&bparams='.rawurlencode($this->bparams);
01653 $thumbNailCheck = t3lib_BEfunc::getFuncCheck('','SET[displayThumbs]',$_MOD_SETTINGS['displayThumbs'],$this->thisScript,$addParams,'id="checkDisplayThumbs"').' <label for="checkDisplayThumbs">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.php:displayThumbs',1).'</label>';
01654 } else {
01655 $thumbNailCheck='';
01656 }
01657 $noThumbs = $noThumbs ? $noThumbs : !$_MOD_SETTINGS['displayThumbs'];
01658
01659
01660 $foldertree = t3lib_div::makeInstance('TBE_FolderTree');
01661 $foldertree->thisScript=$this->thisScript;
01662 $foldertree->ext_noTempRecyclerDirs = ($this->mode == 'filedrag');
01663 $tree=$foldertree->getBrowsableTree();
01664
01665 list(,,$specUid) = explode('_',$this->PM);
01666
01667 if ($this->mode=='filedrag') {
01668 $files = $this->TBE_dragNDrop($foldertree->specUIDmap[$specUid],$pArr[3]);
01669 } else {
01670 $files = $this->TBE_expandFolder($foldertree->specUIDmap[$specUid],$pArr[3],$noThumbs);
01671 }
01672
01673
01674 $content.= '
01675
01676 <!--
01677 Wrapper table for folder tree / file list:
01678 -->
01679 <table border="0" cellpadding="0" cellspacing="0" id="typo3-EBfiles">
01680 <tr>
01681 <td class="c-wCell" valign="top">'.$this->barheader($GLOBALS['LANG']->getLL('folderTree').':').$tree.'</td>
01682 <td class="c-wCell" valign="top">'.$files.'</td>
01683 </tr>
01684 </table>
01685 ';
01686 $content.= $thumbNailCheck;
01687
01688
01689 if (!$BE_USER->getTSConfigVal('options.uploadFieldsInTopOfEB')) $content.=$uploadForm;
01690 if ($BE_USER->isAdmin() || $BE_USER->getTSConfigVal('options.createFoldersInEB')) $content.=$createFolder;
01691
01692
01693 $content.='<br /><br />';
01694
01695
01696 $this->doc->JScode.= $this->doc->wrapScriptTags('BrowseLinks.addElements(' . json_encode($this->elements) . ');');
01697
01698 $content.= $this->doc->endPage();
01699 $content = $this->doc->insertStylesAndJS($content);
01700
01701 return $content;
01702 }
01703
01704
01705
01706
01707
01708
01709 function main_folder() {
01710 global $BE_USER;
01711
01712
01713 $content = $this->doc->startPage('TBE folder selector');
01714
01715
01716 $parameters = explode('|', $this->bparams);
01717
01718
01719 $path = $this->expandFolder;
01720 if (!$path || !@is_dir($path)) {
01721
01722 $path = $this->fileProcessor->findTempFolder().'/';
01723 }
01724 if ($path != '/' && @is_dir($path)) {
01725 $createFolder = $this->createFolder($path);
01726 } else {
01727 $createFolder='';
01728 }
01729
01730
01731 $foldertree = t3lib_div::makeInstance('TBE_FolderTree');
01732 $foldertree->thisScript = $this->thisScript;
01733 $foldertree->ext_noTempRecyclerDirs = ($this->mode == 'filedrag');
01734 $tree = $foldertree->getBrowsableTree(false);
01735
01736 list(, , $specUid) = explode('_', $this->PM);
01737
01738 if($this->mode == 'filedrag') {
01739 $folders = $this->TBE_dragNDrop(
01740 $foldertree->specUIDmap[$specUid],
01741 $parameters[3]
01742 );
01743 } else {
01744 $folders = $this->TBE_expandSubFolders($foldertree->specUIDmap[$specUid]);
01745 }
01746
01747
01748 $content.= '
01749
01750 <!--
01751 Wrapper table for folder tree / folder list:
01752 -->
01753 <table border="0" cellpadding="0" cellspacing="0" id="typo3-EBfiles">
01754 <tr>
01755 <td class="c-wCell" valign="top">'.$this->barheader($GLOBALS['LANG']->getLL('folderTree').':').$tree.'</td>
01756 <td class="c-wCell" valign="top">'.$folders.'</td>
01757 </tr>
01758 </table>
01759 ';
01760
01761
01762 if($BE_USER->isAdmin() || $BE_USER->getTSConfigVal('options.createFoldersInEB')) {
01763 $content .= $createFolder;
01764 }
01765
01766
01767 $content .= '<br /><br />';
01768
01769
01770 $content.= $this->doc->endPage();
01771 $content = $this->doc->insertStylesAndJS($content);
01772
01773 return $content;
01774 }
01775
01776
01777
01778
01779
01780
01781
01782
01783
01784
01785
01786
01787
01788
01789
01790
01791
01792
01793
01794
01795
01796
01797
01798
01799
01800
01801
01802 function expandPage() {
01803 global $BE_USER, $BACK_PATH;
01804
01805 $out='';
01806 $expPageId = $this->expandPage;
01807
01808
01809 if (!$this->expandPage && $this->curUrlInfo['cElement']) {
01810 $expPageId = $this->curUrlInfo['pageid'];
01811 }
01812
01813
01814 if ($expPageId && t3lib_div::testInt($expPageId) && $BE_USER->isInWebMount($expPageId)) {
01815
01816
01817 $out.=$this->barheader($GLOBALS['LANG']->getLL('contentElements').':');
01818
01819
01820 $titleLen=intval($GLOBALS['BE_USER']->uc['titleLen']);
01821 $mainPageRec = t3lib_BEfunc::getRecordWSOL('pages',$expPageId);
01822 $picon = t3lib_iconWorks::getSpriteIconForRecord('pages', $mainPageRec);
01823 $picon.= htmlspecialchars(t3lib_div::fixed_lgd_cs($mainPageRec['title'],$titleLen));
01824 $out.=$picon.'<br />';
01825
01826
01827 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
01828 'uid,header,hidden,starttime,endtime,fe_group,CType,colpos,bodytext',
01829 'tt_content',
01830 'pid='.intval($expPageId).
01831 t3lib_BEfunc::deleteClause('tt_content').
01832 t3lib_BEfunc::versioningPlaceholderClause('tt_content'),
01833 '',
01834 'colpos,sorting'
01835 );
01836 $cc = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
01837
01838
01839 $c=0;
01840 while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
01841 $c++;
01842 $icon = t3lib_iconWorks::getSpriteIconForRecord('tt_content', $row);
01843 if ($this->curUrlInfo['act']=='page' && $this->curUrlInfo['cElement']==$row['uid']) {
01844 $arrCol='<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/blinkarrow_left.gif','width="5" height="9"').' class="c-blinkArrowL" alt="" />';
01845 } else {
01846 $arrCol='';
01847 }
01848
01849 $out.='<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/ol/join'.($c==$cc?'bottom':'').'.gif','width="18" height="16"').' alt="" />'.
01850 $arrCol.
01851 '<a href="#" onclick="return link_typo3Page(\''.$expPageId.'\',\'#'.$row['uid'].'\');">'.
01852 $icon.
01853 htmlspecialchars(t3lib_div::fixed_lgd_cs($row['header'],$titleLen)).
01854 '</a><br />';
01855
01856
01857 if (t3lib_div::inList('text,textpic', $row['CType'])) {
01858 $split = preg_split('/(<a[^>]+name=[\'"]?([^"\'>[:space:]]+)[\'"]?[^>]*>)/i', $row['bodytext'], -1, PREG_SPLIT_DELIM_CAPTURE);
01859
01860 foreach($split as $skey => $sval) {
01861 if (($skey%3)==2) {
01862 // Putting list element HTML together:
01863 $sval = substr($sval,0,100);
01864 $out.='<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/ol/line.gif','width="18" height="16"').' alt="" />'.
01865 '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/ol/join'.($skey+3>count($split)?'bottom':'').'.gif','width="18" height="16"').' alt="" />'.
01866 '<a href="#" onclick="return link_typo3Page(\''.$expPageId.'\',\'#'.rawurlencode($sval).'\');">'.
01867 htmlspecialchars(' <A> '.$sval).
01868 '</a><br />';
01869 }
01870 }
01871 }
01872 }
01873 }
01874 return $out;
01875 }
01876
01877
01878
01879
01880
01881
01882
01883 function TBE_expandPage($tables) {
01884 global $TCA,$BE_USER, $BACK_PATH;
01885
01886 $out='';
01887 if ($this->expandPage>=0 && t3lib_div::testInt($this->expandPage) && $BE_USER->isInWebMount($this->expandPage)) {
01888
01889 // Set array with table names to list:
01890 if (!strcmp(trim($tables),'*')) {
01891 $tablesArr = array_keys($TCA);
01892 } else {
01893 $tablesArr = t3lib_div::trimExplode(',',$tables,1);
01894 }
01895 reset($tablesArr);
01896
01897 // Headline for selecting records:
01898 $out.=$this->barheader($GLOBALS['LANG']->getLL('selectRecords').':');
01899
01900 // Create the header, showing the current page for which the listing is. Includes link to the page itself, if pages are amount allowed tables.
01901 $titleLen=intval($GLOBALS['BE_USER']->uc['titleLen']);
01902 $mainPageRec = t3lib_BEfunc::getRecordWSOL('pages',$this->expandPage);
01903 $ATag='';
01904 $ATag_e='';
01905 $ATag2='';
01906 if (in_array('pages',$tablesArr)) {
01907 $ficon=t3lib_iconWorks::getIcon('pages',$mainPageRec);
01908 $ATag="<a href=\"#\" onclick=\"return insertElement('pages', '".$mainPageRec['uid']."', 'db', ".t3lib_div::quoteJSvalue($mainPageRec['title']).", '', '', '".$ficon."','',1);\">";
01909 $ATag2="<a href=\"#\" onclick=\"return insertElement('pages', '".$mainPageRec['uid']."', 'db', ".t3lib_div::quoteJSvalue($mainPageRec['title']).", '', '', '".$ficon."','',0);\">";
01910 $ATag_alt=substr($ATag,0,-4).",'',1);\">";
01911 $ATag_e='</a>';
01912 }
01913 $picon=t3lib_iconWorks::getSpriteIconForRecord('pages', $mainPageRec);
01914 $pBicon=$ATag2?'<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/plusbullet2.gif','width="18" height="16"').' alt="" />':'';
01915 $pText=htmlspecialchars(t3lib_div::fixed_lgd_cs($mainPageRec['title'],$titleLen));
01916 $out.=$picon.$ATag2.$pBicon.$ATag_e.$ATag.$pText.$ATag_e.'<br />';
01917
01918
01919 $id = $this->expandPage;
01920 $pointer = t3lib_div::intInRange($this->pointer,0,100000);
01921 $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
01922 $pageinfo = t3lib_BEfunc::readPageAccess($id,$perms_clause);
01923 $table='';
01924
01925
01926 $dblist = t3lib_div::makeInstance('TBE_browser_recordList');
01927 $dblist->thisScript=$this->thisScript;
01928 $dblist->backPath = $GLOBALS['BACK_PATH'];
01929 $dblist->thumbs = 0;
01930 $dblist->calcPerms = $GLOBALS['BE_USER']->calcPerms($pageinfo);
01931 $dblist->noControlPanels=1;
01932 $dblist->clickMenuEnabled=0;
01933 $dblist->tableList=implode(',',$tablesArr);
01934
01935 $dblist->start($id,t3lib_div::_GP('table'),$pointer,
01936 t3lib_div::_GP('search_field'),
01937 t3lib_div::_GP('search_levels'),
01938 t3lib_div::_GP('showLimit')
01939 );
01940 $dblist->setDispFields();
01941 $dblist->generateList();
01942 $dblist->writeBottom();
01943
01944
01945 $out.=$dblist->HTMLcode;
01946
01947
01948 if ($dblist->table) {
01949 $out.= $dblist->fieldSelectBox($dblist->table);
01950 }
01951
01952 $out.=$dblist->getSearchBox();
01953 }
01954
01955
01956 return $out;
01957 }
01958
01959
01960
01961
01962
01963
01964
01965
01966 function TBE_expandSubFolders($expandFolder=0) {
01967 $content = '';
01968
01969 $expandFolder = $expandFolder ?
01970 $expandFolder :
01971 $this->expandFolder;
01972
01973 if($expandFolder && $this->checkFolder($expandFolder)) {
01974 if(t3lib_div::isFirstPartOfStr($expandFolder, PATH_site)) {
01975 $rootFolder = substr($expandFolder, strlen(PATH_site));
01976 }
01977
01978 $folders = array();
01979
01980
01981 $folders = t3lib_div::get_dirs($expandFolder);
01982 if(count($folders) > 0) {
01983 foreach($folders as $index => $folder) {
01984 $folders[$index] = $rootFolder.$folder.'/';
01985 }
01986 }
01987 $content.= $this->folderList($rootFolder, $folders);
01988 }
01989
01990
01991 return $content;
01992 }
01993
01994
01995
01996
01997
01998
01999
02000
02001
02002
02003
02004
02005
02006
02007
02008
02009
02010
02011
02012
02013
02014
02015
02016 function expandFolder($expandFolder=0,$extensionList='') {
02017 global $BACK_PATH;
02018
02019 $expandFolder = $expandFolder ? $expandFolder : $this->expandFolder;
02020 $out='';
02021 if ($expandFolder && $this->checkFolder($expandFolder)) {
02022
02023
02024 $out.=$this->barheader($GLOBALS['LANG']->getLL('files').':');
02025
02026
02027 if (!$this->curUrlInfo['value']) {
02028 $cmpPath='';
02029 } else {
02030 $cmpPath=PATH_site.$this->curUrlInfo['info'];
02031 }
02032
02033
02034
02035 $titleLen=intval($GLOBALS['BE_USER']->uc['titleLen']);
02036 $picon='<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/i/_icon_webfolders.gif','width="18" height="16"').' alt="" />';
02037 $picon.=htmlspecialchars(t3lib_div::fixed_lgd_cs(basename($expandFolder),$titleLen));
02038 $picon='<a href="#" onclick="return link_folder(\''.t3lib_div::rawUrlEncodeFP(substr($expandFolder,strlen(PATH_site))).'\');">'.$picon.'</a>';
02039 if ($this->curUrlInfo['act'] == 'folder' && $cmpPath == $expandFolder) {
02040 $out.= '<img'.t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/blinkarrow_left.gif', 'width="5" height="9"') . ' class="c-blinkArrowL" alt="" />';
02041 }
02042 $out.=$picon.'<br />';
02043
02044
02045 if ($this->mode == 'wizard' && $this->act == 'folder') {
02046 $files = t3lib_div::get_dirs($expandFolder);
02047 } else {
02048 $files = t3lib_div::getFilesInDir($expandFolder, $extensionList, 1, 1);
02049 }
02050
02051 $c=0;
02052 $cc=count($files);
02053 if (is_array($files)) {
02054 foreach($files as $filepath) {
02055 $c++;
02056 $fI=pathinfo($filepath);
02057
02058 if ($this->mode == 'wizard' && $this->act == 'folder') {
02059 $filepath = $expandFolder.$filepath.'/';
02060 $icon = '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/i/_icon_webfolders.gif', 'width="18" height="16"') . ' alt="" />';
02061 } else {
02062
02063 $icon = t3lib_BEfunc::getFileIcon(strtolower($fI['extension']));
02064
02065
02066 $size = ' (' . t3lib_div::formatSize(filesize($filepath)) . 'bytes)';
02067 $icon = '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/fileicons/' . $icon . '', 'width="18" height="16"') . ' title="' . htmlspecialchars($fI['basename'] . $size) . '" alt="" />';
02068 }
02069
02070
02071 if (($this->curUrlInfo['act'] == 'file' || $this->curUrlInfo['act'] == 'folder') && $cmpPath == $filepath) {
02072 $arrCol='<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/blinkarrow_left.gif','width="5" height="9"').' class="c-blinkArrowL" alt="" />';
02073 } else {
02074 $arrCol='';
02075 }
02076
02077
02078 $out.='<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/ol/join'.($c==$cc?'bottom':'').'.gif','width="18" height="16"').' alt="" />'.
02079 $arrCol.
02080 '<a href="#" onclick="return link_folder(\''.t3lib_div::rawUrlEncodeFP(substr($filepath,strlen(PATH_site))).'\');">'.
02081 $icon.
02082 htmlspecialchars(t3lib_div::fixed_lgd_cs(basename($filepath),$titleLen)).
02083 '</a><br />';
02084 }
02085 }
02086 }
02087 return $out;
02088 }
02089
02090
02091
02092
02093
02094
02095
02096
02097
02098 function TBE_expandFolder($expandFolder=0,$extensionList='',$noThumbs=0) {
02099 global $LANG;
02100
02101 $extensionList = ($extensionList == '*') ? '' : $extensionList;
02102 $expandFolder = $expandFolder ? $expandFolder : $this->expandFolder;
02103 $out='';
02104 if ($expandFolder && $this->checkFolder($expandFolder)) {
02105
02106 $files = t3lib_div::getFilesInDir($expandFolder,$extensionList,1,1);
02107 $out.= $this->fileList($files, $expandFolder, $noThumbs);
02108 }
02109
02110
02111 return $out;
02112 }
02113
02114
02115
02116
02117
02118
02119
02120
02121
02122 function fileList($files, $folderName='', $noThumbs=0) {
02123 global $LANG, $BACK_PATH;
02124
02125 $out='';
02126
02127
02128 if (is_array($files)) {
02129
02130
02131 $filesCount = count($files);
02132 $out.=$this->barheader(sprintf($GLOBALS['LANG']->getLL('files').' (%s):', $filesCount));
02133 $out.=$this->getBulkSelector($filesCount);
02134
02135 $titleLen=intval($GLOBALS['BE_USER']->uc['titleLen']);
02136
02137
02138 if($folderName) {
02139 $picon='<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/i/_icon_webfolders.gif','width="18" height="16"').' alt="" />';
02140 $picon.=htmlspecialchars(t3lib_div::fixed_lgd_cs(basename($folderName),$titleLen));
02141 $out.=$picon.'<br />';
02142 }
02143
02144
02145 $imgObj = t3lib_div::makeInstance('t3lib_stdGraphic');
02146 $imgObj->init();
02147 $imgObj->mayScaleUp=0;
02148 $imgObj->tempPath=PATH_site.$imgObj->tempPath;
02149
02150
02151 $lines=array();
02152 foreach($files as $filepath) {
02153 $fI=pathinfo($filepath);
02154
02155
02156 if (t3lib_div::inList(strtolower($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']),strtolower($fI['extension'])) && !$noThumbs) {
02157 $imgInfo = $imgObj->getImageDimensions($filepath);
02158 $pDim = $imgInfo[0].'x'.$imgInfo[1].' pixels';
02159 $clickIcon = t3lib_BEfunc::getThumbNail($BACK_PATH.'thumbs.php',$filepath,'hspace="5" vspace="5" border="1"');
02160 } else {
02161 $clickIcon = '';
02162 $pDim = '';
02163 }
02164
02165
02166 $ficon = t3lib_BEfunc::getFileIcon(strtolower($fI['extension']));
02167 $size=' ('.t3lib_div::formatSize(filesize($filepath)).'bytes'.($pDim?', '.$pDim:'').')';
02168 $icon = '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/fileicons/'.$ficon,'width="18" height="16"').' title="'.htmlspecialchars($fI['basename'].$size).'" class="absmiddle" alt="" />';
02169
02170
02171 if (strstr($filepath,',') || strstr($filepath,'|')) {
02172 $eMsg = $LANG->JScharCode(sprintf($LANG->getLL('invalidChar'),', |'));
02173 $ATag = $ATag_alt = "<a href=\"#\" onclick=\"alert(".$eMsg.");return false;\">";
02174 $bulkCheckBox = '';
02175 } else {
02176 $filesIndex = count($this->elements);
02177 $this->elements['file_'.$filesIndex] = array(
02178 'md5' => t3lib_div::shortMD5($filepath),
02179 'type' => 'file',
02180 'fileName' => $fI['basename'],
02181 'filePath' => $filepath,
02182 'fileExt' => $fI['extension'],
02183 'fileIcon' => $ficon,
02184 );
02185 $ATag = "<a href=\"#\" onclick=\"return BrowseLinks.File.insertElement('file_$filesIndex');\">";
02186 $ATag_alt = substr($ATag,0,-4).",1);\">";
02187 $bulkCheckBox = '<input type="checkbox" class="typo3-bulk-item" name="file_'.$filesIndex.'" value="0" /> ';
02188 }
02189 $ATag_e='</a>';
02190
02191
02192 $Ahref = $BACK_PATH.'show_item.php?table='.rawurlencode($filepath).'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'));
02193 $ATag2='<a href="'.htmlspecialchars($Ahref).'">';
02194 $ATag2_e='</a>';
02195
02196
02197 $filenameAndIcon=$bulkCheckBox.$ATag_alt.$icon.htmlspecialchars(t3lib_div::fixed_lgd_cs(basename($filepath),$titleLen)).$ATag_e;
02198
02199
02200 if ($pDim) {
02201 $lines[]='
02202 <tr class="bgColor4">
02203 <td nowrap="nowrap">'.$filenameAndIcon.' </td>
02204 <td>'.$ATag.'<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/plusbullet2.gif','width="18" height="16"').' title="'.$LANG->getLL('addToList',1).'" alt="" />'.$ATag_e.'</td>
02205 <td nowrap="nowrap">'.($ATag2.'<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/zoom2.gif','width="12" height="12"').' title="'.$LANG->getLL('info',1).'" alt="" /> '.$LANG->getLL('info',1).$ATag2_e).'</td>
02206 <td nowrap="nowrap"> '.$pDim.'</td>
02207 </tr>';
02208 $lines[]='
02209 <tr>
02210 <td colspan="4">'.$ATag_alt.$clickIcon.$ATag_e.'</td>
02211 </tr>';
02212 } else {
02213 $lines[]='
02214 <tr class="bgColor4">
02215 <td nowrap="nowrap">'.$filenameAndIcon.' </td>
02216 <td>'.$ATag.'<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/plusbullet2.gif','width="18" height="16"').' title="'.$LANG->getLL('addToList',1).'" alt="" />'.$ATag_e.'</td>
02217 <td nowrap="nowrap">'.($ATag2.'<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/zoom2.gif','width="12" height="12"').' title="'.$LANG->getLL('info',1).'" alt="" /> '.$LANG->getLL('info',1).$ATag2_e).'</td>
02218 <td> </td>
02219 </tr>';
02220 }
02221 $lines[]='
02222 <tr>
02223 <td colspan="3"><img src="clear.gif" width="1" height="3" alt="" /></td>
02224 </tr>';
02225 }
02226
02227
02228 $out.='
02229
02230
02231
02232 <!--
02233 File listing
02234 -->
02235 <table cellpadding="0" cellspacing="0" id="typo3-fileList">
02236 '.implode('',$lines).'
02237 </table>';
02238 }
02239
02240 return $out;
02241 }
02242
02243
02244
02245
02246
02247
02248
02249
02250 function folderList($baseFolder, $folders) {
02251 global $LANG, $BACK_PATH;
02252
02253 $content = '';
02254
02255
02256 $content.=$this->barheader(
02257 sprintf($GLOBALS['LANG']->getLL('folders').' (%s):',count($folders))
02258 );
02259
02260 $titleLength = intval($GLOBALS['BE_USER']->uc['titleLen']);
02261
02262
02263 if($baseFolder) {
02264 if (strstr($baseFolder, ',') || strstr($baseFolder, '|')) {
02265
02266 $errorMessage = $LANG->JScharCode(sprintf($LANG->getLL('invalidChar'),', |'));
02267 $aTag = $aTag_alt = "<a href=\"#\" onclick=\"alert(".$errorMessage.");return false;\">";
02268 } else {
02269
02270 $aTag = "<a href=\"#\" onclick=\"return insertElement('','".rawurlencode($baseFolder)."', 'folder', '".rawurlencode($baseFolder)."', unescape('".rawurlencode($baseFolder)."'), '".$fI['extension']."', '".$ficon."');\">";
02271 $aTag_alt = substr($aTag,0,-4).",'',1);\">";
02272 }
02273 $aTag_e = '</a>';
02274
02275
02276 $folderIcon = $aTag_alt;
02277 $folderIcon.= '<img'.t3lib_iconWorks::skinImg(
02278 $BACK_PATH,
02279 'gfx/i/_icon_webfolders.gif','width="18" height="16"'
02280 ).' alt="" />';
02281 $folderIcon.= htmlspecialchars(
02282 t3lib_div::fixed_lgd_cs(basename($baseFolder),$titleLength)
02283 );
02284 $folderIcon.= $aTag_e;
02285
02286 $content.=$folderIcon.'<br />';
02287 }
02288
02289
02290 if(is_array($folders)) {
02291 if(count($folders) > 0) {
02292
02293 $lines = array();
02294 foreach($folders as $folderPath) {
02295 $pathInfo = pathinfo($folderPath);
02296
02297
02298 $icon = '<img src="clear.gif" width="16" height="16" alt="" /><img'.t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/i/_icon_webfolders.gif','width="16" height="16"').' title="'.htmlspecialchars($pathInfo['basename'].$size).'" class="absmiddle" alt="" />';
02299
02300
02301 if($this->P['itemName'] != '' && $this->P['formName'] != '') {
02302 $aTag = "<a href=\"#\" onclick=\"return set_folderpath(unescape('".rawurlencode($folderPath)."'));\">";
02303 } else {
02304 $aTag = "<a href=\"#\" onclick=\"return insertElement('','".rawurlencode($folderPath)."', 'folder', '".rawurlencode($folderPath)."', unescape('".rawurlencode($folderPath)."'), '".$pathInfo['extension']."', '".$ficon."');\">";
02305 }
02306
02307 if (strstr($folderPath,',') || strstr($folderPath,'|')) {
02308
02309 $errorMessage = $LANG->JScharCode(sprintf($LANG->getLL('invalidChar'),', |'));
02310 $aTag = $aTag_alt = "<a href=\"#\" onclick=\"alert(".$errorMessage.");return false;\">";
02311 } else {
02312
02313 $aTag_alt = substr($aTag,0,-4).",'',1);\">";
02314 }
02315 $aTag_e='</a>';
02316
02317
02318 $foldernameAndIcon = $aTag_alt.$icon.htmlspecialchars(
02319 t3lib_div::fixed_lgd_cs(basename($folderPath),$titleLength)
02320 ).$aTag_e;
02321
02322 if($this->P['itemName'] != '') {
02323 $lines[] = '
02324 <tr class="bgColor4">
02325 <td nowrap="nowrap">'.$foldernameAndIcon.' </td>
02326 <td> </td>
02327 </tr>';
02328 } else {
02329 $lines[] = '
02330 <tr class="bgColor4">
02331 <td nowrap="nowrap">'.$foldernameAndIcon.' </td>
02332 <td>'.$aTag.'<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/plusbullet2.gif','width="18" height="16"').' title="'.$LANG->getLL('addToList',1).'" alt="" />'.$aTag_e.'</td>
02333 <td> </td>
02334 </tr>';
02335 }
02336
02337 $lines[] = '
02338 <tr>
02339 <td colspan="3"><img src="clear.gif" width="1" height="3" alt="" /></td>
02340 </tr>';
02341 }
02342 }
02343
02344
02345 $content.='
02346
02347 <!--
02348 Folder listing
02349 -->
02350 <table border="0" cellpadding="0" cellspacing="1" id="typo3-folderList">
02351 '.implode('', $lines).'
02352 </table>';
02353 }
02354
02355
02356 return $content;
02357 }
02358
02359
02360
02361
02362
02363
02364
02365
02366
02367 function TBE_dragNDrop($expandFolder=0,$extensionList='') {
02368 global $BACK_PATH;
02369
02370 $extensionList = ($extensionList == '*') ? '' : $extensionList;
02371 $expandFolder = $expandFolder ? $expandFolder : $this->expandFolder;
02372 $out='';
02373 if ($expandFolder && $this->checkFolder($expandFolder)) {
02374 if ($this->isWebFolder($expandFolder)) {
02375
02376
02377 $files = t3lib_div::getFilesInDir($expandFolder,$extensionList,1,1);
02378 if (is_array($files)) {
02379 $out.=$this->barheader(sprintf($GLOBALS['LANG']->getLL('files').' (%s):',count($files)));
02380
02381 $titleLen=intval($GLOBALS['BE_USER']->uc['titleLen']);
02382 $picon='<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/i/_icon_webfolders.gif','width="18" height="16"').' alt="" />';
02383 $picon.=htmlspecialchars(t3lib_div::fixed_lgd_cs(basename($expandFolder),$titleLen));
02384 $out.=$picon.'<br />';
02385
02386
02387 $lines=array();
02388
02389
02390 $lines[]='
02391 <tr>
02392 <td colspan="2">'.$this->getMsgBox($GLOBALS['LANG']->getLL('findDragDrop')).'</td>
02393 </tr>';
02394
02395
02396 foreach ($files as $filepath) {
02397 $fI = pathinfo($filepath);
02398
02399
02400 $iurl = $this->siteURL.t3lib_div::rawurlencodeFP(substr($filepath,strlen(PATH_site)));
02401
02402
02403 if (t3lib_div::inList('gif,jpeg,jpg,png',strtolower($fI['extension']))) {
02404 $imgInfo = @getimagesize($filepath);
02405 $pDim = $imgInfo[0].'x'.$imgInfo[1].' pixels';
02406
02407 $ficon = t3lib_BEfunc::getFileIcon(strtolower($fI['extension']));
02408 $size=' ('.t3lib_div::formatSize(filesize($filepath)).'bytes'.($pDim?', '.$pDim:'').')';
02409 $icon = '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/fileicons/'.$ficon,'width="18" height="16"').' class="absmiddle" title="'.htmlspecialchars($fI['basename'].$size).'" alt="" />';
02410 $filenameAndIcon=$icon.htmlspecialchars(t3lib_div::fixed_lgd_cs(basename($filepath),$titleLen));
02411
02412 if (t3lib_div::_GP('noLimit')) {
02413 $maxW=10000;
02414 $maxH=10000;
02415 } else {
02416 $maxW=380;
02417 $maxH=500;
02418 }
02419 $IW = $imgInfo[0];
02420 $IH = $imgInfo[1];
02421 if ($IW>$maxW) {
02422 $IH=ceil($IH/$IW*$maxW);
02423 $IW=$maxW;
02424 }
02425 if ($IH>$maxH) {
02426 $IW=ceil($IW/$IH*$maxH);
02427 $IH=$maxH;
02428 }
02429
02430
02431 $lines[]='
02432 <tr class="bgColor4">
02433 <td nowrap="nowrap">'.$filenameAndIcon.' </td>
02434 <td nowrap="nowrap">'.
02435 ($imgInfo[0]!=$IW ? '<a href="'.htmlspecialchars(t3lib_div::linkThisScript(array('noLimit'=>'1'))).'">'.
02436 '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/icon_warning2.gif','width="18" height="16"').' title="'.$GLOBALS['LANG']->getLL('clickToRedrawFullSize',1).'" alt="" />'.
02437 '</a>':'').
02438 $pDim.' </td>
02439 </tr>';
02440
02441 $lines[]='
02442 <tr>
02443 <td colspan="2"><img src="'.$iurl.'" width="'.$IW.'" height="'.$IH.'" border="1" alt="" /></td>
02444 </tr>';
02445 $lines[]='
02446 <tr>
02447 <td colspan="2"><img src="clear.gif" width="1" height="3" alt="" /></td>
02448 </tr>';
02449 }
02450 }
02451
02452
02453 $out.='
02454
02455
02456 <!--
02457 File listing / Drag-n-drop
02458 -->
02459 <table border="0" cellpadding="0" cellspacing="1" id="typo3-dragBox">
02460 '.implode('',$lines).'
02461 </table>';
02462 }
02463 } else {
02464
02465 $out.=$this->barheader($GLOBALS['LANG']->getLL('files'));
02466 $out.=$this->getMsgBox($GLOBALS['LANG']->getLL('noWebFolder'),'icon_warning2');
02467 }
02468 }
02469 return $out;
02470 }
02471
02472
02473
02474
02475
02476
02477
02478
02479
02480
02481
02482
02483
02484
02485
02486
02487
02488
02489
02490
02491
02492
02493
02494
02495
02496 function isWebFolder($folder) {
02497 $folder = rtrim($folder, '/').'/';
02498 return t3lib_div::isFirstPartOfStr($folder,PATH_site) ? TRUE : FALSE;
02499 }
02500
02501
02502
02503
02504
02505
02506
02507 function checkFolder($folder) {
02508 return $this->fileProcessor->checkPathAgainstMounts(rtrim($folder, '/') . '/') ? true : false;
02509 }
02510
02511
02512
02513
02514
02515
02516
02517 function isReadOnlyFolder($folder) {
02518 return ($GLOBALS['FILEMOUNTS'][$this->fileProcessor->checkPathAgainstMounts(rtrim($folder, '/') . '/')]['type'] == 'readonly');
02519 }
02520
02521
02522
02523
02524
02525
02526
02527 function barheader($str) {
02528 return '
02529 <!-- Bar header: -->
02530 <h3>' . htmlspecialchars($str) . '</h3>
02531 ';
02532 }
02533
02534
02535
02536
02537
02538
02539
02540
02541 function getMsgBox($in_msg,$icon='icon_note') {
02542 global $BACK_PATH;
02543
02544 $msg = '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/'.$icon.'.gif','width="18" height="16"').' alt="" />'.htmlspecialchars($in_msg);
02545 $msg = '
02546
02547 <!--
02548 Message box:
02549 -->
02550 <table cellspacing="0" class="bgColor4" id="typo3-msgBox">
02551 <tr>
02552 <td>'.$msg.'</td>
02553 </tr>
02554 </table>
02555 ';
02556 return $msg;
02557 }
02558
02559
02560
02561
02562
02563
02564
02565 function printCurrentUrl($str) {
02566 if (strlen($str)) {
02567 return '
02568 <!-- Print current URL -->
02569 <table border="0" cellpadding="0" cellspacing="0" id="typo3-curUrl">
02570 <tr>
02571 <td>' . $GLOBALS['LANG']->getLL('currentLink',1) . ': ' .htmlspecialchars(rawurldecode($str)) . '</td>
02572 </tr>
02573 </table>';
02574 } else {
02575 return '';
02576 }
02577 }
02578
02579
02580
02581
02582
02583
02584
02585
02586 function parseCurUrl($href,$siteUrl) {
02587 $href = trim($href);
02588 if ($href) {
02589 $info=array();
02590
02591
02592 $info['value']=$href;
02593 $info['act']='url';
02594
02595 $specialParts = explode('#_SPECIAL',$href);
02596 if (count($specialParts)==2) {
02597 $info['value']='#_SPECIAL'.$specialParts[1];
02598 $info['act']='spec';
02599 } elseif (t3lib_div::isFirstPartOfStr($href,$siteUrl)) {
02600 $rel = substr($href,strlen($siteUrl));
02601 if (file_exists(PATH_site.rawurldecode($rel))) {
02602 $info['value']=rawurldecode($rel);
02603 if (@is_dir(PATH_site . $info['value'])) {
02604 $info['act'] = 'folder';
02605 } else {
02606 $info['act'] = 'file';
02607 }
02608 } else {
02609 $uP=parse_url($rel);
02610 if (!trim($uP['path'])) {
02611 $pp = preg_split('/^id=/', $uP['query']);
02612 $pp[1] = preg_replace( '/&id=[^&]*/', '', $pp[1]);
02613 $parameters = explode('&', $pp[1]);
02614 $id = array_shift($parameters);
02615 if ($id) {
02616
02617 if (!t3lib_div::testInt($id)) {
02618 list($idPartR) = t3lib_BEfunc::getRecordsByField('pages','alias',$id);
02619 $id=intval($idPartR['uid']);
02620 }
02621
02622 $pageRow = t3lib_BEfunc::getRecordWSOL('pages',$id);
02623 $titleLen=intval($GLOBALS['BE_USER']->uc['titleLen']);
02624 $info['value']=$GLOBALS['LANG']->getLL('page',1)." '".htmlspecialchars(t3lib_div::fixed_lgd_cs($pageRow['title'],$titleLen))."' (ID:".$id.($uP['fragment']?', #'.$uP['fragment']:'').')';
02625 $info['pageid']=$id;
02626 $info['cElement']=$uP['fragment'];
02627 $info['act']='page';
02628 $info['query'] = $parameters[0]?'&'.implode('&', $parameters):'';
02629 }
02630 }
02631 }
02632 } else {
02633 if (strtolower(substr($href,0,7))=='mailto:') {
02634 $info['value']=trim(substr($href,7));
02635 $info['act']='mail';
02636 }
02637 }
02638 $info['info'] = $info['value'];
02639 } else {
02640 $info=array();
02641 $info['info']=$GLOBALS['LANG']->getLL('none');
02642 $info['value']='';
02643 $info['act']='page';
02644 }
02645
02646
02647 foreach($this->hookObjects as $hookObject) {
02648 $info = $hookObject->parseCurrentUrl($href, $siteUrl, $info);
02649 }
02650
02651 return $info;
02652 }
02653
02654
02655
02656
02657
02658
02659
02660
02661 function uploadForm($path) {
02662 global $BACK_PATH;
02663
02664 if ($this->isReadOnlyFolder($path)) return '';
02665
02666
02667 $userSetting = $GLOBALS['BE_USER']->getTSConfigVal('options.folderTree.uploadFieldsInLinkBrowser');
02668 $count = isset($userSetting) ? $userSetting : 3;
02669 if ($count === '0') {
02670 return '';
02671 }
02672 $count = intval($count) == 0 ? 3 : intval($count);
02673
02674
02675 $header = t3lib_div::isFirstPartOfStr($path,PATH_site)?substr($path,strlen(PATH_site)):$path;
02676 $code=$this->barheader($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_upload.php.pagetitle',1).':');
02677 $code.='
02678
02679 <!--
02680 Form, for uploading files:
02681 -->
02682 <form action="'.$BACK_PATH.'tce_file.php" method="post" name="editform" enctype="'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'].'">
02683 <table border="0" cellpadding="0" cellspacing="3" id="typo3-uplFiles">
02684 <tr>
02685 <td><strong>'.$GLOBALS['LANG']->getLL('path',1).':</strong> '.htmlspecialchars($header).'</td>
02686 </tr>
02687 <tr>
02688 <td>';
02689
02690
02691 for ($a=1;$a<=$count;$a++) {
02692 $code.='<input type="file" name="upload_'.$a.'"'.$this->doc->formWidth(35).' size="50" />
02693 <input type="hidden" name="file[upload]['.$a.'][target]" value="'.htmlspecialchars($path).'" />
02694 <input type="hidden" name="file[upload]['.$a.'][data]" value="'.$a.'" /><br />';
02695 }
02696
02697
02698 $redirectValue = $this->thisScript.'?act='.$this->act.'&mode='.$this->mode.'&expandFolder='.rawurlencode($path).'&bparams='.rawurlencode($this->bparams);
02699 $code.='<input type="hidden" name="redirect" value="'.htmlspecialchars($redirectValue).'" />'.
02700 '<input type="submit" name="submit" value="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_upload.php.submit',1).'" />';
02701
02702 $code.='
02703 <div id="c-override">
02704 <input type="checkbox" name="overwriteExistingFiles" id="overwriteExistingFiles" value="1" /> <label for="overwriteExistingFiles">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_misc.xml:overwriteExistingFiles',1).'</label>
02705 </div>
02706 ';
02707
02708
02709 $code.='</td>
02710 </tr>
02711 </table>
02712 </form>';
02713
02714 return $code;
02715 }
02716
02717
02718
02719
02720
02721
02722
02723
02724 function createFolder($path) {
02725 global $BACK_PATH;
02726
02727 if ($this->isReadOnlyFolder($path)) return '';
02728
02729
02730 if ($GLOBALS['BE_USER']->getTSConfigVal('options.folderTree.hideCreateFolder')) {
02731 return '';
02732 }
02733
02734 $header = t3lib_div::isFirstPartOfStr($path,PATH_site)?substr($path,strlen(PATH_site)):$path;
02735 $code=$this->barheader($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_newfolder.php.pagetitle').':');
02736 $code.='
02737
02738 <!--
02739 Form, for creating new folders:
02740 -->
02741 <form action="'.$BACK_PATH.'tce_file.php" method="post" name="editform2">
02742 <table border="0" cellpadding="0" cellspacing="3" id="typo3-crFolder">
02743 <tr>
02744 <td><strong>'.$GLOBALS['LANG']->getLL('path',1).':</strong> '.htmlspecialchars($header).'</td>
02745 </tr>
02746 <tr>
02747 <td>';
02748
02749
02750 $a=1;
02751 $code.='<input'.$this->doc->formWidth(20).' type="text" name="file[newfolder]['.$a.'][data]" />'.
02752 '<input type="hidden" name="file[newfolder]['.$a.'][target]" value="'.htmlspecialchars($path).'" />';
02753
02754
02755 $redirectValue = $this->thisScript.'?act='.$this->act.'&mode='.$this->mode.'&expandFolder='.rawurlencode($path).'&bparams='.rawurlencode($this->bparams);
02756 $code.='<input type="hidden" name="redirect" value="'.htmlspecialchars($redirectValue).'" />'.
02757 '<input type="submit" name="submit" value="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_newfolder.php.submit',1).'" />';
02758
02759 $code.='</td>
02760 </tr>
02761 </table>
02762 </form>';
02763
02764 return $code;
02765 }
02766
02767
02768
02769
02770
02771
02772
02773 function getBulkSelector($filesCount) {
02774 if ($filesCount) {
02775 $labelToggleSelection = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_browse_links.php:toggleSelection',1);
02776 $labelImportSelection = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_browse_links.php:importSelection',1);
02777
02778 $out = $this->doc->spacer(15).'<div>' .
02779 '<a href="#" onclick="BrowseLinks.Selector.toggle()">' .
02780 '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/clip_select.gif','width="12" height="12"').' title="'.$labelToggleSelection.'" alt="" /> ' .
02781 $labelToggleSelection.'</a>'.$this->doc->spacer(5) .
02782 '<a href="#" onclick="BrowseLinks.Selector.handle()">' .
02783 '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/import.gif','width="12" height="12"').' title="'.$labelImportSelection.'" alt="" /> ' .
02784 $labelImportSelection.'</a>' .
02785 '</div>'.$this->doc->spacer(15);
02786 }
02787 return $out;
02788 }
02789 }
02790
02791
02792 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.browse_links.php']) {
02793 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.browse_links.php']);
02794 }
02795
02796 ?>