Difference between revisions of "CKEditor upgrade"

From GLMWiki
Jump to: navigation, search
(Upgrades pre pear toolbox to CKEditor)
 
Line 45: Line 45:
 
     */
 
     */
 
     define('ORIGINAL', "http://is0.gaslightmedia.com/".IS_OWNER_ID."/original/");
 
     define('ORIGINAL', "http://is0.gaslightmedia.com/".IS_OWNER_ID."/original/");
define('RESIZED',  "http://is0.gaslightmedia.com/".IS_OWNER_ID."/tbs1/");
+
    define('RESIZED',  "http://is0.gaslightmedia.com/".IS_OWNER_ID."/tbs1/");
define('MIDSIZED', "http://is0.gaslightmedia.com/".IS_OWNER_ID."/tbs2/");
+
    define('MIDSIZED', "http://is0.gaslightmedia.com/".IS_OWNER_ID."/tbs2/");
 
     define('THUMB',    "http://is0.gaslightmedia.com/".IS_OWNER_ID."/tbs3/");
 
     define('THUMB',    "http://is0.gaslightmedia.com/".IS_OWNER_ID."/tbs3/");
 
 
     define('IMAGE_MANAGER',    "http://is0.gaslightmedia.com/".IS_OWNER_ID."/imgMgr/");
 
     define('IMAGE_MANAGER',    "http://is0.gaslightmedia.com/".IS_OWNER_ID."/imgMgr/");
  

Revision as of 12:04, 28 October 2009

This checklist upgrades a site from the FCKeditor to CKEditor using Pear Libraries


1) Verify GLM_APP_BASE and GLM_APP_BASE_URL is defined in setup.phtml

2) add to the top function in setup.phtml (or setup_functions.phtml) <script type="text/javascript" src="'.GLM_APP_BASE_URL.'ckeditor/current/ckeditor.js"></script> <script type="text/javascript" src="'.GLM_APP_BASE_URL.'libjs/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="./cktoolbox.js "></script>

3) Add the function __autoload($className) to setup.phtml

4) add the global variable, $flexyOptions to setup.phtml

5) add $dbh to setup

6) Set up client on the image server and add to setup.phtml:

   /**
    * Now using new Image Server
    * http://is0.gaslightmedia.com/admin
    * setup new owner with owner_id and owner_pw
    * MUST BE DONE BEFORE uploading any images
    */
   /**
   * IS_OWNER_ID owner_id from image server config
    */
   define('IS_OWNER_ID', 'Owner');
   /**
    * IS_OWNER_PW owner_pw from image server config
    */
   define('IS_OWNER_PW', 'Password');
   /**
    * Toolbox image URLS
    * NOTE: these don't change
    * There are 4 global "image styles"
    * original = used for original images no processing
    * tbs1     = used to be resized
    * tbs2     = used to be midsized
    * tbs3     = used to be thumb
    * check on http://is0.gaslightmedia.com/admin under owner _SYSTEM_
    * for their sizes
    * if you need a different size you'll need to create image style for 
    * your owner with new sizes just use one of set style names
    * tbs1,tbs2,tbs3 (do this before uploading the image will help)
    */
   define('ORIGINAL', "http://is0.gaslightmedia.com/".IS_OWNER_ID."/original/");
   define('RESIZED',  "http://is0.gaslightmedia.com/".IS_OWNER_ID."/tbs1/");
   define('MIDSIZED', "http://is0.gaslightmedia.com/".IS_OWNER_ID."/tbs2/");
   define('THUMB',    "http://is0.gaslightmedia.com/".IS_OWNER_ID."/tbs3/");
   define('IMAGE_MANAGER',    "http://is0.gaslightmedia.com/".IS_OWNER_ID."/imgMgr/");


7) add file cktoolbox.js to admin/Toolbox

8) add to function mySubmit in admin/Toolbox/edit_bus.phtml: var MemberToolbox = {

   init: function()
   {
       if ($('#description').is('textarea')) {
           //  Only try to replace the textarea if the
           //  CKEditor is compatible w/ the browser.
           if (CKEDITOR.env.isCompatible) {
               CKEDITOR.replace('description',
                   {
                       toolbar : 'Default',
                       width : 570,
                       height : 400,
                       filebrowserImageBrowseUrl : '../../Toolkit/CKImages/browser.php?folder=1',
                       filebrowserImageUploadUrl : '../../Toolkit/CKImages/connector.php?command=Upload',

filebrowserImageWindowWidth : '760', filebrowserImageWindowHeight : '500'

                   });
           }
       }
   }

};


9) copy Toolkit/CKImages/ to site root

10) add Common.php and FormBuilder.php to the Toolkit folder

11) copy Image folder to Toolkit

12) run the Toolkit/CKImages/database/ckeditorImages.sql file against the site db.

13) run psql -U postgres -E -f /usr/share/postgresql/8.2/contrib/tablefunc.sql <database> to add postgres functions

14) Replace description instances where textarea(fn) is called with: echo '<td><textarea name="description" id="description" cols="60" rows="60">'.$value.'</textarea></td>'; in edit_bus and edit_bus_category

15) Remove the htmlcode() function from bottom of admin/Toolbox/edit_bus and edit_bus_category.phtml