More workspace stuff for beta.
[Packages/TYPO3.CMS.git] / typo3 / sysext / viewpage / view / index.php
index 982e706..e66b8f6 100755 (executable)
  */
 
 unset($MCONF);
-require ("conf.php");
-require ($BACK_PATH."init.php");
-//require ($BACK_PATH."template.php");
-require_once (PATH_t3lib."class.t3lib_page.php");
+require ('conf.php');
+require ($BACK_PATH.'init.php');
+//require ($BACK_PATH.'template.php');
+require_once (PATH_t3lib.'class.t3lib_page.php');
 $BE_USER->modAccess($MCONF,1);
 
 
@@ -73,60 +73,65 @@ class SC_mod_web_view_index {
        var $pageinfo;
        var $url;
        var $id;
+       var $wsInstruction='';
 
        /**
-        * @return      [type]          ...
+        * Initialization of module
+        *
+        * @return      void
         */
        function init() {
-               global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
-               $this->MCONF = $GLOBALS["MCONF"];
-               $this->id = intval(t3lib_div::_GP("id"));
+               global $BE_USER;
+
+               $this->MCONF = $GLOBALS['MCONF'];
+               $this->id = intval(t3lib_div::_GP('id'));
 
                $this->perms_clause = $BE_USER->getPagePermsClause(1);
 
                        // page/be_user TSconfig settings and blinding of menu-items
-               $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id,"mod.".$this->MCONF["name"]);
-               $this->type = intval($this->modTSconfig["properties"]["type"]);
+               $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id,'mod.'.$this->MCONF['name']);
+               $this->type = intval($this->modTSconfig['properties']['type']);
        }
 
        /**
-        * [Describe function...]
+        * Main function
         *
-        * @return      [type]          ...
+        * @return      void
         */
        function main() {
                global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
-               // Access check...
-               // The page will show only if there is a valid page and if this page may be viewed by the user
+
+                       // Access check...
+                       // The page will show only if there is a valid page and if this page may be viewed by the user
                $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
                $access = is_array($this->pageinfo) ? 1 : 0;
-               $addCmd="";
+               $addCmd='';
                if ($this->id && $access)       {
-                       $addCmd = "&ADMCMD_view=1&ADMCMD_editIcons=1".t3lib_BEfunc::ADMCMD_previewCmds($this->pageinfo);
+                       $addCmd = '&ADMCMD_view=1&ADMCMD_editIcons=1'.t3lib_BEfunc::ADMCMD_previewCmds($this->pageinfo);
                }
 
-               $parts = parse_url(t3lib_div::getIndpEnv("TYPO3_SITE_URL"));
-               $dName = t3lib_BEfunc::getDomainStartPage($parts["host"],$parts["path"]) ?
+               $parts = parse_url(t3lib_div::getIndpEnv('TYPO3_SITE_URL'));
+               $dName = t3lib_BEfunc::getDomainStartPage($parts['host'],$parts['path']) ?
                                                t3lib_BEfunc::firstDomainRecord(t3lib_BEfunc::BEgetRootLine($this->id)):
-                                               "";
+                                               '';
 
-               $this->url.= ($dName?(t3lib_div::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://').$dName:$BACK_PATH."..")."/index.php?id=".$this->id.($this->type?"&type=".$this->type:"").$addCmd;
+               $this->url.= ($dName?(t3lib_div::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://').$dName:$BACK_PATH.'..').'/index.php?id='.$this->id.($this->type?'&type='.$this->type:'').$addCmd;
                //debug($this->url);
        }
 
        /**
-        * [Describe function...]
+        * Redirect URL
         *
-        * @return      [type]          ...
+        * @return      void
         */
        function printContent() {
-               Header("Location: ".t3lib_div::locationHeaderUrl($this->url));
+               Header('Location: '.t3lib_div::locationHeaderUrl($this->url));
        }
 }
 
 // Include extension?
-if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/viewpage/view/index.php"])    {
-       include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/viewpage/view/index.php"]);
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/viewpage/view/index.php'])    {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/viewpage/view/index.php']);
 }
 
 
@@ -141,7 +146,7 @@ if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/viewpag
 
 
 // Make instance:
-$SOBE = t3lib_div::makeInstance("SC_mod_web_view_index");
+$SOBE = t3lib_div::makeInstance('SC_mod_web_view_index');
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();