Permalink
Browse files

Added book plugin to sv list. All it does is choose new view.

  • Loading branch information...
1 parent d79d3aa commit 2ad713e65665687d1ae8eb309621410fce172a16 Jon Sagotsky committed Mar 14, 2012
@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * @class scholar_books
+ *
+ * Extends os_simpleview_list to provide options for books
+ */
+
+class scholar_book extends os_simpleview_list_default {
+ //override the default view
+ function view_settings() {
+ return (object)array('view_name' => 'scholar_books', 'display_id' => 'block_1');
+ }
+
+}
@@ -44,3 +44,23 @@ function scholar_book_views_api() {
'api' => '2',
);
}
+
+/**
+ * Implementation of os_simpleview_list_plugin
+ * Provides book for simpleview list
+ */
+function scholar_book_os_simpleview_list_plugin() {
+ $info = array(
+ 'book' => array(
+ 'content_type' => 'book',
+ 'handler' => array(
+ 'class' => 'scholar_book',
+ 'file' => 'scholar_book.inc',
+ 'path' => drupal_get_path('module', 'scholar_book') . '/plugins/',
+ 'parent' => 'os_simpleview_list_default',
+ )
+ )
+ );
+
+ return $info;
+}
@@ -215,8 +215,8 @@ function os_simpleview_list_simpleview_class_form(&$form, &$form_state) {
$class = $form_state['form_info']['forms'][$step]['class'];
$form_method = $form_state['form_info']['forms'][$step]['form method'];
- $plugin = os_simpleview_list_plugin_load($class); //y u no load? plugin is just default. not name of whole class
- $class_handler = ctools_plugin_get_class($plugin, 'handler');
+ //$plugin = os_simpleview_list_plugin_load($class); //y u no load? plugin is just default. not name of whole class
+ //$class_handler = ctools_plugin_get_class($plugin, 'handler'); //already loaded?
$instance = new $class(); //class_handler()
$default_options = $instance->options_defaults();

0 comments on commit 2ad713e

Please sign in to comment.