Documentation TYPO3 par Ameos

class.mod_user_task.php

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
00006 *  All rights reserved
00007 *
00008 *  This script is part of the TYPO3 project. The TYPO3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *  A copy is found in the textfile GPL.txt and important notices to the license
00017 *  from the author is found in LICENSE.txt distributed with these scripts.
00018 *
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
00035 require_once(PATH_t3lib.'class.t3lib_extobjbase.php');
00036 
00037 class mod_user_task extends t3lib_extobjbase {
00038         var $getUserNamesFields = 'username,usergroup,usergroup_cached_list,uid,realName,email';
00039         var $userGroupArray = array();
00040         var $perms_clause = '';
00041 
00042         var $backPath;
00043         var $BE_USER;
00044 
00045         function JScode() {
00046 
00047         }
00048 
00057         function sendEmail($recipient, $subject, $message) {
00058                 $message .= '
00059 
00060                                 --------
00061                                 '.sprintf($GLOBALS['LANG']->getLL('messages_emailFooter'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'], t3lib_div::getIndpEnv('HTTP_HOST'));
00062 
00063                 require_once(PATH_t3lib.'class.t3lib_htmlmail.php');
00064                 $email = t3lib_div::makeInstance('t3lib_htmlmail');
00065                 $email->start();
00066                 $email->useBase64();
00067                 $email->subject = $GLOBALS['TYPO3_CONF_VARS']['BE']['notificationPrefix'].' '.$subject;
00068                 $email->from_email = $this->BE_USER->user['email'];
00069                 $email->from_name = $this->BE_USER->user['realName'];
00070                 $email->addPlain($message);
00071                 $email->setHTML($email->encodeMsg($message));
00072                 $email->setHeaders();
00073                 $email->setContent();
00074                 $email->recipient = $recipient;
00075                 $email->sendTheMail();
00076         }
00077 
00084         function mod_user_task_init($BE_USER) {
00085                 $this->BE_USER = $BE_USER;
00086                 $this->perms_clause = $this->BE_USER->getPagePermsClause(1);
00087         }
00088 
00094         function helpBubble() {
00095                 return '<img src="'.$this->backPath.'gfx/helpbubble.gif" width="14" height="14" hspace=2 align=top'.$GLOBALS['SOBE']->doc->helpStyle().'>';
00096         }
00097 
00098 
00107         function headLink($key, $dontLink = false, $params = '') {
00108                 $str = $GLOBALS['SOBE']->MOD_MENU['function'][$key];
00109                 if (!$dontLink) $str = '<a href="index.php?SET[function]='.$key.$params.'" onClick="this.blur();">'.htmlspecialchars($str).'</a>';
00110                 return $str;
00111         }
00112 
00120         function fixed_lgd($str, $len = 0) {
00121                 return t3lib_div::fixed_lgd($str, $len?$len:$this->BE_USER->uc['titleLen']);
00122         }
00123 
00129         function errorIcon() {
00130                 return '<img src="'.$this->backPath.'gfx/icon_fatalerror.gif" width="18" height="16" align=top>';
00131         }
00132 
00138         function getUserAndGroupArrays() {
00139                 // Get groupnames for todo-tasks
00140                 $be_group_Array = t3lib_BEfunc::getListGroupNames('title,uid');
00141                 $groupArray = array_keys($be_group_Array);
00142                 // Usernames
00143                 $be_user_Array = $be_user_Array_o = t3lib_BEfunc::getUserNames($this->getUserNamesFields);
00144                 if (!$GLOBALS['BE_USER']->isAdmin()) $be_user_Array = t3lib_BEfunc::blindUserNames($be_user_Array, $groupArray, 1);
00145 
00146                 $this->userGroupArray = array($be_user_Array, $be_group_Array, $be_user_Array_o);
00147                 return $this->userGroupArray;
00148         }
00149 
00157         function dateTimeAge($tstamp, $prefix = 1) {
00158                 return t3lib_BEfunc::dateTimeAge($tstamp, $prefix);
00159         }
00160 
00167         function accessMod($mod) {
00168                 return $this->BE_USER->modAccess(array('name' => $mod, 'access' => 'user,group'), 0);
00169         }
00170 
00180         function mkMenuConfig($htmlContent, $label = "", $content = "", $popUpDescription = '') {
00181                 $configArr = Array();
00182                 if ((string) $htmlContent) $configArr['icon'] = $htmlContent;
00183                 if ((string) $label) $configArr['label'] = $label;
00184                 if ((string) $content) $configArr['content'] = $content;
00185                 if ((string) $linkTitle) $configArr['linkTitle'] = $linkTitle;
00186                 return $configArr;
00187         }
00188 
00196         function urlInIframe($url,$max=0) {
00197                 return '<iframe onload="resizeIframe(this,'.$max.');" scrolling="auto" width="100%" src="'.$url.'" name="list_frame" frameborder="no" style="border: none;"></iframe>';
00198         }
00199 
00200 
00201 }
00202 
00203 // Include extension?
00204 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/taskcenter/task/class.mod_user_task.php']) {
00205         include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/taskcenter/task/class.mod_user_task.php']);
00206 }
00207 
00208 
00209 ?>


Généré par Le spécialiste TYPO3 avec  doxygen 1.4.6