37. File Comparison Report

Produced on Wed Jun 18 08:01:42 2008 UTC. This report uses XHTML and CSS2, and is best viewed with a reasonably standards compliant browser such as the latest version of Firefox or Internet Explorer. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

37.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.1.1\inc\classes BxDolPageViewAdmin.php Sun May 11 13:17:00 2008 UTC
2 Dolphin-v.6.1.2\inc\classes BxDolPageViewAdmin.php Mon May 26 10:15:41 2008 UTC

37.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 1662
Changed 1 2
Inserted 0 0
Removed 0 0

37.3 Comparison options

Whitespace All differences in whitespace within lines are ignored
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

37.4 Active regular expressions

No regular expressions were active.

37.5 Comparison detail

1   <?   1   <?
2     2  
3   require_on ce( BX_DIR ECTORY_PAT H_ROOT . ' plugins/Se rvices_JSO N.php' );   3   require_on ce( BX_DIR ECTORY_PAT H_ROOT . ' plugins/Se rvices_JSO N.php' );
4     4  
5   class BxDo lPageViewA dmin {   5   class BxDo lPageViewA dmin {
6       var $a Pages = ar ray();   6       var $a Pages = ar ray();
7       var $o Page;   7       var $o Page;
8       var $s Page_db; / /name of c urrent pag e, used fo rm databas e manipula tions   8       var $s Page_db; / /name of c urrent pag e, used fo rm databas e manipula tions
9       var $s DBTable; / /used data base table   9       var $s DBTable; / /used data base table
10       var $b AjaxMode =  false;   10       var $b AjaxMode =  false;
11       var $a Aliases =  array(   11       var $a Aliases =  array(
12           'i ndex' => ' Homepage',   12           'i ndex' => ' Homepage',
13           'm usic' => ' Shared Mus ic',   13           'm usic' => ' Shared Mus ic',
14           'v ideo' => ' Shared Vid eo',   14           'v ideo' => ' Shared Vid eo',
15           'p hoto' => ' Shared Pho to',   15           'p hoto' => ' Shared Pho to',
16           'a ds'   => ' Classified s',   16           'a ds'   => ' Classified s',
17           'm ember' =>  'Account',   17           'm ember' =>  'Account',
18           'p rofile' =>  'Profile'   18           'p rofile' =>  'Profile'
19       );   19       );
20          20       
21          21       
22       functi on BxDolPa geViewAdmi n( $sDBTab le, $sCach eFile ) {   22       functi on BxDolPa geViewAdmi n( $sDBTab le, $sCach eFile ) {
23           $t his -> sDB Table = $s DBTable;   23           $t his -> sDB Table = $s DBTable;
24           $t his -> sCa cheFile =  $sCacheFil e;   24           $t his -> sCa cheFile =  $sCacheFil e;
25              25           
26           $s Page = pro cess_pass_ data( isse t( $_REQUE ST['Page']  ) ? trim(  $_REQUEST ['Page'] )  : '' );   26           $s Page = pro cess_pass_ data( isse t( $_REQUE ST['Page']  ) ? trim(  $_REQUEST ['Page'] )  : '' );
27              27           
28           $t his -> get Pages();   28           $t his -> get Pages();
29              29           
30           if ( strlen($ sPage) )   30           if ( strlen($ sPage) )
31                /* @var  $this->oPa ge BxDolPV APage */   31                /* @var  $this->oPa ge BxDolPV APage */
32                $this ->  oPage = n ew BxDolPV APage( $sP age, $this  );   32                $this ->  oPage = n ew BxDolPV APage( $sP age, $this  );
33              33           
34           $t his -> che ckAjaxMode ();   34           $t his -> che ckAjaxMode ();
35              35           
36           if ( $this ->  bAjaxMode  and $this  -> oPage  ) {   36           if ( $this ->  bAjaxMode  and $this  -> oPage  ) {
37                $this ->  sPage_db  = addslash es( $this  -> oPage - > sName );   37                $this ->  sPage_db  = addslash es( $this  -> oPage - > sName );
38                   38                
39                switch(  $_REQUEST[ 'action']  ) {   39                switch(  $_REQUEST[ 'action']  ) {
40                    case  'load':   40                    case  'load':
41                         header( 'C ontent-typ e:text/jav ascript' ) ;   41                         header( 'C ontent-typ e:text/jav ascript' ) ;
42                         send_heade rs_page_ch anged();   42                         send_heade rs_page_ch anged();
43                         echo $this  -> oPage  -> getJSON ();   43                         echo $this  -> oPage  -> getJSON ();
44                    brea k;   44                    brea k;
45                       45                    
46                    case  'saveCols Widths':   46                    case  'saveCols Widths':
47                         if( is_arr ay( $_POST ['widths']  ) ) {   47                         if( is_arr ay( $_POST ['widths']  ) ) {
48                             $this  -> saveCol sWidths( $ _POST['wid ths'] );   48                             $this  -> saveCol sWidths( $ _POST['wid ths'] );
49                             $this  -> createC ache();   49                             $this  -> createC ache();
50                         }   50                         }
51                    brea k;   51                    brea k;
52                       52                    
53                    case  'saveBloc ks':   53                    case  'saveBloc ks':
54                         if( is_arr ay( $_POST ['columns' ] ) ) {   54                         if( is_arr ay( $_POST ['columns' ] ) ) {
55                             $this  -> saveBlo cks( $_POS T['columns '] );   55                             $this  -> saveBlo cks( $_POS T['columns '] );
56                             $this  -> createC ache();   56                             $this  -> createC ache();
57                         }   57                         }
58                    brea k;   58                    brea k;
59                       59                    
60                    case  'loadEdit Form':   60                    case  'loadEdit Form':
61                         if( $iBloc kID = (int )$_POST['i d'] )   61                         if( $iBloc kID = (int )$_POST['i d'] )
62                             $this  -> showPro pForm( $iB lockID );   62                             $this  -> showPro pForm( $iB lockID );
63                    brea k;   63                    brea k;
64                       64                    
65                    case  'saveItem ':   65                    case  'saveItem ':
66                         if( (int)$ _POST['id' ] ) {   66                         if( (int)$ _POST['id' ] ) {
67                             $this  -> saveIte m( $_POST  );   67                             $this  -> saveIte m( $_POST  );
68                             $this  -> createC ache();   68                             $this  -> createC ache();
69                         }   69                         }
70                    brea k;   70                    brea k;
71                       71                    
72                    case  'deleteBl ock':   72                    case  'deleteBl ock':
73                         if( $iBloc kID = (int )$_REQUEST ['id'] ) {   73                         if( $iBloc kID = (int )$_REQUEST ['id'] ) {
74                             $this  -> deleteB lock( $iBl ockID );   74                             $this  -> deleteB lock( $iBl ockID );
75                             $this  -> createC ache();   75                             $this  -> createC ache();
76                         }   76                         }
77                    brea k;   77                    brea k;
78                       78                    
79                    case  'checkNew Block':   79                    case  'checkNew Block':
80                         if( $iBloc kID = (int )$_REQUEST ['id'] )   80                         if( $iBloc kID = (int )$_REQUEST ['id'] )
81                             $this  -> checkNe wBlock( $i BlockID );   81                             $this  -> checkNe wBlock( $i BlockID );
82                    brea k;   82                    brea k;
83                       83                    
84                    case  'savePage Width':   84                    case  'savePage Width':
85                         if( $sPage Width = pr ocess_pass _data( $_P OST['width '] ) ) {   85                         if( $sPage Width = pr ocess_pass _data( $_P OST['width '] ) ) {
86                             $this  -> savePag eWidth( $s PageWidth  );   86                             $this  -> savePag eWidth( $s PageWidth  );
87                             $this  -> createC ache();   87                             $this  -> createC ache();
88                                88                             
89                             if( $t his -> oPa ge -> sNam e == 'inde x' ) {   89                             if( $t his -> oPa ge -> sNam e == 'inde x' ) {
90                                 if ( $sPageWi dth == '10 0%' )   90                                 if ( $sPageWi dth == '10 0%' )
91                                      setParam ( 'promoWi dth', '960 ' );   91                                      setParam ( 'promoWi dth', '960 ' );
92                                 el se   92                                 el se
93                                      setParam ( 'promoWi dth', (int )$sPageWid th );   93                                      setParam ( 'promoWi dth', (int )$sPageWid th );
94                                    94                                 
95                                 Re sizeAllPro mos();   95                                 Re sizeAllPro mos();
96                             }   96                             }
97                         }   97                         }
98                    brea k;   98                    brea k;
99                       99                    
100                    case  'saveOthe rPagesWidt h':   100                    case  'saveOthe rPagesWidt h':
101                         if( $sWidt h = $_REQU EST['width '] ) {   101                         if( $sWidt h = $_REQU EST['width '] ) {
102                             setPar am( 'main_ div_width' , $sWidth  );   102                             setPar am( 'main_ div_width' , $sWidth  );
103                             echo ' OK';   103                             echo ' OK';
104                         }   104                         }
105                    brea k;   105                    brea k;
106                       106                    
107                    case  'resetPag e':   107                    case  'resetPag e':
108                         $this -> r esetPage() ;   108                         $this -> r esetPage() ;
109                         $this -> c reateCache ();   109                         $this -> c reateCache ();
110                    brea k;   110                    brea k;
111                }   111                }
112                   112                
113                exit;   113                exit;
114           }  else {   114           }  else {
115                $this ->  showMainP age();   115                $this ->  showMainP age();
116           }   116           }
117       }   117       }
118          118       
119       functi on savePag eWidth( $s PageWidth  ) {   119       functi on savePag eWidth( $s PageWidth  ) {
120           $s PageWidth  = addslash es( $sPage Width );   120           $s PageWidth  = addslash es( $sPage Width );
121           $s Query = "U PDATE `{$t his -> sDB Table}` SE T `PageWid th` = '$sP ageWidth'  WHERE `Pag e` = '{$th is -> sPag e_db}'";   121           $s Query = "U PDATE `{$t his -> sDB Table}` SE T `PageWid th` = '$sP ageWidth'  WHERE `Pag e` = '{$th is -> sPag e_db}'";
122           db _res( $sQu ery );   122           db _res( $sQu ery );
123              123           
124           ec ho 'OK';   124           ec ho 'OK';
125       }   125       }
126          126       
127       functi on createC ache() {   127       functi on createC ache() {
128           $o Cacher = n ew BxDolPa geViewCach er( $this  -> sDBTabl e, $this - > sCacheFi le );   128           $o Cacher = n ew BxDolPa geViewCach er( $this  -> sDBTabl e, $this - > sCacheFi le );
129           $o Cacher ->  createCach e();   129           $o Cacher ->  createCach e();
130       }   130       }
131     131  
132          132       
133       functi on checkNe wBlock( $i BlockID )  {   133       functi on checkNe wBlock( $i BlockID )  {
134           $s Query = "S ELECT `Des c`, `Capti on`, `Func `, `Conten t`, `Visib le` FROM ` {$this ->  sDBTable}`  WHERE `ID ` = $iBloc kID";   134           $s Query = "S ELECT `Des c`, `Capti on`, `Func `, `Conten t`, `Visib le` FROM ` {$this ->  sDBTable}`  WHERE `ID ` = $iBloc kID";
135           $a Block = db _assoc_arr ( $sQuery  );   135           $a Block = db _assoc_arr ( $sQuery  );
136              136           
137           if ( $aBlock[ 'Func'] ==  'Sample'  ) {   137           if ( $aBlock[ 'Func'] ==  'Sample'  ) {
138                $sQuery  = "   138                $sQuery  = "
139                    INSE RT INTO `{ $this -> s DBTable}`  SET   139                    INSE RT INTO `{ $this -> s DBTable}`  SET
140                         `Desc`     = '" . add slashes( $ aBlock['De sc']    )  . "',   140                         `Desc`     = '" . add slashes( $ aBlock['De sc']    )  . "',
141                         `Caption`  = '" . add slashes( $ aBlock['Ca ption'] )  . "',   141                         `Caption`  = '" . add slashes( $ aBlock['Ca ption'] )  . "',
142                         `Func`     = '{$aBloc k['Content ']}',   142                         `Func`     = '{$aBloc k['Content ']}',
143                         `Visible`  = '{$aBloc k['Visible ']}',   143                         `Visible`  = '{$aBloc k['Visible ']}',
144                         `Page`     = '{$this  -> sPage_d b}'   144                         `Page`     = '{$this  -> sPage_d b}'
145                    ";   145                    ";
146                db_res(  $sQuery );   146                db_res(  $sQuery );
147                   147                
148                echo mys ql_insert_ id();   148                echo mys ql_insert_ id();
149                   149                
150                $this ->  createCac he();   150                $this ->  createCac he();
151           }   151           }
152       }   152       }
153          153       
154       functi on deleteB lock( $iBl ockID ) {   154       functi on deleteB lock( $iBl ockID ) {
155           $s Query = "D ELETE FROM  `{$this - > sDBTable }` WHERE ` Page` = '{ $this -> s Page_db}'  AND `ID` =  $iBlockID ";   155           $s Query = "D ELETE FROM  `{$this - > sDBTable }` WHERE ` Page` = '{ $this -> s Page_db}'  AND `ID` =  $iBlockID ";
156           db _res( $sQu ery );   156           db _res( $sQu ery );
157       }   157       }
158          158       
159       functi on resetPa ge() {   159       functi on resetPa ge() {
160           if ( $this ->  oPage ->  bResetable  ) {   160           if ( $this ->  oPage ->  bResetable  ) {
161                $sQuery  = "DELETE  FROM `{$th is -> sDBT able}` WHE RE `Page`  = '{$this  -> sPage_d b}'";   161                $sQuery  = "DELETE  FROM `{$th is -> sDBT able}` WHE RE `Page`  = '{$this  -> sPage_d b}'";
162                db_res($ sQuery);   162                db_res($ sQuery);
163                execSqlF ile( $this  -> oPage  -> sDefaul tSqlFile ) ;   163                execSqlF ile( $this  -> oPage  -> sDefaul tSqlFile ) ;
164                   164                
165                if( $thi s -> oPage  -> sName  == 'index'  ) {   165                if( $thi s -> oPage  -> sName  == 'index'  ) {
166                    setP aram( 'pro moWidth',  '960' );   166                    setP aram( 'pro moWidth',  '960' );
167                    Resi zeAllPromo s();   167                    Resi zeAllPromo s();
168                }   168                }
169           }   169           }
170              170           
171           ec ho (int)$t his -> oPa ge -> bRes etable;   171           ec ho (int)$t his -> oPa ge -> bRes etable;
172       }   172       }
173          173       
174       functi on saveIte m( $aData  ) {   174       functi on saveIte m( $aData  ) {
175           $i ID = (int) $aData['id '];   175           $i ID = (int) $aData['id '];
176              176           
177           $s Query = "S ELECT `Fun c` FROM `{ $this -> s DBTable}`  WHERE `ID`  = $iID";   177           $s Query = "S ELECT `Fun c` FROM `{ $this -> s DBTable}`  WHERE `ID`  = $iID";
178           $s Func  = db _value( $s Query );   178           $s Func  = db _value( $s Query );
179           if ( !$sFunc  )   179           if ( !$sFunc  )
180                return;   180                return;
181              181           
182           $s Caption =  process_db _input($aD ata['Capti on']);   182           $s Caption =  process_db _input($aD ata['Capti on']);
183            $sVisible   =   i
mplode(   ',',      $aData['Vi sible'])
;
  183            $sVisible   =   i s_array(   $aData['Vi sible']   )   ?   i mplode(   ',',   $aData['Vi sible']   )   :   '' ;
184              184           
185           if ( $sFunc = = 'RSS' )   185           if ( $sFunc = = 'RSS' )
186                $sConten tUpd = "`C ontent` =  '" . proce ss_db_inpu t($aData[' Url']) . ' #' . (int) $aData['Nu m'] . "'," ;   186                $sConten tUpd = "`C ontent` =  '" . proce ss_db_inpu t($aData[' Url']) . ' #' . (int) $aData['Nu m'] . "'," ;
187           el seif( $sFu nc == 'Ech o' )   187           el seif( $sFu nc == 'Ech o' )
188                $sConten tUpd = "`C ontent` =  '" . proce ss_db_inpu t($aData[' Content'])  . "',";   188                $sConten tUpd = "`C ontent` =  '" . proce ss_db_inpu t($aData[' Content'])  . "',";
189           el se   189           el se
190                $sConten tUpd = '';   190                $sConten tUpd = '';
191              191           
192           $s Query = "   192           $s Query = "
193                UPDATE ` {$this ->  sDBTable}`  SET   193                UPDATE ` {$this ->  sDBTable}`  SET
194                    `Cap tion` = '$ sCaption',   194                    `Cap tion` = '$ sCaption',
195                    $sCo ntentUpd   195                    $sCo ntentUpd
196                    `Vis ible` = '$ sVisible'   196                    `Vis ible` = '$ sVisible'
197                WHERE `I D` = $iID   197                WHERE `I D` = $iID
198           ";   198           ";
199              199           
200           db _res( $sQu ery );   200           db _res( $sQu ery );
201              201           
202           ec ho _t( pro cess_pass_ data($aDat a['Caption ']) );   202           ec ho _t( pro cess_pass_ data($aDat a['Caption ']) );
203       }   203       }
204          204       
205       functi on saveCol sWidths( $ aWidths )  {   205       functi on saveCol sWidths( $ aWidths )  {
206           $i Counter =  0;   206           $i Counter =  0;
207           fo reach( $aW idths as $ iWidth ) {   207           fo reach( $aW idths as $ iWidth ) {
208                $iCounte r ++;   208                $iCounte r ++;
209                $iWidth  = (int)$iW idth;   209                $iWidth  = (int)$iW idth;
210                   210                
211                $sQuery  = "UPDATE  `{$this ->  sDBTable} ` SET `Col Width` = $ iWidth WHE RE `Page`  = '{$this  -> sPage_d b}' AND `C olumn` = $ iCounter";   211                $sQuery  = "UPDATE  `{$this ->  sDBTable} ` SET `Col Width` = $ iWidth WHE RE `Page`  = '{$this  -> sPage_d b}' AND `C olumn` = $ iCounter";
212                db_res(  $sQuery );   212                db_res(  $sQuery );
213           }   213           }
214              214           
215           ec ho 'OK';   215           ec ho 'OK';
216       }   216       }
217          217       
218       functi on saveBlo cks( $aCol umns ) {   218       functi on saveBlo cks( $aCol umns ) {
219           // reset bloc ks on this  page   219           // reset bloc ks on this  page
220           $s Query = "U PDATE `{$t his -> sDB Table}` SE T `Column`  = 0, `Ord er` = 0 WH ERE `Page`  = '{$this  -> sPage_ db}'";   220           $s Query = "U PDATE `{$t his -> sDB Table}` SE T `Column`  = 0, `Ord er` = 0 WH ERE `Page`  = '{$this  -> sPage_ db}'";
221           db _res( $sQu ery );   221           db _res( $sQu ery );
222              222           
223           $i ColCounter  = 0;   223           $i ColCounter  = 0;
224           fo reach( $aC olumns as  $sBlocks )  {   224           fo reach( $aC olumns as  $sBlocks )  {
225                $iColCou nter ++;   225                $iColCou nter ++;
226                   226                
227                $aBlocks  = explode ( ',', $sB locks );   227                $aBlocks  = explode ( ',', $sB locks );
228                foreach(  $aBlocks  as $iOrder  => $iBloc kID ) {   228                foreach(  $aBlocks  as $iOrder  => $iBloc kID ) {
229                    $iBl ockID = (i nt)$iBlock ID;   229                    $iBl ockID = (i nt)$iBlock ID;
230                    $sQu ery = "UPD ATE `{$thi s -> sDBTa ble}` SET  `Column` =  $iColCoun ter, `Orde r` = $iOrd er WHERE ` ID` = $iBl ockID AND  `Page` = ' {$this ->  sPage_db}' ";   230                    $sQu ery = "UPD ATE `{$thi s -> sDBTa ble}` SET  `Column` =  $iColCoun ter, `Orde r` = $iOrd er WHERE ` ID` = $iBl ockID AND  `Page` = ' {$this ->  sPage_db}' ";
231                    db_r es( $sQuer y );   231                    db_r es( $sQuer y );
232                }   232                }
233           }   233           }
234              234           
235           ec ho 'OK';   235           ec ho 'OK';
236       }   236       }
237          237       
238       functi on showMai nPage() {   238       functi on showMai nPage() {
239           gl obal $_pag e;   239           gl obal $_pag e;
240           gl obal $site ;   240           gl obal $site ;
241              241           
242           $_ page['head er']   = ' Page Build er';   242           $_ page['head er']   = ' Page Build er';
243           $_ page['css_ name'] = ' pageBuilde r.css';   243           $_ page['css_ name'] = ' pageBuilde r.css';
244           $_ page['extr aCodeInHea d'] = <<<B LAH   244           $_ page['extr aCodeInHea d'] = <<<B LAH
245                       245                    
246                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} jquery/jqu ery.js"></ script>   246                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} jquery/jqu ery.js"></ script>
247                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} jquery/jqu ery.dimens ions.js">< /script>   247                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} jquery/jqu ery.dimens ions.js">< /script>
248                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} jquery/jqu ery.form.j s"></scrip t>   248                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} jquery/jqu ery.form.j s"></scrip t>
249                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} jquery/ui. mouse.js"> </script>   249                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} jquery/ui. mouse.js"> </script>
250                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} jquery/ui. draggable. js"></scri pt>   250                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} jquery/ui. draggable. js"></scri pt>
251                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} jquery/ui. draggable. ext.js"></ script>   251                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} jquery/ui. draggable. ext.js"></ script>
252                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} jquery/ui. droppable. js"></scri pt>   252                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} jquery/ui. droppable. js"></scri pt>
253                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} jquery/ui. sortable.j s"></scrip t>   253                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} jquery/ui. sortable.j s"></scrip t>
254                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} jquery/ui. sortable.e xt.js"></s cript>   254                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} jquery/ui. sortable.e xt.js"></s cript>
255                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} jquery/ui. slider.js" ></script>   255                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} jquery/ui. slider.js" ></script>
256                       256                    
257                    <scr ipt type=" text/javas cript" lan guage="jav ascript" s rc="{$site ['url']}in c/js/class es/BxDolPa geBuilder. js"></scri pt>   257                    <scr ipt type=" text/javas cript" lan guage="jav ascript" s rc="{$site ['url']}in c/js/class es/BxDolPa geBuilder. js"></scri pt>
258                       258                    
259                    <!--  tinyMCE g z -->   259                    <!--  tinyMCE g z -->
260                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} tiny_mce/t iny_mce_gz ip.js"></s cript>   260                    <scr ipt type=" text/javas cript" src ="{$site[' plugins']} tiny_mce/t iny_mce_gz ip.js"></s cript>
261                    <scr ipt type=" text/javas cript">   261                    <scr ipt type=" text/javas cript">
262                         tinyMCE_GZ .init({   262                         tinyMCE_GZ .init({
263                             plugin s : "style ,layer,tab le,save,ad vhr,advima ge,advlink ,emotions, iespell,in sertdateti me,preview ,media,sea rchreplace ,print,con textmenu,p aste,direc tionality, fullscreen ,noneditab le,visualc hars,nonbr eaking,xht mlxtras",   263                             plugin s : "style ,layer,tab le,save,ad vhr,advima ge,advlink ,emotions, iespell,in sertdateti me,preview ,media,sea rchreplace ,print,con textmenu,p aste,direc tionality, fullscreen ,noneditab le,visualc hars,nonbr eaking,xht mlxtras",
264                             themes  : "simple ,advanced" ,   264                             themes  : "simple ,advanced" ,
265                             langua ges : "en" ,   265                             langua ges : "en" ,
266                             disk_c ache : tru e,   266                             disk_c ache : tru e,
267                             debug  : false   267                             debug  : false
268                         });   268                         });
269                    </sc ript>   269                    </sc ript>
270                   270                
271                    <scr ipt langua ge="javasc ript" type ="text/jav ascript">   271                    <scr ipt langua ge="javasc ript" type ="text/jav ascript">
272                         tinyMCE.in it({   272                         tinyMCE.in it({
273                             mode :  "textarea s",   273                             mode :  "textarea s",
274                             theme  : "advance d",   274                             theme  : "advance d",
275                                275                             
276                             editor _selector  : "form_in put_html",   276                             editor _selector  : "form_in put_html",
277                             conten t_css : "{ $site['plu gins']}tin y_mce/dolp hin.css",   277                             conten t_css : "{ $site['plu gins']}tin y_mce/dolp hin.css",
278                                278                             
279                             plugin s : "style ,layer,tab le,save,ad vhr,advima ge,advlink ,emotions, iespell,in sertdateti me,preview ,zoom,medi a,searchre place,prin t,contextm enu,paste, directiona lity,fulls creen,visu alchars,no nbreaking, xhtmlxtras ",   279                             plugin s : "style ,layer,tab le,save,ad vhr,advima ge,advlink ,emotions, iespell,in sertdateti me,preview ,zoom,medi a,searchre place,prin t,contextm enu,paste, directiona lity,fulls creen,visu alchars,no nbreaking, xhtmlxtras ",
280                             relati ve_urls :  false,   280                             relati ve_urls :  false,
281                                281                             
282                             theme_ advanced_b uttons1 :  "bold,ital ic,underli ne,striket hrough,|,j ustifyleft ,justifyce nter,justi fyright,ju stifyfull, |,fontsele ct,fontsiz eselect",   282                             theme_ advanced_b uttons1 :  "bold,ital ic,underli ne,striket hrough,|,j ustifyleft ,justifyce nter,justi fyright,ju stifyfull, |,fontsele ct,fontsiz eselect",
283                             theme_ advanced_b uttons2 :  "forecolor ,backcolor ,|,bullist ,numlist,| ,outdent,i ndent,|,li nk,unlink, image,hr,| ,sub,sup,| ,insertdat e,insertti me,|,style props",   283                             theme_ advanced_b uttons2 :  "forecolor ,backcolor ,|,bullist ,numlist,| ,outdent,i ndent,|,li nk,unlink, image,hr,| ,sub,sup,| ,insertdat e,insertti me,|,style props",
284                             theme_ advanced_b uttons3 :  "charmap,e motions,|, cite,abbr, acronym,at tribs,|,pr eview,remo veformat,| ,code,help ",   284                             theme_ advanced_b uttons3 :  "charmap,e motions,|, cite,abbr, acronym,at tribs,|,pr eview,remo veformat,| ,code,help ",
285                             theme_ advanced_b uttons4 :  "table,row _props,cel l_props,de lete_col,d elete_row, delete_tab le,col_aft er,col_bef ore,row_af ter,row_be fore,row_a fter,row_b efore,spli t_cells,me rge_cells" ,   285                             theme_ advanced_b uttons4 :  "table,row _props,cel l_props,de lete_col,d elete_row, delete_tab le,col_aft er,col_bef ore,row_af ter,row_be fore,row_a fter,row_b efore,spli t_cells,me rge_cells" ,
286                             theme_ advanced_t oolbar_loc ation : "t op",   286                             theme_ advanced_t oolbar_loc ation : "t op",
287                             theme_ advanced_t oolbar_ali gn : "cent er",   287                             theme_ advanced_t oolbar_ali gn : "cent er",
288                             valid_ elements :  "*[*]"   288                             valid_ elements :  "*[*]"
289                         });   289                         });
290                    </sc ript>   290                    </sc ript>
291   BLAH;   291   BLAH;
292              292           
293           $_ page['extr aCodeInBod y'] = <<<B LAH   293           $_ page['extr aCodeInBod y'] = <<<B LAH
294                    <div  id="editF ormWrapper "   294                    <div  id="editF ormWrapper "
295                      st yle="displ ay:none;"  onclick="i f ( ( even t.target | | event.sr cElement )  == this )  $(this).h ide();">   295                      st yle="displ ay:none;"  onclick="i f ( ( even t.target | | event.sr cElement )  == this )  $(this).h ide();">
296                         <div id="e ditFormCon t">   296                         <div id="e ditFormCon t">
297                                297                             
298                         </div>   298                         </div>
299                    </di v>   299                    </di v>
300   BLAH;   300   BLAH;
301           To pCodeAdmin ();   301           To pCodeAdmin ();
302              302           
303           $t his -> sho wBuildZone ();   303           $t his -> sho wBuildZone ();
304              304           
305           Bo ttomCode() ;   305           Bo ttomCode() ;
306       }   306       }
307          307       
308       functi on showBui ldZone() {   308       functi on showBui ldZone() {
309           gl obal $site ;   309           gl obal $site ;
310           ?>   310           ?>
311                <div id= "buildZone Wrapper">   311                <div id= "buildZone Wrapper">
312           <?   312           <?
313              313           
314           $t his -> sho wPageSelec tor();   314           $t his -> sho wPageSelec tor();
315              315           
316           if ( $this ->  oPage ) {   316           if ( $this ->  oPage ) {
317                ?>   317                ?>
318                    <div  id="build AreasWrapp er">   318                    <div  id="build AreasWrapp er">
319                         <div class ="block_he ad">Page W idth</div>   319                         <div class ="block_he ad">Page W idth</div>
320                         <div class ="block_co nt_nd">   320                         <div class ="block_co nt_nd">
321                                321                             
322                             <div i d="pageWid thValue">< /div>   322                             <div i d="pageWid thValue">< /div>
323                                323                             
324                             <div i d="pageWid thSlider">   324                             <div i d="pageWid thSlider">
325                                 <d iv></div>   325                                 <d iv></div>
326                             </div>   326                             </div>
327                                327                             
328                             <div c lass="clea r_both"></ div>   328                             <div c lass="clea r_both"></ div>
329                         </div>   329                         </div>
330                           330                        
331                         <div class ="block_he ad">Active  Blocks</d iv>   331                         <div class ="block_he ad">Active  Blocks</d iv>
332                         <div class ="block_co nt" id="ac tiveAreaWr apper">   332                         <div class ="block_co nt" id="ac tiveAreaWr apper">
333                             <div i d="pageCon trols">   333                             <div i d="pageCon trols">
334                <?   334                <?
335                if( !iss et( $this  -> aAliase s[ $this - > oPage ->  sName ] )  ) {   335                if( !iss et( $this  -> aAliase s[ $this - > oPage ->  sName ] )  ) {
336                    ?>   336                    ?>
337                                 <a  href="<?=  $site['ur l'] ?>view Page.php?I D=<?= html specialcha rs( $this  -> oPage - > sName )  ?>"   337                                 <a  href="<?=  $site['ur l'] ?>view Page.php?I D=<?= html specialcha rs( $this  -> oPage - > sName )  ?>"
338                                    target="_b lank">View  Page</a>   338                                    target="_b lank">View  Page</a>
339                    <?   339                    <?
340                }   340                }
341                   341                
342                if( $thi s -> oPage  -> bReset able ) {   342                if( $thi s -> oPage  -> bReset able ) {
343                    ?>   343                    ?>
344                                 <a  href="#"  onclick="o PB.resetPa ge(); retu rn false;" >Reset Pag e</a>   344                                 <a  href="#"  onclick="o PB.resetPa ge(); retu rn false;" >Reset Pag e</a>
345                    <?   345                    <?
346                }   346                }
347                ?>   347                ?>
348                                    348                                 
349                             </div>   349                             </div>
350                                350                             
351                             <div i d="activeB locksArea"  class="bu ildArea">   351                             <div i d="activeB locksArea"  class="bu ildArea">
352                                 Lo ading...   352                                 Lo ading...
353                             </div>   353                             </div>
354                         </div>   354                         </div>
355                           355                        
356                         <div id="c olumnsSlid er">   356                         <div id="c olumnsSlid er">
357                             <div>< /div>   357                             <div>< /div>
358                         </div>   358                         </div>
359     359  
360                         <div class ="block_he ad">Inacti ve Blocks< /div>   360                         <div class ="block_he ad">Inacti ve Blocks< /div>
361                         <div class ="block_co nt">   361                         <div class ="block_co nt">
362                             <div i d="inactiv eBlocksAre a" class=" buildArea" >   362                             <div i d="inactiv eBlocksAre a" class=" buildArea" >
363                                 Lo ading...   363                                 Lo ading...
364                             </div>   364                             </div>
365                         </div>   365                         </div>
366                           366                        
367                         <div class ="block_he ad">Sample s</div>   367                         <div class ="block_he ad">Sample s</div>
368                         <div class ="block_co nt">   368                         <div class ="block_co nt">
369                             <div i d="samples BlocksArea " class="b uildArea">   369                             <div i d="samples BlocksArea " class="b uildArea">
370                                 Lo ading...   370                                 Lo ading...
371                             </div>   371                             </div>
372                         </div>   372                         </div>
373                           373                        
374                         <div class ="block_he ad">Other  Pages Widt h</div>   374                         <div class ="block_he ad">Other  Pages Widt h</div>
375                         <div class ="block_co nt_nd">   375                         <div class ="block_co nt_nd">
376                                376                             
377                             <div i d="pageWid thValue1"> </div>   377                             <div i d="pageWid thValue1"> </div>
378                                378                             
379                             <div i d="pageWid thSlider1" >   379                             <div i d="pageWid thSlider1" >
380                                 <d iv></div>   380                                 <d iv></div>
381                             </div>   381                             </div>
382                                382                             
383                             <div c lass="clea r_both"></ div>   383                             <div c lass="clea r_both"></ div>
384                         </div>   384                         </div>
385                           385                        
386                    </di v>   386                    </di v>
387                       387                    
388                    <scr ipt langua ge="javasc ript" type ="text/jav ascript">   388                    <scr ipt langua ge="javasc ript" type ="text/jav ascript">
389                         $( documen t ).ready(  function( ){   389                         $( documen t ).ready(  function( ){
390                             oPB =  new BxDolP ageBuilder ( {   390                             oPB =  new BxDolP ageBuilder ( {
391                                 pa rser: '<?=  $_SERVER[ 'PHP_SELF' ] ?>',   391                                 pa rser: '<?=  $_SERVER[ 'PHP_SELF' ] ?>',
392                                 pa ge: '<?= a ddslashes(  $this ->  oPage -> s Name ) ?>' ,   392                                 pa ge: '<?= a ddslashes(  $this ->  oPage -> s Name ) ?>' ,
393                                 mi nCols: 1,   393                                 mi nCols: 1,
394                                 ma xCols: 4,   394                                 ma xCols: 4,
395                                 pa geWidth: ' <?= $this  -> oPage - > iPageWid th ?>',   395                                 pa geWidth: ' <?= $this  -> oPage - > iPageWid th ?>',
396                                 ot herPagesWi dth: '<?=  getParam(  'main_div_ width' ) ? >'   396                                 ot herPagesWi dth: '<?=  getParam(  'main_div_ width' ) ? >'
397                             } );   397                             } );
398                         } );   398                         } );
399                    </sc ript>   399                    </sc ript>
400                <?   400                <?
401           }   401           }
402              402           
403           ?>   403           ?>
404                </div>   404                </div>
405           <?   405           <?
406       }   406       }
407          407       
408       functi on showPag eSelector( ) {   408       functi on showPag eSelector( ) {
409           ?>   409           ?>
410           <d iv>   410           <d iv>
411                <script  type="text /javascrip t" languag e="javascr ipt">   411                <script  type="text /javascrip t" languag e="javascr ipt">
412                    var  createNewB uilderPage  = functio n() {   412                    var  createNewB uilderPage  = functio n() {
413                         var sNewPa ge = promp t('Enter n ame of new  page', 'N ew Page');   413                         var sNewPa ge = promp t('Enter n ame of new  page', 'N ew Page');
414                         if(sNewPag e != undef ined && $. trim(sNewP age) != '' )   414                         if(sNewPag e != undef ined && $. trim(sNewP age) != '' )
415                             window .location  = '<?= $_S ERVER['PHP _SELF'] ?> ?Page=' +  encodeURIC omponent(  sNewPage ) ;   415                             window .location  = '<?= $_S ERVER['PHP _SELF'] ?> ?Page=' +  encodeURIC omponent(  sNewPage ) ;
416                    }   416                    }
417                </script >   417                </script >
418                   418                
419                <a href= "#" onclic k="createN ewBuilderP age(); ret urn false; " id="newP ageLink">N ew Page</a >   419                <a href= "#" onclic k="createN ewBuilderP age(); ret urn false; " id="newP ageLink">N ew Page</a >
420                   420                
421                <ul id=" pageSelect or">   421                <ul id=" pageSelect or">
422           <?   422           <?
423           fo reach( $th is -> aPag es as $sPa ge ) {   423           fo reach( $th is -> aPag es as $sPa ge ) {
424                $sSelect ed = ( $th is -> oPag e -> sName  == $sPage  ) ? 'clas s="current "' : '';   424                $sSelect ed = ( $th is -> oPag e -> sName  == $sPage  ) ? 'clas s="current "' : '';
425                   425                
426                ?>   426                ?>
427                    <li  <?= $sSele cted ?>>   427                    <li  <?= $sSele cted ?>>
428                         <a href="< ?= $_SERVE R['PHP_SEL F'] ?>?Pag e=<?= html specialcha rs_adv( ur lencode($s Page) ) ?> ">   428                         <a href="< ?= $_SERVE R['PHP_SEL F'] ?>?Pag e=<?= html specialcha rs_adv( ur lencode($s Page) ) ?> ">
429                             <?= ht mlspecialc hars( isse t($this ->  aAliases[ $sPage]) ?  $this ->  aAliases[$ sPage] : $ sPage ) ?>   429                             <?= ht mlspecialc hars( isse t($this ->  aAliases[ $sPage]) ?  $this ->  aAliases[$ sPage] : $ sPage ) ?>
430                         </a>   430                         </a>
431                    </li >   431                    </li >
432                <?   432                <?
433           }   433           }
434              434           
435           ?>   435           ?>
436                </ul>   436                </ul>
437           </ div>   437           </ div>
438           <?   438           <?
439       }   439       }
440          440       
441       functi on getPage s() {   441       functi on getPage s() {
442           $s PagesQuery  = "SELECT  DISTINCT  `Page` FRO M `{$this  -> sDBTabl e}` WHERE  `Page` !=  '' ORDER B Y `Page`";   442           $s PagesQuery  = "SELECT  DISTINCT  `Page` FRO M `{$this  -> sDBTabl e}` WHERE  `Page` !=  '' ORDER B Y `Page`";
443           $r Pages = db _res( $sPa gesQuery ) ;   443           $r Pages = db _res( $sPa gesQuery ) ;
444           wh ile( $aPag e = mysql_ fetch_asso c($rPages)  )   444           wh ile( $aPag e = mysql_ fetch_asso c($rPages)  )
445                $this ->  aPages[]  = $aPage[' Page'];   445                $this ->  aPages[]  = $aPage[' Page'];
446       }   446       }
447          447       
448       functi on checkAj axMode() {   448       functi on checkAj axMode() {
449           if ( isset( $ _SERVER['H TTP_X_REQU ESTED_WITH '] ) and $ _SERVER['H TTP_X_REQU ESTED_WITH '] == 'XML HttpReques t' )   449           if ( isset( $ _SERVER['H TTP_X_REQU ESTED_WITH '] ) and $ _SERVER['H TTP_X_REQU ESTED_WITH '] == 'XML HttpReques t' )
450                $this ->  bAjaxMode  = true;   450                $this ->  bAjaxMode  = true;
451       }   451       }
452          452       
453       functi on showPro pForm( $iB lockID ) {   453       functi on showPro pForm( $iB lockID ) {
454           $s Query = "S ELECT * FR OM `{$this  -> sDBTab le}` WHERE  `Page` =  '{$this ->  sPage_db} ' AND `ID`  = $iBlock ID";   454           $s Query = "S ELECT * FR OM `{$this  -> sDBTab le}` WHERE  `Page` =  '{$this ->  sPage_db} ' AND `ID`  = $iBlock ID";
455           $a Item = db_ assoc_arr( $sQuery);   455           $a Item = db_ assoc_arr( $sQuery);
456           if ( !$aItem  ) {   456           if ( !$aItem  ) {
457                ?>   457                ?>
458                <div sty le="text-a lign:cente r;color:re d;">This b lock has n o properti es</div>   458                <div sty le="text-a lign:cente r;color:re d;">This b lock has n o properti es</div>
459                <?   459                <?
460                return ;   460                return ;
461           }   461           }
462              462           
463           ?>   463           ?>
464   <form name ="formItem Edit" id=" formItemEd it" action ="<?=$_SER VER['PHP_S ELF']?>" m ethod="POS T">   464   <form name ="formItem Edit" id=" formItemEd it" action ="<?=$_SER VER['PHP_S ELF']?>" m ethod="POS T">
465       <input  type="hid den" name= "Page" val ue="<?= ht mlspecialc hars($this ->oPage->s Name) ?>"  />   465       <input  type="hid den" name= "Page" val ue="<?= ht mlspecialc hars($this ->oPage->s Name) ?>"  />
466       <input  type="hid den" name= "id" value ="<?= $iBl ockID ?>"  />   466       <input  type="hid den" name= "id" value ="<?= $iBl ockID ?>"  />
467       <input  type="hid den" name= "action" v alue="save Item" />   467       <input  type="hid den" name= "action" v alue="save Item" />
468          468       
469       <table  class="po pup_form_w rapper">   469       <table  class="po pup_form_w rapper">
470           <t r>   470           <t r>
471                <td clas s="corner" ><img src= "images/op _cor_tl.pn g" /></td>   471                <td clas s="corner" ><img src= "images/op _cor_tl.pn g" /></td>
472                <td clas s="side_ve r"><img sr c="images/ spacer.gif " /></td>   472                <td clas s="side_ve r"><img sr c="images/ spacer.gif " /></td>
473                <td clas s="corner" ><img src= "images/op _cor_tr.pn g" /></td>   473                <td clas s="corner" ><img src= "images/op _cor_tr.pn g" /></td>
474           </ tr>   474           </ tr>
475           <t r>   475           <t r>
476                <td clas s="side">< img src="i mages/spac er.gif" /> </td>   476                <td clas s="side">< img src="i mages/spac er.gif" /> </td>
477                   477                
478                <td clas s="contain er">   478                <td clas s="contain er">
479                    <div  class="ed it_item_ta ble_cont">   479                    <div  class="ed it_item_ta ble_cont">
480                       480                    
481                         <table cla ss="edit_i tem_table"  >   481                         <table cla ss="edit_i tem_table"  >
482                             <tr>   482                             <tr>
483                                 <t d class="f orm_label" >Type:</td >   483                                 <t d class="f orm_label" >Type:</td >
484                                 <t d>   484                                 <t d>
485                                      <?   485                                      <?
486                                          swit ch( $aItem ['Func'] )  {   486                                          swit ch( $aItem ['Func'] )  {
487                                               case 'PFBl ock': echo  'Profile  Fields'; b reak;   487                                               case 'PFBl ock': echo  'Profile  Fields'; b reak;
488                                               case 'Echo ':    echo  'HTML Blo ck'; break ;   488                                               case 'Echo ':    echo  'HTML Blo ck'; break ;
489                                               case 'RSS' :     echo  'RSS Feed '; break;   489                                               case 'RSS' :     echo  'RSS Feed '; break;
490                                               default:         echo  'Special  Block';   490                                               default:         echo  'Special  Block';
491                                          }   491                                          }
492                                      ?>   492                                      ?>
493                                 </ td>   493                                 </ td>
494                             </tr>   494                             </tr>
495                             <tr>   495                             <tr>
496                                 <t d class="f orm_label" >Descripti on:</td>   496                                 <t d class="f orm_label" >Descripti on:</td>
497                                 <t d><?= $aIt em['Desc']  ?></td>   497                                 <t d><?= $aIt em['Desc']  ?></td>
498                             </tr>   498                             </tr>
499                             <tr>   499                             <tr>
500                                 <t d class="f orm_label" >Caption L ang Key:</ td>   500                                 <t d class="f orm_label" >Caption L ang Key:</ td>
501                                 <t d>   501                                 <t d>
502                                      <input t ype="text"  class="fo rm_input_t ext" name= "Caption"  value="<?=  $aItem['C aption'] ? >" />   502                                      <input t ype="text"  class="fo rm_input_t ext" name= "Caption"  value="<?=  $aItem['C aption'] ? >" />
503                                 </ td>   503                                 </ td>
504                             </tr>   504                             </tr>
505                             <tr>   505                             <tr>
506                                 <t d class="f orm_label" >Visible f or:</td>   506                                 <t d class="f orm_label" >Visible f or:</td>
507                                 <t d>   507                                 <t d>
508                                      <label>   508                                      <label>
509                                          <inp ut type="c heckbox" n ame="Visib le[]" valu e="non"   509                                          <inp ut type="c heckbox" n ame="Visib le[]" valu e="non"
510                                            <? = ( ( strp os( $aItem ['Visible' ], 'non'   ) === fals e ) ? '' :  'checked= "checked"'  ) ?> />   510                                            <? = ( ( strp os( $aItem ['Visible' ], 'non'   ) === fals e ) ? '' :  'checked= "checked"'  ) ?> />
511                                          Gues t   511                                          Gues t
512                                      </label>   512                                      </label>
513                                         513                                      
514                                      <label>   514                                      <label>
515                                          <inp ut type="c heckbox" n ame="Visib le[]" valu e="memb"   515                                          <inp ut type="c heckbox" n ame="Visib le[]" valu e="memb"
516                                            <? = ( ( strp os( $aItem ['Visible' ], 'memb'  ) === fals e ) ? '' :  'checked= "checked"'  ) ?> />   516                                            <? = ( ( strp os( $aItem ['Visible' ], 'memb'  ) === fals e ) ? '' :  'checked= "checked"'  ) ?> />
517                                          Memb er   517                                          Memb er
518                                      </label>   518                                      </label>
519                                 </ td>   519                                 </ td>
520                             </tr>   520                             </tr>
521       <?   521       <?
522       if( $a Item['Func '] == 'Ech o' ) {   522       if( $a Item['Func '] == 'Ech o' ) {
523           ?>   523           ?>
524                             <tr>   524                             <tr>
525                                 <t d class="f orm_label" >HTML-cont ent:</td>   525                                 <t d class="f orm_label" >HTML-cont ent:</td>
526                                 <t d>&nbsp;</ td>   526                                 <t d>&nbsp;</ td>
527                             </tr>   527                             </tr>
528                             <tr>   528                             <tr>
529                                 <t d class="f orm_colspa n" colspan ="2">   529                                 <t d class="f orm_colspa n" colspan ="2">
530                                      <textare a class="f orm_input_ html" id=" form_input _html" nam e="Content "><?= html specialcha rs_adv( $a Item['Cont ent'] ) ?> </textarea >   530                                      <textare a class="f orm_input_ html" id=" form_input _html" nam e="Content "><?= html specialcha rs_adv( $a Item['Cont ent'] ) ?> </textarea >
531                                 </ td>   531                                 </ td>
532                             </tr>   532                             </tr>
533           <?   533           <?
534       } else if( $aItem ['Func'] = = 'RSS' )  {   534       } else if( $aItem ['Func'] = = 'RSS' )  {
535           li st( $sUrl,  $iNum ) =  explode(  '#', $aIte m['Content '] );   535           li st( $sUrl,  $iNum ) =  explode(  '#', $aIte m['Content '] );
536           $i Num = (int )$iNum;   536           $i Num = (int )$iNum;
537              537           
538           ?>   538           ?>
539                             <tr>   539                             <tr>
540                                 <t d class="f orm_label" >Url of RS S feed:</t d>   540                                 <t d class="f orm_label" >Url of RS S feed:</t d>
541                                 <t d><input t ype="text"  class="fo rm_input_t ext" name= "Url" valu e="<?= $sU rl ?>" />< /td>   541                                 <t d><input t ype="text"  class="fo rm_input_t ext" name= "Url" valu e="<?= $sU rl ?>" />< /td>
542                             </tr>   542                             </tr>
543                             <tr>   543                             <tr>
544                                 <t d class="f orm_label" >Number of  RSS items  (0 - all) :</td>   544                                 <t d class="f orm_label" >Number of  RSS items  (0 - all) :</td>
545                                 <t d><input t ype="text"  class="fo rm_input_t ext" name= "Num" valu e="<?= $iN um ?>" />< /td>   545                                 <t d><input t ype="text"  class="fo rm_input_t ext" name= "Num" valu e="<?= $iN um ?>" />< /td>
546                             </tr>   546                             </tr>
547           <?   547           <?
548       }   548       }
549       ?>   549       ?>
550                             <tr>   550                             <tr>
551                                 <t d class="f orm_colspa n" colspan ="2">   551                                 <t d class="f orm_colspa n" colspan ="2">
552                                      <input t ype="submi t" value=" Save" />   552                                      <input t ype="submi t" value=" Save" />
553       <?   553       <?
554       if( $a Item['Func '] == 'RSS ' or $aIte m['Func']  == 'Echo'  ) {   554       if( $a Item['Func '] == 'RSS ' or $aIte m['Func']  == 'Echo'  ) {
555           ?>   555           ?>
556                                      <input t ype="reset " value="D elete" nam e="Delete"  />   556                                      <input t ype="reset " value="D elete" nam e="Delete"  />
557           <?   557           <?
558       }   558       }
559       ?>   559       ?>
560                                      <input t ype="reset " value="C ancel" nam e="Cancel"  />   560                                      <input t ype="reset " value="C ancel" nam e="Cancel"  />
561                                 </ td>   561                                 </ td>
562                             </tr>   562                             </tr>
563                         </table>   563                         </table>
564                       564                    
565                    </di v>   565                    </di v>
566                </td>   566                </td>
567                   567                
568                <td clas s="side">< img src="i mages/spac er.gif" al t="" /></t d>   568                <td clas s="side">< img src="i mages/spac er.gif" al t="" /></t d>
569           </ tr>   569           </ tr>
570           <t r>   570           <t r>
571                <td clas s="corner" ><img src= "images/op _cor_bl.pn g" /></td>   571                <td clas s="corner" ><img src= "images/op _cor_bl.pn g" /></td>
572                <td clas s="side_ve r"><img sr c="images/ spacer.gif " alt="" / ></td>   572                <td clas s="side_ve r"><img sr c="images/ spacer.gif " alt="" / ></td>
573                <td clas s="corner" ><img src= "images/op _cor_br.pn g" onload= "if( navig ator.appNa me == 'Mic rosoft Int ernet Expl orer' && v ersion >=  5.5 && ver sion < 7 )  png_fix() ;" /></td>   573                <td clas s="corner" ><img src= "images/op _cor_br.pn g" onload= "if( navig ator.appNa me == 'Mic rosoft Int ernet Expl orer' && v ersion >=  5.5 && ver sion < 7 )  png_fix() ;" /></td>
574           </ tr>   574           </ tr>
575       </tabl e>   575       </tabl e>
576   </form>   576   </form>
577     577  
578     578  
579           <?   579           <?
580       }   580       }
581          581       
582   }   582   }
583     583  
584   class BxDo lPVAPage {   584   class BxDo lPVAPage {
585       var $s Name;   585       var $s Name;
586       var $s Name_db;   586       var $s Name_db;
587       var $o Parent;   587       var $o Parent;
588       var $a ColsWidths      = arr ay();   588       var $a ColsWidths      = arr ay();
589       var $a Blocks          = arr ay();   589       var $a Blocks          = arr ay();
590       var $a BlocksInac tive = arr ay();   590       var $a BlocksInac tive = arr ay();
591       var $a BlocksSamp les  = arr ay();   591       var $a BlocksSamp les  = arr ay();
592       var $a MinWidths       = arr ay();   592       var $a MinWidths       = arr ay();
593       var $i PageWidth;   593       var $i PageWidth;
594       var $b Resetable;  //defines  if the pa ge can be  reset   594       var $b Resetable;  //defines  if the pa ge can be  reset
595       var $s DefaultSql File; //fi le contain ing defaul t setting  for reset   595       var $s DefaultSql File; //fi le contain ing defaul t setting  for reset
596          596       
597       var $b New = fals e;   597       var $b New = fals e;
598          598       
599       functi on BxDolPV APage( $sP age, &$oPa rent ) {   599       functi on BxDolPV APage( $sP age, &$oPa rent ) {
600           gl obal $dir;   600           gl obal $dir;
601           gl obal $admi n_dir;   601           gl obal $admi n_dir;
602              602           
603           $t his -> sNa me   = $sP age;   603           $t his -> sNa me   = $sP age;
604           $t his -> sNa me_db = ad dslashes(  $this -> s Name );   604           $t his -> sNa me_db = ad dslashes(  $this -> s Name );
605              605           
606           /*  @var $thi s->oParent  BxDolPage ViewAdmin  */   606           /*  @var $thi s->oParent  BxDolPage ViewAdmin  */
607           $t his -> oPa rent = &$o Parent;   607           $t his -> oPa rent = &$o Parent;
608              608           
609           $t his -> sDe faultSqlFi le = "{$di r['root']} {$admin_di r}/default _builders/ {$this ->  oParent ->  sDBTable} _{$this ->  sName}.sq l";   609           $t his -> sDe faultSqlFi le = "{$di r['root']} {$admin_di r}/default _builders/ {$this ->  oParent ->  sDBTable} _{$this ->  sName}.sq l";
610           $t his -> bRe setable =  file_exist s( $this - > sDefault SqlFile );   610           $t his -> bRe setable =  file_exist s( $this - > sDefault SqlFile );
611                       611                    
612           $t his -> loa dContent() ;   612           $t his -> loa dContent() ;
613       }   613       }
614          614       
615       functi on loadCon tent() {   615       functi on loadCon tent() {
616           if ( in_array ( $this ->  sName, $t his -> oPa rent -> aP ages ) ) {   616           if ( in_array ( $this ->  sName, $t his -> oPa rent -> aP ages ) ) {
617                //get pa ge width   617                //get pa ge width
618                $sQuery  = "SELECT  `PageWidth ` FROM `{$ this -> oP arent -> s DBTable}`  WHERE `Pag e` = '{$th is -> sNam e_db}' LIM IT 1";   618                $sQuery  = "SELECT  `PageWidth ` FROM `{$ this -> oP arent -> s DBTable}`  WHERE `Pag e` = '{$th is -> sNam e_db}' LIM IT 1";
619                $this ->  iPageWidt h = db_val ue( $sQuer y );   619                $this ->  iPageWidt h = db_val ue( $sQuer y );
620                   620                
621                   621                
622                //get co lumns widt hs   622                //get co lumns widt hs
623                $sQuery  = "   623                $sQuery  = "
624                    SELE CT   624                    SELE CT
625                         `Column`,   625                         `Column`,
626                         `ColWidth`   626                         `ColWidth`
627                    FROM  `{$this - > oParent  -> sDBTabl e}`   627                    FROM  `{$this - > oParent  -> sDBTabl e}`
628                    WHER E   628                    WHER E
629                         `Page` = ' {$this ->  sName_db}'  AND   629                         `Page` = ' {$this ->  sName_db}'  AND
630                         `Column` ! = 0   630                         `Column` ! = 0
631                    GROU P BY `Colu mn`   631                    GROU P BY `Colu mn`
632                    ORDE R BY `Colu mn`   632                    ORDE R BY `Colu mn`
633                ";   633                ";
634                $rColumn s = db_res ( $sQuery  );   634                $rColumn s = db_res ( $sQuery  );
635                while( $ aColumn =  mysql_fetc h_assoc( $ rColumns )  ) {   635                while( $ aColumn =  mysql_fetc h_assoc( $ rColumns )  ) {
636                    $iCo lumn                         = ( int)$aColu mn['Column '];   636                    $iCo lumn                         = ( int)$aColu mn['Column '];
637                    $thi s -> aCols Widths[$iC olumn] = ( int)$aColu mn['ColWid th'];   637                    $thi s -> aCols Widths[$iC olumn] = ( int)$aColu mn['ColWid th'];
638                    $thi s -> aBloc ks[$iColum n]     = a rray();   638                    $thi s -> aBloc ks[$iColum n]     = a rray();
639                       639                    
640                    //ge t active b locks   640                    //ge t active b locks
641                    $sQu eryActive  = "   641                    $sQu eryActive  = "
642                         SELECT   642                         SELECT
643                             `ID`,   643                             `ID`,
644                             `Capti on`   644                             `Capti on`
645                         FROM `{$th is -> oPar ent -> sDB Table}`   645                         FROM `{$th is -> oPar ent -> sDB Table}`
646                         WHERE   646                         WHERE
647                             `Page`  = '{$this  -> sName_ db}' AND   647                             `Page`  = '{$this  -> sName_ db}' AND
648                             `Colum n` = $iCol umn   648                             `Colum n` = $iCol umn
649                         ORDER BY ` Order`   649                         ORDER BY ` Order`
650                         ";   650                         ";
651                       651                    
652                    $rBl ocks = db_ res( $sQue ryActive ) ;   652                    $rBl ocks = db_ res( $sQue ryActive ) ;
653                       653                    
654                    whil e( $aBlock   = mysql_ fetch_asso c( $rBlock s ) )   654                    whil e( $aBlock   = mysql_ fetch_asso c( $rBlock s ) )
655                         $this -> a Blocks[$iC olumn][ (i nt)$aBlock ['ID'] ] =  _t( $aBlo ck['Captio n'] );   655                         $this -> a Blocks[$iC olumn][ (i nt)$aBlock ['ID'] ] =  _t( $aBlo ck['Captio n'] );
656                }   656                }
657                   657                
658                // load  minimal wi dths   658                // load  minimal wi dths
659                $sQuery  = "SELECT  `ID`, `Min Width` FRO M `{$this  -> oParent  -> sDBTab le}` WHERE  `MinWidth ` > 0 AND  `Page`= '{ $this -> s Name_db}'" ;   659                $sQuery  = "SELECT  `ID`, `Min Width` FRO M `{$this  -> oParent  -> sDBTab le}` WHERE  `MinWidth ` > 0 AND  `Page`= '{ $this -> s Name_db}'" ;
660                $rBlocks  = db_res(  $sQuery ) ;   660                $rBlocks  = db_res(  $sQuery ) ;
661                while( $ aBlock = m ysql_fetch _assoc( $r Blocks ) )   661                while( $ aBlock = m ysql_fetch _assoc( $r Blocks ) )
662                    $thi s -> aMinW idths[ (in t)$aBlock[ 'ID'] ] =  (int)$aBlo ck['MinWid th'];   662                    $thi s -> aMinW idths[ (in t)$aBlock[ 'ID'] ] =  (int)$aBlo ck['MinWid th'];
663                   663                
664                   664                
665                $this ->  loadInact iveBlocks( );   665                $this ->  loadInact iveBlocks( );
666                   666                
667           }  else {   667           }  else {
668                $this ->  bNew = tr ue;   668                $this ->  bNew = tr ue;
669                $this ->  oParent - > aPages[]  = $this - > sName;   669                $this ->  oParent - > aPages[]  = $this - > sName;
670                $this ->  loadInact iveBlocks( );   670                $this ->  loadInact iveBlocks( );
671                //load f rom post   671                //load f rom post
672           }   672           }
673       }   673       }
674          674       
675       functi on loadIna ctiveBlock s() {   675       functi on loadIna ctiveBlock s() {
676           // get inacti ve blocks  and sample s   676           // get inacti ve blocks  and sample s
677           $s QueryInact ive = "   677           $s QueryInact ive = "
678                SELECT   678                SELECT
679                    `ID` ,   679                    `ID` ,
680                    `Cap tion`   680                    `Cap tion`
681                FROM `{$ this -> oP arent -> s DBTable}`   681                FROM `{$ this -> oP arent -> s DBTable}`
682                WHERE   682                WHERE
683                    `Pag e` = '{$th is -> sNam e_db}' AND   683                    `Pag e` = '{$th is -> sNam e_db}' AND
684                    `Col umn` = 0   684                    `Col umn` = 0
685           ";   685           ";
686              686           
687           $s QuerySampl es = "   687           $s QuerySampl es = "
688                SELECT   688                SELECT
689                    `ID` ,   689                    `ID` ,
690                    `Cap tion`   690                    `Cap tion`
691                FROM `{$ this -> oP arent -> s DBTable}`   691                FROM `{$ this -> oP arent -> s DBTable}`
692                WHERE   692                WHERE
693                    `Fun c` = 'Samp le'   693                    `Fun c` = 'Samp le'
694           ";   694           ";
695              695           
696           $r Inactive =  db_res( $ sQueryInac tive );   696           $r Inactive =  db_res( $ sQueryInac tive );
697           $r Samples  =  db_res( $ sQuerySamp les );   697           $r Samples  =  db_res( $ sQuerySamp les );
698              698           
699           wh ile( $aBlo ck = mysql _fetch_ass oc( $rInac tive ) )   699           wh ile( $aBlo ck = mysql _fetch_ass oc( $rInac tive ) )
700                $this ->  aBlocksIn active[ (i nt)$aBlock ['ID'] ] =  _t( $aBlo ck['Captio n'] );   700                $this ->  aBlocksIn active[ (i nt)$aBlock ['ID'] ] =  _t( $aBlo ck['Captio n'] );
701              701           
702           wh ile( $aBlo ck = mysql _fetch_ass oc( $rSamp les ) )   702           wh ile( $aBlo ck = mysql _fetch_ass oc( $rSamp les ) )
703                $this ->  aBlocksSa mples[ (in t)$aBlock[ 'ID'] ] =  _t( $aBloc k['Caption '] );   703                $this ->  aBlocksSa mples[ (in t)$aBlock[ 'ID'] ] =  _t( $aBloc k['Caption '] );
704       }   704       }
705          705       
706       functi on getJSON () {   706       functi on getJSON () {
707           $o PVAPageJSO N = new Bx DolPVAPage JSON( $thi s );   707           $o PVAPageJSO N = new Bx DolPVAPage JSON( $thi s );
708           $o Json = new  Services_ JSON();   708           $o Json = new  Services_ JSON();
709           re turn $oJso n -> encod e($oPVAPag eJSON);   709           re turn $oJso n -> encod e($oPVAPag eJSON);
710       }   710       }
711          711       
712   }   712   }
713     713  
714   /* tempora ry JSON ob ject */   714   /* tempora ry JSON ob ject */
715   class BxDo lPVAPageJS ON {   715   class BxDo lPVAPageJS ON {
716       var $a ctive;   716       var $a ctive;
717       var $i nactive;   717       var $i nactive;
718       var $s amples;   718       var $s amples;
719       var $w idths;   719       var $w idths;
720       var $m in_widths;   720       var $m in_widths;
721          721       
722       functi on BxDolPV APageJSON(  $oParent  ) {   722       functi on BxDolPV APageJSON(  $oParent  ) {
723           $t his -> wid ths     =  $oParent - > aColsWid ths;   723           $t his -> wid ths     =  $oParent - > aColsWid ths;
724           $t his -> min _widths =  $oParent - > aMinWidt hs;   724           $t his -> min _widths =  $oParent - > aMinWidt hs;
725           $t his -> act ive     =  $oParent - > aBlocks;   725           $t his -> act ive     =  $oParent - > aBlocks;
726           $t his -> ina ctive   =  $oParent - > aBlocksI nactive;   726           $t his -> ina ctive   =  $oParent - > aBlocksI nactive;
727           $t his -> sam ples    =  $oParent - > aBlocksS amples;   727           $t his -> sam ples    =  $oParent - > aBlocksS amples;
728       }   728       }
729   }   729   }
730     730  
731     731  
732   class BxDo lPageViewC acher {   732   class BxDo lPageViewC acher {
733       var $s CacheFile;   733       var $s CacheFile;
734          734       
735       functi on BxDolPa geViewCach er( $sDBTa ble, $sCac heFile ) {   735       functi on BxDolPa geViewCach er( $sDBTa ble, $sCac heFile ) {
736           $t his -> sDB Table = $s DBTable;   736           $t his -> sDB Table = $s DBTable;
737           $t his -> sCa cheFile =  BX_DIRECTO RY_PATH_IN C . "db_ca ched/$sCac heFile";   737           $t his -> sCa cheFile =  BX_DIRECTO RY_PATH_IN C . "db_ca ched/$sCac heFile";
738       }   738       }
739          739       
740       functi on createC ache() {   740       functi on createC ache() {
741           $s CacheStrin g = '';   741           $s CacheStrin g = '';
742              742           
743           $r CacheFile  = @fopen(  $this -> s CacheFile,  'w' );   743           $r CacheFile  = @fopen(  $this -> s CacheFile,  'w' );
744           if ( !$rCache File ) {   744           if ( !$rCache File ) {
745                echo '<b r /><b>War ning!</b>  Cannot ope n Page Vie w cache fi le (' . $t his -> sCa cheFile .  ') for wri te.';   745                echo '<b r /><b>War ning!</b>  Cannot ope n Page Vie w cache fi le (' . $t his -> sCa cheFile .  ') for wri te.';
746                return f alse;   746                return f alse;
747           }   747           }
748              748           
749           fw rite( $rCa cheFile, " // cache o f Page Vie w composer \n\nreturn  array(\n   //pages\n " );   749           fw rite( $rCa cheFile, " // cache o f Page Vie w composer \n\nreturn  array(\n   //pages\n " );
750              750           
751           // get pages   751           // get pages
752           $s Query = "S ELECT `Pag e`,`PageWi dth` FROM  `{$this ->  sDBTable} ` WHERE `P age` != ''  GROUP BY  `Page`";   752           $s Query = "S ELECT `Pag e`,`PageWi dth` FROM  `{$this ->  sDBTable} ` WHERE `P age` != ''  GROUP BY  `Page`";
753           $r Pages = db _res( $sQu ery );   753           $r Pages = db _res( $sQu ery );
754              754           
755           wh ile( $aPag e = mysql_ fetch_asso c( $rPages  ) ) {   755           wh ile( $aPag e = mysql_ fetch_asso c( $rPages  ) ) {
756                $sPageNa me = $aPag e['Page'];   756                $sPageNa me = $aPag e['Page'];
757                   757                
758                fwrite(  $rCacheFil e, "  '$sP ageName' = > array(\n " );   758                fwrite(  $rCacheFil e, "  '$sP ageName' = > array(\n " );
759                fwrite(  $rCacheFil e, "    'W idth' => ' {$aPage['P ageWidth'] }',\n" );   759                fwrite(  $rCacheFil e, "    'W idth' => ' {$aPage['P ageWidth'] }',\n" );
760                fwrite(  $rCacheFil e, "    'C olumns' =>  array(\n"  );   760                fwrite(  $rCacheFil e, "    'C olumns' =>  array(\n"  );
761                   761                
762                //get co lumns   762                //get co lumns
763                $sQuery  = "   763                $sQuery  = "
764                    SELE CT   764                    SELE CT
765                         `Column`,   765                         `Column`,
766                         `ColWidth`   766                         `ColWidth`
767                    FROM  `{$this - > sDBTable }`   767                    FROM  `{$this - > sDBTable }`
768                    WHER E   768                    WHER E
769                         `Page` = ' $sPageName ' AND   769                         `Page` = ' $sPageName ' AND
770                         `Column` >  0   770                         `Column` >  0
771                    GROU P BY `Colu mn`   771                    GROU P BY `Colu mn`
772                    ORDE R BY `Colu mn`   772                    ORDE R BY `Colu mn`
773                ";   773                ";
774                $rColumn s = db_res ( $sQuery  );   774                $rColumn s = db_res ( $sQuery  );
775                   775                
776                while( $ aColumn =  mysql_fetc h_assoc( $ rColumns )  ) {   776                while( $ aColumn =  mysql_fetc h_assoc( $ rColumns )  ) {
777                    $iCo lumn = $aC olumn['Col umn'];   777                    $iCo lumn = $aC olumn['Col umn'];
778                    $iCo lWidth  =  $aColumn[' ColWidth'] ;   778                    $iCo lWidth  =  $aColumn[' ColWidth'] ;
779                       779                    
780                    fwri te( $rCach eFile, "       $iColu mn => arra y(\n" );   780                    fwri te( $rCach eFile, "       $iColu mn => arra y(\n" );
781                    fwri te( $rCach eFile, "         'Wid th'  => $i ColWidth,\ n" );   781                    fwri te( $rCach eFile, "         'Wid th'  => $i ColWidth,\ n" );
782                    fwri te( $rCach eFile, "         'Blo cks' => ar ray(\n" );   782                    fwri te( $rCach eFile, "         'Blo cks' => ar ray(\n" );
783                       783                    
784                    //ge t blocks o f column   784                    //ge t blocks o f column
785                    $sQu ery = "   785                    $sQu ery = "
786                         SELECT   786                         SELECT
787                             `ID`,   787                             `ID`,
788                             `Capti on`,   788                             `Capti on`,
789                             `Func` ,   789                             `Func` ,
790                             `Conte nt`,   790                             `Conte nt`,
791                             `Desig nBox`,   791                             `Desig nBox`,
792                             `Visib le`   792                             `Visib le`
793                         FROM `{$th is -> sDBT able}`   793                         FROM `{$th is -> sDBT able}`
794                         WHERE   794                         WHERE
795                             `Page`  = '$sPage Name' AND   795                             `Page`  = '$sPage Name' AND
796                             `Colum n` = $iCol umn   796                             `Colum n` = $iCol umn
797                         ORDER BY ` Order` ASC   797                         ORDER BY ` Order` ASC
798                    ";   798                    ";
799                    $rBl ocks = db_ res( $sQue ry );   799                    $rBl ocks = db_ res( $sQue ry );
800                       800                    
801                    whil e( $aBlock  = mysql_f etch_assoc ( $rBlocks  ) ) {   801                    whil e( $aBlock  = mysql_f etch_assoc ( $rBlocks  ) ) {
802                         fwrite( $r CacheFile,  "           {$aBlock ['ID']} =>  array(\n"  );   802                         fwrite( $r CacheFile,  "           {$aBlock ['ID']} =>  array(\n"  );
803                           803                        
804                         fwrite( $r CacheFile,  "             'Func'       => ' {$aBlock[' Func']}',\ n" );   804                         fwrite( $r CacheFile,  "             'Func'       => ' {$aBlock[' Func']}',\ n" );
805                         fwrite( $r CacheFile,  "             'Conte nt'   => ' " . $this  -> addSlas hes( $aBlo ck['Conten t'] ) . "' ,\n" );   805                         fwrite( $r CacheFile,  "             'Conte nt'   => ' " . $this  -> addSlas hes( $aBlo ck['Conten t'] ) . "' ,\n" );
806                         fwrite( $r CacheFile,  "             'Capti on'   => ' " . $this  -> addSlas hes( $aBlo ck['Captio n'] ) . "' ,\n" );   806                         fwrite( $r CacheFile,  "             'Capti on'   => ' " . $this  -> addSlas hes( $aBlo ck['Captio n'] ) . "' ,\n" );
807                         fwrite( $r CacheFile,  "             'Visib le'   => ' {$aBlock[' Visible']} ',\n" );   807                         fwrite( $r CacheFile,  "             'Visib le'   => ' {$aBlock[' Visible']} ',\n" );
808                         fwrite( $r CacheFile,  "             'Desig nBox' => { $aBlock['D esignBox'] }\n" );   808                         fwrite( $r CacheFile,  "             'Desig nBox' => { $aBlock['D esignBox'] }\n" );
809                           809                        
810                         fwrite( $r CacheFile,  "           ),\n" );  //close b lock   810                         fwrite( $r CacheFile,  "           ),\n" );  //close b lock
811                    }   811                    }
812                    fwri te( $rCach eFile, "         )\n"  ); //clos e blocks   812                    fwri te( $rCach eFile, "         )\n"  ); //clos e blocks
813                    fwri te( $rCach eFile, "       ),\n"  ); //close  column   813                    fwri te( $rCach eFile, "       ),\n"  ); //close  column
814                }   814                }
815                   815                
816                fwrite(  $rCacheFil e, "    )\ n" ); //cl ose column s   816                fwrite(  $rCacheFil e, "    )\ n" ); //cl ose column s
817                fwrite(  $rCacheFil e, "  ),\n " ); //clo se page   817                fwrite(  $rCacheFil e, "  ),\n " ); //clo se page
818           }   818           }
819              819           
820           fw rite( $rCa cheFile, " );\n" ); / /close mai n array   820           fw rite( $rCa cheFile, " );\n" ); / /close mai n array
821              821           
822           fc lose( $rCa cheFile );   822           fc lose( $rCa cheFile );
823           re turn true;   823           re turn true;
824       }   824       }
825          825       
826       functi on addSlas hes( $sTex t ) {   826       functi on addSlas hes( $sTex t ) {
827           $s Text = str _replace(  '\\', '\\\ \', $sText  );   827           $s Text = str _replace(  '\\', '\\\ \', $sText  );
828           $s Text = str _replace(  '\'', '\\\ '', $sText  );   828           $s Text = str _replace(  '\'', '\\\ '', $sText  );
829              829           
830           re turn $sTex t;   830           re turn $sTex t;
831       }   831       }
832   }   832   }