⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 class.tx_sysaction.php

📁 Typo3, 开源里边最强大的
💻 PHP
📖 第 1 页 / 共 2 页
字号:
						}					break;					case 3: //list records						return htmlspecialchars($this->headLInk('tx_taskcenterrootlist', 1)). '<br />'. $this->urlInIframe($this->backPath."db_list.php?id=".intval($actionRow["t3_listPid"])."&table=".$actionRow["t3_tables"],1);					break;					case 4: //edit records						$dbAnalysis = t3lib_div::makeInstance("t3lib_loadDBGroup");						$dbAnalysis->fromTC=0;						$dbAnalysis->start($actionRow["t4_recordsToEdit"],"*");						$dbAnalysis->getFromDB();						$lines=array();						reset($dbAnalysis->itemArray);						while(list(,$el)=each($dbAnalysis->itemArray))	{							$path = t3lib_BEfunc::getRecordPath ($el["id"],$this->perms_clause,$this->BE_USER->uc["titleLen"]);							$lines[]='<tr>								<td nowrap class="bgColor4">'.									'<a href="'.$this->backPath.'alt_doc.php?returnUrl='.rawurlencode(t3lib_div::getIndpEnv("REQUEST_URI")).'&edit['.$el["table"].']['.$el["id"].']=edit">'.									t3lib_iconworks::getIconImage($el["table"],$dbAnalysis->results[$el["table"]][$el["id"]],$this->backPath,'hspace="2" align="top" title="'.htmlspecialchars($path).'"').									t3lib_BEfunc::getRecordTitle($el["table"],$dbAnalysis->results[$el["table"]][$el["id"]],TRUE).'</a></td>								</tr>';						}						$actionContent = '<table border=0 cellpadding=0 cellspacing=2>'.implode("",$lines).'</table>';						$theCode.= $this->pObj->doc->section($LANG->getLL("action_t4_edit"),$actionContent,0,1);					break;					case 5: //new record						return htmlspecialchars($this->headLInk('tx_taskcenterrootlist', 1)). '<br />'. $this->urlInIframe($this->backPath.'alt_doc.php?returnUrl='.rawurlencode('db_list.php?id='.intval($actionRow['t3_listPid']).'&table='.$actionRow['t3_tables']).'&edit['.$actionRow['t3_tables'].']['.intval($actionRow['t3_listPid']).']=new',1);					break;					default:						$theCode.= $this->pObj->doc->section($LANG->getLL("action_error"),'<span class="typo3-red">'.$LANG->getLL("action_noType").'</span>',0,1);					break;				}			}		}		return $theCode;	}	function getActionResPointer($uid=0)	{		if ($this->BE_USER->isAdmin())	{			$wQ='';			if (intval($uid)>0)	$wQ.=' AND sys_action.uid='.intval($uid);			$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_action', 'sys_action.pid=0'.$wQ, '', 'sys_action.sorting');		} else {			$wQ = 'be_groups.uid IN ('.($this->BE_USER->groupList?$this->BE_USER->groupList:0).')';			$hQ = 'AND sys_action.hidden=0 ';			if (intval($uid)>0)	$wQ.=' AND sys_action.uid='.intval($uid);			$res = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(						'sys_action.*',						'sys_action',						'sys_action_asgr_mm',						'be_groups',						' AND '.$wQ.' AND sys_action.pid=0 '.$hQ,						'sys_action.uid',						'sys_action.sorting'					);		}		return $res;	}	function renderActionList()	{		global $LANG;		$res = $this->getActionResPointer();		$lines=array();		while($actionRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))	{			$lines[]='<nobr>'.t3lib_iconworks::getIconImage("sys_action",$actionRow,$this->backPath,'hspace="2" align="top"').$this->action_link($this->fixed_lgd($actionRow["title"]),$actionRow["uid"],$actionRow["description"]).'</nobr><BR>';		}		$out = implode("",$lines);		return $out;	}	function action_link($str,$id,$title="")	{		$str='<a href="index.php?SET[function]=tx_sysaction&sys_action_uid='.$id.'" onClick="this.blur();" title="'.htmlspecialchars($title).'">'.$str.'</a>';		return $str;	}	function action_linkUserName($str,$id,$bid)	{		$str='<a href="index.php?sys_action_uid='.$id.'&be_users_uid='.$bid.'" onClick="this.blur();">'.$str.'</a>';		return $str;	}	function action_t1_createUpdateBeUser($arr,$actionRow=array())	{		reset($arr);		$key = key($arr);		$data="";		$nId=0;		$BEuid = $actionRow["t1_copy_of_user"];		if ($key=="NEW")	{			$beRec = t3lib_BEfunc::getRecord("be_users",intval($BEuid));			if (is_array($beRec) && trim($arr[$key]["password"]) && $this->fixUsername($arr[$key]["username"],$actionRow["t1_userprefix"]))	{//				debug($arr[$key]);				$data=array();				$data["be_users"][$key]=$beRec;				$data["be_users"][$key]["username"]=$this->fixUsername($arr[$key]["username"],$actionRow["t1_userprefix"]);				$data["be_users"][$key]["password"]=md5(trim($arr[$key]["password"]));				$data["be_users"][$key]["realName"]=$arr[$key]["realName"];				$data["be_users"][$key]["email"]=$arr[$key]["email"];				$data["be_users"][$key]["disable"]=intval($arr[$key]["disable"]);				$data["be_users"][$key]["admin"]=0;				$data["be_users"][$key]["usergroup"] = $this->fixUserGroup($data["be_users"][$key]["usergroup"],$actionRow["t1_allowed_groups"],$arr[$key]["usergroups"]);				$data["be_users"][$key]["db_mountpoints"]=$arr[$key]["db_mountpoints"];				$data["be_users"][$key]["createdByAction"]=$actionRow["uid"];			}		} else {			$beRec = t3lib_BEfunc::getRecord("be_users",intval($key));			if (is_array($beRec) && $beRec["cruser_id"]==$this->BE_USER->user["uid"])	{				if (t3lib_div::_GP("_delete_"))	{						// delete... ?					$cmd=array();					$cmd["be_users"][$key]["delete"]=1;					$tce = t3lib_div::makeInstance("t3lib_TCEmain");					$tce->stripslashes_values=0;					$tce->start(Array(),$cmd,$this->BE_USER);					$tce->admin=1;					$tce->process_cmdmap();//					debug($cmd);					$nId = 0;				} elseif ($this->fixUsername($arr[$key]["username"],$actionRow["t1_userprefix"]))	{					// check ownership...					$data=array();					$data["be_users"][$key]["username"]=$this->fixUsername($arr[$key]["username"],$actionRow["t1_userprefix"]);					if (trim($arr[$key]["password"]))	{$data["be_users"][$key]["password"]=md5(trim($arr[$key]["password"]));}					$data["be_users"][$key]["realName"]=$arr[$key]["realName"];					$data["be_users"][$key]["email"]=$arr[$key]["email"];					$data["be_users"][$key]["disable"]=intval($arr[$key]["disable"]);					$data["be_users"][$key]["admin"]=0;					$data["be_users"][$key]["usergroup"] = $this->fixUserGroup($beRec["usergroup"],$actionRow["t1_allowed_groups"],$arr[$key]["usergroups"]);					$data["be_users"][$key]["db_mountpoints"]=$arr[$key]["db_mountpoints"];					$nId=$key;				}			}		}		if (is_array($data))	{			$tce = t3lib_div::makeInstance("t3lib_TCEmain");			$tce->stripslashes_values=0;			$tce->start($data,Array(),$this->BE_USER);			$tce->admin=1;			$tce->process_datamap();			$nId = intval($tce->substNEWwithIDs["NEW"]);			if ($nId)	{	// Create				$this->action_createDir($nId);			} else {	// update				$nId=intval($key);			}			unset($tce);		}		return $nId;	}	function fixUsername($username,$prefix)	{		$username=trim($username);		$prefix=trim($prefix);		$username=ereg_replace("^".quotemeta($prefix),"",$username);		if ($username)	{			return $prefix.$username;		} else return false;	}	function fixUserGroup($curUserGroup,$allowedGroups,$inGroups)	{			// User group:			// All current groups:		$cGroups = array_flip(t3lib_div::trimExplode(",",$curUserGroup,1));		$grList = t3lib_div::intExplode(",",$allowedGroups);		reset($grList);		while(list(,$gu)=each($grList))	{			unset($cGroups[$gu]);	// Remove the group if it's in the array for some reason...		}			// reverse array again and set incoming groups:		$cGroups=array_keys($cGroups);		if (is_array($inGroups))	{			reset($inGroups);			while(list(,$gu)=each($inGroups))	{				$checkGr = t3lib_BEfunc::getRecord("be_groups",$gu);				if (is_array($checkGr) && in_array($gu,$grList))	{					$cGroups[]=$gu;				}			}		}		return implode(",",$cGroups);	}	function action_createDir($uid)	{		$path = $this->action_getUserMainDir();		if ($path)	{			@mkdir($path.$uid,0755);			@mkdir($path.$uid."/_temp_",0755);//			debug($path);		}	}	function action_getUserMainDir()	{		$path = $GLOBALS["TYPO3_CONF_VARS"]["BE"]["userHomePath"];		if ($path && @is_dir($path) &&				$GLOBALS["TYPO3_CONF_VARS"]["BE"]["lockRootPath"] &&				t3lib_div::isFirstPartOfStr($path,$GLOBALS["TYPO3_CONF_VARS"]["BE"]["lockRootPath"]) &&				substr($path,-1)=="/"			)	{			return $path;		}	}}if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/sys_action/class.tx_sysaction.php"])	{	include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/sys_action/class.tx_sysaction.php"]);}?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -