<?php

ClassBlogs::require_cb_file('Admin.php');
ClassBlogs::require_cb_file('BasePlugin.php');
/**
 * A plugin that can disable commenting on every post across the entire site.
 *
 * This provides an admin menu option available only to a professor on the admin
 * side of the root blog that allows them to disable commenting on all blogs
 * that are part of the class blog.  This is generally used at the end of the
 * semester to put the blog into a very light lockdown mode.
 *
 * @package ClassBlogs_Plugins
 * @subpackage DisableComments
 * @since 0.1
 */
class ClassBlogs_Plugins_DisableComments extends ClassBlogs_BasePlugin
{
    /**
     * Default options for the plugin.
     *
     * @access protected
     * @var array
     * @since 0.1
     */
    protected $default_options = array('comments_disabled' => false);
    /**
     * Register hooks to preventing commenting.
     */
    function __construct()
    {
<?php

ClassBlogs::require_cb_file('BasePlugin.php');
ClassBlogs::require_cb_file('Settings.php');
ClassBlogs::require_cb_file('Students.php');
ClassBlogs::require_cb_file('Utils.php');
ClassBlogs::require_cb_file('Widget.php');
/**
 * A widget that shows a list of links to every student blog on the site.
 *
 * @package ClassBlogs_Plugins
 * @subpackage StudentBlogListWidget
 * @access private
 * @since 0.1
 */
class _ClassBlogs_Plugins_StudentBlogListWidget extends ClassBlogs_Widget
{
    /**
     * Default options for the student-blogs widget.
     *
     * @access protected
     * @since 0.1
     */
    protected $default_options = array('display' => '%firstname% %lastname%', 'title' => 'Students');
    /**
     * The name of the plugin.
     */
    protected function get_name()
    {
        return __('Student List', 'classblogs');
    }
示例#3
0
<?php

ClassBlogs::require_cb_file('Admin.php');
ClassBlogs::require_cb_file('BasePlugin.php');
ClassBlogs::require_cb_file('Plugins/Aggregation/SitewidePosts.php');
ClassBlogs::require_cb_file('Plugins/Aggregation/SitewideComments.php');
ClassBlogs::require_cb_file('Utils.php');
/**
 * A plugin that tracks the number of words produced each week by students.
 *
 * This provides an admin page available to any admins on the root blog that
 * displays the number of words written by each student over a period of time,
 * drawn from the content of their posts and comments.  The professor is able
 * to set a weekly minimum word count, which influences the display of the
 * word counts shown on the admin page, with word counts falling below the
 * minimum shown differently than those that exceed it.
 *
 * It also provides each student with a dashboard widget that displays their
 * word counts for the current week and the previous one.
 *
 * @package ClassBlogs_Plugins
 * @subpackage WordCounter
 * @since 0.1
 */
class ClassBlogs_Plugins_WordCounter extends ClassBlogs_BasePlugin
{
    /**
     * The default options for the plugin.
     *
     * @access protected
     * @var array
<?php

ClassBlogs::require_cb_file('Admin.php');
ClassBlogs::require_cb_file('Paginator.php');
ClassBlogs::require_cb_file('Students.php');
ClassBlogs::require_cb_file('Utils.php');
ClassBlogs::require_cb_file('Widget.php');
ClassBlogs::require_cb_file('NXTClass.php');
ClassBlogs::require_cb_file('Plugins/Aggregation/SitewidePlugin.php');
ClassBlogs::require_cb_file('Plugins/StudentBlogList.php');
/**
 * A widget that displays a list of recent sitewide comments.
 *
 * A user can change what information about each comment is shown using a simple
 * string that can contain placeholder variables chosen from a list.  An excerpt
 * of the comment can also be displayed, and the total number of comments, as
 * well as the maximum number of comments shown from each blog, can also be
 * controlled via the widget's admin panel.
 *
 * @package ClassBlogs_Plugins_Aggregation
 * @subpackage SitewideCommentsWidget
 * @access private
 * @since 0.1
 */
class _ClassBlogs_Plugins_Aggregation_SitewideCommentsWidget extends ClassBlogs_Widget
{
    /**
     * The length of the comment excerpt in words.
     *
     * @access private
     * @var int
示例#5
0
<?php

ClassBlogs::require_cb_file('Settings.php');
/**
 * NXTClass abstraction functions.
 *
 * This abstraction layer exists primarily to allow the class blogs suite to
 * run either in multisite mode, where each student is given a dedicated blog,
 * or in standard mode, where each student simply has a user account.
 *
 * @package ClassBlogs
 * @subpackage NXTClass
 * @since 0.4
 */
class ClassBlogs_NXTClass
{
    /**
     * Switches to a blog with the given ID.
     *
     * This switches to the given blog when in multisite mode, or does nothing
     * when running a normal installation with only a single blog defined.
     *
     * @param int $blog_id the ID of a blog
     *
     * @since 0.4
     */
    public static function switch_to_blog($blog_id)
    {
        if (function_exists('switch_to_blog')) {
            switch_to_blog($blog_id);
        }
<?php

ClassBlogs::require_cb_file('Admin.php');
ClassBlogs::require_cb_file('BasePlugin.php');
ClassBlogs::require_cb_file('Settings.php');
ClassBlogs::require_cb_file('Utils.php');
ClassBlogs::require_cb_file('NXTClass.php');
/**
 * A plugin that allows a professor to make certain links always appear in
 * a widget shown in the first widgetized area of any student blogs.
 *
 * This plugin provides an admin menu that allows a professor to
 * add unlimited links of their choosing to student blogs.  These links will
 * appear on every student blog as the first widget in the first widgetized
 * area of the theme in use.
 *
 * @package ClassBlogs_Plugins
 * @subpackage StudentBlogLinks
 * @since 0.1
 */
class ClassBlogs_Plugins_StudentBlogLinks extends ClassBlogs_BasePlugin
{
    /**
     * The default options for the plugin.
     *
     * @access protected
     * @var array
     * @since 0.1
     */
    protected $default_options = array('links' => array(), 'title' => 'Class Links');
    /**
<?php

ClassBlogs::require_cb_file('BasePlugin.php');
ClassBlogs::require_cb_file('Utils.php');
ClassBlogs::require_cb_file('NXTClass.php');
ClassBlogs::require_cb_file('Plugins/Aggregation/Settings.php');
/**
 * The base class for any plugin that deals with sitewide data.
 *
 * This provides descended classes with a few utility methods to manipulate
 * sitewide data, a set of methods that are used to properly inject sitewide
 * data into the normal NXTClass loop, some methods that allow for easy
 * management of cached sitewide data, and a list of the names of the tables
 * used to track sitewide data.
 *
 * @package ClassBlogs_Plugins_Aggregation
 * @subpackage SitewidePlugin
 * @since 0.1
 */
abstract class ClassBlogs_Plugins_Aggregation_SitewidePlugin extends ClassBlogs_BasePlugin
{
    /**
     * The names of the sitewide tables.
     *
     * This works similarly to NXTClass's `$nxtdb` global, with each table name
     * being available through a short term that is a property of the `$tables`
     * object.  The available table keys and their natures are as follows:
     *
     *     posts     - a master list of any published posts on any blog on the site
     *     comments  - a master list of all comments left on any blog on the site
     *     tags      - a list of all tags used across the site with usage counts
<?php

ClassBlogs::require_cb_file('Admin.php');
ClassBlogs::require_cb_file('BasePlugin.php');
ClassBlogs::require_cb_file('Http.php');
ClassBlogs::require_cb_file('PluginPage.php');
ClassBlogs::require_cb_file('Schema.php');
ClassBlogs::require_cb_file('Settings.php');
ClassBlogs::require_cb_file('Utils.php');
ClassBlogs::require_cb_file('Widget.php');
ClassBlogs::require_cb_file('NXTClass.php');
ClassBlogs::require_cb_file('Plugins/Aggregation/SitewidePosts.php');
/**
 * A widget that displays the most recent additions to the YouTube class playlist.
 *
 * This widget can be configured to adjust the maximum number of videos displayed
 * in the playlist.
 *
 * @package ClassBlogs_Plugins
 * @subpackage YouTubeClassPlaylistWidget
 * @access private
 * @since 0.1
 */
class _ClassBlogs_Plugins_YouTubeClassPlaylistWidget extends ClassBlogs_Widget
{
    /**
     * Default options for the class playlist widget.
     *
     * @access protected
     * @since 0.1
     */
示例#9
0
<?

ClassBlogs::require_cb_file( 'Schema.php' );

/**
 * Schemata for tables used by the sitewide plugins.
 *
 * These schemata represent the tables that the sitewide plugins use to keep
 * track of the sitewide data.  Some of the tables, such as the comments and
 * posts table, are more or less identical to NXTClass's core comments and posts
 * tables, with the addition of a few ID fields and modified indexes.  Other
 * tables, such as those used to keep track of sitewide tags, adhere less
 * closely to the NXTClass tables.
 *
 * Note that these objects simply represent the table structure.  The actual
 * names of the tables to which these schemata are bound are set via the
 * `ClassBlogs_Plugins_Aggregation_Settings` class.
 *
 * @package ClassBlogs_Plugins_Aggregation
 * @subpackage Schemata
 * @since 0.2
 */
class ClassBlogs_Plugins_Aggregation_Schemata
{

	/**
	 * Get the schema used for the sitewide comments table
	 *
	 * @return ClassBlogs_Schema an instance of the comment schema
	 *
	 * @since 0.2