Fixed bug #16252: Apply "bookmarks" naming to UserTS options
authorSteffen Gebert <steffen.gebert@typo3.org>
Sun, 7 Nov 2010 20:34:25 +0000 (20:34 +0000)
committerSteffen Gebert <steffen.gebert@typo3.org>
Sun, 7 Nov 2010 20:34:25 +0000 (20:34 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9303 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_userauthgroup.php
t3lib/config_default.php
typo3/alt_shortcut.php
typo3/backend.php
typo3/classes/class.shortcutmenu.php

index cd1b70e..d80b19c 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2010-11-07  Steffen Gebert  <steffen@steffen-gebert.de>
 
        * Fixed bug #16246: Create class constants for pages.doktype
+       * Fixed bug #16252: Apply "bookmarks" naming to UserTS options
 
 2010-11-07  Stanislas Rolland  <typo3@sjbr.ca>
 
index 798c16a..cb54eff 100644 (file)
@@ -732,8 +732,12 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
         * @return      boolean
         */
        function mayMakeShortcut()      {
-               return $this->getTSConfigVal('options.enableShortcuts') &&
-                       !$this->getTSConfigVal('options.mayNotCreateEditShortcuts');
+                       // "Shortcuts" have been renamed to "Bookmarks"
+                       // @deprecated remove shortcuts code in TYPO3 4.7
+               return  ($this->getTSConfigVal('options.enableShortcuts')
+                               || $this->getTSConfigVal('options.enableBookmarks'))
+                               &&      (!$this->getTSConfigVal('options.mayNotCreateEditShortcuts')
+                               && !$this->getTSConfigVal('options.mayNotCreateEditBookmarks'));
        }
 
        /**
index e1e181c..31f5fc7 100644 (file)
@@ -225,7 +225,7 @@ $TYPO3_CONF_VARS = array(
                'maxFileSize' => '10240',                               // Integer: If set this is the max filesize in KB's for file operations in the backend. Can be overridden through $TCA per table field separately.
                '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.
-               'defaultUserTSconfig' => 'options.enableShortcuts=1
+               'defaultUserTSconfig' => 'options.enableBookmarks=1
                        options.enableShowPalettes=1
                        options.file_list.enableDisplayBigControlPanel=selectable
                        options.file_list.enableDisplayThumbnails=selectable
@@ -651,4 +651,4 @@ $SIM_EXEC_TIME = $EXEC_TIME;                        // $SIM_EXEC_TIME is set to $EXEC_TIME but can be
 $ACCESS_TIME = $EXEC_TIME - ($EXEC_TIME % 60);         // $ACCESS_TIME is a common time in minutes for access control
 $SIM_ACCESS_TIME = $ACCESS_TIME;               // if $SIM_EXEC_TIME is changed this value must be set accordingly
 
-?>
+?>
\ No newline at end of file
index 07cfbad..e19d7d6 100644 (file)
@@ -299,9 +299,18 @@ class SC_alt_shortcut {
                        5 => 1,
                );
 
-               $shortCutGroups = $BE_USER->getTSConfig('options.shortcutGroups');
-               if (is_array($shortCutGroups['properties']) && count($shortCutGroups['properties']))    {
-                       foreach ($shortCutGroups['properties'] as $k=>$v)       {
+                       // "Shortcuts" have been renamed to "Bookmarks"
+                       // @deprecated remove shortcuts code in TYPO3 4.7
+               $shortCutGroups = $BE_USER->getTSConfigProp('options.shortcutGroups');
+               if ($shortCutGroups !== NULL) {
+                       t3lib_div::deprecationLog('options.shortcutGroups - since TYPO3 4.5, will be removed in TYPO3 4.7 - use options.bookmarkGroups instead');
+               }
+               $bookmarkGroups = $BE_USER->getTSConfigProp('options.bookmarkGroups');
+               if ($bookmarkGroups !== NULL) {
+                       $shortCutGroups = $bookmarkGroups;
+               }
+               if (is_array($shortCutGroups) && count($shortCutGroups)) {
+                       foreach ($shortCutGroups as $k=>$v)     {
                                if (strcmp('',$v) && strcmp('0',$v))    {
                                        $this->groupLabels[$k] = (string)$v;
                                } elseif ($BE_USER->isAdmin())  {
@@ -429,9 +438,17 @@ class SC_alt_shortcut {
                                                <table border="0" cellpadding="0" cellspacing="2" id="typo3-shortcuts">
                                                        <tr>
                                                        ';
-                                                       if ($GLOBALS['BE_USER']->getTSConfigVal('options.enableShortcuts')) {
+                                                               // "Shortcuts" have been renamed to "Bookmarks"
+                                                               // @deprecated remove shortcuts code in TYPO3 4.7
+                                                       $useShortcuts = $GLOBALS['BE_USER']->getTSConfigVal('options.enableShortcuts');
+                                                       $useBookmarks = $GLOBALS['BE_USER']->getTSConfigVal('options.enableBookmarks');
+                                                       if ($useShortcuts || $useBookmarks) {
                                                                $this->content .= implode('
                                                                ', $this->lines);
+
+                                                               if ($useShortcuts) {
+                                                                       t3lib_div::deprecationLog('options.enableShortcuts - since TYPO3 4.5, will be removed in TYPO3 4.7 - use options.enableBookmarks instead');
+                                                               }
                                                        }
                                                        $this->content .= $editIdCode . '
                                                        </tr>
@@ -539,10 +556,19 @@ class SC_alt_shortcut {
                        // $this->linesPre contains elements with sc_group>=0
                $this->lines = array_merge($this->linesPre,$this->lines);
 
-               if (count($this->lines))        {
-                       if (!$BE_USER->getTSConfigVal('options.mayNotCreateEditShortcuts'))     {
+               if (count($this->lines)) {
+                               // "Shortcuts" have been renamed to "Bookmarks"
+                               // @deprecated remove shortcuts code in TYPO3 4.7
+                       $createShortcuts = !$BE_USER->getTSConfigVal('options.mayNotCreateEditShortcuts');
+                       $createBookmarks = !$BE_USER->getTSConfigVal('options.mayNotCreateEditBookmarks');
+
+                       if ($createShortcuts || $createBookmarks) {
                                $this->lines=array_merge(array('<td><input type="checkbox" id="editShortcut_check" name="editShortcut_check" value="1"'.($this->editSC?' checked="checked"':'').' /> <label for="editShortcut_check">'.$LANG->getLL('bookmark_edit',1).'</label>&nbsp;</td>'),$this->lines);
                                $this->lines[]='<td>'.$manageForm.'</td>';
+
+                               if ($createShortcuts) {
+                                       t3lib_div::deprecationLog('options.mayNotCreateEditShortcuts - since TYPO3 4.5, will be removed in TYPO3 4.7 - use options.mayNotCreateEditBookmarks instead');
+                               }
                        }
                        $this->lines[]='<td><img src="clear.gif" width="10" height="1" alt="" /></td>';
                }
@@ -593,10 +619,25 @@ class SC_alt_shortcut {
                                        $perms_clause = $BE_USER->getPagePermsClause(1);
                                        $this->editPath = t3lib_BEfunc::getRecordPath($this->theEditRec['pid'], $perms_clause, 30);
 
-                                       if(!$BE_USER->getTSConfigVal('options.shortcut_onEditId_dontSetPageTree')) {
+                                               // "Shortcuts" have been renamed to "Bookmarks"
+                                               // @deprecated remove shortcuts code in TYPO3 4.7
+                                       $shortcutSetPageTree = !$BE_USER->getTSConfigVal('options.shortcut_onEditId_dontSetPageTree');
+                                       $bookmarkSetPageTree = !$BE_USER->getTSConfigVal('options.bookmark_onEditId_dontSetPageTree');
+
+                                       if ($shortcutSetPageTree && $bookmarkSetPageTree) {
+                                               $shortcutKeepExpanded = $BE_USER->getTSConfigVal('options.shortcut_onEditId_keepExistingExpanded');
+                                               $bookmarkKeepExpanded = $BE_USER->getTSConfigVal('options.bookmark_onEditId_keepExistingExpanded');
+                                               $keepNotExpanded = (!$shortcutKeepExpanded || !$bookmarkKeepExpanded);
 
                                                        // Expanding page tree:
-                                               t3lib_BEfunc::openPageTree($this->theEditRec['pid'],!$BE_USER->getTSConfigVal('options.shortcut_onEditId_keepExistingExpanded'));
+                                               t3lib_BEfunc::openPageTree($this->theEditRec['pid'], $keepNotExpanded);
+
+                                               if ($shortcutSetPageTree) {
+                                                       t3lib_div::deprecationLog('options.shortcut_onEditId_dontSetPageTree - since TYPO3 4.5, will be removed in TYPO3 4.7 - use options.bookmark_onEditId_dontSetPageTree instead');
+                                               }
+                                               if ($shortcutKeepExpanded) {
+                                                       t3lib_div::deprecationLog('options.shortcut_onEditId_keepExistingExpanded - since TYPO3 4.5, will be removed in TYPO3 4.7 - use options.bookmark_onEditId_keepExistingExpanded instead');
+                                               }
                                        }
                                }
                        }
index 5ee2ce4..3539451 100644 (file)
@@ -546,11 +546,28 @@ class TYPO3backend {
                // Load page to edit:
        window.setTimeout("top.loadEditId('.intval($editRecord['uid']).');", 500);
                        ';
+
+                                       // "Shortcuts" have been renamed to "Bookmarks"
+                                       // @deprecated remove shortcuts code in TYPO3 4.7
+                               $shortcutSetPageTree = $GLOBALS['BE_USER']->getTSConfigVal('options.shortcut_onEditId_dontSetPageTree');
+                               $bookmarkSetPageTree = $GLOBALS['BE_USER']->getTSConfigVal('options.bookmark_onEditId_dontSetPageTree');
+                               if ($shortcutSetPageTree !== '') {
+                                       t3lib_div::deprecationLog('options.shortcut_onEditId_dontSetPageTree - since TYPO3 4.5, will be removed in TYPO3 4.7 - use options.bookmark_onEditId_dontSetPageTree instead');
+                               }
+
                                        // Checking page edit parameter:
-                               if(!$GLOBALS['BE_USER']->getTSConfigVal('options.shortcut_onEditId_dontSetPageTree')) {
+                               if (!$shortcutSetPageTree && !$bookmarkSetPageTree) {
+
+                                       $shortcutKeepExpanded = $GLOBALS['BE_USER']->getTSConfigVal('options.shortcut_onEditId_keepExistingExpanded');
+                                       $bookmarkKeepExpanded = $GLOBALS['BE_USER']->getTSConfigVal('options.bookmark_onEditId_keepExistingExpanded');
+                                       $keepExpanded = ($shortcutKeepExpanded || $bookmarkKeepExpanded);
 
                                                // Expanding page tree:
-                                       t3lib_BEfunc::openPageTree(intval($editRecord['pid']), !$GLOBALS['BE_USER']->getTSConfigVal('options.shortcut_onEditId_keepExistingExpanded'));
+                                       t3lib_BEfunc::openPageTree(intval($editRecord['pid']), !$keepExpanded);
+
+                                       if ($shortcutKeepExpanded) {
+                                               t3lib_div::deprecationLog('options.shortcut_onEditId_keepExistingExpanded - since TYPO3 4.5, will be removed in TYPO3 4.7 - use options.bookmark_onEditId_keepExistingExpanded instead');
+                                       }
                                }
                        } else {
                                $this->js .= '
index 094bbb1..a69fb1d 100644 (file)
@@ -99,10 +99,15 @@ class ShortcutMenu implements backend_toolbarItem {
         * @return  boolean  true if user has access, false if not
         */
        public function checkAccess() {
-               if ($GLOBALS['BE_USER']->getTSConfigVal('options.enableShortcuts')) {
-                       return true;
+                       // "Shortcuts" have been renamed to "Bookmarks"
+                       // @deprecated remove shortcuts code in TYPO3 4.7
+               $useShortcuts = $GLOBALS['BE_USER']->getTSConfigVal('options.enableShortcuts');
+               if ($useShortcuts !== NULL) {
+                       t3lib_div::deprecationLog('options.enableShortcuts - since TYPO3 4.5, will be removed in TYPO3 4.7 - use options.enableBookmarks instead');
+                       return (bool) $useShortcuts;
                }
-               return false;
+
+               return (bool) $GLOBALS['BE_USER']->getTSConfigVal('options.enableBookmarks');
        }
 
        /**
@@ -383,10 +388,19 @@ class ShortcutMenu implements backend_toolbarItem {
         */
        protected function initShortcutGroups($params = array(), TYPO3AJAX &$ajaxObj = null) {
                        // groups from TSConfig
-               $userShortcutGroups = $GLOBALS['BE_USER']->getTSConfig('options.shortcutGroups');
+                       // "Shortcuts" have been renamed to "Bookmarks"
+                       // @deprecated remove shortcuts code in TYPO3 4.7
+               $userShortcutGroups = $GLOBALS['BE_USER']->getTSConfigProp('options.shortcutGroups');
+               if ($userShortcutGroups) {
+                       t3lib_div::deprecationLog('options.shortcutGroups - since TYPO3 4.5, will be removed in TYPO3 4.7 - use options.bookmarkGroups instead');
+               }
+               $bookmarkGroups = $GLOBALS['BE_USER']->getTSConfigProp('options.bookmarkGroups');
+               if ($bookmarkGroups !== NULL) {
+                       $userShortcutGroups = $bookmarkGroups;
+               }
 
-               if(is_array($userShortcutGroups['properties']) && count($userShortcutGroups['properties'])) {
-                       foreach($userShortcutGroups['properties'] as $groupId => $label) {
+               if(is_array($userShortcutGroups) && count($userShortcutGroups)) {
+                       foreach($userShortcutGroups as $groupId => $label) {
                                if(strcmp('', $label) && strcmp('0', $label)) {
                                        $this->shortcutGroups[$groupId] = (string) $label;
                                } elseif($GLOBALS['BE_USER']->isAdmin()) {