[TYPO3-core] RFC #11773: Integrate an option to deactivate shortcuts completely

Christopher Stelmaszyk christopher at yahoo.de
Fri Aug 28 11:01:51 CEST 2009


Hi guys,

attached is version 3.

Summarising the changes compared to version 1:
* Use the name Ingo proposed
* Backport the option for the old BE

So in the old BE, you can now also hide the part of the shortcut-frame which 
actually displays the shortcuts.

Cheers

Christopher


Index: typo3/classes/class.shortcutmenu.php
===================================================================
--- typo3/classes/class.shortcutmenu.php	(revision 5837)
+++ typo3/classes/class.shortcutmenu.php	(working copy)
@@ -99,8 +99,10 @@
 	 * @return  boolean  true if user has access, false if not
 	 */
 	public function checkAccess() {
-			// Shortcut module is enabled for everybody
-		return true;
+		if ($GLOBALS['BE_USER']->getTSConfigVal('options.enableShortcuts')) {
+			return true;
+		}
+		return false;
 	}

 	/**
Index: t3lib/class.t3lib_userauthgroup.php
===================================================================
--- t3lib/class.t3lib_userauthgroup.php	(revision 5837)
+++ t3lib/class.t3lib_userauthgroup.php	(working copy)
@@ -656,7 +656,9 @@
 	 * @return	boolean
 	 */
 	function mayMakeShortcut()	{
-		return $this->getTSConfigVal('options.shortcutFrame') && 
!$this->getTSConfigVal('options.mayNotCreateEditShortcuts');
+		return $this->getTSConfigVal('options.enableShortcuts') &&
+			$this->getTSConfigVal('options.shortcutFrame') &&
+			!$this->getTSConfigVal('options.mayNotCreateEditShortcuts');
 	}

 	/**
Index: typo3/alt_shortcut.php
===================================================================
--- typo3/alt_shortcut.php	(revision 5837)
+++ typo3/alt_shortcut.php	(working copy)
@@ -426,8 +426,12 @@
 						-->
 						<table border="0" cellpadding="0" cellspacing="2" 
id="typo3-shortcuts">
 							<tr>
-							'.implode('
-							',$this->lines).$editIdCode.'
+							';
+							if ($GLOBALS['BE_USER']->getTSConfigVal('options.enableShortcuts')) 
{
+								$this->content .= implode('
+								', $this->lines);
+							}
+							$this->content .= $editIdCode . '
 							</tr>
 						</table>
 					</td>
Index: t3lib/config_default.php
===================================================================
--- t3lib/config_default.php	(revision 5837)
+++ t3lib/config_default.php	(working copy)
@@ -202,7 +202,8 @@
 		'forceCharset' => '',					// String. Normally the charset of the backend 
users language selection is used. If you set this value to a charset found 
in t3lib/csconvtbl/ (or "utf-8") the backend (and database) will ALWAYS use 
this charset. Always use a lowercase value.
 		'installToolPassword' => '',			// String. This is the md5-hashed password 
for the Install Tool. Set this to '' and access will be totally denied. 
PLEASE consider to externally password protect the typo3/install/ folder, 
eg. with a .htaccess file.
 		'trackBeUser' => 0,						// Boolean. If set, every invokation of a 
backend script is logged in sys_trackbeuser. This is used to get a view of 
the backend users behaviour. Mostly for debugging, support and user 
interaction analysis. Requires 'beuser_tracking' extension.
- 		'defaultUserTSconfig' => 'options.shortcutFrame=1',			// String. Enter 
lines of default backend user/group TSconfig.
+ 		'defaultUserTSconfig' => 'options.shortcutFrame=1
+			options.enableShortcuts=1',			// String. Enter lines of default backend 
user/group TSconfig.
 		'defaultPageTSconfig' => '',			// Enter lines of default Page TSconfig.
 		'defaultPermissions' => array (			// Default permissions set for new 
pages in t3lib/tce_main.php. Keys are 'show,edit,delete,new,editcontent'. 
Enter as comma-list
 //			'user' => '',						// default in tce_main is 
'show,edit,delete,new,editcontent'. If this is set (uncomment), this value 
is used instead. 


begin 666 11773_enableShortcuts_v3.patch
M26YD97 at Z('1Y<&\S+V-L87-S97,O8VQA<W,N<VAO<G1C=71M96YU+G!H< H]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]"BTM+2!T>7!O,R]C;&%S<V5S+V-L87-S
M+G-H;W)T8W5T;65N=2YP:' )*')E=FES:6]N(#4X,S<I"BLK*R!T>7!O,R]C
M;&%S<V5S+V-L87-S+G-H;W)T8W5T;65N=2YP:' )*'=O<FMI;F<@8V]P>2D*
M0$ @+3DY+#@@*SDY+#$P($! "B )("H at 0')E='5R;B @8F]O;&5A;B @=')U
M92!I9B!U<V5R(&AA<R!A8V-E<W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TM('0S;&EB+V-O;F9I9U]D969A=6QT+G!H< DH<F5V
M:7-I;VX at -3@S-RD**RLK('0S;&EB+V-O;F9I9U]D969A=6QT+G!H< DH=V]R
M:VEN9R!C;W!Y*0I 0" M,C R+#<@*S(P,BPX($! "B )"2=F;W)C94-H87)S
M970G(#T^("<G+ D)"0D)+R\@4W1R:6YG+B!.;W)M86QL>2!T:&4 at 8VAA<G-E
M="!O9B!T:&4 at 8F%C:V5N9"!U<V5R<R!L86YG=6%G92!S96QE8W1I;VX@:7,@
M=7-E9"X at 268@>6]U('-E="!T:&ES('9A;'5E('1O(&$@8VAA<G-E="!F;W5N
M9"!I;B!T,VQI8B]C<V-O;G9T8FPO("AO<B B=71F+3 at B*2!T:&4 at 8F%C:V5N
M9" H86YD(&1A=&%B87-E*2!W:6QL($%,5T%94R!U<V4@=&AI<R!C:&%R<V5T
M+B!!;'=A>7,@=7-E(&$@;&]W97)C87-E('9A;'5E+ at H@"0DG:6YS=&%L;%1O
M;VQ087-S=V]R9"<@/3X@)R<L"0D)+R\@4W1R:6YG+B!4:&ES(&ES('1H92!M
M9#4M:&%S:&5D('!A<W-W;W)D(&9O<B!T:&4 at 26YS=&%L;"!4;V]L+B!3970@
M=&AI<R!T;R G)R!A;F0 at 86-C97-S('=I;&P at 8F4@=&]T86QL>2!D96YI960N
M(%!,14%312!C;VYS:61E<B!T;R!E>'1E<FYA;&QY('!A<W-W;W)D('!R;W1E
M8W0@=&AE('1Y<&\S+VEN<W1A;&PO(&9O;&1E<BP at 96<N('=I=&@@82 N:'1A
M8V-E<W, at 9FEL92X*( D))W1R86-K0F55<V5R)R ]/B P+ D)"0D)"2\O($)O
M;VQE86XN($EF('-E="P at 979E<GD@:6YV;VMA=&EO;B!O9B!A(&)A8VME;F0@
M<V-R:7!T(&ES(&QO9V=E9"!I;B!S>7-?=')A8VMB975S97(N(%1H:7,@:7,@
M=7-E9"!T;R!G970 at 82!V:65W(&]F('1H92!B86-K96YD('5S97)S(&)E:&%V
M:6]U<BX at 36]S=&QY(&9O<B!D96)U9V=I;F<L('-U<'!O<G0 at 86YD('5S97(@
M:6YT97)A8W1I;VX at 86YA;'ES:7,N(%)E<75I<F5S("=B975S97)?=')A8VMI
M;F<G(&5X=&5N<VEO;BX*+2 )"2=D969A=6QT57-E<E138V]N9FEG)R ]/B G
M;W!T:6]N<RYS:&]R=&-U=$9R86UE/3$G+ D)"2\O(%-T<FEN9RX at 16YT97(@
M;&EN97,@;V8 at 9&5F875L="!B86-K96YD('5S97(O9W)O=7 @5%-C;VYF:6<N
M"BL@"0DG9&5F875L=%5S97)44V-O;F9I9R<@/3X@)V]P=&EO;G,N<VAO<G1C
M=71&<F%M93TQ"BL)"0EO<'1I;VYS+F5N86)L95-H;W)T8W5T<STQ)RP)"0DO
M+R!3=')I;F<N($5N=&5R(&QI;F5S(&]F(&1E9F%U;'0 at 8F%C:V5N9"!U<V5R
M+V=R;W5P(%138V]N9FEG+ at H@"0DG9&5F875L=%!A9V544V-O;F9I9R<@/3X@
M)R<L"0D)+R\@16YT97(@;&EN97,@;V8 at 9&5F875L="!086=E(%138V]N9FEG
M+ at H@"0DG9&5F875L=%!E<FUI<W-I;VYS)R ]/B!A<G)A>2 H"0D)+R\@1&5F
M875L="!P97)M:7-S:6]N<R!S970 at 9F]R(&YE=R!P86=E<R!I;B!T,VQI8B]T
M8V5?;6%I;BYP:' N($ME>7, at 87)E("=S:&]W+&5D:70L9&5L971E+&YE=RQE
M9&ET8V]N=&5N="<N($5N=&5R(&%S(&-O;6UA+6QI<W0*("\O"0D))W5S97(G
M(#T^("<G+ D)"0D)"2\O(&1E9F%U;'0@:6X@=&-E7VUA:6X@:7,@)W-H;W<L
M961I="QD96QE=&4L;F5W+&5D:71C;VYT96YT)RX at 268@=&AI<R!I<R!S970@
H*'5N8V]M;65N="DL('1H:7,@=F%L=64@:7,@=7-E9"!I;G-T96%D+@``
`
end



More information about the TYPO3-team-core mailing list