Documentation TYPO3 par Ameos |
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 00060 function sendEmail($email, $subject, $message) { 00061 $sender = $this->BE_USER->user['realName'].' <'.$this->BE_USER->user['email'].'>'; 00062 $message .= ' 00063 00064 -------- 00065 '.sprintf($GLOBALS['LANG']->getLL('messages_emailFooter'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'], t3lib_div::getIndpEnv('HTTP_HOST')); 00066 mail($email, $GLOBALS['TYPO3_CONF_VARS']['BE']['notificationPrefix'].' '.$subject, $message, "From: ".$sender); 00067 00068 // debug($email); 00069 // debug($message); 00070 } 00071 00078 function mod_user_task_init($BE_USER) { 00079 $this->BE_USER = $BE_USER; 00080 $this->perms_clause = $this->BE_USER->getPagePermsClause(1); 00081 } 00082 00088 function helpBubble() { 00089 return '<img src="'.$this->backPath.'gfx/helpbubble.gif" width="14" height="14" hspace=2 align=top'.$GLOBALS['SOBE']->doc->helpStyle().'>'; 00090 } 00091 00092 00101 function headLink($key, $dontLink = false, $params = '') { 00102 $str = $GLOBALS['SOBE']->MOD_MENU['function'][$key]; 00103 if (!$dontLink) $str = '<a href="index.php?SET[function]='.$key.$params.'" onClick="this.blur();">'.htmlspecialchars($str).'</a>'; 00104 return $str; 00105 } 00106 00114 function fixed_lgd($str, $len = 0) { 00115 return t3lib_div::fixed_lgd($str, $len?$len:$this->BE_USER->uc['titleLen']); 00116 } 00117 00123 function errorIcon() { 00124 return '<img src="'.$this->backPath.'gfx/icon_fatalerror.gif" width="18" height="16" align=top>'; 00125 } 00126 00132 function getUserAndGroupArrays() { 00133 // Get groupnames for todo-tasks 00134 $be_group_Array = t3lib_BEfunc::getListGroupNames('title,uid'); 00135 $groupArray = array_keys($be_group_Array); 00136 // Usernames 00137 $be_user_Array = $be_user_Array_o = t3lib_BEfunc::getUserNames($this->getUserNamesFields); 00138 if (!$GLOBALS['BE_USER']->isAdmin()) $be_user_Array = t3lib_BEfunc::blindUserNames($be_user_Array, $groupArray, 1); 00139 00140 $this->userGroupArray = array($be_user_Array, $be_group_Array, $be_user_Array_o); 00141 return $this->userGroupArray; 00142 } 00143 00151 function dateTimeAge($tstamp, $prefix = 1) { 00152 return t3lib_BEfunc::dateTimeAge($tstamp, $prefix); 00153 } 00154 00161 function accessMod($mod) { 00162 return $this->BE_USER->modAccess(array('name' => $mod, 'access' => 'user,group'), 0); 00163 } 00164 00174 function mkMenuConfig($htmlContent, $label = "", $content = "", $popUpDescription = '') { 00175 $configArr = Array(); 00176 if ((string) $htmlContent) $configArr['icon'] = $htmlContent; 00177 if ((string) $label) $configArr['label'] = $label; 00178 if ((string) $content) $configArr['content'] = $content; 00179 if ((string) $linkTitle) $configArr['linkTitle'] = $linkTitle; 00180 return $configArr; 00181 } 00182 00189 function urlInIframe($url,$max=0) { 00190 return '<iframe onload="resizeIframe(this,'.$max.');" scrolling="auto" width="100%" src="'.$url.'" name="list_frame" frameborder="no" style="border: none;"></iframe>'; 00191 } 00192 00193 00194 } 00195 00196 // Include extension? 00197 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/taskcenter/task/class.mod_user_task.php']) { 00198 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/taskcenter/task/class.mod_user_task.php']); 00199 } 00200 00201 00202 ?>