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

SC_move_el Class Reference

List of all members.

Public Member Functions

 init ()
 Constructor, initializing internal variables.
 main ()
 Creating the module output.
 printContent ()
 Print out the accumulated content:.

Public Attributes

 $sys_language = 0
 $page_id
 $table
 $R_URI
 $input_moveUid
 $moveUid
 $makeCopy
 $doc
 $perms_clause
 $content

Member Function Documentation

SC_move_el::init  ) 
 

Constructor, initializing internal variables.

Returns:
void

Definition at line 250 of file move_el.php.

References table().

00250                      {
00251       global $BE_USER,$LANG,$BACK_PATH;
00252 
00253 
00254          // Setting internal vars:
00255       $this->sys_language = intval(t3lib_div::_GP('sys_language'));
00256       $this->page_id=intval(t3lib_div::_GP('uid'));
00257       $this->table=t3lib_div::_GP('table');
00258       $this->R_URI=t3lib_div::_GP('returnUrl');
00259       $this->input_moveUid = t3lib_div::_GP('moveUid');
00260       $this->moveUid = $this->input_moveUid ? $this->input_moveUid : $this->page_id;
00261       $this->makeCopy = t3lib_div::_GP('makeCopy');
00262 
00263          // Select-pages where clause for read-access:
00264       $this->perms_clause = $BE_USER->getPagePermsClause(1);
00265 
00266          // Starting the document template object:
00267       $this->doc = t3lib_div::makeInstance('mediumDoc');
00268       $this->doc->docType= 'xhtml_trans';
00269       $this->doc->backPath = $BACK_PATH;
00270       $this->doc->JScode='';
00271 
00272          // Starting document content (header):
00273       $this->content='';
00274       $this->content.=$this->doc->startPage($LANG->getLL('movingElement'));
00275       $this->content.=$this->doc->header($LANG->getLL('movingElement'));
00276       $this->content.=$this->doc->spacer(5);
00277    }

SC_move_el::main  ) 
 

Creating the module output.

Returns:
void

Definition at line 284 of file move_el.php.

References $LANG, t3lib_BEfunc::cshItem(), t3lib_iconWorks::getIconImage(), t3lib_BEfunc::getModTSconfig(), t3lib_BEfunc::getRecord(), t3lib_BEfunc::getRecordTitle(), t3lib_BEfunc::readPageAccess(), and table().

00284                      {
00285       global $LANG,$BACK_PATH,$BE_USER;
00286 
00287       if ($this->page_id)  {
00288 
00289             // Get record for element:
00290          $elRow = t3lib_BEfunc::getRecord($this->table,$this->moveUid);
00291 
00292             // Headerline: Icon, record title:
00293          $hline = t3lib_iconWorks::getIconImage($this->table,$elRow,$BACK_PATH,' id="c-recIcon" title="'.htmlspecialchars(t3lib_BEfunc::getRecordIconAltText($elRow,$this->table)).'"');
00294          $hline.= t3lib_BEfunc::getRecordTitle($this->table,$elRow,1);
00295 
00296             // Make-copy checkbox (clicking this will reload the page with the GET var makeCopy set differently):
00297          $onClick = 'document.location=\''.t3lib_div::linkThisScript(array('makeCopy'=>!$this->makeCopy)).'\';';
00298          $hline.= '<br /><input type="hidden" name="makeCopy" value="0" /><input type="checkbox" name="makeCopy" value="1"'.($this->makeCopy?' checked="checked"':'').' onclick="'.htmlspecialchars($onClick).'" />'.
00299             $LANG->getLL('makeCopy',1);
00300 
00301             // Add the header-content to the module content:
00302          $this->content.=$this->doc->section($LANG->getLL('moveElement').':',$hline,0,1);
00303          $this->content.=$this->doc->spacer(20);
00304 
00305             // Reset variable to pick up the module content in:
00306          $code='';
00307 
00308             // IF the table is "pages":
00309          if ((string)$this->table=='pages')  {
00310                // Get page record (if accessible):
00311             $pageinfo = t3lib_BEfunc::readPageAccess($this->page_id,$this->perms_clause);
00312             if (is_array($pageinfo) && $BE_USER->isInWebMount($pageinfo['pid'],$this->perms_clause))  {
00313 
00314                   // Initialize the position map:
00315                $posMap = t3lib_div::makeInstance('ext_posMap_pages');
00316                $posMap->moveOrCopy = $this->makeCopy?'copy':'move';
00317 
00318                   // Print a "go-up" link IF there is a real parent page (and if the user has read-access to that page).
00319                if ($pageinfo['pid'])   {
00320                   $pidPageInfo = t3lib_BEfunc::readPageAccess($pageinfo['pid'],$this->perms_clause);
00321                   if (is_array($pidPageInfo))   {
00322                      if ($BE_USER->isInWebMount($pidPageInfo['pid'],$this->perms_clause)) {
00323                         $code.= '<a href="'.htmlspecialchars(t3lib_div::linkThisScript(array('uid'=>intval($pageinfo['pid']),'moveUid'=>$this->moveUid))).'">'.
00324                            '<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/i/pages_up.gif','width="18" height="16"').' alt="" />'.
00325                            t3lib_BEfunc::getRecordTitle('pages',$pidPageInfo,1).
00326                            '</a><br />';
00327                      } else {
00328                         $code.= t3lib_iconWorks::getIconImage('pages',$pidPageInfo,$BACK_PATH,'').
00329                            t3lib_BEfunc::getRecordTitle('pages',$pidPageInfo,1).
00330                            '<br />';
00331                      }
00332                   }
00333                }
00334 
00335                   // Create the position tree:
00336                $code.= $posMap->positionTree($this->page_id,$pageinfo,$this->perms_clause,$this->R_URI);
00337 
00338                   // CSH for move-pages:
00339                $code.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'move_el_pages', $GLOBALS['BACK_PATH'],'<br/>|');
00340             }
00341          }
00342 
00343             // IF the table is "tt_content":
00344          if ((string)$this->table=='tt_content')   {
00345 
00346                // First, get the record:
00347             $tt_content_rec = t3lib_BEfunc::getRecord('tt_content',$this->moveUid);
00348 
00349                // ?
00350             if (!$this->input_moveUid) $this->page_id = $tt_content_rec['pid'];
00351 
00352                // Checking if the parent page is readable:
00353             $pageinfo = t3lib_BEfunc::readPageAccess($this->page_id,$this->perms_clause);
00354             if (is_array($pageinfo) && $BE_USER->isInWebMount($pageinfo['pid'],$this->perms_clause))  {
00355 
00356                   // Initialize the position map:
00357                $posMap = t3lib_div::makeInstance('ext_posMap_tt_content');
00358                $posMap->moveOrCopy = $this->makeCopy?'copy':'move';
00359                $posMap->cur_sys_language = $this->sys_language;
00360 
00361                   // Headerline for the parent page: Icon, record title:
00362                $hline = t3lib_iconWorks::getIconImage('pages',$pageinfo,$BACK_PATH,' title="'.htmlspecialchars(t3lib_BEfunc::getRecordIconAltText($pageinfo,'pages')).'"');
00363                $hline.= t3lib_BEfunc::getRecordTitle('pages',$pageinfo,1);
00364 
00365                   // Load SHARED page-TSconfig settings and retrieve column list from there, if applicable:
00366                $modTSconfig_SHARED = t3lib_BEfunc::getModTSconfig($this->page_id,'mod.SHARED');    // SHARED page-TSconfig settings.
00367                $colPosList = strcmp(trim($modTSconfig_SHARED['properties']['colPos_list']),'') ? trim($modTSconfig_SHARED['properties']['colPos_list']) : '1,0,2,3';
00368                $colPosList = implode(',',array_unique(t3lib_div::intExplode(',',$colPosList)));    // Removing duplicates, if any
00369 
00370                   // Adding parent page-header and the content element columns from position-map:
00371                $code=$hline.'<br />';
00372                $code.=$posMap->printContentElementColumns($this->page_id,$this->moveUid,$colPosList,1,$this->R_URI);
00373 
00374                   // Print a "go-up" link IF there is a real parent page (and if the user has read-access to that page).
00375                $code.= '<br />';
00376                $code.= '<br />';
00377                if ($pageinfo['pid'])   {
00378                   $pidPageInfo = t3lib_BEfunc::readPageAccess($pageinfo['pid'],$this->perms_clause);
00379                   if (is_array($pidPageInfo))   {
00380                      if ($BE_USER->isInWebMount($pidPageInfo['pid'],$this->perms_clause)) {
00381                         $code.= '<a href="'.htmlspecialchars(t3lib_div::linkThisScript(array('uid'=>intval($pageinfo['pid']),'moveUid'=>$this->moveUid))).'">'.
00382                            '<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/i/pages_up.gif','width="18" height="16"').' alt="" />'.
00383                            t3lib_BEfunc::getRecordTitle('pages',$pidPageInfo,1).
00384                            '</a><br />';
00385                      } else {
00386                         $code.= t3lib_iconWorks::getIconImage('pages',$pidPageInfo,$BACK_PATH,'').
00387                            t3lib_BEfunc::getRecordTitle('pages',$pidPageInfo,1).
00388                            '<br />';
00389                      }
00390                   }
00391                }
00392 
00393                   // Create the position tree (for pages):
00394                $code.= $posMap->positionTree($this->page_id,$pageinfo,$this->perms_clause,$this->R_URI);
00395 
00396                   // CSH for move-content-elements:
00397                $code.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'move_el_cs', $GLOBALS['BACK_PATH'],'<br/>|');
00398             }
00399          }
00400 
00401             // IF a return-url is given, print the go-back link:
00402          if ($this->R_URI) {
00403             $code.='<br /><br /><a href="'.htmlspecialchars($this->R_URI).'" class="typo3-goBack"><img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/goback.gif','width="14" height="14"').' alt="" />'.$LANG->getLL('goBack',1).'</a>';
00404          }
00405 
00406             // Add the $code content as a new section to the module:
00407          $this->content.=$this->doc->section($LANG->getLL('selectPositionOfElement').':',$code,0,1);
00408       }
00409    }

SC_move_el::printContent  ) 
 

Print out the accumulated content:.

Returns:
void

Definition at line 416 of file move_el.php.

00416                            {
00417       global $SOBE;
00418 
00419       $this->content.= $this->doc->endPage();
00420       echo $this->content;
00421    }


Member Data Documentation

SC_move_el::$content
 

Definition at line 242 of file move_el.php.

SC_move_el::$doc
 

Definition at line 238 of file move_el.php.

SC_move_el::$input_moveUid
 

Definition at line 234 of file move_el.php.

SC_move_el::$makeCopy
 

Definition at line 236 of file move_el.php.

SC_move_el::$moveUid
 

Definition at line 235 of file move_el.php.

SC_move_el::$page_id
 

Definition at line 231 of file move_el.php.

SC_move_el::$perms_clause
 

Definition at line 239 of file move_el.php.

SC_move_el::$R_URI
 

Definition at line 233 of file move_el.php.

SC_move_el::$sys_language = 0
 

Definition at line 230 of file move_el.php.

SC_move_el::$table
 

Definition at line 232 of file move_el.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