Beispiel #1
0
<?php

/**
 * iZAP izap_videos
 *
 * @package Elgg videotizer, by iZAP Web Solutions.
 * @license GNU Public License version 3
 * @Contact iZAP Team "<*****@*****.**>"
 * @Founder Tarun Jangra "<*****@*****.**>"
 * @link http://www.izap.in/
 *
 */
global $CONFIG;
$video = $vars['video'];
$videos = $video->getRelatedVideos();
if ($videos) {
    echo elgg_view_title(elgg_echo('izap_videos:related_videos'));
    echo elgg_view('izap_videos/videos_bunch', array('videos' => $videos));
}
$options['type'] = 'object';
$options['subtype'] = 'izap_videos';
$options['limit'] = 10;
if (is_old_elgg()) {
    $videos = get_entities($options['type'], $options['subtype'], 0, '', $options['subtype']);
} else {
    $videos = elgg_get_entities($options);
}
if ($videos) {
    echo elgg_view_title(elgg_echo('izap_videos:latest'));
    echo elgg_view('izap_videos/videos_bunch', array('videos' => $videos));
}
Beispiel #2
0
/**
 * main function that register everything
 *
 * @global <type> $CONFIG
 */
function init_izap_videos()
{
    global $CONFIG;
    // render this plugin from izap-elgg-bridge now
    if (is_plugin_enabled('izap-elgg-bridge')) {
        func_init_plugin_byizap(array('plugin' => array('name' => GLOBAL_IZAP_VIDEOS_PLUGIN)));
    } else {
        register_error('This plugin needs izap-elgg-bridge');
        disable_plugin(GLOBAL_IZAP_VIDEOS_PLUGIN);
    }
    // for the first time, admin settings are not set so send admin to the setting page, to set the default settings
    if (isadminloggedin() && (int) datalist_get('izap_videos_installtime') == 0) {
        datalist_set('izap_videos_installtime', time());
        forward($CONFIG->wwwroot . 'pg/videos/adminSettings/' . get_loggedin_user()->username . '?option=settings');
    }
    // extend the views
    if (is_callable('elgg_extend_view')) {
        $extend_view = 'elgg_extend_view';
    } else {
        $extend_view = 'extend_view';
    }
    // include the main lib file
    include dirname(__FILE__) . '/lib/izapLib.php';
    // load all the required files
    izapLoadLib_izap_videos();
    // register pagehandler
    register_page_handler('videos', 'pageHandler_izap_videos');
    register_page_handler('izap_videos_files', 'pageHandler_izap_videos_files');
    // register the notification hook
    if (is_callable('register_notification_object')) {
        register_notification_object('object', 'izap_videos', elgg_echo('izap_videos:newVideoAdded'));
    }
    $period = get_plugin_setting('izap_cron_time', GLOBAL_IZAP_VIDEOS_PLUGIN);
    if (isOnserverEnabled() && is_plugin_enabled('crontrigger') && $period != 'none') {
        register_plugin_hook('cron', $period, 'izap_queue_cron');
    }
    // asking group to include the izap_videos
    if (is_callable('add_group_tool_option')) {
        add_group_tool_option('izap_videos', elgg_echo('izap_videos:group:enablevideo'), true);
    }
    // register the notification hook
    if (is_callable('register_notification_object')) {
        register_notification_object('object', 'izap_videos', elgg_echo('izap_videos:newVideoAdded'));
    }
    // skip tags from filteration
    if (is_old_elgg()) {
        //allow some tags for elgg lesser than 1.6
        $CONFIG->allowedtags['object'] = array('width' => array(), 'height' => array(), 'classid' => array(), 'codebase' => array(), 'data' => array(), 'type' => array());
        $CONFIG->allowedtags['param'] = array('name' => array(), 'value' => array());
        $CONFIG->allowedtags['embed'] = array('src' => array(), 'type' => array(), 'wmode' => array(), 'width' => array(), 'height' => array());
    } else {
        $allowed_tags = get_plugin_setting('izapHTMLawedTags', GLOBAL_IZAP_VIDEOS_PLUGIN);
        $CONFIG->htmlawed_config['elements'] = 'object, embed, param, p, img, b, i, ul, li, ol, u, a, s, blockquote, br, strong, em' . ($allowed_tags ? ', ' . $allowed_tags : '');
    }
    run_function_once('izapSetup_izap_videos');
    $extend_view('css', 'izap_videos/css/default');
    $extend_view('metatags', 'izap_videos/js/javascript');
    //$extend_view('profile/menu/links','izap_videos/menu');
    $extend_view('groups/right_column', 'izap_videos/gruopVideos', 1);
    // only if enabled by admin
    if (izapIncludeIndexWidget_izap_videos()) {
        $extend_view('index/righthandside', 'izap_videos/customindexVideos');
    }
    // only if enabled by admin
    if (izapTopBarWidget_izap_videos()) {
        $extend_view('elgg_topbar/extend', 'izap_videos/navBar');
    }
    // finally lets register the object
    register_entity_type('object', 'izap_videos');
}