[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/ckeditor/includes/ -> ckeditor.drush.inc (source)

   1  <?php
   2  /**
   3   * CKEditor - The text editor for the Internet - http://ckeditor.com
   4   * Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
   5   *
   6   * == BEGIN LICENSE ==
   7   *
   8   * Licensed under the terms of any of the following licenses of your
   9   * choice:
  10   *
  11   *  - GNU General Public License Version 2 or later (the "GPL")
  12   *    http://www.gnu.org/licenses/gpl.html
  13   *
  14   *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
  15   *    http://www.gnu.org/licenses/lgpl.html
  16   *
  17   *  - Mozilla Public License Version 1.1 or later (the "MPL")
  18   *    http://www.mozilla.org/MPL/MPL-1.1.html
  19   *
  20   * == END LICENSE ==
  21   *
  22   * @file
  23   * CKEditor Module for Drupal 6.x
  24   *
  25   * This module allows Drupal to replace textarea fields with CKEditor.
  26   *
  27   * CKEditor is an online rich text editor that can be embedded inside web pages.
  28   * It is a WYSIWYG (What You See Is What You Get) editor which means that the
  29   * text edited in it looks as similar as possible to the results end users will
  30   * see after the document gets published. It brings to the Web popular editing
  31   * features found in desktop word processors such as Microsoft Word and
  32   * OpenOffice.org Writer. CKEditor is truly lightweight and does not require any
  33   * kind of installation on the client computer.
  34   */
  35  
  36  /**
  37   * @file
  38   * Drush integration for the CKEditor module.
  39   */
  40  
  41  /**
  42   * Implements hook_drush_command().
  43   */
  44  function ckeditor_drush_command() {
  45    $items['ckeditor-download'] = array(
  46      'callback' => 'ckeditor_drush_download',
  47      'description' => dt('Downloads the required CKEditor library from svn.ckeditor.com.'),
  48      'arguments' => array(
  49        'path' => dt('Optional. The path to the download folder. If omitted, Drush will use the default location (<code>sites/all/libraries/ckeditor</code>).'),
  50      ),
  51    );
  52    return $items;
  53  }
  54  
  55  /**
  56   * Downloads
  57   */
  58  function ckeditor_drush_download() {
  59    $args = func_get_args();
  60    if ($args[0]) {
  61      $path = $args[0];
  62    }
  63    else {
  64      $path = drush_get_context('DRUSH_DRUPAL_ROOT') . '/sites/all/libraries/ckeditor';
  65    }
  66  
  67    if (drush_shell_exec('svn checkout http://svn.ckeditor.com/CKEditor/releases/stable/ ' . $path)) {
  68      drush_log(dt('CKEditor was downloaded to @path.', array('@path' => $path)), 'success');
  69    }
  70    else {
  71      drush_log(dt('Drush was unable to download CKEditor to @path.', array('@path' => $path)), 'error');
  72    }
  73  }
  74  
  75  /**
  76   * Implements drush_MODULE_post_COMMAND().
  77   */
  78  function drush_ckeditor_post_enable() {
  79    $modules = func_get_args();
  80    if (in_array('ckeditor', $modules)) {
  81      ckeditor_drush_download();
  82    }
  83  }


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7