public
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
Search Repo:
Removing some stuff from lib/page.functions.php

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


git-svn-id: http://svn.cmsmadesimple.org/svn/cmsmadesimple/trunk@4461 
3d254a34-79dc-0310-9e5f-be208747d8a0
tedkulp (author)
Sun Apr 27 07:29:54 -0700 2008
commit  1d4e393fe0cae8142711a915f87157611a76f101
tree    5ae931db88ca7b522756bf319e6cfc6ccda35924
parent  5c1eb285cfb340bd5332b019ff18afc44a4d5881
...
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
...
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
...
400
401
402
403
404
 
 
405
406
407
...
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
...
185
186
187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
189
190
...
256
257
258
 
 
 
 
 
 
 
 
 
 
 
 
259
260
261
...
263
264
265
 
 
266
267
268
269
270
...
314
315
316
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
318
319
0
@@ -185,131 +185,6 @@
0
     $db->Execute($query, array($value, $userid, $prefname));
0
   }
0
 }
0
-
0
-/**
0
- * Returns the stylesheet for the given templateid. Returns a hash with encoding and stylesheet entries.
0
- *
0
- * @since 0.1
0
- */
0
-function get_stylesheet($template_id, $media_type = '')
0
-{
0
- $result = array();
0
- $css = "";
0
-
0
- global $gCms;
0
- $db = cms_db();
0
- $templateops = $gCms->GetTemplateOperations();
0
-
0
- $templateobj = FALSE;
0
-
0
- #Grab template id and make sure it's actually "somewhat" valid
0
- if (isset($template_id) && is_numeric($template_id) && $template_id > -1)
0
- {
0
- #Ok, it's valid, let's load the bugger
0
- $templateobj =& $templateops->LoadTemplateById($template_id);
0
- }
0
-
0
- #If it's valid after loading, then start the process...
0
- if ($templateobj !== FALSE && ($templateobj->active == '1' || $templateobj->active == TRUE) )
0
- {
0
- #Grab the encoding
0
- $result['encoding'] = CmsResponse::get_encoding();
0
-
0
- #Load in the "standard" template CSS if media type is empty
0
- if ($media_type == '')
0
- {
0
- if (isset($templateobj->stylesheet) && $templateobj->stylesheet != '')
0
- {
0
- $css .= $templateobj->stylesheet;
0
- }
0
- }
0
-
0
- #Handle "advanced" CSS Management
0
- $cssquery = "SELECT css_text FROM ".cms_db_prefix()."css c, ".cms_db_prefix()."css_assoc ca
0
- WHERE id = assoc_css_id
0
- AND assoc_type = 'template'
0
- AND assoc_to_id = ?
0
- AND c.media_type = ? ORDER BY ca.create_date";
0
- $cssresult =& $db->Execute($cssquery, array($template_id, $media_type));
0
-
0
- while ($cssresult && $cssline = $cssresult->FetchRow())
0
- {
0
- $css .= "\n".$cssline['css_text']."\n";
0
- }
0
-
0
- if ($cssresult) $cssresult->Close();
0
- }
0
- else
0
- {
0
- $result['nostylesheet'] = true;
0
- $result['encoding'] = CmsResponse::get_encoding();
0
- }
0
-
0
- #$css = preg_replace("/[\r\n]/", "", $css); //hack for tinymce
0
- $result['stylesheet'] = $css;
0
-
0
- return $result;
0
-}
0
-
0
-function get_stylesheet_media_types($template_id)
0
-{
0
- $result = array();
0
-
0
- global $gCms;
0
- $db =& $gCms->GetDb();
0
- $templateops =& $gCms->GetTemplateOperations();
0
-
0
- $templateobj = FALSE;
0
-
0
- #Grab template id and make sure it's actually "somewhat" valid
0
- if (isset($template_id) && is_numeric($template_id) && $template_id > -1)
0
- {
0
- #Ok, it's valid, let's load the bugger
0
- $templateobj = $templateops->LoadTemplateById($template_id);
0
- if (isset($templateobj->stylesheet) && $templateobj->stylesheet != '')
0
- {
0
- $result[] = '';
0
- }
0
- }
0
-
0
- #If it's valid after loading, then start the process...
0
- if ($templateobj !== FALSE && ($templateobj->active == '1' || $templateobj->active == TRUE) )
0
- {
0
- #Handle "advanced" CSS Management
0
- $cssquery = "SELECT DISTINCT media_type FROM ".cms_db_prefix()."css c, ".cms_db_prefix()."css_assoc
0
- WHERE id = assoc_css_id
0
- AND assoc_type = 'template'
0
- AND assoc_to_id = ?";
0
- $cssresult = &$db->Execute($cssquery, array($template_id));
0
-
0
- while ($cssresult && !$cssresult->EOF)
0
- {
0
- if (!in_array($cssresult->fields['media_type'], $result))
0
- $result[] =& $cssresult->fields['media_type'];
0
- $cssresult->MoveNext();
0
- }
0
-
0
- if ($cssresult) $cssresult->Close();
0
- }
0
-
0
- return $result;
0
-}
0
-
0
-/**
0
- * Strips slashes from an array of values.
0
- */
0
-function & stripslashes_deep(&$value)
0
-{
0
- if (is_array($value))
0
- {
0
- $value = array_map('stripslashes_deep', $value);
0
- }
0
- elseif (!empty($value) && is_string($value))
0
- {
0
- $value = stripslashes($value);
0
- }
0
- return $value;
0
-}
0
   
0
 function create_textarea($enablewysiwyg, $text, $name, $classname='', $id='', $encoding='', $stylesheet='', $width='80', $height='15',$forcewysiwyg='',$wantedsyntax='')
0
 {
0
@@ -381,18 +256,6 @@
0
   return $result;
0
 }
0
 
0
-/*
0
- * Displays the login form (frontend)
0
- */
0
-function display_login_form()
0
-{
0
- return '<form method=post action="'.$_SERVER['PHP_SELF'].'">'.
0
- 'Name: <input type="text" name="login_name"><br>'.
0
- 'Password: <input type="password" name="login_password"><br>'.
0
- '<input type="submit">'.
0
- '</form>';
0
-}
0
-
0
 /**
0
  * Creates a string containing links to all the pages.
0
  * @param page - the current page to display
0
@@ -400,8 +263,8 @@
0
  * @param limit - the amount of items to list per page
0
  * @return a string containing links to all the pages (ex. next 1,2 prev)
0
  */
0
- function pagination($page, $totalrows, $limit)
0
- {
0
+function pagination($page, $totalrows, $limit)
0
+{
0
   $page_string = "";
0
   $from = ($page * $limit) - $limit;
0
   $numofpages = $totalrows / $limit;
0
@@ -451,39 +314,6 @@
0
     }
0
   }
0
   return $page_string;
0
- }
0
-
0
-
0
-function wysiwyg_form_submit()
0
-{
0
- global $gCms;
0
- $result = '';
0
-
0
- $userid = get_userid(false);
0
- if( $userid != '' )
0
- {
0
- $wysiwyg = get_preference($userid, 'wysiwyg');
0
- }
0
-
0
- if (isset($wysiwyg) && $wysiwyg != '')
0
- {
0
- #Perform the content title callback
0
- reset($gCms->modules);
0
- while (list($key) = each($gCms->modules))
0
- {
0
- $value =& $gCms->modules[$key];
0
- if ($gCms->modules[$key]['installed'] == true &&
0
- $gCms->modules[$key]['active'] == true)
0
- {
0
- @ob_start();
0
- $gCms->modules[$key]['object']->WYSIWYGPageFormSubmit();
0
- $result = @ob_get_contents();
0
- @ob_end_clean();
0
- }
0
- }
0
- }
0
-
0
- return $result;
0
 }
0
 
0
 # vim:ts=4 sw=4 noet

Comments

    No one has commented yet.