/**
  * Adds the embed code field to the page.
  * @param $entity
  * @param $displayer
  */
 private function _add_embed_code($entity)
 {
     reason_include_once('classes/media/kaltura/media_work_displayer.php');
     $displayer = new KalturaMediaWorkDisplayer();
     $displayer->set_media_work($entity);
     if ($entity->get_value('av_type') == 'Video') {
         $displayer->set_height('small');
         $embed_markup_small = $displayer->get_display_markup();
         $displayer->set_height('medium');
         $embed_markup_medium = $displayer->get_display_markup();
         $displayer->set_height('large');
         $embed_markup_large = $displayer->get_display_markup();
         if (!empty($embed_markup_small)) {
             $this->_show_embed_item('Small Embedding Code', $embed_markup_small);
             $this->_show_embed_item('Medium Embedding Code', $embed_markup_medium);
             $this->_show_embed_item('Large Embedding Code', $embed_markup_large);
         }
     } else {
         $displayer->set_height('small');
         $embed_markup_small = $displayer->get_display_markup();
         if (!empty($embed_markup_small)) {
             $this->_show_embed_item('Audio Embedding Code', $embed_markup_small);
         }
     }
 }
示例#2
0
function get_feed_as_text($params)
{
    if (!empty($params['type_id'])) {
        $type = new entity($params['type_id']);
        if (!empty($params['feed'])) {
            $feed_file = $params['feed'];
        } elseif ($type->get_value('custom_feed')) {
            $feed_file = str_replace('.php', '', $type->get_value('custom_feed'));
        } else {
            $feed_file = 'default';
            // otherwise use default feed script
        }
        reason_include_once('feeds/' . $feed_file . '.php');
        $feed_class = $GLOBALS['_feed_class_names'][$feed_file];
        if (!empty($params['site_id'])) {
            $site = new entity($params['site_id']);
            $feed = new $feed_class($type, $site);
        } else {
            $feed = new $feed_class($type);
        }
        $feed->set_request_vars($params);
        ob_start();
        $feed->run(false);
        $feed_text = ob_get_contents();
        ob_end_clean();
        if (!empty($feed_text)) {
            return $feed_text;
        }
    }
}
 function run()
 {
     reason_include_once('minisite_templates/modules/magpie/reason_rss.php');
     $rfd = new reasonFeedDisplay();
     $rfd->set_location($this->feed_location, $this->is_remote);
     if (isset($this->disable_cache)) {
         $rfd->set_cache_disable($this->disable_cache);
     }
     if (isset($this->params['display_timestamp'])) {
         $rfd->set_display_timestamp($this->params['display_timestamp']);
     }
     if (isset($this->params['show_entries_lacking_description'])) {
         $rfd->set_show_entries_lacking_description($this->params['show_entries_lacking_description']);
     }
     $rfd->set_page_query_string_key('view_page');
     $rfd->set_search_query_string_key('search');
     if (!empty($this->request['view_page'])) {
         $rfd->set_page($this->request['view_page']);
     }
     if (!empty($this->request['search'])) {
         $rfd->set_search_string($this->request['search']);
     }
     if (!empty($this->params['num_per_page'])) {
         $rfd->set_num_in_nav($this->params['num_per_page']);
     }
     if (!empty($this->params['title'])) {
         $rfd->set_title($this->params['title']);
     }
     echo $rfd->display_feed('nav');
 }
示例#4
0
 function _build_content_manager()
 {
     reason_include_once('content_managers/default.php3');
     $content_handler = $GLOBALS['_content_manager_class_names']['default.php3'];
     if ($this->type_entity->get_value('custom_content_handler')) {
         $include_file = 'content_managers/' . $this->type_entity->get_value('custom_content_handler');
         reason_include_once($include_file);
         if (!empty($GLOBALS['_content_manager_class_names'][$this->type_entity->get_value('custom_content_handler')])) {
             $content_handler = $GLOBALS['_content_manager_class_names'][$this->type_entity->get_value('custom_content_handler')];
         } else {
             trigger_error('Content handler not found in ' . $include_file);
         }
     }
     if (!class_exists($content_handler)) {
         $filename = $this->type_entity->get_value('custom_content_handler') ? $this->type_entity->get_value('custom_content_handler') : 'default.php3';
         trigger_error('Content manager class name provided for ' . $filename . ' (' . $content_handler . ') not found', HIGH);
         die;
     }
     $disco_item = new $content_handler();
     $disco_item->admin_page =& $this->admin_page;
     $disco_item->set_head_items($this->head_items);
     $disco_item->prep_for_run($this->admin_page->site_id, $this->admin_page->type_id, $this->admin_page->id, $this->admin_page->user_id);
     $disco_item->init();
     return $disco_item;
 }
示例#5
0
 function reasonAVDIsplay($displayer = REASON_DEFAULT_AV_DISPLAYER)
 {
     $override = false;
     reason_include_once('classes/av_displayers/' . $displayer . '.php');
     if (empty($GLOBALS['reason_av_displayers'][$displayer])) {
         if (REASON_DEFAULT_AV_DISPLAYER == $displayer) {
             trigger_error('Default AV displayer (' . $displayer . ') did not register itself; giving up.', HIGH);
             return;
         }
         trigger_error($displayer . ' AV displayer did not register itself in the $GLOBALS array. Using default displayer instead (' . REASON_DEFAULT_AV_DISPLAYER . ').');
         $this->reasonAVDIsplay();
         $override = true;
     } elseif (!class_exists($GLOBALS['reason_av_displayers'][$displayer])) {
         if (REASON_DEFAULT_AV_DISPLAYER == $displayer) {
             trigger_error('Default AV displayer class (' . $GLOBALS['reason_av_displayers'][$displayer] . ') does not exist; giving up.', HIGH);
             return;
         }
         trigger_error('Class defined for displayer (' . $GLOBALS['reason_av_displayers'][$displayer] . ') does not exist. Using default displayer (' . REASON_DEFAULT_AV_DISPLAYER . ').');
         $override = true;
     }
     if ($override) {
         $this->reasonAVDIsplay();
         return;
     }
     $this->_displayer = new $GLOBALS['reason_av_displayers'][$displayer]();
 }
示例#6
0
 /**
  * Set the model and view from parameters before we grab the request
  * @author Nathan White
  */
 function pre_request_cleanup_init()
 {
     // check page type for custom model and view
     if (isset($this->params['model'])) {
         $this->model_name = $this->params['model'];
     }
     if (isset($this->params['view'])) {
         $this->view_name = $this->params['view'];
     }
     $model_path = '/minisite_templates/modules/classified/' . $this->model_name . '.php';
     $view_path = '/minisite_templates/modules/classified/' . $this->view_name . '.php';
     if (reason_file_exists($model_path)) {
         reason_include_once($model_path);
     } else {
         trigger_error('The classified module model could not be found at ' . $model_path, FATAL);
     }
     if (reason_file_exists($view_path)) {
         reason_include_once($view_path);
     } else {
         trigger_error('The classified module view could not be found at ' . $view_path, FATAL);
     }
     // initialize the class names
     $model_classname = $GLOBALS['_classified_module_model']['classified/' . $this->model_name];
     $view_classname = $GLOBALS['_classified_module_view']['classified/' . $this->view_name];
     // create the model and pass it some basic info
     $this->model = new $model_classname();
     $this->model->set_site_id($this->site_id);
     $this->model->set_head_items($this->parent->head_items);
     // create the view and pass a reference to the model
     $this->view = new $view_classname();
     $this->view->set_model($this->model);
 }
示例#7
0
 /**
  * Gets the correct class for the given library and module. More documentation to come...
  */
 private static function _construct($entity_or_library, $module, $filename = false, $meta_info = false)
 {
     $library = self::_get_library($entity_or_library);
     if (!$filename) {
         $filename = 'classes/media/' . $library . '/' . $module . '.php';
     }
     if (reason_file_exists($filename)) {
         reason_include_once($filename);
         $classname = self::_convert_to_camel_case($module);
         if ($meta_info) {
             $library_classname = ucfirst($library) . $meta_info . $classname;
         } else {
             $library_classname = ucfirst($library) . $classname;
         }
         if (class_exists($library_classname)) {
             $interface_file = 'classes/media/interfaces/' . $module . '_interface.php';
             if (reason_file_exists($interface_file)) {
                 reason_include_once($interface_file);
                 $class = new $library_classname();
                 $implemented = class_implements($class);
                 if (isset($implemented[$classname . 'Interface'])) {
                     return $class;
                 } else {
                     trigger_error($library_classname . ' must implement ' . $classname . 'Interface.');
                 }
             } else {
                 trigger_error($module . ' interface file does not exist: ' . $interface_file);
             }
         } else {
             trigger_error($module . ' class does not exist: ' . $library_classname);
         }
     } else {
         trigger_error($module . ' file does not exist: ' . $filename);
     }
 }
示例#8
0
 /**
  * Load and configure the appropriate model.
  *
  * Right now we hard code this - it could be made to dynamically look in the model folder.
  */
 final function setup_api()
 {
     if (isset($_GET['type'])) {
         if ($_GET['type'] === 'image') {
             reason_include_once('classes/api/feed/models/image.php');
             $model = new ReasonImageJSON();
             $this->set_model($model);
         } elseif ($_GET['type'] === 'linkTypeList') {
             reason_include_once('classes/api/feed/models/link.php');
             $model = new ReasonLinkTypeListJSON();
             $this->set_model($model);
         } elseif ($_GET['type'] === 'siteList') {
             reason_include_once('classes/api/feed/models/link.php');
             $model = new ReasonSiteListJSON();
             $this->set_model($model);
         } elseif ($_GET['type'] === 'pageList') {
             reason_include_once('classes/api/feed/models/link.php');
             $model = new ReasonPageListJSON();
             $this->set_model($model);
         } elseif ($_GET['type'] == 'assetList') {
             reason_include_once('classes/api/feed/models/link.php');
             $model = new ReasonAssetListJSON();
             $this->set_model($model);
         }
     }
 }
 function run()
 {
     reason_include_once('minisite_templates/modules/magpie/reason_rss.php');
     $rfd = new reasonFeedDisplay();
     $rfd->set_page_query_string_key('view_page');
     $rfd->set_search_query_string_key('search');
     echo $rfd->generate_search();
 }
示例#10
0
 function get_selection_page_set($site_id)
 {
     reason_include_once('minisite_templates/nav_classes/default.php');
     $pages = new MinisiteNavigation();
     $site = new entity($site_id);
     $pages->site_info = $site;
     $pages->init($site_id, id_of('minisite_page'));
     return $this->flatten_page_tree($pages->get_tree_data());
 }
示例#11
0
 function init($args = array())
 {
     parent::init($args);
     // force secure form due to a bug that causes images not to work in unsecure environment
     if (!on_secure_page()) {
         reason_include_once('function_libraries/user_functions.php');
         force_secure_if_available();
     }
 }
示例#12
0
 function get_reason_page_cache()
 {
     if (!isset($this->_reason_page_cache)) {
         reason_include_once('classes/page_cache.php');
         $this->_reason_page_cache = new ReasonPageCache();
         $this->_reason_page_cache->set_site_id($this->admin_page->site_id);
         $this->_reason_page_cache->set_page_id($this->admin_page->id);
     }
     return $this->_reason_page_cache;
 }
 /**
  * run the rewrite rules
  */
 function run()
 {
     $urlm = new url_manager($this->vars['site_id']);
     $urlm->update_rewrites();
     // if a page was just deleted, lets also clear the nav cache for the site
     if ($this->vars['type_id'] == id_of('minisite_page')) {
         reason_include_once('classes/object_cache.php');
         $cache = new ReasonObjectCache($this->vars['site_id'] . '_navigation_cache');
         $cache->clear();
     }
 }
示例#14
0
 protected function _get_template()
 {
     if (!isset($this->template)) {
         reason_include_once('minisite_templates/modules/events_gallery/templates/' . str_replace('../', '', $this->params['template']) . '.php');
         $classname = 'eventsGallery' . ucfirst($this->params['template']) . 'Template';
         if (class_exists($classname)) {
             $this->template = new $classname();
         }
     }
     return $this->template;
 }
示例#15
0
 function pre_request_cleanup_init()
 {
     if (reason_include_once($this->params['form_include']) == false) {
         trigger_error('DiscoModule tried to include a file but failed.  Check your "form_include" setting in the page_types');
     }
     $this->form = new $this->params['form_name']();
     $this->form->add_element('site_id', 'hidden');
     $this->form->add_element('page_id', 'hidden');
     $this->form->set_value('site_id', $this->site_id);
     $this->form->set_value('page_id', $this->page_id);
     $this->form->init();
 }
示例#16
0
/**
 * Get a new session object of the given session class
 * @param string $class
 * @return object
 */
function get_session_factory($class)
{
    switch ($class) {
        case 'Session_Cookie':
            reason_include_once('classes/session_cookie.php');
            break;
        case 'Session_PHP':
            reason_include_once('classes/session_php.php');
            break;
        default:
            trigger_error('The session class requested does not exist', WARNING);
            break;
    }
    return new $class();
}
示例#17
0
 function init()
 {
     if (!$this->_ok_to_run_module()) {
         return;
     }
     reason_include_once('content_previewers/default.php');
     $previewer = $GLOBALS['_content_previewer_class_names']['default.php'];
     $ent = new entity($this->admin_page->id);
     $this->admin_page->title = 'Previewing ' . $ent->get_value('name');
     $type = new entity($this->admin_page->type_id);
     if ($type->get_value('custom_previewer')) {
         reason_include_once('content_previewers/' . $type->get_value('custom_previewer'));
         $previewer = $GLOBALS['_content_previewer_class_names'][$type->get_value('custom_previewer')];
     }
     $this->previewer = new $previewer();
     $this->previewer->init($this->admin_page->id, $this->admin_page);
 }
示例#18
0
 function get_markup($events)
 {
     $ret = '<div id="eventsGalleryModule" class="bigList">' . "\n";
     $ret .= '<ul class="events">' . "\n";
     foreach ($events as $event) {
         $ret .= '<li class="event">' . "\n";
         $ret .= '<a href="' . reason_htmlspecialchars($event->get_url()) . '">' . "\n";
         $ret .= '<span class="imageWrap">' . "\n";
         if ($image = $event->get_image()) {
             reason_include_once('classes/sized_image.php');
             $rsi = new reasonSizedImage();
             $rsi->set_id($image->id());
             $rsi->set_width(280);
             $rsi->set_height(200);
             $url = $rsi->get_url();
             $ret .= '<img src="' . htmlspecialchars($url) . '" alt="' . reason_htmlspecialchars(strip_tags($image->get_value('description'))) . '" width="295" height="200" class="primaryImage" />' . "\n";
         }
         $ret .= '</span>' . "\n";
         $ret .= '<span class="info">' . "\n";
         $ret .= '<span class="meta">' . "\n";
         $ret .= '<em class="currency">' . htmlspecialchars($event->temporal_phrase()) . '</em> / ';
         $ret .= '<span class="dates">' . htmlspecialchars($event->date_range_phrase()) . '</span>' . "\n";
         $ret .= '</span><br />' . "\n";
         $ret .= '<span class="name">' . "\n";
         $ret .= '<strong class="title">';
         $ret .= $event->get_main_title($event);
         if ($sub = $event->get_subtitle($event)) {
             $ret .= ':';
         }
         $ret .= '</strong>';
         if (!empty($sub)) {
             $ret .= '<span class="subtitle">' . $sub . '</span>' . "\n";
         }
         $ret .= '</span>' . "\n";
         $ret .= '</span>' . "\n";
         $ret .= '</a>' . "\n";
         $ret .= '</li>' . "\n";
     }
     $ret .= '</ul>' . "\n";
     $ret .= '</div>' . "\n";
     return $ret;
 }
 /**
  * Adds the embed code field to the page.
  * @param $entity
  * @param $displayer
  */
 private function _add_embed_code($entity)
 {
     reason_include_once('classes/media/vimeo/media_work_displayer.php');
     $displayer = new VimeoMediaWorkDisplayer();
     $displayer->set_media_work($entity);
     $displayer->set_height('small');
     $embed_markup_small = $displayer->get_display_markup();
     $displayer->set_height('medium');
     $embed_markup_medium = $displayer->get_display_markup();
     $displayer->set_height('large');
     $embed_markup_large = $displayer->get_display_markup();
     if (!empty($embed_markup_small)) {
         $this->_show_embed_item('Small Embedding Code', $embed_markup_small);
     }
     if (!empty($embed_markup_medium)) {
         $this->_show_embed_item('Medium Embedding Code', $embed_markup_medium);
     }
     if (!empty($embed_markup_large)) {
         $this->_show_embed_item('Large Embedding Code', $embed_markup_large);
     }
 }
示例#20
0
 function init()
 {
     $this->admin_page->set_show('leftbar', false);
     if (empty($this->admin_page->id)) {
         $this->_not_undeletable_reason = 'no_id_provided';
         return false;
     }
     if (!reason_user_has_privs($this->admin_page->user_id, 'publish')) {
         $this->_not_undeletable_reason = 'insufficient_privileges';
         return false;
     }
     $item = new entity($this->admin_page->id);
     $user = new entity($this->admin_page->user_id);
     if (!$item->user_can_edit_field('state', $user)) {
         $this->_not_undeletable_reason = 'state_field_locked';
         return false;
     }
     if ($item->get_value('state') != 'Deleted') {
         $this->_not_undeletable_reason = 'not_deleted_yet';
         return false;
     }
     reason_update_entity($this->admin_page->id, $this->admin_page->user_id, array('state' => 'Live'), false);
     if ($this->admin_page->type_id == id_of('minisite_page')) {
         // zap nav cache so it reappears.
         reason_include_once('classes/object_cache.php');
         $cache = new ReasonObjectCache($this->admin_page->site_id . '_navigation_cache');
         $cache->clear();
     }
     $manager_site_id = $this->admin_page->site_id;
     if ($item->get_value('type') == id_of('site')) {
         $manager_site_id = $item->id();
     }
     //Updates the rewrites to prevent infinite redirection loop.
     reason_include_once('classes/url_manager.php');
     $urlm = new url_manager($manager_site_id);
     $urlm->update_rewrites();
     $link = unhtmlentities($this->admin_page->make_link(array('cur_module' => 'Lister', 'id' => '', 'state' => 'deleted')));
     header('Location: ' . $link);
     die;
 }
示例#21
0
 function init()
 {
     $this->head_items->add_stylesheet(REASON_ADMIN_CSS_DIRECTORY . 'sharing.css');
     reason_include_once('classes/sharing_filter.php');
     reason_include_once('content_listers/sharing.php');
     $type = new entity($this->admin_page->type_id);
     // save the type entity in an object scope
     $this->rel_type = $type;
     $this->get_views($type->id());
     if (empty($this->views)) {
         //add generic lister if not already present
         $this->views = array();
     } else {
         reset($this->views);
         $c = current($this->views);
         if ($c) {
             $lister = $c->id();
             $this->admin_page->request['lister'] = $lister;
         } else {
             $lister = '';
         }
     }
     $this->admin_page->title = $type->get_value('plural_name') ? $type->get_value('plural_name') : $type->get_value('name');
     if ($icon_url = reason_get_type_icon_url($type, false)) {
         $this->admin_page->title = '<img src="' . $icon_url . '" alt="" /> ' . $this->admin_page->title;
     }
     if ($this->admin_page->is_second_level()) {
         $this->admin_page->set_show('leftbar', false);
     }
     $this->viewer = new sharing_viewer();
     $this->viewer->set_page($this->admin_page);
     if (!isset($lister)) {
         $lister = '';
     }
     $this->viewer->init($this->admin_page->site_id, $type->id(), $lister);
     $this->filter = new sharing_filter();
     $this->filter->set_page($this->admin_page);
     $this->filter->grab_fields($this->viewer->filters);
 }
示例#22
0
 function display_entity()
 {
     $this->start_table();
     // iFrame Preview
     if ($this->_entity->get_value('bug_state') != 'Done') {
         // iFrame Preview
         reason_include_once('function_libraries/URL_History.php');
         $site = $this->_entity->get_owner();
         $es = new entity_selector($site->id());
         $es->add_type(id_of('minisite_page'));
         $es->add_relation('page_node.custom_page = "projects"');
         $es->set_num(1);
         $pages = $es->run_one();
         if (!empty($pages)) {
             $page = current($pages);
             $url = reason_get_page_url($page->id()) . '?item_id=' . $this->_entity->id();
             $this->show_item_default('Public View of Project', '<iframe src="' . $url . '" width="100%" height="400"></iframe>');
             $this->show_item_default('Link to Public View of Project', '<a href="' . $url . '">' . $url . '</a>');
         }
     }
     // Everything Else
     $this->show_all_values($this->_entity->get_values());
     $this->end_table();
 }
示例#23
0
function attach_thumbnail($media_work, $shim)
{
    // create image file in the vimeo temp directory
    $image_url = $shim->get_thumbnail($media_work->get_value('entry_id'));
    if ($image_url) {
        $tmp_path = VimeoShim::get_temp_dir() . 'tmp_thumbnail_' . $media_work->get_value('id');
        $f = fopen($tmp_path, 'w');
        $contents = get_reason_url_contents($image_url);
        fwrite($f, $contents);
        fclose($f);
        $user = new entity($media_work->get_value('created_by'));
        $username = $user->get_value('name');
        // Create a reason entity out of the temp image file
        if (!empty($tmp_path) && file_exists($tmp_path) && $username) {
            if ($id = create_image_entity($media_work, $username)) {
                reason_include_once('content_managers/image.php3');
                $im = new ImageManager();
                $im->thumbnail_width = REASON_STANDARD_MAX_THUMBNAIL_WIDTH;
                $im->thumbnail_height = REASON_STANDARD_MAX_THUMBNAIL_HEIGHT;
                $im->max_width = REASON_STANDARD_MAX_IMAGE_WIDTH;
                $im->max_height = REASON_STANDARD_MAX_IMAGE_HEIGHT;
                $im->load_by_type(id_of('image'), $id, $media_work->get_value('created_by'));
                $im->handle_standard_image($id, $tmp_path);
                $im->create_default_thumbnail($id);
                $values = array();
                foreach ($im->get_element_names() as $element_name) {
                    $values[$element_name] = $im->get_value($element_name);
                }
                reason_update_entity($id, get_user_id($username), $values, false);
                create_relationship($media_work->get_value('id'), $id, relationship_id_of('av_to_primary_image'));
            }
        }
    } else {
        echo date(DATE_RFC822) . ': No thumbnail url found for media work with id ' . $media_work->get_value('entry_id') . "\n";
    }
}
示例#24
0
<?php

reason_include_once('minisite_templates/modules/publication/item_markup_generators/default.php');
class ResponsiveItemMarkupGenerator extends PublicationItemMarkupGenerator
{
    function run()
    {
        $show_related_section = $this->should_show_related_events_section() || $this->should_show_images_section() || $this->should_show_assets_section() || $this->should_show_categories_section();
        $this->markup_string = '';
        $this->markup_string .= '<div class="fullPost';
        $this->markup_string .= $show_related_section ? ' hasRelated' : ' noRelated';
        $this->markup_string .= '">';
        $this->markup_string .= '<div class="primaryContent firstChunk">' . "\n";
        if ($this->should_show_comment_added_section()) {
            $this->markup_string .= '<div class="commentAdded">' . $this->get_comment_added_section() . '</div>' . "\n";
        }
        if ($this->should_show_inline_editing_link()) {
            $this->markup_string .= $this->get_open_inline_editing_section();
        }
        $this->markup_string .= $this->get_title_section();
        if ($this->should_show_date_section()) {
            $this->markup_string .= '<div class="date">' . $this->get_date_section() . '</div>' . "\n";
        }
        if ($this->should_show_author_section()) {
            $this->markup_string .= '<div class="author">' . $this->get_author_section() . '</div>' . "\n";
        }
        if ($this->should_show_social_sharing_section()) {
            $this->markup_string .= '<div class="social top">' . $this->get_social_sharing_section() . '</div>' . "\n";
        }
        if ($this->should_show_media_section()) {
            $this->markup_string .= '<div class="media">' . $this->get_media_section() . '</div>' . "\n";
示例#25
0
<?php

/**
 * Catalog: Subject Page
 *
 * Module for displaying a subject page for a course catalog
 *
 * @author Mark Heiman
 * @since 2014-08-20
 * @package MinisiteModule
 *
 * 
 */
$GLOBALS['_module_class_names']['catalog/' . basename(__FILE__, '.php')] = 'CatalogSubjectPageModule';
reason_include_once('minisite_templates/modules/default.php');
reason_include_once('function_libraries/course_functions.php');
class CatalogSubjectPageModule extends DefaultMinisiteModule
{
    public $cleanup_rules = array('module_api' => array('function' => 'turn_into_string'), 'module_identifier' => array('function' => 'turn_into_string'));
    function init($args = array())
    {
        parent::init($args);
        // If we're in ajax mode, we just return the data and quit the module.
        $api = $this->get_api();
        if ($api && $api->get_name() == 'standalone') {
            if (isset($this->request['subject'])) {
                $this->do_course_lookup($this->request['subject']);
                exit;
            }
            if (isset($this->request['toggle_course'])) {
                echo json_encode($this->do_course_toggle($this->request['toggle_course']));
<?php

/**
 * @package reason
 * @subpackage minisite_modules
 */
/**
 * Include base class & register module with Reason
 */
reason_include_once('minisite_templates/modules/children.php');
$GLOBALS['_module_class_names'][basename(__FILE__, '.php')] = 'ChildrenAndGrandchildrenModule';
/**
 * A minisite module that shows a tree of children, grandchildren, etc. of the
 * current page.
 *
 * Use the parameter max_depth to control how deeply the module shows progeny
 *
 * @todo support thumbnail parameters in the original module.
 * @todo possibly rework so this supports all params of ChildrenModule, extends less ... see children_full_titles.php for example
 */
class ChildrenAndGrandchildrenModule extends ChildrenModule
{
    var $acceptable_params = array('max_depth' => 1, 'use_link_name' => true, 'default_tag' => 'strong', 'depth_to_tag_map' => array(1 => 'h4'), 'show_only_this_branch' => '', 'show_only_pages_in_nav' => false, 'parent_unique_name' => '', 'provide_images' => false, 'randomize_images' => false, 'thumbnail_width' => 0, 'thumbnail_height' => 0, 'thumbnail_crop' => '');
    function run()
    {
        echo '<div id="childrenAndGrandchildren">' . "\n";
        /* If the page has no entries, say so */
        if (empty($this->offspring)) {
            echo 'This page has no children<br />';
        } else {
            echo '<ul class="childrenList">' . "\n";
示例#27
0
<?php

/**
 * If REASON_ENABLE_ENTITY_SANITIZATION is defined, this file defines sanitization settings.
 *
 * The strings used can reference
 *
 * - a native or already included function name (ie. strip_tags or reason_sanitize_html)
 * - the empty string to disable sanitization for a field
 *
 * The keys in $GLOBALS['_reason_entity_sanitization'] are primarily the unique names of types, with two exceptions:
 *
 * - "default" is the sanitization function that will be run in nothing more explicit is defined for a field.
 * - "entity" provides defaults for the fields in the entity table - you could override then on a type by type basis.
 *
 * @todo after reason 4.5 remove "no_tidy" from admin interface and use these rules instead.
 * @todo create sanitization function which parses thor XML and sanitizes the individual fields with HTML purifier.
 * @todo create sanitization function which parses LDAP queries and sanitizes them as appropriate.
 *
 * @package reason
 * @subpackage config
 * @author Nathan White
 */
$GLOBALS['_reason_entity_sanitization'] = array('default' => 'reason_sanitize_html', 'entity' => array('id' => '', 'name' => 'reason_sanitize_html', 'type' => '', 'last_edited_by' => '', 'last_modified' => '', 'unique_name' => '', 'state' => '', 'creation_date' => '', 'no_share' => '', 'new' => '', 'created_by' => ''), 'minisite_page' => array('extra_head_content' => ''), 'form' => array('thor_content' => ''), 'audience_type' => array('audience_filter' => ''), 'group_type' => array('arbitrary_ldap_query' => '', 'ldap_group_filter' => '', 'ldap_group_member_fields' => ''));
if (reason_file_exists('config/entity_sanitization/setup_local.php')) {
    reason_include_once('config/entity_sanitization/setup_local.php');
    if (!empty($GLOBALS['_reason_entity_sanitization_local'])) {
        $GLOBALS['_reason_entity_sanitization'] = array_merge($GLOBALS['_reason_entity_sanitization'], $GLOBALS['_reason_entity_sanitization_local']);
    }
}
示例#28
0
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Upgrade Reason: Asset changes for 4.0 beta 6</title>
</head>

<body>
<?php 
include 'reason_header.php';
include_once CARL_UTIL_INC . 'db/db_selector.php';
reason_include_once('classes/entity_selector.php');
reason_include_once('function_libraries/util.php');
reason_include_once('function_libraries/user_functions.php');
reason_include_once('function_libraries/admin_actions.php');
class assetUpdaterb5b6
{
    var $mode;
    var $reason_user_id;
    var $asset_to_category_details = array('description' => 'Asset to Category', 'directionality' => 'bidirectional', 'connections' => 'many_to_many', 'required' => 'no', 'is_sortable' => 'yes', 'display_name' => 'Assign to Categories', 'display_name_reverse_direction' => 'Assets in this category', 'description_reverse_direction' => 'Assets in this category');
    //type_to_default_view
    function do_updates($mode, $reason_user_id)
    {
        if ($mode != 'run' && $mode != 'test') {
            trigger_error('$mode most be either "run" or "test"');
            return;
        }
        $this->mode = $mode;
        settype($reason_user_id, 'integer');
        if (empty($reason_user_id)) {
示例#29
0
<?php

/**
 * Stub for the 4.0b7_to_4.0b8 update_types upgrade script
 * @package reason
 * @subpackage scripts
 */
include_once 'reason_header.php';
reason_include_once('scripts/upgrade/4.0b7_to_4.0b8/update_types.php');
<?php

include_once 'reason_header.php';
reason_include_once('classes/entity_selector.php');
reason_include_once('classes/upgrade/upgrader_interface.php');
reason_include_once('classes/field_to_entity_table_class.php');
$GLOBALS['_reason_upgraders']['4.4_to_4.5']['structured_page_head_items'] = 'ReasonUpgrader_45_StructuredPageHeadItems';
class ReasonUpgrader_45_StructuredPageHeadItems implements reasonUpgraderInterface
{
    protected $user_id;
    protected $helper;
    public function user_id($user_id = NULL)
    {
        if (!empty($user_id)) {
            return $this->user_id = $user_id;
        } else {
            return $this->user_id;
        }
    }
    /**
     * Get the title of the upgrader
     * @return string
     */
    public function title()
    {
        return 'Add a field for structured head items on pages';
    }
    /**
     * Get a description of what this upgrade script will do
     * 
     * @return string HTML description