[geeklog-cvs] geeklog: Updated Calendar and Staticpage plugin to use Scripts c...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Fri Apr 1 10:50:09 EDT 2011


changeset 8205:74e584b6e197
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/74e584b6e197
user: Tom <websitemaster at cogeco.net>
date: Fri Apr 01 10:48:34 2011 -0400
description:
Updated Calendar and Staticpage plugin to use Scripts class.

diffstat:

 plugins/calendar/functions.inc                            |  9 ++-------
 plugins/staticpages/templates/admin/editor_advanced.thtml |  7 +------
 public_html/admin/plugins/staticpages/index.php           |  7 ++++++-
 3 files changed, 9 insertions(+), 14 deletions(-)

diffs (64 lines):

diff -r 11c8b3b91de6 -r 74e584b6e197 plugins/calendar/functions.inc
--- a/plugins/calendar/functions.inc	Mon Mar 28 19:58:46 2011 +0200
+++ b/plugins/calendar/functions.inc	Fri Apr 01 10:48:34 2011 -0400
@@ -672,17 +672,12 @@
 
 function plugin_getheadercode_calendar()
 {
-    global $_CONF;
-
-    $str = null;
+    global $_SCRIPTS;
 
     // use the CSS only if we are on the plugin's pages
     if (substr_count ($_SERVER['PHP_SELF'], '/calendar/') > 0) {
-        $str = '<link rel="stylesheet" type="text/css" href="'
-             . $_CONF['site_url'] . '/calendar/style.css"' . XHTML . '>';
+        $_SCRIPTS->setCSSFile('calendar', '/calendar/style.css', false);
     }
-
-    return $str;
 }
 
 /**
diff -r 11c8b3b91de6 -r 74e584b6e197 plugins/staticpages/templates/admin/editor_advanced.thtml
--- a/plugins/staticpages/templates/admin/editor_advanced.thtml	Mon Mar 28 19:58:46 2011 +0200
+++ b/plugins/staticpages/templates/admin/editor_advanced.thtml	Fri Apr 01 10:48:34 2011 -0400
@@ -1,12 +1,7 @@
 <!-- Hide the Advanced Editor as JavaScript is required. If JS is not enabled then the message below in the <nonscript> tags will be displayed -->
 <noscript>
-    <div class="pluginAlert" style="border:1px dashed #ccc;text-align:center;margin-top:10px;padding:15px;">{lang_nojavascript} </div>
+    <div class="pluginAlert" style="border:1px dashed #ccc;text-align:center;margin-top:10px;padding:15px;">{lang_nojavascript}</div>
 </noscript>
-<script type="text/javascript">
-    // Setup editor path for FCKeditor JS Functions
-    geeklogEditorBasePath = "{site_url}/fckeditor/" ;
-</script>
-<script type="text/javascript" src="{site_url}/javascript/staticpages_fckeditor.js"></script>
 
   {start_block_editor}
   <form action="{site_admin_url}/plugins/staticpages/index.php" method="post" onsubmit='set_postcontent();'>
diff -r 11c8b3b91de6 -r 74e584b6e197 public_html/admin/plugins/staticpages/index.php
--- a/public_html/admin/plugins/staticpages/index.php	Mon Mar 28 19:58:46 2011 +0200
+++ b/public_html/admin/plugins/staticpages/index.php	Fri Apr 01 10:48:34 2011 -0400
@@ -68,7 +68,7 @@
 {
     global $_CONF, $_TABLES, $_USER, $_GROUPS, $_SP_CONF, $mode, $sp_id,
            $LANG21, $LANG_STATIC, $LANG_ACCESS, $LANG_ADMIN, $LANG24,
-           $LANG_postmodes, $MESSAGE, $_IMAGE_TYPE;
+           $LANG_postmodes, $MESSAGE, $_IMAGE_TYPE, $_SCRIPTS;
 
     $template_path = staticpages_templatePath('admin');
     if (!empty($sp_id) && $mode=='edit') {
@@ -94,6 +94,11 @@
     $sp_template = COM_newTemplate($template_path);
     if ($_CONF['advanced_editor'] && $_USER['advanced_editor']) {
         $sp_template->set_file('form', 'editor_advanced.thtml');
+        
+        $js = '// Setup editor path for FCKeditor JS Functions
+            geeklogEditorBasePath = "' . $_CONF['site_url'] . '/fckeditor/";';
+        $_SCRIPTS->setJavaScript($js, true);        
+        $_SCRIPTS->setJavaScriptFile('staticpages_fckeditor', '/javascript/staticpages_fckeditor.js');
 
         $sp_template->set_var('lang_expandhelp', $LANG24[67]);
         $sp_template->set_var('lang_reducehelp', $LANG24[68]);



More information about the geeklog-cvs mailing list