Commit 9f50c058 authored by Kasper Skårhøj's avatar Kasper Skårhøj
Browse files

* Added possibility to copy database/file elements attached to records; You can now click the icon of these elements in the editing forms and get a (limited) context menu for these elements.
* Fixed some other bugs around.


git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@203 709f56b5-9817-0410-a4d7-c38de5d9e867
parent 1839a081
2004-04-19 Kasper Skårhøj,,, <kasper@typo3.com>
* Added possibility to copy database/file elements attached to records; You can now click the icon of these elements in the editing forms and get a (limited) context menu for these elements.
* Fixed some other bugs around.
2004-04-16 Kasper Skårhøj,,, <kasper@typo3.com>
* fixed detection of schemes (http://, ftp:// etc) in "typolinks". Now email addresses are detected only if NOT prepended with a scheme. Also the presence of a scheme will make typolink function detect the input as a plain URL which should just be passed through untouched.
2004-04-14 Kasper Skårhøj,,, <kasper@typo3.com>
* Mount Points (Mount pages) reworking:
......
......@@ -884,6 +884,15 @@ BACKEND TOOLS:
- Global search and replace of records (Rene F?)
- Export the complete typo3 site/database, in a big file like mycompletesite.t3d
Repeated intervals extension:
- Cron-job which alters the start/end times according to some schedule.
- Configurable for any element of course
New-Wizard:
- An extension offering people to configure a wizard for creation of records. For instance you can configure to create a content element in three steps: First select type and header, then according to first choice, select more. Each screen has custom text/images/examples. Eventually the record is created. After creation there might be more options to set. In the end the wizard might fire up another application (like TemplaVoila) or a wizard or such.
- Could be useful for: TemplaVoila Template Objects, Content Elements (like tables/forms/plugins), Pages of sorts.
- Configuration could be in XML (since it needs a hierarchy)
**************************************
APPENDIX: PATTERN-control
......
......@@ -373,11 +373,11 @@ class t3lib_clipboard {
if ($table=='_FILE') { // Rendering files/directories on the clipboard:
if (@file_exists($v) && t3lib_div::isAllowedAbsPath($v)) {
$fI=pathinfo($v);
$fI = pathinfo($v);
$icon = is_dir($v) ? 'folder.gif' : t3lib_BEfunc::getFileIcon(strtolower($fI['extension']));
$size=' ('.t3lib_div::formatSize(filesize($v)).'bytes)';
$size = ' ('.t3lib_div::formatSize(filesize($v)).'bytes)';
$icon = '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/fileicons/'.$icon,'width="18" height="16"').' border="0" hspace="20" class="absmiddle" title="'.htmlspecialchars($fI['basename'].$size).'" alt="" />';
$thumb= $this->clipData['_setThumb'] ? (t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],$fI['extension']) ? t3lib_BEfunc::getThumbNail($this->backPath.'thumbs.php',$v,' vspace="4"') : '') :'';
$thumb = $this->clipData['_setThumb'] ? (t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],$fI['extension']) ? t3lib_BEfunc::getThumbNail($this->backPath.'thumbs.php',$v,' vspace="4"') : '') :'';
$lines[]='
<tr>
......
This diff is collapsed.
......@@ -46,59 +46,61 @@
*
*
*
* 123: class clickMenu
* 155: function init($item)
* 198: function doDisplayTopFrameCM()
* 125: class clickMenu
* 157: function init($item)
* 200: function doDisplayTopFrameCM()
*
* SECTION: DATABASE
* 226: function printDBClickMenu($table,$uid)
* 313: function printNewDBLevel($table,$uid)
* 350: function externalProcessingOfDBMenuItems($menuItems)
* 362: function processingByExtClassArray($menuItems,$table,$uid)
* 381: function urlRefForCM($url,$retUrl='',$hideCM=1)
* 398: function DB_copycut($table,$uid,$type)
* 421: function DB_paste($table,$uid,$type,$elInfo)
* 442: function DB_info($table,$uid)
* 458: function DB_history($table,$uid)
* 477: function DB_perms($table,$uid,$rec)
* 496: function DB_db_list($table,$uid,$rec)
* 515: function DB_moveWizard($table,$uid,$rec)
* 536: function DB_newWizard($table,$uid,$rec)
* 559: function DB_editAccess($table,$uid)
* 577: function DB_editPageHeader($uid)
* 595: function DB_edit($table,$uid)
* 637: function DB_new($table,$uid)
* 662: function DB_hideUnhide($table,$rec,$hideField)
* 686: function DB_delete($table,$uid,$elInfo)
* 707: function DB_view($id,$anchor='')
* 228: function printDBClickMenu($table,$uid)
* 315: function printNewDBLevel($table,$uid)
* 352: function externalProcessingOfDBMenuItems($menuItems)
* 364: function processingByExtClassArray($menuItems,$table,$uid)
* 383: function urlRefForCM($url,$retUrl='',$hideCM=1)
* 400: function DB_copycut($table,$uid,$type)
* 429: function DB_paste($table,$uid,$type,$elInfo)
* 450: function DB_info($table,$uid)
* 466: function DB_history($table,$uid)
* 485: function DB_perms($table,$uid,$rec)
* 504: function DB_db_list($table,$uid,$rec)
* 523: function DB_moveWizard($table,$uid,$rec)
* 544: function DB_newWizard($table,$uid,$rec)
* 567: function DB_editAccess($table,$uid)
* 585: function DB_editPageHeader($uid)
* 603: function DB_edit($table,$uid)
* 645: function DB_new($table,$uid)
* 670: function DB_hideUnhide($table,$rec,$hideField)
* 694: function DB_delete($table,$uid,$elInfo)
* 715: function DB_view($id,$anchor='')
*
* SECTION: FILE
* 736: function printFileClickMenu($path)
* 800: function externalProcessingOfFileMenuItems($menuItems)
* 814: function FILE_launch($path,$script,$type,$image)
* 833: function FILE_copycut($path,$type)
* 853: function FILE_delete($path)
* 875: function FILE_paste($path,$target,$elInfo)
* 744: function printFileClickMenu($path)
* 808: function externalProcessingOfFileMenuItems($menuItems)
* 822: function FILE_launch($path,$script,$type,$image)
* 841: function FILE_copycut($path,$type)
* 867: function FILE_delete($path)
* 889: function FILE_paste($path,$target,$elInfo)
*
* SECTION: COMMON
* 915: function printItems($menuItems,$item)
* 960: function printLayerJScode($menuItems)
* 998: function wrapColorTableCM($str)
* 1021: function menuItemsForTopFrame($menuItems)
* 1038: function menuItemsForClickMenu($menuItems)
* 1073: function linkItem($str,$icon,$onClick,$onlyCM=0,$dontHide=0)
* 1097: function excludeIcon($iconCode)
* 1107: function label($label)
* 1116: function isCMlayers()
* 1126: function frameLocation($str)
* 929: function printItems($menuItems,$item)
* 981: function printLayerJScode($menuItems)
* 1019: function wrapColorTableCM($str)
* 1042: function menuItemsForTopFrame($menuItems)
* 1059: function menuItemsForClickMenu($menuItems)
* 1094: function linkItem($str,$icon,$onClick,$onlyCM=0,$dontHide=0)
* 1118: function excludeIcon($iconCode)
* 1128: function enableDisableItems($menuItems)
* 1166: function cleanUpSpacers($menuItems)
* 1208: function label($label)
* 1217: function isCMlayers()
* 1227: function frameLocation($str)
*
*
* 1151: class SC_alt_clickmenu
* 1169: function init()
* 1260: function main()
* 1295: function printContent()
* 1252: class SC_alt_clickmenu
* 1271: function init()
* 1369: function main()
* 1403: function printContent()
*
* TOTAL FUNCTIONS: 41
* TOTAL FUNCTIONS: 43
* (This index is automatically created/updated by the extension "extdeveval")
*
*/
......@@ -132,7 +134,7 @@ class clickMenu {
var $listFrame=0; // If set, the calling document should be in the listframe of a frameset.
var $isDBmenu=0; // If set, the menu is about database records, not files. (set if part 2 [1] of the item-var is NOT blank)
var $alwaysContentFrame=0; // If true, the "content" frame is always used for reference (when condensed mode is enabled)
var $iParts=array(); // Stores the parts of the input $item string, splitted by "|"
var $iParts=array(); // Stores the parts of the input $item string, splitted by "|": [0] = table/file, [1] = uid/blank, [2] = flag: If set, listFrame, [3] = ("+" prefix = disable all by default, enable these. Default is to disable) Items key list
var $disabledItems=array(); // Contains list of keywords of items to disable in the menu
var $dontDisplayTopFrameCM=0; // If true, the context sensitive menu will not appear in the top frame, only as a layer.
var $leftIcons=0; // If true, Show icons on the left.
......@@ -400,10 +402,15 @@ class clickMenu {
$isSel = $this->clipObj->isSelected($table,$uid);
}
$addParam = array();
if ($this->listFrame) {
$addParam['reloadListFrame'] = ($this->alwaysContentFrame ? 2 : 1);
}
return $this->linkItem(
$this->label($type),
$this->excludeIcon('<img'.t3lib_iconWorks::skinImg($this->PH_backPath,'gfx/clip_'.$type.($isSel==$type?'_h':'').'.gif','width="12" height="12"').' alt="" />'),
"top.loadTopMenu('".$this->clipObj->selUrlDB($table,$uid,($type=='copy'?1:0),($isSel==$type),array('reloadListFrame'=>$this->listFrame))."');return false;"
"top.loadTopMenu('".$this->clipObj->selUrlDB($table,$uid,($type=='copy'?1:0),($isSel==$type),$addParam)."');return false;"
);
}
......@@ -832,15 +839,21 @@ class clickMenu {
* @internal
*/
function FILE_copycut($path,$type) {
$table='_FILE'; // Pseudo table name for use in the clipboard.
$table = '_FILE'; // Pseudo table name for use in the clipboard.
$uid = t3lib_div::shortmd5($path);
if ($this->clipObj->current=='normal') {
$isSel = $this->clipObj->isSelected($table,$uid);
}
$addParam = array();
if ($this->listFrame) {
$addParam['reloadListFrame'] = ($this->alwaysContentFrame ? 2 : 1);
}
return $this->linkItem(
$this->label($type),
$this->excludeIcon('<img'.t3lib_iconWorks::skinImg($this->PH_backPath,'gfx/clip_'.$type.($isSel==$type?'_h':'').'.gif','width="12" height="12"').' alt="" />'),
"top.loadTopMenu('".$this->clipObj->selUrlFile($path,($type=='copy'?1:0),($isSel==$type))."');return false;"
"top.loadTopMenu('".$this->clipObj->selUrlFile($path,($type=='copy'?1:0),($isSel==$type),$addParam)."');return false;"
);
}
......@@ -914,8 +927,15 @@ class clickMenu {
* @return string HTML code
*/
function printItems($menuItems,$item) {
$out='';
// Enable/Disable items:
$menuItems = $this->enableDisableItems($menuItems);
// Clean up spacers:
$menuItems = $this->cleanUpSpacers($menuItems);
// Adding topframe part (horizontal clickmenu)
if ($this->doDisplayTopFrameCM()) {
$out.= '
......@@ -1099,6 +1119,86 @@ if (top.content && top.content'.$frameName.' && top.content'.$frameName.'.setLay
return ($GLOBALS['BE_USER']->uc['noMenuMode'] && strcmp($GLOBALS['BE_USER']->uc['noMenuMode'],'icons')) ? '' : ' '.$iconCode;
}
/**
* Enabling / Disabling items based on list provided from GET var ($this->iParts[3])
*
* @param array Menu items array
* @return array Menu items array, processed.
*/
function enableDisableItems($menuItems) {
if ($this->iParts[3]) {
// Detect "only" mode: (only showing listed items)
if (substr($this->iParts[3],0,1)=='+') {
$this->iParts[3] = substr($this->iParts[3],1);
$only = TRUE;
} else {
$only = FALSE;
}
// Do filtering:
if ($only) { // Transfer ONLY elements which are mentioned (or are spacers)
$newMenuArray = array();
foreach($menuItems as $key => $value) {
if (t3lib_div::inList($this->iParts[3], $key) || (is_string($value) && $value=='spacer')) {
$newMenuArray[$key] = $value;
}
}
$menuItems = $newMenuArray;
} else { // Traverse all elements except those listed (just unsetting them):
$elements = t3lib_div::trimExplode(',',$this->iParts[3],1);
foreach($elements as $value) {
unset($menuItems[$value]);
}
}
}
// Return processed menu items:
return $menuItems;
}
/**
* Clean up spacers; Will remove any spacers in the start/end of menu items array plus any duplicates.
*
* @param array Menu items array
* @return array Menu items array, processed.
*/
function cleanUpSpacers($menuItems) {
// Remove doubles:
$prevItemWasSpacer = FALSE;
foreach($menuItems as $key => $value) {
if (is_string($value) && $value=='spacer') {
if ($prevItemWasSpacer) {
unset($menuItems[$key]);
}
$prevItemWasSpacer = TRUE;
} else {
$prevItemWasSpacer = FALSE;
}
}
// Remove first:
reset($menuItems);
$key = key($menuItems);
$value = current($menuItems);
if (is_string($value) && $value=='spacer') {
unset($menuItems[$key]);
}
// Remove last:
end($menuItems);
$key = key($menuItems);
$value = current($menuItems);
if (is_string($value) && $value=='spacer') {
unset($menuItems[$key]);
}
// Return processed menu items:
return $menuItems;
}
/**
* Get label from locallang_core.php:cm.*
*
......@@ -1212,6 +1312,7 @@ class SC_alt_clickmenu {
$secs = t3lib_div::intInRange($BE_USER->getTSConfigVal('options.contextMenu.options.clickMenuTimeOut'),1,100,5); // default is 5
// Setting the JavaScript controlling the timer on the page
$listFrameDoc = $this->reloadListFrame!=2 ? 'top.content.list_frame' : 'top.content';
$this->doc->JScode.=$this->doc->wrapScriptTags('
var date = new Date();
var mo_timeout = Math.floor(date.getTime()/1000);
......@@ -1255,7 +1356,7 @@ class SC_alt_clickmenu {
'.($this->reloadListFrame ? '
// Reload list frame:
if(top.content.list_frame){top.content.list_frame.document.location=top.content.list_frame.document.location;}' :
if('.$listFrameDoc.'){'.$listFrameDoc.'.document.location='.$listFrameDoc.'.document.location;}' :
'').'
');
}
......@@ -1274,7 +1375,6 @@ class SC_alt_clickmenu {
// Update clipboard if some actions are sent.
$CB = t3lib_div::_GET('CB');
$clipObj->setCmd($CB);
$clipObj->cleanCurrent();
$clipObj->endClipboard(); // Saves
......
......@@ -415,6 +415,12 @@ class SC_alt_doc {
}
'.(isset($HTTP_POST_VARS['_savedokview_x']) && $this->popViewId ? t3lib_BEfunc::viewOnClick($this->popViewId,'',t3lib_BEfunc::BEgetRootLine($this->popViewId),'',$this->viewUrl) : '')
);
// Setting up the context sensitive menu:
$CMparts = $this->doc->getContextMenuCode();
$this->doc->JScode.= $CMparts[0];
$this->doc->bodyTagAdditions = $CMparts[1];
$this->doc->postCode.= $CMparts[2];
}
/**
......@@ -439,6 +445,7 @@ class SC_alt_doc {
$this->tceforms->returnUrl = $this->R_URI;
$this->tceforms->palettesCollapsed = !$this->MOD_SETTINGS['showPalettes'];
$this->tceforms->disableRTE = $this->MOD_SETTINGS['disableRTE'];
$this->tceforms->enableClickMenu = TRUE;
// Clipboard is initialized:
$this->tceforms->clipObj = t3lib_div::makeInstance('t3lib_clipboard'); // Start clipboard
......
......@@ -309,6 +309,7 @@ TABLE.typo3-page-ceHeader IMG { vertical-align: middle; }
TABLE.typo3-page-columnsMode IMG.c-divider { margin: 10px 0px 5px 0px;}
TABLE.typo3-page-columnsMode TR TD A { text-decoration: none; }
TABLE.typo3-page-columnsMode TR TD A B { text-decoration: underline; }
TABLE.typo3-page-cols TR TD SPAN.exampleContent A { text-decoration: none;}
/* Web > List */
TABLE.typo3-dblist IMG { vertical-align: middle; }
......
This diff is collapsed.
......@@ -4636,8 +4636,11 @@ class tslib_cObj {
$target = isset($conf['target']) ? $conf['target'] : $GLOBALS['TSFE']->intTarget;
if ($conf['target.']) {$target=$this->stdWrap($target, $conf['target.']);}
// Parse URL:
$pU = parse_url($link_param);
// Detecting kind of link:
if(strstr($link_param,'@')) { // If it's a mail address:
if(strstr($link_param,'@') && !$pU['scheme']) { // If it's a mail address:
$link_param = eregi_replace('^mailto:','',$link_param);
if ($linktxt=='') $linktxt = $link_param;
if (!$GLOBALS['TSFE']->config['config']['jumpurl_enable'] || $GLOBALS['TSFE']->config['config']['jumpurl_mailto_disable']) {
......@@ -4664,12 +4667,12 @@ class tslib_cObj {
$isLocalFile=1;
}
if(!$isLocalFile && $urlChar && (strstr($link_param,'//') || !$fileChar || $urlChar<$fileChar)) { // url (external): If doubleSlash or if a '.' comes before a '/'.
if($pU['scheme'] || (!$isLocalFile && $urlChar && (!$fileChar || $urlChar<$fileChar))) { // url (external): If doubleSlash or if a '.' comes before a '/'.
$target = isset($conf['extTarget']) ? $conf['extTarget'] : $GLOBALS['TSFE']->extTarget;
if ($conf['extTarget.']) {$target = $this->stdWrap($target, $conf['extTarget.']);}
if ($forceTarget) {$target=$forceTarget;}
if ($linktxt=='') $linktxt = $link_param;
if (!ereg('^[a-z]*://',trim(strtolower($link_param)))) {$scheme='http://';} else {$scheme='';}
if (!$pU['scheme']) {$scheme='http://';} else {$scheme='';}
if ($GLOBALS['TSFE']->config['config']['jumpurl_enable']) {
$this->lastTypoLinkUrl = $GLOBALS['TSFE']->absRefPrefix.$GLOBALS['TSFE']->config['mainScript'].$initP.'&jumpurl='.rawurlencode($scheme.$link_param).$GLOBALS['TSFE']->getMethodUrlIdToken;
} else {
......@@ -4680,7 +4683,7 @@ class tslib_cObj {
$finalTagParts['targetParams'] = $target ? ' target="'.$target.'"' : '';
$finalTagParts['TYPE']='url';
} elseif ($fileChar || $isLocalFile) { // file (internal)
$splitLinkParam = explode('?',$link_param);
$splitLinkParam = explode('?', $link_param);
if (@file_exists(rawurldecode($splitLinkParam[0])) || $isLocalFile) {
if ($linktxt=='') $linktxt = rawurldecode($link_param);
if ($GLOBALS['TSFE']->config['config']['jumpurl_enable']) {
......
......@@ -509,7 +509,10 @@ class tslib_pibase {
<'.trim('table '.$tableParams).'>
<tr>
<td><input type="text" name="'.$this->prefixId.'[sword]" value="'.htmlspecialchars($this->piVars['sword']).'"'.$this->pi_classParam('searchbox-sword').' /></td>
<td><input type="submit" value="'.$this->pi_getLL('pi_list_searchBox_search','Search',TRUE).'"'.$this->pi_classParam('searchbox-button').' /><input type="hidden" name="no_cache" value="1" /></td>
<td><input type="submit" value="'.$this->pi_getLL('pi_list_searchBox_search','Search',TRUE).'"'.$this->pi_classParam('searchbox-button').' />'.
'<input type="hidden" name="no_cache" value="1" />'.
'<input type="hidden" name="'.$this->prefixId.'[pointer]" value="" />'.
'</td>
</tr>
</table>
</form>
......
......@@ -279,12 +279,14 @@ class template {
* @param integer If icon is for database record this is the UID for the record from $table
* @param boolean Tells the top frame script that the link is coming from a "list" frame which means a frame from within the backend content frame.
* @param string Additional GET parameters for the link to alt_clickmenu.php
* @param string Enable / Disable click menu items. Example: "+new,view" will display ONLY these two items (and any spacers in between), "new,view" will display all BUT these two items.
* @param boolean If set, will return only the onclick JavaScript, not the whole link.
* @return string The link-wrapped input string.
*/
function wrapClickMenuOnIcon($str,$table,$uid='',$listFr=1,$addParams='') {
function wrapClickMenuOnIcon($str,$table,$uid='',$listFr=1,$addParams='',$enDisItems='', $returnOnClick=FALSE) {
$backPath = '&backPath='.rawurlencode($this->backPath).'|'.t3lib_div::shortMD5($this->backPath.'|'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']);
$onClick = 'top.loadTopMenu(\''.$this->backPath.'alt_clickmenu.php?item='.rawurlencode($table.'|'.$uid.'|'.$listFr).$backPath.$addParams.'\');'.$this->thisBlur().'return false;';
return '<a href="#" onclick="'.htmlspecialchars($onClick).'">'.$str.'</a>';
$onClick = 'top.loadTopMenu(\''.$this->backPath.'alt_clickmenu.php?item='.rawurlencode($table.'|'.$uid.'|'.$listFr.'|'.$enDisItems).$backPath.$addParams.'\');'.$this->thisBlur().'return false;';
return $returnOnClick ? $onClick : '<a href="#" onclick="'.htmlspecialchars($onClick).'">'.$str.'</a>';
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment