コード例 #1
0
<?php

/**
 * @package reason
 * @subpackage minisite_modules
 */
/**
 * Include parent class(es)
 */
include_once DISCO_INC . 'disco.php';
include_once CARL_UTIL_INC . 'db/table_admin.php';
/**
 * Register the view with Reason
 */
$GLOBALS['_classified_module_view'][module_basename(__FILE__)] = 'ClassifiedView';
/**
 * The classified view handles HTML generation as well as the standard operations of the Disco Form
 *
 * Extensions of the class can define a method that modifies the display of a field at preview or display as follows
 *
 * get_display_value_field_name($value, &$item, $summary_mode)
 *
 * The base class defines clean_value methods for classified_date_available, datetime, and price to format these appropriately on display
 *
 * @author Nathan White
 */
class ClassifiedView extends Disco
{
    /**
     * SUMMARY AND DETAIL VIEW SETTINGS
     */
コード例 #2
0
ファイル: default.php プロジェクト: hunter2814/reason_package
<?php

/**
 * @package reason
 * @subpackage minisite_modules
 */
/**
 * Include parent class
 */
include_once DISCO_INC . 'disco_db.php';
/**
 * Register form with Reason
 */
$GLOBALS['_custom_form_class_names'][module_basename(__FILE__, '.php')] = 'DefaultCustomForm';
/**
 * DefaultCustomForm is an extension of DiscoDB that sets up a framework for DiscoDB forms used by the form_custom reason module
 * It modifies the DiscoDB init, run, and process methods.
 *
 * A new method pre_init_and_run form is introducted, which typically would set the class variable init_and_run_form, or other intial
 * tasks like adding head items to the page.
 *
 * In the init phase, init_no_form is invoked if the class variable init_and_run_form is set to false.
 *
 * In the run phase, run_no_form is invoked if the class variable init_and_run_form is set to false.
 *
 * In the process phase, the class variable allowable_fields is consulted. If not empty, then only the fields in this array
 * will be updated by the database calls.
 *
 * @deprecated use the standard form module with the DB model
 * @author Nathan White
 */
コード例 #3
0
<?php

/**
 * @package reason
 * @subpackage minisite_modules
 */
/**
 * Include the base class & dependencies, and register the module with Reason
 */
include_once 'reason_header.php';
reason_include_once('minisite_templates/modules/mvc.php');
$GLOBALS['_module_class_names'][module_basename(__FILE__, '.php')] = 'ReasonSocialAccountModule';
/**
 * An MVC based module for presenting social accounts. Currently it does just two things.
 *
 * - Sets a default model and view to display profile links.
 * - Passes the site_id as a configuration parameter to the model.
 *
 * @todo theme customizer integration to pick social icons via theme options.
 *
 * @author Nathan White
 */
class ReasonSocialAccountModule extends ReasonMVCModule
{
    var $model = 'minisite_templates/modules/social_account/models/profile_links.php';
    var $view = 'minisite_templates/modules/social_account/views/profile_links.php';
    // set everything up and get the model data.
    function init($args = array())
    {
        $controller = $this->get_controller();
        $model = $controller->model();
コード例 #4
0
<?php

/**
 * Poll Module
 * @author Amanda Frisbee
 * @package reason
 * @subpackage minisite_modules
 */
/**
 * Include parent and thor classes and register module with Reason
 */
reason_include_once('minisite_templates/modules/default.php');
include_once THOR_INC . 'thor.php';
$GLOBALS['_module_class_names'][module_basename(__FILE__)] = 'PollingGraphModule';
/**
 * A minisite module that converts a form into a poll and displays the results in a pie graph
 *
 * @author Amanda Frisbee
 * @todo lets move database work to init and add a has_content.
 */
class PollingGraphModule extends DefaultMinisiteModule
{
    var $acceptable_params = array('custom_colors' => array('#cb4b4b', '#edc240', '#2f90dc', '#9440ed', '#4da74d'));
    var $sidebar = false;
    var $cleanup_rules = array('show_results' => 'turn_into_int');
    function init($args = array())
    {
        // Add all necessary JavaScript files as head items
        if ($hi =& $this->get_head_items()) {
            $hi->add_javascript(JQUERY_URL, true);
            $hi->add_javascript(REASON_PACKAGE_HTTP_BASE_PATH . 'flot/jquery.flot.js');
コード例 #5
0
ファイル: feature.php プロジェクト: natepixel/reason_package
reason_include_once( 'minisite_templates/modules/default.php' );
reason_include_once('function_libraries/image_tools.php');
reason_include_once( 'classes/sized_image.php' );
reason_include_once( 'classes/av_display.php' );
reason_include_once( 'classes/feature_helper.php' );
reason_include_once( 'minisite_templates/modules/feature/views/default_feature_view.php' );

include_once(CARL_UTIL_INC . 'basic/image_funcs.php');
include_once(CARL_UTIL_INC . 'basic/url_funcs.php');

if (!defined("FEATURE_VIEW_PATH"))
{
	define("FEATURE_VIEW_PATH",'minisite_templates/modules/feature/views/');
}

$GLOBALS[ '_module_class_names' ][ module_basename( __FILE__) ] = 'FeatureModule';

/**
 * The feature module displays entities of the feature type.
 *
 * Requirements for this module:
 *
 * - Works with JavaScript on or off ... though autoplay does require javascript.
 * - Loads a CSS file that hides inactive blocks and satisfies other css requirements - see reason_package/reason_4.0/www/css/feature.css
 * - Loads a javascript file that animates the feature set and makes smooth transitions without page reloads - see reason_package/reason_4.0/www/js/feature.js
 *
 * Supports these parameters:
 *
 * - shuffle - default false. If true, we sort features randomly rather than by sort order
 * - autoplay_timer - default 0 (off). If a positive integer, indicates the time delay between switches
 * - max - default 0 (no max). If positive, designates a maximum number of features to select
コード例 #6
0
<?php

/**
 * @package reason
 * @subpackage minisite_modules
 */
/**
 * Include the parent class & dependencies, and register the module with Reason
 */
reason_include_once('minisite_templates/modules/default.php');
reason_include_once('classes/api/api.php');
$GLOBALS['_module_class_names'][module_basename(__FILE__, '.php')] = 'RandomNumberModule';
/**
 * The random number module displays a random number - and sets up an API that can be used to grab a random number for a page 
 * that uses this module. It is intended to demonstrate best practices for setting up basic ajax functionality for a reason module
 * 
 * There are two ways a page running this module could be asked for a random number:
 *
 * First way - specify the module_api name (random_number) as declared in setup_supported_apis. In this case, the template will 
 * look at the page type, and call run_api on the first instance of the random_number module.
 *
 * eg. http://reason.site.url/path/to/page/?module_api=random_number
 *
 * If we want to target a particular instance of the module, as we would want to do for most use cases that provided some kind 
 * of ajax functionality, we can target the module more specifically by including a module_identifier.
 *
 * eg. http://reason.site.url/path/to/page/?module_api=random_number&module_identifier=module_identifier-mcla-RandomNumberModule-mloc-main_post-mpar-dcca48101505dd86b703689a604fe3c4
 *
 * In the random_number module run method, note that we call the default minisite module method get_api_class_string. That method
 * gives us a string that includes the module_identifier and well as the names of all the module_apis supported by a module.
 *
コード例 #7
0
<?php

/**
 * @package reason
 * @subpackage minisite_modules
 */
/**
 * include dependencies
 */
reason_include_once('minisite_templates/modules/generic3.php');
reason_include_once('minisite_templates/modules/classified/classified_model.php');
/**
 * Register the module with Reason
 */
$GLOBALS['_module_class_names'][module_basename(__FILE__)] = 'ClassifiedModule';
/**
 * The classified module is based upon Generic3, and uses something of an MVC approach to handle various scenarios
 *
 * Both the model and the view can be specified in the page type - the module acts as the controller
 *
 * The model responds to requests for information (ie - categories, classified entities, etc) and is available to view and the controller
 * 
 * @author Nathan White and Dan Ehrenberg
 */
class ClassifiedModule extends Generic3Module
{
    // generic3 variable overrides
    var $type_unique_name = 'classified_type';
    var $use_pagination = true;
    var $use_filters = true;
    var $filter_types = array('category' => array('type' => 'classified_category_type', 'relationship' => 'classified_to_classified_category'));
コード例 #8
0
ファイル: feed.php プロジェクト: hunter2814/reason_package
<?php

/**
 * @package reason
 * @subpackage minisite_modules
 */
/**
 * Include the base class & dependencies, and register the module with Reason
 */
include_once 'reason_header.php';
reason_include_once('minisite_templates/modules/mvc.php');
$GLOBALS['_module_class_names'][module_basename(__FILE__)] = 'ReasonMVCFeedModule';
/**
 * Reason MVC Feed Module
 *
 * Deploy various feeds. In the page type, you should specify a model and view (and possibly a controller).
 *
 * Your model must implement a build method that returns the data.
 * 
 * Your view must implement a get method that returns content.
 *
 * @todo implement refresh capabilities
 *
 * @author Nathan White
 */
class ReasonMVCFeedModule extends ReasonMVCModule
{
    function run()
    {
        echo '<div id="reason_feed">';
        echo $this->content;
コード例 #9
0
/**
 * @package reason
 * @subpackage minisite_modules
 */
/**
 * Include parent class & other utils
 */
reason_include_once('minisite_templates/modules/default.php');
reason_include_once('function_libraries/url_utils.php');
reason_include_once('classes/user.php');
/**
 * Register module with Reason
 */
//$GLOBALS[ '_module_class_names' ][ 'user_settings' ] = 'UserSettingsModule';
$GLOBALS['_module_class_names'][module_basename(__FILE__)] = 'UserSettingsModule';
/**
 * A minisite module to handle user settings.
 *
 * Designed to be easy to expand and configure. Settings to be configured are defined in an array
 * of settings classes.
 *
 * @author Ben Cochran, Nathan White
 */
class UserSettingsModule extends DefaultMinisiteModule
{
    var $user;
    /**
     * When you add a setting, you need to add it to the 'extra_args' array
     * in the cleanup rules so it is allowed to be passed as a query string.
     *
コード例 #10
0
<?php

/**
 * @package reason
 * @subpackage minisite_modules
 */
/**
 * Include parent class and other dependencies
 */
reason_include_once('minisite_templates/modules/default.php');
reason_include_once('function_libraries/file_finders.php');
include_once CARL_UTIL_INC . 'db/table_admin.php';
/**
 * Register module with Reason
 */
$GLOBALS['_module_class_names'][module_basename(__FILE__)] = 'FormCustomMinisiteModule';
/**
 * A module which runs custom discoDB forms - and provides an interface for data viewing and editing of the form contents
 *
 * Typical usage would be to invoke with module on a page type that also passes a parameter custom_form consisting of the
 * custom form filename without the .php extension.
 *
 * An admin form name can also be passed. This form will be used by the table_viewer to customize the adminstrative options
 * that are available, hide/show columns, set comments in editing fields, etc. If an admin form name is not passed, the
 * form will not offer an administrative interface.
 *
 * @deprecated - use form module with appropriate model
 * @author Nathan White
 */
class FormCustomMinisiteModule extends DefaultMinisiteModule
{
コード例 #11
0
<?php

/**
 * @package reason
 * @subpackage minisite_modules
 */
/**
 * Register the model with Reason
 */
$GLOBALS['_classified_module_model'][module_basename(__FILE__)] = 'ClassifiedModel';
include_once TYR_INC . 'email.php';
/**
 * Classified model - primarily returns data. The controlling module and the views may use this model.
 * @author Nathan White
 */
class ClassifiedModel
{
    var $classified_id;
    var $site_id;
    var $head_items;
    var $category_names;
    var $category_names_by_classified_id;
    /**
     * If approval is required, saved entities will be marked at pending
     * @var boolean
     */
    var $classified_requires_approval = false;
    /**
     * If notification is required, notice of new postings will be sent to the 
     * recipient designated by the view. $classified_requires_approval will override
     * this and always send a notification.