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
00068 require('init.php');
00069 require('template.php');
00070 $LANG->includeLLFile('EXT:lang/locallang_misc.xml');
00071 require_once(PATH_t3lib.'class.t3lib_loadmodules.php');
00072 require_once(PATH_t3lib.'class.t3lib_basicfilefunc.php');
00073
00074
00075
00076
00077
00078
00086 class SC_alt_shortcut {
00087
00088
00089 var $modName;
00090 var $M_modName;
00091 var $URL;
00092 var $editSC;
00093 var $deleteCategory;
00094 var $editName;
00095 var $editGroup;
00096 var $whichItem;
00097
00098
00104 var $loadModules;
00105
00111 var $doc;
00112
00113
00114 var $content;
00115 var $lines;
00116
00117 var $editLoaded;
00118 var $editError;
00119 var $editPath;
00120 var $editSC_rec;
00121 var $theEditRec;
00122 var $editPage;
00123 var $selOpt;
00124 var $searchFor;
00125 var $groupLabels=array();
00126
00127 var $alternativeTableUid = array();
00128
00129
00130
00136 function preinit() {
00137 global $TBE_MODULES;
00138
00139
00140 $this->modName = t3lib_div::_GP('modName');
00141 $this->M_modName = t3lib_div::_GP('motherModName');
00142 $this->URL = t3lib_div::_GP('URL');
00143 $this->editSC = t3lib_div::_GP('editShortcut');
00144
00145 $this->deleteCategory = t3lib_div::_GP('deleteCategory');
00146 $this->editPage = t3lib_div::_GP('editPage');
00147 $this->changeWorkspace = t3lib_div::_GP('changeWorkspace');
00148 $this->changeWorkspacePreview = t3lib_div::_GP('changeWorkspacePreview');
00149 $this->editName = t3lib_div::_GP('editName');
00150 $this->editGroup = t3lib_div::_GP('editGroup');
00151 $this->whichItem = t3lib_div::_GP('whichItem');
00152
00153
00154 $this->loadModules = t3lib_div::makeInstance('t3lib_loadModules');
00155 $this->loadModules->load($TBE_MODULES);
00156 }
00157
00163 function preprocess() {
00164 global $BE_USER;
00165 $description = '';
00166 $url = urldecode($this->URL);
00167
00168
00169 $page_id = $this->getLinkedPageId($url);
00170 if (t3lib_div::testInt($page_id)) {
00171 if (preg_match('/\&edit\[(.*)\]\[(.*)\]=edit/',$url,$matches)) {
00172
00173 $description = '';
00174 } else {
00175
00176 $pageRow = t3lib_BEfunc::getRecord('pages',$page_id);
00177 if (count($pageRow)) {
00178
00179 $description = $pageRow['title'];
00180 }
00181 }
00182 } else {
00183 if (preg_match('/\/$/', $page_id)) {
00184
00185 $description = basename($page_id);
00186 }
00187 }
00188
00189
00190
00191 if ($this->modName && $this->URL) {
00192 $fields_values = array(
00193 'userid' => $BE_USER->user['uid'],
00194 'module_name' => $this->modName.'|'.$this->M_modName,
00195 'url' => $this->URL,
00196 'description' => $description,
00197 'sorting' => time(),
00198 );
00199 $GLOBALS['TYPO3_DB']->exec_INSERTquery('sys_be_shortcuts', $fields_values);
00200 }
00201
00202
00203 $addUSERWhere = (!$BE_USER->isAdmin()?' AND userid='.intval($BE_USER->user['uid']):'');
00204
00205
00206 if (strcmp($this->deleteCategory,'')) {
00207 if (t3lib_div::testInt($this->deleteCategory)) {
00208 $GLOBALS['TYPO3_DB']->exec_DELETEquery('sys_be_shortcuts', 'sc_group='.intval($this->deleteCategory).$addUSERWhere);
00209 }
00210 }
00211
00212
00213 if (is_array($_POST)) {
00214
00215 if (isset($_POST['_savedok_x']) || isset($_POST['_saveclosedok_x'])) {
00216 $fields_values = array(
00217 'description' => $this->editName,
00218 'sc_group' => intval($this->editGroup)
00219 );
00220 if ($fields_values['sc_group']<0 && !$BE_USER->isAdmin()) {
00221 $fields_values['sc_group']=0;
00222 }
00223
00224 $GLOBALS['TYPO3_DB']->exec_UPDATEquery('sys_be_shortcuts', 'uid='.intval($this->whichItem).$addUSERWhere, $fields_values);
00225 }
00226
00227 if (isset($_POST['_savedok_x'])) {
00228 $this->editSC=$this->whichItem;
00229 }
00230
00231 if (isset($_POST['_deletedok_x'])) {
00232 $GLOBALS['TYPO3_DB']->exec_DELETEquery('sys_be_shortcuts', 'uid='.intval($this->whichItem).$addUSERWhere);
00233
00234 if (!$this->editSC) $this->editSC=-1;
00235 }
00236 }
00237
00238 }
00239
00245 function init() {
00246 global $BACK_PATH;
00247
00248 $this->doc = t3lib_div::makeInstance('template');
00249 $this->doc->backPath = $BACK_PATH;
00250 $this->doc->form='<form action="alt_shortcut.php" name="shForm" method="post">';
00251 $this->doc->docType='xhtml_trans';
00252 $this->doc->divClass='typo3-shortcut';
00253 $this->doc->JScode.=$this->doc->wrapScriptTags('
00254 function jump(url,modName,mainModName) {
00255
00256 top.fsMod.navFrameHighlightedID = new Array();
00257 if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav) {
00258 top.content.nav_frame.refresh_nav();
00259 }
00260
00261 top.nextLoadModuleUrl = url;
00262 top.goToModule(modName);
00263 }
00264 function editSh(uid) {
00265 window.location.href="alt_shortcut.php?editShortcut="+uid;
00266 }
00267 function submitEditPage(id) {
00268 window.location.href="alt_shortcut.php?editPage="+top.rawurlencode(id);
00269 }
00270 function changeWorkspace(workspaceId) {
00271 window.location.href="alt_shortcut.php?changeWorkspace="+top.rawurlencode(workspaceId);
00272 }
00273 function changeWorkspacePreview(newstate) {
00274 window.location.href="alt_shortcut.php?changeWorkspacePreview="+newstate;
00275 }
00276 function refreshShortcuts() {
00277 window.location.href = document.URL;
00278 }
00279
00280 ');
00281 $this->content.=$this->doc->startPage('Shortcut frame');
00282 }
00283
00289 function main() {
00290 global $BE_USER,$LANG,$TCA;
00291
00292
00293 $this->groupLabels=array(
00294 1 => 1,
00295 2 => 1,
00296 3 => 1,
00297 4 => 1,
00298 5 => 1,
00299 );
00300
00301 $shortCutGroups = $BE_USER->getTSConfig('options.shortcutGroups');
00302 if (is_array($shortCutGroups['properties']) && count($shortCutGroups['properties'])) {
00303 foreach ($shortCutGroups['properties'] as $k=>$v) {
00304 if (strcmp('',$v) && strcmp('0',$v)) {
00305 $this->groupLabels[$k] = (string)$v;
00306 } elseif ($BE_USER->isAdmin()) {
00307 unset($this->groupLabels[$k]);
00308 }
00309 }
00310 }
00311
00312
00313 $globalGroups = -100;
00314 if (count($this->groupLabels)) {
00315 $globalGroups .= ','.implode(',',array_keys($this->groupLabels));
00316 $globalGroups = str_replace(',',',-',$globalGroups);
00317 }
00318
00319
00320 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_be_shortcuts', '((userid='.$BE_USER->user['uid'].' AND sc_group>=0) OR sc_group IN ('.$globalGroups.'))', '', 'sc_group,sorting');
00321
00322
00323 $this->lines=array();
00324 $this->linesPre=array();
00325 $this->editSC_rec='';
00326 $this->selOpt=array();
00327 $formerGr='';
00328
00329
00330 while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
00331 $mParts = explode('|',$row['module_name']);
00332 $row['module_name']=$mParts[0];
00333 $row['M_module_name']=$mParts[1];
00334 $mParts = explode('_',$row['M_module_name']?$row['M_module_name']:$row['module_name']);
00335 $qParts = parse_url($row['url']);
00336
00337 if (!$BE_USER->isAdmin()) {
00338
00339 if (!isset($LANG->moduleLabels['tabs_images'][implode('_',$mParts).'_tab'])) {
00340 continue;
00341 }
00342
00343 $page_id = $this->getLinkedPageId($row['url']);
00344 if (t3lib_div::testInt($page_id)) {
00345
00346 if (!$GLOBALS['BE_USER']->isInWebMount($page_id)) continue;
00347
00348
00349 $pageRow = t3lib_BEfunc::getRecord('pages',$page_id);
00350 if (!$GLOBALS['BE_USER']->doesUserHaveAccess($pageRow,$perms=1)) continue;
00351 }
00352 }
00353
00354 if ($this->editSC && $row['uid']==$this->editSC) {
00355 $this->editSC_rec=$row;
00356 }
00357
00358 $sc_group = $row['sc_group'];
00359 if ($sc_group && strcmp($formerGr,$sc_group)) {
00360 if ($sc_group!=-100) {
00361 if ($this->groupLabels[abs($sc_group)] && strcmp('1',$this->groupLabels[abs($sc_group)])) {
00362 $label = $this->groupLabels[abs($sc_group)];
00363 } else {
00364 $label = $LANG->getLL('shortcut_group_'.abs($sc_group),1);
00365 if (!$label) $label = $LANG->getLL('shortcut_group',1).' '.abs($sc_group);
00366 }
00367
00368 if ($sc_group>=0) {
00369 $onC = 'if (confirm('.$GLOBALS['LANG']->JScharCode($LANG->getLL('shortcut_delAllInCat')).')){window.location.href=\'alt_shortcut.php?deleteCategory='.$sc_group.'\';}return false;';
00370 $this->linesPre[]='<td> </td><td class="bgColor5"><a href="#" onclick="'.htmlspecialchars($onC).'" title="'.$LANG->getLL('shortcut_delAllInCat',1).'">'.$label.'</a></td>';
00371 } else {
00372 $label = $LANG->getLL('shortcut_global',1).': '.($label ? $label : abs($sc_group));
00373 $this->lines[]='<td> </td><td class="bgColor5">'.$label.'</td>';
00374 }
00375 unset($label);
00376 }
00377 }
00378
00379 $bgColorClass = $row['uid']==$this->editSC ? 'bgColor5' : ($row['sc_group']<0 ? 'bgColor6' : 'bgColor4');
00380
00381 if ($row['description']&&($row['uid']!=$this->editSC)) {
00382 $label = $row['description'];
00383 } else {
00384 $label = t3lib_div::fixed_lgd(rawurldecode($qParts['query']),150);
00385 }
00386 $titleA = $this->itemLabel($label,$row['module_name'],$row['M_module_name']);
00387
00388 $editSH = ($row['sc_group']>=0 || $BE_USER->isAdmin()) ? 'editSh('.intval($row['uid']).');' : "alert('".$LANG->getLL('shortcut_onlyAdmin')."')";
00389 $jumpSC = 'jump(unescape(\''.rawurlencode($row['url']).'\'),\''.implode('_',$mParts).'\',\''.$mParts[0].'\');';
00390 $onC = 'if (document.shForm.editShortcut_check && document.shForm.editShortcut_check.checked){'.$editSH.'}else{'.$jumpSC.'}return false;';
00391 if ($sc_group>=0) {
00392 $this->linesPre[]='<td class="'.$bgColorClass.'"><a href="#" onclick="'.htmlspecialchars($onC).'"><img src="'.$this->getIcon($row['module_name']).'" title="'.htmlspecialchars($titleA).'" alt="" /></a></td>';
00393 } else {
00394 $this->lines[]='<td class="'.$bgColorClass.'"><a href="#" onclick="'.htmlspecialchars($onC).'"><img src="'.$this->getIcon($row['module_name']).'" title="'.htmlspecialchars($titleA).'" alt="" /></a></td>';
00395 }
00396 if (trim($row['description'])) {
00397 $kkey = strtolower(substr($row['description'],0,20)).'_'.$row['uid'];
00398 $this->selOpt[$kkey]='<option value="'.htmlspecialchars($jumpSC).'">'.htmlspecialchars(t3lib_div::fixed_lgd_cs($row['description'],50)).'</option>';
00399 }
00400 $formerGr=$row['sc_group'];
00401 }
00402 ksort($this->selOpt);
00403 array_unshift($this->selOpt,'<option>['.$LANG->getLL('shortcut_selSC',1).']</option>');
00404
00405 $this->editLoadedFunc();
00406 $this->editPageIdFunc();
00407
00408 if (!$this->editLoaded && t3lib_extMgm::isLoaded('cms')) {
00409 $editIdCode = '<td nowrap="nowrap">'.$LANG->getLL('shortcut_editID',1).': <input type="text" value="'.($this->editError?htmlspecialchars($this->editPage):'').'" name="editPage"'.$this->doc->formWidth(15).' onchange="submitEditPage(this.value);" />'.
00410 ($this->editError?' <strong><span class="typo3-red">'.htmlspecialchars($this->editError).'</span></strong>':'').
00411 (is_array($this->theEditRec)?' <strong>'.$LANG->getLL('shortcut_loadEdit',1).' \''.t3lib_BEfunc::getRecordTitle('pages',$this->theEditRec,TRUE).'\'</strong> ('.htmlspecialchars($this->editPath).')':'').
00412 ($this->searchFor?' '.$LANG->getLL('shortcut_searchFor',1).' <strong>\''.htmlspecialchars($this->searchFor).'\'</strong>':'').
00413 '</td>';
00414 } else $editIdCode = '';
00415
00416
00417 $editIdCode.= '<td> '.t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'shortcuts', $GLOBALS['BACK_PATH'],'',TRUE).'</td>';
00418
00419
00420 $this->content.='
00421
00422 <table border="0" cellpadding="0" cellspacing="0" width="99%">
00423 <tr>
00424 <td>
00425 <!--
00426 Shortcut Display Table:
00427 -->
00428 <table border="0" cellpadding="0" cellspacing="2" id="typo3-shortcuts">
00429 <tr>
00430 '.implode('
00431 ',$this->lines).$editIdCode.'
00432 </tr>
00433 </table>
00434 </td>
00435 <td align="right">';
00436 if ($this->hasWorkspaceAccess()) {
00437 $this->content .= $this->workspaceSelector() .
00438 t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'workspaceSelector', $GLOBALS['BACK_PATH'],'',TRUE);
00439 }
00440 $this->content .= '
00441 </td>
00442 </tr>
00443 </table>
00444 ';
00445
00446
00447 if ($this->theEditRec['uid']) {
00448 $this->content.=$this->doc->wrapScriptTags('top.loadEditId('.$this->theEditRec['uid'].');');
00449 }
00450
00451
00452 if (count($this->alternativeTableUid)==2 && isset($TCA[$this->alternativeTableUid[0]]) && t3lib_div::testInt($this->alternativeTableUid[1])) {
00453 $JSaction = t3lib_BEfunc::editOnClick('&edit['.$this->alternativeTableUid[0].']['.$this->alternativeTableUid[1].']=edit','','dummy.php');
00454 $this->content.=$this->doc->wrapScriptTags('function editArbitraryElement() { top.content.'.$JSaction.'; } editArbitraryElement();');
00455 }
00456
00457
00458 if ($this->searchFor) {
00459 $firstMP = intval($GLOBALS['WEBMOUNTS'][0]);
00460 $this->content.= $this->doc->wrapScriptTags('jump(unescape("'.rawurlencode('db_list.php?id='.$firstMP.'&search_field='.rawurlencode($this->searchFor).'&search_levels=4').'"),"web_list","web");');
00461 }
00462 }
00463
00469 function editLoadedFunc() {
00470 global $BE_USER,$LANG;
00471
00472 $this->editLoaded=0;
00473 if (is_array($this->editSC_rec) && ($this->editSC_rec['sc_group']>=0 || $BE_USER->isAdmin())) {
00474 $this->editLoaded=1;
00475
00476 $opt=array();
00477 $opt[]='<option value="0"></option>';
00478
00479 foreach($this->groupLabels as $k=>$v) {
00480 if ($v && strcmp('1',$v)) {
00481 $label = $v;
00482 } else {
00483 $label = $LANG->getLL('shortcut_group_'.$k,1);
00484 if (!$label) $label = $LANG->getLL('shortcut_group',1).' '.$k;
00485 }
00486 $opt[]='<option value="'.$k.'"'.(!strcmp($this->editSC_rec['sc_group'],$k)?' selected="selected"':'').'>'.$label.'</option>';
00487 }
00488
00489 if ($BE_USER->isAdmin()) {
00490 foreach($this->groupLabels as $k=>$v) {
00491 if ($v && strcmp('1',$v)) {
00492 $label = $v;
00493 } else {
00494 $label = $LANG->getLL('shortcut_group_'.$k,1);
00495 if (!$label) $label = $LANG->getLL('shortcut_group',1).' '.$k;
00496 }
00497 $label = $LANG->getLL('shortcut_global',1).': '.$label;
00498
00499 $opt[]='<option value="-'.$k.'"'.(!strcmp($this->editSC_rec['sc_group'],'-'.$k)?' selected="selected"':'').'>'.$label.'</option>';
00500 }
00501 $opt[]='<option value="-100"'.(!strcmp($this->editSC_rec['sc_group'],'-100')?' selected="selected"':'').'>'.$LANG->getLL('shortcut_global',1).': '.$LANG->getLL('shortcut_all',1).'</option>';
00502 }
00503
00504
00505 $manageForm='
00506
00507 <!--
00508 Shortcut Editing Form:
00509 -->
00510 <table border="0" cellpadding="0" cellspacing="0" id="typo3-shortcuts-editing">
00511 <tr>
00512 <td> </td>
00513 <td><input type="image" class="c-inputButton" name="_savedok"'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/savedok.gif','').' title="'.$LANG->getLL('shortcut_save',1).'" /></td>
00514 <td><input type="image" class="c-inputButton" name="_saveclosedok"'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/saveandclosedok.gif','').' title="'.$LANG->getLL('shortcut_saveClose',1).'" /></td>
00515 <td><input type="image" class="c-inputButton" name="_closedok"'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/closedok.gif','').' title="'.$LANG->getLL('shortcut_close',1).'" /></td>
00516 <td><input type="image" class="c-inputButton" name="_deletedok"'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/deletedok.gif','').' title="'.$LANG->getLL('shortcut_delete',1).'" /></td>
00517 <td><input name="editName" type="text" value="'.htmlspecialchars($this->editSC_rec['description']).'"'.$this->doc->formWidth(15).' /></td>
00518 <td><select name="editGroup">'.implode('',$opt).'</select></td>
00519 </tr>
00520 </table>
00521 <input type="hidden" name="whichItem" value="'.$this->editSC_rec['uid'].'" />
00522
00523 ';
00524 } else $manageForm='';
00525
00526 if (!$this->editLoaded && count($this->selOpt)>1) {
00527 $this->lines[]='<td> </td>';
00528 $this->lines[]='<td><select name="_selSC" onchange="eval(this.options[this.selectedIndex].value);this.selectedIndex=0;">'.implode('',$this->selOpt).'</select></td>';
00529 }
00530
00531
00532 $this->lines = array_merge($this->linesPre,$this->lines);
00533
00534 if (count($this->lines)) {
00535 if (!$BE_USER->getTSConfigVal('options.mayNotCreateEditShortcuts')) {
00536 $this->lines=array_merge(array('<td><input type="checkbox" id="editShortcut_check" name="editShortcut_check" value="1"'.($this->editSC?' checked="checked"':'').' /> <label for="editShortcut_check">'.$LANG->getLL('shortcut_edit',1).'</label> </td>'),$this->lines);
00537 $this->lines[]='<td>'.$manageForm.'</td>';
00538 }
00539 $this->lines[]='<td><img src="clear.gif" width="10" height="1" alt="" /></td>';
00540 }
00541 }
00542
00549 function editPageIdFunc() {
00550 global $BE_USER,$LANG;
00551
00552 if (!t3lib_extMgm::isLoaded('cms')) return;
00553
00554
00555 $this->editPage = trim($LANG->csConvObj->conv_case($LANG->charSet,$this->editPage,'toLower'));
00556 $this->editError = '';
00557 $this->theEditRec = '';
00558 $this->searchFor = '';
00559 if ($this->editPage) {
00560
00561
00562 $this->alternativeTableUid = explode(':',$this->editPage);
00563 if (!(count($this->alternativeTableUid)==2 && $BE_USER->isAdmin())) {
00564
00565 $where = ' AND ('.$BE_USER->getPagePermsClause(2).' OR '.$BE_USER->getPagePermsClause(16).')';
00566 if (t3lib_div::testInt($this->editPage)) {
00567 $this->theEditRec = t3lib_BEfunc::getRecordWSOL('pages',$this->editPage,'*',$where);
00568 } else {
00569 $records = t3lib_BEfunc::getRecordsByField('pages','alias',$this->editPage,$where);
00570 if (is_array($records)) {
00571 reset($records);
00572 $this->theEditRec = current($records);
00573 t3lib_BEfunc::workspaceOL('pages',$this->theEditRec);
00574 }
00575 }
00576 if (!is_array($this->theEditRec)) {
00577 unset($this->theEditRec);
00578 $this->searchFor = $this->editPage;
00579 } elseif (!$BE_USER->isInWebMount($this->theEditRec['uid'])) {
00580 unset($this->theEditRec);
00581 $this->editError=$LANG->getLL('shortcut_notEditable');
00582 } else {
00583
00584
00585 $perms_clause = $BE_USER->getPagePermsClause(1);
00586 $this->editPath = t3lib_BEfunc::getRecordPath($this->theEditRec['pid'], $perms_clause, 30);
00587
00588 if(!$BE_USER->getTSConfigVal('options.shortcut_onEditId_dontSetPageTree')) {
00589
00590
00591 t3lib_BEfunc::openPageTree($this->theEditRec['pid'],!$BE_USER->getTSConfigVal('options.shortcut_onEditId_keepExistingExpanded'));
00592 }
00593 }
00594 }
00595 }
00596 }
00597
00603 function printContent() {
00604 $this->content.= $this->doc->endPage();
00605 $this->content = $this->doc->insertStylesAndJS($this->content);
00606 echo $this->content;
00607 }
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00628 function workspaceSelector() {
00629 global $TYPO3_DB,$BE_USER,$LANG;
00630
00631
00632 if (strlen($this->changeWorkspace)) {
00633 $BE_USER->setWorkspace($this->changeWorkspace);
00634 return $this->doc->wrapScriptTags('top.location.href="alt_main.php";');
00635 }
00636
00637 if (strlen($this->changeWorkspacePreview)) {
00638 $BE_USER->setWorkspacePreview($this->changeWorkspacePreview);
00639 }
00640
00641
00642 $options = array();
00643 if ($BE_USER->checkWorkspace(array('uid' => 0))) {
00644 $options[0] = '['.$LANG->getLL('shortcut_onlineWS').']';
00645 }
00646 if ($BE_USER->checkWorkspace(array('uid' => -1))) {
00647 $options[-1] = '['.$LANG->getLL('shortcut_offlineWS').']';
00648 }
00649
00650
00651 $workspaces = $TYPO3_DB->exec_SELECTgetRows('uid,title,adminusers,members,reviewers','sys_workspace','pid=0'.t3lib_BEfunc::deleteClause('sys_workspace'),'','title');
00652 if (count($workspaces)) {
00653 foreach ($workspaces as $rec) {
00654 if ($BE_USER->checkWorkspace($rec)) {
00655 $options[$rec['uid']] = $rec['uid'].': '.$rec['title'];
00656 }
00657 }
00658 }
00659
00660
00661 if (count($options)) {
00662 foreach($options as $value => $label) {
00663 $selected = ((int)$BE_USER->workspace===$value ? ' selected="selected"' : '');
00664 $options[$value] = '<option value="'.htmlspecialchars($value).'"'.$selected.'>'.htmlspecialchars($label).'</option>';
00665 }
00666 } else {
00667 $options[] = '<option value="-99">'.$LANG->getLL('shortcut_noWSfound',1).'</option>';
00668 }
00669
00670 $selector = '';
00671
00672 if ($BE_USER->workspace!==0) {
00673 $selector.= '<label for="workspacePreview">Frontend Preview:</label> <input type="checkbox" name="workspacePreview" id="workspacePreview" onclick="changeWorkspacePreview('.($BE_USER->user['workspace_preview'] ? 0 : 1).')"; '.($BE_USER->user['workspace_preview'] ? 'checked="checked"' : '').'/> ';
00674 }
00675
00676 $selector.= '<a href="mod/user/ws/index.php" target="content">'.
00677 t3lib_iconWorks::getIconImage('sys_workspace',array(),$this->doc->backPath,'align="top"').
00678 '</a>';
00679 if (count($options) > 1) {
00680 $selector .= '<select name="_workspaceSelector" onchange="changeWorkspace(this.options[this.selectedIndex].value);">'.implode('',$options).'</select>';
00681 }
00682
00683 return $selector;
00684 }
00685
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697
00705 function mIconFilename($Ifilename,$backPath) {
00706
00707 $Ifilename = str_replace ('mod/file/list/list.gif', 'mod/file/file.gif', $Ifilename);
00708
00709 if (t3lib_div::isAbsPath($Ifilename)) {
00710 $Ifilename = '../'.substr($Ifilename,strlen(PATH_site));
00711 }
00712 return $backPath.$Ifilename;
00713 }
00714
00721 function getIcon($modName) {
00722 global $LANG;
00723 if ($LANG->moduleLabels['tabs_images'][$modName.'_tab']) {
00724 $icon = $this->mIconFilename($LANG->moduleLabels['tabs_images'][$modName.'_tab'],'');
00725 } elseif ($modName=='xMOD_alt_doc.php') {
00726 $icon = 'gfx/edit2.gif';
00727 } elseif ($modName=='xMOD_file_edit.php') {
00728 $icon = 'gfx/edit_file.gif';
00729 } elseif ($modName=='xMOD_wizard_rte.php') {
00730 $icon = 'gfx/edit_rtewiz.gif';
00731 } else {
00732 $icon = 'gfx/dummy_module.gif';
00733 }
00734 return $icon;
00735 }
00736
00745 function itemLabel($inlabel,$modName,$M_modName='') {
00746 global $LANG;
00747 if (substr($modName,0,5)=='xMOD_') {
00748 $label=substr($modName,5);
00749 } else {
00750 $split = explode('_',$modName);
00751 $label = $LANG->moduleLabels['tabs'][$split[0].'_tab'];
00752 if (count($split)>1) {
00753 $label.='>'.$LANG->moduleLabels['tabs'][$modName.'_tab'];
00754 }
00755 }
00756 if ($M_modName) $label.=' ('.$M_modName.')';
00757 $label.=': '.$inlabel;
00758 return $label;
00759 }
00760
00767 function getLinkedPageId($url) {
00768 return preg_replace('/.*[\?&]id=([^&]+).*/', '$1', $url);
00769 }
00770
00776 function hasWorkspaceAccess() {
00777 $MCONF = array();
00778 include('mod/user/ws/conf.php');
00779 return $GLOBALS['BE_USER']->modAccess(array('name' => 'user', 'access' => 'user,group'), false) && $GLOBALS['BE_USER']->modAccess($MCONF, false);
00780 }
00781 }
00782
00783
00784 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_shortcut.php']) {
00785 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_shortcut.php']);
00786 }
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799 $SOBE = t3lib_div::makeInstance('SC_alt_shortcut');
00800 $SOBE->preinit();
00801 $SOBE->preprocess();
00802 $SOBE->init();
00803 $SOBE->main();
00804 $SOBE->printContent();
00805 ?>