Index: sites/all/modules/jcarousel/jcarousel.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/jcarousel/Attic/jcarousel.module,v retrieving revision 1.2.2.2 diff -u -r1.2.2.2 jcarousel.module --- sites/all/modules/jcarousel/jcarousel.module 26 Nov 2010 22:04:31 -0000 1.2.2.2 +++ sites/all/modules/jcarousel/jcarousel.module 27 Nov 2010 04:03:05 -0000 @@ -12,37 +12,85 @@ function jcarousel_help($path, $arg) { switch ($path) { case 'admin/help#jcarousel': - $output = '

' . t('The following is a demonstration of jCarousel module.') . '

'; + $fieldset = array( + '#title' => t('View sample code'), + '#description' => t('The following HTML may be printed out to the page through a node, block, or in a custom template. Then the following PHP code must be run to add the jCarousel library and CSS to the page.'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + + $output = ''; + + $output .= '

' . t('The jCarousel module provides the ability to create carousel-style lists such as those included on this page. The jCarousel module includes integrations with other Drupal modules, but may also be used manually within your own theme or custom modules. It does not include any site-wide settings page or options, each carousel is separately configured.') . '

'; + + $output .= '

' . t('Views integration') . '

'; + $output .= '

'; + $output .= t('Most configuration options for the jCarousel module are provided through Views module.'); + if (module_exists('views_ui')) { + $output .= ' ' . t('You may configure a new view through the Views module interface. After adding a new view, change its "Display style" to "jCarousel" and configure the remaining options there. When using the jCarousel display style with Views, you can construct any of the examples on this page as well as dynamically loaded carousels through AJAX requests.'); + } + else { + $output .= ' ' . t('This site not have Views (or the Views UI module) installed currently. You may be able to turn on this module under your site\'s module page, or you may have to download Views module and install it.', array('!modules-url' => url('admin/build/modules'))); + } + $output .= '

'; + + $output .= '

' . t('Custom implementations') . '

'; + $output .= '

' . t('The following are demonstrations of jCarousel module when used directly by another module or your theme. Most users do not need to manually code carousels (building carousels using Views is the most common approach), but these demonstrations provide good examples of jCarousel\'s abilities.') . '

'; // Construct the jCarousel list. - $list = '
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • '; + $list = ' +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +'; // Provide the horizontal carousel demonstration. - $output .= '

    Horizontal carousel

    '; + $output .= '

    ' . t('Horizontal carousel') . '

    '; + $output .= '

    ' . t('This example uses jcarousel_add() directly with no options to create the default horizontal carousel.') . '

    '; + $list_html = ''; + + $sample = $fieldset; + $sample['#children'] = '
    ' . check_plain($list_html) . '
    ' . highlight_string("", TRUE); + $output .= theme('fieldset', $sample); + + $output .= $list_html; jcarousel_add('horizontalcarousel'); - $output .= '

    As you can see, simply calling jcarousel_add() with the element class will create the default horizontal carousel.

    '; + // Provide the vertical carousel demonstration. - $output .= '

    Vertical carousel

    '; + $output .= '

    ' . t('Vertical carousel') . '

    '; + $output .= '

    ' . t('jCarousel can accept a variety of configuration options via the second argument to jcarousel_add(). In this example, we created a vertical carousel.') . '

    '; + $list_html = ''; + + $sample = $fieldset; + $sample['#children'] = '
    ' . check_plain($list_html) . '
    ' . highlight_string(" TRUE)); ?>", TRUE); + $output .= theme('fieldset', $sample); + + $output .= $list_html; jcarousel_add('verticalcarousel', array('vertical' => TRUE)); - $output .= '

    The configuration options are passed via the second argument in the call to jcarousel_add(). In this example, we created a vertical carousel.

    '; // Provide the different skins carousel demonstration. - $output .= '

    Different skins

    '; + $output .= '

    ' . t('Different skins') . '

    '; + $list_html = ''; + $output .= '

    ' . t('The "skin" of a carousel can be changed by setting the $options[\'skin\'] property. This skin must match one of the skins either provided by a module or matching a skin included in your theme\'s style.css file. Skins are simply a class given to the HTML list with the name "jcarousel-skin-[skin-name]".') . '

    '; + + $sample = $fieldset; + $sample['#children'] = '
    ' . check_plain($list_html) . '
    ' . highlight_string(" 'tango')); ?>", TRUE); + $output .= theme('fieldset', $sample); + + $output .= $list_html; jcarousel_add('differentskin', array('skin' => 'tango')); - $output .= '

    We can easily change the associated skin by changing the $options[\'skin\'] property.

    '; // Another thing you can do is use the theme('jcarousel') function. $output .= '

    ' . t('Theme function') . '

    '; + $output .= '

    ' . t('The theme(\'jcarousel\') function allows you to easily create the markup and add all the JavaScript to the page in one function call. Like jcarousel_add() the theme function approach can also take options. In this example we create the carousel with the button next event being called when the mouse rolls over the buttons.') . '

    '; $items = array( '', '', @@ -59,17 +107,26 @@ 'buttonNextEvent' => 'mouseover', 'buttonPrevEvent' => 'mouseover', ); + $fieldset['#description'] = t('The following PHP code may be placed in a template file or a module to create a carousel.'); + + $sample = $fieldset; + $sample['#children'] = '
    ' . highlight_string("", TRUE) . '
    '; + $output .= theme('fieldset', $sample); $output .= theme('jcarousel', $items, $options); - $output .= '

    ' . t('The theme function allows you to easily create the markup, and add all the JavaScript to the page in one function call. In this example we create the carousel with the button next event being called when the mouse rolls over the buttons.') . '

    '; // Provide a circular wrap element. $output .= '

    ' . t('Circular wrap') . '

    '; + $output .= '

    ' . t('This example puts the carousel into a circular wrap.') . '

    '; + $options = array( 'wrap' => 'circular', ); + $sample = $fieldset; + $sample['#children'] = '
    ' . highlight_string("", TRUE) . '
    '; + $output .= theme('fieldset', $sample); $output .= theme('jcarousel', $items, $options); + return $output; - break; } }