typo3

.htaccess – typo3

RewriteEngine on
#RewriteBase /
RewriteRule ^typo3$ typo3/index_re.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule .* index.php [L]

AuthName “Website”
AuthType Basic
AuthUserFile /www/.htpasswd
require valid-user

htpasswd -c /home/doe/public_html/.htpasswd username111


TSconfig – RTE

RTE.default {
blindImageOptions = magic, dragdrop
#contentCSS = fileadmin/templates/inc/css/global.css
showTagFreeClasses =
classesCharacter =
classesParagraph =
classesImage =
classesAnchor = external-link, internal-link, download, mail, thickbox
classesAnchor.default {
page = internal-link
url = external-link
file = download
mail = mail
}
classesTable =
classesTD =
classesUL =
classesHR =
enableWordClean = 1
removeTrailingBR = 1
removeComments = 1
removeTags = sdfield, font
removeTagsAndContents = style, script
useCSS = 1

# blockstylelabel, blockstyle, textstylelabel, textstyle, fontstyle, fontsize, formatblock, bold, italic, underline, strikethrough, subscript, superscript, lefttoright, righttoleft, left, center, right, justifyfull, orderedlist, unorderedlist, outdent, indent, textcolor, bgcolor, textindicator, emoticon, insertcharacter, line, link, image, table, user, acronym, findreplace, spellcheck, chMode, inserttag, removeformat, copy, cut, paste, undo, redo, showhelp, about, toggleborders, tableproperties, rowproperties, rowinsertabove, rowinsertunder, rowdelete, rowsplit, columninsertbefore, columninsertafter, columndelete, columnsplit, cellproperties, cellinsertbefore, columninsertafter, celldelete, cellsplit, cellmerge
# showButtons = *
# hideButtons = blockstylelabel, blockstyle
# toolbarOrder = blockstylelabel, blockstyle, bar, textstylelabel, textstyle, bar, formatblock, linebreak, bold, italic, underline, unorderedlist, bar, link, image, bar, removeformat, copy, cut, paste, undo, redo, bar, chMode, linebreak, table, toggleborders, tableproperties, rowproperties, rowinsertabove, rowinsertunder, rowdelete, rowsplit, columninsertbefore, columninsertafter, columndelete, columnsplit, cellproperties, cellinsertbefore, columninsertafter, celldelete, cellsplit, cellmerge, textstyle
showButtons = formatblock,bold, underline, italic, left, center, right, justifyfull, orderedlist, unorderedlist, insertcharacter, link, image, removeformat, copy, cut, paste, undo, redo, subscript, superscript, findreplace, textindicator, user, chMode,
# hideButtons = blockstyle, blockstylelabel,fontstyle, formatblock, fontsize, lefttoright, righttoleft, textcolor, bgcolor, emoticon, spellcheck, inserttag, outdent, indent, acronym, line, table, toggleborders, tableproperties, rowproperties, rowinsertabove, rowinsertunder, rowdelete, rowsplit, columninsertbefore, columninsertafter, columndelete, columnsplit, cellproperties, cellinsertbefore, cellinsertafter, celldelete, cellsplit, cellmerge, showhelp, about, textstyle, textstylelabel, insertcharacter, underline, strikethrough
hideTableOperationsInToolbar = 0

disableContextMenu = 0
disableTYPO3Browsers = 0
disableSelectColor = 0
disableEnterParagraphs = 0
hidePStyleItems = pre,address,blockquote,div
hideFontSizes =
fontSizes =
hideTags = 0
disableColorPicker = 1
showStatusBar = 1
defaultLinkTarget = _self
buttons.formatblock.removeItems = pre,address,blockquote,div
}

RTE.classesAnchor {
internalLink {
class = internal-link
type = page
image >
titleText >
}
externalLink {
class = external-link
type = url
image >
titleText >
}
download {
class = download
type = file
image >
titleText >
}
mail {
class = mail
type = mail
image >
titleText >
}
}

RTE.default.proc {
overruleMode = ts_css
remapParagraphTag = p
dontConvBRtoParagraph = 1
internalizeFontTags = 1
allowTagsOutside = img, table, br, span, hr, h1, h2, h3, h4,h5,h6,embed,object,param
# table, tbody, tr, th, td, h1, h2, h3, h4, h5, h6, div, p, br, span, ul, ol, li, pre, blockquote, strong, em, b, i, u, sub, sup, strike, a, img, nobr, hr, center, font, tt, q, cite, abbr, acronym, sdfield
allowTags = table, tbody, tr, th, td, h1, h2, h3, h4, h5, h6, div, p, br, span, ul, ol, li, blockquote, strong, em, b, i, u, sub, sup, strike, a, img, nobr, hr,embed,object,param
denyTags = *
preserveTags = div, span, & &quote;
keepPDIVattribs = id,class,style,align

# Allow embed (Youtube) HTML tags in the RTE
allowTags := addToList(object,param,embed)
allowTagsOutside := addToList(object,embed)
entryHTMLparser_db.allowTags < RTE.default.proc.allowTags

allowedClasses =
entryHTMLparser_db = 1
entryHTMLparser_db {
allowTags < RTE.default.proc.allowTags
denyTags >
htmlSpecialChars = 0
tags {
div.remap >
## REMOVE IMG TAGS
# img.allowedAttribs = 0
# img.rmTagIfNoAttrib = 1
## CLEAN ATTRIBUTES ON THE FOLLOWING TAGS
span.fixAttrib >
# span.fixAttrib.style.unset = 1
# p.fixAttrib.align.unset = 1
# div.fixAttrib.align.unset = 1
# hr.allowedAttribs = class
# b.allowedAttribs = xml:lang
# blockquote.allowedAttribs = xml:lang
# cite.allowedAttribs = xml:lang
# em.allowedAttribs = xml:lang
# i.allowedAttribs = xml:lang
# q.allowedAttribs = xml:lang
# strong.allowedAttribs = xml:lang
# sub.allowedAttribs = xml:lang
# sup.allowedAttribs = xml:lang
# tt.allowedAttribs = xml:lang
}
removeTags = sdfield
rmTagIfNoAttrib >
keepNonMatchedTags = protect
}

HTMLparser_db {
noAttrib = b, i, u, strike, sub, sup, strong, em, quote, blockquote, cite, tt, br, center
xhtml_cleaning = 1
}

exitHTMLparser_db = 1
exitHTMLparser_db {
tags.b.remap = strong
tags.i.remap = em
keepNonMatchedTags = 1
htmlSpecialChars = 0
}
}

RTE.default.FE < RTE.default

#mod.SHARED {
# defaultLanguageLabel = Deutsch
# defaultLanguageFlag = de.gif
#}

## Default RTE configuration

RTE.default.buttons.indent.useBlockquote = 1
RTE.default.buttons.left.useAlignAttribute = 1
RTE.default.buttons.center.useAlignAttribute = 1
RTE.default.buttons.right.useAlignAttribute = 1
RTE.default.buttons.justifyfull.useAlignAttribute = 1

RTE.default.buttons.left.useClass = test-left

RTE.default.buttons.center.useClass = test-center

RTE.default.buttons.right.useClass = test-right


typo3 TCA Flexform CSH

也就是说我们已经为TCA的字段加上了一个说明,那如何实现这个效果呢,步骤如下:
1. 创建一个csh(context sensitive help)文件(比如我的文件是locallang_csh_pages.php),这个文
件存储了,你在tca中要用到了所有的description信息.
$LOCAL_LANG = Array (
‘default’ => Array (
‘fieldname.title’=>titile, 标题
‘fieldname.description’=>description是一个简要的介绍信息,
‘fieldname.details’=>details是当你鼠标hover过去的时候看的详细信息,
)
)
2. 在你的ext_tables.php中引入这个csh的文件。
t3lib_extMgm::addLLrefForTCAdescr(‘tx_davtravel_catalogue’,’EXT:dav_travel/locallang_csh_pages.php’);

注意:tx_davtravel_catalogue为数据库表名,dav_travel 为插件名
3.在你的tca.php中的interface这个数组中加入always_description如下:
“interface” => Array (
“always_description” => 1
),

Flexform
Add context sensitive help (CSH) to FlexForm fields

1. FILE: your_extkey/pi1/flexform_ds.xml


  
    1
  
  
    
      
        
          The title of the sheet
          LLL:EXT:your_extkey/pi1/locallang_csh_flexform.xml
        
        array
        
          
            
              
              
                ... field configuration ...
              
            
          
        
      
    
  



2. FILE: your_extkey/pi1/locallang_csh_flexform.xml



  
    CSH labels for FlexForm fields
    CSH
    
    EXT:your_extkey/pi1/locallang_csh_flexform.xml
    
  
  
    
      
      
      
      
      
      
      
    
  


typo3 mail

1.sendnotifyemail (前台)

$this->cObj->sendNotifyEmail($msg, $recipients, $cc, $email_from, $email_fromName=”, $replyTo=”)

typo3.org/fileadmin/typo3api-4.2.6/df/d65/classtslib__cObj.html#bf556a717be8d450ebd66870e9d13f50

2.sendHTMLMail (前后台)

require_once PATH_tslib.’media/scripts/fe_adminLib.inc’;

user_feAdmin::sendHTMLMail($content,$recipient,$dummy,$fromEmail,$fromName,$replyTo=”);

typo3.org/fileadmin/typo3api-4.2.6/da/d94/fe__adminLib_8inc-source.html#l01536

Emailconf example


$confemail = array ('###SITENAME###' => $GLOBALS['TSFE']->TYPO3_CONF_VARS['SYS']['sitename']);
foreach ($GLOBALS['TSFE']->fe_user->user as $key1=>$val1){
$confemail['###'.t3lib_div::strtoupper($key1).'###'] = $val1;
}
/** * Application for alteration of personal information via e-mail
* @return success/failed message
*/
function sendNotifyEmail($confemail = array()) {
//get email content
$emailContent = $this->lConf ['emailtitle'] . chr(10) . $this->lConf ['emailcontent'];
//send email
if (! empty ( $confemail )) {
foreach ( $confemail as $key => $val ) {
$emailContent = str_replace ( $key, $val, $emailContent );
}
}
if ($this->cObj->sendNotifyEmail (
$emailContent, $this->lConf ['emailto'], '', $this->lConf ['emailfrom'], $this->lConf ['emailfromname'] )) {
return $this->cObj->wrap($this->pi_getLL ( 'emailsuccess' ),'|

‘); } else {
return $this->cObj->wrap($this->pi_getLL ( ’emailerror’ ),’|

‘); } }

3. t3lib_htmlmail(前后台)
####6.2####
$this->objectManager->get(‘TYPO3\\CMS\\Core\\Mail\\MailMessage’);

require_once(PATH_t3lib.’class.t3lib_htmlmail.php’);

// Prepare mailer and send the mail
$mailer = t3lib_div::makeInstance(‘t3lib_htmlmail’);
$mailer->start();
$mailer->useBase64();
$mailer->from_email = ”;
$mailer->from_name = ”;
$mailer->charset = ‘iso-8859-1′;
//$mailer->replyto_email = $this->reply_email;
//$mailer->replyto_name = ‘TEST-TASK’;
$mailer->subject = ”;
//$mailer->addPlain($mailBody);
$mailer->addHTML($url); //支持图片CID
$mailer->setRecipient(recipient@email.com);
$mailer->setHeaders();
$mailer->setContent();
$mailer->sendtheMail();

4. t3lib_mail_message (前后台)

$mail = t3lib_div::makeInstance(‘t3lib_mail_Message’); 
$mail->setFrom(array($email => $name)); 
$mail->setTo(array($email => $name)); 
$mail->setReplyTo(array(test_replyto@test.com => ‘name2′)); 
$mail->setSubject($subject); 
$mail->setBody($body, ‘text/html’, ‘iso-8859-1′); 
$mail->send();

相关:http://buzz.typo3.org/teams/core/article/your-first-blog/

Practical samples
The best way to explain is to show a few examples

Regular syntax

$mail = t3lib_div::makeInstance(‘t3lib_mail_Message’);
$mail->setFrom(array($email => $name));
$mail->setTo(array($email => $name));
$mail->setSubject($subject);
$mail->setBody($body);
$mail->send();
Concatenated syntax

Because most methods return the message object the calls can also be concatenated:

$mail = t3lib_div::makeInstance(‘t3lib_mail_Message’);
$mail->setFrom(array($email => $name))
->setTo(array($email => $name))
->setSubject($subject)
->setBody($body)
->send();
Extra options

The class t3lib_mail_Message extends the class Swift_Message, so all the magic of Swift Mailer is available in the t3lib_mail_Message. One of the things added by t3lib_mail_Message is the send() method. This takes care of all the ‘transport’ and ‘mailer’ magic. It will use the settings from the Install Tool, so all mails from TYPO3 will use the same transport method.

HTML and plain text mails

It’s easy to add alternative body parts. Swift Mailer will add the appropriate boundaries and MIME-part headers:

$mail->setBody($bodyHtml, ‘text/html’);
$mail->addPart($bodyText, ‘text/plain’);
Attachments

Again Swift Mailer will take care of the encoding, MIME part headers, etc.

$mail->attach(Swift_Attachment::fromPath($theFile));
Want to set the filename of the attachment?

$mail->attach(Swift_Attachment::fromPath($theFile)->setFilename($theName));
Inline images

If you want to embed images in HTML text Swift Mailer can help you too

$cid = $mail->embed(Swift_Image::fromPath($theFile);
The $cid contains the id you can use in the HTML content in the src attribute of the img tag.

 

使用cid:标记,表明图形是放在一个叫123的附件中的 然后加入一个附件,指定为 content-type: image/gif content-id: <123> 即上面那个123 content-disposition: inline; filename=sdfsdf filename是随便指定的 content-transfer-encodinf: base64 这里是附件内容要求用base64编码。

Legacy code
Existing extensions will use various mail functions in the current TYPO3 API. To make sure that all mails sent from the TYPO3 installation use the new transport mechanisms an adapter is included which catches all calls to the ‘old’ functions and forwards them to the Swift Mailer functions. This adapter is not 100% perfect, so in case of problems you can disable this adapter:

$TYPO3_CONF_VARS[‘MAIL’][‘substituteOldMailAPI’] = 0

以下是cid demo from FMOT:

$mail = t3lib_div::makeInstance('t3lib_mail_Message');
            $mail->setFrom(array($sender => $sender_name));
            $mail->setReplyTo($reply_to);
            $mail->setTo($row['email']);
            $mail->setSubject($subject);

            $body = t3lib_div::getUrl($url = $GLOBALS['TSFE']->baseUrl.$this->getLinkUrl('', '&action=newwindow&query_id='.$row['uid']));

            preg_match_all("/\embed(Swift_Image::fromPath($src));
                    if($cid){
                        $body = str_replace($src, $cid, $body);
                    }
                }
            }
            $mail->setBody($body, 'text/html', 'utf-8');
            return $mail->send();

StartPoint

1.取值(array)

$startPoint = $this->cObj->data[‘pages’];

2.去掉startpoint

ext_tables.php
t3lib_div::loadTCA(‘tt_content’);

$TCA[‘tt_content’][‘types’][‘list’][‘subtypes_excludelist’][$_EXTKEY.’_pi1′]=’layout,select_key,pages,recursive‘‘;

3.startpoint多级

$this->storagePid = $this->pi_getPidList($this->cObj->data[‘pages’], $this->cObj->data[‘recursive’]);

后台用户菜单树不显示解决

1. 将用户归入后台用户组editor中
2. editor组属性中DB Mounts:一定要设置.新建File Mounts:时注意指定fileadmin下子目录,否则filelist不会显示。
3. Access权限group选为editor.
后台用户菜单树不显示解决 - 天才bobo仔 - 天上人间*bobo之家后台用户菜单树不显示解决 - 天才bobo仔 - 天上人间*bobo之家


Copyright © 1996-2010 Add Lives. All rights reserved.
iDream theme by Templates Next | Powered by WordPress