Main Page | Directories | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages | Examples

tx_extrapagecmoptions Class Reference

List of all members.

Public Member Functions

 main (&$backRef, $menuItems, $table, $uid)
 Adding various standard options to the context menu.
 includeLL ()
 Include local lang file.

Member Function Documentation

tx_extrapagecmoptions::includeLL  ) 
 

Include local lang file.

Returns:
array Local lang array.

Definition at line 159 of file class.tx_extrapagecmoptions.php.

References $LANG, and $LOCAL_LANG.

Referenced by main().

00159                         {
00160       global $LANG;
00161 
00162       $LOCAL_LANG = $LANG->includeLLFile('EXT:extra_page_cm_options/locallang.php',FALSE);
00163       return $LOCAL_LANG;
00164    }

tx_extrapagecmoptions::main &$  backRef,
menuItems,
table,
uid
 

Adding various standard options to the context menu.

This includes both first and second level.

Parameters:
object The calling object. Value by reference.
array Array with the currently collected menu items to show.
string Table name of clicked item.
integer UID of clicked item.
Returns:
array Modified $menuItems array

Definition at line 79 of file class.tx_extrapagecmoptions.php.

References $TCA, includeLL(), spacer(), and table().

00079                                                    {
00080       global $BE_USER,$TCA,$LANG;
00081 
00082       $localItems = array();  // Accumulation of local items.
00083       $subname = t3lib_div::_GP('subname');
00084 
00085          // Detecting menu level
00086       if (!$backRef->cmLevel) {  // LEVEL: Primary menu.
00087 
00088             // Creating menu items here:
00089          if ($backRef->editOK)   {
00090             $LL = $this->includeLL();
00091 
00092             $localItems[]='spacer';
00093             $localItems['moreoptions']=$backRef->linkItem(
00094                $GLOBALS['LANG']->makeEntities($LANG->getLLL('label',$LL)),
00095                $backRef->excludeIcon(''),
00096                "top.loadTopMenu('".t3lib_div::linkThisScript()."&cmLevel=1&subname=moreoptions');return false;",
00097                0,
00098                1
00099             );
00100 
00101             if (!in_array('hide',$backRef->disabledItems) && is_array($TCA[$table]['ctrl']['enablecolumns']) && $TCA[$table]['ctrl']['enablecolumns']['disabled'])
00102                   $localItems['hide'] = $backRef->DB_hideUnhide($table,$backRef->rec,$TCA[$table]['ctrl']['enablecolumns']['disabled']);
00103             if (!in_array('edit_access',$backRef->disabledItems) && is_array($TCA[$table]['ctrl']['enablecolumns']))
00104                   $localItems['edit_access'] = $backRef->DB_editAccess($table,$uid);
00105             if (!in_array('edit_pageheader',$backRef->disabledItems) && $table=='pages' && $backRef->editPageIconSet)
00106                   $localItems['edit_pageheader'] = $backRef->DB_editPageHeader($uid);
00107          }
00108 
00109             // Find delete element among the input menu items and insert the local items just before that:
00110          reset($menuItems);
00111          $c=0;
00112          $deleteFound = FALSE;
00113          while(list($k)=each($menuItems)) {
00114             $c++;
00115             if (!strcmp($k,'delete'))  {
00116                $deleteFound = TRUE;
00117                break;
00118             }
00119          }
00120 
00121          if ($deleteFound) {
00122                // .. subtract two... (delete item + its spacer element...)
00123             $c-=2;
00124                // and insert the items just before the delete element.
00125             array_splice(
00126                $menuItems,
00127                $c,
00128                0,
00129                $localItems
00130             );
00131          } else { // If no delete item was found, then just merge in the items:
00132             $menuItems=array_merge($menuItems,$localItems);
00133          }
00134       } elseif ($subname==='moreoptions') {  // LEVEL: Secondary level of menus (activated by an item on the first level).
00135          if ($backRef->editOK)   {  // If the page can be edited, then show this:
00136             if (!in_array('move_wizard',$backRef->disabledItems) && ($table=='pages' || $table=='tt_content')) $localItems['move_wizard']=$backRef->DB_moveWizard($table,$uid,$backRef->rec);
00137             if (!in_array('new_wizard',$backRef->disabledItems) && ($table=='pages' || $table=='tt_content'))  $localItems['new_wizard']=$backRef->DB_newWizard($table,$uid,$backRef->rec);
00138             if (!in_array('history',$backRef->disabledItems))  $localItems['history']=$backRef->DB_history($table,$uid);
00139             if (!in_array('perms',$backRef->disabledItems) && $table=='pages' && $BE_USER->check('modules','web_perm')) $localItems['perms']=$backRef->DB_perms($table,$uid,$backRef->rec);
00140             if (!in_array('db_list',$backRef->disabledItems) && $BE_USER->check('modules','web_list'))   $localItems['db_list']=$backRef->DB_db_list($table,$uid,$backRef->rec);
00141          }
00142 
00143             // Temporary mount point item:
00144          if ($table=='pages') {
00145             $localItems['perms'] = $backRef->DB_tempMountPoint($uid);
00146          }
00147 
00148             // Merge the locally made items into the current menu items passed to this function.
00149          $menuItems = array_merge($menuItems,$localItems);
00150       }
00151       return $menuItems;
00152    }


The documentation for this class was generated from the following file:
Generated on Sun Oct 3 01:07:51 2004 for TYPO3core 3.7.0 dev by  doxygen 1.3.8-20040913