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
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
00069
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
00134 $be_group_Array = t3lib_BEfunc::getListGroupNames('title,uid');
00135 $groupArray = array_keys($be_group_Array);
00136
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
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 ?>