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

SC_mod_web_perm_index Class Reference

List of all members.

Public Member Functions

 init ()
 Initialization of the class.
 menuConfig ()
 Configuration of the menu and initialization of ->MOD_SETTINGS.
 main ()
 Main function, creating the content for the access editing forms/listings.
 printContent ()
 Outputting the accumulated content to screen.
 doEdit ()
 Creating form for editing the permissions ($this->edit = true) (Adding content to internal content variable).
 notEdit ()
 Showing the permissions in a tree ($this->edit = false) (Adding content to internal content variable).
 printCheckBox ($checkName, $num)
 Print a checkbox for the edit-permission form.
 printPerms ($int)
 Print a set of permissions.
 groupPerms ($row, $firstGroup)
 Returns the permissions for a group based of the perms_groupid of $row.
 getRecursiveSelect ($id, $perms_clause)
 Finding tree and offer setting of values recursively.

Public Attributes

 $getLevels = 10
 $MCONF = array()
 $doc
 $content
 $MOD_MENU = array()
 $MOD_SETTINGS = array()
 $perms_clause
 $pageinfo
 $color
 $color2
 $color3
 $editingAllowed
 $id
 $edit
 $return_id
 $lastEdited

Member Function Documentation

SC_mod_web_perm_index::doEdit  ) 
 

Creating form for editing the permissions ($this->edit = true) (Adding content to internal content variable).

Returns:
void

Definition at line 317 of file index.php.

References t3lib_BEfunc::blindGroupNames(), t3lib_BEfunc::blindUserNames(), t3lib_BEfunc::cshItem(), t3lib_BEfunc::getGroupNames(), t3lib_BEfunc::getListGroupNames(), t3lib_BEfunc::getUserNames(), and table().

00317                      {
00318       global $BE_USER,$LANG;
00319 
00320          // Get usernames and groupnames
00321       $be_group_Array=t3lib_BEfunc::getListGroupNames('title,uid');
00322       $groupArray=array_keys($be_group_Array);
00323 
00324       $be_user_Array = t3lib_BEfunc::getUserNames();
00325       if (!$GLOBALS['BE_USER']->isAdmin())      $be_user_Array = t3lib_BEfunc::blindUserNames($be_user_Array,$groupArray,1);
00326       $be_group_Array_o = $be_group_Array = t3lib_BEfunc::getGroupNames();
00327       if (!$GLOBALS['BE_USER']->isAdmin())      $be_group_Array = t3lib_BEfunc::blindGroupNames($be_group_Array_o,$groupArray,1);
00328       $firstGroup = $groupArray[0] ? $be_group_Array[$groupArray[0]] : ''; // data of the first group, the user is member of
00329 
00330 
00331          // Owner selector:
00332       $options='';
00333       $userset=0; // flag: is set if the page-userid equals one from the user-list
00334       foreach($be_user_Array as $uid => $row)   {
00335          if ($uid==$this->pageinfo['perms_userid'])   {
00336             $userset = 1;
00337             $selected=' selected="selected"';
00338          } else {$selected='';}
00339          $options.='
00340             <option value="'.$uid.'"'.$selected.'>'.htmlspecialchars($row['username']).'</option>';
00341       }
00342       $options='
00343             <option value="0"></option>'.$options;
00344       $selector='
00345          <select name="data[pages]['.$this->id.'][perms_userid]">
00346             '.$options.'
00347          </select>';
00348 
00349       $this->content.=$this->doc->section($LANG->getLL('Owner').':',$selector);
00350 
00351 
00352          // Group selector:
00353       $options='';
00354       $userset=0;
00355       foreach($be_group_Array as $uid => $row)  {
00356          if ($uid==$this->pageinfo['perms_groupid'])  {
00357             $userset = 1;
00358             $selected=' selected="selected"';
00359          } else {$selected='';}
00360          $options.='
00361             <option value="'.$uid.'"'.$selected.'>'.htmlspecialchars($row['title']).'</option>';
00362       }
00363       if (!$userset && $this->pageinfo['perms_groupid']) {  // If the group was not set AND there is a group for the page
00364          $options='
00365             <option value="'.$this->pageinfo['perms_groupid'].'" selected="selected">'.
00366                   htmlspecialchars($be_group_Array_o[$this->pageinfo['perms_groupid']]['title']).
00367                   '</option>'.
00368                   $options;
00369       }
00370       $options='
00371             <option value="0"></option>'.$options;
00372       $selector='
00373          <select name="data[pages]['.$this->id.'][perms_groupid]">
00374             '.$options.'
00375          </select>';
00376 
00377       $this->content.=$this->doc->divider(5);
00378       $this->content.=$this->doc->section($LANG->getLL('Group').':',$selector);
00379 
00380          // Permissions checkbox matrix:
00381       $code='
00382          <table border="0" cellspacing="2" cellpadding="0" id="typo3-permissionMatrix">
00383             <tr>
00384                <td></td>
00385                <td class="bgColor2">'.str_replace(' ','<br />',$LANG->getLL('1',1)).'</td>
00386                <td class="bgColor2">'.str_replace(' ','<br />',$LANG->getLL('16',1)).'</td>
00387                <td class="bgColor2">'.str_replace(' ','<br />',$LANG->getLL('2',1)).'</td>
00388                <td class="bgColor2">'.str_replace(' ','<br />',$LANG->getLL('4',1)).'</td>
00389                <td class="bgColor2">'.str_replace(' ','<br />',$LANG->getLL('8',1)).'</td>
00390             </tr>
00391             <tr>
00392                <td align="right" class="bgColor2">'.$LANG->getLL('Owner',1).'</td>
00393                <td class="bgColor-20">'.$this->printCheckBox('perms_user',1).'</td>
00394                <td class="bgColor-20">'.$this->printCheckBox('perms_user',5).'</td>
00395                <td class="bgColor-20">'.$this->printCheckBox('perms_user',2).'</td>
00396                <td class="bgColor-20">'.$this->printCheckBox('perms_user',3).'</td>
00397                <td class="bgColor-20">'.$this->printCheckBox('perms_user',4).'</td>
00398             </tr>
00399             <tr>
00400                <td align="right" class="bgColor2">'.$LANG->getLL('Group',1).'</td>
00401                <td class="bgColor-20">'.$this->printCheckBox('perms_group',1).'</td>
00402                <td class="bgColor-20">'.$this->printCheckBox('perms_group',5).'</td>
00403                <td class="bgColor-20">'.$this->printCheckBox('perms_group',2).'</td>
00404                <td class="bgColor-20">'.$this->printCheckBox('perms_group',3).'</td>
00405                <td class="bgColor-20">'.$this->printCheckBox('perms_group',4).'</td>
00406             </tr>
00407             <tr>
00408                <td align="right" class="bgColor2">'.$LANG->getLL('Everybody',1).'</td>
00409                <td class="bgColor-20">'.$this->printCheckBox('perms_everybody',1).'</td>
00410                <td class="bgColor-20">'.$this->printCheckBox('perms_everybody',5).'</td>
00411                <td class="bgColor-20">'.$this->printCheckBox('perms_everybody',2).'</td>
00412                <td class="bgColor-20">'.$this->printCheckBox('perms_everybody',3).'</td>
00413                <td class="bgColor-20">'.$this->printCheckBox('perms_everybody',4).'</td>
00414             </tr>
00415          </table>
00416          <br />
00417 
00418          <input type="hidden" name="data[pages]['.$this->id.'][perms_user]" value="'.$this->pageinfo['perms_user'].'" />
00419          <input type="hidden" name="data[pages]['.$this->id.'][perms_group]" value="'.$this->pageinfo['perms_group'].'" />
00420          <input type="hidden" name="data[pages]['.$this->id.'][perms_everybody]" value="'.$this->pageinfo['perms_everybody'].'" />
00421          '.$this->getRecursiveSelect($this->id,$this->perms_clause).'
00422          <input type="submit" name="submit" value="'.$LANG->getLL('Save',1).'" />'.
00423          '<input type="submit" value="'.$LANG->getLL('Abort',1).'" onclick="'.htmlspecialchars('jumpToUrl(\'index.php?id='.$this->id.'\'); return false;').'" />
00424          <input type="hidden" name="redirect" value="'.htmlspecialchars(TYPO3_MOD_PATH.'index.php?mode='.$this->MOD_SETTINGS['mode'].'&depth='.$this->MOD_SETTINGS['depth'].'&id='.intval($this->return_id).'&lastEdited='.$this->id).'" />
00425       ';
00426 
00427          // Adding section with the permission setting matrix:
00428       $this->content.=$this->doc->divider(5);
00429       $this->content.=$this->doc->section($LANG->getLL('permissions').':',$code);
00430 
00431          // CSH for permissions setting
00432       $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'perm_module_setting', $GLOBALS['BACK_PATH'],'<br/><br/>');
00433 
00434          // Adding help text:
00435       if ($BE_USER->uc['helpText']) {
00436          $this->content.=$this->doc->divider(20);
00437          $legendText = '<b>'.$LANG->getLL('1',1).'</b>: '.$LANG->getLL('1_t',1);
00438          $legendText.= '<br /><b>'.$LANG->getLL('16',1).'</b>: '.$LANG->getLL('16_t',1);
00439          $legendText.= '<br /><b>'.$LANG->getLL('2',1).'</b>: '.$LANG->getLL('2_t',1);
00440          $legendText.= '<br /><b>'.$LANG->getLL('4',1).'</b>: '.$LANG->getLL('4_t',1);
00441          $legendText.= '<br /><b>'.$LANG->getLL('8',1).'</b>: '.$LANG->getLL('8_t',1);
00442 
00443          $code=$legendText.'<br /><br />'.$LANG->getLL('def',1);
00444          $this->content.=$this->doc->section($LANG->getLL('Legend',1).':',$code);
00445       }
00446    }

SC_mod_web_perm_index::getRecursiveSelect id,
perms_clause
 

Finding tree and offer setting of values recursively.

Parameters:
integer Page id.
string Select clause
Returns:
string Select form element for recursive levels (if any levels are found)

Definition at line 693 of file index.php.

References $a.

00693                                                    {
00694 
00695          // Initialize tree object:
00696       $tree = t3lib_div::makeInstance('t3lib_pageTree');
00697       $tree->init('AND '.$perms_clause);
00698       $tree->addField('perms_userid',1);
00699       $tree->makeHTML=0;
00700       $tree->setRecs = 1;
00701 
00702          // Make tree:
00703       $tree->getTree($id,$this->getLevels,'');
00704 
00705          // If there are a hierarchy of page ids, then...
00706       if ($GLOBALS['BE_USER']->user['uid'] && count($tree->ids_hierarchy)) {
00707 
00708             // Init:
00709          $label_recur = $GLOBALS['LANG']->getLL('recursive');
00710          $label_levels = $GLOBALS['LANG']->getLL('levels');
00711          $label_pA = $GLOBALS['LANG']->getLL('pages_affected');
00712          $theIdListArr=array();
00713          $opts='
00714                   <option value=""></option>';
00715 
00716             // Traverse the number of levels we want to allow recursive setting of permissions for:
00717          for ($a=$this->getLevels;$a>0;$a--) {
00718             if (is_array($tree->ids_hierarchy[$a]))   {
00719                foreach($tree->ids_hierarchy[$a] as $theId)  {
00720                   if ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->user['uid']==$tree->recs[$theId]['perms_userid'])   {
00721                      $theIdListArr[]=$theId;
00722                   }
00723                }
00724                $lKey = $this->getLevels-$a+1;
00725                $opts.='
00726                   <option value="'.htmlspecialchars(implode(',',$theIdListArr)).'">'.
00727                      t3lib_div::deHSCentities(htmlspecialchars($label_recur.' '.$lKey.' '.$label_levels)).' ('.count($theIdListArr).' '.$label_pA.')'.
00728                      '</option>';
00729             }
00730          }
00731 
00732             // Put the selector box together:
00733          $theRecursiveSelect = '<br />
00734                <select name="mirror[pages]['.$id.']">
00735                   '.$opts.'
00736                </select>
00737 
00738             <br /><br />';
00739       } else {
00740          $theRecursiveSelect = '';
00741       }
00742 
00743          // Return selector box element:
00744       return $theRecursiveSelect;
00745    }

SC_mod_web_perm_index::groupPerms row,
firstGroup
 

Returns the permissions for a group based of the perms_groupid of $row.

If the $row[perms_groupid] equals the $firstGroup[uid] then the function returns perms_everybody OR'ed with perms_group, else just perms_everybody

Parameters:
array Row array (from pages table)
array First group data
Returns:
integer Integer: Combined permissions.

Definition at line 676 of file index.php.

References $out.

00676                                           {
00677       if (is_array($row))  {
00678          $out=intval($row['perms_everybody']);
00679          if ($row['perms_groupid'] && $firstGroup['uid']==$row['perms_groupid']) {
00680             $out|= intval($row['perms_group']);
00681          }
00682          return $out;
00683       }
00684    }

SC_mod_web_perm_index::init  ) 
 

Initialization of the class.

Returns:
void

Definition at line 123 of file index.php.

00123                      {
00124       global $BE_USER,$BACK_PATH;
00125 
00126          // Setting GPvars:
00127       $this->id = intval(t3lib_div::_GP('id'));
00128       $this->edit = t3lib_div::_GP('edit');
00129       $this->return_id = t3lib_div::_GP('return_id');
00130       $this->lastEdited = t3lib_div::_GP('lastEdited');
00131 
00132          // Module name;
00133       $this->MCONF = $GLOBALS['MCONF'];
00134 
00135          // Page select clause:
00136       $this->perms_clause = $BE_USER->getPagePermsClause(1);
00137 
00138          // Initializing document template object:
00139       $this->doc = t3lib_div::makeInstance('mediumDoc');
00140       $this->doc->backPath = $BACK_PATH;
00141       $this->doc->docType = 'xhtml_trans';
00142       $this->doc->form='<form action="'.$BACK_PATH.'tce_db.php" method="post" name="editform">';
00143       $this->doc->JScode = '<script type="text/javascript" src="'.$BACK_PATH.'t3lib/jsfunc.updateform.js"></script>';
00144       $this->doc->JScode.= $this->doc->wrapScriptTags('
00145          function checkChange(checknames, varname) {  //
00146             var res = 0;
00147             for (var a=1; a<=5; a++)   {
00148                if (document.editform[checknames+"["+a+"]"].checked)  {
00149                   res|=Math.pow(2,a-1);
00150                }
00151             }
00152             document.editform[varname].value = res | (checknames=="check[perms_user]"?1:0) ;
00153             setCheck (checknames,varname);
00154          }
00155          function setCheck(checknames, varname) {  //
00156             if (document.editform[varname])  {
00157                var res = document.editform[varname].value;
00158                for (var a=1; a<=5; a++)   {
00159                   document.editform[checknames+"["+a+"]"].checked = (res & Math.pow(2,a-1));
00160                }
00161             }
00162          }
00163          function jumpToUrl(URL) {  //
00164             document.location = URL;
00165          }
00166       ');
00167 
00168          // Setting up the context sensitive menu:
00169       $CMparts=$this->doc->getContextMenuCode();
00170       $this->doc->bodyTagAdditions = $CMparts[1];
00171       $this->doc->JScode.=$CMparts[0];
00172       $this->doc->postCode.= $CMparts[2];
00173 
00174          // Set up menus:
00175       $this->menuConfig();
00176    }

SC_mod_web_perm_index::main  ) 
 

Main function, creating the content for the access editing forms/listings.

Returns:
void

Definition at line 214 of file index.php.

References $LANG, t3lib_BEfunc::getFuncMenu(), and t3lib_BEfunc::readPageAccess().

00214                      {
00215       global $BE_USER,$LANG;
00216 
00217          // Access check...
00218          // The page will show only if there is a valid page and if this page may be viewed by the user
00219       $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
00220       $access = is_array($this->pageinfo) ? 1 : 0;
00221 
00222          // Checking access:
00223       if (($this->id && $access) || ($BE_USER->user['admin'] && !$this->id))  {
00224          if ($BE_USER->user['admin'] && !$this->id)   {
00225             $this->pageinfo=array('title' => '[root-level]','uid'=>0,'pid'=>0);
00226          }
00227 
00228             // This decides if the editform can and will be drawn:
00229          $this->editingAllowed = ($this->pageinfo['perms_userid']==$BE_USER->user['uid'] || $BE_USER->isAdmin());
00230          $this->edit = $this->edit && $this->editingAllowed;
00231 
00232             // If $this->edit then these functions are called in the end of the page...
00233          if ($this->edit)  {
00234             $this->doc->postCode.= $this->doc->wrapScriptTags('
00235                setCheck("check[perms_user]","data[pages]['.$this->id.'][perms_user]");
00236                setCheck("check[perms_group]","data[pages]['.$this->id.'][perms_group]");
00237                setCheck("check[perms_everybody]","data[pages]['.$this->id.'][perms_everybody]");
00238             ');
00239          }
00240 
00241             // Draw the HTML page header.
00242          $this->content.=$this->doc->startPage($LANG->getLL('permissions'));
00243          $this->content.=$this->doc->header($LANG->getLL('permissions').($this->edit?': '.$LANG->getLL('Edit'):''));
00244          $this->content.=$this->doc->spacer(5);
00245          $this->content.=$this->doc->section('',
00246             $this->doc->funcMenu(
00247                $this->doc->getHeader('pages',$this->pageinfo,htmlspecialchars($this->pageinfo['_thePath'])).'<br />'.
00248                   $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.path',1).': '.
00249                   '<span title="'.htmlspecialchars($this->pageinfo['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_cs($this->pageinfo['_thePath'],-50)).'</span>',
00250                t3lib_BEfunc::getFuncMenu($this->id,'SET[mode]',$this->MOD_SETTINGS['mode'],$this->MOD_MENU['mode'])
00251             ));
00252          $this->content.=$this->doc->divider(5);
00253 
00254 
00255 
00256          $vContent = $this->doc->getVersionSelector($this->id,1);
00257          if ($vContent) {
00258             $this->content.=$this->doc->section('',$vContent);
00259          }
00260 
00261 
00262 
00263             // Main function, branching out:
00264          if (!$this->edit) {
00265             $this->notEdit();
00266          } else {
00267             $this->doEdit();
00268          }
00269 
00270             // ShortCut
00271          if ($BE_USER->mayMakeShortcut()) {
00272             $this->content.=
00273                $this->doc->spacer(20).
00274                $this->doc->section('',$this->doc->makeShortcutIcon('id,edit,return_id',implode(',',array_keys($this->MOD_MENU)),$this->MCONF['name']));
00275          }
00276       } else {
00277             // If no access or if ID == zero
00278          $this->content.=$this->doc->startPage($LANG->getLL('permissions'));
00279          $this->content.=$this->doc->header($LANG->getLL('permissions'));
00280       }
00281 
00282          // Ending page:
00283       $this->content.=$this->doc->endPage();
00284    }

SC_mod_web_perm_index::menuConfig  ) 
 

Configuration of the menu and initialization of ->MOD_SETTINGS.

Returns:
void

Definition at line 183 of file index.php.

References $LANG, and t3lib_BEfunc::getModuleData().

00183                            {
00184       global $LANG;
00185 
00186          // MENU-ITEMS:
00187          // If array, then it's a selector box menu
00188          // If empty string it's just a variable, that'll be saved.
00189          // Values NOT in this array will not be saved in the settings-array for the module.
00190       $temp = $LANG->getLL('levels');
00191       $this->MOD_MENU = array(
00192          'depth' => array(
00193             1 => '1 '.$temp,
00194             2 => '2 '.$temp,
00195             3 => '3 '.$temp,
00196             4 => '4 '.$temp,
00197             10 => '10 '.$temp
00198          ),
00199          'mode' => array(
00200             0 => $LANG->getLL('user_overview'),
00201             'perms' => $LANG->getLL('permissions')
00202          )
00203       );
00204 
00205          // Clean up settings:
00206       $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']);
00207    }

SC_mod_web_perm_index::notEdit  ) 
 

Showing the permissions in a tree ($this->edit = false) (Adding content to internal content variable).

Returns:
void

Definition at line 454 of file index.php.

References $cells, $LANG, t3lib_BEfunc::blindGroupNames(), t3lib_BEfunc::blindUserNames(), t3lib_BEfunc::cshItem(), t3lib_BEfunc::getFuncMenu(), t3lib_BEfunc::getGroupNames(), t3lib_iconWorks::getIconImage(), t3lib_BEfunc::getUserNames(), and table().

00454                         {
00455       global $BE_USER,$LANG,$BACK_PATH;
00456 
00457          // Get usernames and groupnames: The arrays we get in return contains only 1) users which are members of the groups of the current user, 2) groups that the current user is member of
00458       $groupArray = $BE_USER->userGroupsUID;
00459       $be_user_Array = t3lib_BEfunc::getUserNames();
00460       if (!$GLOBALS['BE_USER']->isAdmin())      $be_user_Array = t3lib_BEfunc::blindUserNames($be_user_Array,$groupArray,0);
00461       $be_group_Array = t3lib_BEfunc::getGroupNames();
00462       if (!$GLOBALS['BE_USER']->isAdmin())      $be_group_Array = t3lib_BEfunc::blindGroupNames($be_group_Array,$groupArray,0);
00463 
00464          // Length of strings:
00465       $tLen= ($this->MOD_SETTINGS['mode']=='perms' ? 20 : 30);
00466 
00467 
00468          // Selector for depth:
00469       $code.=$LANG->getLL('Depth').': ';
00470       $code.=t3lib_BEfunc::getFuncMenu($this->id,'SET[depth]',$this->MOD_SETTINGS['depth'],$this->MOD_MENU['depth']);
00471       $this->content.=$this->doc->section('',$code);
00472       $this->content.=$this->doc->spacer(5);
00473 
00474          // Initialize tree object:
00475       $tree = t3lib_div::makeInstance('t3lib_pageTree');
00476       $tree->init('AND '.$this->perms_clause);
00477 
00478       $tree->addField('perms_user',1);
00479       $tree->addField('perms_group',1);
00480       $tree->addField('perms_everybody',1);
00481       $tree->addField('perms_userid',1);
00482       $tree->addField('perms_groupid',1);
00483       $tree->addField('hidden');
00484       $tree->addField('fe_group');
00485       $tree->addField('starttime');
00486       $tree->addField('endtime');
00487       $tree->addField('editlock');
00488 
00489          // Creating top icon; the current page
00490       $HTML=t3lib_iconWorks::getIconImage('pages',$this->pageinfo,$BACK_PATH,'align="top"');
00491       $tree->tree[]=Array('row'=>$this->pageinfo,'HTML'=>$HTML);
00492 
00493          // Create the tree from $this->id:
00494       $tree->getTree($this->id,$this->MOD_SETTINGS['depth'],'');
00495 
00496          // Make header of table:
00497       $code='';
00498       if ($this->MOD_SETTINGS['mode']=='perms') {
00499          $code.='
00500             <tr>
00501                <td class="bgColor2" colspan="2">&nbsp;</td>
00502                <td class="bgColor2"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
00503                <td class="bgColor2" align="center"><b>'.$LANG->getLL('Owner',1).'</b></td>
00504                <td class="bgColor2"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
00505                <td class="bgColor2" align="center"><b>'.$LANG->getLL('Group',1).'</b></td>
00506                <td class="bgColor2"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
00507                <td class="bgColor2" align="center"><b>'.$LANG->getLL('Everybody',1).'</b></td>
00508                <td class="bgColor2"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
00509                <td class="bgColor2" align="center"><b>'.$LANG->getLL('EditLock',1).'</b></td>
00510             </tr>
00511          ';
00512       } else {
00513          $code.='
00514             <tr>
00515                <td class="bgColor2" colspan="2">&nbsp;</td>
00516                <td class="bgColor2"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
00517                <td class="bgColor2" align="center" nowrap="nowrap"><b>'.$LANG->getLL('User',1).':</b> '.$BE_USER->user['username'].'</td>
00518                '.(!$BE_USER->isAdmin()?'<td class="bgColor2"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
00519                <td class="bgColor2" align="center"><b>'.$LANG->getLL('EditLock',1).'</b></td>':'').'
00520             </tr>';
00521       }
00522 
00523          // Traverse tree:
00524       foreach($tree->tree as $data) {
00525          $cells = array();
00526 
00527             // Background colors:
00528          if ($this->lastEdited==$data['row']['uid'])  {$bgCol = ' class="bgColor-20"';} else {$bgCol = '';}
00529          $lE_bgCol = $bgCol;
00530 
00531             // User/Group names:
00532          $userN = $be_user_Array[$data['row']['perms_userid']] ? $be_user_Array[$data['row']['perms_userid']]['username'] : ($data['row']['perms_userid'] ? '<i>['.$data['row']['perms_userid'].']!</i>' : '');
00533          $groupN = $be_group_Array[$data['row']['perms_groupid']] ? $be_group_Array[$data['row']['perms_groupid']]['title']  : ($data['row']['perms_groupid'] ? '<i>['.$data['row']['perms_groupid'].']!</i>' : '');
00534          $groupN = t3lib_div::fixed_lgd_cs($groupN,20);
00535 
00536             // Seeing if editing of permissions are allowed for that page:
00537          $editPermsAllowed=($data['row']['perms_userid']==$BE_USER->user['uid'] || $BE_USER->isAdmin());
00538 
00539             // First column:
00540          $cells[]='
00541                <td align="left" nowrap="nowrap"'.$bgCol.'>'.$data['HTML'].htmlspecialchars(t3lib_div::fixed_lgd($data['row']['title'],$tLen)).'&nbsp;</td>';
00542 
00543             // "Edit permissions" -icon
00544          if ($editPermsAllowed && $data['row']['uid'])   {
00545             $aHref = 'index.php?mode='.$this->MOD_SETTINGS['mode'].'&depth='.$this->MOD_SETTINGS['depth'].'&id='.$data['row']['uid'].'&return_id='.$this->id.'&edit=1';
00546             $cells[]='
00547                <td'.$bgCol.'><a href="'.htmlspecialchars($aHref).'"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/edit2.gif','width="11" height="12"').' border="0" title="'.$LANG->getLL('ch_permissions',1).'" align="top" alt="" /></a></td>';
00548          } else {
00549             $cells[]='
00550                <td'.$bgCol.'></td>';
00551          }
00552 
00553             // Rest of columns (depending on mode)
00554          if ($this->MOD_SETTINGS['mode']=='perms') {
00555             $cells[]='
00556                <td'.$bgCol.'><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
00557                <td'.$bgCol.' nowrap="nowrap">'.($data['row']['uid']?$this->printPerms($data['row']['perms_user']).' '.$userN:'').'</td>
00558 
00559                <td'.$bgCol.'><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
00560                <td'.$bgCol.' nowrap="nowrap">'.($data['row']['uid']?$this->printPerms($data['row']['perms_group']).' '.$groupN:'').'</td>
00561 
00562                <td'.$bgCol.'><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
00563                <td'.$bgCol.' nowrap="nowrap">'.($data['row']['uid']?' '.$this->printPerms($data['row']['perms_everybody']):'').'</td>
00564 
00565                <td'.$bgCol.'><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
00566                <td'.$bgCol.' nowrap="nowrap">'.($data['row']['editlock']?'<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/recordlock_warning2.gif','width="22" height="16"').' title="'.$LANG->getLL('EditLock_descr',1).'" alt="" />':'').'</td>
00567             ';
00568          } else {
00569             $cells[]='
00570                <td'.$bgCol.'><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>';
00571 
00572             if ($BE_USER->user['uid']==$data['row']['perms_userid']) {$bgCol = ' class="bgColor-20"';} else {$bgCol = $lE_bgCol;}
00573             $cells[]='
00574                <td'.$bgCol.' nowrap="nowrap" align="center">'.($data['row']['uid']?$owner.$this->printPerms($BE_USER->calcPerms($data['row'])):'').'</td>
00575                '.(!$BE_USER->isAdmin()?'
00576                <td'.$bgCol.'><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
00577                <td'.$bgCol.' nowrap="nowrap">'.($data['row']['editlock']?'<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/recordlock_warning2.gif','width="22" height="16"').' title="'.$LANG->getLL('EditLock_descr',1).'" alt="" />':'').'</td>
00578                ':'');
00579             $bgCol = $lE_bgCol;
00580          }
00581 
00582             // Compile table row:
00583          $code.='
00584             <tr>
00585                '.implode('
00586                ',$cells).'
00587             </tr>';
00588       }
00589 
00590          // Wrap rows in table tags:
00591       $code='<table border="0" cellspacing="0" cellpadding="0" id="typo3-permissionList">'.$code.'</table>';
00592 
00593          // Adding the content as a section:
00594       $this->content.=$this->doc->section('',$code);
00595 
00596          // CSH for permissions setting
00597       $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'perm_module', $GLOBALS['BACK_PATH'],'<br/>|');
00598 
00599          // Creating legend table:
00600       $legendText = '<b>'.$LANG->getLL('1',1).'</b>: '.$LANG->getLL('1_t',1);
00601       $legendText.= '<br /><b>'.$LANG->getLL('16',1).'</b>: '.$LANG->getLL('16_t',1);
00602       $legendText.= '<br /><b>'.$LANG->getLL('2',1).'</b>: '.$LANG->getLL('2_t',1);
00603       $legendText.= '<br /><b>'.$LANG->getLL('4',1).'</b>: '.$LANG->getLL('4_t',1);
00604       $legendText.= '<br /><b>'.$LANG->getLL('8',1).'</b>: '.$LANG->getLL('8_t',1);
00605 
00606       $code='<table border="0" id="typo3-legendTable">
00607          <tr>
00608             <td valign="top"><img src="legend.gif" width="86" height="75" alt="" /></td>
00609             <td valign="top" nowrap="nowrap">'.$legendText.'</td>
00610          </tr>
00611       </table>';
00612       $code.='<br />'.$LANG->getLL('def',1);
00613       $code.='<br /><br /><span class="perm-allowed">*</span>: '.$LANG->getLL('A_Granted',1);
00614       $code.='<br /><span class="perm-denied">x</span>: '.$LANG->getLL('A_Denied',1);
00615 
00616          // Adding section with legend code:
00617       $this->content.=$this->doc->spacer(20);
00618       $this->content.=$this->doc->section($LANG->getLL('Legend').':',$code,0,1);
00619    }

SC_mod_web_perm_index::printCheckBox checkName,
num
 

Print a checkbox for the edit-permission form.

Parameters:
string Checkbox name key
integer Checkbox number index
Returns:
string HTML checkbox

Definition at line 647 of file index.php.

00647                                              {
00648       $onClick = 'checkChange(\'check['.$checkName.']\', \'data[pages]['.$GLOBALS['SOBE']->id.']['.$checkName.']\')';
00649       return '<input type="checkbox" name="check['.$checkName.']['.$num.']" onclick="'.htmlspecialchars($onClick).'" /><br />';
00650    }

SC_mod_web_perm_index::printContent  ) 
 

Outputting the accumulated content to screen.

Returns:
void

Definition at line 291 of file index.php.

00291                            {
00292 
00293       echo $this->content;
00294    }

SC_mod_web_perm_index::printPerms int  ) 
 

Print a set of permissions.

Parameters:
integer Permission integer (bits)
Returns:
string HTML marked up x/* indications.

Definition at line 658 of file index.php.

00658                               {
00659       $str='';
00660       $str.= (($int&1)?'*':'<span class="perm-denied">x</span>');
00661       $str.= (($int&16)?'*':'<span class="perm-denied">x</span>');
00662       $str.= (($int&2)?'*':'<span class="perm-denied">x</span>');
00663       $str.= (($int&4)?'*':'<span class="perm-denied">x</span>');
00664       $str.= (($int&8)?'*':'<span class="perm-denied">x</span>');
00665 
00666       return '<span class="perm-allowed">'.$str.'</span>';
00667    }


Member Data Documentation

SC_mod_web_perm_index::$color
 

Definition at line 105 of file index.php.

SC_mod_web_perm_index::$color2
 

Definition at line 106 of file index.php.

SC_mod_web_perm_index::$color3
 

Definition at line 107 of file index.php.

SC_mod_web_perm_index::$content
 

Definition at line 97 of file index.php.

SC_mod_web_perm_index::$doc
 

Definition at line 96 of file index.php.

SC_mod_web_perm_index::$edit
 

Definition at line 113 of file index.php.

SC_mod_web_perm_index::$editingAllowed
 

Definition at line 109 of file index.php.

SC_mod_web_perm_index::$getLevels = 10
 

Definition at line 92 of file index.php.

SC_mod_web_perm_index::$id
 

Definition at line 112 of file index.php.

SC_mod_web_perm_index::$lastEdited
 

Definition at line 115 of file index.php.

SC_mod_web_perm_index::$MCONF = array()
 

Definition at line 95 of file index.php.

SC_mod_web_perm_index::$MOD_MENU = array()
 

Definition at line 99 of file index.php.

SC_mod_web_perm_index::$MOD_SETTINGS = array()
 

Definition at line 100 of file index.php.

SC_mod_web_perm_index::$pageinfo
 

Definition at line 103 of file index.php.

SC_mod_web_perm_index::$perms_clause
 

Definition at line 102 of file index.php.

SC_mod_web_perm_index::$return_id
 

Definition at line 114 of file index.php.


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