public this repo is viewable by everyone
Description: Git mirror of the CMS Made Simple 2.0 rewrite
Homepage: http://cmsmadesimple.org
Clone URL: git://github.com/tedkulp/cmsmadesimple-2-0.git
More page.functions.php and misc.functions.php cleanup -- Probably 
introduced a few bugs

Signed-off-by: Ted Kulp <ted@cmsmadesimple.org>


git-svn-id: http://svn.cmsmadesimple.org/svn/cmsmadesimple/trunk@4462 
3d254a34-79dc-0310-9e5f-be208747d8a0
tedkulp (author)
18 days ago
commit  5ff950061372f6d3c32f24674eed223a0bdff9f0
tree    c306865e8d5d7b7a05696d2d643155592c1e4db5
parent  1d4e393fe0cae8142711a915f87157611a76f101
...
150
151
152
153
154
155
156
...
150
151
152
 
153
154
155
0
@@ -150,7 +150,6 @@ $smarty->assign('header_name', $themeObject->ShowHeader('addtemplate'));
0
 $smarty->assign_by_ref('template_object', $template_object);
0
 
0
 $smarty->assign('content_box', create_textarea(false, $template_object->content, 'template[content]', 'pagebigtextarea', '', $template_object->encoding));
0
-$smarty->assign('encoding_dropdown', create_encoding_dropdown('template[encoding]', $template_object->encoding));
0
 
0
 //extra buttons
0
 $ExtraButtons = array(
...
110
111
112
113
114
115
116
...
110
111
112
 
113
114
115
0
@@ -110,7 +110,6 @@ $smarty->assign('header_name', $themeObject->ShowHeader('edittemplate'));
0
 $smarty->assign_by_ref('template_object', $template_object);
0
 
0
 $smarty->assign('content_box', create_textarea(false, $template_object->content, 'template[content]', 'pagebigtextarea', '', $template_object->encoding));
0
-$smarty->assign('encoding_dropdown', create_encoding_dropdown('template[encoding]', $template_object->encoding));
0
 
0
 //extra buttons
0
 $ExtraButtons = array(
...
50
51
52
53
 
54
55
56
...
50
51
52
 
53
54
55
56
0
@@ -50,7 +50,7 @@ $themeObject->DisplayDashboardCallout(dirname(dirname(__FILE__)) . '/install');
0
 $themeObject->DisplayDashboardCallout(TMP_CACHE_LOCATION . '/SITEDOWN', lang('sitedownwarning', TMP_CACHE_LOCATION . '/SITEDOWN'));
0
 
0
 // Display a warning if safe mode is enabled
0
-if( ini_get_boolean('safe_mode') && CmsApplication::get_preference(('disablesafemodewarning',0) == 0 )
0
+if( ini_get_boolean('safe_mode') && CmsApplication::get_preference('disablesafemodewarning',0) == 0 )
0
   {
0
     echo '<div class="pageerrorcontainer"><div class="pageoverflow"><p class="pageerror">'.lang('warning_safe_mode').'</p></div></div>';
0
   }
...
473
474
475
476
 
477
478
479
...
473
474
475
 
476
477
478
479
0
@@ -473,7 +473,7 @@ $smarty->assign('lang_list', $lang_list);
0
        while (($file = readdir($dir)) !== false) {
0
            if (@is_dir("themes/".$file) && ($file[0]!='.')) {
0
       ?>
0
-         <option value="<?php echo $file?>"<?php echo (CmsApplication::get_preference(('logintheme', 'default')==$file?" selected=\"selected\"":"")?>><?php echo $file?></option>        
0
+         <option value="<?php echo $file?>"<?php echo (CmsApplication::get_preference('logintheme', 'default')==$file?" selected=\"selected\"":"")?>><?php echo $file?></option>        
0
          <?php
0
        }
0
      }
...
22
23
24
25
26
27
28
29
30
31
32
 
 
33
34
35
36
 
 
 
37
38
39
...
22
23
24
 
 
 
 
 
 
 
 
25
26
27
 
 
 
28
29
30
31
32
33
0
@@ -22,18 +22,12 @@
0
      {/if}
0
     </div>
0
     <div id="advanced">
0
-      {* Encoding *}
0
-      <div class="row">
0
-        <label>{lang string='encoding'}:</label>
0
-        {$encoding_dropdown}
0
-      </div>
0
-  
0
-   {* Active *}
0
-    {admin_input type='checkbox' label='active' id='template_active' name='template[active]' selected=$template_object->active}  
0
+     {* Active *}
0
+      {admin_input type='checkbox' label='active' id='template_active' name='template[active]' selected=$template_object->active}  
0
    
0
-   {html_hidden name='is_postback' value='true'}
0
-   {html_hidden name='template[id]' value=$template_object->id}
0
-   {html_hidden name='template_id' value=$template_object->id}
0
+     {html_hidden name='is_postback' value='true'}
0
+     {html_hidden name='template[id]' value=$template_object->id}
0
+     {html_hidden name='template_id' value=$template_object->id}
0
     </div>
0
   </div><!-- End Tabs -->
0
   {include file='elements/buttons.tpl'}
...
50
51
52
53
 
54
55
56
...
58
59
60
61
 
62
63
64
...
50
51
52
 
53
54
55
56
...
58
59
60
 
61
62
63
64
0
@@ -50,7 +50,7 @@ CmsContentOperations::find_content_types();
0
 CmsContentOperations::find_block_types();
0
 
0
 #Set a umask
0
-$global_umask = CmsApplication::get_preference(('global_umask','');
0
+$global_umask = CmsApplication::get_preference('global_umask','');
0
 if( $global_umask != '' )
0
 {
0
   @umask( octdec($global_umask) );
0
@@ -58,7 +58,7 @@ if( $global_umask != '' )
0
 
0
 #Set the locale if it's set
0
 #either in the config, or as a site preference.
0
-$frontendlang = CmsApplication::get_preference(('frontendlang','');
0
+$frontendlang = CmsApplication::get_preference('frontendlang','');
0
 if (CmsConfig::exists('locale') && CmsConfig::get('locale') != '')
0
 {
0
     $frontendlang = CmsConfig::get('locale');
...
193
194
195
196
 
197
198
199
...
193
194
195
 
196
197
198
199
0
@@ -193,7 +193,7 @@ if (CmsConfig::get('debug'))
0
   echo CmsProfiler::get_instance()->report();
0
 }
0
 
0
-if (CmsApplication::get_preference(('enablesitedownmessage') == "1" || $config['debug'] == true)
0
+if (CmsApplication::get_preference('enablesitedownmessage') == "1" || $config['debug'] == true)
0
 {
0
   cms_smarty()->clear_compiled_tpl();
0
 }
...
73
74
75
76
77
 
 
78
79
80
81
82
 
 
83
84
85
...
73
74
75
 
 
76
77
78
79
80
 
 
81
82
83
84
85
0
@@ -73,13 +73,13 @@ class CmsPageInfoOperations extends CmsObject
0
     else
0
     {
0
       #Page isn't found. Should we setup an alternate page?
0
-      #if (CmsApplication::get_preference(('custom404template') > 0 && CmsApplication::get_preference(('enablecustom404') == "1")
0
-      if (CmsApplication::get_preference(('enablecustom404') == "1")
0
+      #if (CmsApplication::get_preference('custom404template') > 0 && CmsApplication::get_preference('enablecustom404') == "1")
0
+      if (CmsApplication::get_preference('enablecustom404') == "1")
0
       {
0
         $onepageinfo = new CmsPageInfo();
0
         $onepageinfo->cachable = false;
0
-        if (CmsApplication::get_preference(('custom404template') > 0)
0
-          $onepageinfo->template_id = CmsApplication::get_preference(('custom404template');
0
+        if (CmsApplication::get_preference('custom404template') > 0)
0
+          $onepageinfo->template_id = CmsApplication::get_preference('custom404template');
0
         else
0
           $onepageinfo->template_id = 'notemplate';
0
         $onepageinfo->template_modified_date = time();
...
291
292
293
294
 
295
296
 
297
298
299
...
350
351
352
353
 
354
355
356
...
386
387
388
389
 
390
391
392
...
291
292
293
 
294
295
 
296
297
298
299
...
350
351
352
 
353
354
355
356
...
386
387
388
 
389
390
391
392
0
@@ -291,9 +291,9 @@ class CmsSmarty extends Smarty {
0
     global $gCms;
0
     $config = cms_config();
0
 
0
-    if (CmsApplication::get_preference(('enablesitedownmessage') == "1")
0
+    if (CmsApplication::get_preference('enablesitedownmessage') == "1")
0
     {
0
-      $tpl_source = CmsApplication::get_preference(('sitedownmessage');
0
+      $tpl_source = CmsApplication::get_preference('sitedownmessage');
0
       return true;
0
     }
0
     else
0
@@ -350,7 +350,7 @@ class CmsSmarty extends Smarty {
0
   {
0
     global $gCms;
0
 
0
-    if (CmsApplication::get_preference(('enablesitedownmessage') == "1" || $tpl_name == 'notemplate')
0
+    if (CmsApplication::get_preference('enablesitedownmessage') == "1" || $tpl_name == 'notemplate')
0
     {
0
       $tpl_timestamp = time();
0
       return true;
0
@@ -386,7 +386,7 @@ class CmsSmarty extends Smarty {
0
       header("HTTP/1.0 404 Not Found");
0
       header("Status: 404 Not Found");
0
       if ($tpl_name == 'default')
0
-        $tpl_source = CmsApplication::get_preference(('custom404');
0
+        $tpl_source = CmsApplication::get_preference('custom404');
0
       else
0
         $tpl_source = '';
0
       return true;
...
94
95
96
97
 
98
99
100
...
2397
2398
2399
2400
 
2401
2402
2403
...
94
95
96
 
97
98
99
100
...
2397
2398
2399
 
2400
2401
2402
2403
0
@@ -94,7 +94,7 @@ class CmsModule extends CmsModuleBase
0
     }
0
     else
0
     {
0
-     $this->curlang = CmsApplication::get_preference(('frontendlang','');
0
+     $this->curlang = CmsApplication::get_preference('frontendlang','');
0
      if (isset($config['locale']) && $config['locale'] != '') {
0
      $this->curlang = $config['locale'];
0
      }
0
@@ -2397,7 +2397,7 @@ class CmsModule extends CmsModuleBase
0
    */
0
   function GetPreference($preference_name, $defaultvalue='')
0
   {
0
-    return CmsApplication::get_preference(($this->GetName() . "_mapi_pref_" . $preference_name, $defaultvalue);
0
+    return CmsApplication::get_preference($this->GetName() . "_mapi_pref_" . $preference_name, $defaultvalue);
0
   }
0
 
0
   /**
...
934
935
936
937
 
938
939
940
...
1783
1784
1785
1786
 
1787
1788
1789
...
934
935
936
 
937
938
939
940
...
1783
1784
1785
 
1786
1787
1788
1789
0
@@ -934,7 +934,7 @@ abstract class CmsModuleBase extends CmsObject
0
   {
0
     if ($returnid != '')
0
     {
0
-      if (!$this->restrict_unknown_params && CmsApplication::get_preference(('allowparamcheckwarnings', 0))
0
+      if (!$this->restrict_unknown_params && CmsApplication::get_preference('allowparamcheckwarnings', 0))
0
       {
0
         trigger_error('WARNING: '.$this->get_name().' is not properly cleaning input params.', E_USER_WARNING);
0
       }
0
@@ -1783,7 +1783,7 @@ abstract class CmsModuleBase extends CmsObject
0
    */
0
   public function get_preference($preference_name, $defaultvalue='')
0
   {
0
-    return CmsApplication::get_preference(($this->get_name() . "_mapi_pref_" . $preference_name, $defaultvalue);
0
+    return CmsApplication::get_preference($this->get_name() . "_mapi_pref_" . $preference_name, $defaultvalue);
0
   }
0
 
0
   /**
...
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
...
112
113
114
115
 
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
...
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
 
376
377
378
...
25
26
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
29
30
...
36
37
38
 
39
40
41
42
43
44
45
 
 
 
 
46
47
48
49
50
51
 
 
52
 
 
 
 
53
 
 
 
 
54
55
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
58
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
61
62
...
65
66
67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
69
70
71
0
@@ -25,82 +25,6 @@
0
  */
0
 
0
 /**
0
- * Shortcut to the print_r function.
0
- * Wraps the output in <pre> and </pre> for easy reading
0
- *
0
- * @param array $var
0
- * @param bool $exit
0
- *
0
- */
0
-function pr($var, $exit = 1)
0
-{
0
-  echo '<pre>';
0
-    print_r($var);
0
-  echo '</pre>';  
0
-  if($exit == 1)   
0
-    die();
0
-}
0
-
0
-
0
-/**
0
- * Simple template parser
0
- *
0
- * @since 0.6.1
0
- */
0
-function parse_template($template, $tpl_array, $warn=0)
0
-{
0
-  while ( list ($key,$val) = each ($tpl_array) )
0
-  {
0
-    if (!(empty($key)))
0
-    {
0
-      if(gettype($val) != "string")
0
-      {
0
-        settype($val,"string");
0
-      }
0
-      $template = eregi_replace('\{' . $key . '\}',$val,$template);
0
-    }
0
-  }
0
-
0
-  if(!$warn)
0
-  {
0
-    // Silently remove anything not already found
0
-
0
-    $template = ereg_replace('\{[A-Z0-9_]+\}', "", $template);
0
-  }
0
-  else
0
-  {
0
-    // Warn about unresolved template variables
0
-    if (ereg('\{[A-Z0-9_]+\}',$template))
0
-    {
0
-      $unknown = split("\n",$template);
0
-      while (list ($Element,$Line) = each($unknown) )
0
-      {
0
-        $UnkVar = $Line;
0
-        if(!(empty($UnkVar)))
0
-        {
0
-          $this->show_unknowns($UnkVar);
0
-        }
0
-      }
0
-    }
0
-  }
0
-  return $template;
0
-
0
-}  // end parse_template();
0
-
0
-function cms_html_entities($string, $param=ENT_QUOTES, $charset="UTF-8")
0
-{
0
-  $result = "";
0
-  #$result = htmlentities($string, $param, $charset);
0
-  $result = my_htmlentities($string);
0
-  return $result;
0
-}
0
-
0
-function cms_htmlentities($string, $param=ENT_QUOTES, $charset="UTF-8")
0
-{
0
-  return cms_html_entities($string, $param, $charset);
0
-}
0
-
0
-/**
0
  * Enter description here...
0
  *
0
  * @param unknown $val
0
@@ -112,215 +36,27 @@ function cms_htmlentities($string, $param=ENT_QUOTES, $charset="UTF-8")
0
  * ENT_QUOTES : Will convert both double and single quotes.
0
  * ENT_NOQUOTES : Will leave both double and single quotes unconverted.
0
  */
0
-function my_htmlentities($val)
0
+function cms_htmlentities($val, $param=ENT_QUOTES, $charset="UTF-8")
0
 {
0
   if ($val == "")
0
   {
0
     return "";
0
   }
0
   $val = str_replace( "&#032;", " ", $val );
0
-
0
-  //Remove sneaky spaces
0
-  // $val = str_replace( chr(0xCA), "", $val );
0
-
0
   $val = str_replace( "&" , "&amp;" , $val );
0
   $val = str_replace( "<!--" , "&#60;&#33;--" , $val );
0
   $val = str_replace( "-->" , "--&#62;" , $val );
0
   $val = preg_replace( "/<script/i" , "&#60;script" , $val );
0
   $val = str_replace( ">" , "&gt;" , $val );
0
   $val = str_replace( "<" , "&lt;" , $val );
0
-  
0
-  
0
   $val = str_replace( "\"" , "&quot;" , $val );
0
-
0
-  // Uncomment it if you need to convert literal newlines
0
-  //$val = preg_replace( "/\n/" , "<br>" , $val );
0
-
0
   $val = preg_replace( "/\\$/" , "&#036;" , $val );
0
-
0
-  // Uncomment it if you need to remove literal carriage returns
0
-  //$val = preg_replace( "/\r/" , "" , $val );
0
-
0
   $val = str_replace( "!" , "&#33;" , $val );
0
   $val = str_replace( "'" , "&#39;" , $val );
0
   
0
-  // Uncomment if you need to convert unicode chars
0
-  //$val = preg_replace("/&#([0-9]+);/s", "&#\1;", $val );
0
-
0
-  // Strip slashes if not already done so.
0
-
0
-  //if ( get_magic_quotes_gpc() )
0
-  //{
0
-  //  $val = stripslashes($val);
0
-  //}
0
-
0
-  // Swop user inputted backslashes
0
-
0
-  //$val = preg_replace( "/\(?!&#|?#)/", "&#092;", $val );
0
-
0
   return $val;
0
 }
0
 
0
-
0
-/**
0
- * Enter description here...
0
- *
0
- * @param unknown $val
0
- * @return unknown
0
- */
0
-function cms_utf8_entities($val)
0
-{
0
-  if ($val == "")
0
-  {
0
-    return "";
0
-  }
0
-  $val = str_replace( "&#032;", " ", $val );
0
-
0
-  //Remove sneaky spaces
0
-  // $val = str_replace( chr(0xCA), "", $val );
0
-
0
-  $val = str_replace( "&" , "\u0026" , $val );
0
-#  $val = str_replace( "<!--" , "&#60;&#33;--" , $val );
0
-#  $val = str_replace( "-->" , "--&#62;" , $val );
0
-#  $val = preg_replace( "/<script/i" , "&#60;script" , $val );
0
-  $val = str_replace( ">" , "\u003E" , $val );
0
-  $val = str_replace( "<" , "\u003C" , $val );
0
-  
0
-  
0
-  $val = str_replace( "\"" , "\u0022" , $val );
0
-
0
-  // Uncomment it if you need to convert literal newlines
0
-  //$val = preg_replace( "/\n/" , "<br>" , $val );
0
-
0
-  #$val = preg_replace( "/\\$/" , "&#036;" , $val );
0
-
0
-  // Uncomment it if you need to remove literal carriage returns
0
-  //$val = preg_replace( "/\r/" , "" , $val );
0
-
0
-  $val = str_replace( "!" , "\u0021" , $val );
0
-  $val = str_replace( "'" , "\u0027" , $val );
0
-  
0
-  // Uncomment if you need to convert unicode chars
0
-  //$val = preg_replace("/&#([0-9]+);/s", "&#\1;", $val );
0
-
0
-  // Strip slashes if not already done so.
0
-
0
-  //if ( get_magic_quotes_gpc() )
0
-  //{
0
-  //  $val = stripslashes($val);
0
-  //}
0
-
0
-  // Swop user inputted backslashes
0
-
0
-  //$val = preg_replace( "/\(?!&#|?#)/", "&#092;", $val );
0
-
0
-  return $val;
0
-}
0
-
0
-function cms_utf8entities($val)
0
-{
0
-  return cms_utf8_entities($val);
0
-}
0
-
0
-//Taken from http://www.webmasterworld.com/forum88/164.htm
0
-function nl2pnbr( $text )
0
-{
0
-  // Use \n for newline on all systems
0
-  $text = preg_replace("/(\r\n|\n|\r)/", "\n", $text);
0
-
0
-  // Only allow two newlines in a row.
0
-  $text = preg_replace("/\n\n+/", "\n\n", $text);
0
-
0
-  // Put <p>..</p> around paragraphs
0
-  $text = preg_replace('/\n?(.+?)(\n\n|\z)/s', "<p>$1</p>", $text);
0
-
0
-  // Convert newlines not preceded by </p> to a <br /> tag
0
-  $text = preg_replace('|(?<!</p>)\s*\n|', "<br />", $text);
0
-
0
-  return $text;
0
-}
0
-
0
-/**
0
-* Debug function to display $var nicely in html.
0
-*
0
-* @param mixed $var
0
-* @param string $title (optional)
0
-* @param boolean $echo_to_screen (optional)
0
-* @return string
0
-*/
0
-function debug_display($var, $title="", $echo_to_screen = true, $use_html = true)
0
-{
0
-  global $gCms;
0
-  $variables =& $gCms->variables;
0
-
0
-  $starttime = microtime();
0
-  if (isset($variables['starttime']))
0
-    $starttime = $variables['starttime'];
0
-  else
0
-    $variables['starttime'] = $starttime;
0
-  
0
-  $titleText = "Debug: ";
0
-  if($title)
0
-  {
0
-    $titleText = "Debug display of '$title':";
0
-  }
0
-  //$titleText .= '(' . microtime_diff($starttime,microtime()) . ')';
0
-  
0
-  if (function_exists('memory_get_usage'))
0
-  {
0
-    $titleText .= ' - ('.memory_get_usage().')';
0
-  }
0
-
0
-  ob_start();
0
-  if ($use_html)
0
-    echo "<div><b>$titleText</b>\n";
0
-
0
-  if(FALSE == empty($var))
0
-  {
0
-    if ($use_html)
0
-    {
0
-      echo '<pre>';
0
-    }
0
-    if(is_array($var))
0
-    {
0
-      echo "Number of elements: " . count($var) . "\n";
0
-      print_r($var);
0
-    }
0
-    elseif(is_object($var))
0
-    {
0
-      print_r($var);
0
-    }
0
-    elseif(is_string($var))
0
-    {
0
-      print_r(htmlentities(str_replace("\t", ' ', $var)));
0
-    }
0
-    elseif(is_bool($var))
0
-    {
0
-      echo $var === true ? 'true' : 'false';
0
-    }
0
-    else
0
-    {
0
-      print_r($var);
0
-    }
0
-    if ($use_html)
0
-    {
0
-      echo '</pre>';
0
-    }
0
-  }
0
-  if ($use_html)
0
-    echo "</div>\n";
0
-
0
-  $output = ob_get_contents();
0
-  ob_end_clean();
0
-
0
-  if($echo_to_screen)
0
-  {
0
-    echo $output;
0
-  }
0
-
0
-  return $output;
0
-}
0
-
0
 /**
0
  * Display $var nicely to the $gCms->errors array if $config['debug'] is set
0
  *
0
@@ -329,50 +65,7 @@ function debug_display($var, $title="", $echo_to_screen = true, $use_html = true
0
  */
0
 function debug_buffer($var, $title="")
0
 {
0
-  global $gCms;
0
-  if ($gCms)
0
-  {
0
-    $config = cms_config();
0
-    //debug_to_log($var, $title='');
0
-    if($config["debug"] == true)
0
-    {
0
-      $gCms->errors[] = debug_display($var, $title, false, true);
0
-    }
0
-  }
0
-}
0
-
0
-function debug_sql($str, $newline)
0
-{
0
-  global $gCms;
0
-  if ($gCms)
0
-  {
0
-    $config =& $gCms->GetConfig();
0
-    if($config["debug"] == true)
0
-    {
0
-      $gCms->errors[] = debug_display($str, '', false, true);
0
-    }
0
-  }
0
-}
0
-
0
-function create_encoding_dropdown($name = 'encoding', $selected = '')
0
-{
0
-  $result = '';
0
-
0
-  $encodings = array(''=>'Default','UTF-8'=>'Unicode','ISO-8859-1'=>'Latin 1/West European','ISO-8859-2'=>'Latin 2/Central European','ISO-8859-3'=>'Latin 3/South European','ISO-8859-4'=>'Latin 4/North European','ISO-8859-5'=>'Cyrilic','ISO-8859-6'=>'Arabic','ISO-8859-7'=>'Greek','ISO-8859-8'=>'Hebrew','ISO-8859-9'=>'Latin 5/Turkish','ISO-8859-11'=>'TIS-620/Thai','ISO-8859-14'=>'Latin 8','ISO-8859-15'=>'Latin 9','Big5'=>'Taiwanese','GB2312'=>'Chinese','EUC-JP'=>'Japanese','EUC-KR'=>'Korean','KOI8-R'=>'Russian','Windows-1250'=>'Central Europe','Windows-1251'=>'Cyrilic','Windows-1252'=>'Latin 1','Windows-1253'=>'Greek','Windows-1254'=>'Turkish','Windows-1255'=>'Hebrew','Windows-1256'=>'Arabic','Windows-1257'=>'Baltic','Windows-1258'=>'Vietnam');
0
-
0
-  $result .= '<select name="'.$name.'">';
0
-  foreach ($encodings as $key=>$value)
0
-  {
0
-    $result .= '<option value="'.$key.'"';
0
-    if ($selected == $key)
0
-    {
0
-      $result .= ' selected="selected"';
0
-    }
0
-    $result .= '>'.$key.($key!=''?' - ':'').$value.'</option>';
0
-  }
0
-  $result .= '</select>';
0
-
0
-  return $result;
0
+  CmsProfiler::get_instance()->mark(print_r($var));
0
 }
0
 
0
 function filespec_is_excluded( $file, $excludes )
...
61
62
63
 
 
 
 
 
 
64
65
66
...
61
62
63
64
65
66
67
68
69
70
71
72
0
@@ -61,6 +61,12 @@ function generate_user_object($userid)
0
   return CmsLogin::generate_user_object($userid);
0
 }
0
 
0
+function check_permission($userid, $permname)
0
+{
0
+  return CmsAcl::check_core_permission($permname, $userid);
0
+}
0
+
0
+
0
 /**
0
  * Put an event into the audit (admin) log. This should be
0
  * done on most admin events for consistency.
...
174
175
176
177
 
178
179
180
181
 
182
183
184
...
174
175
176
 
177
178
179
180
 
181
182
183
184
0
@@ -174,11 +174,11 @@ function smarty_cms_function_sitemap($params, &$smarty)
0
                 {
0
                     $menu .= ' target="' . $onecontent->GetPropertyValue('target') . '"';
0
                 }
0
- $menu .= '>' . my_htmlentities($onecontent->MenuText()) . '</a>';
0
+ $menu .= '>' . cms_htmlentities($onecontent->MenuText()) . '</a>';
0
             }
0
             else
0
             {
0
- $menu .= my_htmlentities($onecontent->MenuText());
0
+ $menu .= cms_htmlentities($onecontent->MenuText());
0
             }
0
         }
0
         else
...
18
19
20
21
 
22
23
24
...
18
19
20
 
21
22
23
24
0
@@ -18,7 +18,7 @@
0
 
0
 function smarty_cms_function_sitename($params, &$smarty)
0
 {
0
-  $result = CmsApplication::get_preference(('sitename', 'CMSMS Site');
0
+  $result = CmsApplication::get_preference('sitename', 'CMSMS Site');
0
   if (array_key_exists('assign', $params))
0
   {
0
     $smarty->assign($params['assign'], $result);
...
108
109
110
111
 
112
113
114
...
108
109
110
 
111
112
113
114
0
@@ -108,7 +108,7 @@ function cms_header_filter_plugin_function($params, &$smarty)
0
     }
0
   }
0
   
0
-  $result .= CmsApplication::get_preference(('metadata', '');
0
+  $result .= CmsApplication::get_preference('metadata', '');
0
 
0
   if (isset($pageinfo) && $pageinfo !== FALSE)
0
   {

Comments

    No one has commented yet.